/* shell.css - SPA shell styles for index.html only.
   Do NOT load this in standalone calculator pages.
   Component-specific styles live in their own component files.
   Shared calculator UI (sliders, inputs, etc.) lives in style.css.
   ─────────────────────────────────────────────────────────────── */

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

:root {
  --navy: #0a0f1e;
  --navy-2: #0f172a;
  --navy-3: #1e293b;
  --navy-4: #334155;
  --gold: #d4a843;
  --gold-dim: rgba(212, 168, 67, 0.12);
  --white: #f1f5f9;
  --muted: #94a3b8;
  --dim: #64748b;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.04);
  --fd: "Playfair Display", Georgia, serif;
  --fb: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --panel-w-left: 280px;
  --panel-w-right: 300px;
  --gap: 1rem;
  --pad: 1rem;
  --panel-radius: 2rem;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: #e2e3e4;
  color: var(--white);
  font-family: var(--fb);
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-areas: "lf ct rt";
  grid-template-columns: var(--panel-w-left) 1fr var(--panel-w-right);
  grid-template-rows: 1fr;
  align-items: stretch;
  justify-content: stretch;
  gap: var(--gap);
  padding: var(--pad);
  height: 100dvh;
}

::selection {
  background: var(--gold);
  color: var(--navy);
}

/* ─── CALC HERO ──────────────────────────────────────────────── */
.ch-hero {
  position: relative;
  background-color: #0f172a;
  background-image: radial-gradient(at 0% 0%, hsla(263, 85%, 60%, 0.5) 0px, transparent 85%), radial-gradient(at 100% 100%, hsla(180, 85%, 50%, 0.35) 0px, transparent 85%);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #fff;
  margin-bottom: 1rem;
  padding: 1.25rem 1rem 1rem;
  box-shadow: 0 15px 35px -12px rgba(0, 0, 0, 0.5);
  user-select: none;
  cursor: pointer;
  transition:
    border-color 0.2s,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.ch-hero:hover {
  border-color: rgba(255, 255, 255, 0.14);
  transform: scale(1.01);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.65);
}
.ch-kicker {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
.ch-total,
.ch-stat-val {
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-primary--lg .ch-total {
  font-size: 2.25rem;
  margin-top: 0.15rem;
}
.ch-primary--md .ch-total {
  font-size: 1.75rem;
  margin-top: 0.15rem;
}
.ch-primary--sm .ch-total {
  font-size: 1.1rem;
  margin-top: 0.1rem;
}
.ch-p1 {
  text-align: center;
  margin-bottom: 1rem;
}
.ch-p1 .ch-kicker {
  justify-content: center;
}
.ch-p2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ch-p2 .ch-primary {
  text-align: center;
}
.ch-p2 .ch-kicker {
  justify-content: center;
}
.ch-p3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: center;
}
.ch-p3-main {
  text-align: center;
}
.ch-p3-main .ch-kicker {
  justify-content: center;
}
.ch-p3-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 0.875rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}
.ch-p3-stack .ch-kicker {
  justify-content: center;
}
.ch-stats {
  display: grid;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  margin-top: 0.25rem;
}
.ch-s1 {
  grid-template-columns: 1fr;
}
.ch-s1 .ch-stat {
  align-items: center;
  text-align: center;
}
.ch-s2 {
  grid-template-columns: 1fr 1fr;
}
.ch-s2 .ch-stat:last-child {
  align-items: flex-end;
  text-align: right;
}
.ch-s3 {
  grid-template-columns: repeat(3, 1fr);
}
.ch-s4 {
  grid-template-columns: repeat(4, 1fr);
}
.ch-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ch-stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.63rem;
  color: #94a3b8;
  line-height: 1.3;
  text-align: center;
}
.ch-stat-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.2rem;
}
.ch-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.ch-disclaimer {
  font-size: 0.6rem;
  color: #475569;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  line-height: 1.5;
}
/* Fallback modal (standalone pages without App) */
#ch-val-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}
@media (min-width: 480px) {
  #ch-val-modal {
    align-items: center;
  }
}
.ch-val-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
}
.ch-val-panel {
  position: relative;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  padding: 1.75rem 1.5rem 1.25rem;
  width: 100%;
  max-width: 320px;
  text-align: center;
  animation: chValUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes chValUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ch-val-close {
  width: 100%;
  padding: 0.75rem;
  background: #334155;
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
/* Guide value display */
.ch-guide-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.875rem;
  line-height: 1.1;
  word-break: break-all;
}

/* ─── GLASS PANEL BASE ──────────────────────────────────────── */
.glass-panel {
  background: #0b1221;
  border-radius: var(--panel-radius);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.2),
    inset 0 10px 20px rgba(255, 255, 255, 0.05),
    inset 0 -15px 30px rgba(0, 0, 0, 0.4),
    0 25px 50px -12px rgba(11, 18, 33, 0.5),
    0 15px 25px -10px rgba(11, 18, 33, 0.3);
}
.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, hsla(263, 45%, 25%, 0.4) 0px, transparent 70%), radial-gradient(ellipse 60% 50% at 85% 80%, hsla(180, 50%, 20%, 0.25) 0px, transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 110%, hsla(38, 80%, 45%, 0.1) 0px, transparent 60%);
  z-index: 1;
  pointer-events: none;
  animation: liquidShift 12s ease-in-out infinite alternate;
}
.glass-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  z-index: 2;
  mix-blend-mode: overlay;
  pointer-events: none;
}
@keyframes liquidShift {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.05);
    opacity: 1;
  }
}
.glass-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ─── LEFT PANEL ────────────────────────────────────────────── */
.lf-panel {
  grid-area: lf;
}

.logo {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  cursor: pointer;
}
.logo-txt {
  font-family: var(--fd);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}
.logo-txt span {
  color: var(--gold);
}

.lf-scroll {
  overflow-y: auto;
  padding: 1rem 0;
  flex-grow: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.lf-scroll::-webkit-scrollbar {
  width: 4px;
}
.lf-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.grp-label {
  font-family: var(--fb);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.875rem 1.5rem 0.3rem;
}

.tool-lnk {
  border-radius: 8px;
  margin: 0.25rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  text-decoration: none;
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
}
.tool-lnk svg {
  flex-shrink: 0;
  color: var(--gold);
  transition: color 0.2s;
}
.tool-lnk:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}
.tool-lnk.active {
  background: var(--gold-dim);
  border-color: rgba(212, 168, 67, 0.3);
}
.tool-lnk.active svg {
  color: var(--gold);
}

.home-lnk {
  border-color: rgba(212, 168, 67, 0.2);
  background: rgba(212, 168, 67, 0.06);
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.home-lnk svg {
  color: var(--gold);
}
.home-lnk:hover {
  background: rgba(212, 168, 67, 0.12);
  border-color: rgba(212, 168, 67, 0.35);
}

.lf-footer {
  padding: 1.25rem 1.5rem 1rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.btn-book {
  display: block;
  width: 100%;
  font-family: var(--fb);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--gold);
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition:
    filter 0.2s,
    transform 0.15s;
  box-shadow: 0 4px 12px rgba(212, 168, 67, 0.3);
}
.btn-book:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.lf-copy {
  font-family: var(--fb);
  font-size: 0.6rem;
  color: var(--dim);
  text-align: center;
  margin-top: 0.75rem;
  line-height: 1.6;
}
.lf-copy a {
  color: var(--dim);
  text-decoration: none;
}
.lf-copy a:hover {
  color: var(--muted);
}

/* ─── WORKSPACE (CENTER) ─────────────────────────────────────── */
.workspace {
  grid-area: ct;
  overflow: visible;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.workspace.calc-active {
  overflow: visible;
}

/* ─── CALC GLASS CARD ────────────────────────────────────────── */
.glass-panel.calc-glass {
  flex: 1;
  min-height: 0;
}

.calc-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.calc-nav-title {
  font-family: var(--fd);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
}

.calc-hero-zone {
  flex-shrink: 0;
  padding: 0.875rem 1.25rem 0;
}
.calc-hero-zone .ch-hero {
  border-radius: 0.75rem;
  margin-bottom: 0;
}

.calc-chart-zone {
  flex: 1;
  min-height: 0;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
}
.calc-chart-zone .chart-container {
  flex: 1;
  min-height: 120px;
  position: relative;
}

.calc-inputs {
  flex-shrink: 0;
  padding: 1.75rem 1.25rem 1rem;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}
.calc-inputs .labelWithTip {
  color: var(--muted);
  display: inline-flex;
  transform-origin: left center;
  transition:
    color 0.2s,
    transform 0.2s ease;
}
.calc-inputs .labelWithTip[data-field]:hover {
  color: var(--white);
  transform: scale(1.06);
}
.calc-inputs .slider-input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--white);
}
.calc-inputs .slider-group {
  margin-bottom: 0.625rem;
}
.calc-inputs .slider-group:last-child {
  margin-bottom: 0;
}

.calc-actions {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  padding: 0 1.25rem 1rem;
  background: rgba(0, 0, 0, 0.18);
}
.btn-report {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  font-family: var(--fb);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  padding: 0.625rem 1rem;
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
  max-width: 480px;
}
.btn-report:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

/* ─── HOME VIEW ──────────────────────────────────────────────── */
#home-view {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  flex: 1;
  min-height: 0;
  overflow: visible;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  flex-shrink: 0;
}
.hero-headline {
  font-family: var(--fd);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: heroFadeUp 0.7s 0.25s ease forwards;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.hero-headline em {
  font-style: italic;
  color: var(--gold);
}
.hero-sub {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto;
  opacity: 0;
  animation: heroFadeUp 0.7s 0.38s ease forwards;
}
@keyframes heroFadeUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── NAV TOOLTIP ────────────────────────────────────────────── */
#nav-tooltip {
  position: fixed;
  z-index: 300;
  max-width: 220px;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    0 8px 24px rgba(0, 0, 0, 0.35);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translate(-4px, -50%);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  backdrop-filter: blur(8px);
  margin-left: 1rem;
}
#nav-tooltip.visible {
  opacity: 1;
  transform: translate(0, -50%);
}
#nav-tooltip::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 7px 8px 7px 0;
  border-style: solid;
  border-color: transparent rgba(15, 23, 42, 0.95) transparent transparent;
}

/* ─── GUIDE PANEL (RIGHT) ────────────────────────────────────── */
.guide-panel {
  grid-area: rt;
}
.guide-shimmer {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  border-radius: var(--panel-radius);
  overflow: hidden;
  opacity: 0;
}
.guide-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%);
  transform: skewX(-15deg);
}
.guide-shimmer.shimmer-active {
  opacity: 1;
  animation: guideShimmer 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes guideShimmer {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.guide-shimmer.shimmer-active::after {
  animation: shimmerSweep 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes shimmerSweep {
  from {
    left: -60%;
  }
  to {
    left: 160%;
  }
}

.guide-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s;
}
.guide-profile:hover {
  background: rgba(255, 255, 255, 0.03);
}

.guide-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  flex-shrink: 0;
}
.guide-id-name {
  font-family: var(--fd);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}
.guide-id-role {
  font-family: var(--fb);
  font-size: 0.575rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.2rem;
}

.guide-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.guide-body::-webkit-scrollbar {
  width: 4px;
}
.guide-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.guide-heading {
  font-family: var(--fd);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.875rem;
  transition: opacity 0.15s;
}
.guide-heading.guide-arrive {
  animation: guideArrive 0.25s ease-out forwards;
}
@keyframes guideArrive {
  from {
    opacity: 0;
    transform: translateX(5px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.guide-text {
  font-size: 0.8125rem;
  line-height: 1.75;
  color: var(--muted);
  transition: opacity 0.15s;
}
.guide-text .ch-guide-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--white);
  margin: 0 0 0.875rem;
  line-height: 1.1;
  word-break: break-all;
}
.guide-text p + p {
  margin-top: 0.875rem;
}
.guide-breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}
.guide-breakdown td {
  padding: 0.3rem 0;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.guide-breakdown td:last-child {
  text-align: right;
  color: var(--white);
  font-weight: 600;
}
.guide-breakdown tr:last-child td {
  border-bottom: none;
}
.guide-pct {
  font-size: 0.7rem;
  color: #4ade80;
  font-weight: 400;
}
.guide-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.guide-body.fading .guide-heading,
.guide-body.fading .guide-text {
  opacity: 0;
}

.guide-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.guide-legal {
  font-family: var(--fb);
  font-size: 0.575rem;
  color: var(--dim);
  line-height: 1.6;
  margin-top: 0.75rem;
  text-align: center;
}

/* ─── MOBILE DRAWER BACKDROP ─────────────────────────────────── */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.32s ease;
}

/* ─── MOBILE TOOLBAR (mobile only) ──────────────────────────── */
.mobile-toolbar {
  display: none;
}

/* ─── SWIPE EDGE HINTS (mobile only) ─────────────────────────── */
.swipe-hint {
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  width: 20px;
  height: 64px;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: hintPulse 2s 1.2s ease-in-out 3 forwards;
  pointer-events: none;
}
.swipe-hint.left {
  left: 0;
  border-radius: 0 8px 8px 0;
  background: rgba(212, 168, 67, 0.15);
}
.swipe-hint.right {
  right: 0;
  border-radius: 8px 0 0 8px;
  background: rgba(212, 168, 67, 0.15);
}
.swipe-hint svg {
  color: var(--gold);
}
@keyframes hintPulse {
  0%,
  100% {
    opacity: 0;
  }
  40%,
  60% {
    opacity: 0.9;
  }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1000px) {
  body {
    display: grid;
    grid-template-areas: "tb" "ct";
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    align-items: stretch;
    justify-content: stretch;
    padding: 0.4rem;
    gap: 0.4rem;
    background: #e2e3e4;
    width: 100%;
    height: 100dvh;
  }

  .mobile-toolbar {
    grid-area: tb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem;
    height: 52px;
    flex-shrink: 0;
    z-index: 50;
    /* glass card - inherits .glass-panel base, overrides added below */
    background: #0b1221;
    border-radius: var(--panel-radius);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
      inset 0 2px 2px rgba(255, 255, 255, 0.2),
      inset 0 10px 20px rgba(255, 255, 255, 0.05),
      inset 0 -15px 30px rgba(0, 0, 0, 0.4),
      0 25px 50px -12px rgba(11, 18, 33, 0.5),
      0 15px 25px -10px rgba(11, 18, 33, 0.3);
  }

  .mob-tb-btn {
    background: none;
    border: none;
    color: var(--muted);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0.5rem;
    transition:
      color 0.2s,
      background 0.2s;
    flex-shrink: 0;
  }
  .mob-tb-btn:active {
    color: var(--gold);
    background: rgba(212, 168, 67, 0.1);
  }

  .mob-tb-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--fb);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: 0.01em;
  }

  .workspace {
    grid-area: ct;
    border-radius: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  #home-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow: visible;
  }

  #game-panel {
    flex: 1;
    min-height: 0;
    overflow: visible;
  }
  #game-panel::before,
  #game-panel::after {
    display: none;
  }

  .landing-hero {
    flex: 0 0 auto;
    padding: 1.25rem 1.5rem;
  }

  .lf-panel {
    position: fixed;
    inset: 0 auto 0 0;
    width: 82%;
    max-width: 320px;
    border-radius: 0 var(--panel-radius) var(--panel-radius) 0;
    border-left: none;
    z-index: 100;
    transform: translateX(-100%);
    transition:
      transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 0.35s;
    will-change: transform;
  }
  .lf-panel.open {
    transform: translateX(0);
    box-shadow:
      inset 0 2px 2px rgba(255, 255, 255, 0.2),
      inset 0 10px 20px rgba(255, 255, 255, 0.05),
      8px 0 40px rgba(0, 0, 0, 0.6);
  }

  .guide-panel {
    position: fixed;
    inset: 0 0 0 auto;
    width: 82%;
    max-width: 340px;
    border-radius: var(--panel-radius) 0 0 var(--panel-radius);
    border-right: none;
    z-index: 100;
    transform: translateX(100%);
    transition:
      transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 0.35s;
    will-change: transform;
  }
  .guide-panel.open {
    transform: translateX(0);
    box-shadow:
      inset 0 2px 2px rgba(255, 255, 255, 0.2),
      inset 0 10px 20px rgba(255, 255, 255, 0.05),
      -8px 0 40px rgba(0, 0, 0, 0.6);
  }

  .drawer-backdrop {
    display: block;
  }

  .calc-nav {
    display: none;
  }

  .hero-headline {
    font-size: clamp(1.4rem, 5vw, 2rem);
    margin-bottom: 0.75rem;
  }

  .hero-sub {
    font-size: 0.8rem;
  }

  /* ── Tighten hero card ── */
  .ch-hero {
    padding: 0.75rem 0.875rem 0.625rem;
    margin-bottom: 0.5rem;
  }
  .ch-p1 {
    margin-bottom: 0.5rem;
  }
  .ch-stats {
    padding-top: 0.5rem;
    margin-top: 0;
  }

  /* ── Fix wrapping label alignment ── */
  .slider-header {
    align-items: flex-start;
  }

  /* ── Tighten slider zone ── */
  .calc-inputs {
    padding: 1rem 1.25rem 0.75rem;
  }
  .calc-inputs .slider-group {
    margin-bottom: 0.5rem;
  }
}

/* ─── TFSA ───────────────────────────────────────────────────── */

.contrib-label-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contrib-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.35rem;
  padding: 2px;
  gap: 2px;
}

.contrib-toggle button {
  flex: 1;
  padding: 0.18rem 0.6rem;
  font-family: var(--fb);
  font-size: 0.65rem;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--muted);
  border-radius: 0.25rem;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}

.contrib-toggle button.active {
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold);
}

.contrib-equiv {
  font-size: 0.65rem;
  color: var(--dim);
  margin-top: 0.3rem;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}

/* ─── ARCADE ─────────────────────────────────────────────────── */

#game-panel {
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 1rem;
  display: flex;
}

.arcade-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  z-index: 10;
}

.arcade-content-area {
  flex: 1;
  min-height: 0;
  background: #fdf8f0;
  border-radius: 1rem;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.arcade-content-area::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  background-image: radial-gradient(circle, rgba(212, 168, 67, 0.15) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(ellipse 65% 65% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 65% 65% at 50% 50%, black 20%, transparent 100%);
  pointer-events: none;
}
#arc-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 1rem;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.arc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: #d4a843;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s;
  opacity: 0.6;
  flex-shrink: 0;
}
.arc-arrow:hover {
  opacity: 1;
}
#arc-prev {
  left: 6px;
}
#arc-next {
  right: 6px;
}

.arc-layout {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  padding: clamp(1rem, 3vh, 1.5rem) clamp(1.5rem, 5vw, 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  height: 100%;
  gap: 1.5rem;
}
.arc-hook {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  justify-content: center;
}
.arc-interaction {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  flex-shrink: 0;
}
.arc-sl-wrap {
  width: 100%;
}

.arc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.arc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  cursor: grab;
  box-shadow: 0 0 0 4px rgba(212, 168, 67, 0.15);
  transition:
    box-shadow 0.2s,
    transform 0.1s;
}
.arc-slider.hint::-webkit-slider-thumb {
  animation: arc-pulse 1.8s ease-in-out infinite;
}
@keyframes arc-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(212, 168, 67, 0.15);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(212, 168, 67, 0.25);
  }
}
.arc-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 7px rgba(212, 168, 67, 0.22);
}
.arc-slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.12);
}

.arc-sentence {
  font-family: var(--fb);
  font-size: clamp(1.15rem, 3.5vh, 1.6rem);
  font-weight: 700;
  color: var(--navy-2);
  line-height: 1.3;
  text-align: center;
  margin: 0;
}
.arc-sentence-sub {
  font-family: var(--fb);
  font-size: clamp(0.8rem, 2vh, 1rem);
  font-weight: 400;
  color: var(--dim);
  text-align: center;
  margin: 0;
}
.arc-accent {
  font-style: normal;
  color: var(--gold);
  font-weight: 700;
}
.arc-accent-sub {
  font-style: normal;
  color: var(--gold);
  font-weight: 600;
}

.arc-cta {
  font-family: var(--fb);
  font-size: clamp(0.65rem, 1.5vh, 0.72rem);
  color: var(--dim);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition:
    color 0.2s,
    gap 0.2s;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  cursor: pointer;
  flex-shrink: 0;
}
.arc-cta:hover {
  color: var(--gold);
  gap: 0.625rem;
  border-bottom-color: rgba(212, 168, 67, 0.3);
}
