/* Marginal on the web. Colours, type and sizes follow the iOS app: Brand.swift, HUD.swift, BottomDock.swift, RootView.swift. */
:root {
  --paper: #173E6B; --deep: #0F2A49; --ink: #F3EBD8; --accent: #F2A541; --stamp: #E8553E; --teal: #3FA7A0; --sky: #261D4A; --lawn: #3C6345; --blue-top: #2B6CC4; --blue-bottom: #153E7A;
  --good: #34C759; --orange: #FF9F0A;
  --glass: rgba(28, 28, 40, .42); --glass-line: rgba(255, 255, 255, .16);
  --din: "DIN Condensed", "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", system-ui, sans-serif;
  --num: "DIN Alternate", "Bahnschrift", "Roboto Condensed", ui-monospace, "SF Mono", Menlo, monospace;
  --round: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rail: 56px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: #fff; font: 15px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; padding: 0; }
[hidden] { display: none !important; }
p { margin: 0; }
.num { font-family: var(--num); font-weight: 700; font-variant-numeric: tabular-nums; }
.din { font-family: var(--din); font-weight: 700; letter-spacing: .01em; }
/* Luckiest Guy (Apache 2.0, fonts/): the wordmark's lettering, for big moments only (lucky.js, iOS LuckyText). */
@font-face { font-family: "Luckiest Guy"; src: url("fonts/LuckiestGuy-Regular.ttf") format("truetype"); font-display: swap; }
.lucky { --line: #2A1E3D; --edge: #E88633; --w: .075em; position: relative; display: inline-block; margin: 0; padding: .06em .08em .14em;
  font-family: "Luckiest Guy", var(--din); font-weight: 400; letter-spacing: .02em; line-height: 1.08; color: #FFD84A; transform: rotate(-3deg);
  text-shadow: var(--w) 0 var(--line), calc(-1 * var(--w)) 0 var(--line), 0 var(--w) var(--line), 0 calc(-1 * var(--w)) var(--line),
    .053em .053em var(--line), -.053em .053em var(--line), .053em -.053em var(--line), -.053em -.053em var(--line),
    .015em .05em var(--edge), .025em .085em var(--edge), .035em .12em var(--edge),
    calc(.04em + var(--w)) .13em var(--line), calc(.04em - var(--w)) .13em var(--line), .04em calc(.13em + var(--w)) var(--line), .093em .183em var(--line), -.013em .183em var(--line); }
.lucky .face { position: absolute; inset: .06em .08em .14em; color: transparent; text-shadow: none; background: linear-gradient(#FFF8E6 10%, #FFD84A 90%);
  -webkit-background-clip: text; background-clip: text; pointer-events: none; }
.lucky.left { text-align: left; transform: rotate(-2deg); transform-origin: left center; }
/* A little sunburst behind art (iOS Sunburst): soft rays and a glow fading out, turning slowly. */
.flarewrap { position: relative; display: grid; place-items: center; }
.flarewrap > :not(.flare) { position: relative; }
.flare { position: absolute; width: 210px; height: 210px; left: 50%; top: 50%; margin: -105px 0 0 -105px; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(242,165,65,.5), rgba(242,165,65,0) 55%), repeating-conic-gradient(rgba(242,165,65,.55) 0 9deg, transparent 9deg 22.5deg);
  -webkit-mask: radial-gradient(closest-side, #000 10%, transparent 100%); mask: radial-gradient(closest-side, #000 10%, transparent 100%); animation: flarespin 40s linear infinite; }
@keyframes flarespin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .flare { animation: none; } }
.accent { color: var(--accent); }
.sf { display: block; flex: none; }
.art { display: block; object-fit: contain; flex: none; }

/* Glass: the iOS 26 Liquid Glass look, dark. */
.glass { background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
  box-shadow: 0 6px 18px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.12); }
.capsule { border-radius: 999px; }
.round { border-radius: 50%; width: 46px; height: 46px; display: grid; place-items: center; flex: none; }
.round.big { width: 60px; height: 60px; }
.glass.tint { background: rgba(242,165,65,.88); color: #000; border-color: rgba(255,255,255,.3); }
@media (hover: hover) { .glass:hover { border-color: rgba(255,255,255,.28); } }

/* Blueprint paper behind panels: deep navy with a faint drafting grid (BlueprintBackground). */
.blueprint {
  background-color: var(--deep);
  background-image:
    linear-gradient(rgba(243,235,216,.09) .7px, transparent .7px), linear-gradient(90deg, rgba(243,235,216,.09) .7px, transparent .7px),
    linear-gradient(rgba(243,235,216,.04) .5px, transparent .5px), linear-gradient(90deg, rgba(243,235,216,.04) .5px, transparent .5px);
  background-size: 48px 48px, 48px 48px, 12px 12px, 12px 12px;
}

#app { position: fixed; inset: 0; }
#split { position: absolute; inset: 0; display: flex; }
#stage { position: relative; flex: 1; min-width: 0; overflow: hidden; background: var(--lawn); transition: flex-basis .35s; }
#floor { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
body.expanded #stage { flex: 0 0 0; opacity: 0; }

/* The bars over the floor (RootView.floor): 12 px from the edges, at most 820 wide. */
#chrome { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; pointer-events: none;
  padding: calc(env(safe-area-inset-top) + 8px) 12px calc(env(safe-area-inset-bottom) + 4px); max-width: 844px; margin: 0 auto; }
body.rail #chrome { left: var(--rail); right: 0; margin: 0 auto; max-width: 844px; }
#chrome > * { pointer-events: auto; }
#chrome > .grow { flex: 1; pointer-events: none; }

#topbar { display: flex; gap: 8px; align-items: center; }
#hud { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 12px; text-align: left; min-height: 46px; }
.hud-text { flex: 1; min-width: 0; display: grid; }
.hud-rate { display: flex; align-items: baseline; gap: 1px; white-space: nowrap; }
#rate { font-size: 19px; color: #fff; overflow: hidden; text-overflow: ellipsis; }
#rate.neg { color: var(--stamp); }
.hud-rate small { font-size: 11px; color: rgba(255,255,255,.6); }
.hud-sub { display: flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; }
#company { color: var(--accent); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hud-sub i { font-style: normal; color: rgba(255,255,255,.5); }
#bankico { color: rgba(255,255,255,.6); }
#cash { color: rgba(255,255,255,.75); }
#cash.neg { color: var(--stamp); }
.hud-day { display: flex; align-items: center; gap: 6px; flex: none; }
.ring { width: 15px; height: 15px; border-radius: 50%; display: block;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1turn), rgba(255,255,255,.15) 0);
  -webkit-mask: radial-gradient(circle, transparent 4.4px, #000 4.6px); mask: radial-gradient(circle, transparent 4.4px, #000 4.6px); }
#day { font-size: 17px; padding-top: 3px; white-space: nowrap; }
#clock { display: flex; gap: 6px; }
#speed { font-size: 18px; }

/* The strip under the top bar (FactoryRateStrip). */
#strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
#strip::-webkit-scrollbar { display: none; }
.pill { display: flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; white-space: nowrap; flex: none; color: #fff; }
.pill .din { font-size: 15px; padding-top: 2px; }
.pill .num { font-size: 13px; }
.pill.bank { background: rgba(232,85,62,.75); gap: 6px; }
.pill.econ.good { background: rgba(52,199,89,.55); } .pill.econ.bad { background: rgba(232,85,62,.55); }
.pill.econ .num { opacity: .75; }
.pill.rate .num { font-size: 14px; }
.pill.rate.here { background: var(--accent); color: #000; }
.pill.rate.neg:not(.here) .num { color: var(--stamp); }
.pill .ico { position: relative; width: 20px; height: 20px; display: grid; place-items: center; font-size: 16px; }
.pill .dot { position: absolute; right: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.qring { width: 16px; height: 16px; border-radius: 50%; display: block; background: conic-gradient(var(--c) calc(var(--p) * 1turn), rgba(255,255,255,.2) 0);
  -webkit-mask: radial-gradient(circle, transparent 4.6px, #000 4.8px); mask: radial-gradient(circle, transparent 4.6px, #000 4.8px); }

/* Education mode: one live insight under the top bar (CoachTicker). */
#ticker { display: flex; align-items: center; gap: 8px; padding: 7px 6px 7px 14px; border-radius: 20px; }
#ticker .go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; }
#ticker .go p { flex: 1; font: 500 12px/1.3 var(--round); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#ticker .go .lead { color: var(--accent); } #ticker.warn .go .lead { color: var(--orange); }
#ticker .go .chev, #ticker .x { color: rgba(235,235,245,.6); }
#ticker .x { width: 28px; height: 28px; display: grid; place-items: center; }
/* Worker characters (workers.js sets the --wk-* numbers): decorative, hidden on very narrow screens and at big text. */
.worker { position: absolute; display: block; pointer-events: none; user-select: none; }
/* A character is a <wk-figure> (workers.js): the still, and over it the strip of two eye frames (half closed, closed) while it blinks.
   It rises 0.4 s from behind the edge its clip-path crops at (`wk-pre` waits below it, `wk-up` rises), or under Reduce Motion fades in 0.2 s. */
wk-figure .wk-in { display: block; position: relative; width: 100%; height: 100%; overflow: hidden; }
wk-figure .wk-art { display: block; width: 100%; height: 100%; }
wk-figure .wk-blink { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 0 0; opacity: 0; }
wk-figure .wk-blink[data-f="1"] { opacity: 1; }
wk-figure .wk-blink[data-f="2"] { opacity: 1; object-position: 100% 0; }
/* A gesture clip (workers.js): the still's frame repeated side by side in one image, as wide as its poses. It takes the still's place while it
   plays and one transform picks the frame, so nothing is laid out or repainted. */
wk-figure .wk-clip { position: absolute; left: 0; top: 0; height: 100%; max-width: none; transform-origin: 0 0; will-change: transform; }
.worker.wk-pre .wk-in { transform: translateY(100%); }
.worker.wk-up .wk-in { transition: transform .4s cubic-bezier(.2, .9, .3, 1.012); }
.worker.wk-pre.wk-fade .wk-in { transform: none; opacity: 0; }
.worker.wk-up.wk-fade .wk-in { transition: opacity .2s ease-out !important; }
html.no-workers .worker { display: none; }
/* The floor hand stands in the Bottleneck tip's left end, his bottom edge at the bar's (the 1px is its border), his hat above its top; the hourglass comes back when he is hidden. */
#ticker { position: relative; }
#ticker .worker.floor-hand { left: calc(-1 * var(--wk-floor-hand-outset)); bottom: calc(-1px - var(--wk-floor-hand-hide)); width: var(--wk-floor-hand-width); height: var(--wk-floor-hand-height); clip-path: inset(0 0 var(--wk-floor-hand-hide) 0); }
html:not(.no-workers) #ticker.has-worker { min-height: var(--wk-floor-hand-bar); }
html:not(.no-workers) #ticker.has-worker .go { margin-left: calc(var(--wk-floor-hand-slot) + 8px); }
html:not(.no-workers) #ticker.has-worker .go .lead { display: none; }
/* The business's worker in four more places: each stands behind an edge (clip-path crops the frame's bottom), nothing moves. */
.worker.next-btn, .worker.answer, .worker.tomorrow, .worker.machine { clip-path: inset(0 0 var(--h) 0); height: var(--ht); width: var(--w); }
.worker.next-btn { --w: var(--wk-next-btn-width); --ht: var(--wk-next-btn-height); --h: var(--wk-next-btn-hide); left: var(--wk-next-btn-inset); bottom: calc(-1px - var(--wk-next-btn-hide)); }
.worker.answer { --w: var(--wk-answer-width); --ht: var(--wk-answer-height); --h: var(--wk-answer-hide); right: var(--wk-answer-inset); bottom: calc(100% - var(--wk-answer-hide)); z-index: 0; }
.worker.tomorrow { --w: var(--wk-tomorrow-width); --ht: var(--wk-tomorrow-height); --h: var(--wk-tomorrow-hide); right: var(--wk-tomorrow-inset); bottom: calc(-1 * var(--wk-tomorrow-hide)); }
.navbar.has-worker { position: relative; }
.worker.machine { --w: var(--wk-machine-width); --ht: var(--wk-machine-height); --h: var(--wk-machine-hide); right: var(--wk-machine-inset); bottom: calc(-1 * var(--wk-machine-hide)); }

/* The end-of-day stamp (ProfitStampView). */
#stampslot { height: 50px; display: grid; place-items: center; pointer-events: none !important; }
/* With the panels in the rail nothing sits under the row, so it keeps clear of the bottom edge (the build bar takes that room when open). */
body.rail #chrome:has(#palette[hidden]) #stampslot { margin-bottom: 40px; }
.stamp { font: 700 26px/1 var(--din); text-transform: uppercase; color: var(--paper); background: var(--ink); border: 3.5px solid var(--stamp);
  padding: 10px 16px 6px; transform: rotate(-3deg); box-shadow: 0 2px 2px rgba(0,0,0,.35); animation: slam .45s cubic-bezier(.3,1.6,.5,1) both; white-space: nowrap; }
.stamp.loss { color: var(--stamp); }
.stamp.out { animation: fadeout .4s ease-out forwards; }
@keyframes slam { from { transform: rotate(-3deg) scale(1.9); opacity: 0; box-shadow: 0 10px 14px rgba(0,0,0,.35); } to { transform: rotate(-3deg) scale(1); opacity: 1; } }
@keyframes fadeout { to { opacity: 0; } }

/* The dock (BottomDock): this factory's panels in a capsule, the hammer beside it. */
#dock { display: flex; gap: 10px; align-items: center; }
#tabs { flex: 1; display: flex; padding: 4px; min-width: 0; }
.tab { flex: 1; min-width: 0; min-height: 52px; display: grid; justify-items: center; align-content: center; gap: 3px; border-radius: 999px; color: rgba(255,255,255,.9); position: relative; transition: background .25s, color .25s; }
.tab .din { font-size: 14px; padding-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab.on { color: var(--accent); background: rgba(242,165,65,.18); }
.tab.on .icon { transform: scale(1.12); }
.tab .icon { position: relative; transition: transform .25s; height: 26px; display: grid; place-items: center; }
.tab .badge { position: absolute; right: -4px; top: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--stamp); }
@media (hover: hover) { .tab:hover:not(.on) { background: rgba(255,255,255,.08); } }
#hammer, #railhammer { color: #fff; }
#hammer.tint, #railhammer.tint { color: #000; }

/* The build palette (BuildPalette), the whole dock while building. */
#palette { border-radius: 28px; padding: 12px 6px 6px; display: grid; gap: 8px; }
.pal-top { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 10px; }
#palhint { flex: 1; font: 500 12px/1.3 var(--round); color: rgba(255,255,255,.85); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
#palclose { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #000; display: grid; place-items: center; flex: none; }
#paltools { display: flex; gap: 2px; }
.tool { flex: 1; min-width: 0; min-height: 58px; display: grid; justify-items: center; align-content: center; gap: 2px; border-radius: 22px; color: rgba(255,255,255,.9); position: relative; }
.tool .icon { height: 22px; display: grid; place-items: center; }
.tool .din { font-size: 13px; display: flex; align-items: center; gap: 2px; white-space: nowrap; overflow: hidden; max-width: 100%; }
.tool .num { font-size: 10px; opacity: .75; min-height: 12px; }
.tool.on { background: var(--accent); color: #000; }
.tool.poor { opacity: .45; }
.menu { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); min-width: 240px; padding: 6px; border-radius: 18px; display: grid; z-index: 5; background: rgba(40,40,52,.92); }
.menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-align: left; font-size: 15px; white-space: nowrap; }
.menu button:hover { background: rgba(255,255,255,.1); }
.menu button .txt { display: flex; flex-direction: column; gap: 1px; }
.menu button .txt small { font-size: 12px; opacity: .7; }

/* iPad landscape: the panel buttons down the left edge (NavRail). */
/* Icon-only, --rail wide (ShellLayout.railWidth, set from mg_static): a button is 44 wide, the capsule adds 3 a side, 6 from the edge.
   The open panel's button also shows its name; the others name themselves on hover (title). */
#rail { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); display: grid; justify-items: center; gap: 12px; z-index: 3; }
#railtabs { display: grid; gap: 2px; padding: 4px 2px; border-radius: 40px; }
#railtabs .tab { width: 44px; height: 52px; min-height: 0; flex: none; gap: 2px; }
#railtabs .tab .din { display: none; font-size: 11px; padding-top: 0; }
#railtabs .tab.on .din { display: block; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#railhammer { width: 50px; height: 50px; }
#railtabs hr { width: 36px; border: 0; border-top: 1px solid rgba(255,255,255,.2); margin: 4px auto; }

/* A panel beside the floor (SidePanel): full height, the floor stays live next to it. */
#side { position: relative; flex: none; height: 100%; border-left: 1px solid rgba(243,235,216,.12); overflow: hidden; display: flex; flex-direction: column; }
body.expanded #side { flex: 1; }
body.rail.expanded #side { margin-left: var(--rail); }

/* A panel over the floor (iPhone sheet, .presentationDetents([.medium, .large])). */
#sheet { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
#sheet.large { pointer-events: auto; background: rgba(0,0,0,.25); }
/* Half height it floats inset with every corner rounded (iOS 26); full height it meets the edges. */
.sheet-body { position: absolute; left: 8px; right: 8px; bottom: 8px; height: calc(100% - env(safe-area-inset-top) - 18px); border-radius: 38px;
  transition: transform .38s cubic-bezier(.2,.9,.25,1), left .3s, right .3s, bottom .3s, border-radius .3s;
  pointer-events: auto; display: flex; flex-direction: column; overflow: hidden; transform: translateY(100%);
  box-shadow: 0 -8px 30px rgba(0,0,0,.35); }
#sheet.large .sheet-body { left: 0; right: 0; bottom: 0; border-radius: 38px 38px 0 0; height: calc(100% - env(safe-area-inset-top) - 10px); }
#sheet.dragging .sheet-body { transition: none; }
.grabber { height: 22px; flex: none; display: grid; place-items: center; cursor: grab; touch-action: none; }
.grabber i { width: 36px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.35); }
#sheetcontent { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* A panel's own page: a navigation bar and a scrolling body. */
.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#sheetcontent .panel { background: transparent; }
.navbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 52px; }
#sheet .navbar { padding-top: 0; }
.navbar h2 { flex: 1; margin: 0; font: 700 17px/1.2 system-ui, -apple-system, sans-serif; text-align: center; }
.navbar .navbtns { display: flex; gap: 8px; min-width: 88px; }
.navbar .navbtns:last-child { justify-content: flex-end; }
.navbar.docked h2 { text-align: left; font-size: 20px; font-weight: 600; }
.navbar.docked .navbtns:last-child:empty { display: none; }
.navbtns.chrome { min-width: 0; gap: 0; padding: 2px 6px; color: var(--accent); }
.navbtn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); display: grid; grid-auto-rows: max-content; gap: 16px; align-content: start; }
.large-title { font: 700 34px/1.1 system-ui, -apple-system, sans-serif; margin: 0 0 2px; }

/* Shared pieces (Components.swift). */
.card { background: var(--paper); border: 1px solid rgba(243,235,216,.28); border-radius: 10px; padding: 16px; display: grid; gap: 12px; }
.card-title { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.card-title .sf { color: var(--accent); }
.card-title .din { font-size: 21px; padding-top: 3px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.stattile { background: rgba(15,42,73,.55); border: 1px solid rgba(243,235,216,.15); border-radius: 8px; padding: 12px; display: grid; gap: 4px; min-width: 0; }
.stattile .lbl { display: flex; align-items: center; gap: 6px; font: 700 14px/1 var(--din); color: rgba(243,235,216,.7); }
.stattile .val { font: 700 22px/1.1 var(--num); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(63,167,160,.22); border: 1px solid rgba(63,167,160,.7);
  color: #9EE6DB; font: 600 12px/1.2 var(--round); justify-self: start; }
.secondary { color: rgba(235,235,245,.6); }
.note { font-size: 13px; color: rgba(235,235,245,.6); }
.bigbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px; border-radius: 999px; font-weight: 600; font-size: 17px; }
.bigbtn:disabled { opacity: .4; }
/* Amber game button (matches iOS AmberButtonStyle): every full-orange primary button. Danger and ghost variants opt out. */
.bigbtn:not(.secondary-btn):not(.cp-danger), .hq .primarybtn, .ln-btns .primarybtn, .inv-hire, .ws-tradebar .buy, #learnbar.tour .next {
  background: linear-gradient(#F7B957, #E2922A); color: #2A1A00;
  box-shadow: 0 3px 0 #9B5F14, 0 4px 6px rgba(0,0,0,.3);
}
.bigbtn:not(.secondary-btn):not(.cp-danger):active, .hq .primarybtn:active, .ln-btns .primarybtn:active, .inv-hire:active, .ws-tradebar .buy:active, #learnbar.tour .next:active {
  transform: translateY(2px); box-shadow: 0 1px 0 #9B5F14, 0 4px 6px rgba(0,0,0,.3);
}
.bigbtn:not(.secondary-btn):not(.cp-danger):disabled, .hq .primarybtn:disabled, .ln-btns .primarybtn:disabled, .inv-hire:disabled, .ws-tradebar .buy:disabled, #learnbar.tour .next:disabled {
  opacity: .4; box-shadow: none; transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .bigbtn:not(.secondary-btn):not(.cp-danger):active, .hq .primarybtn:active, .ln-btns .primarybtn:active, .inv-hire:active, .ws-tradebar .buy:active, #learnbar.tour .next:active {
    transform: none; filter: brightness(.9);
  }
}
.row { display: flex; align-items: center; gap: 12px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 17px; }
.toggle input { appearance: none; width: 51px; height: 31px; border-radius: 16px; background: rgba(120,120,128,.32); position: relative; transition: background .2s; flex: none; cursor: pointer; margin: 0; }
.toggle input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.toggle small { display: block; margin-top: 2px; font-size: 13px; color: rgba(235,235,245,.6); }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { left: 22px; }
/* iOS inset grouped form rows on paper (Form + .listRowBackground(Brand.paper)). */
.form { display: grid; gap: 22px; }
.section h4 { margin: 0 0 6px 16px; font: 400 13px/1.2 system-ui, sans-serif; color: rgba(235,235,245,.6); text-transform: uppercase; }
.group { background: var(--paper); border-radius: 12px; overflow: hidden; }
.group > * + * { border-top: .5px solid rgba(255,255,255,.12); }
.group > p { padding: 12px 16px; font-size: 16px; }
.group .link { display: block; width: 100%; text-align: left; padding: 12px 16px; font-size: 17px; font-weight: 600; color: var(--accent); }
.mode { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; width: 100%; text-align: left; }
.mode .lead { width: 32px; display: grid; place-items: center; color: rgba(235,235,245,.6); padding-top: 2px; }
.mode.on .lead, .mode.on .check { color: var(--accent); }
.mode .txt { flex: 1; display: grid; gap: 3px; }
.mode .txt b { font-size: 17px; font-weight: 600; }
.mode .txt span { font-size: 12px; color: rgba(235,235,245,.6); }
.mode .check { color: rgba(235,235,245,.6); padding-top: 2px; }

/* Market panel (#33): after MarketPanel and its cards on iOS. */
.panel-body.market { container-type: inline-size; }
.mk-main, .mk-detail { display: grid; gap: 16px; align-content: start; min-width: 0; }
.mk-slot { display: grid; min-width: 0; }
.mk-slot > .card, .mk-slot > .tiles { min-width: 0; }
h2.mk-title { display: flex; align-items: center; justify-content: center; gap: 8px; }
.navbar.docked h2.mk-title { justify-content: flex-start; }
.mk-badgerow { display: flex; }
.mk-badge { --c: var(--orange); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); }
.mk-badge .din { font-size: 16px; padding-top: 2px; letter-spacing: .04em; }
.mk-badge.orange { --c: #FF9F0A; } .mk-badge.purple { --c: #BF5AF2; } .mk-badge.blue { --c: #0A84FF; } .mk-badge.red { --c: #FF453A; }
.mk-badge.teal { --c: #40C8E0; } .mk-badge.pink { --c: #FF375F; } .mk-badge.cyan { --c: #64D2FF; }
.mk-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (min-width: 600px) { .mk-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.mk-tiles .stattile { padding: 10px; }
.mk-tiles .stattile .lbl { font-size: 13px; }
.mk-tiles .stattile .val { font-size: 20px; }
.stattile.good .val { color: var(--good); } .stattile.bad .val { color: var(--stamp); } .stattile.warn .val { color: var(--orange); }
.mk-subtiles { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.market .good { color: var(--good); } .market .bad { color: var(--stamp); } .market .warn { color: var(--orange); }
/* The half-height sheet is the full sheet slid down, so leave room to scroll the last card into view. */
/* At half height the sheet is the full sheet slid down, so a panel's end needs room to scroll into view. */
#sheet:not(.large) .panel-body { padding-bottom: calc(50vh + 24px); }
/* In effect strip */
.mk-strip h3 { margin: 0 0 8px 2px; font: 700 20px/1 var(--din); padding-top: 3px; color: var(--ink); }
.mk-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.mk-mod { flex: none; width: 128px; height: 128px; scroll-snap-align: start; text-align: left; padding: 12px; border-radius: 14px; background: var(--paper); border: 1px solid rgba(243,235,216,.28);
  display: grid; grid-template-rows: auto auto 1fr; gap: 4px; align-content: start; color: var(--ink); overflow: hidden; }
.mk-mod.good { border-color: rgba(52,199,89,.7); background: rgba(52,199,89,.14); color: var(--ink); }
.mk-mod.bad { border-color: rgba(232,85,62,.8); background: rgba(232,85,62,.14); color: var(--ink); }
.mk-mod.warn { border-color: rgba(255,159,10,.7); background: rgba(255,159,10,.12); color: var(--ink); }
.mk-mod .top { display: flex; justify-content: space-between; align-items: center; color: var(--accent); }
.mk-mod .days { font-size: 14px; color: rgba(243,235,216,.75); }
.mk-mod .ttl { font: 600 14px/1.15 system-ui, sans-serif; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-mod .fx { display: grid; gap: 1px; font: 700 12px/1.2 var(--round); align-content: end; }
.mk-mod .fx .good { color: var(--good); } .mk-mod .fx .bad { color: #FF7A66; }
/* Cards */
.mk-card .note p, .mk-card p { margin: 0; }
.mk-card .secondary { color: rgba(235,235,245,.6); }
.mk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { cursor: pointer; }
.mk-note { display: grid; gap: 6px; justify-items: start; }
.mk-line { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-radius: 10px; font-size: 15px; background: rgba(243,235,216,.07); }
.mk-line.rival { background: rgba(10,132,255,.16); } .mk-line.taker b { font-size: 22px; color: var(--accent); }
.mk-split { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mk-bar { height: 10px; border-radius: 5px; background: rgba(243,235,216,.14); overflow: hidden; }
.mk-bar i { display: block; height: 100%; border-radius: 5px; background: var(--accent); transition: width .25s; }
.mk-bar.good i { background: var(--good); } .mk-bar.bad i { background: var(--stamp); } .mk-bar.warn i { background: var(--orange); }
.mk-verdict { font: 500 14px/1.35 var(--round); color: var(--ink); }
.mk-slider { display: flex; align-items: center; gap: 12px; }
.mk-slider input { flex: 1; min-width: 0; accent-color: var(--accent); height: 32px; margin: 0; }
.mk-slider output { min-width: 64px; text-align: right; font-size: 17px; color: var(--ink); }
.mk-nudges { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mk-nudge { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 6px; row-gap: 2px; align-items: center; text-align: left; padding: 10px; border-radius: 12px;
  background: rgba(243,235,216,.09); border: 1px solid rgba(243,235,216,.2); color: var(--ink); }
.mk-nudge .sf { color: var(--accent); grid-row: 1 / 3; }
.mk-nudge .lbl { font-weight: 600; font-size: 15px; }
.mk-nudge .mk-delta { grid-column: 2; }
.mk-nudge:active { background: rgba(243,235,216,.18); }
.mk-delta { font-size: 14px; color: rgba(235,235,245,.6); white-space: nowrap; }
.mk-delta.good { color: var(--good); } .mk-delta.bad { color: var(--stamp); } .mk-delta.cur { font: 600 12px var(--round); }
.mk-best { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--good); }
.mk-gen2 { display: grid; gap: 6px; font-size: 14px; justify-items: start; }
.mk-gen2 .fading { font: 600 12px var(--round); color: var(--orange); background: rgba(255,159,10,.18); padding: 3px 8px; border-radius: 999px; }
.mk-subhead { display: flex; justify-content: space-between; align-items: baseline; }
.num.big { font-size: 30px; line-height: 1.1; }
.mk-spark { width: 100%; height: 56px; }
.mk-spark polygon { fill: rgba(63,167,160,.22); } .mk-spark polyline { fill: none; stroke: var(--teal); stroke-width: 2; vector-effect: non-scaling-stroke; }
.mk-sub { display: grid; gap: 8px; padding-top: 10px; border-top: .5px solid rgba(243,235,216,.18); }
.mk-card .toggle { padding: 0; font-size: 16px; }
.mk-toggle { font-weight: 600; }
.mk-running { display: flex; gap: 12px; align-items: flex-start; color: var(--accent); }
.mk-running b { color: var(--ink); font-weight: 600; }
.mk-warn { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--orange); }
.mk-warn .sf { margin-top: 1px; }
.mk-row, .mk-radio, .mk-chan { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; color: var(--ink); }
.mk-row + .mk-row, .mk-radio + .mk-radio, .mk-chan + .mk-chan { padding-top: 12px; border-top: .5px solid rgba(243,235,216,.15); }
.mk-row .ic { color: var(--accent); width: 28px; padding-top: 2px; display: grid; place-items: center; flex: none; }
.mk-row .txt, .mk-radio .txt, .mk-chan .txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mk-row .txt b, .mk-radio .txt b, .mk-chan .txt b { font-weight: 600; font-size: 15px; }
.mk-gain { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.mk-buy { flex: none; align-self: center; padding: 8px 14px; border-radius: 999px; background: var(--accent); color: #000; font: 700 15px var(--num); min-width: 72px; }
.mk-buy:disabled { background: rgba(243,235,216,.14); color: rgba(235,235,245,.45); }
.mk-state { flex: none; align-self: center; font: 600 13px var(--round); color: rgba(235,235,245,.6); }
.mk-state.running { color: var(--good); }
.mk-rl { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; }
.mk-rl .sf { margin-top: 2px; flex: none; }
.mk-rl.strong { color: var(--ink); font-weight: 600; }
.mk-rl.small { font-size: 12px; color: rgba(235,235,245,.6); }
.mk-rl.warn { color: var(--orange); } .mk-rl.bad { color: #FF7A66; } .mk-rl.good { color: var(--good); }
.mk-bigbtn { padding: 12px; font-size: 16px; }
.mk-radio .dot { color: rgba(235,235,245,.6); padding-top: 1px; flex: none; }
.mk-radio.on .dot { color: var(--accent); }
.mk-radio > .mk-delta, .mk-radio > .mk-art { flex: none; }
.mk-art { display: inline-grid; place-items: center; flex: none; color: var(--accent); }
.mk-chan .lead { width: 28px; padding-top: 2px; display: grid; place-items: center; flex: none; color: var(--accent); }
.mk-sw { padding: 0; align-self: center; }
.mk-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border-radius: 12px; background: rgba(0,0,0,.25); }
.mk-seg button { display: grid; gap: 2px; justify-items: center; padding: 8px 2px; border-radius: 9px; color: var(--ink); }
.mk-seg button .nm { font-size: 18px; padding-top: 2px; }
.mk-seg button.on { background: rgba(242,165,65,.25); box-shadow: inset 0 0 0 2px var(--accent); }
.mk-seg .mk-delta { font-size: 12px; text-align: center; white-space: normal; }
/* Modifier detail (ModifierDetailView) */
.mk-donebar { display: flex; }
.mk-done { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 600; font-size: 17px; padding: 6px 4px; }
.mk-dhead { display: flex; gap: 12px; align-items: center; }
.mk-dhead h3 { margin: 0; font: 700 24px/1 var(--din); padding-top: 3px; color: var(--ink); }
.mk-dhead .big { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; flex: none; background: rgba(243,235,216,.1); color: var(--accent); }
.mk-dhead .big.good { background: rgba(52,199,89,.2); color: var(--good); } .mk-dhead .big.bad { background: rgba(232,85,62,.22); color: #FF7A66; }
.mk-tip { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; } .mk-tip .sf { color: var(--accent); flex: none; margin-top: 2px; }
.alert .btns button.strong { font-weight: 600; }

/* A banner under the top bar (BannerView). */
#banner { position: fixed; top: calc(env(safe-area-inset-top) + 70px); left: 50%; width: min(520px, calc(100% - 32px)); transform: translateX(-50%); z-index: 8;
  display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 20px; background: var(--ink); color: var(--paper); border: 2.5px solid var(--paper);
  box-shadow: 0 4px 8px rgba(0,0,0,.3); cursor: pointer; animation: dropin .4s cubic-bezier(.3,1.3,.5,1); }
body.rail #banner { left: calc(50% + var(--rail) / 2); }
#banner .bico { width: 36px; height: 36px; border-radius: 50%; background: var(--paper); color: var(--accent); display: grid; place-items: center; flex: none; }
#banner b { display: block; font: 700 15px/1.25 var(--round); }
#banner span { display: block; font: 500 12px/1.3 var(--round); color: rgba(23,62,107,.85); }
#banner.out { animation: liftout .3s ease-in forwards; }
@keyframes dropin { from { transform: translate(-50%, -40px); opacity: 0; } }
@keyframes liftout { to { transform: translate(-50%, -40px); opacity: 0; } }

/* "Now playing" on Marginal FM (NowPlayingCard). */
#nowplaying { position: fixed; top: calc(env(safe-area-inset-top) + 4px); left: 50%; transform: translateX(-50%); z-index: 9; display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; font-size: 13px; pointer-events: none; animation: dropin .35s ease-out; white-space: nowrap; }
#nowplaying .secondary { color: rgba(235,235,245,.6); }
#nowplaying .sf { color: var(--accent); }

#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 150px); transform: translate(-50%, 10px); background: rgba(40,40,52,.92); color: #fff; padding: 8px 16px;
  border-radius: 999px; opacity: 0; transition: .25s; pointer-events: none; font-size: 14px; max-width: 90%; text-align: center; z-index: 9; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Alerts (a sheet with a form). */
#modal { position: fixed; inset: 0; z-index: 12; display: grid; place-items: center; background: rgba(0,0,0,.4); }
.alert { width: min(300px, calc(100% - 60px)); border-radius: 22px; background: rgba(44,44,58,.96); text-align: center; overflow: hidden; animation: pop .25s ease-out; }
.alert .msg { padding: 20px 18px 16px; display: grid; gap: 6px; }
.alert h3 { margin: 0; font-size: 17px; font-weight: 600; }
.alert p { font-size: 13px; }
.alert .btns { display: grid; border-top: .5px solid rgba(255,255,255,.18); }
.alert .btns button { padding: 12px; font-size: 17px; color: #0A84FF; }
.alert .btns button + button { border-top: .5px solid rgba(255,255,255,.18); }
.alert .btns .destructive { color: #FF453A; }
@keyframes pop { from { transform: scale(1.1); opacity: 0; } }
#modal.sheetmodal { place-items: end center; }
.formsheet { width: min(640px, 100%); height: calc(100% - env(safe-area-inset-top) - 10px); border-radius: 38px 38px 0 0; display: flex; flex-direction: column; overflow: hidden;
  animation: rise .38s cubic-bezier(.2,.9,.25,1); }
@media (min-width: 700px) { #modal.sheetmodal { place-items: center; } .formsheet { height: min(720px, calc(100% - 80px)); border-radius: 38px; } }
@keyframes rise { from { transform: translateY(100%); } }

/* The blue page (BluePage): the icon's gradient with a faint 32 px drafting grid, centred. Behind the loading screen and the welcome. */
#loading, #intro { background: linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px) 50% 50% / 32px 32px, linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px) 50% 50% / 32px 32px, linear-gradient(var(--blue-top), var(--blue-bottom)); }
/* Loading (LoadingView): the blue page, the works, the title and the product riding a belt that fills. */
#loading { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; transition: opacity .45s, transform .45s; }
#loading.gone { opacity: 0; transform: scale(1.06); pointer-events: none; }
.load-inner { position: relative; display: grid; place-items: center; }
.load-inner .logo { width: 240px; }
.load-words { position: absolute; top: calc(50% + 170px - 60px); display: grid; justify-items: center; gap: 10px; animation: wordsin .5s ease-out both; white-space: nowrap; }
.load-words h1 { margin: 0; line-height: 0; }
.load-words h1 .wordmark { width: 250px; height: auto; }
.load-words p { font: 500 15px var(--round); color: rgba(243,235,216,.7); }
.line { position: relative; width: 200px; height: 44px; margin-top: 6px; overflow: hidden; }
.line .belt { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; border-radius: 6px; background-color: rgba(243,235,216,.18);
  background-image: repeating-linear-gradient(90deg, transparent 0 11px, rgba(15,42,73,.45) 11px 13px, transparent 13px 14px); animation: roll .2s linear infinite; }
.line .good { position: absolute; bottom: 12px; left: -28px; width: 28px; height: 28px; animation: ride 3s linear infinite; }
@keyframes ride { to { left: 200px; } }
@keyframes roll { from { background-position: 0 0; } to { background-position: 14px 0; } }
@keyframes wordsin { from { opacity: 0; transform: translateY(16px); } }

/* The welcome (WelcomeView): one screen over the blue page, with the actions pinned at the bottom. */
#intro { position: fixed; inset: 0; z-index: 15; overflow: hidden; }
#intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.welcome { position: absolute; inset: 0; display: flex; flex-direction: column; }
.welcome .col { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; width: 100%; max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 16px) 24px 16px; display: grid; align-content: center; justify-items: center; text-align: center; gap: 20px; }
.welcome .logo { width: 220px; max-width: 70vw; animation: float 2.2s ease-in-out infinite alternate; }
@keyframes float { from { transform: translateY(6px); } to { transform: translateY(-6px); } }
.welcome .head { display: grid; gap: 8px; }
.welcome h1 { margin: 0; line-height: 0; }
.welcome h1 .wordmark { width: 290px; max-width: 80vw; height: auto; }
.welcome .tag { margin: 0; font: 600 17px/1.35 var(--round); color: rgba(243,235,216,.78); }
.welcome .tag span { display: inline-block; white-space: nowrap; }
/* The three steps as stations on a dashed belt, like the logo's conveyor. */
.welcome .steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; align-items: flex-start; width: 100%; }
.welcome .step { flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: 8px; }
.welcome .tile { width: 64px; height: 64px; border-radius: 18px; background: rgba(15,42,73,.78); border: 1px solid rgba(243,235,216,.22); display: grid; place-items: center; color: var(--accent); }
.welcome .tile img { width: 40px; height: 40px; }
.welcome .tile svg { width: 28px; height: 28px; }
.welcome .step b { font: 600 13px/1.25 var(--round); color: rgba(243,235,216,.92); text-wrap: balance; }
.welcome .belt { flex: 0 0 34px; height: 64px; display: flex; align-items: center; gap: 2px; color: var(--accent); }
.welcome .belt i { flex: 1; height: 0; border-top: 2.5px dotted rgba(243,235,216,.45); }
.welcome .belt svg { width: 11px; height: 11px; flex: none; }
.welcome .pinned { position: relative; padding: 12px 24px calc(env(safe-area-inset-bottom) + 18px); }
.welcome .pinned .hills { position: absolute; left: 0; right: 0; bottom: 0; top: -46px; width: 100%; height: calc(100% + 46px); pointer-events: none; }
.welcome .pinned .inner { position: relative; max-width: 560px; margin: 0 auto; display: grid; gap: 10px; }
/* The two class links (WelcomeView.classLink): capsules side by side when they fit, stacked when they don't. */
.welcome .links { display: flex; flex-wrap: wrap; gap: 10px; }
.welcome .classlink { flex: 1 1 auto; min-height: 46px; padding: 10px 16px; border-radius: 999px; background: rgba(15,42,73,.7); border: 1px solid rgba(243,235,216,.2); color: rgba(243,235,216,.9); font: 600 15px/1.2 var(--round); text-align: center; }
.welcome .classlink:active { background: rgba(15,42,73,.9); }
.welcome .classlink:focus-visible, .welcome .bigbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* A sheet opened from the welcome (join a class, teacher setup) sits above it, as on iOS. */
#intro:not([hidden]) ~ .sheetwrap { z-index: 16; }
@media (min-width: 700px) and (min-height: 760px) {
  .welcome .logo { width: 300px; } .welcome h1 .wordmark { width: 362px; } .welcome .tag { font-size: 20px; }
  .welcome .col { max-width: 680px; gap: 26px; } .welcome .tile { width: 84px; height: 84px; border-radius: 24px; } .welcome .tile img { width: 52px; height: 52px; }
  .welcome .step b { font-size: 15px; } .welcome .belt { height: 84px; flex-basis: 56px; }
}
@media (max-height: 700px) { .welcome .logo { width: 150px; } .welcome .col { gap: 14px; } .welcome h1 .wordmark { width: 250px; } }
/* The end-of-day card (EndOfDayCard) as a sheet over the floor. */
.formsheet.eod { height: auto; max-height: calc(100% - env(safe-area-inset-top) - 10px); }
@media (min-width: 700px) { .formsheet.eod { max-height: min(720px, calc(100% - 80px)); } }
.eod-body { min-height: 0; overflow-y: auto; padding: 24px; display: grid; gap: 16px; align-content: start; max-width: 560px; width: 100%; margin: 0 auto; scrollbar-width: none; }
/* Keep going stays pinned at the card's foot while the rest scrolls (iOS: a bottom safe-area inset). */
.eod-foot { flex: none; max-width: 560px; width: 100%; margin: 0 auto; padding: 8px 24px calc(14px + env(safe-area-inset-bottom)); }
.eod h2 { margin: 0 0 4px; font-size: 32px; }
.eod-profit { display: flex; align-items: baseline; gap: 8px; margin: 0; color: rgba(235,235,245,.6); font-size: 15px; }
.eod-profit b { font-size: 40px; line-height: 1; } .eod-profit .good { color: var(--good); } .eod-profit .bad { color: var(--stamp); }
.eod-block { display: flex; gap: 12px; padding: 14px; border-radius: 12px; }
.eod-block .eod-ico { flex: none; padding-top: 2px; }
.eod-block h3 { margin: 0 0 4px; font: 700 17px/1 var(--din); padding-top: 2px; color: var(--ink); }
.eod-block b { display: block; font: 700 14px/1.3 var(--round); margin-bottom: 2px; }
.eod-block p { font: 500 15px/1.35 var(--round); }
.eod-block.lesson { background: rgba(242,165,65,.12); } .eod-block.lesson .eod-ico { color: var(--accent); }
.eod-block.tomorrow { position: relative; background: rgba(63,167,160,.12); } .eod-block.tomorrow .eod-ico { color: var(--teal); }
.eod-streak { display: flex; align-items: center; gap: 6px; margin: 0; font: 700 15px/1 var(--round); color: var(--accent); }
.eod-block.eod-badges { background: rgba(255,255,255,.09); } .eod-block.eod-badges > div { flex: 1; min-width: 0; }
.eod-brow { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 8px; margin-top: 8px; }
.eod-bd { display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; }
.eod-badge { width: 48px; height: 48px; object-fit: contain; }
.eod-bd small { font: 600 12px/1.2 var(--round); color: rgba(235,235,245,.8); }
html:not(.no-workers) .eod-block.tomorrow.has-worker { padding-right: calc(14px + var(--wk-tomorrow-room)); }
.eod-block.tomorrow .eod-back { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(243,235,216,.2); font-weight: 600; }
.eod-setup .note { font-size: 12px; color: rgba(235,235,245,.6); }
.eod-setup { display: grid; gap: 10px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 15px; font-weight: 600; color: rgba(235,235,245,.6); }
.field input { font: 20px system-ui, sans-serif; color: #fff; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.3); outline: none; }
.field input:focus { border: 2px solid var(--accent); padding: 11px 13px; }
.ipanel { padding: 14px; border-radius: 16px; background: rgba(23,62,107,.85); border: 1px solid rgba(255,255,255,.1); display: grid; gap: 10px; }
.ipanel > h3 { margin: 0; font: 700 20px/1 var(--din); padding-top: 2px; color: var(--ink); }
.diffs { display: flex; gap: 8px; }
.diff { flex: 1; display: grid; gap: 4px; justify-items: center; padding: 10px 0; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.diff .din { font-size: 19px; padding-top: 2px; }
.diff .num { font-size: 14px; color: rgba(235,235,245,.6); }
.diff.on { background: rgba(242,165,65,.22); border: 2px solid var(--accent); }

/* Reduce motion (the iOS Settings > Accessibility switch): no slides, pops or fades; the belt texture is stopped in game.js. */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; } }

/* On the page for screen readers, off it for everyone else. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; list-style: none; }

/* A page pushed inside a panel (shell.js pushPage): Back on the leading edge, as a NavigationLink. */
.navback { display: flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; min-width: 88px; padding: 8px 0; }
.navbar.docked .navback + h2 { text-align: left; }

/* A sheet over everything (shell.js presentSheet). */
.sheetwrap { position: fixed; inset: 0; z-index: 11; display: grid; place-items: end center; background: rgba(0,0,0,.4); }
.sheetwrap .formsheet .navbar .navbtns:last-child .navback { justify-content: flex-end; font-weight: 600; }
.sheetwrap.full { place-items: stretch; background: var(--deep); }
.sheetwrap.full .formsheet { width: 100%; height: 100%; border-radius: 0; animation: none; }
@media (min-width: 700px) { .sheetwrap { place-items: center; } }

/* Startup failure and no-JavaScript message on the loading screen (game.js showStartFailure, index.html noscript). */
.load-fail { max-width: 420px; padding: 24px; text-align: center; color: var(--ink); font: 500 16px/1.45 var(--round); }
.load-fail h2 { margin: 0 0 10px; font-size: 28px; line-height: 1.1; }
.load-fail p { margin: 8px 0; }
.load-fail a { color: var(--accent); text-underline-offset: 3px; }
.load-fail small { display: block; margin-top: 14px; font-size: 13px; opacity: .7; overflow-wrap: anywhere; }
