@font-face {
  font-family: 'Ezra SIL';
  src: url('fonts/SILEOT.woff') format('woff');
  font-display: swap;
}

:root {
  --bg: #04050e;
  --glass: rgba(12, 14, 30, 0.55);
  --glass-2: rgba(16, 18, 38, 0.7);
  --line: rgba(150, 160, 220, 0.16);
  --gold: #e8c468;
  --text: #e9eaf6;
  --muted: #8b93b8;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, sans-serif; }

#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; }

#app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr 500px;
  grid-template-rows: 74px 1fr 50px;
  grid-template-areas:
    "rail topbar topbar"
    "rail stage  detail"
    "bottombar bottombar bottombar";
}

/* ---------- left rail ---------- */
#rail {
  grid-area: rail;
  display: flex; flex-direction: column;
  padding: 20px 14px; gap: 14px; overflow-y: auto;
  background: var(--glass); backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
}
.rail-title { font-family: "Cinzel", serif; font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); padding: 0 6px 4px; }
#lessons { display: flex; flex-direction: column; gap: 8px; }
/* accordion groups */
.acc { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.02); }
.acc-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 13px; background: none; border: none; cursor: pointer; font: inherit;
  font-family: "Cinzel", serif; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.acc-head:hover { color: var(--gold); }
.acc-caret { font-style: normal; font-size: 10px; color: var(--muted); transition: transform .2s; }
.acc.open .acc-caret { transform: rotate(180deg); }
.acc-body { display: none; flex-direction: column; padding: 2px 6px 8px; }
.acc.open .acc-body { display: flex; }
.lesson { text-align: left; padding: 8px 11px; margin: 1px 0; border: none; border-radius: 8px;
  background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; transition: all .15s; }
.lesson:hover { color: var(--text); background: rgba(255,255,255,.04); }
.lesson.active { color: var(--gold); background: rgba(232,196,104,.12); }

/* ---------- top bar ---------- */
#topbar {
  grid-area: topbar; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(10,12,28,.55), transparent);
}
.brand h1 { margin: 0; font-family: "Cinzel", serif; font-weight: 600; font-size: 24px; letter-spacing: .12em;
  color: #f1ecff; text-shadow: 0 0 22px rgba(150,120,255,.4); }
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); font-family: "EB Garamond", serif; font-style: italic; }
.actions { display: flex; gap: 10px; }
.actions button {
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 16px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted); transition: all .2s;
}
.actions button:hover { color: var(--text); border-color: rgba(232,196,104,.4); }
.actions .lamp { color: var(--gold); border-color: rgba(232,196,104,.5);
  box-shadow: 0 0 16px rgba(232,196,104,.3); }

/* ---------- stage ---------- */
#stage { grid-area: stage; position: relative; overflow: hidden; }
#tree-svg { width: 100%; height: 100%; display: block; }

/* tree text */
#tree-svg .he { font-family: "EB Garamond", serif; font-size: 46px; font-weight: 600; }
#tree-svg .it { font-family: "Cinzel", serif; font-size: 14px; letter-spacing: .12em; fill: rgba(233,234,246,.78); }
#tree-svg .badge-n { font-family: "Inter", sans-serif; font-size: 19px; font-weight: 600; fill: #e9eaf6; }
#tree-svg .glyph { font-family: "EB Garamond", serif; font-size: 27px; fill: rgba(233,226,255,.6); }
#tree-svg .node { cursor: pointer; }
#tree-svg .node .disc { transition: fill .2s; }
#tree-svg .node:hover .halo { stroke-width: 3; }
#tree-svg .node.selected .halo { stroke-width: 4; }
#tree-svg .node.selected .he { font-size: 50px; }

/* settings modal (Visualizzazione / Livelli / Sfondo) */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,6,16,.55); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: 340px; max-width: 90vw; padding: 20px 22px 22px;
  background: var(--glass-2); backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-family: "Cinzel", serif; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.modal-x { background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; }
.modal-x:hover { color: var(--text); }

/* viz panel — vertical, lives inside the settings modal */
#viz-panel { display: flex; flex-direction: column; gap: 18px; }
.viz-group { display: flex; flex-direction: column; gap: 3px; }
.viz-row { display: flex; flex-direction: column; gap: 2px; }
#viz-panel h2 { margin: 0 0 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  font-family: "Cinzel", serif; }
.viz { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin: 0;
  background: none; border: none; border-radius: 9px; color: var(--muted); cursor: pointer; font: inherit; font-size: 14px; }
.viz span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }
.viz:hover { color: var(--text); background: rgba(255,255,255,.03); }
.viz.active { color: var(--gold); }
.viz.active span { color: var(--gold); border-color: rgba(232,196,104,.55); box-shadow: 0 0 10px rgba(232,196,104,.3); }

/* ---------- detail (reading) panel ---------- */
#detail {
  grid-area: detail; margin: 16px 16px 0 0; padding: 26px 26px 24px;
  background: var(--glass-2); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 20px;
  overflow-y: auto;
}
#detail::-webkit-scrollbar { width: 8px; }
#detail::-webkit-scrollbar-thumb { background: rgba(150,160,220,.2); border-radius: 8px; }

.dt-head { display: flex; justify-content: space-between; align-items: flex-start; }
.dt-he { font-family: "EB Garamond", serif; font-size: 52px; line-height: 1; font-weight: 600; }
.dt-title { font-family: "Cinzel", serif; font-size: 16px; letter-spacing: .1em; margin-top: 10px; }
.dt-sub { color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.dt-emblem { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid; font-size: 26px; }
/* dynamic tarot cards in the panel header (in place of the star emblem) */
.dt-cards { display: flex; gap: 8px; flex: none; }
.dt-card { width: 68px; aspect-ratio: 164 / 298; object-fit: cover; border-radius: 9px;
  border: 1px solid; background: #0b0d1c; transition: transform .18s ease; cursor: pointer; }
.dt-card:hover { transform: translateY(-3px) scale(1.05); }
.dt-card:not([data-arcana]) { cursor: default; }

.dt-block { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.dt-block:first-of-type { border-top: none; }
.dt-block h3 { margin: 0 0 12px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  font-family: "Cinzel", serif; }
.dt-block p { margin: 0; line-height: 1.6; font-family: "EB Garamond", serif; font-size: 17px; color: #d7d9ec; }

.rows .row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed rgba(150,160,220,.08); font-size: 13px; }
.rows .row span { color: var(--muted); }
.rows .row b { font-weight: 500; }

.dt-he-row { display: flex; align-items: baseline; gap: 12px; }
.dt-he2 { font-family: "EB Garamond", serif; font-size: 52px; font-weight: 600; color: var(--muted); line-height: 1; }
/* natal sign panel: list of planets in the sign (no per-planet tarot) */
.planet-list { display: flex; flex-direction: column; gap: 2px; }
.pl-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; margin: 0;
  background: none; border: none; border-radius: 9px; cursor: pointer; font: inherit; text-align: left;
  color: var(--text); transition: background .15s; }
.pl-row:hover { background: rgba(255,255,255,.05); }
.pl-he { font-family: 'Ezra SIL', "EB Garamond", serif; font-size: 21px; line-height: 1; width: 22px; text-align: center; flex: none; }
.pl-glyph { width: 18px; text-align: center; font-size: 13px; flex: none; opacity: .8; }
.pl-name { font-size: 14px; flex: none; min-width: 80px; display: flex; flex-direction: column; gap: 1px; }
.pl-cusp { font-size: 11px; font-style: normal; color: var(--gold); letter-spacing: .02em; line-height: 1.1; }
.pl-row.pl-ghost { opacity: .5; }
.pl-cusp.ghost { color: var(--muted); }
.pl-cusp-note { color: var(--muted); }
.pl-formula { font-size: 13.5px; color: var(--text); flex: 1; }
/* back button (e.g. from a planet card back to its sign) */
.dt-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 5px 11px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; }
.dt-back:hover { color: var(--gold); border-color: rgba(232,196,104,.4); }
.pl-pos { font-size: 12px; color: var(--muted); margin-left: auto; letter-spacing: .02em; white-space: nowrap; }
.pl-pos .retro { color: #ff7a9a; font-weight: 700; }

.dt-meta { margin-top: 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dt-meta .retro { color: #ff7a9a; font-weight: 700; }
.dt-meta .abs-deg { color: var(--gold); font-weight: 600; }
.arcana { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.arc { display: flex; align-items: center; gap: 8px; padding: 8px 13px; font-size: 13.5px; color: var(--text);
  background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; }
.arc-ic { color: var(--gold); font-size: 12px; }

.aspects { display: flex; flex-direction: column; gap: 5px; }
.aspect { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 3px 0; }
.aspect .asp-sym { width: 18px; text-align: center; font-size: 15px; flex: none; }
.aspect .asp-name { color: var(--text); min-width: 96px; }
.aspect .asp-other { color: var(--muted); flex: 1; }
.aspect .asp-orb { color: var(--muted); font-size: 12px; flex: none; }

.links { display: flex; flex-direction: column; gap: 8px; }
.link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; font: inherit;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-align: left; transition: all .18s; }
.link:hover { background: rgba(255,255,255,.06); border-color: rgba(232,196,104,.3); }
.lk-num { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid; display: grid; place-items: center;
  font-size: 12px; color: var(--text); }
.lk-body { flex: 1; display: flex; flex-direction: column; }
.lk-body b { font-size: 14px; }
.lk-body i { font-size: 12px; color: var(--muted); font-style: normal; }
.lk-go { color: var(--muted); font-size: 20px; }

.approfondisci { width: 100%; margin-top: 26px; padding: 15px; cursor: pointer; font: inherit; font-size: 14px;
  letter-spacing: .12em; text-transform: uppercase; color: #efeaff;
  background: linear-gradient(135deg, rgba(120,90,220,.45), rgba(60,80,180,.4));
  border: 1px solid rgba(150,140,230,.4); border-radius: 14px;
  box-shadow: 0 0 22px rgba(110,90,220,.25); transition: all .2s; }
.approfondisci:hover { box-shadow: 0 0 30px rgba(140,110,255,.45); }

/* ---------- bottom bar ---------- */
#bottombar { grid-area: bottombar; display: flex; align-items: stretch; padding: 0 18px;
  border-top: 1px solid var(--line); background: rgba(8,10,22,.6); position: relative; }
.chips { display: flex; flex: 1; justify-content: center; align-items: stretch; }
.chip { display: flex; align-items: center; gap: 8px; padding: 0 20px; color: var(--muted); position: relative; }
.chip + .chip::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 16px; background: var(--line); }
.chip .ci { font-size: 13px; color: var(--muted); }
.chip > div { display: flex; align-items: baseline; gap: 6px; }
.chip b { font-size: 11.5px; color: var(--text); font-weight: 500; letter-spacing: .03em; }
.chip i { font-size: 11px; font-style: normal; color: var(--muted); }
.chip.active { color: var(--gold); }
.chip.active .ci { color: var(--gold); }
.chip.active b { color: var(--gold); }

/* ---------- natal input form (header) ---------- */
.natal-form { display: flex; align-items: center; gap: 10px; }
.field { display: flex; flex-direction: column; justify-content: center; padding: 5px 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; }
.field small { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
.field input { background: none; border: none; color: var(--text); font: inherit; font-size: 13px; outline: none; color-scheme: dark; }
.field.place { min-width: 168px; }
.field input::placeholder { color: rgba(139,147,184,.55); }
.natal-go { padding: 0 18px; height: 44px; border-radius: 12px; cursor: pointer; font: inherit; font-size: 13px; letter-spacing: .06em;
  color: #efeaff; background: linear-gradient(135deg, rgba(120,90,220,.5), rgba(60,80,180,.45));
  border: 1px solid rgba(150,140,230,.4); transition: box-shadow .2s; }
.natal-go:hover { box-shadow: 0 0 18px rgba(140,110,255,.45); }

/* path words (planets / signs) */
#tree-svg .word { font-family: "Inter", sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .5px; }

/* ---------- view switch + stage layout (tree / wheel) ---------- */
.view-switch { position: absolute; top: 14px; left: 14px; z-index: 6;
  display: flex; gap: 4px; padding: 3px; background: var(--glass-2); border: 1px solid var(--line);
  border-radius: 12px; backdrop-filter: blur(12px); }
.view-switch button { padding: 6px 12px; border: none; background: none; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 12px; border-radius: 9px; transition: all .18s; }
.view-switch button:hover { color: var(--text); }
.view-switch button.active { color: var(--gold); background: rgba(232,196,104,.14); }

#stage-canvas { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 3%; padding: 30px 2% 0; }
#tree-svg { height: 100%; width: auto; max-width: 100%; display: block; }
#wheel { position: relative; height: 82%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
#wheel-svg { width: 100%; height: 100%; }
#wheel-empty { position: absolute; max-width: 230px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5;
  font-family: "EB Garamond", serif; }
#wheel.ready #wheel-empty { display: none; }
#wheel-svg .wsign { font-size: 12px; font-family: "Cinzel", serif; font-weight: 600; letter-spacing: .04em; }
#wheel-svg .wband:hover { opacity: .4 !important; }
#wheel-svg .wplanet { font-size: 16px; }
#wheel-svg .wasc { font-size: 11px; letter-spacing: .1em; font-weight: 600; }
#wheel-svg .whouse { font-size: 10px; font-family: "Inter", sans-serif; }
#wheel-svg .wretro { font-size: 9px; font-weight: 700; }
/* cross-highlight: mirror the tree focus on the wheel (selected lit, rest dimmed) */
#wheel-svg .wband, #wheel-svg .wsign, #wheel-svg .wplanet-hit, #wheel-svg .wtick { transition: opacity .25s ease; }
#wheel-svg .wdim { opacity: .14 !important; }
#wheel-svg .wband.wsel { opacity: .6 !important; }
#wheel-svg .wsign.wsel { opacity: 1 !important; font-weight: 700; }
#wheel-svg .wplanet-hit.wsel circle { stroke-width: 2.6; }
/* selected planet: the dot breathes gently, its degree tick pulses (like the tree conduit) */
@keyframes wDotPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes wTickPulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
#wheel-svg .wplanet-hit.wsel { animation: wDotPulse 1.3s ease-in-out infinite; }
#wheel-svg .wtick.wsel { stroke-width: 3; animation: wTickPulse 1.1s ease-in-out infinite; }

#stage[data-view="albero"] #wheel { display: none; }
#stage[data-view="zodiaco"] #tree-svg { display: none; }
#stage[data-view="zodiaco"] #wheel { height: 92%; }
#stage[data-view="entrambi"] #tree-svg { height: 94%; }
#stage[data-view="entrambi"] #wheel { height: 66%; }

.natal-go.busy { opacity: .8; }

/* livelli section in viz panel */
.lay { display: flex; align-items: center; gap: 10px; padding: 7px 10px; color: var(--muted); font-size: 14px; cursor: pointer; border-radius: 8px; }
.lay input { accent-color: var(--gold); width: 15px; height: 15px; }
.lay:hover { color: var(--text); background: rgba(255,255,255,.03); }

@media (max-width: 1240px) {
  .natal-form .field small { display: none; }
  .field.place { min-width: 120px; }
}
@media (max-width: 1100px) {
  #app { grid-template-columns: 210px 1fr 360px; }
}

/* traditional Hebrew typeface for all Hebrew letters */
#tree-svg .he, #tree-svg .glyph, .dt-he, .dt-he2 { font-family: 'Ezra SIL', "EB Garamond", serif; }
.asp-phrase { color: var(--text); flex: 1; }

/* selected planet/sign: only its channels blink on the tree */
@keyframes conduitBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.18; } }
#tree-svg .conduit.blink { animation: conduitBlink 1.1s ease-in-out infinite; }
/* spotlight: when something blinks, the other conduits recede (no glow, lower opacity) */
#tree-svg .conduit.dimmed { opacity: 0.32 !important; filter: saturate(0.6) !important; transition: opacity .25s ease; }

/* ============================================================
   RESPONSIVE — mobile shell (see responsive.js). Desktop (>=980px)
   is unchanged; the rules below activate only under 980px.
   ============================================================ */

/* shared elements — hidden on desktop by default */
#nav-burger { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px;
  background: rgba(255,255,255,.04); color: var(--muted); font-size: 17px; place-items: center; cursor: pointer; flex: none; }
#nav-burger:hover { color: var(--text); }
#m-tabbar { display: none; border-top: 1px solid var(--line); background: rgba(8,10,22,.92); backdrop-filter: blur(14px);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
#m-tabbar button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 6px; background: none; border: none; color: var(--muted); font: inherit; font-size: 8.5px;
  letter-spacing: .02em; white-space: nowrap; cursor: pointer; }
#m-tabbar .ic { font-size: 16px; line-height: 1; }
#m-tabbar button.active { color: var(--gold); }
#m-tabbar button.active .ic { filter: drop-shadow(0 0 8px rgba(232,196,104,.5)); }
#m-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(3,4,12,.55); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .25s; }
#m-scrim.on { opacity: 1; }
#m-scrim[hidden] { display: none; }

/* drawer menu footer (settings) — only shown on mobile, inside the drawer */
.m-menu { display: none; }
.m-menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  background: none; border: none; border-radius: 8px; color: var(--muted); font: inherit; font-size: 13.5px;
  letter-spacing: .02em; cursor: pointer; }
.m-menu-item:hover { color: var(--gold); background: rgba(255,255,255,.04); }
.m-mi-ic { font-size: 15px; width: 18px; text-align: center; }

@media (max-width: 979px) {
  html, body { overflow: hidden; }
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "topbar" "stage" "mtab";
    height: 100dvh;
  }

  /* topbar */
  #nav-burger { display: grid; }
  #topbar { padding: 0 12px; gap: 10px; }
  #topbar .actions { display: none; }
  .brand h1 { font-size: 17px; letter-spacing: .06em; }
  .brand p { display: none; }

  /* rail -> left drawer */
  #rail { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: 282px; max-width: 84vw;
    transform: translateX(-104%); transition: transform .28s cubic-bezier(.4,0,.2,1); }
  body.m-rail #rail { transform: none; }
  /* natal form relocated into the drawer (by responsive.js) */
  #rail #natal { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0 4px 14px; }
  #rail #natal .field { width: 100%; }
  #rail #natal .field small { display: block; }
  #rail #natal .field.place { min-width: 0; }
  #rail #natal .natal-go { height: 44px; }
  /* settings entry pinned to the bottom of the drawer */
  .m-menu { display: block; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }

  /* detail -> bottom sheet */
  #detail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0;
    max-height: 82dvh; padding: 0 22px 26px; border-radius: 22px 22px 0 0; border-bottom: none;
    transform: translateY(101%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
  body.m-sheet #detail { transform: none; }
  .m-sheet-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: center;
    padding: 13px 0 10px; margin: 0 -22px 4px; background: linear-gradient(to bottom, var(--glass-2) 70%, rgba(16,18,38,0));
    touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
  .m-sheet-head:active { cursor: grabbing; }
  .m-grab { width: 46px; height: 5px; border-radius: 5px; background: rgba(150,160,220,.45); transition: background .2s, width .2s; }
  .m-sheet-head:active .m-grab { background: var(--gold); width: 60px; }
  .m-close { position: absolute; right: 14px; top: 4px; font-size: 24px; line-height: 1; padding: 0 4px;
    color: var(--muted); background: none; border: none; cursor: pointer; }
  .m-close:hover { color: var(--text); }

  /* bottom chips out, tab bar in */
  #bottombar { display: none; }
  #m-tabbar { display: flex; grid-area: mtab; }

  /* stage: full width; "Entrambi" stacks vertically */
  #stage-canvas { flex-direction: column; gap: 1.5%; padding: 56px 3% 8px; }
  #stage[data-view="entrambi"] #tree-svg { height: auto; width: auto; max-width: 92%; max-height: 52%; }
  #stage[data-view="entrambi"] #wheel { height: auto; width: min(70vw, 42vh); max-height: 46%; }
  /* solo Zodiaco: size the wheel by WIDTH so it fits a portrait screen */
  #stage[data-view="zodiaco"] #wheel { height: auto; width: min(92vw, 74vh); max-height: 100%; }
}
