/* ============================================================================
   SOLVEPOP KIDS v14.9.0 — Copyright (c) 2026 SolvePop — PROTECTED STYLESHEET RULES (WCAG AA + RESEND FEEDBACK EDITION)
   1. DO NOT remove .hidden, [data-skin], [data-calc-shape], [data-bg-pattern], or [data-btn-shape].
   2. KEEP all CSS custom properties intact for Skin Studio & WCAG contrast.
   3. All interactive controls maintain >= 44px minimum touch target size.
   4. ZERO inline styles required (100% strict CSP compatible).
   ============================================================================ */

/* Self-Hosted SIL Open Font License (OFL 1.1) Lato — Zero External CDN Calls, 100% CSP & Offline Safe */
@font-face {
  font-family: "CalcClue Sans";
  src: url("fonts/lato-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "CalcClue Sans";
  src: url("fonts/lato-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "CalcClue Sans";
  src: url("fonts/lato-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-page: #fef7e6;
  --bg-card: #ffffff;
  --bg-casing: #2563eb;
  --casing-border: #1d4ed8;
  --casing-highlight: rgba(255, 255, 255, 0.28);
  --casing-label: #ffffff;
  --casing-glow: rgba(37, 99, 235, 0.22);
  --screen-bg: #e0f2fe;
  --screen-text: #0f172a;
  --screen-border: rgba(15, 23, 42, 0.14);
  --btn-num: #ffffff;
  --btn-num-text: #0f172a;
  --btn-op: #b45309;
  --btn-op-text: #ffffff;
  --btn-util: #e2e8f0;
  --btn-util-text: #0f172a;
  --btn-paren: #cbd5e1;
  --btn-paren-text: #0f172a;
  --btn-eq: #047857;
  --btn-eq-text: #ffffff;
  --accent: #c2410c;
  --accent-text: #ffffff;
  --quiz-accent: #6d28d9;
  --quiz-tint: rgba(109, 40, 217, 0.1);
  --status-ok: #047857;
  --status-warn: #b45309;
  --status-err: #b91c1c;
  --text-main: #1e293b;
  --text-muted: #475569;
  --card-border: rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --btn-radius: 14px;
  --pattern-tint: rgba(37, 99, 235, 0.09);
  --font-display: "CalcClue Sans", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  --font-main: "CalcClue Sans", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

/* Skin 2: 8-Bit Arcade (Free) */
body[data-skin="arcade"] {
  --bg-page: #0f0e17;
  --bg-card: #1a1829;
  --bg-casing: #232136;
  --casing-border: #e11d48;
  --casing-highlight: rgba(0, 245, 212, 0.25);
  --casing-glow: rgba(225, 29, 72, 0.32);
  --screen-bg: #07111a;
  --screen-text: #00f5d4;
  --screen-border: rgba(0, 245, 212, 0.35);
  --btn-num: #2a273f;
  --btn-num-text: #fffffe;
  --btn-op: #be185d;
  --btn-op-text: #ffffff;
  --btn-util: #393552;
  --btn-util-text: #f8fafc;
  --btn-paren: #44415a;
  --btn-paren-text: #f8fafc;
  --btn-eq: #0369a1;
  --btn-eq-text: #ffffff;
  --accent: #e11d48;
  --accent-text: #ffffff;
  --quiz-accent: #7e22ce;
  --quiz-tint: rgba(168, 85, 247, 0.18);
  --status-ok: #34d399;
  --status-warn: #fbbf24;
  --status-err: #fb7185;
  --text-main: #fffffe;
  --text-muted: #cbd5e1;
  --card-border: rgba(0, 245, 212, 0.16);
  --radius: 8px;
  --btn-radius: 5px;
  --pattern-tint: rgba(0, 245, 212, 0.09);
  --font-display: "Consolas", "Courier New", monospace;
  --font-main: "Consolas", "Courier New", monospace;
  color-scheme: dark;
}

body[data-skin="arcade"] .calc-screen {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 245, 212, 0.05) 0px,
    rgba(0, 245, 212, 0.05) 2px,
    transparent 2px,
    transparent 5px
  );
  text-shadow: 0 0 10px rgba(0, 245, 212, 0.35);
}

/* Skin 3: Space Mission (Pro) */
body[data-skin="space"] {
  --bg-page: #0b132b;
  --bg-card: #16203d;
  --bg-casing: #2d4263;
  --casing-border: #5bc0be;
  --casing-highlight: rgba(111, 255, 233, 0.3);
  --casing-glow: rgba(91, 192, 190, 0.28);
  --screen-bg: #050b18;
  --screen-text: #6fffe9;
  --screen-border: rgba(111, 255, 233, 0.3);
  --btn-num: #1c284a;
  --btn-num-text: #ffffff;
  --btn-op: #c2410c;
  --btn-op-text: #ffffff;
  --btn-util: #263659;
  --btn-util-text: #f1f5f9;
  --btn-paren: #324670;
  --btn-paren-text: #f1f5f9;
  --btn-eq: #0f766e;
  --btn-eq-text: #ffffff;
  --accent: #0f766e;
  --accent-text: #ffffff;
  --quiz-accent: #0369a1;
  --quiz-tint: rgba(56, 189, 248, 0.16);
  --status-ok: #5eead4;
  --status-warn: #fcd34d;
  --status-err: #fda4af;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --card-border: rgba(91, 192, 190, 0.2);
  --radius: 26px;
  --btn-radius: 999px;
  --pattern-tint: rgba(111, 255, 233, 0.16);
  color-scheme: dark;
}

body[data-skin="space"] .calc-casing {
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(91, 192, 190, 0.35), inset 0 2px 0 var(--casing-highlight);
}

/* Skin 4: Dino Lab (Pro) */
body[data-skin="dino"] {
  --bg-page: #ecfdf5;
  --bg-card: #ffffff;
  --bg-casing: #15803d;
  --casing-border: #14532d;
  --casing-highlight: rgba(254, 240, 138, 0.32);
  --casing-glow: rgba(21, 128, 61, 0.22);
  --screen-bg: #fef3c7;
  --screen-text: #451a03;
  --screen-border: rgba(180, 83, 9, 0.24);
  --btn-num: #fefce8;
  --btn-num-text: #365314;
  --btn-op: #b45309;
  --btn-op-text: #ffffff;
  --btn-util: #dcfce7;
  --btn-util-text: #14532d;
  --btn-paren: #bbf7d0;
  --btn-paren-text: #14532d;
  --btn-eq: #3f6212;
  --btn-eq-text: #ffffff;
  --accent: #15803d;
  --accent-text: #ffffff;
  --quiz-accent: #b45309;
  --quiz-tint: rgba(180, 83, 9, 0.1);
  --status-ok: #15803d;
  --status-warn: #b45309;
  --status-err: #b91c1c;
  --text-main: #14532d;
  --text-muted: #3f6212;
  --card-border: rgba(21, 128, 61, 0.14);
  --radius: 22px;
  --btn-radius: 20px 6px 20px 6px;
  --pattern-tint: rgba(22, 163, 74, 0.1);
  color-scheme: light;
}

/* Skin 5: Ninja Dojo (Pro) */
body[data-skin="ninja"] {
  --bg-page: #18181b;
  --bg-card: #242428;
  --bg-casing: #7f1d1d;
  --casing-border: #450a0a;
  --casing-highlight: rgba(253, 224, 71, 0.32);
  --casing-glow: rgba(185, 28, 28, 0.32);
  --screen-bg: #09090b;
  --screen-text: #fde047;
  --screen-border: rgba(253, 224, 71, 0.35);
  --btn-num: #3f3f46;
  --btn-num-text: #fafafa;
  --btn-op: #b45309;
  --btn-op-text: #ffffff;
  --btn-util: #52525b;
  --btn-util-text: #fafafa;
  --btn-paren: #71717a;
  --btn-paren-text: #ffffff;
  --btn-eq: #991b1b;
  --btn-eq-text: #ffffff;
  --accent: #b45309;
  --accent-text: #ffffff;
  --quiz-accent: #a16207;
  --quiz-tint: rgba(234, 179, 8, 0.15);
  --status-ok: #4ade80;
  --status-warn: #fde047;
  --status-err: #fca5a5;
  --text-main: #fafafa;
  --text-muted: #d4d4d8;
  --card-border: rgba(253, 224, 71, 0.14);
  --radius: 12px;
  --btn-radius: 8px;
  --pattern-tint: rgba(253, 224, 71, 0.08);
  color-scheme: dark;
}

body[data-skin="ninja"] .calc-casing {
  border-top: 3px solid rgba(253, 224, 71, 0.45);
}

/* Skin 6: Ocean Explorer (Pro) */
body[data-skin="ocean"] {
  --bg-page: #ecfeff;
  --bg-card: #ffffff;
  --bg-casing: #0e7490;
  --casing-border: #155e75;
  --casing-highlight: rgba(165, 243, 252, 0.35);
  --casing-glow: rgba(14, 116, 144, 0.24);
  --screen-bg: #cffafe;
  --screen-text: #083344;
  --screen-border: rgba(14, 116, 144, 0.22);
  --btn-num: #f0f9ff;
  --btn-num-text: #0c4a6e;
  --btn-op: #0369a1;
  --btn-op-text: #ffffff;
  --btn-util: #e0f2fe;
  --btn-util-text: #0c4a6e;
  --btn-paren: #bae6fd;
  --btn-paren-text: #0c4a6e;
  --btn-eq: #0f766e;
  --btn-eq-text: #ffffff;
  --accent: #0e7490;
  --accent-text: #ffffff;
  --quiz-accent: #0369a1;
  --quiz-tint: rgba(2, 132, 199, 0.11);
  --status-ok: #047857;
  --status-warn: #b45309;
  --status-err: #b91c1c;
  --text-main: #083344;
  --text-muted: #155e75;
  --card-border: rgba(14, 116, 144, 0.14);
  --radius: 24px;
  --btn-radius: 999px;
  --pattern-tint: rgba(14, 116, 144, 0.09);
  color-scheme: light;
}

/* Button Shape Overrides (used by Skin Studio) */
body[data-btn-shape="rounded"] {
  --radius: 20px;
  --btn-radius: 14px;
}

body[data-btn-shape="pill"] {
  --radius: 26px;
  --btn-radius: 999px;
}

body[data-btn-shape="blocky"] {
  --radius: 8px;
  --btn-radius: 5px;
}

body[data-btn-shape="gem"] {
  --radius: 22px;
  --btn-radius: 20px 6px 20px 6px;
}

/* Shared Background Patterns (used by both the main page and the Skin Studio mini-preview) */
:is(body, .studio-preview-stage)[data-bg-pattern="solid"] {
  background-color: var(--bg-page);
  background-image: none;
}

:is(body, .studio-preview-stage)[data-bg-pattern="grid"] {
  background-color: var(--bg-page);
  background-image:
    linear-gradient(to right, var(--pattern-tint) 1px, transparent 1px),
    linear-gradient(to bottom, var(--pattern-tint) 1px, transparent 1px);
  background-size: 26px 26px;
}

:is(body, .studio-preview-stage)[data-bg-pattern="dots"] {
  background-color: var(--bg-page);
  background-image: radial-gradient(var(--pattern-tint) 2.5px, transparent 2.5px);
  background-size: 22px 22px;
}

:is(body, .studio-preview-stage)[data-bg-pattern="stars"] {
  background-color: var(--bg-page);
  background-image:
    radial-gradient(var(--pattern-tint) 2.2px, transparent 2.2px),
    radial-gradient(var(--pattern-tint) 1.5px, transparent 1.5px);
  background-size: 38px 38px;
  background-position: 0 0, 19px 19px;
}

:is(body, .studio-preview-stage)[data-bg-pattern="stripes"] {
  background-color: var(--bg-page);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 14px,
    var(--pattern-tint) 14px,
    var(--pattern-tint) 28px
  );
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

body {
  font-family: var(--font-main);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  padding: 14px 16px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.top-bar, .beta-free-banner, .skin-bar, .workspace, .trial-banner, .app-footer {
  max-width: 1060px;
  margin: 0 auto 12px auto;
}

/* Header & Brand Emblem */
.top-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 2px solid var(--card-border);
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

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

.brand-emblem {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.brand-lens-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.emblem-ring { fill: var(--bg-casing); }
.emblem-glass { fill: var(--screen-bg); }
.emblem-glint { fill: none; stroke: #ffffff; stroke-width: 3; stroke-linecap: round; opacity: 0.7; }
.emblem-handle { stroke: var(--casing-border); stroke-width: 7; stroke-linecap: round; }

.brand-badge {
  position: relative;
  z-index: 1;
  font-size: 1.25rem;
  transform: translate(-2px, -2px);
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand-kicker {
  background: var(--bg-page);
  color: var(--accent);
  border: 1.5px solid var(--accent);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 999px;
}

.subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.controls-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Minimum 44px Touch Targets for Child-Friendly Accessibility */
button, select, .buy-link-btn, .back-link-btn {
  min-height: 44px;
}

.dev-toggle-btn {
  background: #fef3c7;
  color: #78350f;
  border: 2px dashed #d97706;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  touch-action: manipulation;
}

.dev-toggle-btn.dev-on {
  background: #dcfce7;
  color: #14532d;
  border-color: #15803d;
}

.install-btn, .profile-pill-btn {
  background: var(--bg-page);
  color: var(--text-main);
  border: 2px solid var(--card-border);
  padding: 6px 13px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  touch-action: manipulation;
}

.pill-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.install-btn {
  border-color: #2563eb;
}

.star-counter, .control-pill {
  background: var(--bg-page);
  padding: 0 12px;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--card-border);
}

.control-pill select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.studio-launch-btn {
  background: var(--bg-page);
  color: var(--text-main);
  border: 2px solid var(--accent);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.studio-launch-btn:hover {
  background: var(--accent);
  color: var(--accent-text);
}

.trial-banner {
  background: #fef3c7;
  color: #78350f;
  border: 2px solid #d97706;
  padding: 8px 16px;
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 0.9rem;
}

/* Theme Strip With Swatches */
.skin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  background: var(--bg-card);
  border: 2px solid var(--card-border);
  padding: 8px 14px;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.skin-label {
  font-weight: 800;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: 2px;
}

.skin-btn, .unlock-cta {
  border: 2px solid transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--bg-page);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  touch-action: manipulation;
  user-select: none;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.skin-btn:hover {
  transform: translateY(-1px);
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.sw-classroom { background: #2563eb; }
.sw-arcade { background: #e11d48; }
.sw-space { background: #0f766e; }
.sw-dino { background: #15803d; }
.sw-ninja { background: #991b1b; }
.sw-ocean { background: #0e7490; }

.skin-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.skin-btn small {
  background: var(--accent);
  color: var(--accent-text);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.unlock-cta {
  margin-left: auto;
  background: var(--accent);
  color: var(--accent-text);
  padding: 7px 15px;
}

.unlock-cta.pro-active {
  background: #047857;
  color: #ffffff;
}

@media (max-width: 680px) {
  .unlock-cta {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

/* Workspace Layouts */
.workspace {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 26px;
  align-items: start;
  padding-top: 10px;
}

.workspace-single {
  grid-template-columns: 1fr;
  max-width: 780px;
}

@media (max-width: 840px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

/* Tactile Physical Calculator Casing */
.calc-casing {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-casing);
  border-top: 2px solid var(--casing-highlight);
  border-bottom: 8px solid var(--casing-border);
  padding: 16px 18px 20px;
  border-radius: var(--radius);
  box-shadow: 0 16px 32px var(--casing-glow), 0 6px 12px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-radius 0.25s ease;
}

.casing-top-trim {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 6px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.casing-model-tag {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--casing-label);
}

.casing-vents {
  display: flex;
  gap: 5px;
}

.casing-vents span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.25);
}

.calc-screen {
  background: var(--screen-bg);
  color: var(--screen-text);
  border: 3px solid var(--screen-border);
  padding: 14px 16px;
  border-radius: calc(var(--radius) * 0.68);
  text-align: right;
  margin-bottom: 16px;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.18), 0 2px 0 rgba(255, 255, 255, 0.2);
}

.equation-preview {
  font-size: 0.94rem;
  font-weight: 700;
  opacity: 0.85;
  min-height: 1.35em;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

.main-display {
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1.15;
  overflow-x: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.key {
  background: var(--btn-num);
  color: var(--btn-num-text);
  border: none;
  border-top: 2px solid rgba(255, 255, 255, 0.45);
  border-bottom: 5px solid rgba(0, 0, 0, 0.28);
  border-radius: var(--btn-radius);
  padding: 13px 6px;
  font-size: 1.28rem;
  font-weight: 900;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: transform 0.08s ease, border-bottom-width 0.08s ease, opacity 0.2s ease, filter 0.2s ease;
}

.key:hover {
  filter: brightness(1.04);
}

.key:active {
  transform: translateY(3px);
  border-bottom-width: 2px;
}

.key-op {
  background: var(--btn-op);
  color: var(--btn-op-text);
  font-size: 1.45rem;
}

.key-util, .key-sign {
  background: var(--btn-util);
  color: var(--btn-util-text);
}

.key-paren {
  background: var(--btn-paren);
  color: var(--btn-paren-text);
}

.key-sign {
  font-size: 1.08rem;
}

.key-quiz {
  background: var(--quiz-accent);
  color: #ffffff;
  font-size: 0.94rem;
}

.key-eq {
  grid-column: span 3;
  background: var(--btn-eq);
  color: var(--btn-eq-text);
  font-size: 1.05rem;
  padding: 13px 10px;
}

/* Visual Quiz Mode Guard — Dim & recess blocked operator/paren keys */
.calc-casing.quiz-mode .key-op,
.calc-casing.quiz-mode .key-paren {
  opacity: 0.36;
  filter: saturate(0.35);
  border-bottom-width: 2px;
  transform: translateY(2px);
}

.calc-casing.quiz-mode .key-op[data-op="-"] {
  opacity: 0.62;
  filter: saturate(0.7);
}

/* Clue Board & Original SVG Mascot */
.teaching-board {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 2px solid var(--card-border);
  padding: 20px 22px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
  min-height: 492px;
  display: flex;
  flex-direction: column;
}

.board-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--card-border);
}

.board-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mini-svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

/* Original "Clue" Mascot Styling & Reactive Moods */
.clue-mascot {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.mascot-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mascot-handle { stroke: var(--casing-border); stroke-width: 7; stroke-linecap: round; }
.mascot-rim { fill: var(--bg-casing); }
.mascot-face { fill: var(--screen-bg); }
.mascot-cap { fill: var(--accent); }
.mascot-brim { fill: var(--casing-border); }
.mascot-cap-btn { fill: #fbbf24; }
.mascot-shine { fill: none; stroke: #ffffff; stroke-width: 2.5; stroke-linecap: round; opacity: 0.7; }
.mascot-eye { fill: var(--screen-text); }
.mascot-spark { fill: var(--screen-bg); opacity: 0.9; }

.mouth-curious, .mouth-happy, .mouth-thinking, .mouth-oops {
  display: none;
}

.clue-mascot[data-mood="curious"] .mouth-curious {
  display: block;
  fill: none;
  stroke: var(--screen-text);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.clue-mascot[data-mood="happy"] .mouth-happy {
  display: block;
  fill: var(--screen-text);
}

.clue-mascot[data-mood="thinking"] .mouth-thinking {
  display: block;
  stroke: var(--screen-text);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.clue-mascot[data-mood="oops"] .mouth-oops {
  display: block;
  fill: none;
  stroke: var(--screen-text);
  stroke-width: 2.4;
}

@keyframes mascotCheer {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  35% { transform: translateY(-6px) rotate(-6deg); }
  70% { transform: translateY(-2px) rotate(5deg); }
}

.clue-mascot[data-mood="happy"] {
  animation: mascotCheer 0.55s ease;
}

.clue-mascot[data-mood="thinking"] {
  transform: rotate(-7deg);
}

.board-title-wrap h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.15;
}

.mascot-caption {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.board-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speak-btn {
  background: var(--bg-page);
  color: var(--text-main);
  border: 2px solid var(--card-border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.speak-btn.speaking {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.speech-status {
  background: #fef3c7;
  color: #78350f;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.mode-tag {
  background: var(--accent);
  color: var(--accent-text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Quiz Banner (Theme-Aware) */
.quiz-banner {
  background: var(--quiz-tint);
  border: 2px solid var(--quiz-accent);
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
}

.quiz-top-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.quiz-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.streak-pill {
  background: #fef3c7;
  color: #78350f;
  border: 1.5px solid #d97706;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.quiz-controls select {
  padding: 6px 10px;
  border-radius: 10px;
  border: 2px solid var(--quiz-accent);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.82rem;
}

.mini-btn {
  background: var(--quiz-accent);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hint-btn {
  background: #b45309;
  color: #ffffff;
}

.quiz-advance-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1.5px dashed var(--quiz-accent);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.quiz-advance-note {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.quiz-continue-btn {
  border: none;
  border-radius: 12px;
  padding: 8px 18px;
  font-weight: 900;
  font-size: 0.92rem;
  cursor: pointer;
  grid-column: auto;
}

@keyframes stepSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-card {
  background: var(--bg-page);
  padding: 12px 15px;
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  margin-bottom: 10px;
  line-height: 1.52;
  animation: stepSlideIn 0.25s ease both;
}

.step-card:nth-child(2) { animation-delay: 0.08s; }
.step-card:nth-child(3) { animation-delay: 0.16s; }
.step-card:nth-child(4) { animation-delay: 0.24s; }
.step-card:nth-child(5) { animation-delay: 0.32s; }

.step-card.speaking-active {
  box-shadow: 0 0 0 3px var(--accent);
  transform: scale(1.01);
}

.step-card.final-card {
  border-left-color: var(--status-ok);
}

.step-card.error-card {
  border-left-color: var(--status-err);
}

.welcome-lead {
  font-size: 0.96rem;
  line-height: 1.45;
}

.sample-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.sample-chip {
  background: var(--bg-page);
  color: var(--text-main);
  border: 2px solid var(--accent);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, background-color 0.15s ease;
}

.sample-chip:hover {
  background: var(--accent);
  color: var(--accent-text);
  transform: translateY(-1px);
}

.compact-tips {
  padding-left: 20px;
  line-height: 1.65;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Visual Manipulatives Stage (SVG Number Line, Base-10, Area Model, PEMDAS Ladder) */
.visual-stage {
  margin-top: 8px;
  margin-bottom: 12px;
  padding: 14px 16px;
  background: var(--bg-page);
  border: 2px solid var(--card-border);
  border-radius: 14px;
}

.visual-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.visual-row {
  font-size: 1.3rem;
  letter-spacing: 4px;
  margin: 4px 0;
}

.faded-counters {
  opacity: 0.32;
}

.manip-svg {
  width: 100%;
  max-width: 540px;
  height: auto;
  display: block;
}

.nl-axis { stroke: var(--text-muted); stroke-width: 3; stroke-linecap: round; }
.nl-tick { stroke: var(--text-muted); stroke-width: 2.5; }
.nl-zero { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 4 3; }
.nl-arc-1 { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.nl-arc-2 { fill: none; stroke: var(--btn-eq); stroke-width: 3.5; stroke-linecap: round; }
.nl-dot-start { fill: var(--bg-casing); stroke: #ffffff; stroke-width: 2; }
.nl-dot-mid { fill: var(--accent); stroke: #ffffff; stroke-width: 2; }
.nl-dot-end { fill: var(--btn-eq); stroke: #ffffff; stroke-width: 2.5; }
.nl-label { fill: var(--text-main); font-size: 14px; font-weight: 800; font-family: var(--font-display); }
.nl-hop-label { fill: var(--accent); font-size: 13px; font-weight: 900; font-family: var(--font-display); }
.nl-hop-label-2 { fill: var(--btn-eq); font-size: 13px; font-weight: 900; font-family: var(--font-display); }

.area-box-tens { fill: var(--screen-bg); stroke: var(--bg-casing); stroke-width: 2.5; }
.area-box-ones { fill: var(--bg-card); stroke: var(--accent); stroke-width: 2.5; }
.area-side-lbl { fill: var(--text-main); font-size: 14px; font-weight: 900; font-family: var(--font-display); }
.area-inner-eq { fill: var(--screen-text); font-size: 14px; font-weight: 900; font-family: var(--font-display); }
.chunk-box-1 { fill: var(--screen-bg); stroke: var(--bg-casing); stroke-width: 2.5; }
.chunk-box-2 { fill: var(--bg-card); stroke: var(--accent); stroke-width: 2.5; }
.chunk-txt-1 { fill: var(--screen-text); font-size: 13.5px; font-weight: 900; font-family: var(--font-display); }
.chunk-txt-2 { fill: var(--text-main); font-size: 13.5px; font-weight: 900; font-family: var(--font-display); }
.chunk-total-lbl { fill: var(--text-muted); font-size: 12.5px; font-weight: 800; font-family: var(--font-display); }
.area-inner-eq-2 { fill: var(--text-main); font-size: 14px; font-weight: 900; font-family: var(--font-display); }

.b10-rod { fill: var(--bg-casing); stroke: rgba(255, 255, 255, 0.5); stroke-width: 1; }
.b10-cube { fill: var(--accent); stroke: rgba(255, 255, 255, 0.45); stroke-width: 1; }
.b10-rod-b { fill: var(--btn-eq); stroke: rgba(255, 255, 255, 0.5); stroke-width: 1; }
.b10-cube-b { fill: var(--quiz-accent); stroke: rgba(255, 255, 255, 0.45); stroke-width: 1; }
.b10-lbl { fill: var(--text-main); font-size: 13px; font-weight: 800; }

.pemdas-ladder {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ladder-rung {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}

.ladder-step-tag {
  background: var(--bg-card);
  border: 1.5px solid var(--card-border);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.ladder-highlight {
  background: var(--accent);
  color: var(--accent-text);
  padding: 2px 7px;
  border-radius: 7px;
}

.ladder-final {
  background: var(--btn-eq);
  color: var(--btn-eq-text);
  padding: 3px 10px;
  border-radius: 8px;
}

/* Collectible Sticker Shelf + Progress Bar */
.sticker-shelf {
  margin-top: auto;
  padding-top: 14px;
  border-top: 2px dashed var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shelf-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.shelf-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.shelf-title {
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--text-main);
}

.next-goal-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sticker-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--bg-page);
  appearance: none;
}

.sticker-progress::-webkit-progress-bar {
  background: var(--bg-page);
  border-radius: 999px;
}

.sticker-progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.sticker-progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.cert-mini-btn {
  background: var(--bg-page);
  color: var(--text-main);
  border: 2px solid var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.sticker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sticker-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 12px;
  background: var(--bg-page);
  border: 2px dashed var(--card-border);
  opacity: 0.48;
  filter: grayscale(1);
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.sticker-badge.earned {
  opacity: 1;
  filter: none;
  border: 2px solid var(--accent);
  background: var(--bg-card);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
}

.sticker-badge.earned:nth-child(odd) {
  transform: rotate(-1deg);
}

.sticker-badge.earned:nth-child(even) {
  transform: rotate(1deg);
}

/* Footer */
.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 6px 0 18px;
}

.app-footer a, .footer-link-btn {
  color: var(--text-main);
  font-weight: 800;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

/* Theme-Aware Status Text Classes (High WCAG Contrast on Light & Dark Skins) */
.status-ok { color: var(--status-ok); }
.status-warn { color: var(--status-warn); }
.status-err { color: var(--status-err); }

/* 16 Distinct Confetti Drop Tracks (Zero Overlap) */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 90;
}

@keyframes confettiDrop {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(540deg); opacity: 0; }
}

.confetti-piece {
  position: absolute;
  top: 0;
  font-size: 1.45rem;
  animation: confettiDrop 1.5s ease-out forwards;
}

.confetti-p0  { left: 4%;  animation-delay: 0.00s; }
.confetti-p1  { left: 10%; animation-delay: 0.12s; }
.confetti-p2  { left: 16%; animation-delay: 0.04s; }
.confetti-p3  { left: 22%; animation-delay: 0.22s; }
.confetti-p4  { left: 28%; animation-delay: 0.08s; }
.confetti-p5  { left: 34%; animation-delay: 0.28s; }
.confetti-p6  { left: 40%; animation-delay: 0.15s; }
.confetti-p7  { left: 47%; animation-delay: 0.02s; }
.confetti-p8  { left: 53%; animation-delay: 0.25s; }
.confetti-p9  { left: 60%; animation-delay: 0.10s; }
.confetti-p10 { left: 66%; animation-delay: 0.30s; }
.confetti-p11 { left: 72%; animation-delay: 0.06s; }
.confetti-p12 { left: 78%; animation-delay: 0.19s; }
.confetti-p13 { left: 84%; animation-delay: 0.03s; }
.confetti-p14 { left: 90%; animation-delay: 0.26s; }
.confetti-p15 { left: 95%; animation-delay: 0.14s; }

.hidden {
  display: none !important;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-card {
  background: var(--bg-card);
  border: 2px solid var(--card-border);
  max-width: 490px;
  width: 100%;
  padding: 22px 24px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.36);
  max-height: 92dvh;
  overflow-y: auto;
}

.studio-card, .pro-modal-card, .cert-modal-card {
  max-width: 580px;
  text-align: left;
}

.studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.icon-close-btn {
  background: var(--bg-page);
  border: 2px solid var(--card-border);
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-main);
}

.studio-sub {
  margin: 6px 0 12px !important;
  font-size: 0.88rem;
}

/* Live Embedded Mini-Calculator Preview Inside Skin Studio */
.studio-preview-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 12px;
  background-color: var(--bg-page);
  border: 2px solid var(--card-border);
}

/* Miniature tile scaling for the Skin Studio preview box (inherits gradients from shared rules above) */
.studio-preview-stage[data-bg-pattern="grid"] { background-size: 16px 16px; }
.studio-preview-stage[data-bg-pattern="dots"] { background-size: 14px 14px; }
.studio-preview-stage[data-bg-pattern="stars"] { background-size: 24px 24px; background-position: 0 0, 12px 12px; }

.mini-calc-preview {
  background: var(--bg-casing);
  border-bottom: 4px solid var(--casing-border);
  border-radius: calc(var(--radius) * 0.7);
  padding: 8px;
  width: 150px;
  flex-shrink: 0;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.16);
}

.mini-screen {
  background: var(--screen-bg);
  color: var(--screen-text);
  border-radius: 6px;
  padding: 4px 7px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.mini-expr { font-size: 0.65rem; opacity: 0.8; }
.mini-val { font-size: 0.95rem; }

.mini-keys-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.mini-k {
  background: var(--btn-num);
  color: var(--btn-num-text);
  border-radius: var(--btn-radius);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 4px 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.25);
}

.mini-k-op {
  background: var(--btn-op);
  color: var(--btn-op-text);
}

.mini-k-eq {
  background: var(--btn-eq);
  color: var(--btn-eq-text);
}

.mini-board-preview {
  flex: 1;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-badge-title {
  font-weight: 900;
  font-size: 0.92rem;
  color: var(--text-main);
}

.mini-counters {
  font-size: 1.25rem;
  letter-spacing: 3px;
}

.studio-presets-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.preset-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
}

.preset-chip, .saved-theme-chip {
  background: var(--bg-page);
  color: var(--text-main);
  border: 1.5px solid var(--card-border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.preset-chip:hover {
  border-color: var(--accent);
}

.saved-themes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.saved-theme-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--bg-page);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  overflow: hidden;
}

.saved-theme-wrap .saved-theme-chip {
  border: none;
  border-radius: 0;
}

.delete-theme-btn {
  background: transparent;
  border: none;
  color: var(--status-err);
  font-weight: 800;
  font-size: 0.85rem;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 480px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
  .studio-preview-stage {
    flex-direction: column;
    align-items: stretch;
  }
  .mini-calc-preview {
    width: 100%;
  }
}

.studio-group {
  background: var(--bg-page);
  padding: 9px 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.studio-span-2 {
  grid-column: span 2;
}

@media (max-width: 480px) {
  .studio-span-2 {
    grid-column: span 1;
  }
}

.studio-group label {
  font-size: 0.78rem;
  font-weight: 800;
}

.studio-group select, .studio-group input[type="text"] {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--card-border);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 700;
  font-family: inherit;
  min-height: 44px;
}

.color-pair {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.color-pair input[type="color"] {
  width: 44px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
}

/* Pro Modal Conversion Layout */
.pro-perks-list {
  margin: 10px 0 14px;
  padding-left: 20px;
  line-height: 1.65;
  color: var(--text-main);
  font-size: 0.92rem;
}

.pro-cta-block {
  margin-bottom: 14px;
  text-align: center;
}

.pro-trust-strip {
  margin: 6px 0 0 !important;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.trial-row {
  background: var(--bg-page);
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.trial-row-label {
  margin: 0 0 8px !important;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-main) !important;
}

.trial-pick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-card p {
  margin: 10px 0 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

.license-box {
  background: var(--bg-page);
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  text-align: left;
}

.license-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-main);
}

.license-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.license-row input {
  flex: 1;
  min-width: 170px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 2px solid var(--card-border);
  font-size: 0.94rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-main);
  min-height: 44px;
}

/* Profiles List with Rename & Delete */
.profiles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  text-align: left;
}

.profile-item-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--bg-page);
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid transparent;
}

.profile-item-row.active-profile {
  border-color: var(--accent);
}

.profile-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-action-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1.5px solid var(--card-border);
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.profile-del-btn {
  color: var(--status-err);
  border-color: var(--status-err);
}

.profile-rename-input {
  flex: 1;
  min-width: 120px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-weight: 700;
  min-height: 44px;
}

.active-key-summary {
  margin: 0 0 10px !important;
  font-weight: 800;
  color: var(--text-main) !important;
}

.license-status {
  margin: 8px 0 4px !important;
  font-size: 0.85rem;
  font-weight: 800;
  min-height: 1.2em;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.modal-btn, .buy-link-btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-size: 0.95rem;
  touch-action: manipulation;
}

.buy-link-btn {
  background: var(--accent);
  color: var(--accent-text);
  width: 100%;
  font-size: 1.02rem;
  padding: 13px 18px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
}

/* Illustrated Certificate Styles */
.certificate-sheet {
  background: #fffbeb;
  color: #1e293b;
  padding: 16px;
  border-radius: 14px;
  margin: 12px 0;
}

.cert-border {
  border: 5px double #d97706;
  outline: 2px solid #fde68a;
  outline-offset: -10px;
  padding: 20px 18px 24px;
  border-radius: 12px;
  text-align: center;
  background: radial-gradient(circle at top, #ffffff 0%, #fffbeb 75%);
}

.cert-seal-svg {
  width: 72px;
  height: 72px;
  margin: 0 auto 6px;
  display: block;
}

.cert-kicker {
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 1.8px;
  color: #b45309 !important;
  margin: 0 0 4px !important;
}

.cert-heading {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  color: #1d4ed8;
  margin-bottom: 6px;
}

.cert-rank-pill {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af !important;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
  margin: 0 0 8px !important;
}

.cert-sub {
  font-size: 0.9rem;
  color: #475569 !important;
  margin: 4px 0 !important;
}

.cert-recipient {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 900;
  color: #0f172a !important;
  border-bottom: 2px solid #cbd5e1;
  display: inline-block;
  padding: 2px 28px;
  margin: 6px 0 12px !important;
}

.cert-stats {
  font-size: 0.95rem;
  color: #1e293b !important;
  font-weight: 700;
}

.cert-badges {
  font-size: 1.45rem;
  letter-spacing: 4px;
  margin: 10px 0;
}

.cert-date {
  font-size: 0.8rem;
  color: #64748b !important;
  margin-top: 8px !important;
}



/* v13.2 Free-Beta Temporary Pro Unlock Banner & Notice */
.beta-free-banner {
  background: var(--bg-card);
  color: var(--text-main);
  border: 2px solid var(--status-ok);
  padding: 8px 14px;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.beta-dismiss-btn {
  background: var(--bg-page);
  color: var(--text-main);
  border: 1.5px solid var(--card-border);
  border-radius: 999px;
  min-width: 44px;
  min-height: 44px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}

.beta-notice-box {
  border: 2px solid var(--status-ok);
}

/* v13.1 Conversion & Game-Feel Additions */
.targeted-trial-btn {
  width: 100%;
  margin-bottom: 10px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 900;
  font-size: 0.92rem;
  cursor: pointer;
  touch-action: manipulation;
}

.targeted-trial-btn:hover {
  background: var(--accent);
  color: var(--accent-text);
}

.safari-tip {
  margin: 0 0 10px !important;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.4;
}

.cert-preview-notice {
  background: var(--quiz-tint);
  border: 2px solid var(--quiz-accent);
  color: var(--text-main) !important;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  margin: 10px 0 6px !important;
}

@keyframes pulseNudge {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.45); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(4, 120, 87, 0); }
}

.pulse-nudge {
  animation: pulseNudge 0.42s ease;
}


/* ============================================================================
   v13.3 TACTILE PHYSICAL CALCULATOR CHASSIS SHAPES ([data-calc-shape])
   Pure CSS silhouette & hardware morphing (Zero inline styles, 1-9 keypad locked,
   >= 44px touch targets preserved across desktop, tablet, and narrow phones).
   ============================================================================ */

/* 1. Classic Desk: Glossy miniature solar-cell strip in the top trim */
body[data-calc-shape="classic"] .casing-vents {
  background: rgba(15, 23, 42, 0.35);
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  gap: 3px;
}

body[data-calc-shape="classic"] .casing-vents span {
  width: 11px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(135deg, #334155 0%, #0f172a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* 2. 8-Bit Handheld Cabinet: Classic curved bottom-right bezel, CRT hood & speaker slits */
body[data-calc-shape="arcade"] .calc-casing {
  border-radius: 12px 12px 38px 12px;
  border: 3px solid var(--casing-border);
  border-bottom-width: 10px;
  padding-top: 12px;
}

body[data-calc-shape="arcade"] .casing-top-trim {
  background: rgba(0, 0, 0, 0.28);
  padding: 6px 10px;
  border-radius: 6px;
  border-bottom: 2px solid var(--casing-border);
  margin-bottom: 12px;
}

body[data-calc-shape="arcade"] .casing-vents {
  gap: 4px;
}

body[data-calc-shape="arcade"] .casing-vents span {
  width: 12px;
  height: 4px;
  border-radius: 2px;
  transform: rotate(-28deg);
}

body[data-calc-shape="arcade"] .calc-screen {
  border-width: 5px;
  border-radius: 8px;
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(0, 0, 0, 0.3);
}

body[data-calc-shape="arcade"] .key-quiz,
body[data-calc-shape="arcade"] .key-eq {
  margin-top: 6px;
  border-bottom-width: 6px;
  letter-spacing: 0.03em;
}

.studio-preview-stage[data-calc-shape="arcade"] .mini-calc-preview {
  border-radius: 6px 6px 18px 6px;
  border: 2px solid var(--casing-border);
  border-bottom-width: 5px;
}

/* 3. Starship Flight Deck: Chamfered octagonal cockpit, angled visor & tri-LED status bar */
body[data-calc-shape="space"] .calc-casing {
  border-radius: 0;
  border: none;
  clip-path: polygon(
    22px 0%, calc(100% - 22px) 0%,
    100% 22px, 100% calc(100% - 22px),
    calc(100% - 22px) 100%, 22px 100%,
    0% calc(100% - 22px), 0% 22px
  );
  padding: 18px 20px 24px;
  box-shadow: inset 0 0 0 3px var(--casing-highlight), inset 0 -9px 0 var(--casing-border);
}

body[data-calc-shape="space"] .calc-screen {
  border-radius: 6px;
  clip-path: polygon(12px 0%, calc(100% - 12px) 0%, 100% 12px, 100% 100%, 0% 100%, 0% 12px);
}

body[data-calc-shape="space"] .casing-vents span {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 8px currentColor;
}

body[data-calc-shape="space"] .casing-vents span:nth-child(1) { background: #38bdf8; color: #38bdf8; }
body[data-calc-shape="space"] .casing-vents span:nth-child(2) { background: #fbbf24; color: #fbbf24; }
body[data-calc-shape="space"] .casing-vents span:nth-child(3) { background: #34d399; color: #34d399; }

body[data-calc-shape="space"] .key-op {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.studio-preview-stage[data-calc-shape="space"] .mini-calc-preview {
  border-radius: 0;
  border: none;
  clip-path: polygon(
    10px 0%, calc(100% - 10px) 0%,
    100% 10px, 100% calc(100% - 10px),
    calc(100% - 10px) 100%, 10px 100%,
    0% calc(100% - 10px), 0% 10px
  );
  box-shadow: inset 0 0 0 2px var(--casing-highlight), inset 0 -4px 0 var(--casing-border);
}

/* 4. Rugged Dino Field Tablet: Asymmetrical carved bumper + stamped bottom badge plate */
body[data-calc-shape="dino"] .calc-casing {
  border-radius: 30px 10px 30px 10px;
  border: 4px solid var(--casing-border);
  border-bottom-width: 10px;
}

body[data-calc-shape="dino"] .casing-top-trim {
  order: 3;
  margin-top: 14px;
  margin-bottom: 0;
  padding: 8px 6px 0;
  border-top: 2px dashed var(--casing-highlight);
}

body[data-calc-shape="dino"] .casing-vents span {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  border: 1.5px solid var(--casing-highlight);
}

body[data-calc-shape="dino"] .calc-screen {
  border-radius: 18px 6px 18px 6px;
  border-width: 4px;
}

.studio-preview-stage[data-calc-shape="dino"] .mini-calc-preview {
  border-radius: 16px 4px 16px 4px;
  border: 2.5px solid var(--casing-border);
  border-bottom-width: 5px;
}

/* 5. Ninja Lacquer Frame: Crisp razor edges, katana-slit vents & twin accent trim */
body[data-calc-shape="ninja"] .calc-casing {
  border-radius: 6px;
  border-top: 4px solid var(--accent);
  border-left: 3px solid var(--casing-border);
  border-right: 3px solid var(--casing-border);
  border-bottom: 9px solid var(--casing-border);
}

body[data-calc-shape="ninja"] .casing-vents span {
  width: 14px;
  height: 3px;
  border-radius: 1px;
  background: var(--accent);
}

body[data-calc-shape="ninja"] .calc-screen {
  border-radius: 4px;
  border-bottom: 4px solid var(--accent);
}

.studio-preview-stage[data-calc-shape="ninja"] .mini-calc-preview {
  border-radius: 4px;
  border-top: 3px solid var(--accent);
  border-left: 2px solid var(--casing-border);
  border-right: 2px solid var(--casing-border);
}

/* 6. Submarine Sonar Console: Bubbly capsule shell, porthole visor & brass rivets */
body[data-calc-shape="ocean"] .calc-casing {
  border-radius: 36px;
  border: 3px solid var(--casing-border);
  border-top: 3px solid var(--casing-highlight);
  border-bottom: 10px solid var(--casing-border);
  padding: 18px 20px 22px;
}

body[data-calc-shape="ocean"] .casing-vents span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--casing-highlight);
}

body[data-calc-shape="ocean"] .calc-screen {
  border-radius: 24px;
  border: 4px solid var(--casing-highlight);
}

.studio-preview-stage[data-calc-shape="ocean"] .mini-calc-preview {
  border-radius: 20px;
  border: 2px solid var(--casing-highlight);
  border-bottom: 5px solid var(--casing-border);
}

/* ============================================================================
   v13.3 DETECTIVE CASE FILES (QUEST / ADVENTURE MODE)
   ============================================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.quest-toggle-btn {
  background: var(--bg-page);
  color: var(--text-main);
  border: 2px solid var(--accent);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.quest-toggle-btn:hover,
.quest-toggle-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-text);
}

.quest-banner {
  background: var(--quiz-tint);
  border: 2px solid var(--accent);
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quest-top-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.quest-picker-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 210px;
}

.quest-picker-wrap select,
.quest-controls select {
  padding: 6px 10px;
  border-radius: 10px;
  border: 2px solid var(--accent);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.84rem;
  font-family: inherit;
  max-width: 100%;
}

.quest-solved-pill {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1.5px solid var(--card-border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.quest-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.quest-world-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 2px solid var(--accent);
}

.quest-exit-btn {
  background: var(--btn-util);
  color: var(--btn-util-text);
}

.quest-trail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

@media (max-width: 520px) {
  .quest-trail {
    grid-template-columns: repeat(2, 1fr);
  }
}

.quest-pip {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 2px dashed var(--card-border);
  border-radius: 10px;
  padding: 6px 8px;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 800;
  transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.quest-pip.current {
  border: 2px solid var(--accent);
  color: var(--text-main);
  box-shadow: 0 0 0 2px var(--quiz-tint);
  transform: translateY(-1px);
}

.quest-pip.done {
  background: var(--btn-eq);
  color: var(--btn-eq-text);
  border: 2px solid var(--btn-eq);
}

.welcome-quest-cta {
  margin: 10px 0 12px;
}

.quest-launch-chip {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-bottom: 4px solid rgba(0, 0, 0, 0.22);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.92rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.quest-launch-chip:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.story-clue-card {
  border-left-color: var(--quiz-accent);
  font-size: 0.98rem;
}

.case-closed-card {
  border-left-color: var(--status-ok);
  border: 2px solid var(--status-ok);
  border-left-width: 6px;
}


/* ============================================================================
   v13.4 OPTION A: SCULPTED tactile SVG ATTACHMENTS, ILLUSTRATED BACKDROPS,
   ANIMATED EQUALIZER BAR & PARENT FEEDBACK MODAL (ZERO INLINE STYLES)
   ============================================================================ */
.calc-shell-wrap {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  transition: filter 0.25s ease;
}

/* Give clipped octagonal Starship shell a real floating drop shadow */
body[data-calc-shape="space"] .calc-shell-wrap {
  filter: drop-shadow(0 16px 24px var(--casing-glow));
  margin-bottom: 14px;
}

/* Ensure calculator content layers cleanly ABOVE the illustrated casing scene */
.calc-casing > .casing-top-trim,
.calc-casing > .calc-screen,
.calc-casing > .led-eq-strip,
.calc-casing > .keypad {
  position: relative;
  z-index: 2;
}

/* Subtle glossy glass glare on the recessed LCD screen */
.calc-screen {
  position: relative;
  overflow: hidden;
}

.calc-screen::after {
  content: "";
  position: absolute;
  inset: 0 0 55% 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}

/* Protruding SVG Attachments Layer */
.shell-attachments {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.attach-svg {
  display: none;
  position: absolute;
  overflow: visible;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.attach-top {
  left: 50%;
  transform: translateX(-50%);
}

.attach-bottom {
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% - 4px);
}

.attach-left {
  top: 50%;
  transform: translateY(-50%);
}

.attach-right {
  top: 50%;
  transform: translateY(-50%);
}

/* Attachment Vector Color Tokens (Auto-Recolors With Skin Studio!) */
.att-casing { fill: var(--bg-casing); }
.att-casing-dark { fill: var(--casing-border); }
.att-accent { fill: var(--accent); }
.att-screen { fill: var(--screen-bg); }
.att-screen-border { fill: none; stroke: var(--screen-text); stroke-width: 1.5; opacity: 0.45; }
.att-glow { fill: var(--screen-text); }
.att-highlight { fill: var(--casing-highlight); }
.att-stroke-glow { stroke: var(--screen-text); stroke-width: 3; stroke-linecap: round; fill: none; }
.att-stroke-accent { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; fill: none; }

/* Classic Pencil Fixed Realistic Accents */
.att-eraser { fill: #fb7185; }
.att-metal { fill: #cbd5e1; }
.att-pencil { fill: #f59e0b; }
.att-pencil-ridge { stroke: #d97706; stroke-width: 1.5; }
.att-wood { fill: #fde68a; }
.att-lead { fill: #1e293b; }

/* Activate matching sculpted attachments per [data-calc-shape] */
body[data-calc-shape="classic"] .attach-classic-top { display: block; width: 148px; height: 24px; top: -18px; }
body[data-calc-shape="classic"] .attach-classic-pencil { display: block; width: 28px; height: 170px; right: -20px; top: 54%; }

body[data-calc-shape="arcade"] .attach-arcade-top { display: block; width: 90%; height: 34px; top: -27px; }
body[data-calc-shape="arcade"] .attach-arcade-pod-l { display: block; width: 24px; height: 138px; left: -19px; top: 52%; }
body[data-calc-shape="arcade"] .attach-arcade-pod-r { display: block; width: 24px; height: 138px; right: -19px; top: 52%; }

body[data-calc-shape="space"] .attach-space-top { display: block; width: 210px; height: 34px; top: -28px; }
body[data-calc-shape="space"] .attach-space-wing-l { display: block; width: 28px; height: 184px; left: -21px; top: 56%; }
body[data-calc-shape="space"] .attach-space-wing-r { display: block; width: 28px; height: 184px; right: -21px; top: 56%; }
body[data-calc-shape="space"] .attach-space-thrusters { display: block; width: 210px; height: 24px; }

body[data-calc-shape="dino"] .attach-dino-top { display: block; width: 88%; height: 30px; top: -22px; }
body[data-calc-shape="dino"] .attach-dino-grip-l { display: block; width: 18px; height: 156px; left: -13px; top: 52%; }
body[data-calc-shape="dino"] .attach-dino-grip-r { display: block; width: 18px; height: 156px; right: -13px; top: 52%; }

body[data-calc-shape="ninja"] .attach-ninja-top { display: block; width: 106%; height: 34px; top: -26px; }
body[data-calc-shape="ninja"] .attach-ninja-ribbon { display: block; width: 32px; height: 130px; right: -22px; top: 26%; }

body[data-calc-shape="ocean"] .attach-ocean-top { display: block; width: 84%; height: 38px; top: -30px; }
body[data-calc-shape="ocean"] .attach-ocean-fin-l { display: block; width: 22px; height: 112px; left: -17px; top: 54%; }
body[data-calc-shape="ocean"] .attach-ocean-fin-r { display: block; width: 22px; height: 112px; right: -17px; top: 54%; }

/* Phone-safe tucking: keep side wings/pods inside viewport so zero horizontal scroll occurs */
@media (max-width: 900px) {
  .calc-shell-wrap {
    margin-left: 12px;
    margin-right: 12px;
  }
}

@media (max-width: 520px) {
  .calc-shell-wrap {
    margin-left: 6px;
    margin-right: 6px;
  }
  .attach-left,
  .attach-right {
    display: none !important;
  }
  body[data-calc-shape="ninja"] .attach-ninja-top {
    width: 100%;
  }
}

/* Illustrated Vector Scene Backdrops Inside Calculator Casing */
.casing-scene-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.42;
}

.scene-svg {
  display: none;
  width: 100%;
  height: 100%;
}

body[data-calc-shape="classic"] .scene-classic { display: block; }
body[data-calc-shape="arcade"]  .scene-arcade  { display: block; }
body[data-calc-shape="space"]   .scene-space   { display: block; }
body[data-calc-shape="dino"]    .scene-dino    { display: block; }
body[data-calc-shape="ninja"]   .scene-ninja   { display: block; }
body[data-calc-shape="ocean"]   .scene-ocean   { display: block; }

.sc-fill-dark { fill: rgba(0, 0, 0, 0.24); }
.sc-fill-soft { fill: rgba(255, 255, 255, 0.18); }
.sc-fill-glow { fill: var(--screen-text); opacity: 0.55; }
.sc-fill-accent { fill: var(--accent); opacity: 0.52; }
.sc-stroke-light { fill: none; stroke: rgba(255, 255, 255, 0.34); stroke-width: 2.5; stroke-linecap: round; }
.sc-stroke-glow { fill: none; stroke: var(--screen-text); stroke-width: 2.2; opacity: 0.5; }
.sc-stroke-accent { fill: none; stroke: var(--accent); stroke-width: 2.5; opacity: 0.55; }

/* Subtle World-Themed Corner Watermark Inside Clue Board (Always behind text) */
.board-scene-bg {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 210px;
  height: 170px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.08;
}

.teaching-board > *:not(.board-scene-bg) {
  position: relative;
  z-index: 1;
}

.board-wm {
  display: none;
  width: 100%;
  height: 100%;
}

body[data-calc-shape="classic"] .wm-classic { display: block; }
body[data-calc-shape="arcade"]  .wm-arcade  { display: block; }
body[data-calc-shape="space"]   .wm-space   { display: block; }
body[data-calc-shape="dino"]    .wm-dino    { display: block; }
body[data-calc-shape="ninja"]   .wm-ninja   { display: block; }
body[data-calc-shape="ocean"]   .wm-ocean   { display: block; }

.wm-fill { fill: var(--accent); }
.wm-stroke { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
.wm-stroke-thick { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; }

/* Classic Tactile LED Equalizer Strip (Displayed on high-tech & retro shells) */
.led-eq-strip {
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  height: 16px;
  padding: 3px 8px;
  margin: -8px 0 12px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--casing-highlight);
}

body[data-calc-shape="arcade"] .led-eq-strip,
body[data-calc-shape="space"] .led-eq-strip,
body[data-calc-shape="ninja"] .led-eq-strip,
body[data-calc-shape="ocean"] .led-eq-strip {
  display: flex;
}

.eq-bar {
  flex: 1;
  border-radius: 2px;
  background: linear-gradient(to top, var(--btn-eq), var(--accent), var(--screen-text));
  opacity: 0.78;
  transition: height 0.2s ease;
}

.eq-b1  { height: 35%; }
.eq-b2  { height: 65%; }
.eq-b3  { height: 48%; }
.eq-b4  { height: 85%; }
.eq-b5  { height: 55%; }
.eq-b6  { height: 92%; }
.eq-b7  { height: 60%; }
.eq-b8  { height: 78%; }
.eq-b9  { height: 42%; }
.eq-b10 { height: 70%; }

@keyframes eqBounce {
  0%, 100% { transform: scaleY(0.55); opacity: 0.75; }
  45% { transform: scaleY(1.25); opacity: 1; }
}

.calc-shell-wrap.eq-active .eq-bar {
  transform-origin: bottom;
  animation: eqBounce 0.42s ease-in-out 2;
}

.calc-shell-wrap.eq-active .eq-b2,
.calc-shell-wrap.eq-active .eq-b7 { animation-delay: 0.06s; }
.calc-shell-wrap.eq-active .eq-b3,
.calc-shell-wrap.eq-active .eq-b8 { animation-delay: 0.12s; }
.calc-shell-wrap.eq-active .eq-b4,
.calc-shell-wrap.eq-active .eq-b9 { animation-delay: 0.18s; }
.calc-shell-wrap.eq-active .eq-b5,
.calc-shell-wrap.eq-active .eq-b10 { animation-delay: 0.24s; }

/* Parent & Teacher Feedback Modal Styles */
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.feedback-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--card-border);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 92px;
}

.feedback-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px 2px;
}

.feedback-check-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex-shrink: 0;
}


/* ============================================================================
   v13.5 PHONE ABOVE-THE-FOLD POLISH & TWO-TAP CONFIRMATION STATES
   ============================================================================ */
.confirm-armed {
  background: var(--status-err) !important;
  color: #ffffff !important;
  border-color: var(--status-err) !important;
}

@media (max-width: 680px) {
  body {
    padding: 8px 10px;
  }
  .top-bar, .beta-free-banner, .skin-bar, .workspace, .trial-banner {
    margin-bottom: 8px;
  }
  .top-bar {
    padding: 8px 12px;
    gap: 8px;
  }
  .brand-emblem {
    width: 38px;
    height: 38px;
  }
  .brand h1 {
    font-size: 1.15rem;
  }
  .subtitle {
    display: none;
  }
  .controls-bar {
    gap: 6px;
  }
  .beta-free-banner {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  /* Compact wrapped theme grid on phones — Ocean & all themes visible with zero horizontal scrolling */
  .skin-bar {
    flex-wrap: wrap;
    overflow-x: visible;
    padding: 6px 8px;
    gap: 5px;
  }
  .skin-bar .skin-label {
    display: none;
  }
  .skin-bar .skin-btn {
    padding: 4px 8px;
    min-height: 32px;
    font-size: 0.74rem;
  }
  .unlock-cta {
    width: auto;
    margin-left: 0;
  }
  .workspace {
    gap: 14px;
    padding-top: 4px;
  }
}


/* ============================================================================
   v13.7 DEEPER EXAMPLES DRAWER, SIBLING CROSS-LINK & OPTION 1 MOBILE POLISH
   ============================================================================ */
.keypad-jump-btn {
  display: none;
  background: var(--bg-page);
  color: var(--text-main);
  border: 2px solid var(--accent);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}

.mobile-challenge-strip {
  display: none;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 10px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
  line-height: 1.3;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.deeper-drawer {
  margin-top: 12px;
  border: 2px solid var(--card-border);
  border-radius: 14px;
  background: var(--bg-page);
  overflow: hidden;
}

.deeper-toggle-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-main);
  border: none;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
}

.deeper-toggle-btn:hover {
  background: rgba(128, 128, 128, 0.08);
}

.deeper-chevron {
  font-size: 1rem;
  color: var(--text-main);
}

.deeper-panel {
  padding: 0 14px 14px;
  border-top: 1.5px dashed var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deeper-methods {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 10px;
}

.deeper-method-card {
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 0.88rem;
  line-height: 1.48;
}

.deeper-examples-wrap {
  padding-top: 4px;
}

.deeper-examples-label {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.sibling-promo-bar {
  max-width: 1080px;
  margin: 0 auto 10px;
  background: var(--bg-card);
  border: 2px solid var(--card-border);
  border-radius: 14px;
  padding: 9px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sibling-promo-link {
  background: var(--accent);
  color: var(--accent-text);
  padding: 6px 14px;
  border-radius: 999px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  font-weight: 900;
  font-size: 0.82rem;
  text-decoration: none;
}

.sibling-promo-link:hover {
  filter: brightness(1.08);
}

/* Option 1 Mobile Visibility Tweaks (Desktop > 840px remains 100% unchanged!) */
@media (max-width: 840px) {
  .keypad-jump-btn {
    display: inline-flex;
    align-items: center;
  }
  .mobile-challenge-strip:not(.hidden) {
    display: block;
  }
}

@media (max-width: 680px) {
  .calc-casing {
    padding: 12px 13px 14px;
  }
  .casing-top-trim {
    margin-bottom: 6px;
  }
  .calc-screen {
    padding: 9px 12px 10px;
    margin-bottom: 8px;
  }
  .main-display {
    font-size: 2rem;
  }
  .led-eq-strip {
    margin-bottom: 8px;
    height: 12px;
  }
  .keypad {
    gap: 7px;
  }
  .key {
    padding: 10px 4px;
    min-height: 46px;
    font-size: 1.2rem;
  }
  .key-eq {
    font-size: 1rem;
  }
}


/* ============================================================================
   v13.9 MORE BACKDROPS, PLAIN MINIMAL STYLE & SESSION ACTIVITY LOG
   ============================================================================ */
:is(body, .studio-preview-stage)[data-bg-pattern="waves"] {
  background-color: var(--bg-page);
  background-image:
    radial-gradient(circle at 20px 26px, transparent 14px, var(--pattern-tint) 15px, var(--pattern-tint) 18px, transparent 19px),
    radial-gradient(circle at 0px 8px, transparent 14px, var(--pattern-tint) 15px, var(--pattern-tint) 18px, transparent 19px);
  background-size: 40px 34px;
}
:is(body, .studio-preview-stage)[data-bg-pattern="checker"] {
  background-color: var(--bg-page);
  background-image:
    linear-gradient(45deg, var(--pattern-tint) 25%, transparent 25%),
    linear-gradient(-45deg, var(--pattern-tint) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--pattern-tint) 75%),
    linear-gradient(-45deg, transparent 75%, var(--pattern-tint) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
}
:is(body, .studio-preview-stage)[data-bg-pattern="horizon"] {
  background-color: var(--bg-page);
  background-image: linear-gradient(180deg, var(--pattern-tint) 0%, transparent 55%, var(--pattern-tint) 100%);
  background-size: 100% 100%;
}
.studio-preview-stage[data-bg-pattern="waves"] { background-size: 24px 20px; }
.studio-preview-stage[data-bg-pattern="checker"] { background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
body[data-plain-bg="true"] { background-image: none !important; }
body[data-calc-shape="plain"] .calc-casing {
  border-radius: 16px;
  border-bottom-width: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
body[data-calc-shape="plain"] .attach-svg,
body[data-calc-shape="plain"] .scene-svg,
body[data-calc-shape="plain"] .board-wm,
body[data-calc-shape="plain"] .led-eq-strip { display: none !important; }
body[data-calc-shape="plain"] .calc-screen { border-radius: 10px; }
.studio-preview-stage[data-calc-shape="plain"] .mini-calc-preview { border-radius: 10px; border-bottom-width: 3px; }
.plain-bg-toggle {
  background: var(--bg-page); color: var(--text-main); border: 1.5px solid var(--card-border);
  border-radius: 999px; padding: 6px 12px; min-height: 36px; font-size: 0.8rem; font-weight: 800;
  cursor: pointer; touch-action: manipulation; white-space: nowrap;
}
.plain-bg-toggle.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.log-toggle-btn {
  background: var(--bg-page); color: var(--text-main); border: 1.5px solid var(--card-border);
  border-radius: 999px; padding: 5px 11px; min-height: 36px; font-size: 0.8rem; font-weight: 900;
  cursor: pointer; touch-action: manipulation;
}
.log-toggle-btn:hover { border-color: var(--accent); }
.session-log-card { max-width: 600px; }
.session-log-summary {
  background: var(--bg-page); border: 1.5px solid var(--card-border); border-radius: 10px;
  padding: 8px 12px; font-size: 0.84rem; font-weight: 800; margin-bottom: 10px;
}
.log-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.log-filter-btn.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.session-log-list { max-height: 310px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; padding-right: 2px; }
.log-empty-msg { font-size: 0.86rem; color: var(--text-muted); text-align: center; padding: 18px 8px; }
.log-entry-row {
  background: var(--bg-page); border: 1.5px solid var(--card-border); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 8px 11px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.log-entry-row.log-correct { border-left-color: var(--status-ok); }
.log-entry-row.log-miss { border-left-color: var(--status-err); }
.log-entry-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.log-entry-top { font-size: 0.72rem; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.log-kind-pill { font-weight: 900; color: var(--text-main); }
.log-entry-expr { font-size: 0.9rem; word-break: break-word; }
.log-entry-detail { font-size: 0.78rem; color: var(--text-muted); }
.log-replay-btn { flex-shrink: 0; font-size: 0.76rem; }


/* ============================================================================
   v14.0 MOBILE COMPACT CALCULATOR + PHONE-ONLY HIDE/SHOW KEYS TOGGLE
   ============================================================================ */
.casing-trim-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mobile-keys-toggle {
  display: none;
  background: rgba(128, 128, 128, 0.18);
  color: var(--casing-label);
  border: 1.5px solid currentColor;
  border-radius: 999px;
  padding: 2px 9px;
  min-height: 28px;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}

.calc-casing.calc-keys-collapsed .led-eq-strip,
.calc-casing.calc-keys-collapsed .keypad {
  display: none;
}

.calc-casing.calc-keys-collapsed .calc-screen {
  margin-bottom: 0;
}

@media (max-width: 840px) {
  .mobile-keys-toggle {
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 680px) {
  /* Reclaim ~85px vertically on phones so the Clue Board peeks cleanly above the fold */
  .attach-top {
    max-height: 24px;
  }
  .calc-casing {
    padding: 9px 11px 11px;
  }
  .casing-top-trim {
    margin-bottom: 5px;
  }
  .calc-screen {
    padding: 7px 10px 8px;
    margin-bottom: 6px;
  }
  .equation-preview {
    font-size: 0.8rem;
  }
  .main-display {
    font-size: 1.75rem;
  }
  .led-eq-strip {
    margin-bottom: 6px;
    height: 9px;
  }
  .keypad {
    gap: 6px;
  }
  .key {
    padding: 7px 4px;
    min-height: 41px;
    font-size: 1.12rem;
  }
  .key-eq {
    font-size: 0.96rem;
  }
}

.step-card a {
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
}


/* v14.0.2 Collapsible Smart Voice Picker Bar */
.voice-toggle-btn {
  background: var(--bg-page);
  color: var(--text-main);
  border: 1.5px solid var(--border-color, #cbd5e1);
  border-radius: 999px;
  padding: 5px 10px;
  min-height: 36px;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.voice-toggle-btn[aria-expanded="true"] {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.voice-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--bg-page);
  border: 1.5px solid var(--border-color, #cbd5e1);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.voice-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  flex: 1;
  min-width: 170px;
}

.voice-rate-field {
  flex: 0 1 auto;
  min-width: 125px;
}

.voice-field select {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border-color, #cbd5e1);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 3px 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
}


/* v14.1 Extra Physical Calculator Body Shapes (notebook & retropad) */
body[data-calc-shape="notebook"] .attach-top,
body[data-calc-shape="notebook"] .attach-left,
body[data-calc-shape="notebook"] .attach-right,
body[data-calc-shape="notebook"] .attach-bottom,
body[data-calc-shape="retropad"] .attach-top,
body[data-calc-shape="retropad"] .attach-left,
body[data-calc-shape="retropad"] .attach-right,
body[data-calc-shape="retropad"] .attach-bottom {
  display: none;
}

body[data-calc-shape="notebook"] .calc-casing {
  border-radius: 6px 22px 22px 6px;
  border: 3px solid var(--casing-border);
  border-left: 14px dashed rgba(255, 255, 255, 0.45);
  border-bottom-width: 10px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.22);
}

body[data-calc-shape="retropad"] .calc-casing {
  border-radius: 36px 36px 44px 44px;
  border: 4px solid var(--casing-border);
  border-bottom-width: 13px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.16), 0 18px 34px rgba(15, 23, 42, 0.26);
}

body[data-calc-shape="retropad"] .calc-screen {
  border-radius: 20px;
  border-width: 4px;
}


/* v14.2 Fix #4: Skin Studio Live Mini-Preview for Notebook & Retropad Shapes */
.studio-preview-stage[data-calc-shape="notebook"] .mini-calc-preview {
  border-radius: 4px 14px 14px 4px;
  border-left: 7px dashed rgba(255, 255, 255, 0.55);
  border-bottom-width: 6px;
}

.studio-preview-stage[data-calc-shape="retropad"] .mini-calc-preview {
  border-radius: 22px 22px 28px 28px;
  border-bottom-width: 7px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

/* v14.2 Color-Coded Equation LCD Switch & Auto Light/Dark WCAG AA Palettes */
.bezel-color-toggle {
  background: rgba(128, 128, 128, 0.22);
  color: var(--casing-label);
  border: 2px solid currentColor;
  border-radius: 999px;
  padding: 3px 11px;
  min-height: 32px;
  font-size: 0.76rem;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}

.bezel-color-toggle[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}

body[data-screen-tone="light"] {
  --eq-op-hi: #991b1b;
  --eq-op-lo: #92400e;
  --eq-eq:    #065f46;
  --eq-p0:    #1d4ed8;
  --eq-p1:    #065f46;
  --eq-p2:    #9d174d;
  --eq-p-err: #991b1b;
}

body[data-screen-tone="dark"] {
  --eq-op-hi: #fb7185;
  --eq-op-lo: #fbbf24;
  --eq-eq:    #34d399;
  --eq-p0:    #38bdf8;
  --eq-p1:    #34d399;
  --eq-p2:    #f472b6;
  --eq-p-err: #fca5a5;
}

.eq-op-hi { color: var(--eq-op-hi); font-weight: 900; }
.eq-op-lo { color: var(--eq-op-lo); font-weight: 900; }
.eq-eq    { color: var(--eq-eq);    font-weight: 900; }
.eq-p0    { color: var(--eq-p0);    font-weight: 900; }
.eq-p1    { color: var(--eq-p1);    font-weight: 900; }
.eq-p2    { color: var(--eq-p2);    font-weight: 900; }
.eq-p-err { color: var(--eq-p-err); font-weight: 900; text-decoration: underline wavy; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Native @media print Certificate Rules — Scoped ONLY When Certificate Modal Is Open */
@media print {
  body {
    background: #ffffff !important;
    background-image: none !important;
    padding: 0 !important;
  }
  .no-print {
    display: none !important;
  }
  #cert-modal:not(.hidden):not(.cert-locked) {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
  }
  #cert-modal:not(.hidden):not(.cert-locked) .cert-modal-card {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  #cert-modal:not(.hidden):not(.cert-locked) #certificate-sheet {
    margin: 0 !important;
    padding: 24px !important;
    background: #fffbeb !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.sibling-promo-link-beta { background: #047857; color: #ffffff; }

.sibling-promo-link-arcade { background: #6d28d9; color: #ffffff; }


/* ============================================================================
   WAVE 2 (v14.4) — PARENT-GATED KID FOCUS MODE
   ============================================================================ */
.focus-mode-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 36px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}
.focus-mode-btn.focus-active {
  background: #047857;
  color: #ffffff;
  border-color: #065f46;
}
.focus-mode-banner {
  max-width: 1120px;
  margin: 0 auto 12px;
  background: #ecfdf5;
  color: #065f46;
  border: 2px solid #047857;
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 800;
}
.focus-gate-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Distraction-Free Kid Focus Rules — keeps Calculator, Visuals, Quiz & Case Files front and center */
body[data-focus-mode="on"] .skin-bar,
body[data-focus-mode="on"] #open-studio-btn,
body[data-focus-mode="on"] #open-profiles-btn,
body[data-focus-mode="on"] #install-pwa-btn,
body[data-focus-mode="on"] #beta-free-banner,
body[data-focus-mode="on"] #trial-banner,
body[data-focus-mode="on"] .sibling-promo-bar,
body[data-focus-mode="on"] #hub-home-link,
body[data-focus-mode="on"] #open-backup-btn,
body[data-focus-mode="on"] #open-feedback-btn,
body[data-focus-mode="on"] #print-cert-btn,
body[data-focus-mode="on"] #open-log-btn,
body[data-focus-mode="on"] #open-privacy-link {
  display: none !important;
}
.app-footer {
  gap: 8px 18px;
}

/* Wave 6 (v14.7.1) — Ready Offline Pill */
.offline-pill {
  font-size: 0.74rem;
  font-weight: 900;
  background: #ecfdf5;
  color: #065f46;
  border: 1.5px solid #047857;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}


.skip-link {
  position: fixed;
  top: -80px;
  left: 12px;
  z-index: 9999;
  background: var(--accent, #0369a1);
  color: var(--accent-text, #ffffff);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 0.85rem;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.skip-link:focus {
  top: 12px;
}

/* v14.8.3 Mobile Button Comfort Polish */
@media (max-width: 680px) {
  .controls-bar .pill-btn,
  .board-actions .mini-btn {
    min-height: 34px;
    padding: 4px 10px;
    font-size: 0.76rem;
  }
  .keypad { gap: 5px; }
  .key { min-height: 38px; padding: 5px 4px; font-size: 1.06rem; }
  .key-eq { font-size: 0.92rem; }
}
