/* Dev Life — every style of the game (AGENTS.md: no inline styles). SHARED FILE IN SECTIONS (spec/plan.md › Rules,
   spec/contracts.md › Shared files): a track writes only inside the section its header names as the owner, so the
   branches merge without conflicts. The colours are tokens on :root (base); a section may add its own tokens at its
   top. The roots (#scene, #hud, #tabbar, #sheet, #screen, #cards, #pop, #overlay, #banner) are in index.html. */


/* ── base · owner: the integrator ─────────────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #1d2233;            /* the page behind everything (the theme colour) */
  --ink: #eef1f7;           /* text on dark */
  --ink-dim: #a7b0c4;
  --panel: rgba(24, 29, 44, 0.94);
  --panel-line: rgba(255, 255, 255, 0.08);
  --accent: #f2b15a;        /* the lamp's warm light: the primary button */
  --accent-ink: #2a1d08;
  --good: #5fc48d;          /* ▲ */
  --bad: #e7876f;           /* ▼, soft, never alarming */
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 15px/1.4 var(--font); }
body { -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
html.cursor-hidden, html.cursor-hidden * { cursor: none !important; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(16px + var(--safe-left)); }
#overlay:not(:has(.panel:not([hidden]))) { display: none; }
.panel { width: min(520px, 100%); max-height: 100%; overflow: auto; padding: 24px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--panel-line); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); }

button.primary { min-height: 48px; padding: 0 28px; border: 0; border-radius: 24px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 17px; }
button.primary:hover { filter: brightness(1.06); }

/* the language switcher (docs/languages.md: the gallery's pill) */
.langPick { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 4px; border-radius: 22px;
  background: rgba(13, 27, 42, 0.85); border: 1px solid rgba(255, 255, 255, 0.08); }
.langPick button { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 16px;
  background: none; color: #9fb0c3; font: 600 12px var(--font); letter-spacing: 0.04em; }
.langPick button:hover { background: rgba(255, 255, 255, 0.08); color: #e8eef5; }
@media (pointer: coarse) { .langPick button { height: 44px; } }
.langPick button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.16); color: #e8eef5; }
.langPick img { width: 21px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15); opacity: 0.6; }
.langPick button:hover img, .langPick button[aria-pressed="true"] img { opacity: 1; }

/* a term of the trade in a text (ui/glossary.js) */
.term { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }



/* ── start · owner: the integrator (placeholder), session 2 · track D (ui/start.js) ─────────────────────────────── */

#start { text-align: center; }
#start h1 { margin: 12px 0 6px; font-size: 40px; letter-spacing: 0.02em; }
#start .tagline { margin: 0 0 14px; color: var(--ink-dim); }
#start .note { margin: 0 0 16px; font-size: 13px; color: var(--ink-dim); }
#start .lifeLine { margin: 0 0 16px; font-weight: 600; }



/* ── common · owner: session 2 · track D ──────────────────────────────────────────────────────────────────────── */
/* The UI kit's look: a warm lo-fi evening. Dark glass for what sits over the scene (the HUD, the tabs, the menus),
   cream paper for what is read (cards, Why? sheets, the bubble, the Dictionary). Touch targets are 44 px on touch. */

:root {
  --paper: #f7efe1;         /* cards, sheets, bubbles */
  --paper-2: #eee2cd;
  --paper-line: #e0d0b6;
  --paper-ink: #3b3026;
  --paper-dim: #7b6a57;
  --paper-up: #2e8655;      /* ▲ on paper */
  --paper-down: #bf563d;    /* ▼ on paper */
  --glass: rgba(21, 25, 39, 0.82);
  --glass-line: rgba(255, 255, 255, 0.09);
  --sheet: #232838;         /* an open tab */
  --sheet-2: #2c3247;
  --sheet-line: rgba(255, 255, 255, 0.08);
  --b1: #6cc58f;            /* the meters' bands: ≥ 70 */
  --b2: #e3c35e;            /* 40–69 */
  --b3: #efa04d;            /* 20–39 */
  --b4: #e98a74;            /* below 20: soft, never alarming */
  --likely: #63c08a;
  --maybe: #e3b65a;
  --longshot: #dc8d73;
  --tap: 36px;              /* a button's least height (44 px on touch, below) */
  --top-h: 60px;            /* the top bar's height: what sits under it */
  --bar-h: 64px;            /* the tab bar's height */
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.42);
}
@media (pointer: coarse) {
  :root { --tap: 44px; }
  /* the small variants keep their look but not a small target on touch */
  html button.ghost.small, html button.link.small, html .seg button, html .chip { min-height: var(--tap); }
  .seg button, .chip { min-width: var(--tap); }
  /* the top bar's buttons and speeds */
  html .tbMoney { height: var(--tap); }
  html .tbIcon { width: var(--tap); height: var(--tap); }
  html .speeds .sp { min-width: var(--tap); }
}

.up { color: var(--good); }
.down { color: var(--bad); }
.flat { color: var(--ink-dim); }
.paper { background: var(--paper); color: var(--paper-ink); }
.paper .up { color: var(--paper-up); }
.paper .down { color: var(--paper-down); }

button.ghost { min-height: var(--tap); padding: 0 16px; border-radius: 22px; border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.07); font-weight: 600; }
button.ghost:hover:not([disabled]) { background: rgba(255, 255, 255, 0.13); }
button.ghost.small { min-height: 30px; padding: 0 12px; font-size: 13px; }
button.ghost.danger { color: var(--bad); }
button[disabled] { opacity: 0.5; cursor: default; }
.paper button.ghost { border-color: var(--paper-line); background: rgba(0, 0, 0, 0.04); }
.paper button.ghost:hover:not([disabled]) { background: rgba(0, 0, 0, 0.08); }
button.link { min-height: var(--tap); padding: 0 6px; border: 0; background: none; color: var(--accent); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; }
.paper button.link { color: #a3611c; }
button.x { flex: none; width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: rgba(127, 127, 127, 0.16);
  font-size: 22px; line-height: 1; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 22px; background: rgba(0, 0, 0, 0.28); }
.seg button { min-height: var(--tap); padding: 0 14px; border: 0; border-radius: 19px; background: none; color: var(--ink-dim); font-weight: 600; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg button small { display: block; font-weight: 400; font-size: 11px; opacity: 0.85; }
.seg.wide { display: flex; width: 100%; }
.seg.wide button { flex: 1; }
.chip { min-height: var(--tap); padding: 0 12px; border-radius: 18px; border: 1px solid var(--glass-line); background: rgba(255, 255, 255, 0.06); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.paper .chip { border-color: var(--paper-line); background: #fff8ec; color: var(--paper-ink); }
.paper .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* no text under 11 px (tools/device-check.js): a <small> in a 12 px line stays readable */
small { font-size: max(11px, 0.83em); }

.hint { margin: 6px 0; font-size: 13px; color: var(--ink-dim); }
.hint.small { font-size: 12px; }
.paper .hint { color: var(--paper-dim); }
.btnRow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.btnRow.center { justify-content: center; }
.btnRow.end { justify-content: flex-end; }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.pill { padding: 2px 10px; border-radius: 10px; background: rgba(242, 177, 90, 0.18); color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap; }

input[type="text"], input[type="date"], input[type="search"], select { min-height: var(--tap); padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--glass-line); background: rgba(0, 0, 0, 0.28); color: inherit; font: inherit; user-select: text; -webkit-user-select: text; }
select option { color: #222; }
input[type="range"] { accent-color: var(--accent); min-height: var(--tap); margin: 0; }
.paper input[type="text"], .paper input[type="search"], .paper select { background: #fffaf2; border-color: var(--paper-line); color: var(--paper-ink); }

.term.new { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.paper .term { text-decoration-color: #b0782e; }
.newMark { display: inline-block; margin-left: 1px; font-size: 0.72em; vertical-align: 0.45em; animation: sparkle 1.6s ease-in-out infinite; }
@keyframes sparkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(0.85); } }

#banner { position: fixed; z-index: 60; top: calc(var(--top-h) + 14px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  max-width: min(520px, calc(100% - 32px)); padding: 10px 18px; border-radius: 22px; background: var(--paper); color: var(--paper-ink);
  box-shadow: var(--shadow); font-weight: 600; text-align: center; pointer-events: none; }
#banner.show { animation: bannerIn 0.25s ease-out; }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }



/* ── hud · owner: session 2 · track D ─────────────────────────────────────────────────────────────────────────── */
/* Desktop: the top bar across, the meters down the left, the now line and the feed above the tab bar. A phone held
   upright: the top bar in two rows, the meters a strip of 5 over the tab bar. Sideways: a slim bar, the meters two
   narrow columns of icons. */

#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud .topbar, #hud .meters, #hud .lower > * { pointer-events: auto; }

.topbar { position: absolute; top: calc(8px + var(--safe-top)); left: calc(8px + var(--safe-left)); right: calc(8px + var(--safe-right));
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 5px 6px 5px 16px; border-radius: 26px;
  background: var(--glass); border: 1px solid var(--glass-line); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.tbRow { display: contents; }
.tbWhen { order: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.speeds { order: 2; }
.tbWho { order: 3; }
.tbMoney { order: 4; }
.tbIcon[data-dict] { order: 5; }
.tbIcon[data-menu] { order: 6; }
.tbDate { font-weight: 600; }
.tbTime { margin-left: 4px; color: var(--accent); font-weight: 700; }
.speeds { display: flex; gap: 2px; padding: 3px; border-radius: 22px; background: rgba(0, 0, 0, 0.3); }
.speeds .sp { min-width: 40px; height: var(--tap); padding: 0 9px; border: 0; border-radius: 19px; background: none; color: var(--ink-dim);
  font-size: 12px; letter-spacing: -3px; white-space: nowrap; }
.speeds .sp:hover { color: var(--ink); }
.speeds .sp[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.skipBar { display: inline-block; width: 2px; height: 0.95em; margin-left: 4px; border-radius: 1px; background: currentColor; vertical-align: -0.14em; }
.tbWho { flex: 1; min-width: 0; overflow: hidden; text-align: right; white-space: nowrap; text-overflow: ellipsis; }
.tbTitle { color: var(--ink-dim); }
.tbTitle:not(:empty)::before { content: '· '; }
.tbMoney { height: 40px; padding: 0 14px; border: 0; border-radius: 20px; background: rgba(242, 177, 90, 0.15); white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.tbMoney b { font-size: 16px; }
.tbMoney .trend { font-size: 11px; }
.tbIcon { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); font-size: 18px; }
.tbMoney:hover, .tbIcon:hover { filter: brightness(1.25); }

.meters { position: absolute; top: calc(var(--top-h) + 16px + var(--safe-top)); left: calc(8px + var(--safe-left)); width: 188px;
  display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-line); }
.meter { position: relative; display: grid; grid-template-columns: 24px 1fr 20px; grid-template-areas: "i n a" "i b a"; align-items: center;
  column-gap: 8px; row-gap: 3px; min-height: max(38px, var(--tap)); padding: 3px 8px; border: 0; border-radius: 12px; background: none; text-align: left; }
.meter:hover { background: rgba(255, 255, 255, 0.07); }
.mIcon { grid-area: i; font-size: 18px; text-align: center; }
.mName { grid-area: n; font-size: 12px; line-height: 1.1; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mBar { grid-area: b; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.mBar i { display: block; height: 100%; border-radius: 3px; background: var(--b1); transition: width 0.4s; }
.meter.b2 .mBar i { background: var(--b2); }
.meter.b3 .mBar i { background: var(--b3); }
.meter.b4 .mBar i { background: var(--b4); }
.mArrow { grid-area: a; font-size: 10px; letter-spacing: -2px; text-align: center; }
.mArrow.up { color: var(--good); }
.mArrow.down { color: var(--bad); }
.mArrow.flat { color: var(--ink-dim); }
.meter.flame { grid-template-areas: "i n n" "i n n"; background: rgba(239, 160, 77, 0.14); }
.meter.flame .mName { color: var(--b3); font-weight: 600; }

.lower { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar-h) + 18px + var(--safe-bottom));
  width: min(640px, calc(100% - 440px)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
/* a tab open: the now line between the meters' column and the side panel */
body.tabOpen .lower { left: calc(212px + var(--safe-left)); right: calc(456px + var(--safe-right)); width: auto; transform: none; }
.nowLine { max-width: 100%; min-height: max(40px, var(--tap)); padding: 0 18px; border-radius: 20px; border: 1px solid var(--glass-line); background: var(--glass);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowLine .until { color: var(--ink-dim); }
.feed { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; max-width: 100%; min-height: var(--tap); padding: 2px 8px; border: 0; background: none;
  color: var(--ink-dim); font-size: 12.5px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.feed .fl { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .fl:first-child { color: var(--ink); }
.nudge { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 14px; border-radius: 18px; background: rgba(60, 44, 22, 0.88);
  border: 1px solid rgba(242, 177, 90, 0.45); color: #ffd9a3; font-size: 13px; }
.nudge .nudgeX { flex: none; min-width: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: #ffd9a3; font-size: 14px; cursor: pointer; }
.nudge .nudgeX:hover { background: rgba(255, 255, 255, 0.08); }
@media (pointer: coarse) { .nudge .nudgeX { min-width: var(--tap); min-height: var(--tap); } }

/* compact meters: icons and thin bars (a phone upright or sideways) */
@media (max-width: 600px) and (orientation: portrait), (max-height: 500px) {
  .meter { grid-template-columns: 1fr; grid-template-areas: "i" "b"; justify-items: center; min-height: 44px; padding: 5px 2px 4px; row-gap: 4px; }
  .mName { display: none; }
  .mBar { width: 78%; height: 4px; }
  .mArrow { position: absolute; top: 1px; right: 3px; font-size: 8px; }
  .meter.flame { grid-template-areas: "i"; }
}

@media (max-width: 600px) and (orientation: portrait) {
  :root { --top-h: 110px; --bar-h: 62px; }
  .topbar { left: calc(6px + var(--safe-left)); right: calc(6px + var(--safe-right)); flex-direction: column; align-items: stretch; gap: 4px;
    padding: 4px 4px 4px 12px; border-radius: 22px; min-height: 0; }
  .tbRow { display: flex; align-items: center; gap: 6px; }
  .tbRow .tbWhen { flex: 1; }
  .tbRow .tbWho { flex: 1; text-align: right; }
  .tbMoney { height: 44px; padding: 0 12px; }
  .tbIcon { width: 44px; height: 44px; }
  .speeds { margin-left: -8px; }
  .speeds .sp { min-width: 44px; padding: 0 6px; }
  .tbTitle { display: none; }
  /* the meters' strip over the now line and the feed (each a touch target): 5 a row, 6 from the 11th meter */
  .meters { top: auto; left: calc(8px + var(--safe-left)); right: calc(8px + var(--safe-right)); width: auto;
    bottom: calc(var(--bar-h) + 18px + 2 * max(38px, var(--tap)) + var(--safe-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 4px; }
  .meters:has(> .meter:nth-child(11)) { grid-template-columns: repeat(6, 1fr); }
  .lower { width: calc(100% - 16px); bottom: calc(var(--bar-h) + 8px + var(--safe-bottom)); gap: 4px; }
  body.tabOpen .lower { left: 50%; right: auto; width: calc(100% - 16px); transform: translateX(-50%); }
  .nowLine { min-height: max(38px, var(--tap)); font-size: 14px; }
  .feed { min-height: max(22px, var(--tap)); }
  .feed .fl:not(:first-child) { display: none; }
}

@media (max-height: 500px) {
  :root { --top-h: 48px; --bar-h: 52px; }
  .topbar { top: calc(4px + var(--safe-top)); min-height: 48px; padding: 2px 4px 2px 14px; gap: 8px; }
  .speeds { padding: 0; }
  .tbTitle { display: none; }
  .tbMoney, .tbIcon { height: 44px; }
  .tbIcon { width: 44px; }
  .meters { top: calc(var(--top-h) + 10px + var(--safe-top)); width: auto; display: grid; grid-template-columns: repeat(2, 46px); gap: 2px; padding: 4px; border-radius: 14px; }
  .lower { bottom: calc(var(--bar-h) + 10px + var(--safe-bottom)); width: min(460px, calc(100% - 300px)); }
  body.tabOpen .lower { display: none; }
  .feed { display: none; }
}
/* a small phone sideways (667 px): the top bar's row squeezed so ☰ stays on the screen */
@media (max-height: 500px) and (max-width: 720px) {
  .topbar { gap: 6px; padding-left: 12px; }
  .tbWhen { font-size: 14px; }
  .tbMoney { padding: 0 10px; }
}
/* a tablet held upright: the scene across the top, the meters a strip of icons under it (as on a phone), the open
   tab a sheet over the lower half */
@media (orientation: portrait) and (min-width: 601px) {
  .meters { top: auto; left: calc(8px + var(--safe-left)); right: calc(8px + var(--safe-right)); width: auto;
    bottom: calc(var(--bar-h) + 36px + max(40px, var(--tap)) + 3 * 18px + var(--safe-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 4px; }
  .meter { grid-template-columns: 1fr; grid-template-areas: "i" "b"; justify-items: center; min-height: 44px; padding: 5px 2px 4px; row-gap: 4px; }
  .mName { display: none; }
  .mBar { width: 78%; height: 4px; }
  .mArrow { position: absolute; top: 1px; right: 3px; font-size: 8px; }
  .meter.flame { grid-template-areas: "i"; }
  .lower { width: min(640px, calc(100% - 32px)); }
  body.tabOpen .lower { left: 50%; right: auto; width: min(640px, calc(100% - 32px)); transform: translateX(-50%); }
}



/* ── card · owner: session 2 · track D ────────────────────────────────────────────────────────────────────────── */
/* A paper card over a dimmed scene: centred on a desktop, a bottom sheet on a phone held upright, the text beside
   the choices on a phone held sideways. Only the top card of a stack shows. */

#cards { position: fixed; inset: 0; z-index: 30; }
.cardWrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(16px + var(--safe-left)); }
.cardWrap.under { display: none; }
.cardShade { position: absolute; inset: 0; background: rgba(10, 12, 22, 0.5); animation: fade 0.2s; }
.card { position: relative; width: min(440px, 100%); max-height: 100%; overflow: auto; border-radius: 22px; box-shadow: var(--shadow); animation: rise 0.22s ease-out; }
.cardWrap.wide .card { width: min(780px, 100%); }
.cardArt { position: relative; height: 104px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(circle at 70% 30%, #ffd9a0 0, transparent 45%), linear-gradient(160deg, #f1c27f 0%, #e09a77 45%, #7f6aa6 100%); }
.cardArt canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cardArt.drawn .cardIcon { display: none; }
.cardIcon { font-size: 50px; filter: drop-shadow(0 4px 8px rgba(60, 30, 10, 0.35)); }
.cardMain { padding: 14px 20px 2px; }
.cardMain h2 { margin: 0 0 6px; font-size: 21px; line-height: 1.25; }
.cardText p { margin: 0 0 6px; line-height: 1.45; }
.cardWhy { margin: 2px 0 6px; padding: 6px 10px; border-radius: 10px; background: #fbe3cf; color: #8a4a22; font-size: 13.5px; line-height: 1.4; }
.choices { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 18px; }
.choice { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-height: 52px; padding: 10px 14px; border-radius: 14px;
  border: 1.5px solid var(--paper-line); background: #fffaf1; color: var(--paper-ink); text-align: left; }
.choice:hover:not([disabled]) { border-color: #d9a25a; background: #fff3df; }
.choice.primary { border-color: var(--accent); background: #fde8c6; }
/* a harmless choice (OK, Later) is a button.primary too: keep the choice's own box, not the round base button's */
button.choice.primary { min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--accent); border-radius: 14px; color: var(--paper-ink);
  font-size: inherit; font-weight: inherit; justify-content: center; }
button.choice.primary:only-child { text-align: center; }
.cLabel { font-weight: 700; font-size: 16px; }
.cWhy { font-size: 12px; color: var(--paper-dim); }

.fx { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.fxi { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.08);
  font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fxi b { font-size: 10px; letter-spacing: -2px; }
.fxi.up { color: var(--good); }
.fxi.down { color: var(--bad); }
.fxi.money { font-weight: 700; }
.fxi.odds { display: inline-block; white-space: normal; }
.fxi.odds em { font-style: normal; font-weight: 700; }
.fxi.odds.likely em { color: var(--likely); }
.fxi.odds.maybe em { color: var(--maybe); }
.fxi.odds.longshot em { color: var(--longshot); }
.paper .fxi { background: rgba(80, 50, 20, 0.06); color: var(--paper-ink); }
.paper .fxi.up { color: var(--paper-up); }
.paper .fxi.down { color: var(--paper-down); }
.paper .fxi.odds { background: rgba(110, 80, 170, 0.08); }
.paper .fxi.odds.likely em { color: var(--paper-up); }
.paper .fxi.odds.maybe em { color: #9a6a12; }
.paper .fxi.odds.longshot em { color: var(--paper-down); }

@media (max-width: 600px) and (orientation: portrait) {
  .cardWrap { align-items: flex-end; padding: calc(40px + var(--safe-top)) 0 0; }
  .card { width: 100%; max-height: 100%; border-radius: 24px 24px 0 0; padding-bottom: var(--safe-bottom); }
  .cardArt { height: 92px; }
}
@media (max-height: 500px) {
  .card { width: min(780px, 100%); display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; }
  .cardArt { grid-column: 1; height: 64px; border-radius: 22px 0 0 0; }
  .cardIcon { font-size: 36px; }
  .cardMain { grid-column: 1; padding: 10px 16px; }
  .cardMain h2 { font-size: 18px; }
  .choices { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: 12px; }
}



/* ── routine · owner: session 2 · track D ─────────────────────────────────────────────────────────────────────── */
/* The 🗓️ Day tab: the ring over the sliders (beside them on a phone held sideways), the weekly arrows, the presets. */

.rtMain { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.rtRing { position: relative; width: 176px; height: 176px; margin: 0 auto; }
.ring { display: block; width: 100%; height: 100%; }
.ring .arc { stroke: var(--sheet); stroke-width: 1.5; }
.ring .tick { fill: var(--ink-dim); font: 600 9px var(--font); text-anchor: middle; dominant-baseline: middle; opacity: 0.8; }
.ringMid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; color: var(--ink-dim); pointer-events: none; }
.ringMid b { max-width: 84px; color: var(--ink); font-size: 12px; text-align: center; line-height: 1.15; }
.rtRows { display: flex; flex-direction: column; gap: 2px; }
.rtRow { display: grid; grid-template-columns: minmax(132px, 1.2fr) var(--tap) minmax(64px, 2fr) var(--tap) 40px; align-items: center;
  column-gap: 6px; min-height: var(--tap); }
.raName { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.raName::before { content: ''; display: inline-block; width: 4px; height: 16px; margin-right: 6px; border-radius: 2px; background: var(--c); vertical-align: -3px; }
.rtRow input[type="range"] { width: 100%; accent-color: var(--c); }
.step { height: var(--tap); border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); font-size: 18px; font-weight: 700; }
.step:hover { background: rgba(255, 255, 255, 0.15); }
.raVal { text-align: right; font-variant-numeric: tabular-nums; }
.rtRow.fixed { color: var(--ink-dim); }
.raFixed { grid-column: 2 / span 3; font-size: 12px; font-style: italic; }
.raNote { grid-column: 1 / -1; margin-top: -6px; font-size: 11.5px; color: var(--b3); }
.raNote:empty { display: none; }
.rtFx .fxRow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.fxw { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 10px; border-radius: 12px;
  border: 1px solid var(--sheet-line); background: rgba(255, 255, 255, 0.05); }
.fxw b { font-size: 10px; letter-spacing: -2px; }
.fxw.up b { color: var(--good); }
.fxw.down b { color: var(--bad); }
.fxw.flat b { color: var(--ink-dim); }
.fxw small { font-size: 11px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.rtChoices { display: flex; flex-direction: column; gap: 8px; }
.rtChoice { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rtChoice select { max-width: 55%; }
.rtChoice.share { flex-direction: column; align-items: stretch; gap: 2px; }
/* which skills to learn: a folded multi-pick of the skills in focus, the skill learned now under it */
.rtLearnPick > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: var(--tap); cursor: pointer; }
.rtLearnPick > summary::-webkit-details-marker { display: none; }
.rtLearnPick > summary > span { flex: 1; }
.rtLearnPick > summary b { max-width: 55%; text-align: right; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
.rtLearnPick > summary::after { content: ''; flex: none; width: 7px; height: 7px; margin: 0 4px 4px; border-right: 2px solid var(--ink-dim);
  border-bottom: 2px solid var(--ink-dim); transform: rotate(45deg); }
.rtLearnPick[open] > summary::after { margin-bottom: 0; transform: rotate(-135deg); }
.rtLearnPick > .hint { margin: 2px 0 6px; }
.rtSkills { display: flex; flex-wrap: wrap; gap: 6px; }
.rtSkills .chip { font-size: 13px; }
.rtSkills .chip.now { border-color: var(--accent); }
.rtLearnNow { margin: 2px 0 0; }
.shareVal { color: var(--accent); }

@media (max-height: 500px) {
  .rtMain { grid-template-columns: 120px 1fr; align-items: start; }
  .rtRing { width: 120px; height: 120px; position: sticky; top: 0; }
}
/* a narrow sheet (a small phone upright, a phone sideways): the name may take two lines, the slider less room */
@media (max-width: 420px), (max-height: 500px) {
  .rtRow { grid-template-columns: minmax(80px, 1.2fr) var(--tap) minmax(48px, 2fr) var(--tap) 38px; column-gap: 4px; }
  .raName { white-space: normal; line-height: 1.15; }
  .raFixed { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}



/* ── tabs · owner: session 2 · track D (the host, 🎓, 💰); later tabs in their owners' sections ─────────────────── */
/* The tab bar (a pill at the bottom; a full-width bar on a phone held upright) and the open tab: a side panel on a
   desktop, a sheet over the scene on a phone. .tCard / .tRow are the blocks every tab may use. */

#tabbar { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-bottom)); }
.tabs { display: flex; gap: 4px; padding: 5px; border-radius: 30px; background: var(--glass); border: 1px solid var(--glass-line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.tabBtn { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: none;
  color: var(--ink-dim); font-weight: 600; white-space: nowrap; }
.tabBtn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.tabBtn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.tIcon { font-size: 18px; }

#sheet { position: fixed; z-index: 15; top: calc(var(--top-h) + 16px + var(--safe-top)); right: calc(8px + var(--safe-right));
  bottom: calc(var(--bar-h) + 20px + var(--safe-bottom)); width: 440px; display: flex; flex-direction: column; border-radius: 20px;
  background: var(--sheet); border: 1px solid var(--sheet-line); box-shadow: var(--shadow); animation: rise 0.2s ease-out; }
.sheetHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 4px 18px; }
.sheetHead h2 { margin: 0; font-size: 18px; }
.sheetBody { flex: 1; overflow: auto; padding: 0 18px 18px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheetBody h3 { margin: 18px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-dim); }
.sheetBody h3:first-child { margin-top: 6px; }

.tCard { display: block; width: 100%; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--sheet-line); background: var(--sheet-2);
  color: inherit; text-align: left; font: inherit; }
button.tCard:hover { border-color: rgba(242, 177, 90, 0.4); }
.tRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; padding: 3px 0; }
.tRow b { text-align: right; font-variant-numeric: tabular-nums; }
.tRow > .seg { flex: none; flex-wrap: nowrap; }  /* a wrapped seg keeps its one-line width: never wrap in a row */
.tRow.total { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--sheet-line); }
.tFoot { margin: 26px 0 6px; text-align: center; }
.note.warm { padding: 8px 12px; border-radius: 12px; background: rgba(242, 177, 90, 0.14); color: #ffd9a3; font-size: 13px; }

/* 🎓 */
.subjects { display: flex; flex-direction: column; gap: 8px; }
.subj { padding: 10px 14px; border-radius: 14px; background: var(--sheet-2); }
.subjTop { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.subjSub { margin-top: 5px; font-size: 12px; color: var(--ink-dim); }
.chance { min-height: max(32px, var(--tap)); padding: 0 12px; border: 0; border-radius: 16px; font-size: 13px; font-weight: 700; }
.chance.likely { background: rgba(99, 192, 138, 0.18); color: var(--likely); }
.chance.maybe { background: rgba(227, 182, 90, 0.18); color: var(--maybe); }
.chance.longshot { background: rgba(220, 141, 115, 0.18); color: var(--longshot); }
.grade { font-weight: 700; color: var(--accent); }
.grade.g0 { color: var(--bad); }
.ujJobs { display: flex; flex-direction: column; gap: 8px; }   /* the student jobs: one card each */
.ujJob .tRow { min-height: 0; }
.ujJob .hint.small { margin: 2px 0 0; }
.ujJob .btnRow { margin: 6px 0 0; }
.ujJob .lnWhy { font-size: 12px; color: var(--ink-dim); }
.sheetBody[data-tab="uni"] > .tCard + .tCard { margin-top: 8px; }   /* the job taken, the internship, the part-time offer */
.chanceTxt.likely { color: var(--likely); }
.chanceTxt.maybe { color: var(--maybe); }
.chanceTxt.longshot { color: var(--longshot); }
.uniStudy .ckChoices { margin-top: 6px; }
.uniLines { margin: 8px 0 0; padding-left: 0; }   /* the confirmation card's conditions, a line each */
.uniLines li { padding: 3px 0; }

/* 💰 */
.accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.acct { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "i n" "i v"; column-gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--sheet-2); }
.aIcon { grid-area: i; align-self: center; font-size: 22px; }
.aName { grid-area: n; font-size: 12px; color: var(--ink-dim); }
.acct b { grid-area: v; font-size: 18px; font-variant-numeric: tabular-nums; }
.acct.worth b { color: var(--accent); }
.monthCard { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; cursor: pointer; }
.monthCard h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-dim); }
.monthCard .tRow.total { grid-column: 1 / -1; }
.mcCol .tRow { min-height: 0; padding: 2px 0; font-size: 13.5px; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 112px; padding: 10px 10px 0; border-radius: 14px; background: var(--sheet-2); }
.cMonth { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.cBars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.cBars i { width: 40%; max-width: 12px; min-height: 2px; border-radius: 3px 3px 0 0; }
.cIn { background: var(--good); }
.cOut { background: var(--bad); }
.cMonth span { padding: 3px 0; font-size: 11px; color: var(--ink-dim); }
.cMonth.now span { color: var(--accent); font-weight: 700; }
.legend { display: flex; gap: 14px; margin: 6px 2px; font-size: 12px; color: var(--ink-dim); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
.lIn::before { background: var(--good); }
.lOut::before { background: var(--bad); }
.moveRow + .moveRow { margin-top: 0; }   /* Move money: into savings, then back to the account */
.mnFx { margin: 4px 0 0; padding-left: 18px; }   /* what paying the mortgage early does, a line per step */
.mnFx li { padding: 1px 0; }
.mnFund b.up { color: var(--good); }
.mnFund b.down { color: var(--bad); }
.tCard b small, .lfMove b small { font-weight: 400; font-size: 12px; color: var(--ink-dim); }
/* the index fund's market month by month: green up from the middle line, red down */
.fundChart { display: flex; gap: 4px; height: 96px; margin-top: 8px; padding: 8px 10px 0; border-radius: 14px; background: var(--sheet-2); }
.fMonth { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.fUp, .fDown { flex: 1; width: 100%; display: flex; justify-content: center; }
.fUp { align-items: flex-end; border-bottom: 1px solid var(--sheet-line); }
.fDown { align-items: flex-start; }
.fUp i, .fDown i { width: 50%; max-width: 12px; }
.fUp i { background: var(--good); border-radius: 3px 3px 0 0; }
.fDown i { background: var(--bad); border-radius: 0 0 3px 3px; }
.fMonth span { padding: 3px 0; font-size: 11px; color: var(--ink-dim); }

@media (max-width: 600px) and (orientation: portrait) {
  #tabbar { left: 0; right: 0; transform: none; bottom: 0; }
  .tabs { justify-content: space-around; padding: 4px 4px calc(4px + var(--safe-bottom)); border-radius: 18px 18px 0 0; border-width: 1px 0 0; }
  .tabBtn { flex: 1; flex-direction: column; justify-content: center; gap: 0; min-height: 52px; padding: 2px 4px; font-size: 11px; border-radius: 14px; }
  .tIcon { font-size: 22px; }
  .tabs.many { gap: 2px; }   /* eight tabs (🎓 and 💼 both): icons only, as a phone held sideways shows them */
  .tabs.many .tTitle { display: none; }
  .tabs.many .tabBtn { min-width: 0; padding: 2px 0; }
  #sheet { top: calc(var(--top-h) + 12px + var(--safe-top)); left: 0; right: 0; bottom: calc(var(--bar-h) + var(--safe-bottom)); width: auto;
    border-radius: 22px 22px 0 0; border-width: 1px 0 0; }
}
@media (orientation: portrait) and (min-width: 601px) {
  #sheet { top: 44%; left: calc(8px + var(--safe-left)); width: auto; }
}
@media (max-height: 500px) {
  #tabbar { bottom: calc(4px + var(--safe-bottom)); }
  .tabs { padding: 3px; }
  .tabBtn .tTitle { display: none; }
  .tabBtn { min-height: 44px; padding: 0 14px; }
  #sheet { top: calc(var(--top-h) + 10px + var(--safe-top)); bottom: calc(var(--bar-h) + 10px + var(--safe-bottom)); width: min(560px, calc(100% - 132px - var(--safe-left))); }
  .sheetHead { padding-top: 4px; padding-bottom: 0; }
}



/* ── why and glossary · owner: session 2 · track D ────────────────────────────────────────────────────────────── */
/* #pop holds the Why? sheets, the term bubble and the 📖 Dictionary, above everything but the banner (the
   Dictionary opens from the pause menu too). */

#pop { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#pop > * { pointer-events: auto; }
.popWrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(16px + var(--safe-left)); }
.popShade { position: absolute; inset: 0; background: rgba(10, 12, 22, 0.5); animation: fade 0.2s; }
.popHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.popHead h2 { margin: 0; font-size: 19px; line-height: 1.25; }

.whySheet { position: relative; width: min(440px, 100%); max-height: 100%; overflow: auto; padding: 14px 18px 16px; border-radius: 20px;
  box-shadow: var(--shadow); animation: rise 0.2s ease-out; }
.whyDesc { margin: 6px 0 10px; color: var(--paper-dim); }
.whyBig { margin: 6px 0 12px; font-size: 14px; }
.whyBig > b { font-size: 30px; font-variant-numeric: tabular-nums; }
.whyBig .of { color: var(--paper-dim); }
.whyBig .wk { margin-left: 8px; font-weight: 700; }
.whySub { margin-top: 4px; color: var(--paper-dim); }
.whyRows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--paper-line); }
.whyRows li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--paper-line); }
.wv { white-space: nowrap; font-variant-numeric: tabular-nums; }
.wv.up { color: var(--paper-up); }
.wv.down { color: var(--paper-down); }
.whyNote { margin: 10px 0 4px; }
.whyWarn { margin: 0 0 12px; padding: 7px 10px; border-radius: 10px; background: #fbe3cf; color: #8a4a22; line-height: 1.4; }
.whyBtns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chanceBar { height: 10px; margin: 4px 0 8px; border-radius: 5px; background: var(--paper-2); overflow: hidden; }
.chanceBar i { display: block; height: 100%; border-radius: 5px; background: var(--maybe); }
.chanceBar.likely i { background: var(--likely); }
.chanceBar.longshot i { background: var(--longshot); }
.chanceWord { font-size: 22px; }

.bubble { position: absolute; width: min(320px, calc(100vw - 16px)); padding: 12px 14px 6px; border-radius: 14px; box-shadow: var(--shadow);
  font-size: 14px; line-height: 1.4; animation: fade 0.15s; }
.bName { font-size: 16px; font-weight: 700; }
.bReal { color: var(--paper-dim); font-weight: 400; }
.bShort { margin: 6px 0; }
.bEx { margin: 6px 0; padding-left: 10px; border-left: 3px solid #e2b26c; color: #5b4a39; font-size: 13.5px; }
.bMore { text-align: right; }

.dict { position: relative; width: min(640px, 100%); height: min(720px, 100%); display: flex; flex-direction: column; padding: 14px 18px 0;
  border-radius: 20px; box-shadow: var(--shadow); animation: rise 0.2s ease-out; }
.dCount { margin: 2px 0 8px; color: var(--paper-dim); }
.dSearch { width: 100%; }
.dGroups { display: flex; gap: 6px; margin: 8px -18px 0; padding: 0 18px 6px; overflow-x: auto; scrollbar-width: none; }
.dGroups .chip { flex: none; }
.dList { flex: 1; overflow: auto; margin: 4px -18px 0; padding: 0 18px 16px; overscroll-behavior: contain; }
.dEntry { border-bottom: 1px solid var(--paper-line); }
.dName { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: var(--tap); padding: 9px 2px; border: 0; background: none;
  color: inherit; text-align: left; }
.dIcon { flex: none; width: 22px; font-size: 17px; text-align: center; }
.dWords { min-width: 0; }
.dShort { display: block; margin-top: 2px; font-size: 13px; color: var(--paper-dim); }
.dEntry.open .dShort { display: none; }
.dEntry.unmet .dName { opacity: 0.6; }
.dBody { padding: 0 4px 12px 34px; }
.dBody p { margin: 0 0 8px; }
.dRel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dMet { font-size: 12.5px; color: var(--paper-dim); }
.dEmpty { margin: 18px 0; text-align: center; color: var(--paper-dim); }

@media (max-width: 600px) and (orientation: portrait) {
  .whyWrap { align-items: flex-end; padding: calc(40px + var(--safe-top)) 0 0; }
  .whySheet { width: 100%; border-radius: 24px 24px 0 0; padding-bottom: calc(16px + var(--safe-bottom)); }
  .dictWrap { padding: 0; }
  .dict { width: 100%; height: 100%; border-radius: 0; padding-top: calc(12px + var(--safe-top)); }
}
@media (max-height: 500px) {
  .dictWrap { padding: 8px; }
  .dict { height: 100%; overflow: auto; }
  .dList { flex: none; overflow: visible; }
}



/* ── pause · owner: session 2 · track D ───────────────────────────────────────────────────────────────────────── */
/* The overlay's panels: the start screen (Welcome back, the title, the New life form) and the pause menu. */

#overlay { z-index: 40; background: rgba(12, 14, 24, 0.55); animation: fade 0.2s; }
#start.panel { text-align: center; }
#start .gameName { margin: 10px 0 4px; font-size: 46px; letter-spacing: 0.01em; }
.titleArt { display: flex; justify-content: center; gap: 18px; margin: 6px 0 16px; font-size: 38px; }
button.primary.big { min-height: 54px; margin: 8px 0; padding: 0 40px; font-size: 19px; }
.startLinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; margin: 6px 0 10px; }
.wbTitle { margin: 12px 0 6px; font-size: 30px !important; }
.wbWhen { margin: 0 0 6px; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.wbWhere { margin: 0 0 14px; color: var(--ink-dim); }
.optRow, .setRow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin: 10px 0 2px; text-align: left; }
.optName { font-weight: 600; }
.optNote { width: 100%; margin: 2px 0 8px; font-size: 12.5px; color: var(--ink-dim); text-align: left; }
.importMsg { color: var(--bad); }
/* the cloud save's account row (ui/start.js, core/cloud.js) */
.wbCloud { margin: -8px 0 12px; font-size: 13px; color: var(--ink-dim); }
.account { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; margin: 14px auto 0;
  padding-top: 12px; border-top: 1px solid var(--panel-line); max-width: 440px; font-size: 13px; }
.account[hidden], .account:empty { display: none; }
.account .cloudFine, .account .cloudNotice { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--ink-dim); }
.account .cloudNotice { color: var(--maybe); }
button.cloudIn { display: inline-flex; align-items: center; gap: 8px; }
.gLogo { width: 16px; height: 16px; flex: none; }
.cloudState { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-dim); }
.cloudState::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #6f8193; flex: none; }
.cloudState.synced::before { background: var(--good); }
.cloudState.syncing::before { background: #6fb1e8; }
.cloudState.error::before, .cloudState.signedOut::before, .cloudState.loadFailed::before { background: var(--maybe); }
.cloudState.local { flex: 1 1 200px; text-align: left; }
.account .cloudChoice { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; }

#start.start-new { width: min(640px, 100%); text-align: left; }
#start.start-new h2 { margin: 6px 0 8px; }
.newGrid { display: grid; grid-template-columns: 128px 1fr; gap: 16px; }
.heroBox { display: flex; align-items: flex-end; justify-content: center; border-radius: 16px; background: linear-gradient(#2e3553, #1d2235); }
.heroBox canvas { width: 120px; height: 160px; }
.heroBox.empty { background: radial-gradient(circle at 50% 38%, rgba(242, 177, 90, 0.25) 0, transparent 60%), linear-gradient(#2e3553, #1d2235); }
.heroBox.empty { display: none; }
.newGrid:has(.heroBox.empty) { grid-template-columns: 1fr; }
.formRow { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.formRow input { width: 100%; }
.lookRows { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: var(--tap); height: var(--tap); padding: 0; border: 3px solid transparent; border-radius: 50%; background: var(--sw);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); }
.swatch[aria-pressed="true"] { border-color: var(--accent); }
.seg.col3 { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.seg.col3 button { padding: 6px 8px; line-height: 1.2; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); margin: 10px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.pauseMenu { width: min(720px, 100%) !important; }
.pauseMenu h2 { margin: 6px 0; text-align: center; font-size: 26px; }
.pauseMenu > button.primary.big { display: block; margin: 6px auto 4px; }
.pauseMenu h3 { margin: 18px 0 4px; text-align: center; font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-dim); }
.pauseMenu > .optNote { text-align: center; }
.setGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); align-items: start; column-gap: 28px; }
.confirmBox { margin: 8px 0; padding: 10px 14px; border-radius: 12px; background: rgba(231, 135, 111, 0.12); text-align: center; }
.confirmBox p { margin: 0; }

@media (max-width: 600px) and (orientation: portrait) {
  .panel { padding: 18px 16px; }
  #start .gameName { font-size: 40px; }
  .newGrid { grid-template-columns: 92px 1fr; gap: 12px; }
  .heroBox canvas { width: 90px; height: 120px; }
}
@media (max-height: 500px) {
  .panel { padding: 12px 18px; }
  #start .gameName { margin-top: 0; font-size: 34px; }
  .titleArt { display: none; }
  button.primary.big { min-height: 48px; margin: 4px 0; }
  .pauseMenu h2 { margin: 0; font-size: 20px; }
  .pauseMenu > button.primary.big { margin: 4px auto; }
}



/* ── scene · owner: session 1 · track B, session 2 · track C ──────────────────────────────────────────────────── */

/* the scene's canvas (render/scene.js): its backdrop colour shows before the first frame; a swipe pans it on a phone */
#scene { background: #262b3d; cursor: default; -webkit-touch-callout: none; }



/* ── career-ui · owner: session 3 · track C ───────────────────────────────────────────────────────────────────── */
/* The Career tab (ck*: the job card, the gauges, the offers' list), the Learn tab (ln*), the offer comparison card (oc*),
   the interview cards (iv*), the profile (pf*, a sheet of paper in the tab) and the Market chart (mc*). The chart's
   series colours are the validated dark slots of ui/market-chart.js (COLORS); the swatches here repeat them. */

:root { --mc0: #338ced; --mc1: #e76624; --mc2: #00a888; }

.ckViews { margin: 4px 0 6px; }
.ckViews button { padding: 0 8px; font-size: 13.5px; }
.ckBody > h3:first-child { margin-top: 12px; }
.ckNone { margin: 4px 0; font-weight: 600; }
.ckAlert { margin: 10px 0 4px; border-color: rgba(242, 177, 90, 0.45); background: rgba(242, 177, 90, 0.1); }
.ckAlert > b { display: block; margin-bottom: 2px; }
button.ckGo { min-height: var(--tap); font-weight: 700; color: #ffd9a3; }
.ckNote { margin: 10px 0 0; }
.ckNote button { margin-left: 6px; }

.ckJobHead { display: flex; align-items: center; gap: 12px; padding: 2px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--sheet-line); }
.ckKind { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px;
  background: rgba(255, 255, 255, 0.07); font-size: 24px; }
.ckJobTitle { font-size: 18px; font-weight: 700; }
.ckJobCo { font-size: 13.5px; }
.ckJobSince { font-size: 12px; color: var(--ink-dim); }
.ckJob .tRow > span { color: var(--ink-dim); font-size: 13.5px; }
.ckJob .tRow > b { font-weight: 600; }
.ckStackRow { align-items: flex-start; }
.ckStack { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.ckSkill { padding: 2px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.07); font-size: 12.5px; white-space: nowrap; }
.ckSkill.ok { color: var(--good); }
.ckSkill.no { color: var(--bad); }
.ckSkill.part { color: var(--maybe); }
.ckSkill b { color: var(--ink); }
.ckGauges { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 8px 0 4px; }
.ckGauge { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n w" "b b"; gap: 2px 6px; font-size: 12.5px; }
.ckGauge > span:first-child { grid-area: n; color: var(--ink-dim); }
.ckGauge .bar { grid-area: b; height: 6px; }
.ckGauge em { grid-area: w; font-style: normal; font-weight: 600; }
.ckGauge.hi .bar i { background: var(--good); }
.ckGauge.mid .bar i { background: var(--maybe); }
.ckGauge.lo .bar i { background: var(--bad); }
.ckGauge.hi em { color: var(--good); }
.ckGauge.lo em { color: var(--bad); }
.ckPerks { align-items: flex-start; }
.ckPerks b { font-weight: 500; font-size: 12.5px; }
.ckPerk { display: inline-block; margin: 1px 0 1px 6px; white-space: nowrap; }

.ckWord.great, .ckWord.good { color: var(--good); }
.ckWord.improve { color: var(--bad); }
.ckPerfBar { margin: 4px 0 8px; height: 10px; }
.ckPerfBar.great i, .ckPerfBar.good i { background: var(--good); }
.ckPerfBar.ok i { background: var(--maybe); }
.ckPerfBar.improve i { background: var(--bad); }
.ckRevs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0; }
.ckRevs .hint { margin: 0 4px 0 0; }
.ckRev { padding: 2px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.07); font-size: 12px; font-weight: 600; }
.ckRev.great, .ckRev.good { color: var(--good); }
.ckRev.improve { color: var(--bad); }
.ckRev small { font-weight: 400; color: var(--ink-dim); }
.ckGoal { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--sheet-line); }
.ckFactor { margin: 6px 0 0; padding: 6px 0 0; border-top: 1px dashed var(--sheet-line); }
.ckFactor .tRow > span { font-size: 13.5px; }
.ckFactor .tRow > b.up { color: var(--good); }
.ckFactor .tRow > b.down { color: var(--bad); }
.ckFactor .hint { margin: 2px 0 0; }
.ckFactor .ckStack { display: inline-flex; justify-content: flex-start; margin-right: 4px; vertical-align: middle; }
.ckCrunch { margin: 10px 0 6px; }
.ckNext > b { display: block; margin-bottom: 4px; }
.ckNeeds { margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.ckNeeds li { padding: 2px 0; }
.ckNeeds li.ok { color: var(--good); }
.ckNeeds li.no { color: var(--bad); }
.lnMentor .btnRow { margin-top: 6px; }

.ckChoices, .ckActions { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
button.ckPick { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 48px; padding: 6px 14px;
  border-radius: 14px; text-align: left; }
button.ckPick small { font-weight: 400; font-size: 12px; color: var(--ink-dim); }
.ckOpen .seg button { min-height: 32px; padding: 0 14px; }

.ckOffers { display: flex; flex-direction: column; gap: 8px; }
button.ckOffer { display: flex; align-items: center; gap: 10px; }
.ckOfMain { flex: 1; min-width: 0; }
.ckOfSub { display: block; font-size: 12px; color: var(--ink-dim); }
.ckOfRight { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: nowrap; }
.ckOfRight small { font-size: 12px; }
.ckOfRight .chance { min-height: 24px; padding: 0 10px; line-height: 24px; font-size: 12px; }
.ckOfSub.ckWhy { color: var(--bad); }
/* the Offers view: the filter, Filtered out, the vacancies board, the market by level; the job view's If you quit */
.ckFilterHead { margin: 8px 0 4px; font-size: 13px; color: var(--ink-dim); }
.ckFilter button { min-height: 36px; }
details.tCard > summary { cursor: pointer; list-style-position: inside; font-weight: 600; }
details.tCard > summary small { display: block; margin-top: 2px; font-weight: 400; font-size: 12px; color: var(--ink-dim); }
details.tCard[open] > summary { margin-bottom: 6px; }
.ckFiltered .ckOffers { margin-top: 6px; }
.ckVacs { display: flex; flex-direction: column; gap: 8px; }
.ckVac .ckJobHead { margin-bottom: 4px; }
.ckVac .tRow > span { color: var(--ink-dim); font-size: 13.5px; }
.ckVac .ckNeeds { margin: 6px 0 2px; }
.ckVac .ckPick { width: 100%; margin-top: 6px; }
.ckReady { margin: 6px 0 2px; color: var(--good); font-size: 13.5px; }
.ckDirs { margin: 0 0 6px; }
.ckSlice { padding: 6px 0; border-top: 1px dashed var(--sheet-line); }
.ckSlice.mine { margin: 0 -8px; padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.ckSlice .tRow { align-items: baseline; }
.ckSliceSkills { justify-content: flex-start; margin: 3px 0; }
.ckSlice .hint { margin: 2px 0 0; }
.ckSlice .ok { color: var(--good); }
.ckSlice .no { color: var(--bad); }
.ckHere { font-style: normal; font-size: 11.5px; color: var(--accent); }
.ckAfterHead { margin: 10px 0 2px; font-weight: 600; font-size: 13.5px; }
.ckAfter .tRow > span { color: var(--ink-dim); font-size: 13.5px; }
.ckAfter .tRow small { font-weight: 400; color: var(--ink-dim); }
.ckAfterList { margin: 8px 0 0; padding-left: 0; list-style: none; font-size: 14px; }
.ckAfterList li { padding: 2px 0; }

/* the Learn tab */
.lnNowHead { display: flex; align-items: center; gap: 10px; }
.lnNowHead > div { flex: 1; min-width: 0; }
.lnNowHead .pill.lnWay { flex: 0 1 auto; min-width: 0; max-width: 46%; white-space: normal; text-align: center; line-height: 1.25; padding: 3px 10px; }
.lnNowHead .hint { margin: 0; }
.lnIcon { flex: none; width: 34px; text-align: center; font-size: 22px; }
.lnXp { margin: 8px 0 4px; height: 10px; }
.lnLimit { margin: 6px 0 0; }
.lnMethods, .lnBig { display: flex; flex-direction: column; gap: 6px; }
button.lnMethod, button.lnStep { display: flex; align-items: center; gap: 10px; }
button.lnMethod[aria-pressed="true"] { border-color: var(--accent); background: rgba(242, 177, 90, 0.12); }
.lnMain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lnMain .hint { margin: 0; }
.lnWhy { font-size: 12px; color: var(--bad); }
.lnRight { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; font-size: 12px; color: var(--ink-dim); }
.lnRight b { color: var(--ink); font-size: 13px; }
.lnFocus { margin: 0 0 4px; font-weight: 600; }
.lnGroup { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.lnGroupName { font-size: 12px; color: var(--ink-dim); }
.lnSkill { display: flex; align-items: stretch; gap: 4px; }
.lnSkBtn { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 10px; border: 1px solid var(--sheet-line); border-radius: 12px;
  background: var(--sheet-2); text-align: left; }
.lnSkBtn:hover { border-color: rgba(242, 177, 90, 0.4); }
.lnSkill.now .lnSkBtn { border-color: var(--accent); }
/* a skill in focus: ticked and tinted (the one learned now also has the accent border) */
.lnSkill.on .lnSkBtn { background: rgba(242, 177, 90, 0.12); }
.lnTick { flex: none; width: 20px; height: 20px; border: 1.5px solid var(--sheet-line); border-radius: 6px; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.lnSkill.on .lnTick { background: var(--accent); border-color: transparent; }
.lnSkTop { display: flex; justify-content: space-between; gap: 6px; font-size: 13.5px; }
.lnLv { color: var(--ink-dim); font-size: 12px; white-space: nowrap; }
.lnSkBtn .bar { height: 6px; margin: 4px 0 2px; }
.lnChips { display: flex; flex-wrap: wrap; gap: 3px; }
.lnChip { padding: 0 6px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); font-size: 11px; line-height: 18px; color: var(--ink-dim); }
.lnChip.now { color: var(--accent); }
.lnChip.hot { color: var(--good); }
.lnChip.cooling, .lnChip.rust { color: var(--bad); }
.lnWhyBtn { flex: none; width: var(--tap); border: 1px solid var(--sheet-line); border-radius: 12px; background: rgba(255, 255, 255, 0.04); color: var(--ink-dim); font-weight: 700; }
.lnStep .fx { margin-top: 3px; }

/* the offer comparison (a wide card) */
.offerCmp .card { width: min(820px, 100%); }
.ocNews { margin: 6px 0; color: #7a4a10; background: rgba(242, 177, 90, 0.2); }
.ocWrap { margin: 8px 0 4px; overflow-x: auto; }
.ocTable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ocTable th, .ocTable td { padding: 5px 6px; border-bottom: 1px solid var(--paper-line); text-align: left; vertical-align: top; }
.ocTable thead th { font-size: 12px; color: var(--paper-dim); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.ocTable tbody th { width: 26%; font-weight: 600; color: var(--paper-dim); }
.ocTable td { width: 37%; }
.ocNew { background: rgba(242, 177, 90, 0.08); }
.ocNew.better { color: var(--paper-up); }
.ocNew.worse { color: var(--paper-down); }
.ocMark { font-style: normal; margin-right: 4px; font-size: 11px; }
.ocNote { display: block; font-size: 11.5px; color: var(--paper-dim); }
.ocTable .ckSkill { background: rgba(80, 50, 20, 0.07); }
.ocTable .ckSkill.ok { color: var(--paper-up); }
.ocTable .ckSkill.no { color: var(--paper-down); }
.ocTable .ckSkill b { color: var(--paper-ink); }
.ocTable .ckStack { justify-content: flex-start; }
.ocTable .ckPerk { margin: 0 6px 0 0; white-space: normal; }
.ocMiss { margin: 8px 0; padding: 8px 12px; border-radius: 12px; background: rgba(191, 86, 61, 0.08); }
.ocMiss ul { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--paper-down); }
.ocChance { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; font-weight: 600; }
.paper .chance.likely { color: var(--paper-up); background: rgba(46, 134, 85, 0.12); }
.paper .chance.maybe { color: #9a6a12; background: rgba(227, 182, 90, 0.2); }
.paper .chance.longshot { color: var(--paper-down); background: rgba(191, 86, 61, 0.12); }
.ocWeek { margin: 6px 0 4px; }
.ocWeek > b { display: block; margin-bottom: 4px; font-size: 13.5px; }
@media (min-width: 700px) {
  .offerCmp .choices { display: grid; grid-template-columns: 1fr 1fr; }
}

/* the interview */
.ivChance { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-weight: 600; }
.ivChance .chance { min-height: 28px; }
.ivMeter { margin: 8px 0 4px; }
.ivMeter > span { font-size: 13px; color: var(--paper-dim); }
.ivBar { height: 12px; margin-top: 4px; background: rgba(80, 50, 20, 0.1); }
.ivBar.hi i { background: var(--paper-up); }
.ivBar.mid i { background: #d59c2c; }
.ivBar.lo i { background: var(--paper-down); }
.ivSkill { margin: 0; }
.ivRight { margin: 6px 0; font-weight: 700; color: var(--paper-up); }
.choice.hinted { border-color: #c9a04a; }
.ivHint { font-size: 12px; font-weight: 600; color: #9a6a12; }

/* the profile: a CV on paper */
.cv { margin-top: 10px; padding: 14px 16px 16px; border-radius: 16px; }
.cv h4 { margin: 14px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--paper-dim); }
.pfHead { padding-bottom: 10px; border-bottom: 2px solid var(--paper-line); }
.pfName { font-size: 22px; font-weight: 700; }
.pfSub { font-size: 14px; }
.pfRep { margin-top: 4px; font-size: 12.5px; color: var(--paper-dim); }
.pfOpen { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13.5px; font-weight: 600; }
.cv .seg { background: rgba(80, 50, 20, 0.1); }
.cv .seg button { min-height: 30px; color: var(--paper-dim); }
.cv .seg button[aria-pressed="true"] { color: var(--accent-ink); }
.pfJobs, .pfSkills, .pfList { margin: 0; padding: 0; list-style: none; }
.pfJobs li { display: flex; gap: 10px; padding: 4px 0; }
.pfYears { flex: none; width: 82px; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--paper-dim); }
.pfWhat small { display: block; font-size: 12px; color: var(--paper-dim); }
.pfEdu { margin: 0; font-size: 13.5px; }
.pfSkills li { display: grid; grid-template-columns: 1fr auto 64px; align-items: center; gap: 8px; padding: 2px 0; font-size: 13.5px; }
.pfSkills small { font-size: 11.5px; color: var(--paper-dim); text-align: right; }
.pfDots { display: flex; gap: 2px; }
.pfDots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(80, 50, 20, 0.15); }
.pfDots i.on { background: #c98a2e; }
.pfChips { display: flex; flex-wrap: wrap; gap: 5px; }
.pfChip { padding: 2px 9px; border-radius: 10px; background: rgba(80, 50, 20, 0.07); font-size: 12.5px; }
.pfList li { padding: 2px 0; font-size: 13px; }

/* the Market chart */
.mcBox { border-radius: 14px; background: var(--sheet-2); padding: 6px 4px 0; }
.mcCanvas { display: block; width: 100%; touch-action: pan-y; cursor: crosshair; }
.mcRead { min-height: 44px; margin: 6px 2px; font-size: 13px; }
.mcRead em { font-style: normal; font-size: 11px; color: var(--accent); }
.mcVals, .mcMoves { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.mcVal { white-space: nowrap; }
.mcSw { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; background: rgba(167, 176, 196, 0.35); vertical-align: -1px; }
.mcChip.s0 .mcSw, .mcVal.s0 .mcSw { background: var(--mc0); }
.mcChip.s1 .mcSw, .mcVal.s1 .mcSw { background: var(--mc1); }
.mcChip.s2 .mcSw, .mcVal.s2 .mcSw { background: var(--mc2); }
.mcMove { font-weight: 600; }
.mcLegend { display: flex; flex-wrap: wrap; gap: 5px; }
.mcChip { min-height: 32px; padding: 0 10px; border-radius: 16px; border: 1px solid var(--sheet-line); background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim); font-size: 12.5px; }
.mcChip.on { color: var(--ink); border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.09); }
.mcChip em { font-style: normal; font-weight: 600; }
.mcChip em.hot { color: var(--good); }
.mcChip em.cooling { color: var(--bad); }
.mcChip small { color: var(--ink-dim); }
@media (pointer: coarse) {
  .mcChip { min-height: var(--tap); }
  .ckOpen .seg button, .cv .seg button { min-height: var(--tap); }
}
.mcNews { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.mcNews li { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--sheet-line); }
.mcNews li span { flex: none; width: 92px; color: var(--ink-dim); font-size: 12px; }



/* ── pc · owner: session 4 · track C (shop, assembly, desk close-up, 🖥️ tab, Codex) ────────────────────────────── */
/* The 🖥️ tab's blocks (bars against the year's need, the desk close-up, the stars), and #screen: the shop, the
   assembly and the Codex as one full screen over the scene — a large panel on a desktop, the whole screen on a phone. */

:root { --pc-ok: #6cc58f; --pc-mid: #e3c35e; --pc-low: #e98a74; --pc-need: rgba(255, 255, 255, 0.75); }

/* 🖥️ */
.pcMain { display: flex; flex-direction: column; gap: 6px; }
.pcHead { display: flex; align-items: center; gap: 12px; }
.pcThumb { width: 76px; height: 64px; flex: none; }
.pcTitle b { font-size: 16px; }
.pcBars { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.pcBar { display: grid; grid-template-columns: minmax(120px, 42%) 1fr 64px; align-items: center; gap: 8px; min-height: 30px; padding: 2px 4px;
  border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; }
button.pcBar:hover { background: rgba(255, 255, 255, 0.05); }
.pbName { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbTrack { position: relative; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.pbTrack i, .pbTrack s { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.pbTrack i { background: var(--pc-ok); }
.pbTrack s { background: rgba(255, 255, 255, 0.22); }
.pcBar.mid .pbTrack i { background: var(--pc-mid); }
.pcBar.low .pbTrack i { background: var(--pc-low); }
.pbTrack em { position: absolute; left: 66.6%; top: -2px; bottom: -2px; width: 2px; background: var(--pc-need); }
.pcBar b { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.pcBar b small { font-size: 10px; }
.pcBox { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 0; }
.pcBtns { margin-top: 12px; }
.pcBtns .ghost { flex: 1 1 auto; }
.pcOther small { display: block; }
.pcOther .btnRow { flex: none; justify-content: flex-end; margin: 0; gap: 6px; }
.pcDeskBtn { display: block; width: 100%; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: none; }
.pcDesk { display: block; width: 100%; height: 190px; }
.pcWork { margin-top: 8px; }
.pcTip { margin-top: 8px; font-size: 13.5px; }
.stars { white-space: nowrap; font-size: 13px; }
@media (pointer: coarse) { .pcBar { min-height: var(--tap); } html .shTarget .seg button, html .biosBtn, html .biosGrid select { min-height: var(--tap); } }
.stars i { font-style: normal; }
.stars i.off { opacity: 0.22; filter: grayscale(1); }

/* #screen: the shop, the assembly, the Codex */
#screen { position: fixed; z-index: 25; inset: calc(12px + var(--safe-top)) calc(12px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(12px + var(--safe-left));
  display: flex; flex-direction: column; border-radius: 20px; background: var(--sheet); border: 1px solid var(--sheet-line); box-shadow: var(--shadow);
  overflow: hidden; animation: rise 0.2s ease-out; }
@media (min-width: 1200px) { #screen { left: 50%; right: auto; width: 1160px; margin-left: -580px; } }
.scrHead { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 10px 8px 18px; border-bottom: 1px solid var(--sheet-line); }
.scrHead h2 { flex: 1; margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scrMoney { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scrBody { flex: 1; overflow: auto; padding: 10px 18px 18px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.scrBody h3 { margin: 16px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-dim); }
button.link.small { min-height: 26px; font-size: 12px; padding: 0 2px; }

/* the shop */
.shCats, .shSlots { flex: none; display: flex; gap: 6px; padding: 8px 14px; overflow-x: auto; scrollbar-width: thin; }
.shSlots { padding: 0 0 8px; flex-wrap: wrap; }
@media (min-width: 901px) { .shCats { flex-wrap: wrap; } }
@media (max-width: 900px) { .shCats { scrollbar-width: none; } .shCats::-webkit-scrollbar { display: none; } }
.shCats .chip, .shSlots .chip { flex: none; white-space: nowrap; font-weight: 600; }
.shTarget { flex: none; padding: 0 14px 6px; }
.shTarget .seg button { min-height: 32px; font-size: 13px; }
.shIntro { margin: 4px 0 10px; }
.shRow { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 12px; padding: 8px 10px; margin-bottom: 6px;
  border-radius: 14px; background: var(--sheet-2); border: 1px solid transparent; }
.shRow.inCart { border-color: rgba(242, 177, 90, 0.6); }
.shRow.fit-no { opacity: 0.72; }
.shRow.have { border-color: rgba(108, 197, 143, 0.45); }
.shPic { width: 78px; height: 60px; }
.shName { font-weight: 700; }
.shSpec { font-size: 12.5px; color: var(--ink-dim); }
.shFit { font-size: 12.5px; margin-top: 2px; }
.shFit.yes { color: var(--good); }
.shFit.cond { color: var(--maybe); }
.shFit.no { color: var(--bad); }
.shFx { margin-top: 4px; align-items: center; }
.shBuy { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.shBuy b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.shBuild { margin-bottom: 10px; }
.shBuildHead { display: flex; align-items: center; gap: 12px; }
.shPrice { font-weight: 700; color: var(--accent); }
.shBuild details { margin: 6px 0; font-size: 13px; }
.shBuild summary { cursor: pointer; color: var(--ink-dim); }
.shCart { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 14px;
  border-top: 1px solid var(--sheet-line); background: var(--sheet-2); }
.shCartInfo { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.shCart .btnRow { margin: 0; }

/* the assembly */
.asmDots { flex: none; display: flex; gap: 4px; padding: 6px 18px 0; }
.asmDots i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.asmDots i.done { background: var(--good); }
.asmDots i.now { background: var(--accent); }
.asmText { flex: none; padding: 6px 18px 8px; font-size: 14.5px; line-height: 1.4; min-height: 2.8em; }
.asmHint { display: block; margin-top: 3px; font-size: 13px; color: #ffd9a3; }
.asmStage { position: relative; flex: 1; min-height: 0; }
.asmStage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.asmFoot { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px calc(8px + var(--safe-bottom)); border-top: 1px solid var(--sheet-line); }
.asmMsg { flex: 1; font-size: 13px; color: var(--ink-dim); text-align: center; }
.asmMsg.ok { color: var(--good); }
.asmMsg.warn { color: #ffc58f; }
.asmFoot .primary, .asmFoot .ghost { min-height: 44px; }
.asmPanel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 24px)); max-height: calc(100% - 24px);
  overflow: auto; padding: 18px 20px; border-radius: 18px; background: rgba(20, 24, 36, 0.97); border: 1px solid var(--sheet-line); box-shadow: var(--shadow); text-align: center; }
.asmPanel h3 { margin: 0 0 10px; font-size: 19px; }
.asmPanel p { margin: 6px 0; }
.postLeds { display: flex; justify-content: center; gap: 8px; margin: 8px 0; }
.postLeds span { min-width: 62px; padding: 6px 8px; border-radius: 8px; background: #1a1d26; color: #59606e; font: 700 13px ui-monospace, Consolas, monospace; }
.postLeds span.on { background: #4a1f1a; color: #ffb39a; box-shadow: 0 0 14px rgba(255, 120, 90, 0.55); }
.postBeep { color: var(--ink-dim); }
.asmPanel.bios { text-align: left; background: #12254a; border-color: #3d5fa0; font-family: ui-monospace, Consolas, monospace; }
.biosHead { margin: -18px -20px 12px; padding: 8px 20px; background: #2d4f92; color: #fff; font-weight: 700; letter-spacing: 0.06em; }
.biosGrid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: center; font-size: 13.5px; }
.biosGrid > span { color: #9fb6e6; }
.biosGrid b { font-weight: 600; color: #fff; }
.biosGrid b small { color: #9fb6e6; font-weight: 400; }
.biosGrid .warn { color: #ffc58f; }
.biosGrid .ok { color: #9ff0bf; }
.biosBtn { min-height: 30px; padding: 0 12px; border-radius: 6px; border: 1px solid #6f8fd0; background: #1e3a72; color: #fff; font: inherit; }
.biosBtn[aria-pressed="true"] { background: #3f7a4e; border-color: #7fd49a; }
.biosGrid select { min-height: 32px; background: #0d1c3a; border-color: #6f8fd0; font-family: inherit; }
.osBar { height: 12px; margin: 14px 0 6px; }
.osBar i { width: 0; transition: width 0.1s linear; }
.asmPanel.done .pcBars { text-align: left; }
.asmPanel.done .pill { display: inline-block; font-size: 14px; }

/* the Codex */
.cxGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cxTile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 14px; border: 1px solid var(--sheet-line);
  background: var(--sheet-2); color: inherit; font-weight: 600; }
.cxTile:hover { border-color: rgba(242, 177, 90, 0.5); }
.cxTile canvas { width: 100%; height: 84px; }
.cxTile.locked { color: var(--ink-dim); }
.cxTile canvas.shade { filter: brightness(0) opacity(0.35); }
.cxCard { max-width: 640px; margin: 8px auto; padding: 16px 22px 18px; border-radius: 20px; }
.scrBody .cxCard h3 { margin: 0 0 6px; font-size: 22px; letter-spacing: 0; text-transform: none; color: var(--paper-ink); }
.cxCard h4 { margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--paper-dim); }
.cxCard p, .cxCard li { line-height: 1.5; }
.cxCard ul { margin: 4px 0; padding-left: 20px; }
.cxBig { display: block; width: 100%; height: 190px; margin: 6px 0; }
.cxWhat { font-size: 16px; font-weight: 600; }
.cxAnalogy { padding: 8px 12px; border-radius: 12px; background: #fff3dc; }
.cxTerms { margin-top: 12px; font-size: 13px; }

@media (max-width: 600px) {
  #screen { inset: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); border-radius: 0; border: 0; }
  .shRow { grid-template-columns: 58px 1fr; gap: 4px 10px; }
  .shPic { width: 58px; height: 46px; }
  .shBuy { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-end; gap: 10px; }
  .pcBar { grid-template-columns: minmax(104px, 40%) 1fr 54px; gap: 6px; }
  .scrHead { padding-left: 12px; gap: 6px; }
  .scrHead .ghost.small { padding: 0 8px; }
  .asmText { font-size: 13.5px; padding: 4px 12px 6px; }
  .cxGrid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .cxTile canvas { height: 64px; }
}
@media (max-height: 500px) {
  #screen { inset: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); border-radius: 0; }
  .asmText { min-height: 0; padding-bottom: 4px; }
}



/* ── life-tab · owner: session 4 · track D ──────────────────────────────────────────────────────────────────────── */
/* The 🏠 Life tab (ui/tabs/life.js): the views' switch, the home's card, the moves, the food's sliders, the things to
   buy, the people's bonds as small bars, the burnout card, the autopilot's rules. */
.lfViews { margin: 4px 0 2px; }
.lfViews button { padding: 0 8px; }
.lfTitle { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 4px; }
.lfTitle b { font-size: 16px; }
.lfBar { display: inline-block; width: 64px; height: 6px; margin-right: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); vertical-align: middle; overflow: hidden; }
.lfBar i { display: block; height: 100%; border-radius: 3px; background: var(--good); }
.lfBar.hot i { background: linear-gradient(90deg, #e3b65a, var(--bad)); }
.lfRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; padding: 2px 0; }
.lfMoves { display: flex; flex-direction: column; gap: 8px; }
.lfMove { padding: 10px 14px; border-radius: 14px; border: 1px solid var(--sheet-line); background: var(--sheet-2); }
.lfMove.off { opacity: 0.7; }
.lfMove .tRow { min-height: 24px; font-size: 13.5px; }
.lfMove button { margin-top: 6px; }
.lfMove b.down { color: var(--bad); }
.lfKr { white-space: nowrap; }
.lfLoan { margin: 4px 0; padding: 2px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }   /* a home to buy: the mortgage */
.lfMoveTop { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.lfFoodRow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(80px, 1fr) 44px; align-items: center; gap: 8px; min-height: var(--tap); }
.lfFoodRow input { width: 100%; accent-color: var(--accent); }
.lfFoodRow b { text-align: right; font-variant-numeric: tabular-nums; }
.lfCoffee button small { display: block; }
.lfItem { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 3px 0; }
.lfItem + .lfItem { border-top: 1px solid var(--sheet-line); }
.lfItem span small { display: block; font-size: 12px; color: var(--ink-dim); }
.lfItem button { flex: none; }
.lfBurn { cursor: pointer; }
.lfBurn.hot, .lfBurn.edge, .lfBurn.burnout { border-color: rgba(231, 135, 111, 0.5); }
/* when a warning is ignored (sim/neglect.js): each area not fine, a tap opens its meter's Why? */
.lfWarn { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: var(--tap); padding: 8px 0; border: 0;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lfWarn + .lfWarn { border-top: 1px solid var(--sheet-line); }
.lfWarnIcon { flex: none; }
.lfWarn.warned span:last-child, .lfWarn.after span:last-child { color: #f0b48a; }
.lfRules { display: flex; flex-direction: column; }
.lfRule { display: flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; }
.lfRule input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.lfFeedRow { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; padding: 3px 0; font-size: 13.5px; }
.lfKept + .lfKept { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--sheet-line); }   /* the homes kept, each with Rent it out */
.lfKept .btnRow { margin: 6px 0 2px; }
/* the 🚗 Garage view (ui/garage.js): the picture (render/garage.js) on top, the cars as the moves' cards */
.grPicBox { margin: 8px 0 4px; border-radius: 14px; overflow: hidden; }
.grPic { display: block; width: 100%; height: 190px; }
.grCar button { margin-right: 6px; }
/* the 🧸 Kids view (ui/kids.js): a card per child — the portrait beside the name and the bond, the two stats, the
   choices by age as rows (the one chosen marked), what each changes as up and down chips */
.kdKid { margin-bottom: 10px; }
.kdHead { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.kdPic { flex: none; width: 64px; height: 80px; }
.kdWho { flex: 1; min-width: 0; }
.kdGroup { margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--sheet-line); }
.kdGroup h4 { margin: 4px 0 2px; font-size: 13px; color: var(--ink-dim); font-weight: 600; }
.kdOpt .fx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.kdOpt.on > span { font-weight: 600; }
.kdOn { flex: none; color: var(--good); font-size: 13px; }
.kdKid > .tRow > span:first-child { flex: none; white-space: nowrap; }   /* 📖 Learning, 🌱 Wellbeing: the label on one line */
.kdKid > .tRow > b { text-align: right; }
@media (max-width: 600px) and (orientation: portrait) {
  .grPic { height: 160px; }
  .kdPic { width: 52px; height: 66px; }
  .lfViews button { padding: 0 4px; font-size: 13px; }
  .lfFoodRow { grid-template-columns: minmax(0, 1fr) 90px 40px; }
  .lfFeedRow { grid-template-columns: 1fr; gap: 0; }
}



/* ── reports · owner: session 5 · track C (birthday, Memoir, Gallery, 🎯 tab, photos) ──────────────────────────── */
/* The birthday report and its Details, the 🎯 tab, the Memoir book and the Life Gallery: full screens in #screen (its
   frame is the pc section's) and the tab's blocks. The wheel of life is an SVG with the sectors' icons around it, the
   photos are canvases (render/photo.js), the Memoir's pages are paper. */

:root { --rp-a: #f2b15a; --rp-b: #338ced; --rp-grid: rgba(255, 255, 255, 0.1); }
.rpScreen .rpRoot { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rpScreen .scrBody { padding-bottom: calc(18px + var(--safe-bottom)); }
button.primary.small { min-height: var(--tap); padding: 0 18px; font-size: 14px; }
.pill.dim { background: rgba(255, 255, 255, 0.08); color: var(--ink-dim); }
.rpIco { display: inline-block; min-width: 1.4em; text-align: center; }
.rpDone { color: var(--accent); font-weight: 700; white-space: nowrap; }
.rpMiss { color: var(--ink-dim); font-size: 13px; white-space: nowrap; }
.rpPct { color: var(--ink-dim); font-variant-numeric: tabular-nums; font-size: 13px; }
.rpBar { height: 6px; margin: 4px 0; }
.rpBar.ok i { background: var(--good); }
.rpBox { padding: 12px 16px; margin: 12px 0; border-radius: 16px; background: var(--sheet-2); border: 1px solid var(--sheet-line); }
.rpBox h3:first-child { margin-top: 2px; }
.rpBox h4 { margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-dim); }
.rpBdGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.rpBtns { margin-top: 16px; }
.rpBtns button { min-width: 140px; }

/* the wheel of life */
.rpWheelBox { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.rpWheel { position: relative; width: 230px; max-width: 100%; aspect-ratio: 1; flex: none; }
.rpWheel svg { position: absolute; inset: 11%; width: 78%; height: 78%; overflow: visible; }
.rpWheel .wRing { fill: none; stroke: var(--rp-grid); stroke-width: 1; }
.rpWheel .wSpoke { stroke: var(--rp-grid); stroke-width: 1; }
.rpWheel .wA { fill: rgba(242, 177, 90, 0.28); stroke: var(--rp-a); stroke-width: 2; stroke-linejoin: round; }
.rpWheel .wB { fill: rgba(51, 140, 237, 0.2); stroke: var(--rp-b); stroke-width: 2; stroke-linejoin: round; }
.rpWheel .wGhost { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.5; stroke-dasharray: 4 3; }
.wLab { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; line-height: 1.05; font-size: 15px; }
.wLab b { font-size: 11px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.rpWheel.tiny { width: 92px; }
.rpWheel.tiny .wLab { font-size: 9px; }
.rpWheel.tiny svg { inset: 13%; width: 74%; height: 74%; }
.rpWheel.cmp { width: 260px; margin: 0 auto; }
.rpBal { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.rpBal span { font-size: 12px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.rpBal b { font-size: 40px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.rpBal small { max-width: 140px; }

/* the 🎯 tab */
.rpTab .tCard { margin-bottom: 8px; }
.rpTab .tCard .hint { margin: 2px 0 0; }
.rpDream.done { border-color: rgba(242, 177, 90, 0.45); }
.rpDream.missed { opacity: 0.75; }
.rpChapter { margin: 0 0 8px; font-weight: 600; }
.rpPick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.rpPickBtn { font-size: 13.5px; }
.rpAchs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.rpLocks { display: flex; flex-wrap: wrap; gap: 5px; }
.rpLock { padding: 3px 9px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); color: var(--ink-dim); font-size: 12.5px; white-space: nowrap; }
.rpLock g-ico { filter: grayscale(1); opacity: 0.6; }
.rpAch { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: var(--sheet-2); font-size: 13px; }
.rpAch .rpIco { font-size: 20px; }
.rpAch b { display: block; }
.rpAch small { display: block; color: var(--ink-dim); font-size: 11.5px; line-height: 1.3; }
.rpAlbum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rpPhotoBtn { padding: 0; border: 0; background: none; transform: rotate(-1.2deg); transition: transform 0.15s; }
.rpPhotoBtn:nth-child(2n) { transform: rotate(1.4deg); }
.rpPhotoBtn:hover { transform: scale(1.03); }
.rpPhotoBtn.big { grid-column: 1 / -1; transform: none; }
.rpPhoto { display: block; width: 100%; aspect-ratio: 0.88; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); border-radius: 2px; }
.rpLinks { margin-top: 22px; }

/* the birthday report */
.rpBdTop { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 18px; align-items: start; }
.rpBdArt { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; align-items: end; }
.rpCakeBtn { padding: 0; border: 0; background: radial-gradient(circle at 50% 70%, rgba(242, 177, 90, 0.2), transparent 70%); border-radius: 16px; }
.rpCake { display: block; width: 100%; aspect-ratio: 0.9; }
.rpBdPhoto { transform: rotate(2deg); }
.rpFlash { animation: rpFlash 0.9s ease-out; }
@keyframes rpFlash { 0% { filter: brightness(3); opacity: 0.4; } 30% { filter: brightness(1.6); opacity: 1; } 100% { filter: none; } }
.rpWho { margin: 2px 0 10px; font-size: 17px; font-weight: 700; color: var(--accent); }
.rpLine { display: grid; grid-template-columns: 28px 74px 1fr; gap: 6px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--sheet-line); font-size: 14.5px; }
.rpLn { color: var(--ink-dim); font-size: 13px; }
.rpLv { font-variant-numeric: tabular-nums; }
.rpHl { margin: 4px 0; padding-left: 20px; line-height: 1.45; }
.rpHl li { margin: 3px 0; }
.rpDreamLine { display: grid; grid-template-columns: 1fr 70px auto; gap: 10px; align-items: center; min-height: 30px; font-size: 14px; }
.rpDreamLine .rpBar { margin: 0; }

/* Details: the charts (SVG at their width) */
.rpChart { width: 100%; min-height: 20px; }
.rpSvg { display: block; overflow: visible; }
.rpSvg .gGrid { stroke: var(--rp-grid); stroke-width: 1; }
.rpSvg .gAx { fill: var(--ink-dim); font-size: 10.5px; font-family: var(--font); }
.rpSvg .gLine { fill: none; stroke: var(--rp-a); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rpSvg .gDot { fill: var(--rp-a); stroke: var(--sheet-2); stroke-width: 2; }
.rpSvg .gHit { fill: transparent; }
.rpSvg .gHit:hover { fill: rgba(242, 177, 90, 0.35); }
.rpSvg .gIn { fill: var(--good); }
.rpSvg .gOut { fill: var(--bad); }
.rpSvg rect:hover { opacity: 0.8; }
.rpHours { margin-top: 8px; }
.rpHourRow { display: grid; grid-template-columns: 14px 1fr auto 64px; gap: 8px; align-items: center; min-height: 26px; font-size: 14px; }
.rpHourRow b, .rpHourRow span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.rpSw { width: 12px; height: 12px; border-radius: 3px; }
.rpTwo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rpMinis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; }
.rpMiniHead { display: flex; justify-content: space-between; font-size: 13px; }
.rpSkill { display: grid; grid-template-columns: 1fr 90px 26px 34px; gap: 8px; align-items: center; min-height: 26px; font-size: 14px; }
.rpSkill b, .rpSkill span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.rpHints { margin: 4px 0; padding-left: 20px; line-height: 1.5; }
.rpHints li { margin: 4px 0; }

/* the Memoir */
.rpMemoir .scrBody { display: flex; flex-direction: column; }
.mBook { flex: 1; display: flex; align-items: stretch; gap: 8px; min-height: 0; touch-action: pan-y; }
.mTurn { flex: none; width: 44px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.06); font-size: 34px; color: var(--ink-dim); }
.mTurn:hover:not([disabled]) { background: rgba(255, 255, 255, 0.12); color: var(--ink); }
.mLeaf { flex: 1; min-width: 0; max-width: 760px; margin: 0 auto; padding: 22px 28px; border-radius: 6px 16px 16px 6px; background: var(--paper); color: var(--paper-ink);
  box-shadow: var(--shadow), inset 10px 0 18px -12px rgba(80, 50, 20, 0.45); overflow: auto; }
.mLeaf.in { animation: fade 0.25s; }
.mLeaf.inR { animation: mInR 0.3s ease-out; }
.mLeaf.inL { animation: mInL 0.3s ease-out; }
@keyframes mInR { from { opacity: 0; transform: perspective(900px) rotateY(-14deg) translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes mInL { from { opacity: 0; transform: perspective(900px) rotateY(14deg) translateX(-30px); } to { opacity: 1; transform: none; } }
.mLeaf .hint, .mLeaf .rpMiss, .mLeaf .rpPct { color: var(--paper-dim); }
.mLeaf .rpDone { color: #a3611c; }
.scrBody .mLeaf h3 { margin: 2px 0 10px; font-size: 26px; font-family: Georgia, 'Times New Roman', serif; letter-spacing: 0; text-transform: none; color: var(--paper-ink); }
.mLeaf h4 { margin: 16px 0 6px; font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--paper-dim); }
.mLeaf .tRow { border-bottom: 1px dashed var(--paper-line); }
.mKicker { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper-dim); }
.mCover { text-align: center; }
.scrBody .mLeaf .memName { margin: 4px 0; font-size: 40px; }
.mFaces { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 10px 0 2px; }
.mFaces figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--paper-dim); }
.mFaces canvas { width: 76px; height: 76px; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 4px 12px rgba(80, 50, 20, 0.25); }
.mFaces figure.now canvas { width: 96px; height: 96px; }
.mTitle { margin: 0 0 4px; font: italic 600 24px Georgia, 'Times New Roman', serif; color: #a3611c; }
.mYears { margin: 0 0 10px; color: var(--paper-dim); }
.mCover .rpWheelBox { margin: 14px 0; }
.mLeaf .rpWheel .wRing, .mLeaf .rpWheel .wSpoke { stroke: rgba(80, 60, 40, 0.18); }
.mLeaf .rpWheel .wA { fill: rgba(242, 177, 90, 0.35); stroke: #c98327; }
.mLeaf .wLab b { color: var(--paper-dim); }
.mLeaf .rpBal b { color: #a3611c; }
.mLeaf .rpBal span { color: var(--paper-dim); }
.mLeaf .pill { background: rgba(163, 97, 28, 0.12); color: #8a5418; }
.hint.center { text-align: center; }
.mPhotos { display: flex; justify-content: center; gap: 16px; margin: 8px 0 14px; flex-wrap: wrap; }
.mPhoto { width: min(200px, 42%); }
.mPhotos .mPhoto:nth-child(1) { transform: rotate(-2deg); }
.mPhotos .mPhoto:nth-child(3) { transform: rotate(2.4deg); }
.mGoals, .mList, .mLines { margin: 6px 0; padding-left: 0; list-style: none; line-height: 1.5; }
.mGoals li, .mList li { margin: 4px 0; }
.mLines li { margin: 0 0 6px; }
.mYear { display: block; margin-top: 8px; font-size: 12px; font-weight: 700; color: #a3611c; }
.mPcs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; }
.mPc { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--paper-dim); }
.mPcArt { width: 86px; height: 72px; }
.mAchs { display: flex; flex-wrap: wrap; gap: 6px; }
.mAch { padding: 4px 10px; border-radius: 14px; background: rgba(163, 97, 28, 0.1); font-size: 13px; }
.mEnd { margin: 22px 0 4px; text-align: center; font: italic 18px Georgia, 'Times New Roman', serif; color: var(--paper-dim); }
.mFoot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; }
.mDots { display: flex; flex-wrap: wrap; gap: 4px; }
.mDot { width: 14px; height: 14px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.mDot[aria-pressed="true"] { background: var(--accent); }

/* the Life Gallery */
.gTools { margin: 0 0 12px; }
.gGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.gCard { padding: 12px 14px; border-radius: 16px; background: var(--sheet-2); border: 1px solid var(--sheet-line); }
.gCard.sel { border-color: var(--accent); }
.gTop { display: grid; grid-template-columns: 72px 1fr 92px; gap: 12px; align-items: center; }
.gFace { width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(246, 241, 230, 0.85); }
.gInfo { display: flex; flex-direction: column; min-width: 0; }
.gName { font-size: 18px; }
.gTitle { color: var(--accent); font-weight: 600; }
.gTags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gNums { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 8px 0 2px; font-size: 13.5px; color: var(--ink-dim); }
.gNums b { color: var(--ink); }
.gDream { font-size: 17px; opacity: 0.35; filter: grayscale(1); }
.gDream.done { opacity: 1; filter: none; }
.gBtns { margin: 8px 0 0; align-items: center; }
.gAsk { font-size: 13.5px; }
.gCmpHead { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
.gWho { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--sheet-2); border-left: 4px solid var(--rp-a); }
.gWho.b { border-left-color: var(--rp-b); }
.gWho span { display: flex; flex-direction: column; min-width: 0; }
.gWho small { color: var(--ink-dim); }
.gWho .gFace { width: 52px; height: 52px; flex: none; }
.gLegend { justify-content: center; }
.lA::before { background: var(--rp-a); }
.lB::before { background: var(--rp-b); }
.gCmpRow { display: grid; grid-template-columns: 1fr 96px 96px 86px; gap: 6px; align-items: center; min-height: 28px; font-size: 14px; border-bottom: 1px solid var(--sheet-line); }
.gCmpRow b, .gCmpRow span:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gCmpRow.head b { font-size: 12px; color: var(--ink-dim); }
.gRecs { display: flex; flex-direction: column; gap: 8px; }
.gRec { display: grid; grid-template-columns: 34px 1fr auto; grid-template-areas: "i n v" "i w w"; gap: 0 10px; padding: 10px 14px; border-radius: 14px; background: var(--sheet-2); }
.gRec .rpIco { grid-area: i; align-self: center; font-size: 22px; }
.gRecName { grid-area: n; }
.gRec b { grid-area: v; color: var(--accent); font-variant-numeric: tabular-nums; }
.gRec .hint { grid-area: w; margin: 0; }

@media (max-width: 760px) {
  .rpBdTop, .rpBdGrid, .rpTwo { grid-template-columns: 1fr; }
  .rpBdArt { grid-template-columns: 0.8fr 1.2fr; }
  .rpLine { grid-template-columns: 26px 64px 1fr; font-size: 14px; }
  .mTurn { display: none; }
  .mLeaf { padding: 16px; border-radius: 10px; }
  .scrBody .mLeaf .memName { font-size: 32px; }
  .gGrid { grid-template-columns: 1fr; }
  .gCmpHead { grid-template-columns: 1fr; }
  .gCmpRow { grid-template-columns: 1fr 74px 74px 62px; font-size: 13px; }
}
@media (max-width: 420px) {
  .rpWheel { width: 200px; }
  .gTop { grid-template-columns: 60px 1fr 80px; gap: 8px; }
  .gFace { width: 60px; height: 60px; }
  .rpWheel.tiny { width: 80px; }
  .rpAlbum { grid-template-columns: repeat(2, 1fr); }
  .rpDreamLine { grid-template-columns: 1fr 50px auto; font-size: 13.5px; }
}

