:root {
  --bg-page: #0f172a;
  --bg-panel: #1e293b;
  --border-panel: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --amber-shift: #f5b727;
  --lcd-bg: #9cad94;
  --lcd-bg-off: #7c8b75;
  --lcd-ink: #162114;
  --lcd-ink-faint: rgba(22, 33, 20, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 30% 15%, #1e293b 0%, #0b1120 75%);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}

.app-workspace {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Top Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(30, 41, 59, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-panel);
  border-radius: 14px;
  padding: 10px 18px;
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-brand .badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111827;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 6px;
}

.toolbar-brand h1 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e2e8f0;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.shell-selector {
  display: flex;
  background: #0f172a;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #334155;
}

.shell-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shell-btn.active {
  background: #334155;
  color: #f8fafc;
}

.util-btn {
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.util-btn:hover {
  background: #1e293b;
  border-color: #475569;
}

/* Main Stage */
.stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

/* ============================================================
   TI-30X IIS PHYSICAL CHASSIS
   ============================================================ */
.ti-chassis {
  --chassis-outer: #20314d;
  --chassis-outer-dark: #131f33;
  --chassis-bezel: #273c5e;
  --screen-frame: #576d91;
  --shift-color: #f6bd38;

  width: 388px;
  border-radius: 30px 30px 46px 46px;
  padding: 15px 16px 26px;
  background: linear-gradient(160deg, var(--chassis-outer) 0%, var(--chassis-outer-dark) 100%);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.7),
    0 6px 16px rgba(0, 0, 0, 0.5),
    inset 0 2px 3px rgba(255, 255, 255, 0.22),
    inset 0 -6px 12px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: background 0.25s ease;
}

.ti-chassis[data-theme="charcoal"] {
  --chassis-outer: #2b2f36;
  --chassis-outer-dark: #191c21;
  --chassis-bezel: #23272e;
  --screen-frame: #4b5262;
  --shift-color: #f5b82e;
}

.ti-chassis[data-theme="school"] {
  --chassis-outer: #eab308;
  --chassis-outer-dark: #ca8a04;
  --chassis-bezel: #1e314f;
  --screen-frame: #eab308;
  --shift-color: #fbbf24;
}

.chassis-inner-bezel {
  background: linear-gradient(180deg, var(--chassis-bezel) 0%, #162236 100%);
  border-radius: 22px 22px 36px 36px;
  padding: 16px 16px 22px;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.55),
    0 1px 1px rgba(255, 255, 255, 0.12);
}

.ti-chassis[data-theme="charcoal"] .chassis-inner-bezel {
  background: linear-gradient(180deg, #23272e 0%, #15181c 100%);
}

/* Header: Brand + Solar Cell */
.calc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 0 4px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ti-logo-row {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #dce6f5;
}

.ti-map-icon {
  width: 18px;
  height: 17px;
  color: #dce6f5;
}

.ti-name {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #dce6f5;
}

.model-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 2px;
}

.model-name {
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  font-family: "Arial Black", "Helvetica Neue", sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.model-sub {
  font-size: 1.05rem;
  font-weight: 800;
  font-style: italic;
  color: #f5b727;
  letter-spacing: 0.03em;
}

.solar-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.solar-window {
  width: 118px;
  height: 30px;
  background: linear-gradient(180deg, #281b19 0%, #3d2723 50%, #241715 100%);
  border-radius: 5px;
  border: 2px solid #141c29;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.85),
    0 1px 0 rgba(255, 255, 255, 0.18);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  position: relative;
}

.solar-window::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, transparent 45%, rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}

.solar-cell {
  border-right: 1px solid rgba(180, 140, 120, 0.35);
}

.solar-cell:last-child {
  border-right: none;
}

.two-way-label {
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #cbd5e1;
}

/* ============================================================
   2-LINE LCD DISPLAY
   ============================================================ */
.lcd-bezel {
  background: linear-gradient(180deg, var(--screen-frame) 0%, #3a4b66 100%);
  padding: 9px 11px;
  border-radius: 14px;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.25),
    0 3px 6px rgba(0, 0, 0, 0.45);
  margin-bottom: 14px;
}

.ti-chassis[data-theme="school"] .lcd-bezel {
  background: linear-gradient(180deg, #eab308 0%, #ca8a04 100%);
}

.lcd-screen {
  background: linear-gradient(180deg, #95a78d 0%, #a2b49a 18%, #9cad94 100%);
  border-radius: 8px;
  border: 2px solid #2b3528;
  box-shadow:
    inset 0 3px 7px rgba(0, 0, 0, 0.38),
    inset 0 0 18px rgba(45, 62, 40, 0.18);
  padding: 6px 10px 5px;
  min-height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--lcd-ink);
  position: relative;
  transition: background 0.25s ease;
}

.lcd-screen.is-off {
  background: var(--lcd-bg-off);
}

.lcd-screen.is-off * {
  opacity: 0 !important;
}

/* Status Indicators */
.lcd-indicators-top,
.lcd-indicators-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  font-family: "Courier New", Courier, monospace;
}

.lcd-indicators-top {
  justify-content: flex-start;
  border-bottom: 1px solid rgba(22, 33, 20, 0.08);
  padding-bottom: 2px;
}

.lcd-indicators-bottom {
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(22, 33, 20, 0.08);
  padding-top: 2px;
}

.ind {
  opacity: 0.12;
  transition: opacity 0.08s ease;
}

.ind.active {
  opacity: 1;
}

/* Line 1: 11-Character Scrolling Dot-Matrix Line */
.lcd-line1-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  margin-top: 2px;
}

.scroll-ind {
  font-size: 0.66rem;
  width: 11px;
  text-align: center;
  opacity: 0.12;
  font-weight: 900;
}

.scroll-ind.active {
  opacity: 0.95;
}

.scroll-stack {
  display: flex;
  flex-direction: column;
  line-height: 0.85;
  margin: 0 2px;
}

.scroll-stack .scroll-ind {
  font-size: 0.52rem;
}

.lcd-line1 {
  flex: 1;
  font-family: "Courier New", "Lucida Console", Monaco, monospace;
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: pre;
  overflow: hidden;
  color: var(--lcd-ink);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  height: 100%;
}

.lcd-char {
  display: inline-block;
  width: 1ch;
  text-align: center;
  position: relative;
}

.lcd-char.menu-active {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2.5px;
}

.lcd-cursor-under {
  animation: blinkCursor 1s steps(1) infinite;
  border-bottom: 2.5px solid var(--lcd-ink);
}

.lcd-cursor-insert {
  animation: blinkBlock 1s steps(1) infinite;
}

@keyframes blinkCursor {
  0%, 49% {
    border-bottom-color: var(--lcd-ink);
  }
  50%, 100% {
    border-bottom-color: transparent;
  }
}

@keyframes blinkBlock {
  0%, 49% {
    background-color: var(--lcd-ink);
    color: var(--lcd-bg);
  }
  50%, 100% {
    background-color: transparent;
    color: var(--lcd-ink);
  }
}

/* Line 2: 10-Digit 7-Segment Result + 2-Digit Exponent */
.lcd-line2-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  height: 34px;
}

.lcd-vars-ind {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  width: 18px;
}

.lcd-line2 {
  flex: 1;
  text-align: right;
  font-family: "Courier New", "Consolas", monospace;
  font-size: 1.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--lcd-ink);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
  overflow: hidden;
  white-space: nowrap;
}

.lcd-exp {
  min-width: 28px;
  text-align: right;
  font-family: "Courier New", "Consolas", monospace;
  font-size: 0.96rem;
  font-weight: 800;
  padding-left: 3px;
  align-self: flex-start;
  margin-top: 2px;
}

.frac-slash {
  font-size: 0.85em;
  font-weight: 900;
  display: inline-block;
  transform: translateY(1px);
}

/* ============================================================
   KEYPAD LAYOUT (TOP 2x3 + D-PAD & MAIN 7x5 MATRIX)
   ============================================================ */
.keypad-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-keypad-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, auto);
  column-gap: 8px;
  row-gap: 6px;
  align-items: end;
}

.main-keypad-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 8px;
  row-gap: 6px;
  align-items: end;
}

.key-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.shift-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--shift-color);
  letter-spacing: -0.01em;
  line-height: 1.05;
  height: 12px;
  white-space: nowrap;
  text-align: center;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.65);
}

.shift-label sup,
.shift-label sub {
  font-size: 0.72em;
}

/* Base Calculator Button */
.calc-key {
  width: 100%;
  height: 34px;
  border-radius: 7px 7px 9px 9px;
  border: 1px solid rgba(0, 0, 0, 0.7);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.05s ease, box-shadow 0.05s ease, filter 0.1s ease;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.calc-key:hover {
  filter: brightness(1.07);
}

.calc-key:active,
.calc-key.pressed {
  transform: translateY(2px);
}

/* Function Keys (Dark Grey) */
.key-func {
  background: linear-gradient(180deg, #434956 0%, #2d323c 100%);
  color: #f8fafc;
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  box-shadow:
    0 3px 0 #171a20,
    0 4px 5px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.key-func:active,
.key-func.pressed {
  box-shadow:
    0 1px 0 #171a20,
    0 2px 3px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* 2nd Key (Amber Yellow) */
.key-2nd {
  background: linear-gradient(180deg, #f7c339 0%, #d99b16 100%);
  color: #172133;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow:
    0 3px 0 #8c6107,
    0 4px 5px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.key-2nd:active,
.key-2nd.pressed {
  box-shadow:
    0 1px 0 #8c6107,
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* White Number Keys */
.key-num {
  height: 38px;
  background: linear-gradient(180deg, #f8fafc 0%, #dce3ec 100%);
  color: #111827;
  font-size: 1.08rem;
  font-weight: 800;
  border-radius: 8px 8px 11px 11px;
  box-shadow:
    0 3px 0 #8c98a8,
    0 4px 5px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 #ffffff;
}

.key-num.key-neg {
  font-size: 0.9rem;
}

.key-num:active,
.key-num.pressed {
  box-shadow:
    0 1px 0 #8c98a8,
    0 2px 3px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 #ffffff;
}

/* Operator Keys (TI Slate Blue) */
.key-op {
  height: 38px;
  background: linear-gradient(180deg, #5d78a3 0%, #415980 100%);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 8px 8px 11px 11px;
  box-shadow:
    0 3px 0 #263650,
    0 4px 5px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.key-op:active,
.key-op.pressed {
  box-shadow:
    0 1px 0 #263650,
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.key-eq {
  flex-direction: column;
  line-height: 0.95;
  font-size: 1.02rem;
}

.enter-sub {
  font-size: 0.46rem;
  letter-spacing: 0.08em;
  opacity: 0.9;
  font-weight: 800;
}

.key-on {
  height: 38px;
}

/* Lower-half left column function keys match number key height */
.main-keypad-grid > .key-slot:nth-child(n + 16) .key-func {
  height: 38px;
}

/* ============================================================
   4-WAY DIRECTIONAL ROCKER PAD (D-PAD)
   ============================================================ */
.dpad-wrapper {
  grid-column: 4 / 6;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding-top: 6px;
}

.dpad-ring {
  width: 126px;
  height: 86px;
  background: radial-gradient(ellipse at center, #384357 0%, #242b38 75%, #1a202b 100%);
  border-radius: 50%;
  border: 2px solid #131923;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.6),
    inset 0 2px 3px rgba(255, 255, 255, 0.22),
    inset 0 -3px 6px rgba(0, 0, 0, 0.65);
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  overflow: hidden;
}

.dpad-btn {
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 0.72rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s, transform 0.05s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dpad-btn:hover {
  color: #fbbf24;
  background: rgba(255, 255, 255, 0.06);
}

.dpad-btn:active,
.dpad-btn.pressed {
  background: rgba(0, 0, 0, 0.28);
  transform: scale(0.94);
}

.dpad-up {
  grid-column: 2;
  grid-row: 1;
  padding-top: 3px;
}

.dpad-left {
  grid-column: 1;
  grid-row: 2;
  padding-left: 4px;
}

.dpad-center {
  grid-column: 2;
  grid-row: 2;
  border-radius: 50%;
  background: radial-gradient(circle, #1f2633 0%, #2b3446 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.55);
  margin: 3px;
}

.dpad-right {
  grid-column: 3;
  grid-row: 2;
  padding-right: 4px;
}

.dpad-down {
  grid-column: 2;
  grid-row: 3;
  padding-bottom: 3px;
}

/* ============================================================
   COMPANION SIDE PANEL (TAPE, REGISTERS & GUIDE)
   ============================================================ */
.companion-panel {
  flex: 1;
  min-width: 300px;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.companion-panel.hidden {
  display: none;
}

.panel-card {
  background: rgba(30, 41, 59, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-panel);
  border-radius: 14px;
  padding: 16px 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel-header h2 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.panel-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.text-btn {
  background: transparent;
  border: 1px solid #475569;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.text-btn:hover {
  background: #334155;
  color: #ffffff;
}

.tape-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.tape-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 12px 0;
  text-align: center;
}

.tape-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.15s, background 0.15s;
}

.tape-item:hover {
  border-color: #60a5fa;
  background: #17233b;
}

.tape-expr {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.tape-res {
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #fbbf24;
  text-align: right;
}

.mem-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.mem-chip {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.mem-chip span {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
}

.mem-chip strong {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.82rem;
  color: #f8fafc;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.guide-list kbd,
.guide-list code {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.75rem;
  color: #fbbf24;
}

/* ============================================================
   MOBILE BROWSER OPTIMIZATION
   In mobile browsers, only show the calculator so it can easily
   and ergonomically be used inside a phone.
   ============================================================ */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    min-height: 100%;
    height: 100%;
    background: #131f33; /* Matches dark calculator bezel */
  }

  /* Completely hide toolbar and companion panel on phone */
  .toolbar {
    display: none !important;
  }

  .companion-panel {
    display: none !important;
  }

  .app-workspace {
    max-width: 100%;
    width: 100%;
    min-height: 100dvh;
    padding: 0;
    margin: 0;
    gap: 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .stage {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
  }

  .ti-chassis {
    width: 100%;
    max-width: 440px;
    min-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: max(8px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .chassis-inner-bezel {
    border-radius: 20px;
    padding: 12px 10px 16px;
  }
}

/* Compact screens, landscape, or smaller phone viewports (e.g. height <= 760px) */
@media (max-width: 768px) and (max-height: 760px) {
  .ti-chassis {
    padding: max(4px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
  }

  .chassis-inner-bezel {
    padding: 8px 8px 12px;
    border-radius: 14px;
  }

  .calc-header {
    margin-bottom: 6px;
  }

  .solar-window {
    width: 90px;
    height: 22px;
  }

  .model-name {
    font-size: 1.15rem;
  }

  .model-sub {
    font-size: 0.9rem;
  }

  .lcd-bezel {
    padding: 6px 8px;
    margin-bottom: 6px;
    border-radius: 10px;
  }

  .lcd-screen {
    min-height: 78px;
    padding: 4px 6px 3px;
  }

  .lcd-line1 {
    font-size: 1.12rem;
  }

  .lcd-line2 {
    font-size: 1.5rem;
  }

  .keypad-container {
    gap: 4px;
  }

  .top-keypad-grid,
  .main-keypad-grid {
    column-gap: 5px;
    row-gap: 4px;
  }

  .shift-label {
    font-size: 0.54rem;
    height: 10px;
  }

  .calc-key {
    height: 30px;
    font-size: 0.72rem;
  }

  .key-num,
  .key-op,
  .key-on {
    height: 32px;
  }

  .main-keypad-grid > .key-slot:nth-child(n + 16) .key-func {
    height: 32px;
  }

  .dpad-ring {
    width: 102px;
    height: 70px;
  }
}
