  /* ── Vintage-chart / KPA-newspaper palette (visuals pass 2026-07-07) ──
     Anchors match the JS-drawn route colours (#1a2737 ink-navy, #c62828 red,
     #b8860b brass) so CSS + JS render as one hand. CSS-only pass: every
     selector predates it; only property values changed/added. */
  :root {
    --paper: #f0e6cd; --paper2: #e9dcbd; --paper3: #dcca9f;
    --ink: #241d12; --ink-nav: #1a2737; --rule: #9c8a63; --rule-soft: #c8b790;
    --brass: #b8860b;
    --water: #97b5c0; --land: #e4d5ae; --reef: #93bdb4;
    --shallows: #bcd5d8; --storm: #5d6b7d;
    --chart-blank: #f8f3e6;   /* fog of war A: uncharted sea — paler than land, no grid */
    /* new-world-map part 2: rivers, and the land types (grassland is --land) */
    --stormbelt: #8e98a6;   /* new-world-map part 3: past the edge of a storm-belt world */
    --river: #8fb2be; --floodplain: #d4d0a0; --forest: #b9c79a; --hills: #d8c49a; --swamp: #b7c2a4; --mountains: #bfb3a0;
    --ESL: #3e6b41; --OL: #2d5d94; --COR: #a63c35; --SR: #3d3a36;
    --TER: #85644c; --GAR: #6d4a86; --MAR: #b5762c; --NAM: #2e7d85; --ALT: #8f8b3d; --MOK: #3f7f62;
  }
  body { margin: 0; font-family: 'Palatino Linotype', Palatino, 'Iowan Old Style', Georgia, serif;
         background: radial-gradient(ellipse 130% 100% at 50% 0%, var(--paper) 55%, var(--paper2) 100%) fixed;
         color: var(--ink); }
  header { background: linear-gradient(var(--paper), var(--paper2)); color: var(--ink);
           padding: 8px 18px 7px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px;
           border-bottom: 4px double var(--rule); }
  header h1 { font-family: 'Palatino Linotype', Palatino, Georgia, serif;
              font-size: 23px; margin: 0; letter-spacing: 3px; font-weight: bold;
              font-variant: small-caps; white-space: nowrap; }
  /* phone-layout part 4: no header item breaks inside itself (the heat toggles moved to the chart to make room), so at
     1280 px they all fit one line; a narrower window moves whole items to a second line instead */
  header .turn { font-size: 14px; opacity: .8; font-style: italic; white-space: nowrap; }
  /* Player turn awareness: a non-modal drift banner under the header. */
  #pending-banner { padding: 7px 18px; font-size: 13px; background: #f3e3b5; color: #4a3a10; border-bottom: 1px solid #c9b06a; }
  .hp-trap { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
  .acct-row { border: 1px solid #c9b79a; border-radius: 3px; padding: 6px 8px; margin: 6px 0; background: #fbf6ea; }
  .reset-code-box { font-family: monospace; font-size: 15px; letter-spacing: 1px; padding: 6px 8px; margin: 6px 0; background: #fffbe8; border: 1px dashed #b08a2e; user-select: all; }
  header button, header a.hdr-btn { font-family: inherit; background: var(--paper); color: var(--ink);
                  border: 1px solid var(--rule); padding: 5px 14px; cursor: pointer; border-radius: 2px;
                  font-variant: small-caps; letter-spacing: .5px; white-space: nowrap;
                  box-shadow: 0 1px 1px #0002, inset 0 1px 0 #fff9; }
  /* small-fixes-7 part 1: a link dressed as a header button (the Roadmap) — the button's box, font size and line. */
  header a.hdr-btn { display: inline-block; font-size: 13.3333px; line-height: normal; text-decoration: none; }
  header button:hover, header a.hdr-btn:hover { background: #fbf3de; }
  header button:focus-visible, header a.hdr-btn:focus-visible { outline: 2px solid var(--ink-nav); outline-offset: 1px; }
  header .hdr-btns { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 8px; align-items: center; }
  header #advance-btn { background: var(--ink-nav); color: var(--paper); font-weight: bold;
                        border-color: var(--ink-nav); }
  header #advance-btn:disabled { opacity: .5; cursor: wait; }
  #admin-controls { display: none; gap: 8px; align-items: center; }
  #admin-controls.on { display: flex; }
  .admin-tab { display: none; }              /* the NPCs tab button — admin only */
  .admin-tab.on { display: inline-block; }
  #tab-npcs { overflow-x: auto; }   /* #25: let a compact roster scroll rather than wrap/balloon */
  #tab-npcs table { width: 100%; border-collapse: collapse; font-size: 12px; }
  #tab-npcs th, #tab-npcs td { text-align: left; padding: 2px 5px; border-bottom: 1px solid #e6dcc4; }
  .npc-stat-td { white-space: nowrap; font-family: 'Courier New', monospace; }   /* #25: stats on ONE line */
  .npc-monitor { margin-bottom: 8px; font-size: 13px; }
  .npc-warn { color: #c62828; font-weight: bold; }
  .npc-spawn { border: 1px solid #c62828; border-radius: 4px; padding: 8px; margin-bottom: 10px; background: #fdecec; }
  .npc-spawn label { font-size: 12px; margin-right: 8px; }
  #npc-stat-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }   /* #25: stat inputs in a row, not stacked */
  /* P1: the red ADMIN badge is the "operating the world" indicator — it belongs to Console mode ONLY.
     An admin in player view sees the ⚓ Console toggle + Replay, but NO badge (they're just a player
     with a role toggle). applyMode() flips body.console-active; the badge gates off it. */
  #admin-badge { display: none; background: #c62828; color: #fff; font-size: 11px; font-weight: bold;
                 padding: 2px 7px; border-radius: 3px; letter-spacing: 1px; }
  body.console-active #admin-badge { display: inline-block; }
  /* one toggle, one place (2026-07-18): ⚓ Console and ‹ Player view share the header slot —
     ⚓ Console shows in player mode, ‹ Player view shows in console mode. */
  body.console-active #console-toggle { display: none; }
  #console-leave-hdr { display: none; }
  body.console-active #hiw-open { display: none !important; }   /* small-fixes-8 part 8: How it works is for the game view (and its ☰ entry, which the menu's own button rule would show) */
  body.console-active #console-leave-hdr { display: inline-flex; }
  #admin-note { font-size: 12px; font-style: italic; }
  /* admin pending-approvals section in the Fleet tab */
  .admin-sec { border: 1px solid #c62828; border-radius: 4px; padding: 6px 8px; margin-bottom: 10px;
               background: #fdecec; }
  .admin-sec-h { font-weight: bold; color: #c62828; font-size: 13px; margin-bottom: 6px; }
  .fac-row { padding: 3px 0; border-bottom: 1px dotted #d8ccae; font-size: 13px; }
  .fac-row:last-child { border-bottom: 0; }
  .fac-row .fac-flag { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; }   /* the page-wide svg rule would fill the row */
  .fac-row .fac-ports, .fac-row .fac-caps { font-size: 12px; margin-left: 16px; }
  .admin-pending { padding: 6px; border-top: 1px solid #f0caca; }
  /* small-fixes-3: Console → Turn — who's playing, and are the orders in */
  #turn-readiness { border-left: 4px solid var(--brass); background: #faf1dc; border-radius: 3px;
                    padding: 8px 12px; margin: 6px 0 10px; }
  #turn-readiness .rd-counts { font-weight: bold; font-size: 15px; }
  #turn-readiness .rd-waiting { font-size: 13px; margin-top: 3px; }
  #turn-captains { margin: 4px 0 12px; }
  #turn-captains summary { font-variant: small-caps; font-size: 14px; letter-spacing: .5px; cursor: pointer;
                           border-bottom: 1px solid var(--rule-soft); padding-bottom: 3px; margin-bottom: 4px; }
  .rd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .rd-table th { text-align: left; font-variant: small-caps; font-weight: normal; border-bottom: 1px solid var(--rule); padding: 3px 4px; }
  .rd-table td { vertical-align: top; padding: 5px 4px; border-bottom: 1px dotted var(--rule-soft); }
  #turn-settlements .sl-n { white-space: nowrap; }   /* small-fixes-14 #193: the settlements list fits the panel */
  #turn-settlements .sl-league { font-size: 11px; }
  .rd-char { display: block; font-style: italic; color: #5a4c33; }
  .rd-devs { display: inline-flex; gap: 5px; }
  .rd-dev { display: inline-flex; width: 17px; height: 17px; color: #3a2f1c; }
  .rd-dev.off { opacity: .2; }
  .rd-dev svg { width: 100%; height: 100%; }
  .rd-admin { font-size: 9.5px; font-variant: small-caps; border: 1px solid var(--rule); border-radius: 2px; padding: 0 3px; margin-left: 4px; }
  .rd-ship { display: block; font-style: italic; }
  .rd-ok { color: #3e6b41; font-style: normal; }
  .rd-wait { color: #a63c35; font-style: normal; }
  .admin-pending:first-of-type { border-top: none; }
  .admin-pending a { font-size: 12px; }
  .admin-pending-btns { display: flex; gap: 6px; margin-top: 4px; }
  /* prizes-awaiting-decision section in the Fleet tab (player: own prizes; admin: all) */
  .prize-sec { border: 1px solid #b8860b; border-radius: 4px; padding: 6px 8px; margin-bottom: 10px;
               background: #fbf3de; }
  .prize-sec-h { font-weight: bold; color: #8a5a00; font-size: 13px; margin-bottom: 6px; }
  .prize-row { padding: 6px; border-top: 1px solid #e8d9a8; }
  .prize-row:first-of-type { border-top: none; }
  .prize-facts { font-size: 12px; color: #4a3f2c; }
  .prize-btns { display: flex; gap: 6px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
  .prize-name-in { font-family: inherit; font-size: 12px; padding: 2px 5px; border: 1px solid var(--rule);
                   border-radius: 2px; width: 132px; }
  .prize-note { font-size: 11px; font-style: italic; color: #7a6a4a; margin-top: 4px; }
  .prize-err { font-size: 11px; color: #c62828; margin-top: 3px; }
  .prize-err:empty { display: none; }
  /* wave-2 #2: transactions ("Send DBs") + bounty board */
  .pay-box { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; margin: 4px 0 2px; }
  .pay-box input { font-family: inherit; font-size: 12px; padding: 2px 5px; border: 1px solid var(--rule); border-radius: 2px; }
  .pay-to { width: 110px; } .pay-amt { width: 66px; } .pay-note { width: 120px; }
  .pay-msg { font-size: 11px; color: #7a6a4a; } .pay-msg.err { color: #c62828; }
  .bounty-sec { border: 1px solid #b8860b; border-radius: 4px; padding: 6px 8px; margin-bottom: 10px; background: #fbf3de; }
  .bounty-sec-h { font-weight: bold; color: #8a5a00; font-size: 13px; margin-bottom: 6px; }
  .bounty-row { padding: 5px 4px; border-top: 1px solid #e8d9a8; font-size: 12px; color: #4a3f2c;
                display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
  .bounty-row:first-of-type { border-top: none; }
  .bounty-target-name { font-weight: bold; } .bounty-minted { color: #8a5a00; font-style: italic; }
  .bounty-paid { color: #2e7d32; } .bounty-lapsed { color: #7a6a4a; font-style: italic; }
  .bounty-post { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #d8c68a; display: flex;
                 gap: 5px; align-items: center; flex-wrap: wrap; }
  .bounty-post select, .bounty-post input { font-family: inherit; font-size: 12px; padding: 2px 5px;
                 border: 1px solid var(--rule); border-radius: 2px; }
  .bounty-amt { width: 78px; } .bounty-sponsor { width: 96px; }
  .bounty-arith { font-size: 11px; color: #7a6a4a; } .bounty-arith.bad { color: #c62828; }
  .bounty-msg { font-size: 11px; color: #c62828; } .bounty-msg:empty { display: none; }
  .bounty-none { font-size: 12px; font-style: italic; color: #7a6a4a; }
  .bounty-pending { font-size: 11px; font-style: italic; color: #8a5a00; }
  .bounty-mint-lbl { font-size: 11px; color: #7a6a4a; }
  /* wave-2 #2 follow-up: the collapsible account ledger in an owner block */
  .acct-ledger { margin: 4px 0 2px; }
  .acct-ledger-tog { font-size: 11px; }
  .acct-ledger-empty { font-size: 11px; font-style: italic; color: #7a6a4a; margin-top: 3px; }
  .acct-ledger-list { margin-top: 3px; border-top: 1px solid rgba(128,128,128,.2); max-height: 260px; overflow-y: auto; }
  .acct-ledger-more { font-size: 11px; margin-top: 3px; }
  .acct-ledger-row { display: flex; gap: 8px; font-size: 12px; padding: 2px 0; align-items: baseline; }
  .acct-ledger-row .led-turn { color: #999; min-width: 30px; }
  .acct-ledger-row .led-amt { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
  .acct-ledger-row .led-amt.led-pos { color: #2e7d32; } .acct-ledger-row .led-amt.led-neg { color: #c62828; }
  .acct-ledger-row .led-note { color: #4a3f2c; }
  /* player heat overlays (D-OV.1): per-hex tint, opacity ∝ value/layer-max. Both layers
     pointer-events:none so map clicks fall through to the terrain hex (bucket in its title). */
  .heat-hex { pointer-events: none; }
  #wrap { display: flex; flex-direction: row; height: calc(100vh - 60px); }
  #mapbox { flex: 1; padding: 8px; min-width: 0; overflow: hidden; position: relative; }
  svg { width: 100%; height: 100%; display: block; }
  #map { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
  /* GitHub #40, small-fixes-8 part 1: while the PAGE is zoomed in (body.page-zoomed, pzSyncPageZoom) the chart takes no
     touch gesture, so the browser may pan and zoom the page over it and the player can always zoom back out. */
  body.page-zoomed #map { touch-action: manipulation; }
  #mapbox.pz-grabbing #map { cursor: grabbing; }
  /* pan/zoom controls: a small cluster over the map's top-right corner */
  /* small-fixes-12 (#165): one short line across the middle of the map while the viewer has no chart. The box covers the map;
     phone.js unchartedPlace() pulls its bottom (or right, sideways) edge in by what the sheet covers, so the line sits in the free part */
  #map-uncharted { position: absolute; left: 0; top: 0; right: var(--unch-right, 0px); bottom: var(--unch-bottom, 0px);
    display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 2; }
  #map-uncharted[hidden] { display: none; }
  /* ports-on-a-course Q8: a refused click, said over the map where the player is looking (orders.js mapRefusal) */
  #map-refusal { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 31; width: max-content; box-sizing: border-box; max-width: min(34em, calc(100% - 32px));
    padding: 6px 12px; font-size: 14px; line-height: 1.35; text-align: center; pointer-events: none;
    color: #fff; background: color-mix(in srgb, #8a2a1c 92%, transparent); border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
  #map-refusal[hidden] { display: none; }
  #map-refusal.info { background: color-mix(in srgb, #2f2a20 92%, transparent); white-space: pre-line; }   /* small-fixes-14 #195: a tapped hex's facts */
  #map-uncharted span { max-width: min(30em, 80%); text-align: center; padding: 8px 14px; font-style: italic; font-size: 15px; line-height: 1.35;
    color: var(--ink); background: color-mix(in srgb, var(--paper) 85%, transparent); border-radius: 4px; }
  /* dispatch-landing: the same box, for a viewer who is not signed in (load.js unchartedSync). The decorative chart is anchored
     bottom-right and fades toward the text under a wash of the paper colour from the left; the text sits on the left. The page's
     own serif and palette throughout: no web font. On a phone the box already stops at the sheet (unchartedPlace); the text
     goes to the top and the chart is fainter. */
  #map-uncharted.is-landing { display: block; overflow: hidden; background: var(--chart-blank); }
  .ld-chart { position: absolute; inset: 0; }
  .ld-chart svg { width: 100%; height: 100%; display: block; }
  .ld-chart::after { content: ""; position: absolute; inset: 0;
    background: linear-gradient(to right, var(--chart-blank) 18%, color-mix(in srgb, var(--chart-blank) 55%, transparent) 42%, transparent 62%); }
  .ld-text { position: relative; box-sizing: border-box; height: 100%; max-width: 34em; padding: 0 24px 0 clamp(24px, 5vw, 64px);
    display: flex; flex-direction: column; justify-content: center; color: var(--ink-nav); }
  .ld-text > * { margin: 0; }
  .ld-kicker { font-variant: small-caps; letter-spacing: 3px; font-size: 17px; color: #6b5a3a; }
  .ld-title { margin-top: 6px; padding-bottom: 14px; border-bottom: 2px solid var(--brass); width: min(330px, 100%); }
  .ld-title svg { display: block; width: min(360px, 100%); height: auto; }
  .ld-tag { margin-top: 16px; font-style: italic; font-size: 22px; line-height: 1.3; color: var(--ink-nav); }
  .ld-lines { list-style: none; padding: 0; margin-top: 14px; font-size: 19px; line-height: 1.6; color: var(--ink); }
  .ld-lines li { padding-left: 26px; position: relative; }
  .ld-lines li::before { content: "⚓"; position: absolute; left: 0; top: 0.15em; font-size: 13px; color: #5b8aa6; }
  .ld-note { margin-top: 14px; font-size: 15.5px; line-height: 1.5; color: #5a4d36; }
  .ld-cta { margin-top: 22px; font-variant: small-caps; letter-spacing: 2.5px; font-size: 16px; color: var(--ink); }
  .ld-phone { display: none; }
  html.phone .ld-desk { display: none; }
  html.phone .ld-phone { display: block; margin-top: 10px; font-size: 16px; line-height: 1.45; color: var(--ink); }
  html.phone .ld-text { justify-content: flex-start; padding: 18px 20px 12px; max-width: none; }
  html.phone .ld-kicker { font-size: 13px; letter-spacing: 2.5px; }
  html.phone .ld-title svg { width: 220px; }
  html.phone .ld-title { width: 190px; padding-bottom: 10px; }
  html.phone .ld-tag { margin-top: 10px; font-size: 16.5px; }
  html.phone .ld-chart { opacity: 0.5; }
  html.phone .ld-chart::after { background: linear-gradient(to bottom, var(--chart-blank) 30%, transparent 62%), linear-gradient(to right, var(--chart-blank) 15%, transparent 55%); }
  #mapctrls { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column;
              gap: 4px; z-index: 5; }
  #mapctrls button { width: 30px; height: 30px; font-size: 17px; line-height: 1; cursor: pointer;
              border: 1px solid var(--rule, #b8a06a); border-radius: 5px; background: #fffdf7ee;
              color: #4a3f2c; box-shadow: 0 1px 3px #0003; padding: 0; }
  #mapctrls button:hover { background: #fff; }
  /* phone-layout part 4: the two heat toggles, small pills under the zoom/fit/replay buttons, right-aligned */
  #mapctrls .heat-toggle { align-self: flex-end; display: inline-flex; align-items: center; gap: 3px; cursor: pointer;
              font-size: 11.5px; font-variant: small-caps; letter-spacing: .4px; white-space: nowrap; color: #4a3f2c;
              padding: 2px 7px 2px 4px; border: 1px solid var(--rule, #b8a06a); border-radius: 5px;
              background: #fffdf7ee; box-shadow: 0 1px 3px #0003; }
  #mapctrls .heat-toggle:first-of-type { margin-top: 4px; }
  #mapctrls .heat-toggle input { margin: 0; }
  #mapctrls .heat-toggle:hover { background: #fff; }
  /* map-look: a hex is a fill; the grid is its own layer drawn over the fills and the rivers (.hgrid) */
  .hex { stroke: none; }
  .hex.water { fill: var(--water); }
  .hex.land { fill: var(--land); }
  .hex.reef { fill: var(--reef); }
  .hex.shallows { fill: var(--shallows); }
  .hex.river { fill: var(--floodplain); }   /* a river hex is land; the river is drawn through it (#river-layer) */
  #river-layer, #hex-grid { pointer-events: none; }
  .river-water { fill: var(--river); stroke: none; }
  .river-faded { opacity: .7; }   /* a river through a charted hex out of sight, faded as the hex is */
  .hgrid { fill: none; stroke: #6b5a3a26; stroke-width: 1; }
  .hgrid.land { stroke: #a8925f; }
  .hgrid.faded { opacity: .7; }
  .hgrid.x1 { opacity: .68; }
  .hgrid.x2 { opacity: .34; }
  .lg-river { width: 24px; height: 14px; vertical-align: -2px; margin-right: 4px; }
  .hex.stormbelt { fill: var(--stormbelt); }
  .hex.land.lt-forest { fill: var(--forest); }
  .hex.land.lt-hills { fill: var(--hills); }
  .hex.land.lt-swamp { fill: var(--swamp); }
  .hex.land.lt-mountains { fill: var(--mountains); }
  /* fog of war A: blank chart paper where she has not charted; the charted sea out of sight a little faded */
  .hex.uncharted { fill: var(--chart-blank); stroke: none; }
  #map.fogged { background: var(--chart-blank); }   /* fog of war B: the paper runs on past what is drawn — no edge */
  .hex.faded { opacity: .7; }
  .tv.tv-unseen { font-style: italic; opacity: .75; }
  /* open-sea surround beyond the world edge: fades into the paper, non-interactive */
  .hex.ext1 { opacity: .68; pointer-events: none; }
  .hex.ext2 { opacity: .34; pointer-events: none; }
  .hex.ext1.fogedge { pointer-events: auto; cursor: not-allowed; }   /* #122: a charted edge hex answers a click with a refusal */
  /* Storms are weather ON a hex, not terrain OF a hex: render as a hatch
     pattern + glyph overlay, never a fill colour. Center = denser hatch +
     lightning glyph; fringe = lighter hatch only. */
  .storm-glyph { pointer-events: none; }
  .storm-glyph text { font-size: 17px; text-anchor: middle; dominant-baseline: central;
                      paint-order: stroke; stroke: #ffffffcc; stroke-width: 1px; }
  .picking .hex.water, .picking .hex.shallows, .picking .hex.reef, .picking .hex.river { cursor: crosshair; }
  /* range-painting overlay — all pointer-events:none so map clicks fall through
     to the terrain hex beneath. */
  .paint-1 { fill: #1a273733; stroke: #1a273744; stroke-width: 1; pointer-events: none; }
  .paint-2 { fill: #1a273714; stroke: #1a273722; stroke-width: 1; pointer-events: none; }
  .route-port { fill: none; stroke: #2e7d32; stroke-width: 2.5; pointer-events: none; }
  .route-tip { fill: var(--brass, #b8860b); stroke: #fff; stroke-width: 1.2; pointer-events: none; }
  /* 1b part 4: the selected ship — a soft brass disc behind her (solid rim, no dash, no animation), her glyph
     filled brass. Red is for danger only. */
  .sel-halo { fill: rgba(184, 134, 11, .22); stroke: var(--brass, #b8860b); stroke-width: 1.5; pointer-events: none; }
  .ship.selected { fill: var(--brass, #b8860b); }
  .route-dwell circle { fill: #b8860b; stroke: #fff; stroke-width: 1.5; pointer-events: none; }
  .route-dwell text { fill: #fff; font-size: 11px; font-weight: bold; text-anchor: middle;
                      dominant-baseline: central; pointer-events: none; }
  .portdot { stroke: #fff; stroke-width: 1.5; }
  .port-hit, .portlabel[data-port] { cursor: pointer; }   /* F2: enlarged port click target */
  .portlabel { font-size: 14.5px; fill: var(--ink); paint-order: stroke; stroke: #f0e6cdd9;
               stroke-width: 3.5px; font-family: 'Palatino Linotype', Palatino, Georgia, serif;
               letter-spacing: .4px; font-weight: bold; }
  .tv { font-size: 11.5px; fill: #4a3f2c; paint-order: stroke; stroke: #f0e6cdcc; stroke-width: 2.5px; }
  .ship { fill: #1c1610; stroke: #f0e6cd; stroke-width: 1; }
  .ship.orderable { cursor: pointer; }
  /* Two-tier ship identity (A1): the viewer's OWN ships stand out; every other ship is a single
     neutral "other". FUTURE (diplomacy): finer own/allied/neutral/enemy faction colouring slots in
     here once a relationship model lands — until then two tiers only (faction is owner-level, no
     ally/enemy graph). The render seam that assigns .own/.other is in load() (search "tier"). */
  .ship.own { fill: #1c1610; stroke: var(--brass, #b8860b); stroke-width: 2.8; }   /* P3: bigger glyph (scale 1.7 in the render loop) + a stronger brass ring — clearly the viewer's own */
  .ship.other { fill: #8a7f6d; stroke: #f0e6cddd; stroke-width: 1; opacity: .8; }
  /* 1b part 4 fix (Cowork's browser render): `.ship.selected` alone lost to `.ship.own` above (same
     specificity, later rule), so a selected own ship was never brass. This one wins: a solid brass ship. */
  .ship.own.selected { fill: var(--brass, #b8860b); stroke: var(--brass, #b8860b); }
  .ship.pending { opacity: .55; stroke-dasharray: 3 2; }   /* approvals-off part 2: her own hull, not yet in play */
  /* during a turn-replay, dim the LIVE ship layer so it doesn't compete with / repaint over the
     replay overlay (the class rides on #mapbox, which survives load()'s #map rebuild). */
  /* small-fixes-1 part 1 (Bregir 2026-10-27): no live ships during a replay — every live ship mark (her glyph,
     the "+N" badge, her label at sea: the whole stack) and the selection halo are not drawn, not faded; the
     replay draws its own. Scoped to #map, so the legend's ship glyph stays. */
  #mapbox.replaying #map .ship-stack, #mapbox.replaying #sel-layer { display: none; }
  /* #18: ships sharing a hex — the brass "+N" badge and the shared list (replaces the browser tooltip) */
  .ship-stack { cursor: pointer; }
  .ship-badge circle { fill: var(--brass); stroke: #fff; stroke-width: 1.5; }
  .ship-badge text { fill: #fff; font-size: 8.5px; font-weight: bold; text-anchor: middle; dominant-baseline: central; }
  #shiplist { position: absolute; left: 14px; top: 14px; min-width: 190px; max-width: 260px; z-index: 7; display: none;
              background: #fbf5e4f5; border: 1px solid var(--rule, #b8a06a); border-radius: 4px; box-shadow: 0 2px 8px #0003;
              padding: 6px 8px; font-size: 12px; color: #1c1610; }
  #shiplist.on { display: block; }
  #shiplist .sl-head { font-variant: small-caps; letter-spacing: .5px; font-size: 13px; color: #5a4a2e;
              border-bottom: 1px solid var(--rule-soft); padding-bottom: 3px; margin-bottom: 3px; }
  #shiplist .sl-count { color: #8a7a5a; }
  #shiplist .sl-row { padding: 3px 2px; border-bottom: 1px dotted #d8ccae; }
  #shiplist .sl-row:last-child { border-bottom: none; }
  #shiplist .sl-row.orderable { cursor: pointer; }
  #shiplist .sl-row.orderable:hover { background: #f3e6c4; }
  #shiplist .sl-name { font-style: italic; }
  #shiplist .sl-meta { color: #5a4f3c; }
  /* fog of war B part 4: giving your chart to a captain in the same port */
  /* fog of war B: each of its Console settings on a line of its own */
  #fog-sec .fog-row { display: block; margin-top: 4px; }
  #shiplist .sl-share { margin: 4px 0 2px; font-size: 12px; color: #3a2f1c; }
  #shiplist .sl-mark { display: inline-block; width: 8px; height: 8px; margin-right: 5px; background: var(--brass);
              clip-path: polygon(50% 0, 100% 100%, 0 100%); }
  #label-leaders .label-leader { stroke: #4a3f2c; stroke-width: 0.8; stroke-opacity: .6; pointer-events: none; }   /* #150: a label placed away from its mark */
  .shiplabel { font-size: 12.5px; font-style: italic; fill: #1c1610;
               paint-order: stroke; stroke: #f0e6cdbb; stroke-width: 3px; }
  /* Tier 0 god-view replay markers */
  /* design batch 1b part 5: the admin god-view draws every ship as the replay's ship icon — nothing brass
     (the admin owns no ships): players and traders grey, pirates near-black. The old dots are gone. */
  .replay-boat.gv { fill: #8a7f6d; stroke: #f0e6cd; stroke-width: 1; }
  .replay-boat.gv.pirate { fill: #2b2016; stroke: #f0e6cd; }
  .replay-track.gv { stroke: #8a7f6d; opacity: .75; }
  .replay-track.gv.pirate { stroke: #2b2016; }
  .replay-course.gv { stroke: #8a7f6d; }
  .replay-course.gv.pirate { stroke: #2b2016; }
  .replay-lbl { font-size: 9px; fill: var(--paper); paint-order: stroke; stroke: #00000088; stroke-width: 2px; }
  /* Tier 1 player replay */
  /* playtest-world part 6 (#13, #16): a ship lost during the replayed turn — wreck (sunk) or struck colours (taken) */
  .replay-wreck path, .replay-wreck line { fill: #5d4a36; stroke: #2b2016; stroke-width: 1.2; }
  .replay-struck line { stroke: #2b2016; stroke-width: 1.4; }
  .replay-struck path { fill: #c62828; stroke: #2b2016; stroke-width: 0.8; }
  .replay-evt-icon { font-size: 12px; text-anchor: middle; }
  /* action-summary replay callouts: a one-liner beside the event icon, auto-fading over ticks */
  .replay-evt-lbl { font-size: 9.5px; fill: var(--paper); font-weight: bold;
                    paint-order: stroke; stroke: #000000aa; stroke-width: 2.5px; }
  .replay-evt.age-1 { opacity: 0.55; } .replay-evt.age-2 { opacity: 0.28; }
  .replay-ghost.black .replay-ghost-ship { stroke: #111; }
  .replay-ghost-lbl { font-size: 9px; fill: #3a2f1c; font-style: italic; paint-order: stroke; stroke: #fffdf4cc; stroke-width: 2px; }
  .replay-ghost.age-1 { opacity: 0.6; } .replay-ghost.age-2 { opacity: 0.3; }
  /* prominent "Replaying turn N" overlay on the map + loud stale badge */
  #replay-banner { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 30;
    background: rgba(26,39,55,.92); color: var(--paper); padding: 5px 12px; border-radius: 4px;
    font-family: inherit; font-weight: bold; font-size: 14px; letter-spacing: .5px; pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.3); }
  /* design batch 1b part 3 (#4): a build prompt that tells the story */
  .ps-prose { font-style: italic; font-size: 14.5px; line-height: 1.45; margin: 4px 0 8px; }
  .ps-facts { font-size: 12px; color: #5a4f3c; background: #f3e9d0; border-left: 4px solid var(--brass, #b8860b);
              padding: 5px 9px; margin: 0 0 8px; }
  .ps-ideas-h { font-variant: small-caps; letter-spacing: .5px; font-weight: bold; font-size: 13px; }
  .ps-ideas ul { margin: 2px 0 8px 18px; padding: 0; font-size: 13px; }
  .ps-reward, .ps-advertiser { font-size: 13px; margin: 4px 0; }
  /* design batch 1b part 2: the log sheet (3C) */
  #replay-sheet { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 8; max-height: 42%;
    display: flex; flex-direction: column; background: #f7efdbf5; border: 3px double var(--rule, #b8a06a);
    border-radius: 4px; box-shadow: 0 3px 10px #0004; padding: 6px 10px; font-size: 13px; }
  #replay-sheet .rs-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  #replay-sheet .rs-title { font-weight: bold; font-variant: small-caps; letter-spacing: .4px; flex: 1; min-width: 120px; }
  #replay-sheet .rs-ctrls { display: flex; gap: 4px; }
  #replay-sheet .rs-ctrls button { font-family: inherit; min-width: 30px; height: 28px; cursor: pointer; border: 1px solid var(--rule, #b8a06a);
    background: #fffdf7; border-radius: 3px; color: #1c1610; }
  #replay-sheet .rs-ctrls .rs-main { background: var(--brass); border-color: var(--brass); }
  #replay-sheet .rs-scrubrow { display: flex; align-items: center; gap: 8px; margin: 5px 0 3px; }
  #replay-sheet #rs-scrub { flex: 1; accent-color: var(--brass); }
  #replay-sheet #rs-day { font-style: italic; color: #5a4f3c; white-space: nowrap; }
  #replay-sheet .rs-list { overflow-y: auto; border-top: 1px solid var(--rule-soft); }
  #replay-sheet .rs-evt { display: flex; gap: 10px; padding: 3px 2px; border-bottom: 1px dotted #d8ccae; cursor: pointer; }
  #replay-sheet .rs-evt .rs-d { font-style: italic; color: #6a5c3e; width: 48px; flex: none; }
  #replay-sheet .rs-evt .rs-s { font-style: italic; font-weight: bold; flex: none; }
  #replay-sheet .rs-evt.future { opacity: .45; }
  #replay-sheet .rs-evt.now { background: #f0e0b8; font-weight: bold; }
  #replay-sheet .rs-none { color: #8a7a5a; font-style: italic; padding: 3px 2px; }
  #replay-sheet.collapsed .rs-scrubrow, #replay-sheet.collapsed .rs-list { display: none; }
  /* since-you-last-looked part 3 (sheet C): the log sheet as a logbook. Fix round 1 (Bregir 2026-10-27): it
     never covers the map — logbookDock() moves it into #wrap in the side panel's place, at the panel's width */
  #replay-sheet.logbook { position: relative; inset: auto; z-index: 8; background: linear-gradient(var(--paper2), var(--paper)); width: var(--panel-w, 340px); flex-shrink: 0; height: calc(100vh - 60px);
    max-height: none; box-sizing: border-box; overflow: hidden; border-radius: 0; box-shadow: none; margin: 0; }
  #replay-sheet.logbook .rs-list { flex: 1; min-height: 0; }
  #replay-sheet.logbook #rs-turn { display: none; }
  .lb-sum { font-style: italic; color: #4a3f2c; padding: 4px 2px 6px; border-bottom: 1px solid var(--rule-soft); }
  .lb-ch { border: 1px solid var(--rule-soft); border-radius: 3px; margin: 6px 0; background: #fbf5e4; }
  .lb-ch.open { border-color: var(--brass); border-width: 2px; }
  .lb-ch.gone .lb-ch-h { color: #7a6c50; }
  .lb-ch-h { display: flex; align-items: baseline; gap: 6px; padding: 4px 7px; }
  .lb-ch-h[data-lb-play] { cursor: pointer; } .lb-ch-h[data-lb-play]:hover { background: #f3e7c6; }
  .lb-ch-h .acct-d { margin-left: auto; }
  .lb-mark { width: 14px; color: var(--brass); }
  .lb-events { padding: 0 6px; }
  .lb-foot { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--rule-soft); }
  .lb-foot .todo, .rl-needs .todo { padding: 5px 8px; margin-bottom: 5px; }
  .lb-done, .rl-watch { font-family: inherit; font-weight: bold; font-size: 14px; background: var(--brass); color: #fff8e6;
    border: 1px solid #8a650a; border-radius: 3px; padding: 7px 14px; cursor: pointer; width: 100%; margin-top: 4px; }
  /* the account of a turn (part 2) */
  .acct { font-size: 13px; }
  .acct-h { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--rule); padding: 2px 4px; }
  .acct-h b { font-variant: small-caps; font-size: 15px; } .acct-purse { font-style: italic; color: #5a4f3c; }
  .acct-l { display: flex; align-items: baseline; gap: 8px; padding: 3px 4px; border-bottom: 1px dotted #d8ccae; }
  .acct-n { flex: none; width: 74px; font-style: italic; font-weight: bold; overflow-wrap: anywhere; }
  .acct-w { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .acct-d { flex: none; font-weight: bold; text-align: right; white-space: nowrap; }
  .acct-d.pos { color: #3d5a1e; } .acct-d.neg { color: #9b2c1f; }
  .acct-net { display: flex; justify-content: space-between; padding: 4px; border-top: 2px solid var(--ink); font-weight: bold; font-variant: small-caps; }
  .acct-net .acct-d { font-variant: normal; font-size: 14px; }
  .acct-tag { display: inline-block; font-size: 10.5px; font-variant: small-caps; letter-spacing: .5px; padding: 0 5px;
    border: 1px solid var(--brass); color: #6b4e06; background: #f6e7bd; border-radius: 2px; }
  .acct-tag.lost { border-color: #9b2c1f; color: #9b2c1f; background: #f7dcd5; }
  .acct-why { color: var(--ink-nav); cursor: pointer; text-decoration: underline dotted; font-size: 12px; }
  .acct-whytext { display: block; font-style: italic; color: #5a4f3c; font-size: 12px; margin-top: 2px; }
  .acct-whytext[hidden] { display: none; }
  .acct-quiet .acct-w { font-style: italic; color: #7a6c50; }
  /* since-you-last-looked part 4: How it works */
  #hiw { padding: 16px; box-sizing: border-box; }
  #hiw .hiw-box { width: min(640px, 100%); background: #fbf5e4; border: 4px double var(--rule); box-shadow: 0 8px 30px rgba(0,0,0,.45);
    padding: 14px 16px 12px; box-sizing: border-box; max-height: 100%; overflow-y: auto; }
  #hiw .hiw-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  #hiw .hiw-top h2 { margin: 0; font-size: 21px; font-variant: small-caps; letter-spacing: 1.5px; }
  #hiw .hiw-skip { background: none; border: 0; font: inherit; font-size: 14px; text-decoration: underline dotted; color: #4a3f2c; cursor: pointer; }
  #hiw .hiw-stage { margin-top: 8px; border: 1px solid var(--rule); background: #97b5c0; overflow: hidden; }
  #hiw .hiw-svg { display: block; width: 100%; height: auto; max-height: 55vh; }   /* small-fixes-8 part 4: room for the text */
  /* small-fixes-8 part 4: a short, wide window (a phone held sideways, ~812×375) sets the animation beside the text, so
     both stay in view; the box still scrolls inside itself if a window is shorter still */
  @media (max-height: 520px) and (min-aspect-ratio: 4/3) {
    #hiw { padding: 8px; }
    #hiw .hiw-box { width: min(900px, 100%); padding: 10px 14px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(190px, 1fr); grid-template-rows: auto auto 1fr auto; column-gap: 14px; grid-template-areas: "top top" "stage step" "stage cap" "stage foot"; }
    #hiw .hiw-top { grid-area: top; }
    #hiw .hiw-stage { grid-area: stage; margin-top: 6px; align-self: start; }
    #hiw .hiw-svg { max-height: calc(100vh - 80px); }
    #hiw .hiw-step { grid-area: step; margin-top: 6px; }
    #hiw .hiw-cap { grid-area: cap; min-height: 0; }
    #hiw .hiw-foot { grid-area: foot; flex-wrap: wrap; }
  }
  #hiw .hiw-lbl { paint-order: stroke; stroke: #f0e6cd; stroke-width: 3px; }
  #hiw .hiw-step { margin: 10px 0 2px; font-variant: small-caps; font-weight: bold; font-size: 17px; }
  #hiw .hiw-cap { margin: 0; font-size: 15.5px; line-height: 1.4; min-height: 66px; }
  #hiw .hiw-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
  #hiw .hiw-dots { display: flex; gap: 6px; flex: 1; min-width: 0; }
  #hiw .hiw-dot { flex: 0 1 26px; width: 26px; height: 6px; border-radius: 3px; background: #d8c9a3; border: 0; padding: 0; cursor: pointer; position: relative; overflow: hidden; }
  #hiw .hiw-dot i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--brass); }
  #hiw .hiw-dot.done i { width: 100%; }
  #hiw .hiw-btn { white-space: nowrap; font: inherit; font-weight: bold; font-size: 14.5px; border-radius: 3px; padding: 6px 14px; cursor: pointer; border: 1px solid transparent; }
  #hiw .hiw-btn.ghost { background: none; border-color: var(--rule); color: var(--ink); }
  #hiw .hiw-btn.brass { background: var(--brass); color: #fff8e6; }
  #hiw .hiw-btn[disabled] { opacity: .35; cursor: default; }
  /* the "While you were away" letter (sheet B) */
  #return-letter .rl-box { width: min(640px, calc(100vw - 24px)); max-width: none; max-height: 88vh; box-sizing: border-box;
    position: relative; padding: 14px 16px; background: #fbf5e4; }
  .rl-x { position: absolute; top: 6px; right: 8px; background: none; border: none; font-size: 18px; cursor: pointer; color: #4a3f2c; }
  .rl-sub { text-align: center; font-style: italic; margin: -2px 0 10px; }
  /* return-prompt (Bregir 2026-10-27, alternative A): one light dim for one turn or several, so the paused
     start of the turn stays readable behind the card. Only this overlay — .overlay is shared. */
  #return-letter.overlay { background: #00000026; }
  .rl-span { text-align: center; font-variant: small-caps; letter-spacing: .5px; font-size: 15px; margin: -2px 0 6px; }
  .rl-head { text-align: center; font-size: 14.5px; margin: 0 0 10px; }
  .rl-head .pos { color: #2e6b2e; font-weight: bold; } .rl-head .neg { color: #9b2c1f; font-weight: bold; }
  .rl-needs { border: 1px solid var(--rule-soft); background: #f6edd4; padding: 6px 8px; border-radius: 3px; margin-bottom: 10px; }
  .rl-needs-h { font-variant: small-caps; letter-spacing: .5px; font-weight: bold; font-size: 13px; color: #5a4a2e; margin-bottom: 4px; }
  .rl-allclear { font-style: italic; color: #6a5c3e; font-size: 13px; }
  .rl-timeline { border-left: 2px solid var(--rule); margin-left: 6px; padding-left: 12px; }
  .rl-turn { position: relative; margin: 0 0 8px; }
  .rl-dot { position: absolute; left: -19px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #fbf5e4; border: 2px solid var(--brass); }
  .rl-turn.open .rl-dot { background: var(--brass); } .rl-turn.lost .rl-dot { border-color: #9b2c1f; }
  .rl-turn-h { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; cursor: pointer; padding: 2px 0; }
  .rl-turn-h b { font-variant: small-caps; font-size: 15px; }
  .rl-one { flex: 1 1 160px; min-width: 0; font-size: 12.5px; color: #5a4f3c; font-style: italic; overflow-wrap: anywhere; }
  .rl-play { font: inherit; font-size: 12px; background: var(--ink-nav); color: var(--paper); border: none; border-radius: 2px; padding: 1px 7px; cursor: pointer; }
  .rl-play-none { display: inline-block; width: 24px; }
  .rl-caret { color: #6a5c3e; }
  .rl-body { display: none; margin: 4px 0 2px; } .rl-turn.open .rl-body { display: block; }
  .rl-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
  .rl-foot .rl-watch { width: auto; flex: 0 1 auto; margin: 0; }
  .rl-close { cursor: pointer; text-decoration: underline; color: var(--ink); }
  /* #17: the replay's own look — your ship the map's brass icon, her track brass, the rest of her course
     a faint dashed line, sightings faded grey icons with a dashed outline; the turn's own storms */
  .replay-boat { fill: #1c1610; stroke: var(--brass, #b8860b); stroke-width: 1.6; }
  .replay-boat.sunk { fill: #555; opacity: .6; } .replay-boat.captured { fill: #7a5a1a; }
  .replay-track { fill: none; stroke: var(--brass, #b8860b); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
  .replay-course { fill: none; stroke: var(--brass, #b8860b); stroke-width: 2; stroke-dasharray: 5 5; opacity: .45; }
  .replay-ghost-ship { fill: #8a7f6d; fill-opacity: .45; stroke: #4a3f2c; stroke-width: 1; stroke-dasharray: 2 1.5; }
  #mapbox.replaying .storm-center, #mapbox.replaying .storm-fringe, #mapbox.replaying .storm-glyph { visibility: hidden; }
  #replay-banner .rb-stale { background: #c0392b; color: #fff; padding: 1px 7px; border-radius: 3px; margin-left: 8px; }
  #mapctrls #map-replay-btn { width: auto; padding: 0 9px; font-size: 13px; background: var(--ink-nav); color: var(--paper);
              border-color: var(--ink-nav); white-space: nowrap; }
  #mapctrls #map-replay-btn:hover { background: #24364c; }
  /* #2: plotting a course comes first — brass primary button, the replay a small link beside it */
  .ship-acts { display: flex; align-items: center; gap: 10px; margin-top: 5px; flex-wrap: wrap; }
  .ship-cta { font-family: inherit; font-size: 12.5px; font-weight: bold; cursor: pointer; border: none;
              border-radius: 3px; padding: 5px 12px; }
  .ship-cta.brass { background: var(--brass); color: #1c1610; }
  .ship-cta.brass:hover { background: #c9971c; }
  .ship-replay-link { font-size: 11.5px; color: var(--ink-nav); cursor: pointer; text-decoration: underline dotted; }
  .ship-replay-link:hover { text-decoration: underline; }
  /* chart-cartouche legend, overlaid on the map's SW corner — one entry per row */
  #legend { position: fixed; left: 14px; bottom: 12px; z-index: 5; width: 262px;
            padding: 6px 11px 7px; font-size: 12.5px; color: #4a3f2c;
            background: #f0e6cdf2; border: 1px solid var(--rule); border-radius: 2px;
            box-shadow: 0 2px 6px #00000022; line-height: 1.45; }
  #legend:empty { display: none; }
  #legend::before { content: "Chart legend"; display: block;
                    font-variant: small-caps; font-weight: bold; letter-spacing: 1px;
                    border-bottom: 1px solid var(--rule-soft); margin-bottom: 4px;
                    padding-bottom: 2px; }
  .lg-row { display: grid; grid-template-columns: 56px 1fr; column-gap: 8px; align-items: center; min-height: 22px; }
  .lg-sym { display: flex; justify-content: center; align-items: center; }
  .lg-sym .sw { margin-right: 0; }
  .lg-flag { width: 18px; height: 18px; vertical-align: -4px; }
  /* league flags: ship stern disc, ruins, the hover list's flag line */
  .ship.pirate { fill: #2b2016; opacity: 1; }   /* pirates near-black, as in the replay */
  .ship.flagged { stroke-width: 1.4; }   /* other captains ships only: your own keep the strong brass ring */   /* a league ship's fill is inline (its league colour); the ring keeps it readable on any terrain */
  .ruinmark polygon { fill: #a79f8c; fill-opacity: .85; stroke: #4a4338; stroke-width: 1.6; }
  .ruinmark path { fill: none; stroke: #3b352b; stroke-width: 1.6; stroke-linecap: round; }
  .ruinmark .ruin-label { font-size: 9px; font-style: italic; fill: #4a4338; stroke: none; paint-order: stroke; }
  .portdot.provisional { opacity: .9; }
  .sl-flag { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-nav); }
  /* the founder's flag picker: 8 colours (rows) x 6 symbols (columns); cells stay >= 28px and the grid wraps */
  .flag-picker { display: grid; grid-template-columns: repeat(6, minmax(28px, 36px)); gap: 4px; margin: 6px 0; }
  .flag-cell { box-sizing: border-box; min-width: 28px; min-height: 28px; aspect-ratio: 1; padding: 1px; cursor: pointer;
               background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; }
  .flag-cell svg { display: block; width: 100%; height: 100%; }
  .flag-cell:hover:not(:disabled) { background: var(--paper3); }
  .flag-cell:focus-visible { outline: 2px solid var(--ink-nav); outline-offset: 1px; }
  .flag-cell.sel { border-color: var(--ink-nav); box-shadow: 0 0 0 2px var(--brass, #b8860b); background: var(--paper2); }
  .flag-cell:disabled { opacity: .3; filter: grayscale(1); cursor: not-allowed; }
  .lg-foot { font-style: italic; color: #7a6a4a; margin-top: 3px; }
  .sw { display: inline-block; width: 14px; height: 14px; border-radius: 2px;
        margin-right: 4px; vertical-align: -1px; }
  #err { color: #b00; padding: 20px; font-size: 16px; }
  #err:not(:empty) { position: relative; z-index: 3; }   /* dispatch-landing: above the landing box, which covers the map */

  /* ── Side panel ── */
  #panel {
    width: var(--panel-w, 340px); flex-shrink: 0; height: calc(100vh - 60px); overflow-y: auto;
    background: linear-gradient(var(--paper2), var(--paper));
    border-left: 4px double var(--rule);
    font-family: 'Palatino Linotype', Palatino, Georgia, serif; font-size: 14px; color: var(--ink);
    display: flex; flex-direction: column;
  }
  /* #26 draggable divider between the map and the panel */
  #panel-resizer { flex: 0 0 6px; cursor: col-resize; background: var(--rule-soft);
    border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
  #panel-resizer:hover, #panel-resizer.dragging { background: var(--ink-nav); }
  /* #16: keep the tab bar visible while a long pane scrolls under it (#panel is the scroll container). */
  #panel-tabs { display: flex; flex-shrink: 0; border-bottom: 3px double var(--rule);
    position: sticky; top: 0; z-index: 5; background: var(--paper2); }
  #panel-tabs button {
    flex: 1; padding: 8px 4px; font-family: inherit;
    font-size: 12px; border: none; background: transparent; color: #6a5a3c; cursor: pointer;
    border-right: 1px solid var(--rule-soft); letter-spacing: 1px;
    font-variant: small-caps; font-weight: bold;
  }
  #panel-tabs button:last-child { border-right: none; }
  #panel-tabs button.active { background: var(--ink-nav); color: var(--paper); }
  .tab-pane { display: none; padding: 10px 12px; }
  .tab-pane.visible { display: block; }
  /* GUI restructure (Stage 1): reserved Admiralty stub — a disabled, dimmed tab. */
  #panel-tabs button.future-tab { color: #9c8a63; font-style: italic; cursor: not-allowed; opacity: .6; }
  #panel-tabs button.future-tab:hover { background: transparent; }
  /* Pre-login gating (§3.7): when signed out, the sidebar shows the login/onboarding ONLY. */
  #login-sidebar { display: none; padding: 12px; }
  #panel.logged-out #login-sidebar { display: block; }
  #panel.logged-out #panel-tabs { display: none; }
  #panel.logged-out .tab-pane { display: none !important; }
  /* ── admin Console mode (Stage 3) ── a role toggle that flips the whole sidebar into the admin
     console (dark header + its own sub-tab bar Turn·Approvals·NPCs·Press). Player tabs/panes hide
     in console mode; console chrome/panes hide in player mode. `.tab-pane.visible` still selects the
     shown pane WITHIN the active mode — the id-qualified mode rules below out-specify it. */
  #console-hdr { display: none; align-items: center; gap: 8px; padding: 7px 12px;
    background: #3a2020; color: var(--paper); border-bottom: 2px solid var(--rule); flex: none; }
  #console-hdr .console-t { font-variant: small-caps; letter-spacing: 1.5px; font-weight: bold; }
  #console-hdr .console-leave { margin-left: auto; font-family: inherit; font-size: 11px;
    font-variant: small-caps; letter-spacing: .5px; background: transparent; color: var(--paper);
    border: 1px solid #f0e6cd66; padding: 3px 9px; border-radius: 2px; cursor: pointer; }
  #console-tabs { display: none; flex-shrink: 0; border-bottom: 3px double var(--rule);
    position: sticky; top: 0; z-index: 5; background: #efe0c4; }
  #console-tabs button { flex: 1; padding: 8px 4px; font-family: inherit; font-size: 12px; border: none;
    background: transparent; color: #9a3b34; cursor: pointer; border-right: 1px solid var(--rule-soft);
    letter-spacing: 1px; font-variant: small-caps; font-weight: bold; }
  #console-tabs button:last-child { border-right: none; }
  #console-tabs button.active { background: #3a2020; color: var(--paper); }
  /* console panes never show in player mode (higher specificity than .tab-pane.visible) */
  #panel:not(.mode-console) .console-pane { display: none; }
  /* in console mode: hide the player tab bar + player panes; show the console chrome */
  #panel.mode-console #panel-tabs,
  #panel.mode-console #tab-actions,
  #panel.mode-console #tab-log,
  #panel.mode-console #tab-paper { display: none; }
  #panel.mode-console #console-hdr { display: flex; }
  /* dispatch-kpa-draft-stuck part 1: the late / stopped draft line, at the top of the Console only */
  #kpa-draft-alert { margin: 6px 10px 0; }
  #panel:not(.mode-console) #kpa-draft-alert { display: none; }
  #panel.mode-console #console-tabs { display: flex; }
  #login-sidebar .ord-head { font-size: 16px; text-transform: none; letter-spacing: 1px;
             font-variant: small-caps; border-bottom: 2px double var(--rule); padding-bottom: 5px; margin-bottom: 6px; }
  /* The pre-login help paragraphs are what a newcomer reads first — larger and darker than the in-game
     .ord-hint (playtest 2026-10-26). Block hints only; the small inline hints inside labels stay as they are. */
  #login-sidebar div.ord-hint { font-size: 13.5px; line-height: 1.45; color: #5a4a2e; }
  /* Actions checklist (§3.1) — the "what needs me this turn" surface. */
  .sec-h { font-variant: small-caps; letter-spacing: 1px; font-size: 15px; margin: 2px 0 8px;
           color: #5a4a2e; border-bottom: 1px solid var(--rule-soft); padding-bottom: 3px; }
  .todo { display: flex; align-items: center; gap: 9px; padding: 8px 10px; margin-bottom: 8px;
          background: #fbf3de; border: 1px solid var(--rule-soft); border-left: 5px solid var(--brass); border-radius: 3px; }
  .todo.warn { border-left-color: #c62828; } .todo.news { border-left-color: var(--ink-nav); }
  /* #130: row colour by kind — orders dark blue, earning builds green, founding / naming / decisions brass, a ship needing attention red */
  .todo.todo-order { border-left-color: var(--ink-nav); } .todo.todo-build { border-left-color: #5b8a5a; } .todo.todo-found { border-left-color: var(--brass); }
  .todo.warn.todo-order { border-left-color: #c62828; }
  .todo .todo-act.green { background: #5b8a5a; }
  .todo-grp { font-variant: small-caps; letter-spacing: 1px; font-size: 12.5px; color: #6a5c3e; margin: 10px 0 5px; }
  .rr-intl { font-size: 11.5px; margin-left: 6px; }
  .todo .todo-ic { font-size: 16px; width: 20px; text-align: center; }
  .todo .todo-body { flex: 1; font-size: 13px; }
  .todo .todo-act { font-family: inherit; font-variant: small-caps; letter-spacing: .5px; font-size: 11.5px;
          background: var(--ink-nav); color: var(--paper); border: none; padding: 5px 10px; border-radius: 2px;
          cursor: pointer; white-space: nowrap; }
  .todo .todo-act.brass { background: var(--brass); }
  .todo .todo-act.ghost { background: transparent; color: var(--ink-nav); border: 1px solid var(--ink-nav); }
  /* actions-streamline: "Other actions" — the Needs-you row in softer colours, outlined buttons; "Next goals" — dashed */
  .todo.todo-other { background: #f6eedb; border-left-color: #b9a77c; }
  .todo.todo-other.todo-char, .todo.todo-other.todo-ship { border-left-color: #8a9bb0; }
  .todo.todo-other.todo-explore { border-left-color: #8fb08e; }
  .todo.todo-goal { background: transparent; border: 1px dashed #b9a77c; }
  .todo .ct-hint, .todo .ct-log { font-size: 12px; margin-top: 2px; }
  .act-confirm p, .act-goal p { margin: 0 0 8px; font-size: 13px; }
  .log-door { margin: 6px 0; font-size: 13px; }
  .ct-traveller.ct-door { cursor: pointer; }
  .allclear { padding: 16px; text-align: center; color: #6a5c3e; font-style: italic;
          border: 1px dashed var(--rule-soft); border-radius: 4px; }
  /* Captain's Log collapsible sections (§3.6) — <details>/<summary> in the age-of-sail hand.
     Open-state survives the 15s poll (LOG_SEC_CLOSED); localStorage persistence is Stage 2. */
  details.acc { margin: 6px 0 10px; }
  details.acc > summary { cursor: pointer; font-variant: small-caps; letter-spacing: 1px; font-size: 13px;
    color: #5a4a2e; padding: 4px 2px; border-bottom: 1px solid var(--rule-soft); list-style: none;
    font-weight: bold; }
  details.acc > summary::-webkit-details-marker { display: none; }
  details.acc > summary::before { content: '▸ '; color: var(--brass); }
  details.acc[open] > summary::before { content: '▾ '; }
  details.acc > .accbody { padding: 8px 2px 2px; }
  /* Captain's Log "Your bounties" summary rows (same data as The Paper board). */
  .log-bounty { font-size: 12px; color: #4a3f2c; padding: 3px 2px; border-top: 1px solid #ece2c9;
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
  .log-bounty:first-child { border-top: none; }
  .log-bounty .amt { color: #8a5a00; font-weight: bold; }
  /* The Paper: keep a little air between the folded-in sections (issues · board · news). */
  #paper-issues, #paper-board, #paper-news { margin-bottom: 4px; }
  /* selected-view-1: the selected view (js/selected.js) — a thing clicked on the map, in the panel's place */
  .sv { position: relative; font-size: 13px; }
  .sv-x { position: absolute; right: 0; top: 2px; cursor: pointer; opacity: .6; border: none; background: transparent;
    font-size: 16px; color: var(--ink); font-family: inherit; }
  .sv-x:hover { opacity: 1; }
  .sv-name { margin: 0; padding-right: 28px; font-variant: small-caps; letter-spacing: .8px; font-size: 20px; }
  .sv-sub { font-size: 13px; color: #7a6a4a; font-style: italic; margin: 2px 0 10px; }
  .sv-town { display: block; width: 100%; border: 1px solid var(--rule-soft); border-radius: 3px; background: #f8f3e6; margin: 0 0 4px; }
  .sv-sec { border-top: 1px solid var(--rule-soft); margin-top: 11px; padding-top: 10px; }
  .sv-sec.sv-first { border-top: none; margin-top: 6px; padding-top: 0; }
  .sv-lab { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px;
    font-variant: small-caps; letter-spacing: .5px; color: #5a4a2e; font-weight: bold; }
  .sv-lab span { font-variant: normal; letter-spacing: 0; font-weight: normal; color: var(--ink); font-size: 13px; }
  .sv-sec[data-sv="market"] .sv-lab span { font-style: italic; color: #7a6a4a; }
  .sv-note { font-size: 12px; color: #7a6a4a; font-style: italic; margin-top: 4px; }
  .sv-bar { height: 9px; border: 1px solid var(--rule); border-radius: 2px; background: #fbf6ea; margin-top: 5px; position: relative; overflow: hidden; }
  .sv-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brass); opacity: .85; }
  .sv-states { display: flex; margin-top: 6px; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
  .sv-states div { flex: 1; text-align: center; font-size: 11.5px; padding: 3px 0; color: #a39369; background: #fbf6ea; border-right: 1px solid var(--rule-soft); }
  .sv-states div:last-child { border-right: none; }
  .sv-states .now { background: var(--ink-nav); color: var(--paper); font-weight: bold; }
  .sv-tv { margin-top: 8px; cursor: pointer; }
  .sv-tvline { font-size: 13px; display: flex; gap: 6px; align-items: baseline; }
  .sv-tvline span { font-variant: small-caps; letter-spacing: .5px; color: #5a4a2e; font-weight: bold; }
  .sv-tvline b { border-bottom: 1px dotted #7a6a4a; }
  .sv-tvline i { color: #7a6a4a; font-size: 12px; }
  /* the ledger: a hover opens it on a computer, a tap (a click) keeps it open — and the poll's redraw keeps it open */
  .sv-ledger { display: none; width: 100%; border-collapse: collapse; margin-top: 5px; background: #fbf6ea; border: 1px solid var(--rule-soft); }
  .sv-tv.open .sv-ledger { display: table; }
  @media (hover: hover) { .sv-tv:hover .sv-ledger { display: table; } }
  .sv-ledger td { font-size: 12.5px; padding: 3px 6px; border-top: 1px solid #e3d6b4; }
  .sv-ledger tr:first-child td { border-top: none; }
  .sv-ledger .sv-amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .sv-ledger .sv-lh td { color: #7a6a4a; font-style: italic; }
  .sv-ledger .sv-lt td { font-weight: bold; border-top: 1px solid var(--rule); }
  .sv-who, .sv-facts { font-size: 13px; line-height: 1.5; margin-top: 5px; }
  .sv-who i { color: #7a6a4a; }
  .sv-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
  .sv-btn { font-family: inherit; font-size: 13.5px; font-variant: small-caps; letter-spacing: .5px; background: var(--paper);
    color: var(--ink); border: 1px solid var(--rule); border-radius: 2px; padding: 5px 14px; cursor: pointer;
    box-shadow: 0 1px 1px #0002, inset 0 1px 0 #fff9; }
  .sv-btn.main { background: var(--ink-nav); color: var(--paper); border-color: var(--ink-nav); }
  /* tracks-2a: a town by its parts — one row per part with its summary, one open at a time */
  .sv-parts { margin-top: 8px; display: flex; flex-direction: column; gap: 7px; }
  .sv-part { border: 1px solid var(--rule); border-radius: 3px; background: #fbf6ea; }
  .sv-prow { display: block; position: relative; width: 100%; text-align: left; font-family: inherit; color: var(--ink);
    background: transparent; border: none; border-radius: 2px; padding: 8px 30px 8px 12px; cursor: pointer; }
  .sv-plain { font-variant: normal; letter-spacing: 0; font-weight: normal; font-size: 12px; font-style: italic; opacity: .75; }
  .sv-rowh { display: block; font-variant: small-caps; letter-spacing: .8px; font-weight: bold; font-size: 14.5px; }
  .sv-sum { display: block; font-size: 12.5px; color: #5a4a2e; }
  .sv-chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: #7a6a4a; }
  .sv-chev::before { content: '›'; font-size: 16px; }
  .sv-part.open > .sv-prow { background: var(--ink-nav); color: var(--paper); }
  .sv-part.open > .sv-prow .sv-sum, .sv-part.open > .sv-prow .sv-chev { color: var(--paper2); }
  .sv-part.open > .sv-prow .sv-chev::before { content: '⌄'; }
  .sv-pbody { padding: 4px 12px 12px; }
  .sv-pbody .sv-btns { margin-top: 10px; }
  /* open-slots (Bregir, 2026-11-17): three boxes to a row at the panel's width, on a computer as on a phone; a long name wraps in its box */
  .sv-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
  .sv-tile { border: 1px solid var(--rule); border-radius: 2px; padding: 4px 3px; text-align: center; background: var(--paper); min-width: 0; }
  .sv-tile small { overflow-wrap: break-word; }   /* a long captain's name wraps inside its box (at its spaces and hyphens) */
  .sv-tile-k { display: block; font-size: 12.5px; color: var(--ink); overflow: hidden; }   /* a kind wraps at its spaces, never inside a word */
  a.sv-tile-k { text-decoration: underline dotted; }
  .sv-tile small { display: block; font-size: 11.5px; color: #7a6a4a; }
  .sv-tile.held { border-style: dashed; border-color: #b5473a; }
  .sv-tile.held small { color: #b5473a; }
  /* open-slots (picture A): an open slot is a brass dashed box, a free one an empty dashed box; a box that is a door is a button */
  button.sv-tile { font-family: inherit; font-size: inherit; color: inherit; width: 100%; margin: 0; }
  .sv-tile.open { border: 1.5px dashed var(--brass); background: #fbf3de; position: relative; }
  .sv-tile.open small { color: #8a6508; }
  .sv-tile.door { cursor: pointer; }
  .sv-tile.free { border-style: dashed; border-color: var(--rule-soft); background: transparent; cursor: pointer; }
  .sv-tile.free .sv-tile-k { color: #7a6a4a; font-size: 17px; line-height: 17px; }
  .sv-tile.free small { color: #a39369; }
  .sv-tile.free.picked { border-style: solid; border-color: var(--ink-nav); }
  .sv-tx { position: absolute; right: 1px; top: 0; border: 0; background: transparent; padding: 0 3px; font-size: 12px; line-height: 16px;
           color: #7a6a4a; cursor: pointer; font-family: inherit; }
  .sv-pick { margin-top: 9px; border: 1px solid var(--rule-soft); background: var(--paper); border-radius: 2px; padding: 7px 9px 9px; }
  .sv-pick h5 { margin: 0 0 4px; font-variant: small-caps; letter-spacing: .6px; font-size: 13.5px; color: #5a4a2e; }
  .sv-pick .sb-kind { display: block; font-size: 13px; margin: 3px 0; }
  .sv-pick .sb-kind.built { color: #a39369; }
  .sv-pick .sv-btns { margin-top: 8px; }
  .sv-slot-err { margin-top: 5px; }
  /* fight-stat-names: a limit's value ("to class + 1") never breaks inside */
  .nb { white-space: nowrap; }
  .sv-limits { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 12px; font-size: 13px; margin-top: 5px; }
  /* tracks-2a: posting a build in two steps */
  .sb-q { font-style: italic; color: #7a6a4a; margin-bottom: 6px; }
  .sb-part { display: block; width: 100%; text-align: left; font-family: inherit; color: var(--ink); background: #fbf6ea;
    border: 1px solid var(--rule); border-radius: 3px; padding: 7px 10px; margin: 0 0 6px; cursor: pointer; }
  .sb-part b { display: block; font-variant: small-caps; letter-spacing: .6px; }
  .sb-part span { font-size: 12.5px; }
  .sb-part.full { cursor: default; opacity: .55; background: transparent; }
  .sb-crumb { font-size: 13px; color: #5a4a2e; margin-bottom: 6px; }
  .sb-crumb a { color: inherit; text-decoration: underline; cursor: pointer; }
  .sb-h { display: flex; justify-content: space-between; font-variant: small-caps; letter-spacing: .6px; font-weight: bold;
    color: #5a4a2e; margin: 8px 0 4px; font-size: 13px; }
  .sb-h span { font-variant: normal; font-weight: normal; letter-spacing: 0; color: var(--ink); }
  .sb-kind { display: block; font-size: 13px; margin: 3px 0; cursor: pointer; }
  .sb-kind.built { color: #a39369; cursor: default; }
  .sb-voice { font-size: 12.5px; font-style: italic; color: #5a4a2e; margin: 0 0 6px; }
  .sb-ex { font-size: 12.5px; font-style: italic; color: #5a4a2e; border-left: 2px solid var(--rule-soft); padding-left: 8px; margin: 2px 0 6px 22px; }
  .sb-note { font-size: 12px; font-style: italic; color: #7a6a4a; margin-top: 4px; }
  .sb-full { color: #b5473a; }
  /* tracks-2a: the Console's launch slider — four positions, each including the ones before it */
  .tk-slider { display: flex; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; margin: 4px 0; max-width: 520px; }
  .tk-pos { flex: 1; font-family: inherit; font-size: 12px; padding: 4px 6px; border: none; border-right: 1px solid var(--rule-soft);
    background: #fbf6ea; color: var(--ink); cursor: pointer; }
  .tk-pos:last-child { border-right: none; }
  .tk-pos.on { background: var(--ink-nav); color: var(--paper); font-weight: bold; }
  .tk-limits input { width: 46px; }
  .tk-limits td { white-space: nowrap; font-size: 12px; padding: 2px 6px 2px 0; }
  #tracks-sec .set-num, #tracks-sec .ord-check, #tracks-admin .set-num { display: block; margin: 4px 0; white-space: normal; }
  #tracks-sec .set-num input, #tracks-admin .set-num input { width: 64px; margin-left: 6px; }
  /* selected-view-2: the ship — her buttons under her whereabouts, her stats as strips, cards, her career */
  .sv-btns.sv-lead { margin-top: 9px; }
  .sv-edit { cursor: pointer; text-decoration: none; opacity: .7; font-style: normal; }
  .sv-stats { margin-top: 6px; }
  .sv-stat { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
  .sv-stat-n { width: 82px; font-variant: small-caps; letter-spacing: .5px; color: #5a4a2e; font-weight: bold; font-size: 13px; }
  .sv-stat b { width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
  .sv-strip { flex: 1; display: flex; gap: 3px; flex-wrap: nowrap; }
  .svc { display: inline-block; flex: 1; max-width: 26px; min-width: 6px; height: 12px; border: 1px solid var(--rule); border-radius: 2px; background: #fbf6ea; }
  .svc.base { background: var(--ink-nav); border-color: var(--ink-nav); }
  .svc.card { background: var(--brass); border-color: #8f6a0a; }
  .svc.away { background: repeating-linear-gradient(135deg, #b5473a 0 2px, #fbf6ea 2px 5px); border-color: #b5473a; }
  .svc.shut { border-style: dashed; border-color: var(--rule-soft); background: transparent; }
  .sv-key { font-size: 11.5px; color: #7a6a4a; font-style: italic; margin-top: 4px; }
  .sv-key .svc { width: 10px; height: 9px; flex: none; vertical-align: -1px; margin-left: 6px; }
  /* tracks-2b: a point a build this yard lacks would allow — hatched, past the yard's limit */
  .svc.hatch { border-style: dashed; border-color: #b5473a; background: repeating-linear-gradient(135deg, rgba(181,71,58,.28) 0 2px, transparent 2px 5px); cursor: pointer; }
  /* tracks-2b: the licensing form — the class buttons, the strips with − and +, each limit under its strip */
  .lic-sub { font-style: italic; margin-top: -2px; }
  .ord-label.lic-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .lic-aside { font-variant: normal; letter-spacing: 0; font-weight: normal; text-transform: none; color: #4a3f2c; }
  .lic-classes { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
  .lic-cls { min-width: 36px; min-height: 32px; border: 1px solid var(--rule); border-radius: 2px; background: #fbf6ea; font: inherit; cursor: pointer; }
  .lic-cls.on { background: var(--ink-nav); border-color: var(--ink-nav); color: #f4ead2; }
  .lic-cls.past { border-style: dashed; border-color: var(--rule-soft); color: #b3a37f; background: transparent; cursor: default; }
  .lic-stats { margin: 4px 0; }
  .lic-stat { display: grid; grid-template-columns: 92px 32px 1fr 32px 22px; align-items: center; column-gap: 6px; margin: 2px 0 6px; }
  .lic-stat .sv-stat-n { width: auto; cursor: help; }
  .lic-pm { width: 32px; height: 32px; border: 1px solid var(--rule); border-radius: 2px; background: #fbf6ea; font: inherit; font-size: 17px; line-height: 1; cursor: pointer; }
  .lic-pm:disabled { opacity: .4; cursor: default; }
  .lic-v { text-align: right; font-variant-numeric: tabular-nums; }
  .lic-lim { grid-column: 3 / 6; font-size: 12px; color: #7a6a4a; font-style: italic; }
  .lic-hint { grid-column: 3 / 6; font-size: 12.5px; color: #7a2f26; margin-top: 2px; }
  .lic-cut { color: #7a2f26; }
  /* tracks-2b: the yard guide — the filter's chips, one card per yard, greyed with its reason when it does not do what she wants */
  .lic-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 8px 0; }
  .lic-want { margin-right: 2px; }
  .lic-chip { border: 1px solid var(--rule); border-radius: 14px; background: #fbf6ea; padding: 3px 10px; font: inherit; font-size: 13px; min-height: 30px; cursor: pointer; }
  .lic-chip.on { background: var(--ink-nav); border-color: var(--ink-nav); color: #f4ead2; }
  .lic-yard { border: 1px solid var(--rule); border-radius: 3px; background: #fbf6ea; padding: 8px 10px; margin: 8px 0; }
  .lic-yard.grey { opacity: .62; background: transparent; }
  .lic-yard-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
  .lic-yard-h b { font-variant: small-caps; letter-spacing: .5px; font-size: 15px; }
  .lic-yard-s { font-style: italic; font-size: 12.5px; color: #6a5a3a; }
  .lic-tiles { display: flex; gap: 4px; margin: 6px 0; flex-wrap: wrap; }
  .lic-tile { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11.5px; line-height: 1.2; padding: 2px 2px; border: 1px dashed var(--rule-soft); border-radius: 2px; color: #9a8a66; }
  .lic-tile.on { border: 1px solid var(--ink-nav); background: var(--ink-nav); color: #f4ead2; }
  .lic-yard-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .lic-why { font-style: italic; font-size: 12.5px; color: #7a2f26; }
  html.phone .lic-yard-f { flex-direction: column; align-items: stretch; }
  html.phone .lic-yard-f .lic-go, html.phone .lic-yard-f .lic-show { width: 100%; }
  html.phone .lic-stat { grid-template-columns: 78px 36px 1fr 36px 20px; }
  html.phone .lic-pm { width: 36px; height: 36px; }
  .sv-repair { color: #9a3b34; }
  .sv-cards { display: flex; gap: 6px; margin-top: 6px; }
  .sv-card { flex: 1; min-height: 44px; border: 1px solid var(--rule); border-radius: 2px; background: #fbf6ea; padding: 5px 6px; text-align: center; font-size: 13px; line-height: 1.25; }
  .sv-card b { font-weight: normal; display: block; }
  .sv-card em { display: block; font-size: 11.5px; color: #7a6a4a; }
  .sv-card.empty { border-style: dashed; border-color: var(--rule-soft); background: transparent; }
  .sv-career { margin-top: 4px; }
  .sv-cl { display: flex; gap: 12px; font-size: 13px; padding: 4px 0; border-top: 1px solid #e3d6b4; line-height: 1.35; }
  .sv-cl:first-child { border-top: none; }
  .sv-cl span { flex: none; width: 52px; color: #7a6a4a; font-style: italic; }
  .sv-more { margin-top: 6px; font-family: inherit; font-size: 12.5px; background: none; border: none; color: #5a4a2e; text-decoration: underline; cursor: pointer; padding: 0; }
  /* story-builds-2: the story on top, the ideas on the page, the dividing heading above the rows */
  .sv-flav { font-size: 12.5px; color: #7a6a4a; margin: -6px 0 10px; }
  .sv-story { margin: 10px 0 12px; }
  .sv-story .sv-lab span { margin-left: 8px; }
  .sv-storybar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 4px 0 6px; }
  .sv-storybar .sv-more { margin-top: 0; }
  .sv-story-e small { display: block; color: #7a6a4a; font-size: 12px; }
  .sv-story-d { color: inherit; }
  .sv-ideas { font-size: 13px; line-height: 1.4; margin: 6px 0 8px; padding: 6px 8px; border-left: 2px solid #c9b88a; background: #fbf6ea; }
  .sv-voice { margin-bottom: 4px; color: #5a4a2e; }
  .sv-ideas .sv-kind { margin: 5px 0; display: block; }
  .sv-ideas .sv-kind.built { color: #9a8c6a; }
  .sv-ex { font-size: 12px; color: #7a6a4a; font-style: italic; margin-top: 1px; }
  .sb-two .fd-desc { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; }
  .sv-partshead { margin: 14px 0 6px; border-top: 1px solid var(--rule-soft); padding-top: 10px; }
  .sv-pideas { margin-top: 8px; }
  .sv-ideas .sv-kind + .sv-kind { border-top: 1px solid #e3d6b4; padding-top: 5px; }
  .own-order.picked polyline { stroke-width: 3.5; opacity: 1; }
  /* selected-view-3: the captain — a name that is a link, the lists of ships, cards and discoveries, the waiting notice */
  .cap-link { color: inherit; border-bottom: 1px solid #7a6a4a; cursor: pointer; text-decoration: none; }
  .cap-link:hover { color: var(--ink-nav); border-bottom-color: var(--ink-nav); }
  .sv-list { margin-top: 5px; }
  .sv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; padding: 4px 0; border-top: 1px solid #e3d6b4; line-height: 1.35; }
  .sv-row:first-child { border-top: none; }
  .sv-row > i { flex: none; color: #7a6a4a; text-align: right; }
  .sv-row span i { color: #7a6a4a; }
  .sv-lab em { font-size: 12px; color: #7a6a4a; }
  .sv-pend { margin-top: 12px; background: #f6e9b8; border: 1px solid #d9c36f; border-radius: 2px; padding: 6px 9px; font-size: 13px; }
  .sv-capart { height: 84px; }

  /* Fleet tab */
  .owner-block { margin-bottom: 14px; }
  .owner-header { font-weight: bold; font-size: 14px; border-bottom: 2px solid var(--rule-soft);
                  padding-bottom: 4px; margin-bottom: 6px; letter-spacing: .3px; }
  .owner-balance { font-weight: normal; font-size: 12px; color: #444; margin-left: 6px; }
  .owner-wanted { color: #c62828; font-size: 12px; margin-bottom: 4px; }
  .owner-fleet { color: #555; font-size: 12px; margin-bottom: 4px; }
  .owner-faction-wrap { margin-left: 8px; }
  .owner-faction { font-weight: normal; font-size: 11px; color: #5a4a2a; font-style: italic; }
  .owner-faction-sel { font-size: 11px; padding: 1px 3px; vertical-align: middle; }
  .ship-card { margin-bottom: 10px; padding: 6px 8px; background: #f7efdbd0;
               border-radius: 2px; border: 1px solid var(--rule-soft);
               box-shadow: 0 1px 2px #0001; }
  .ship-card.orderable { cursor: pointer; }
  .ship-card.orderable:hover { border-color: #1a2737; background: #f7f0e0; }
  .ship-card.selected { border-left: 5px solid var(--brass, #b8860b); background: #efe2c2; }   /* 1b part 4: brass bar, darker paper */
  .ship-name { font-style: italic; font-size: 15px; font-weight: bold; }
  /* ship-flavour part 1: the type reads as plain words before the italic name; the description quieter beneath */
  .ship-name .ship-type, .sl-name .ship-type { font-style: normal; font-weight: normal; }
  .ship-desc { font-size: 12px; color: #7a6a4a; margin: 1px 0 3px; }
  .sl-desc { font-size: 11px; color: #7a6a4a; margin: 1px 0 0 0; }
  .flv-acts { margin-top: 3px; font-size: 12px; }
  .flv-acts a { cursor: pointer; text-decoration: underline; margin-right: 8px; }
  /* ship-flavour part 2: a ship's name that opens her build — the name's own style, a quiet underline */
  a.ship-moc { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
  .ship-stats { font-size: 11px; color: #555; margin: 2px 0; font-family: 'Courier New', monospace; }
  /* build+story cards (wave-2 #4): a per-ship badge line under the stats (public v1) */
  .ship-cards { font-size: 11px; margin: 2px 0; }
  .card-badge { display: inline-block; background: #efe3c2; border: 1px solid var(--rule-soft);
                border-radius: 2px; padding: 0 4px; font-variant: small-caps; letter-spacing: .3px; }
  /* tester-ready-3 part 6 (#5): a card's name opens what it does — on hover, or on tap/focus on a phone */
  .card-name { position: relative; cursor: help; border-bottom: 1px dotted currentColor; }
  .card-tip { display: none; position: absolute; left: 0; top: 100%; z-index: 25; width: 240px; margin-top: 3px;
              background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 3px;
              padding: 6px 8px; font: 12px/1.35 Georgia, serif; font-variant: normal; letter-spacing: 0;
              box-shadow: 0 3px 10px #0004; white-space: normal; text-align: left; }
  .card-name:hover .card-tip, .card-name:focus .card-tip, .card-name:focus-within .card-tip { display: block; }
  .card-tip i { display: block; margin-bottom: 3px; }
  .grant-note { font-size: 11px; color: #666; margin-top: 6px; line-height: 1.35; }
  .ship-location { font-size: 12px; margin: 2px 0; }
  .ship-orders { font-size: 12px; margin: 2px 0; }
  .ship-orders.awaiting { color: #888; font-style: italic; }
  .ord-cta { font-size: 12px; color: #1a2737; font-weight: bold; margin-top: 4px; }
  .badge { display: inline-block; font-size: 11px; border-radius: 3px;
           padding: 1px 5px; margin-top: 3px; margin-right: 4px; }
  .badge-repair { background: #fff3e0; color: #e65100; border: 1px solid #ffb74d; }
  .badge-prize { background: #fff8e1; color: #795548; border: 1px solid #ffe082; }
  .status-bad { color: #c62828; font-weight: bold; }
  .no-ships { color: #888; font-style: italic; font-size: 13px; }

  /* Ports tab */
  #ports-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  #ports-table th { background: transparent; color: var(--ink); text-align: left;
                    padding: 4px 6px; font-weight: bold; font-size: 10px;
                    text-transform: uppercase; letter-spacing: .6px;
                    border-bottom: 2px solid var(--rule); }
  #ports-table td { padding: 4px 6px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
  #ports-table tr:last-child td { border-bottom: none; }
  .fac-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px;
                vertical-align: -1px; margin-right: 5px; }
  .tv-up { color: #2e7d32; }
  .tv-down { color: #c62828; }

  /* News tab */
  .pirates-line { font-size: 12px; color: #555; margin-bottom: 10px;
                  padding-bottom: 8px; border-bottom: 1px solid var(--rule-soft); }
  .news-item { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
  .news-turn { font-size: 10px; font-family: 'Courier New', monospace;
               background: var(--paper3); color: #4a3f2c; border-radius: 2px;
               padding: 2px 5px; white-space: nowrap; flex-shrink: 0; margin-top: 1px;
               border: 1px solid var(--rule-soft); }
  .news-text { font-size: 13px; line-height: 1.5; }

  /* ── Drill-in (Stage 2) ── an action's detail takes over its launching tab's pane; a "‹ Back"
     restores the list. The order/register forms (and pay/join/bounty/prize) render into #drill-body. */
  #drill-body { padding: 2px 0; }
  .drillbar { margin-bottom: 6px; }
  .backbtn { font-family: inherit; font-variant: small-caps; letter-spacing: .5px; font-size: 12px;
             background: transparent; color: var(--ink-nav); border: 1px solid var(--ink-nav);
             padding: 4px 12px; border-radius: 2px; cursor: pointer; }
  .backbtn:hover { background: var(--ink-nav); color: var(--paper); }
  /* ── Order form (GUI step 3; now rendered inside a drill) ── */
  .ord-head { font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
              color: #1a2737; font-weight: bold; }
  .ord-ship { font-style: italic; font-size: 17px; font-weight: bold; margin: 2px 0 2px; }
  .ord-shipstats { display: block; font-style: normal; font-size: 11px; color: #555;
                   font-family: 'Courier New', monospace; font-weight: normal; }
  .ord-types { margin: 10px 0; display: flex; gap: 16px; font-size: 14px; }
  .ord-types label { cursor: pointer; }
  .ord-label { display: block; font-size: 12px; font-weight: bold; color: #1a2737;
               margin: 10px 0 3px; }
  .ord-input { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px;
               padding: 5px 6px; border: 1px solid var(--rule-soft); border-radius: 2px; background: #fffdf4; }
  /* small-fixes-3: a build link that is not required (the playtest) recedes — the panel's own paper, a
     lighter border — so it reads as skippable; typed text keeps the ink colour, the placeholder stays legible
     (#6e6045 on the paper is 4.9:1, typed ink 13.4:1). */
  .ord-input.build-optional { background: var(--paper); border-color: #ddd0ae; color: var(--ink); }
  .ord-input.build-optional::placeholder { color: #6e6045; font-style: italic; opacity: 1; }
  .ord-hint { font-size: 11px; color: #888; font-weight: normal; font-style: italic; }
  .ord-dim { color: #aaa; }
  /* #21 themed port suggestion list (replaces the native <datalist> dark overlay) */
  .port-combo { position: relative; }
  .port-sug { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; max-height: 190px;
              overflow-y: auto; background: #fffdf4; border: 1px solid var(--rule);
              border-radius: 0 0 2px 2px; box-shadow: 0 4px 10px rgba(0,0,0,.18); }
  /* small-fixes-8 part 3: opened above the field when the keyboard leaves no room below (placeDestSug) */
  .port-sug.up { bottom: 100%; top: auto; border-radius: 2px 2px 0 0; box-shadow: 0 -4px 10px rgba(0,0,0,.18); }
  .port-sug-item { padding: 5px 8px; cursor: pointer; font-size: 13px; }
  .port-sug-item:hover, .port-sug-item.hi { background: var(--ink-nav); color: var(--paper); }
  .port-sug-gated { opacity: .55; }   /* shallow-only port the selected ship draws too much water for */
  .ord-mini { font-family: inherit; font-size: 11px; margin-left: 8px; cursor: pointer;
              border: 1px solid var(--rule-soft); background: var(--paper); border-radius: 3px; padding: 1px 6px; }
  .ord-readout { margin: 12px 0 4px; padding: 8px; background: var(--paper); border-radius: 4px;
                 font-size: 13px; border: 1px solid var(--rule-soft); }
  .ord-warn { margin: 4px 0; }
  .ord-warn-item { color: #c62828; font-size: 12px; margin: 3px 0; }
  .ord-error { color: #b00; font-size: 12px; margin: 4px 0; }
  .ord-buttons { margin-top: 14px; display: flex; gap: 8px; }
  .ord-go { flex: 1; font-family: inherit; font-size: 14px; padding: 8px; cursor: pointer;
            background: #1a2737; color: var(--paper); border: none; border-radius: 4px; }
  .ord-go:disabled { background: #8a8170; opacity: .45; cursor: not-allowed; }
  .ord-cancel { font-family: inherit; font-size: 14px; padding: 8px 14px; cursor: pointer;
                background: var(--paper2); color: #5a4a2e; border: 1px solid var(--rule-soft); border-radius: 4px; }
  /* route builder */
  .ord-route { font-size: 13px; padding: 4px 0; }
  .ord-route-line { margin-bottom: 6px; }
  .ord-route-controls { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
  .ord-mini:disabled { opacity: .4; cursor: not-allowed; }
  .ord-note { font-size: 11px; color: #8a6d3b; font-style: italic; margin-top: 4px; }
  .ord-targets { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 4px 0; }
  .ord-check { font-size: 12px; cursor: pointer; white-space: nowrap; }
  .ord-check input { vertical-align: -1px; margin-right: 3px; }
  /* register form (GUI step 5; now rendered inside a drill) */
  .reg-add { width: 100%; font-family: inherit; font-size: 13px; padding: 7px; cursor: pointer;
             background: #1a2737; color: var(--paper); border: none; border-radius: 4px; margin-bottom: 10px; }
  .loss-modal { position: fixed; inset: 0; background: rgba(26,23,18,.55); z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; }
  .loss-box { background: var(--paper); border: 2px solid var(--rule); border-radius: 6px; max-width: 460px; width: 100%; max-height: 80vh; overflow: auto; padding: 14px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
  .loss-entry { margin: 8px 0; padding-bottom: 8px; border-bottom: 1px solid var(--rule-soft); }
  .lost-row { margin: 4px 0; font-size: 13px; }
  .reg-stats { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
  .reg-stat { display: flex; align-items: center; gap: 4px; font-size: 12px; }
  .reg-stat-name { font-size: 11px; opacity: .75; }
  .reg-stat-hint { min-height: 1.3em; }
  .reg-warn { color: #8a5a00; font-size: 12px; padding: 2px 0; }
  .reg-stat-k { font-family: 'Courier New', monospace; font-weight: bold; width: 12px; text-align: center; }
  .reg-stat input { width: 52px; font-family: inherit; font-size: 13px; padding: 3px 4px;
                    border: 1px solid var(--rule-soft); border-radius: 3px; }
  .reg-ok { color: #2e7d32; }
  .reg-bad { color: #c62828; }
  .reg-stat input.reg-stat-bad { border-color: #c62828; background: #fdecec; }
  .reg-note { font-size: 12px; margin: 6px 0 2px; padding: 6px 8px; background: var(--paper);
              border-radius: 4px; line-height: 1.4; }
  #reg-stat-feedback { font-size: 12px; margin: 2px 0; min-height: 1em; }
  .status-pending { color: #8a6d3b; font-style: italic; }
  /* round-report overlay (GUI step 4) */
  .overlay { display: none; position: fixed; inset: 0; background: #00000066; z-index: 10;
             align-items: center; justify-content: center; }
  .overlay-box { background: var(--paper); border: 4px double var(--ink); border-radius: 2px;
                 max-width: 520px; max-height: 80vh; overflow-y: auto; padding: 16px 20px;
                 font-family: 'Palatino Linotype', Palatino, Georgia, serif;
                 box-shadow: 0 8px 30px #00000055; }
  .overlay-title { font-size: 18px; font-weight: bold; color: var(--ink); margin-bottom: 8px;
                   font-variant: small-caps; letter-spacing: 1px; text-align: center;
                   border-bottom: 1px solid var(--rule); padding-bottom: 5px; }
  .rr-item { font-size: 13px; line-height: 1.5; margin: 3px 0; }
  .rr-feedback-h { font-weight: bold; color: #1a2737; margin: 10px 0 4px;
                   border-top: 1px solid var(--rule-soft); padding-top: 8px; }
  /* Actions → "The round's report" (the player's private mini-KPA) */
  .rr-report-h { display: flex; align-items: center; justify-content: space-between; gap: 8px;
                 margin-top: 16px; border-top: 1px solid var(--rule-soft); padding-top: 10px; }
  .rr-report-h .sec-h { margin: 0; }
  .rr-turnpick { display: inline-flex; align-items: center; gap: 6px; }
  .rr-step { font-family: inherit; font-size: 13px; cursor: pointer; background: transparent;
             border: 1px solid var(--ink-nav); color: var(--ink-nav); border-radius: 3px; padding: 0 7px; line-height: 1.6; }
  .rr-step:disabled { opacity: .35; cursor: not-allowed; }
  .rr-turnlbl { font-variant: small-caps; letter-spacing: .5px; font-size: 12.5px; min-width: 6em; text-align: center; }
  .rr-ship { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .rr-name { font-weight: bold; color: #1a2737; }
  .rr-line { flex: 1; min-width: 12em; }
  /* one indented sub-line per notable event (round-story fidelity) */
  .rr-event { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 2px 0 2px 20px; color: #34435a; }
  .rr-event::before { content: "\203A"; color: var(--ink-nav); opacity: .55; margin-right: -2px; }
  .rr-dbs { color: #7a5c12; font-weight: bold; }
  /* small-fixes-5 part 9: the fate is a small badge after the name, in the Fleet card's words and colour (.status-bad) */
  .rr-fate { font-size: 10px; letter-spacing: .04em; margin: 0 4px 0 2px; }
  .rr-reward { color: #3a5c2e; }
  .rr-fallback { margin-top: 8px; font-size: 12.5px; color: #6a5c3e; }
  .rr-fallback .todo-act { margin-left: 6px; }
  /* KPA tab */
  .kpa-mast { text-align: center; border-bottom: 4px double var(--ink); padding-bottom: 6px; margin-bottom: 8px;
              border-top: 1px solid var(--ink); padding-top: 5px; }
  .kpa-mast h2 { font-family: 'Palatino Linotype', Palatino, Georgia, serif;
                 font-size: 18px; margin: 0; letter-spacing: 2px; font-weight: bold;
                 font-variant: small-caps; }
  .kpa-mast .kpa-sub { font-size: 11px; color: #5a4a2e; font-style: italic; }
  .kpa-sec { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink);
             font-weight: bold; border-bottom: 1px solid var(--rule); margin: 12px 0 5px;
             text-align: center; }
  .kpa-item { font-size: 13px; line-height: 1.5; margin: 3px 0; }
  .kpa-rumor { font-size: 13px; font-style: italic; color: #5a4a2a; margin: 3px 0; }
  .kpa-ship { font-size: 13px; margin: 2px 0; }
  .kpa-ship .kpa-name { font-style: italic; font-weight: bold; }
  .kpa-ship.npc .kpa-name { font-weight: normal; color: #555; }
  .kpa-todo { font-size: 10px; color: #999; font-style: italic; margin-top: 10px;
              border-top: 1px dashed var(--rule-soft); padding-top: 6px; }
  .kpa-table-wrap { overflow-x: auto; margin: 4px 0; }
  .kpa-table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .kpa-table th, .kpa-table td { text-align: left; padding: 2px 5px; border-bottom: 1px solid var(--rule-soft); white-space: nowrap; }
  .kpa-table th { color: #1a2737; text-transform: uppercase; letter-spacing: .5px; font-size: 10px; }
  .kpa-table td.num { text-align: right; }
  .kpa-table tr.lost td { color: #c62828; }
  /* admin-only NPC order routes (T10): faint dashed for all, bold for the selected NPC */
  #npc-order-layer, #npc-order-layer .npc-route { pointer-events: none; }
  /* Feedback button (feedback-loop method, spec §7.3 "point at it") */
  #fb-bar { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 40; gap: 10px; flex-wrap: wrap;
            align-items: center; padding: 8px 12px; background: var(--ink-nav); color: var(--paper);
            font-size: 13px; box-shadow: 0 2px 8px #0006; }
  body.fb-picking #fb-bar { display: flex; }
  #fb-bar .fb-bar-msg { flex: 1 1 220px; }
  #fb-bar button { font-family: inherit; background: var(--paper); color: var(--ink); border: 1px solid var(--rule);
                   padding: 5px 12px; cursor: pointer; border-radius: 2px; }
  body.fb-picking [data-feedback-section] { cursor: crosshair; }
  .fb-hover { outline: 3px dashed #c8861a !important; outline-offset: -3px; }
  /* The button stays clickable over any open pop-up: it is lifted above every pop-up backdrop (.overlay, .loss-modal: 10) but
     stays below #fb-bar (40) and #fb-modal (50). It holds because no ancestor (span.hdr-btns, header)
     makes a stacking context — none sets z-index, opacity, transform or filter; keep it that way. */
  #feedback-btn { position: relative; z-index: 11; }
  #fb-modal { z-index: 50; }
  #fb-modal .overlay-box { width: min(520px, 92vw); }
  #fb-modal textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 6px; margin: 6px 0; }
  #fb-modal .fb-about { font-size: 13px; margin-bottom: 4px; }
  #fb-modal .fb-follow { display: block; font-size: 13px; margin: 4px 0; }
  #fb-modal .fb-privacy { font-size: 12px; color: #7a6a4a; margin: 4px 0 8px; }
  #fb-modal .fb-msg { color: #c62828; font-size: 13px; min-height: 1.2em; margin-bottom: 4px; }
  .fb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
  /* ── phone-layout part 1: the game on a phone (html.phone = the window is at most 700 px wide, PHONE_MQ) ──
     The chart fills the screen under a one-line header (brand, turn, Feedback, ☰); the ☰ holds the header's other
     items. The panel is a sheet over the chart's foot with three resting heights (#panel.sheet-peek · half · full);
     a replay's log sheet takes its place. The page itself never scrolls (the sheet and the menu do). */
  html:not(.phone) .phone-only { display: none !important; }
  html.phone:not(.view-roadmap), html.phone:not(.view-roadmap) body { height: 100%; overflow: hidden; overscroll-behavior: none; }   /* the roadmap page scrolls */
  html.phone header { flex-wrap: nowrap; align-items: center; gap: 8px; padding: 6px 8px 5px 10px; position: relative; }
  html.phone header h1 { font-size: 16px; letter-spacing: 1.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  html.phone header .hdr-the { display: none; }
  html.phone header .turn { font-size: 13px; }
  html.phone header .hdr-btns { flex-wrap: nowrap; gap: 6px; }
  html.phone header button, html.phone header a.hdr-btn { padding: 4px 9px; }
  html.phone #hdr-menu-btn { font-size: 16px; line-height: 1.15; padding: 2px 9px; font-variant: normal; }
  #hdr-menu { display: none; }
  html.phone header.menu-open #hdr-menu { display: flex; flex-direction: column; position: absolute; top: 100%; right: 6px;
    z-index: 12; min-width: 230px; max-width: calc(100vw - 12px); box-sizing: border-box; padding: 2px 0;
    background: var(--paper); border: 1px solid var(--rule); box-shadow: 0 6px 16px #0004; font-size: 15px; }
  html.phone #hdr-menu > * { margin: 0; padding: 10px 14px; border-top: 1px solid var(--rule-soft); }
  html.phone #hdr-menu > button, html.phone #hdr-menu > a.hdr-btn { display: block; width: 100%; box-sizing: border-box;
    text-align: left; font-size: 15px; border: none; border-top: 1px solid var(--rule-soft); border-radius: 0;
    box-shadow: none; background: none; }
  html.phone #hdr-menu > .turn { opacity: .9; font-size: 14px; white-space: normal; }
  html.phone body.console-active #hdr-menu > #hiw-open { display: none; }   /* small-fixes-8 part 8: not in the Console */
  html.phone #hdr-menu #admin-controls.on { display: flex; flex-wrap: wrap; gap: 6px; }
  html.phone #pending-banner { padding: 5px 10px; font-size: 12px; }
  html.phone #wrap { flex-direction: column; position: relative;
    height: calc(100vh - var(--hdr-h, 46px)); height: calc(100dvh - var(--hdr-h, 46px)); }
  html.phone #mapbox { flex: 1; min-height: 0; padding: 0; }
  html.phone #err:empty { display: none; }   /* its padding would push the chart down */
  html.phone #panel-resizer { display: none; }
  html.phone #panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; width: auto; height: auto;
    border-left: none; border-top: 4px double var(--rule); border-radius: 10px 10px 0 0; box-shadow: 0 -4px 14px #0003;
    padding-bottom: var(--kb, 0px); box-sizing: border-box; transition: height .18s ease; }
  html.phone #panel.sheet-peek { overflow: hidden; }
  html.phone #panel.sheet-peek > :not(#sheet-handle):not(#panel-tabs):not(#console-tabs):not(#sheet-peek) { display: none !important; }
  html.phone #panel.sheet-half { height: 52vh; height: 52dvh; }
  html.phone #panel.sheet-full { height: calc(100vh - var(--hdr-h, 46px)); height: calc(100dvh - var(--hdr-h, 46px)); }
  html.phone #panel.sheet-dragging { transition: none; }
  #sheet-handle { flex-shrink: 0; height: 22px; display: flex; align-items: center; justify-content: center;
    cursor: grab; touch-action: none; position: sticky; top: 0; z-index: 6; background: var(--paper2); }
  #sheet-handle span { width: 46px; height: 5px; border-radius: 3px; background: var(--rule); }
  html.phone #panel-tabs { top: 22px; }
  html.phone #panel-tabs button, html.phone #console-tabs button { white-space: nowrap; padding: 9px 2px; }
  html.phone #panel-tabs button.future-tab { display: none; }   /* the Admiralty stub: nothing to tap yet */
  html.phone #console-tabs { overflow-x: auto; }   /* the admin's seven sub-tabs scroll sideways, each on one line */
  html.phone #console-tabs button { flex: 0 0 auto; padding: 9px 10px; }
  #sheet-peek { display: none; }
  html.phone #panel.sheet-peek #sheet-peek { display: flex; align-items: center; gap: 8px; padding: 7px 12px 9px; min-height: 30px; }
  #sheet-peek .todo { flex: 1; min-width: 0; margin: 0; padding: 0; border: none; background: none; box-shadow: none;
    display: flex; align-items: center; gap: 8px; }
  #sheet-peek .todo-body { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #sheet-peek .peek-line { flex: 1; min-width: 0; font-style: italic; }
  #sheet-peek .peek-more { font-size: 12px; color: #6b5a3a; white-space: nowrap; }
  /* the replay: its log sheet takes the panel sheet's place, below the chart (the logbook too, docked into #wrap) */
  html.phone #wrap.replaying #panel { display: none; }
  html.phone #mapbox.replaying { display: flex; flex-direction: column; }
  html.phone #mapbox.replaying #map { flex: 1; min-height: 0; }
  html.phone #replay-sheet { position: static; flex: none; max-height: 45%; margin: 0; border-radius: 10px 10px 0 0; }
  html.phone #replay-sheet.logbook { width: auto; height: auto; max-height: 50%; }
  /* the chart's floating cards: the legend folds to its title (a tap opens it); the ship list sits under it */
  html.phone #legend { top: calc(var(--hdr-h, 46px) + 8px); bottom: auto; left: 8px; width: auto;
    max-width: calc(100vw - 70px); box-sizing: border-box; cursor: pointer; font-size: 12px; }
  html.phone #legend:not(.open) > * { display: none; }
  html.phone #legend:not(.open)::before { content: "Chart legend ▸"; border: none; margin: 0; padding: 0; }
  html.phone #shiplist { top: 44px; left: 8px; }
  /* a phone held sideways (html.landscape): the panel is a side sheet from the right; closed (peek) is its tab strip,
     open (half or full) about 42 % of the width; the replay's log sheet likewise. The header stays one line. */
  html.phone.landscape #panel { top: var(--hdr-h, 40px); right: 0; bottom: 0; left: auto; width: 42vw; height: auto;
    flex-direction: column; padding-left: 14px; border-top: none; border-left: 4px double var(--rule);
    border-radius: 10px 0 0 10px; box-shadow: -4px 0 14px #0003; transition: width .18s ease; }
  html.phone.landscape #panel.sheet-half, html.phone.landscape #panel.sheet-full { height: auto; width: 42vw; }
  html.phone.landscape #panel.sheet-peek { width: 52px; height: auto; }
  html.phone.landscape #sheet-handle { position: absolute; left: 0; top: 0; bottom: 0; width: 14px; height: auto; }
  html.phone.landscape #sheet-handle span { width: 5px; height: 46px; }
  html.phone.landscape #panel-tabs { top: 0; }
  html.phone.landscape #panel.sheet-peek #panel-tabs, html.phone.landscape #panel.sheet-peek #console-tabs {
    flex-direction: column; border-bottom: none; overflow: hidden; }
  html.phone.landscape #panel.sheet-peek #panel-tabs button, html.phone.landscape #panel.sheet-peek #console-tabs button {
    writing-mode: vertical-rl; flex: none; padding: 12px 0; border-right: none; border-bottom: 1px solid var(--rule-soft); }
  html.phone.landscape #panel.sheet-peek #sheet-peek { display: none; }
  html.phone.landscape #mapctrls { right: 66px; }
  html.phone.landscape #wrap.replaying #mapctrls { right: calc(42vw + 14px); }
  html.phone.landscape #wrap.replaying #replay-banner { left: calc((100% - 42vw) / 2); }
  html.phone.landscape #wrap { flex-direction: row; }
  html.phone.landscape #mapbox.replaying { flex-direction: row; }
  html.phone.landscape #replay-sheet { width: 42vw; max-height: none; box-sizing: border-box; overflow: hidden;
    border-radius: 10px 0 0 10px; }
  html.phone.landscape #replay-sheet .rs-list { flex: 1; min-height: 0; }
  html.phone.landscape #replay-sheet.logbook { width: 42vw; max-height: none; }
  /* forms and pop-ups: the whole width of the screen, and never under the on-screen keyboard (--kb) */
  html.phone .overlay-box, html.phone #fb-modal .overlay-box, html.phone #rm-panel .overlay-box,
  html.phone #return-letter .rl-box { width: 100% !important; max-width: none !important; box-sizing: border-box;
    max-height: calc(100% - var(--kb, 0px)); border-left: none; border-right: none; }
  /* ── The public roadmap (dispatch-roadmap-page): a view of this page at /roadmap ── */
  /* phone-layout part 3: on a phone the header is part 1's (brand, "Roadmap", Feedback, ☰ with Back to the game and
     the sign-in line), and the intro folds to its first paragraph */
  html.phone.view-roadmap header { flex-wrap: nowrap; gap: 8px; padding: 6px 8px 5px 10px; }
  html.phone.view-roadmap header h1 { font-size: 15px; letter-spacing: 1px; flex-shrink: 0; }
  html.phone.view-roadmap header .rm-label { font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.phone.view-roadmap #hdr-menu #whoami { display: block; }
  html.phone .rm-intro:not(.open) .rm-intro-rest { display: none; }
  html.phone .rm-intro.open [data-rm-more] { display: none; }
  .rm-more { color: #8a6508; font-style: italic; white-space: nowrap; }
  html:not(.view-roadmap) .rm-only { display: none !important; }
  html.view-roadmap .game-only, html.view-roadmap #wrap, html.view-roadmap #legend,
  html.view-roadmap #pending-banner { display: none !important; }
  header .rm-label { font-style: italic; font-size: 15px; }
  #roadmap { padding: 14px 18px 30px; }
  .rm-intro h2 { font-variant: small-caps; letter-spacing: 2px; font-size: 18px; margin: 0 0 6px; }
  .rm-intro p { font-size: 15px; line-height: 1.5; margin: 0 0 6px; }
  .rm-tabs { display: none; }
  .rm-board { display: grid; grid-template-columns: 1fr .85fr 1.25fr .85fr; gap: 16px; align-items: start; margin-top: 14px; }
  .rm-col { border: 1px solid var(--rule-soft); background: #f6eedb99; padding: 8px 8px 10px; }
  .rm-col h3 { font-variant: small-caps; letter-spacing: 2px; font-size: 17px; margin: 0 0 6px;
               border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
  .rm-compact { border: 1px solid var(--rule-soft); background: #fbf6ea; padding: 3px 10px; margin: 5px 0;
                font-weight: bold; font-size: 14px; }
  .rm-card { border: 1px solid var(--rule-soft); background: #fbf6ea; padding: 7px 10px 8px; margin: 7px 0;
             font-size: 13.5px; line-height: 1.4; }
  .rm-clickable { cursor: pointer; }
  .rm-clickable:hover { background: #fffbe8; }
  .rm-card.rm-picked { border-color: var(--brass); box-shadow: inset 4px 0 0 var(--brass); }
  .rm-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .rm-card-h b { font-size: 14.5px; }
  .rm-details { color: #8a6a10; font-size: 12.5px; white-space: nowrap; }
  .rm-inv { font-size: 12px; color: #6b5a3a; margin-top: 3px; }
  .rm-inv-k { font-variant: small-caps; letter-spacing: .5px; color: var(--ink); margin-right: 3px; }
  .rm-pick-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
  .rm-pick { font-family: inherit; font-size: 13px; padding: 3px 10px; background: #efe5cc; color: var(--ink);
             border: 1px solid var(--rule); border-radius: 2px; cursor: pointer; text-decoration: none; }
  .rm-pick:hover { background: #fbf3de; }
  .rm-pick.on { background: var(--brass); color: #fffbe8; border-color: #8a6508; }
  .rm-count { font-size: 12.5px; color: #6b5a3a; }
  .rm-note { font-style: italic; font-size: 12.5px; color: #6b5a3a; margin: 0 0 8px; line-height: 1.35; }
  .rm-pickbox { background: #f6e7bf; border: 1px solid #d9c48a; padding: 7px 9px; font-size: 12.5px;
                line-height: 1.45; margin-bottom: 8px; }
  .rm-pickbox b { color: #8a6508; }
  .rm-group-h { font-variant: small-caps; letter-spacing: 1.5px; font-size: 13px; color: #5a4a2e; margin: 10px 0 2px; }
  .rm-msg { color: #c62828; font-size: 13px; margin: 6px 0; }
  #rm-panel .overlay-box { width: min(620px, 92vw); max-width: 620px; position: relative; }
  #rm-panel .rm-place { display: inline-block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
                        border: 1px solid var(--rule); padding: 0 5px; color: #6b5a3a; }
  #rm-panel h2 { font-variant: small-caps; letter-spacing: 1.5px; margin: 4px 0 6px; font-size: 22px; }
  #rm-panel h3 { font-variant: small-caps; letter-spacing: 1px; font-size: 15px; border-bottom: 1px solid var(--rule);
                 margin: 12px 0 4px; }
  #rm-panel p { font-size: 14.5px; line-height: 1.5; margin: 0 0 6px; }
  #rm-panel ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
  #rm-panel .rm-x { position: absolute; top: 6px; right: 10px; background: none; border: 0; font-size: 20px;
                    cursor: pointer; color: var(--ink); }
  @media (max-width: 899px) {
    html.view-roadmap header { flex-wrap: wrap; gap: 8px 12px; padding: 8px 16px 7px; }
    html.view-roadmap header h1 { font-size: 18px; letter-spacing: 2px; }
    html.view-roadmap #whoami { display: none; }
    #roadmap { padding: 10px 16px 24px; }
    .rm-tabs { display: flex; gap: 6px; margin: 12px 0 8px; }
    .rm-tabs button { flex: 1 1 0; min-width: 0; font-family: inherit; font-variant: small-caps; font-size: 12px;
                      padding: 5px 2px; background: var(--paper); color: var(--ink); border: 1px solid var(--rule);
                      border-radius: 2px; cursor: pointer; }
    .rm-tabs button.on { background: #e3cf98; }
    .rm-board { display: block; margin-top: 0; }
    .rm-col { display: none; }
    .rm-col.active { display: block; }
  }

  /* ── founding (web/js/founding.js): the Actions section, and the map's candidate sites ── */
  .fd-card.fd-off { opacity: .6; }
  .fd-card { margin: 8px 0; padding: 8px; border: 1px solid rgba(128,128,128,.3); border-radius: 6px; }
  .fd-h { font-weight: bold; margin-bottom: 4px; }
  .fd-hints { font-size: 12px; margin: 2px 0 6px; }
  .fd-blocked { opacity: .6; }
  .fd-end-warn { cursor: help; }
  /* discovery naming: quiet labels on charted features — ship-label size, italic, muted, no symbol */
  #feature-layer text.feat-label { font-size: 12.5px; font-style: italic; fill: #7d6e52; opacity: .85; pointer-events: none; paint-order: stroke; stroke: #f0e6cdbb; stroke-width: 3px; }
  #feature-layer text.feat-named { fill: #5a4a2e; opacity: 1; }
  #discovery-hl polygon.dc-hl { fill: rgba(184,134,11,.28); stroke: #d9a441; stroke-width: 1.5; pointer-events: none; }   /* #123 */
  #found-layer polygon { stroke-width: 2; }
  #found-layer polygon.found-ok { fill: rgba(184,134,11,.18); stroke: #d9a441; cursor: pointer; }
  #found-layer polygon.found-ok.found-chosen { fill: rgba(184,134,11,.45); }
  #found-layer polygon.found-ok.found-reopen { cursor: default; stroke-dasharray: 4 3; }
  #found-layer polygon.found-blocked { fill: rgba(60,60,60,.3); stroke: none; pointer-events: none; }
  /* captain travel: a traveller (a small boat on water, a figure on land), her course, the route being plotted, the land hint */
  #travel-layer { pointer-events: none; }
  /* small-fixes-14 (1b): the layer lets every click through, so a traveller's marker took none; where its door is open
     (travel.js adds .ct-door) the figure and its name take the click. The course, the plotted route and the arrows stay as they are. */
  #travel-layer .ct-traveller.ct-door .ct-hit { fill: transparent; stroke: none; pointer-events: all; }
  #travel-layer .ct-traveller.ct-door .ct-mark, #travel-layer .ct-traveller.ct-door .ct-label { pointer-events: visiblePainted; }
  #travel-layer .ct-mark { fill: #fffaf0; stroke: #4a3a22; stroke-width: 1.4; }
  #travel-layer .ct-traveller.own .ct-mark { fill: var(--brass, #b8860b); stroke: #1c1610; }
  #travel-layer .ct-traveller.foot path.ct-mark { fill: none; stroke-width: 1.8; }
  #travel-layer .ct-traveller.own.foot path.ct-mark { stroke: #1c1610; }
  #travel-layer polyline.ct-course { fill: none; stroke: #8a6a2a; stroke-width: 2; stroke-dasharray: 2 4; }
  #travel-layer polyline.ct-draft { fill: none; stroke: var(--brass, #b8860b); stroke-width: 3; stroke-dasharray: 6 4; }
  /* the bearing (signs of life, land): one look — a two-tone needle, 80% opaque, dark half tinted by kind, a mark at its tip.
     Order routes keep their own dashed lines; nothing here is dashed. */
  .bearing { opacity: .8; --bt: #2f7a3f; }
  .bearing-people { --bt: #8c3b22; }
  .bearing .bn-light { fill: #f6efdc; stroke: var(--bt); stroke-width: 1; stroke-linejoin: round; }
  .bearing .bn-dark { fill: var(--bt); stroke: var(--bt); stroke-width: 1; stroke-linejoin: round; }
  .bearing .bearing-mark path, .bearing .bearing-mark rect { fill: var(--bt); stroke: #f6efdc; stroke-width: 1.2; stroke-linejoin: round; paint-order: stroke; }
  .bearing .bearing-mark .bm-smoke { fill: none; stroke: var(--bt); stroke-width: 1.6; stroke-linecap: round; paint-order: normal; }
  .lg-bearing { width: 52px; height: 17px; vertical-align: -3px; }
  /* exploration 1: the Exploring box — one build per line */
  .ex-box .ex-opt { display: block; margin: 3px 0; }
  .ct-card .ct-where { margin-bottom: 4px; }
  .ct-card .ct-hint { color: #2d6a8a; margin: 4px 0; }
  .ct-card .ct-dir { margin-top: 8px; }
  .ct-card .ct-plot-n { margin: 4px 0; font-weight: bold; }

/* small-fixes-10 #136: the recipient field's suggestions sit under it */
.recip-wrap { display: inline-block; }
.recip-sug { display: block; margin-top: 2px; }
.recip-sug .recip-pick { margin: 1px 3px 1px 0; }
  /* reset-4: the start-type choice on the sign-up and embark forms (two cards, stacked; whole card is the target) */
  .start-types { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
  .start-type { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--rule-soft);
                border-radius: 4px; background: var(--paper); cursor: pointer; }
  .start-type.on { border-color: var(--ink-nav); background: var(--paper2); box-shadow: inset 3px 0 0 var(--ink-nav); }
  .start-type input { margin-top: 3px; flex: none; }
  .start-type-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .start-type-text { font-size: 12.5px; line-height: 1.4; }
  /* dispatch-landing: while the landing shows (html.landing, load.js unchartedSync) the chart's controls and its legend (on a phone,
     its button) are put away; they come back the moment she signs in. Last in the file, so it outranks the phone legend's own rules. */
  html.landing #mapctrls, html.landing #legend { display: none; }
