/* Locavert — single stylesheet. Tokens first (DESIGN §6), then page chrome ported from the
   approved mockup. Scene rules arrive with the scene in Phase 1. */
:root {
  color-scheme: light;
  --bg: #f1e9d9;
  --surface: #fff7e7;
  --surface-2: #fbf6e9;
  --ink: #303d52;
  --muted: #655741;
  --border: #c0b59f;
  --border-soft: #e3dac6;
  --frame: #495668;
  --frame-shadow: #d6cdb9;
  --accent: #b95f4f;
  --action: #ad523c;
  --action-ink: #fff9e8;
  --select: #4c7290;
  --select-ink: #fff4da;
  --progress: #527b90;
  --board: #34475d;
  --board-ink: #f7eacb;
  --board-dim: #d2ddc5;
  --badge: #e0dbc8;
  --ok: #517345;
  --fail: #a24138;
  --warn: #976225;
  --idle: #8f826b;
  --focus: #a94638;
  --font-body: 15px/1.5 'Trebuchet MS', Arial, sans-serif;
  --font-display: Georgia, serif;
  --font-mono: ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--font-body); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 10px 15px; min-height: 44px; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }

/* Page chrome */
.header-right { display: flex; align-items: center; gap: 10px; }
.install { font-size: 12px; padding: 8px 12px; min-height: 36px; background: var(--select); color: var(--select-ink); border-color: var(--select); }
.page { max-width: 1180px; margin: auto; padding: 23px 32px; }
header { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.brand { font: bold 29px var(--font-display); letter-spacing: -1px; }
.brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.landing-line { margin-top: 12px !important; font-size: 14px; color: var(--ink) !important; background: var(--badge); display: inline-block; padding: 6px 14px; border-radius: 999px; }
.landing-line a { color: var(--board); margin-left: 4px; }
.brand-mark { width: 40px; height: 40px; display: block; }
.badge { background: var(--badge); border-radius: 20px; padding: 7px 12px; font-size: 11px; }
.intro { text-align: center; margin: 25px 0; }
.eyebrow { font: 11px var(--font-mono); text-transform: uppercase; letter-spacing: .17em; color: var(--muted); }
h1 { font: 500 clamp(38px, 5vw, 60px)/1.08 var(--font-display); letter-spacing: -2px; margin: 10px 0 12px; }
h1 em { color: var(--accent); font-style: italic; }
.intro p { font-size: 15px; color: var(--muted); margin: 0; }
.intro strong { color: var(--ink); }

/* Depot card */
.depot { position: relative; border: 2px solid var(--frame); border-radius: 19px; overflow: hidden; box-shadow: 0 7px 0 var(--frame-shadow); background: var(--surface); }
.floating-actions { position: absolute; right: 18px; bottom: 26px; z-index: 9; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.floating-actions .run { min-height: 40px; padding: 8px 16px; box-shadow: 0 3px 0 #7d6a52, 0 8px 18px rgba(48, 61, 82, .25); }
.floating-actions button:not(.run) { min-height: 40px; padding: 8px 12px; }
/* Keep the caption clear of the floating button. */
.scene-caption { text-align: left; padding-right: 210px; }
.floating-actions .run-status { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; font-size: 12px; color: var(--muted); }
.floating-actions button:not(.run) { background: var(--surface); }
.departure { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: var(--board); color: var(--board-ink); padding: 14px 23px; font: 11px var(--font-mono); letter-spacing: .05em; }
.departure span:last-child { color: var(--board-dim); }
/* Below the depot: the picker on top, the chosen format's settings in one wide row under it. */
.controls { display: grid; gap: 18px; margin-top: 18px; padding: 18px 22px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 13px; }
.settings-block { min-width: 0; }
.label { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 7px; }
.formats { display: grid; gap: 8px 14px; grid-template-columns: max-content 1fr; align-items: center; }
.format-family { display: contents; }
.family-label { font-size: 11px; color: var(--muted); }
.family-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.formats button { padding: 8px 12px; font-size: 12px; }
.formats button[aria-pressed="true"] { background: var(--select); color: var(--select-ink); border-color: var(--select); }
.run { background: var(--action); color: var(--action-ink); border-color: var(--action); font-weight: 700; min-width: 165px; box-shadow: 0 3px 0 #e4c6a4; }

/* Controls: options and actions */
.depot.dropping { outline: 3px dashed var(--select); outline-offset: -3px; }
.options { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 12px; color: var(--muted); align-items: end; }
.options:empty::before { content: "Nothing to adjust for this format."; }
.options label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.options .quality { flex-direction: column; align-items: flex-start; gap: 2px; min-width: 200px; }
.options .quality + input[type="range"] { width: 200px; }
.options input[type="range"] { accent-color: var(--select); height: 44px; margin: 0; cursor: pointer; }
.options .dimensions { display: flex; flex-direction: column; gap: 2px; }
.options .dim { width: 5.5em; min-height: 36px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.options .hint { font-size: 10px; color: var(--muted); }
.options .hint.copy-only { font-size: 12px; color: var(--ink); grid-column: 1 / -1; }
.actions { display: grid; gap: 8px; justify-items: stretch; }
.run-status { font-size: 12px; color: var(--muted); text-align: center; }
.run.zip { background: var(--select); border-color: var(--select); color: var(--select-ink); box-shadow: 0 3px 0 #c9d5db; }
.linkish { background: none; border: 0; padding: 0 2px; min-height: 0; color: var(--board); text-decoration: underline; font: inherit; cursor: pointer; }
.skipped { font-size: 12px; color: var(--warn); margin: 10px 0 0; }
.clear { margin-top: 10px; font-size: 12px; }
.job button { font-size: 11px; min-height: 44px; padding: 5px 10px; }
.job .converting { color: var(--select); }

/* Per-row settings drawer */
.job .chosen { color: var(--select); font-weight: 600; }
.row-settings { margin: 2px 0 2px 40px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; display: grid; gap: 10px; }
.job .unlock { margin: 2px 0 2px 40px; }
.apply-all { margin-top: 8px; font-size: 12px; }

/* Row password prompt */
.unlock { display: flex; gap: 6px; margin-top: 6px; }
.unlock .dim { width: 12em; }
.unlock button { min-height: 36px; padding: 4px 10px; font-size: 11px; }

/* Tools row: prompt state */
.tools.prompting { background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 14px 18px; }
.tools-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tools-actions .run { min-width: 0; }

/* Tools row */
.tools { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 14px; align-items: center; margin: 19px 0; }
.tools strong { color: var(--ink); }
.track { height: 4px; background: var(--border-soft); overflow: hidden; border-radius: 4px; margin-top: 7px; }
.track span { display: block; width: 0; height: 100%; background: var(--progress); transition: width .2s; }

/* Queue */
.queue { border: 1px solid var(--border-soft); background: var(--surface-2); border-radius: 13px; padding: 18px 22px; }
.queue-head { display: flex; justify-content: space-between; font: 10px var(--font-mono); color: var(--muted); }
.empty-state { margin: 16px 0 6px; padding: 28px 16px; border: 2px dashed var(--border); border-radius: 12px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-state strong { color: var(--ink); display: block; margin-bottom: 6px; font-size: 15px; }
.job { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(150px, 220px) 150px auto; grid-template-areas: "index name to status actions" "track track track track track" "drawer drawer drawer drawer drawer"; gap: 6px 12px; align-items: center; padding: 12px 10px 12px 12px; border-bottom: 1px solid var(--border-soft); border-left: 4px solid var(--idle); }
.job.edge-converting { border-left-color: var(--select); }
.job.edge-completed { border-left-color: var(--ok); }
.job.edge-failed { border-left-color: var(--fail); }
.job.edge-cancelled { border-left-style: dashed; }
.job.expanded { background: var(--surface); border-radius: 0 10px 10px 0; }
.job-index { grid-area: index; }
.job-name { grid-area: name; min-width: 0; }
.job-to { grid-area: to; display: flex; gap: 6px; align-items: center; }
.job-status { grid-area: status; }
.job-actions { grid-area: actions; display: flex; gap: 6px; justify-content: flex-end; }
.job-track { grid-area: track; margin: 0; }
.job .drawer { grid-area: drawer; }
.job .file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .meta { display: flex; flex-wrap: wrap; gap: 2px 6px; }
.to-select { min-height: 36px; padding: 4px 30px 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%234c7290'/></svg>") no-repeat right 10px center; appearance: none; font-size: 12px; font-weight: 600; color: var(--select); min-width: 0; flex: 1; }
.gear { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 8px; font-size: 15px; flex: none; }
.gear[aria-expanded="true"] { background: var(--select); color: var(--select-ink); border-color: var(--select); }
.pill { display: inline-block; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 11px; color: var(--select); font-weight: 600; }
.job small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.job-status { font-size: 11px; display: flex; gap: 8px; align-items: center; text-align: right; }
.job .warn { color: var(--warn); }
.job .error, .failed { color: var(--fail); }
.completed { color: var(--ok); }
.pending, .cancelled { color: var(--idle); }
.overall { font-size: 11px; color: var(--muted); margin-top: 13px; }

/* Static block from index.html, shown until the app mounts and read by crawlers. */
#prerender { max-width: 720px; margin: 40px auto; padding: 0 20px; color: var(--muted); font-size: 15px; line-height: 1.6; }
#prerender h1 { font: bold 30px var(--font-display); color: var(--ink); letter-spacing: -0.5px; margin: 0 0 12px; }
#prerender h2 { font: italic 20px var(--font-display); color: var(--ink); margin: 20px 0 6px; }
#prerender strong { color: var(--ink); }
#prerender a { color: var(--board); }
/* On a landing page the block stays below the depot as the "about this conversion" section. */
#prerender.about { max-width: 1180px; margin: 0 auto 40px; padding: 22px 32px 0; box-sizing: border-box; border-top: 1px dashed var(--border); }
#prerender.about h2 { font: italic 22px var(--font-display); color: var(--ink); letter-spacing: -0.3px; margin: 0 0 10px; }
#prerender.about p { max-width: 720px; }

/* Footer */
.footer { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 24px; }
.notice { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 0; }
.privacy { border-top: 1px dashed var(--border); padding-top: 18px; }
.privacy-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.privacy-headline { font: italic 20px var(--font-display); color: var(--ink); margin: 0; letter-spacing: -0.3px; }
.how-link { font-size: 13px; }
.privacy-links { display: flex; gap: 16px; align-items: baseline; font-size: 13px; }

/* How it converts modal */
.how { border: 2px solid var(--frame); border-radius: 19px; padding: 0; background: var(--surface); color: var(--ink); width: min(720px, calc(100vw - 32px)); box-shadow: 0 7px 0 var(--frame-shadow); }
.how::backdrop { background: rgba(48, 61, 82, 0.55); }
.how-body { padding: 22px 26px 24px; }
.how-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.how-head h2 { font: italic 24px var(--font-display); margin: 0; letter-spacing: -0.4px; }
.how-close { min-height: 36px; padding: 4px 12px; font-size: 20px; line-height: 1; }
.how-lede { margin: 6px 0 14px; color: var(--muted); font-size: 14px; }
.how-art { width: 100%; height: auto; display: block; }
.how-art .device { fill: var(--surface-2); stroke: var(--frame); stroke-width: 2; }
.how-art .zone { font: 12px var(--font-mono); letter-spacing: .17em; fill: var(--muted); }
.how-art .grass { fill: #b9c9a5; }
.how-art .rail { stroke: var(--frame); stroke-width: 3; }
.how-art .hill { fill: #8fae7c; }
.how-art .mouth { fill: var(--board); }
.how-art .plaque rect { fill: var(--board); }
.how-art .sign { font: 10px var(--font-mono); letter-spacing: .14em; fill: var(--board-ink); }
.how-art .cart rect { fill: var(--surface); stroke: var(--frame); stroke-width: 2; }
.how-art .cart circle { fill: var(--frame); }
.how-art .cart text { font: bold 17px var(--font-display); fill: var(--ink); }
.how-art .cart.out rect { fill: var(--select-ink); stroke: var(--select); }
.how-art .cart.out text { fill: var(--select); }
.how-art .arrow { fill: none; stroke: var(--frame); stroke-width: 2.5; }
.how-art .arrow.tools { stroke: var(--ok); }
.how-art .arrow.never { stroke: var(--fail); stroke-dasharray: 6 5; }
.how-art marker path { fill: var(--frame); }
.how-art .cross line { stroke: var(--fail); stroke-width: 4; stroke-linecap: round; }
.how-art .folder rect { fill: var(--badge); stroke: var(--border); }
.how-art .folder text { font-family: 'Trebuchet MS', Arial, sans-serif; font-size: 13px; fill: var(--ink); }
.how-art .cloud { fill: #fbf6e9; stroke: var(--border); stroke-width: 2; stroke-dasharray: 5 4; }
.how-art .cloud-text { font: italic 15px var(--font-display); fill: var(--muted); }
.how-art .note { font-size: 14px; font-family: 'Trebuchet MS', Arial, sans-serif; }
.how-art .note.ok { fill: var(--ok); }
.how-art .note.fail { fill: var(--fail); }
.how-steps { margin: 14px 0 0; padding-left: 22px; font-size: 14px; line-height: 1.6; color: var(--muted); display: grid; gap: 8px; }
.how-steps strong { color: var(--ink); font-weight: 600; }
.how-foot { margin: 16px 0 0; font: italic 15px var(--font-display); color: var(--ink); text-align: center; }
@media (max-width: 720px) { .how-body { padding: 16px; } .how-head h2 { font-size: 20px; } }
.privacy-lines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.privacy-lines strong { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) { .privacy-lines { grid-template-columns: 1fr; } }
.end { text-align: center; font: italic 14px var(--font-display); color: var(--muted); margin-top: 23px; }
.colophon { text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.colophon a { color: var(--board); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 720px) {
  .page { padding: 20px; }
  .formats { grid-template-columns: 1fr; }
  .floating-actions { right: 12px; bottom: 30px; }
  .scene-caption { padding-right: 180px; font-size: 10px; }
  .family-label { margin-top: 4px; }
  .run { width: 100%; }
  .scene { height: 300px; }
  .departure { font-size: 9px; padding: 12px 16px; }
  .tools { align-items: flex-start; }
}
@media (max-width: 420px) {
  .page { padding: 16px 12px; }
  .brand { font-size: 25px; }
  .badge { font-size: 9px; }
  .intro p { font-size: 13px; }
  h1 { font-size: 39px; }
  .departure { gap: 10px; }
  .controls { padding: 17px 14px; gap: 14px; }
  .scene { height: 282px; }
  .queue { padding: 15px; }
  .job-status { flex-direction: column; align-items: flex-end; gap: 4px; }
  .job { grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: "index name status" "to to to" "track track track" "drawer drawer drawer" "actions actions actions"; }
  .job-actions { justify-content: flex-start; }
  .row-settings, .job .unlock { margin-left: 0; }
  .queue-head { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Scene. Colours are the mockup's and are locked (DESIGN §1). The camera rides with the
   locomotive: the model sets `left` on the train, portals, hill body, station, signal and
   arrivals sign every frame and scrolls the rail, grass and bush patterns. ---- */
.scene { height: 325px; position: relative; overflow: hidden; background: #dce9e4; isolation: isolate; }
.scenery { position: absolute; inset: 0; }
.sky { position: absolute; inset: 0; background: linear-gradient(#d5e6e5, #ecf0da); z-index: 1; }
.sun { position: absolute; top: 30px; left: 15%; width: 48px; height: 48px; border-radius: 50%; background: #f6d58c; z-index: 1; }
.cloud { position: absolute; top: 48px; right: 20%; width: 88px; height: 18px; background: #f8faee; border-radius: 20px; z-index: 1; }
.cloud::before { content: ''; position: absolute; width: 36px; height: 32px; border-radius: 50%; background: #f8faee; left: 18px; top: -17px; }
.hills { position: absolute; bottom: 63px; left: 0; width: 100%; height: 190px; z-index: 1; background: radial-gradient(ellipse 58% 92% at 50% 100%, #ccdab8 99%, transparent 100%) 0 100%/640px 150px repeat-x, radial-gradient(ellipse 66% 100% at 50% 100%, #b9cbaa 99%, transparent 100%) 0 100%/1040px 190px repeat-x; }
.grass { position: absolute; bottom: 0; left: -150%; right: -150%; height: 104px; z-index: 1; background: radial-gradient(ellipse 7px 4px at 50% 100%, #c2cc9a 92%, transparent 100%) 0 calc(100% - 6px)/74px 12px repeat-x, radial-gradient(ellipse 5px 3px at 50% 100%, #c6cf9f 92%, transparent 100%) 40px calc(100% - 22px)/118px 10px repeat-x #d1d8ad; }
.rail { position: absolute; bottom: 64px; left: 0; width: 100%; height: 20px; border-top: 4px solid #71736b; border-bottom: 4px solid #71736b; background: repeating-linear-gradient(90deg, transparent 0 18px, #9b8061 18px 26px, transparent 26px 43px); z-index: 3; }
.rail-shadow { position: absolute; bottom: 54px; left: 0; width: 100%; height: 10px; background: #bcc79d; z-index: 2; }
.bushes { position: absolute; left: 0; right: 0; bottom: 24px; height: 34px; z-index: 3; background: radial-gradient(circle 15px at 24px 22px, #9fb58f 98%, transparent 100%) 0 0/540px 34px repeat-x, radial-gradient(circle 11px at 46px 26px, #adc19c 98%, transparent 100%) 0 0/540px 34px repeat-x, radial-gradient(circle 9px at 300px 27px, #adc19c 98%, transparent 100%) 0 0/540px 34px repeat-x; }
.station { position: absolute; bottom: 86px; left: 5%; width: 125px; height: 103px; background: #f8d4a3; border: 2px solid #92765a; border-radius: 5px; z-index: 2; }
.roof { position: absolute; top: -24px; left: -12px; right: -12px; height: 27px; background: #bc6850; clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%); }
.station-label { text-align: center; font: 10px var(--font-mono); background: #fff4d8; margin: 10px 9px; padding: 3px; border: 1px solid #b9976e; }
.door { position: absolute; bottom: 0; left: 46px; width: 32px; height: 46px; background: #769ba4; border: 2px solid #667b7a; border-radius: 12px 12px 0 0; }
.station-window { position: absolute; left: 12px; bottom: 18px; width: 23px; height: 27px; background: #bedbd3; border: 3px solid #b19065; }
.clock { position: absolute; right: 10px; bottom: 24px; border: 2px solid #92765a; border-radius: 50%; background: #fff2d4; width: 23px; height: 23px; font-size: 14px; text-align: center; line-height: 19px; }
.signal { position: absolute; bottom: 85px; left: 32%; width: 8px; height: 65px; background: #617b75; z-index: 2; }
.signal::before { content: ''; position: absolute; top: -13px; left: -9px; width: 26px; height: 36px; background: #526762; border-radius: 12px; }
.signal::after { content: ''; position: absolute; top: -4px; left: 0; width: 8px; height: 8px; background: #e4c383; border-radius: 50%; }
.scene.working .signal::after { background: #bcdb92; }
.arrival { position: absolute; bottom: 85px; width: 104px; height: 100px; z-index: 2; }
.arrival-board { background: #4e7590; color: #fff2d6; border: 2px solid #3b5b72; border-radius: 5px; text-align: center; padding: 8px 4px; font: 10px var(--font-mono); position: relative; z-index: 1; }
.arrival-board strong { font-size: 18px; display: block; letter-spacing: .06em; }
.arrival::after { content: ''; position: absolute; top: 40px; bottom: 0; left: 49px; width: 7px; background: #896f51; }
.tunnel, .portal-back { position: absolute; bottom: 66px; width: 120px; height: 118px; pointer-events: none; }
.tunnel { z-index: 6; overflow: visible; }
.portal-back { z-index: 2; }
.portal-face, .portal-back svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: skewY(12deg); transform-origin: center center; }
.tunnel > div:first-child { position: absolute; inset: 0; }
.tunnel.exit .portal-face, .portal-back.exit svg { transform: scaleX(-1) skewY(12deg); }
.tunnel-sign { position: absolute; top: 14px; left: -12px; right: -12px; background: #e5e6c8; border: 1px solid #6c8276; padding: 3px 0; text-align: center; font: 9px var(--font-mono); border-radius: 3px; }
.tunnel-progress { position: absolute; left: 12px; right: 12px; bottom: 46px; color: #d8e5be; font: 11px var(--font-mono); text-align: center; z-index: 1; }
.scene.inspect .tunnel-progress, .scene.entering .tunnel-progress, .scene.exiting .tunnel-progress, .scene.present .tunnel-progress { visibility: hidden; }
.tunnel-body { position: absolute; bottom: 61px; height: 140px; z-index: 5; background: #aebf9d; border: 0; border-top: 3px solid #6f8a6e; pointer-events: none; }
.ridge { position: absolute; left: 0; right: 0; bottom: 196px; height: 44px; z-index: 5; pointer-events: none; }
.ridge i { position: absolute; bottom: -3px; border-radius: 50%; background: #94ad8c; }
.ridge i.big { background: #86a07f; }
.hillsigns { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.hillsign { position: absolute; bottom: 122px; transform: translateX(-50%); background: #e5e6c8; border: 1px solid #6c8276; border-radius: 3px; padding: 4px 9px; font: 9px/1.35 var(--font-mono); letter-spacing: .06em; color: #303d52; text-align: center; white-space: nowrap; box-shadow: 0 2px 0 #7d907c; }
.hillsign::after { content: ""; position: absolute; left: 50%; top: 100%; width: 4px; height: 24px; margin-left: -2px; background: #7d907c; }
.hud { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); z-index: 7; background: #e5e6c8; border: 1px solid #6c8276; border-radius: 3px; padding: 4px 12px; font: 10px var(--font-mono); color: #303d52; letter-spacing: .05em; white-space: nowrap; }
.scene-caption { position: absolute; bottom: 7px; left: 0; right: 0; z-index: 8; text-align: center; font-size: 11px; color: #46553a; background: #d1d8ad; padding: 4px 12px; }
.train-window { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
/* The empty train's placeholder cart is a real button: click it to add files. */
.wagon.placeholder { pointer-events: auto; cursor: pointer; min-height: 0; padding: 0; border-style: dashed; border-color: #a8956d; background: #f3e4bf; transition: transform .15s; }
.wagon.placeholder:hover, .wagon.placeholder:focus-visible { transform: translateY(-2px); }
.wagon.placeholder .file.plus { border-style: dashed; border-color: #b0a07a; background: #fff8e6; color: var(--select); font-size: 26px; font-weight: 400; line-height: 1; }
.scene.inspect .placeholder .wheel { animation: none; }
.train { position: absolute; bottom: 79px; width: 85px; height: 76px; z-index: 5; }
.engine { position: absolute; right: 0; bottom: 10px; width: 85px; height: 44px; background: #cb735a; border: 2px solid #704d46; border-radius: 6px 23px 6px 6px; }
.cab { position: absolute; left: 2px; top: -23px; width: 39px; height: 34px; background: #d68965; border: 2px solid #704d46; border-radius: 4px; }
.cab::before { content: ''; position: absolute; left: -5px; right: -5px; top: -7px; height: 8px; background: #526e7d; border: 2px solid #405867; border-radius: 4px; }
.cab-window { position: absolute; inset: 5px 7px; background: #cee0cd; border-radius: 4px; color: #566c67; font-size: 11px; text-align: center; }
.chimney { position: absolute; right: 16px; top: -15px; width: 12px; height: 17px; background: #526e7d; border: 2px solid #405867; border-radius: 3px; }
.engine-face { position: absolute; right: 5px; bottom: 8px; font-size: 12px; letter-spacing: 1px; }
.wagon { position: absolute; left: var(--cart-left); bottom: 10px; width: 66px; height: 29px; background: #e4bd77; border: 2px solid #8c744e; border-radius: 5px; }
.wagon::after { content: ''; position: absolute; right: -17px; bottom: 5px; width: 17px; height: 4px; background: #677569; }
.file { position: absolute; left: 12px; bottom: 24px; width: 42px; height: 45px; background: #fff2c7; border: 2px solid #978461; border-radius: 5px 12px 5px 5px; transform: rotate(-6deg); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.file.done { background: #dcecc0; }
.file.bad { background: #efc7b7; }
.file.cancelled { background: #dbd7cd; }
.wheel { position: absolute; bottom: -7px; background: #607683; border: 3px solid #405360; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 3px #9db4b5; left: 9px; }
.wheel.two { left: auto; right: 9px; }
.smoke { position: absolute; right: 15px; top: -17px; width: 15px; height: 15px; background: #faf5e7; border-radius: 50%; opacity: 0; }
.scene.inspect .wheel, .scene.entering .wheel, .scene.working .wheel, .scene.exit-ready .wheel, .scene.exiting .wheel { animation: wheel .6s linear infinite; }
.scene.inspect .smoke, .scene.entering .smoke, .scene.exiting .smoke { animation: puff 1s ease-out infinite; }
@keyframes wheel { to { transform: rotate(360deg); } }
@keyframes puff { to { transform: translate(-18px, -35px) scale(2); opacity: .7; } }
@media (max-width: 720px) {
  .station { width: 94px; height: 90px; }
  .door { left: 34px; }
  .station-window { left: 8px; width: 18px; }
  .clock { right: 6px; width: 18px; height: 18px; font-size: 12px; line-height: 14px; }
  .station-label { font-size: 8px; margin: 9px 5px; }
  .arrival { width: 82px; }
  .arrival::after { left: 37px; }
}
@media (max-width: 420px) {
  .station { width: 73px; height: 74px; }
  .station-label { font-size: 7px; }
  .door { left: 26px; height: 33px; width: 23px; }
  .station-window { height: 19px; width: 14px; left: 6px; bottom: 10px; }
  .clock { right: 3px; bottom: 12px; width: 14px; height: 14px; font-size: 9px; line-height: 10px; }
  .arrival { width: 63px; }
  .arrival-board { font-size: 8px; }
  .arrival-board strong { font-size: 14px; }
  .arrival::after { left: 29px; }
}
