/* LCD glyphs are drawn by lcd-display.js, so no display font is needed here */
@import url("https://fonts.cdnfonts.com/css/eurostile-mn");
@import url("https://fonts.cdnfonts.com/css/pirulen");

body {
  margin: 0;
  min-height: 100vh;
  padding: 1.5rem 1rem 3rem;
  box-sizing: border-box;
  background: #0f172a; /* deep slate */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Calculator and the example recorder sit side by side, stacking when narrow */
.workspace {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 2rem;
  width: 100%;
}

body > h2,
body > h5 {
  color: #f2f2f2;
  font-family: Helvetica;
  width: 100%;
  text-align: center;
}

.calculator {
  width: 18rem;
  height: 35rem;
  background: #242321; /* soft near-black charcoal: low-glare, not pure black */
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 100px 30px;
  border-bottom-right-radius: 100px 30px;
  /* stays positioned: the replay pad and nav arrows are absolute children */
  position: relative;
  flex: 0 0 auto;
  padding: 1.5rem;
  color: hsl(225, 20%, 84%);
  font-family: Helvetica;
  box-shadow: 0 0 50px 5px hsla(0, 0%, 0%, 0.5);
}

.model {
  display: block;
  text-align: right;
  /* keeps the casing spacing the removed brand labels used to occupy */
  margin-bottom: 1.7rem;
  font-size: 90%;
  font-style: italic;
  font-family: CMU;
  font-weight: 700;
}

/* The LCD is painted onto a canvas by lcd-display.js. The .indicators,
   .input and .main-display elements stay in the DOM as the source of
   truth for the renderer, but are not themselves visible. */
.screen {
  width: 100%;
  height: 5.2rem;
  background: #97ab96;
  background: linear-gradient(to bottom, #a3b6a0, #8b9f8b 65%, #93a692);
  border-radius: 5px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.45), inset 0 2px 5px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.12);
  margin: 0.8em 0;
  overflow: hidden;
  position: relative;
  border: 2px solid #5a6e5d;
}

.screen .lcd {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* Glass sheen over the finished pixels */
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.04) 22%,
    rgba(255, 255, 255, 0) 45%
  );
}

.screen.off {
  background: linear-gradient(to bottom, #93a695, #849682);
}

/* Not rendered, so innerText reads back exactly what was written */
.screen .indicators,
.screen .input,
.screen .main-display {
  display: none;
}

button {
  text-align: center;
  padding: 5px;
  border: 0 white none;
  box-sizing: border-box;
  color: hsl(225, 20%, 84%);
  position: relative;
  box-shadow: 2px 2px 5px 0 hsla(0, 0%, 0%, 0.75);
  transition: all 0.2s ease;
  cursor: pointer;
}

.simple-button,
.on {
  cursor: pointer;
}
.active {
  top: 2px;
  -webkit-box-shadow: inset 0 1px 0 #ffe5c4b4, inset 0 -3px 0 #161616;
  -moz-box-shadow: inset 0 1px 0 #ffe5c4b4, inset 0 -3pxpx 0 #161616;
  box-shadow: inset 0 1px 0 #ffe5c4b4, inset 0 -3px 0 #161616;
}

table {
  width: 100%;
  border-collapse: collapse;
}

td {
  text-align: center;
}

/* Trimmed to offset the taller LCD, so the replay pad stays aligned */
.modifiers {
  margin: 1.5rem 0 1.15rem 0;
}

.modifiers button {
  width: 2.35rem;
  height: 1.25rem;
  border-radius: 15px;
  position: relative;
  margin-right: 0.75rem;
  background: hsl(221, 14%, 66%);
  background: linear-gradient(to top, hsl(221, 14%, 66%), hsl(221, 14%, 71%));
}

.modifiers button::before,
.modifiers button::after {
  text-transform: uppercase;
}

.mode::before,
.on::before {
  color: hsl(225, 20%, 84%);
}

.shift {
  left: 0;
}

.alpha {
  top: 5px;
}

.mode {
  float: right;
  top: 11px;
}

.on {
  float: right;
  right: 0;
  margin-right: 0.5em !important;
}

.shift::before {
  content: "Shift";
}
.alpha::after {
  content: "Alpha";
}
.mode::before {
  content: "Mode";
  left: -9px;
}
.mode::after {
  content: "CLR";
  right: -9px;
  color: hsl(34, 68%, 72%);
}
.on::before {
  content: "ON";
}

.replay {
  background: linear-gradient(to top, hsl(221, 14%, 66%), hsl(221, 14%, 71%));
  width: 78px;
  height: 70px;
  line-height: 70px;
  position: absolute;
  left: 38%;
  top: 30%;
  border-radius: 125px;
  text-transform: uppercase;
  font-size: 9px;
  text-align: center;
  vertical-align: middle;
  box-shadow: 2px 2px 5px 0 hsla(0, 0%, 0%, 0.75);
}

button.nav {
  position: absolute;
  background: none;
  box-shadow: none;
  width: 26px;
  height: 22px;
  padding: 0;
  font-size: 11px;
  line-height: 22px;
  color: hsl(208, 30%, 22%);
  z-index: 2;
}

/* Replay pad: 78x70px circle at left 38% / top 30% */
.nav.up {
  left: calc(38% + 26px);
  top: calc(30% + 1px);
}

.nav.down {
  left: calc(38% + 26px);
  top: calc(30% + 47px);
}

.nav.left {
  left: calc(38% + 1px);
  top: calc(30% + 24px);
}

.nav.right {
  left: calc(38% + 51px);
  top: calc(30% + 24px);
}

button.nav.active {
  transform: scale(0.85);
}

.function-keys {
  margin: 1.5rem 0 0.75rem 0;
}

.function-keys button {
  background: hsl(198, 39%, 23%);
  background: linear-gradient(to top, hsl(198, 39%, 23%), hsl(198, 39%, 28%));
  font-size: small;
  width: 2.25rem;
  height: 1.5rem;
  border-radius: 5px;
}

.function-keys td {
  padding-bottom: 1rem;
  padding-right: 0.25rem;
}

/* .basic-keys {
} */
.basic-keys button {
  width: 2.5rem;
  height: 1.75rem;
  background: hsl(221, 14%, 66%);
  background: linear-gradient(to top, hsl(221, 14%, 66%), hsl(221, 14%, 71%));
  border-radius: 3px 3px 7px 7px;
}

.basic-keys td {
  padding-bottom: 1rem;
  padding-right: 0.25rem;
}

.basic-keys tr:last-child td {
  padding-bottom: 0;
}

button.pink {
  background: hsl(353, 50%, 70%);
  background: linear-gradient(to top, hsl(353, 50%, 70%), hsl(353, 50%, 75%));
}

button::before,
button::after {
  position: absolute;
  font-size: 9px;
  top: -13px;
  display: block;
  width: 100%;
  display: inline-block;
}

/* shift */
button::before {
  color: hsl(34, 68%, 72%);
  left: 0;
  text-align: left;
}

/* alpha */
button::after {
  color: hsl(353, 50%, 70%);
  right: 0;
  text-align: right;
}

.center-shift::before,
.center-alpha::after {
  text-align: center;
}

.del::before {
  content: "INS";
}
.ac::before {
  content: "OFF";
}
.reciprocal::before {
  content: "x!";
}
.combin::before {
  content: "nPr";
}
.pol::before {
  content: "Rec(";
}
.pol::after {
  content: ":";
}
.cube::before {
  content: "\221b";
}
.frac::before {
  content: "d/c";
}
.pow::before {
  content: "ˣ \221A";
}
.log::before {
  content: "10 ˣ";
}
.ln::before {
  content: "e ˣ";
}
.ln::after {
  content: "e";
}
.minus::before {
  content: "";
}
.minus::after {
  content: "A";
}
.deg::before {
  content: "\2190";
}
.deg::after {
  content: "B";
}
.hyp::after {
  content: "C";
}
.sin::before {
  content: "sin \207b\b9";
}
.cos::before {
  content: "cos \207b\b9";
}
.tan::before {
  content: "tan \207b\b9";
}
.sin::after {
  content: "D";
}
.cos::after {
  content: "E";
}
.tan::after {
  content: "F";
}
.rcl::before {
  content: "STO";
}
.eng::before {
  content: "\2190";
}
.close-paren::after {
  content: "X";
}
.comma::before {
  content: ";";
}
.comma::after {
  content: "Y";
}
.mem-plus::before {
  content: "M-";
}
.mem-plus::after {
  content: "M";
}
.zero::before {
  content: "Rnd";
}
.period::before {
  content: "Ran#";
}
.exp::before {
  content: "\03c0";
}
.ans::before {
  content: "DRG\25ba";
}
.equals::before {
  content: "%";
}
.one::before {
  content: "S-SUM";
  font-size: 8px;
  top: -10px;
}
.two::before {
  content: "S-VAR";
  font-size: 8px;
  top: -10px;
}

/* jazzy 'x' */
/* .reciprocal, .square {} */

/* ---------------------------------------------------------------
   Example recorder
   --------------------------------------------------------------- */
.recorder {
  width: 21rem;
  max-width: 100%;
  box-sizing: border-box;
  align-self: stretch;
  background: #172033;
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 12px;
  padding: 1rem 1.1rem 1.2rem;
  color: hsl(225, 20%, 84%);
  font-family: Helvetica;
  font-size: 13px;
  line-height: 1.45;
}

.recorder [hidden] {
  display: none !important;
}

.rec-heading {
  margin: 0 0 0.9rem 0;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: hsl(34, 68%, 72%);
}

.rec-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.recorder button {
  box-shadow: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.rec-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: hsl(220, 9%, 32%);
  color: hsl(225, 20%, 88%);
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-family: Helvetica;
  font-size: 13px;
}

.rec-btn:hover {
  background: hsl(220, 9%, 38%);
}

.rec-btn.small {
  flex: 1 1 auto;
  justify-content: center;
  padding: 0.45rem 0.5rem;
  font-size: 12px;
}

.rec-btn.ghost {
  background: transparent;
}

.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: hsl(353, 50%, 70%);
}

.recorder.is-recording .rec-btn#rec-toggle {
  background: hsl(353, 40%, 38%);
  border-color: hsl(353, 50%, 55%);
}

.recorder.is-recording .rec-dot {
  animation: rec-pulse 1s infinite;
}

@keyframes rec-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

.rec-count {
  font-size: 12px;
  color: hsl(225, 12%, 62%);
}

.rec-naming {
  margin-bottom: 0.75rem;
}

.rec-naming input {
  width: 100%;
  box-sizing: border-box;
  background: #0f172a;
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 7px;
  padding: 0.5rem 0.6rem;
  color: hsl(225, 20%, 88%);
  font-family: Helvetica;
  font-size: 13px;
}

.rec-naming input:focus {
  outline: 1px solid hsl(34, 68%, 72%);
}

.rec-naming-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.rec-save,
.rec-discard {
  border-radius: 7px;
  padding: 0.45rem 0.9rem;
  font-family: Helvetica;
  font-size: 12.5px;
  border: 1px solid transparent;
}

.rec-save {
  background: hsl(34, 68%, 72%);
  color: #2a1f0d;
}

.rec-discard {
  background: transparent;
  color: hsl(225, 12%, 62%);
  border-color: rgba(226, 232, 240, 0.16);
}

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rec-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #101a2b;
  border: 1px solid rgba(226, 232, 240, 0.08);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

.rec-item .rec-play-name {
  flex: 1;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  color: hsl(225, 20%, 88%);
  font-family: Helvetica;
  font-size: 13px;
}

.rec-item .rec-play-name:hover {
  color: hsl(34, 68%, 72%);
}

.rec-item .rec-steps {
  font-size: 11px;
  color: hsl(225, 12%, 55%);
}

.rec-item .rec-delete {
  background: none;
  border: none;
  padding: 0 0.2rem;
  color: hsl(225, 12%, 55%);
  font-size: 15px;
  line-height: 1;
}

.rec-item .rec-delete:hover {
  color: hsl(353, 50%, 70%);
}

.rec-empty {
  color: hsl(225, 12%, 55%);
  font-size: 12.5px;
  text-align: center;
  padding: 0.4rem 0;
}

.rec-replay {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(226, 232, 240, 0.16);
}

.rec-replay-title {
  color: hsl(34, 68%, 72%);
  font-weight: bold;
  margin-bottom: 0.2rem;
}

.rec-replay-step {
  min-height: 2.6em;
  font-size: 12.5px;
}

.rec-replay-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0.5rem 0 0.7rem;
}

.rec-replay-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(226, 232, 240, 0.2);
}

.rec-replay-dots i.done {
  background: hsl(34, 68%, 72%);
}

.rec-replay-dots i.current {
  background: #fff;
  transform: scale(1.35);
}

.rec-replay-controls {
  display: flex;
  gap: 0.4rem;
}

.rec-hint {
  margin: 1rem 0 0;
  font-size: 11.5px;
  color: hsl(225, 12%, 58%);
}

.rec-hint b {
  color: hsl(225, 20%, 84%);
}

/* Key lit up by the replay */
.calculator button.rec-flash {
  box-shadow: 0 0 0 2px #fff, 0 0 14px 3px rgba(255, 255, 255, 0.6);
}

button span.sup {
  font-size: xx-small !important;
  vertical-align: super;
}

.sub {
  font-size: xx-small;
  vertical-align: bottom;
}

.xxs {
  font-size: xx-small;
}


/* Mobile: scale the ORIGINAL calculator as one complete object.
   No individual buttons, LCD, or Replay-pad dimensions are redesigned. */
@media (max-width: 600px) {
  html, body {
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }
  body {
    display: block;
    position: fixed;
    inset: 0;
  }
  body > h2,
  body > h5,
  .recorder {
    display: none !important;
  }
  .workspace {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: calc(100dvh - 0.5in);
    min-height: 0;
    margin: 0;
    padding: 0;
    display: block;
    overflow: hidden;
  }
  .calculator {
    position: absolute;
    top: 0;
    left: 50%;
    margin: 0;
    flex: none;
    transform-origin: top center;
    /* transform is set by mobile-calculator-scale.js */
  }
}


/* ================================================================
   FX-82MS PAGE SHELL — soft white, muted royal blue and clear text.
   Calculator casing, LCD, key colours, dimensions and key positions
   above this section are intentionally left unchanged.
================================================================ */
:root {
  --page-bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-soft: #F7F9FC;
  --ink: #263449;
  --ink-muted: #526176;
  --ink-soft: #65748A;
  --blue: #315A91;
  --blue-hover: #274A79;
  --blue-soft: #EAF0F7;
  --line: #D9E0E9;
  --success: #34765A;
}

html { color-scheme: light; }
body {
  background: var(--page-bg);
  color: var(--ink);
  padding: 0 24px 18px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

.site-header {
  width: min(100%, 1040px);
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #E4EBF4;
  color: #294D7C;
  font: 700 19px/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: -1px;
}
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { color: #263449; font-size: 14px; font-weight: 700; }
.brand-copy small { color: #526176; font-size: 11px; letter-spacing: .02em; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.ready-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #526176;
  font-size: 12px;
  font-weight: 600;
}
.ready-indicator i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4D8A6B;
  box-shadow: 0 0 0 3px #E5F0E9;
}
.haptics-toggle {
  border: 1px solid #CFD9E6;
  border-radius: 8px;
  padding: 8px 11px;
  background: #FFFFFF;
  color: #34465E;
  font: 600 12px/1.2 Inter, "Segoe UI", Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(31, 48, 70, .04);
}
.haptics-toggle:hover { background: #F2F6FA; border-color: #AEBED1; }
.haptics-toggle:focus-visible,
.text-action:focus-visible,
.history-action:focus-visible,
.recorder button:focus-visible,
.keyboard-panel summary:focus-visible {
  outline: 3px solid rgba(49, 90, 145, .28);
  outline-offset: 2px;
}

.page-main { width: 100%; }
.page-intro {
  width: min(100%, 1040px);
  margin: 25px auto 22px;
  text-align: center;
}
.page-intro h1 {
  margin: 0;
  color: #263449;
  font-size: clamp(23px, 2.4vw, 29px);
  line-height: 1.2;
  letter-spacing: -.65px;
  font-weight: 700;
}
.page-intro p {
  margin: 7px 0 0;
  color: #526176;
  font-size: 13px;
}
.workspace {
  width: min(100%, 1040px);
  margin: 0 auto;
  gap: 28px;
  align-items: flex-start;
}
.side-panels {
  width: 340px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 0 1 340px;
}
.recorder,
.history-panel,
.keyboard-panel {
  width: 100%;
  box-sizing: border-box;
  align-self: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  box-shadow: 0 2px 9px rgba(35, 52, 73, .045);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
.recorder { padding: 17px 18px; font-size: 13px; }
.rec-heading,
.utility-heading {
  margin: 0 0 12px;
  color: #304F78;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.rec-btn {
  background: #EAF0F7;
  border: 1px solid #D5DFEB;
  color: #2D4F7C;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
}
.rec-btn:hover { background: #DFE8F2; color: #233F65; }
.rec-dot { background: #6686AE; }
.recorder.is-recording .rec-btn#rec-toggle {
  background: #F8E9E9;
  border-color: #E7CACA;
  color: #8A3E42;
}
.recorder.is-recording .rec-dot { background: #B9575D; }
.rec-count { color: #526176; }
.rec-naming input {
  background: #FFFFFF;
  border: 1px solid #C9D4E1;
  color: #263449;
  font: 13px Inter, "Segoe UI", Arial, sans-serif;
}
.rec-naming input::placeholder { color: #78869A; }
.rec-naming input:focus { outline: 2px solid rgba(49, 90, 145, .25); border-color: #6686AE; }
.rec-save { background: #315A91; color: #FFFFFF; font-family: inherit; font-weight: 600; }
.rec-save:hover { background: #274A79; }
.rec-discard { color: #526176; border-color: #D5DFE9; font-family: inherit; }
.rec-item { background: #F7F9FC; border-color: #E2E7EE; }
.rec-item .rec-play-name { color: #304F78; font-family: inherit; }
.rec-item .rec-play-name:hover { color: #1F3F6B; }
.rec-item .rec-steps { color: #65748A; }
.rec-item .rec-delete { color: #758298; }
.rec-item .rec-delete:hover { color: #A4444B; }
.rec-empty { color: #526176; }
.rec-replay { border-top-color: #DCE3EC; }
.rec-replay-title { color: #304F78; }
.rec-replay-step { color: #35465D; }
.rec-replay-dots i { background: #D7DFE9; }
.rec-replay-dots i.done { background: #6686AE; }
.rec-replay-dots i.current { background: #315A91; }
.rec-hint { color: #526176; line-height: 1.55; }
.rec-hint b { color: #304F78; }

.history-panel { padding: 16px 17px; }
.panel-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.utility-heading { margin-bottom: 2px; }
.panel-subtitle { margin: 0 0 11px; color: #65748A; font-size: 11.5px; }
.text-action {
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: #315A91;
  font: 600 12px Inter, "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}
.text-action:hover { color: #1F3F6B; text-decoration: underline; }
.text-action:disabled { color: #A0AABA; cursor: default; text-decoration: none; }
.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 265px; overflow: auto; }
.history-empty { margin: 0; padding: 12px 8px; color: #65748A; font-size: 12px; text-align: center; }
.history-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #E3E8EF;
  border-radius: 8px;
  background: #FAFBFD;
}
.history-values { min-width: 0; }
.history-expression { color: #47566B; font-size: 12px; overflow-wrap: anywhere; }
.history-result { margin-top: 2px; color: #263F61; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.history-time { display: block; margin-top: 3px; color: #78869A; font-size: 10px; }
.history-actions { display: flex; flex-shrink: 0; gap: 5px; }
.history-action {
  border: 1px solid #D5DFEA;
  border-radius: 6px;
  padding: 5px 7px;
  background: #FFFFFF;
  color: #315A91;
  font: 600 10.5px Inter, "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}
.history-action:hover { background: #EAF0F7; }
.history-action.secondary { color: #526176; }

.keyboard-panel { padding: 0; overflow: hidden; }
.keyboard-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 17px;
  cursor: pointer;
  list-style: none;
}
.keyboard-panel summary::-webkit-details-marker { display: none; }
.keyboard-panel summary span:first-child { display: grid; gap: 2px; }
.keyboard-panel summary strong { color: #304F78; font-size: 13px; }
.keyboard-panel summary small { color: #65748A; font-size: 11px; }
.summary-chevron { color: #65748A; font-size: 20px; transition: transform .15s ease; }
.keyboard-panel[open] .summary-chevron { transform: rotate(180deg); }
.shortcut-grid { padding: 0 17px 12px; border-top: 1px solid #E6EBF1; }
.shortcut-row {
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #EEF1F5;
  color: #526176;
  font-size: 11.5px;
}
.shortcut-row:last-child { border-bottom: 0; }
kbd {
  display: inline-block;
  margin-left: 3px;
  padding: 2px 6px;
  border: 1px solid #D4DCE7;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #F7F9FC;
  color: #34465E;
  font: 600 10px/1.4 Inter, "Segoe UI", Arial, sans-serif;
  white-space: nowrap;
}
.shortcut-note { margin: 3px 17px 14px; color: #65748A; font-size: 10.5px; line-height: 1.45; }

.site-footer {
  width: min(100%, 1040px);
  margin: 28px auto 0;
  padding: 13px 0 5px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: #526176;
  font-size: 10.5px;
}
.footer-version { color: #526176; font-weight: 600; }

@media (max-width: 850px) and (min-width: 601px) {
  body { padding-left: 16px; padding-right: 16px; }
  .workspace { gap: 20px; }
  .side-panels { width: min(340px, 100%); flex-basis: 300px; }
}

/* Keep the established mobile full-screen calculator experience intact. */
@media (max-width: 600px) {
  body { background: #F3F5F8; }
  .site-header, .page-intro, .side-panels, .site-footer { display: none !important; }
  .workspace { width: 100%; }
}


/* Shared model viewport: both models occupy the exact original FX-82MS box. */
#fx991-frame {
  display: block;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}
.calculator {
  overflow: hidden;
}
.calculator.is-fx991 {
  /* Do not change width, height, padding, or position when switching models. */
  background: transparent;
  box-shadow: none;
}
.calculator.is-fx991 > :not(#fx991-frame) {
  display: none !important;
}
.calculator.is-fx991 #fx991-frame {
  visibility: visible;
  pointer-events: auto;
}

/* Opening sequence: CASIO intro -> model cards -> the existing workspace. */
.intro-screen,
.selector-screen {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #f5f7fb;
  background: radial-gradient(ellipse at 50% 42%, #263447 0%, #171f2c 38%, #0d1119 100%);
  transition: transform .85s cubic-bezier(.77,0,.18,1), opacity .65s ease;
}
.intro-screen::before,
.intro-screen::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215,231,250,.28), transparent);
}
.intro-screen::before { top: 18%; }
.intro-screen::after { bottom: 18%; }
.intro-content {
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  transform: translateY(-2vh);
}
.intro-mark {
  font-size: clamp(54px, 11vw, 112px);
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1;
}
.intro-rule {
  width: min(280px, 55vw);
  height: 2px;
  margin: 24px 0 18px;
  background: linear-gradient(90deg, transparent, #b7cbe2, transparent);
}
.intro-content p {
  margin: 0;
  font-size: 12px;
  letter-spacing: .38em;
  color: #d5e1ee;
  font-weight: 700;
}
.intro-caption { margin-top: 13px; color: #8192a8; font-size: 13px; }
.enter-button {
  margin-top: 48px;
  border: 1px solid rgba(224,237,252,.35);
  border-radius: 30px;
  background: rgba(255,255,255,.045);
  color: #e8f0f9;
  padding: 12px 24px;
  font-size: 11px;
  letter-spacing: .2em;
  cursor: pointer;
}
.enter-button span { margin-left: 12px; font-size: 15px; }
.intro-bottom {
  position: absolute;
  bottom: 28px;
  left: 0; right: 0;
  text-align: center;
  color: #69798d;
  font-size: 9px;
  letter-spacing: .24em;
}
.intro-bottom span { padding: 0 9px; color: #c1d2e6; }
body.intro-dismissed .intro-screen { transform: translateY(-100%); opacity: .95; pointer-events: none; }
.selector-screen {
  position: fixed;
  inset: 0;
  z-index: 2900;
  display: none;
  flex-direction: column;
  padding: 0 clamp(20px, 5vw, 76px);
  color: #f5f7fb;
  background: radial-gradient(ellipse at 50% 15%, #1e2a3a 0%, #111722 55%, #0d1118 100%);
}
.selector-screen[hidden] { display: none !important; }
body.selector-open .selector-screen { display: flex; }
body.launcher-locked > .site-header,
body.launcher-locked > .page-main,
body.launcher-locked > .site-footer { display: none !important; }
.selector-header {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  flex: 0 0 auto;
}
.mini-brand { display:flex; align-items:center; gap:13px; font-size:10px; letter-spacing:.2em; color:#9eafc4; white-space:nowrap; }
.mini-mark { font-size:19px; letter-spacing:.06em; font-weight:900; color:#f3f6fa; }
.header-line { height:1px; flex:1; background:linear-gradient(90deg,rgba(220,235,251,.18),transparent); }
.selector-content { width:min(900px,100%); margin:auto; padding:26px 0; text-align:center; }
.eyebrow { font-size:10px; letter-spacing:.3em; color:#8ea4bd; font-weight:700; margin:0 0 12px; }
.selector-content h1 { font-size:clamp(27px,4vw,42px); letter-spacing:-.04em; margin:0; font-weight:650; color:#f5f7fb; }
.selector-subtitle { font-size:13px; color:#9aa9bb; margin:12px 0 26px; }
.model-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; text-align:left; }
.model-card {
  min-width:0; min-height:370px; position:relative; display:flex; flex-direction:column;
  align-items:center; padding:20px 22px 19px; border:1px solid rgba(213,230,249,.16);
  border-radius:19px; background:linear-gradient(145deg,rgba(255,255,255,.075),rgba(255,255,255,.018));
  color:#f5f7fb; cursor:pointer; overflow:hidden; transition:transform .25s,border-color .25s,box-shadow .25s;
}
.model-card:hover { transform:translateY(-4px); border-color:rgba(215,232,251,.48); box-shadow:0 18px 50px rgba(0,0,0,.25); }
.card-index { align-self:flex-start; font-size:9px; letter-spacing:.18em; color:#8294aa; }
.photo-wrap { height:245px; width:100%; display:grid; place-items:center; margin:8px auto; position:relative; }
.model-photo {
  display:block; width:auto; height:168px; max-width:78%; object-fit:contain;
  filter:drop-shadow(0 14px 15px rgba(0,0,0,.42));
  transition:transform .25s ease, filter .25s ease;
}
.model-card:hover .model-photo { transform:translateY(-3px) scale(1.035); filter:drop-shadow(0 18px 18px rgba(0,0,0,.5)); }
.card-copy { display:flex; flex-direction:column; align-items:center; gap:6px; }
.card-copy strong { font-size:17px; }
.card-copy span { font-size:11px; color:#99a8ba; }
.card-open {
  margin-top:18px; padding-top:13px; width:100%; border-top:1px solid rgba(255,255,255,.1);
  display:flex; justify-content:space-between; align-items:center; font-size:9px;
  letter-spacing:.17em; color:#c2d3e5; font-weight:700;
}
.card-open b { font-size:17px; font-weight:400; }
.selector-footer {
  height:48px; flex:0 0 auto; border-top:1px solid rgba(255,255,255,.12);
  display:flex; align-items:center; justify-content:space-between; color:#65758a;
  font-size:9px; letter-spacing:.18em;
}
/* Back navigation sits at the far left of the workspace, not in the header. */
.back-to-models {
  position: fixed;
  z-index: 120;
  top: 86px;
  left: max(14px, calc((100vw - 1220px) / 2));
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  color: #263b57;
  background: #ffffff;
  border: 1px solid #c6d2e1;
  border-radius: 8px;
  box-shadow: 0 2px 7px rgba(26, 43, 64, .10);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.back-to-models:hover {
  color: #142b49;
  background: #eaf0f7;
  border-color: #9fb2ca;
}
.back-to-models:focus-visible {
  outline: 3px solid rgba(49, 90, 145, .28);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .selector-screen { padding:0 16px; }
  .selector-header { height:48px; }
  .selector-content { padding:10px 0; display:flex; flex-direction:column; justify-content:center; min-height:0; }
  .eyebrow { font-size:8px; margin-bottom:5px; }
  .selector-content h1 { font-size:clamp(21px,5vw,27px); }
  .selector-subtitle { font-size:10px; margin:5px 0 10px; }
  .model-grid { grid-template-columns:1fr; gap:9px; }
  .model-card {
    min-height:0; height:clamp(205px,34dvh,275px); padding:10px 13px;
    border-radius:13px; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    grid-template-rows:22px 1fr 25px; column-gap:10px; align-items:center;
  }
  .card-index { grid-column:1/-1; grid-row:1; font-size:7px; }
  .photo-wrap { grid-column:1; grid-row:2; height:100%; max-height:190px; margin:0; min-height:0; }
  .photo-placeholder { width:80px; height:130px; font-size:7px; }
  .photo-placeholder strong { font-size:10px; }
  .card-copy { grid-column:2; grid-row:2; align-items:flex-start; text-align:left; gap:5px; }
  .card-copy strong { font-size:clamp(12px,3.4vw,16px); }
  .card-copy span { font-size:9px; }
  .card-open { grid-column:1/-1; grid-row:3; margin:0; padding-top:6px; font-size:7px; }
  .selector-footer { height:30px; font-size:6px; letter-spacing:.1em; }
  .intro-mark { font-size:60px; }
  .intro-content p { font-size:9px; }
  .enter-button { margin-top:32px; }
}
@media (max-width:370px) {
  .selector-screen { padding:0 10px; }
  .selector-header { height:42px; }
  .selector-content { padding:5px 0; }
  .selector-subtitle { margin-bottom:7px; }
  .model-card { height:clamp(185px,32dvh,225px); padding:8px 9px; }
  .selector-footer { height:25px; }
}
@media (max-height:650px) and (max-width:700px) {
  .selector-header { height:38px; }
  .selector-content { padding:4px 0; }
  .selector-content h1 { font-size:20px; }
  .selector-subtitle { margin:4px 0 6px; }
  .model-card { height:calc((100dvh - 150px)/2); min-height:150px; }
  .photo-placeholder { height:110px; }
  .selector-footer { height:24px; }
}


/* Clear, high-contrast model switcher in the top application bar. */
.site-header { justify-content:space-between; }

/* Shared sliding lid: copied from the FX-991ES PLUS original cover design.
   It starts fully closed, holds for one second, then slides down to reveal either model. */
.calculator { isolation:isolate; }
#calc-cover {
  position:absolute; inset:0; z-index:30;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.026) 0%, transparent 24%, transparent 76%, rgba(0,0,0,0.24) 100%),
    linear-gradient(180deg, #202125 0%, #17181c 52%, #0e0f12 100%);
  border-radius:31px 31px 38px 38px;
  overflow:hidden; pointer-events:none;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.08), inset 0 -3px 8px rgba(0,0,0,0.82);
  will-change:transform;
  transform:translateY(0);
  visibility:hidden;
}
#calc-cover::before {
  content:""; position:absolute; inset:7px;
  border-radius:25px 25px 32px 32px;
  border:1px solid rgba(255,255,255,0.03);
  box-shadow:inset 0 1px 2px rgba(255,255,255,0.035), inset 0 -1px 2px rgba(0,0,0,0.55);
}
#calc-cover::after {
  content:""; position:absolute; left:0; right:0; top:0; height:24%;
  background:linear-gradient(180deg, rgba(255,255,255,0.035), transparent);
}
#calc-cover .cover-dot {
  position:absolute; width:10.5px; height:10.5px; border-radius:50%;
  background:radial-gradient(circle at 36% 30%, #050506 0%, #101116 58%, #24262b 100%);
  box-shadow:inset 0 1.5px 2px rgba(0,0,0,0.95), inset 0 -1px 1px rgba(255,255,255,0.16), 0 1px 0 rgba(255,255,255,0.05);
}
#calc-cover .cover-dot.tl { top:12px; left:12px; }
#calc-cover .cover-dot.tr { top:12px; right:12px; }
#calc-cover .cover-dot.bl { bottom:12px; left:12px; }
#calc-cover .cover-dot.br { bottom:12px; right:12px; }
#calc-cover .cover-brand {
  position:absolute; top:20%; left:50%; transform:translate(-50%,-50%);
  font-family:'CasioBrand','Arial Black',sans-serif; font-weight:700;
  font-size:22px; letter-spacing:2.5px; color:#111216;
  text-shadow:0 1px 1px rgba(255,255,255,0.12), 0 -1px 1.5px rgba(0,0,0,0.95);
}
.calculator.is-switching #calc-cover { visibility:visible; }
/* The lid is already closed at the beginning of each switch. */
.calculator.cover-opening #calc-cover {
  transform:translateY(103%);
  transition:transform .75s cubic-bezier(.42,0,.2,1);
}

/* Keep the shutter visible above either active calculator, including FX-991. */
.calculator.is-fx991 > :not(#fx991-frame):not(#calc-cover) { display:none !important; }
@media(max-width:600px) {
  .workspace {
    top:42px;
    height:calc(100dvh - 42px - 0.5in);
  }
}
