  :root {
    color-scheme: dark;
    --bg: #05060a; --panel: #0b0e17; --line: #1c2333;
    --ink: #9fb3c8; --dim: #5c6b80; --hi: #4be08a; --warn: #e05a4b; --caution: #e0b44b; --ally: #4ba8e0;
    /* The brighter tint of the accent, for the one headline on a screen. */
    --hi-bright: #e9fff0;
    /* The colour the night is painted in, on top of whatever is under it. */
    --night: #04060d;
    /* The two faces (DESIGN.md, issue #211): IBM Plex Mono carries everything
       that is read - running text, labels, tables. VT323 is the display face
       and belongs to moment headlines and big numbers only, never to
       paragraphs or tables. Both are loaded from Google Fonts in
       index.html; both fall back to the stack the terminal used before. */
    --font-body: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --font-display: "VT323", "IBM Plex Mono", ui-monospace, monospace;
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    margin: 0; padding: 16px 12px; background: var(--bg); color: var(--ink);
    font: 13px/1.6 var(--font-body);
  }
  main { max-width: none; margin: 0; }
  .topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
  .topbar > div { min-width: 0; }
  /* Profile menu (issue #297): initials in a circle, top right. */
  #profile { position: relative; flex: 0 0 auto; }
  #profile-btn {
    width: 38px; height: 38px; padding: 0; border-radius: 50%;
    border: 1px solid #23402f; color: var(--hi); background: var(--panel);
    font-family: var(--font-body); font-weight: 700;
  }
  #profile-btn:focus-visible, #profile-menu :focus-visible { outline: 2px solid var(--hi); outline-offset: 1px; }
  #profile-menu {
    position: absolute; right: 0; top: 44px; z-index: 50;
    width: 240px; max-width: calc(100vw - 24px);
    background: var(--panel); border: 1px solid var(--line);
    box-shadow: 0 6px 24px #000c; padding: 6px 0;
  }
  #profile-menu[hidden] { display: none; }
  #profile-who { padding: 4px 12px; color: var(--hi-bright); font-weight: 700; overflow-wrap: anywhere; }
  #profile-money { padding: 0 12px 6px; color: var(--dim); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  #profile-menu a, #profile-menu button {
    display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0;
    background: none; color: var(--ink); text-decoration: none; font: inherit; cursor: pointer;
  }
  #profile-menu a:hover, #profile-menu button:hover { background: #121826; color: var(--hi); }
  /* Profile page (issue #303): everything else in the terminal steps aside. */
  #terminal.on-profile > :not(#profile-page) { display: none; }
  #profile-page.hidden { display: none; }
  #profile-facts th { text-align: left; color: var(--dim); font-weight: 400; padding-right: 16px; white-space: nowrap; }
  #profile-facts td { overflow-wrap: anywhere; }
  #profile-page .swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }
  #key-list { overflow-x: auto; }
  #profile-menu #logout { color: var(--warn); border-top: 1px solid var(--line); margin-top: 4px; }
  #fullscreen, #notify { flex: 0 0 auto; width: auto; margin-top: 2px; }
  /* On a phone the top bar wraps: its row of links is one line of a thousand
     pixels otherwise, and a page wider than the screen makes the browser
     widen the layout viewport - and every board over the page with it. */
  @media (max-width: 760px) {
    .topbar { flex-wrap: wrap; }
    .topbar > div:last-child { flex: 1 1 100% !important; flex-wrap: wrap; min-width: 0; }
  }
  /* The toggle is a switch, not a command, and it is never the accent colour
     while it is off. */
  #notify[data-on="yes"] { color: var(--hi); border-color: #23402f; }
  #notify[data-on="no"] { color: var(--dim); border-color: var(--line); }
  h1 { font-size: 18px; letter-spacing: .4em; color: var(--hi); margin: 0 0 4px; }
  h1 a { color: inherit; text-decoration: none; cursor: pointer; }
  h2 { font-size: 12px; letter-spacing: .3em; color: var(--dim); margin: 24px 0 8px;
       text-transform: uppercase; }
  .sub { color: var(--dim); margin: 0 0 24px; }
  /* The display face's two allowed uses (DESIGN.md): the headline of a moment
     and a big number. The only places VT323 may appear - paragraphs and
     tables stay on --font-body. Sizes and line-heights are DESIGN.md's
     display and numeral tokens; colour and glow stay with the component
     that owns the moment (see #squad-view-title). */
  .moment { font-family: var(--font-display); font-size: 34px; line-height: 1.1; }
  .numeral { font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
  section { border: 1px solid var(--line); background: var(--panel); padding: 16px; }
  .grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
  @media (min-width: 760px) { .grid { grid-template-columns: 1fr 1fr; } }
  /* Wide screens: the world map is the big central element (at least ~65%
     of the width, nearly the viewport height); the panels live in a
     scrollable side column. Below 1100 px everything stacks as before. */
  .layout { display: block; }
  /* One column no wider than the side itself: without minmax(0, 1fr) the
     implicit column grows to the widest table (the personnel table, about
     480 px), which scrolled a phone sideways and cut the Freeze / Send
     buttons off at 1280 px (#399). A table wider than its panel scrolls
     inside the panel instead. */
  .side { display: grid; gap: 16px; align-content: start;
          grid-template-columns: minmax(0, 1fr); }
  .side > * { min-width: 0; }
  .side section { overflow-x: auto; }
  @media (min-width: 1100px) {
    .layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 33%);
              gap: 16px; align-items: start; }
    .side { max-height: calc(100vh - 140px); overflow-y: auto; }
    .side .grid { grid-template-columns: 1fr; }
    .map-panel { position: sticky; top: 0; }
    #map-wrap, #zmap-wrap { height: calc(100vh - 260px); min-height: 420px; }
    .map-panel #map { width: 100%; height: 100%; }
  }
  label { display: block; color: var(--dim); margin-bottom: 4px; }
  input, select, button {
    font: inherit; background: #070910; color: var(--ink);
    border: 1px solid var(--line); padding: 7px 9px; width: 100%;
  }
  button { cursor: pointer; color: var(--hi); border-color: #23402f; }
  button:hover:not(:disabled) { background: #0d1a13; }
  button:disabled { color: var(--dim); cursor: not-allowed; border-color: var(--line); }
  /* The one action in the terminal that cannot be taken back for hours. */
  button.danger { color: var(--warn); border-color: #4a211c; }
  button.danger:hover:not(:disabled) { background: #170b09; }
  /* A corporation's colour, as the map draws it. */
  .swatch { display: inline-block; width: 8px; height: 8px; margin-right: 6px;
            vertical-align: baseline; border: 1px solid var(--line); }
  .row { display: flex; gap: 8px; align-items: end; margin-bottom: 8px; }
  .row > * { flex: 1; }
  .row > button { flex: 0 0 auto; width: auto; }
  table { width: 100%; border-collapse: collapse; }
  th { text-align: left; color: var(--dim); font-weight: normal; padding: 4px 8px 4px 0;
       border-bottom: 1px solid var(--line); text-transform: uppercase; font-size: 11px;
       letter-spacing: .1em; }
  td { padding: 5px 8px 5px 0; border-bottom: 1px solid #10141f; }
  .money { color: var(--hi); }
  .dead { color: var(--warn); }
  .squad { color: var(--hi); }
  .msg { margin-top: 12px; padding: 8px 10px; border-left: 2px solid var(--hi);
         background: #08110c; white-space: pre-wrap; }
  .msg.bad { border-color: var(--warn); background: #140a09; color: #e8a49b; }
  .hidden { display: none; }

  /* The world. Flat fills and a thin coastline, after the original's map
     screen - no gradients, no shadows, no relief. The whole palette is dark,
     because the night now covers half of it and a day side bright enough to
     notice would leave the marked territories shouting on one side of the world
     and whispering on the other. The steps between the three fills are the same
     size as they were, so the map reads the same as it did, only quieter. */
  #map-wrap { border: 1px solid var(--line); background: #02030a; overflow: hidden; }
  #map { display: block; width: 100%; height: auto; }
  #map path {
    fill: #0a0e16; stroke: #08131b; stroke-width: .4;
    transition: fill .15s;
  }
  /* A country nobody has written a mission for: present, but not a target. */
  #map path.unplayable { fill: #0a0d13; }
  #map path.playable { fill: #1a2b3a; cursor: pointer; }
  #map path.playable:hover { fill: #27404f; }
  /* A holding is the loudest thing on the map, which it should be - it is
     somebody's territory. Held down just enough that it does not outshine the
     outline that says whose it is. */
  #map path.held { cursor: pointer; fill-opacity: .8; }
  #map path.mine { stroke: var(--hi); stroke-width: .9; }
  /* Held by a member of our own alliance: a solid outline is taken by our own
     territory, so this one is dashed - readable at map scale, and still an
     outline rather than a fill, which is what a holding is drawn with. */
  #map path.ally { stroke: var(--ally); stroke-width: .9; stroke-dasharray: 3 2; }
  /* Ownership by pattern and glyph as well as colour (issue #210). A free
     district gets a dotted outline; the fills are SVG patterns, set from
     terminal.js. */
  #map path.own-free { stroke: #9fb3c8; stroke-width: .5; stroke-dasharray: .05 .9;
                       stroke-linecap: round; }
  #map .owner-glyph { pointer-events: none; paint-order: stroke; stroke: #02030a;
                      stroke-width: .5; fill: #e6eef6; }
  #map .owner-glyph.own { fill: var(--hi); }
  #map .owner-glyph.gang { fill: var(--warn); }
  #map .owner-glyph.ally { fill: var(--ally); }
  .owner-key svg { vertical-align: -2px; }
  #map path.selected { stroke: #fff; stroke-width: 1.2; }
  /* Office-capable buildings (plans/gameplay.md section 5): a diamond per
     building at its district's label. A building no corporation holds is
     hollow - a bright outline, nothing in it - so a district with a hollow
     diamond has a free office, and one whose diamonds are all filled has
     none (issue #264): amber a gang's, pale a free one, an office filled
     in its owner's colour, ours outlined. */
  #map .office { stroke: #000; stroke-width: .15; cursor: pointer; }
  #map .office.gang { fill: none; stroke: #e8a23c; stroke-width: .3; }
  #map .office.free { fill: none; stroke: #d8d8d8; stroke-width: .3; }
  #map .office.mine { stroke: #fff; stroke-width: .3; }
  /* Our heat in a district (plans/gameplay.md 10.3): a red glow at its label,
     stronger the hotter it is. Clicks go through it to the district. */
  #map .heat { fill: #ff3b2f; pointer-events: none; }
  #map path.contested { animation: contested 1.1s steps(2, end) infinite; }
  @keyframes contested { 50% { stroke: var(--warn); stroke-width: 1.6; } }
  /* The owner has opened the territory: the outline warns, the fill still
     says who holds it. */
  #map path.warzone { stroke: #e33; stroke-width: 2px; stroke-dasharray: 4 3; }
  /* A rival has declared against this territory but nobody has gone yet. */
  #map path.threatened { animation: threatened 1.6s steps(2, end) infinite; }
  @keyframes threatened { 50% { stroke: #e8a23c; stroke-width: 1.4; } }
  /* A co-op match is running on this territory: the outline pulses, the fill
     keeps saying who holds it. */
  #map path.live { stroke: #00e5ff; stroke-width: 2px;
                   animation: livepulse 2s ease-in-out infinite; }
  @keyframes livepulse { 50% { stroke-opacity: .3; } }
  /* A match is in progress on this territory (issue #272): the outline blinks
     in the warning red - click it to list the matches and watch one. */
  #map path.watch { stroke: #ff4d6d; stroke-width: 2.4px; cursor: pointer;
                    animation: watchblink 1s steps(2, end) infinite; }
  @keyframes watchblink { 50% { stroke-opacity: 0; } }
  #live-matches { margin-top: 10px; }
  #live-matches h3 { font-size: 11px; letter-spacing: .3em; font-weight: normal;
                     color: var(--dim); text-transform: uppercase; margin: 0 0 6px; }
  #live-list .live-row { display: flex; gap: 12px; align-items: center; padding: 4px 0;
                         border-bottom: 1px solid #1b2a33; flex-wrap: wrap; }
  #live-list .live-row .who { flex: 1 1 220px; min-width: 0; }
  #live-list .live-row .time { color: var(--dim); font-variant-numeric: tabular-nums; }
  #live-list .live-row button { width: auto; }
  #live-filter { color: var(--dim); margin-bottom: 4px; }
  #live-filter button { width: auto; margin-left: 8px; }
  /* The territory a mission was just played on. The stroke pulses a few times
     and then settles on the ordinary 'selected' outline - enough to be found
     on a map of a hundred and seventy-seven countries, not enough to keep
     blinking for the rest of the session. */
  #map path.recent { animation: recent 1.5s ease-in-out 4; }
  @keyframes recent { 50% { stroke: var(--hi); stroke-width: 2.4; } }
  /* The district a first-job offer points at (issue #208, DESIGN.md "District
     map"): it pulses slowly until the office is taken. The corporation's own
     green, slower than the co-op pulse, and the card names the place too -
     no state is carried by colour alone. */
  #map path.job { stroke: var(--hi); stroke-width: 2px;
                  animation: jobpulse 3.2s ease-in-out infinite; }
  @keyframes jobpulse { 50% { stroke-opacity: .3; } }

  /* The dark half of the world, over the countries and under nothing else. It
     must not swallow a click meant for the country beneath it, and its paths
     are stroked in the fill colour as well as filled: stacked shapes that abut
     leave a hairline of show-through where the anti-aliasing does not quite
     meet, and the stroke of the one on top covers it. */
  #night { pointer-events: none; }
  #map #night path { fill: var(--night); stroke: var(--night); stroke-width: 1; }

  /* The zoom map (static/zoommap.js). Strokes keep their width on screen
     whatever the zoom; the roads are the one thing drawn in metres. */
  #zmap-wrap { border: 1px solid var(--line); background: #02030a; overflow: hidden;
               position: relative; height: 62vh; min-height: 320px; }
  #zmap { display: block; width: 100%; height: 100%; touch-action: none;
          cursor: grab; user-select: none; }
  #zmap:active { cursor: grabbing; }
  #zmap path, #zmap polygon, #zmap rect, #zmap line, #zmap circle {
    vector-effect: non-scaling-stroke; }
  #zmap .zm-land { fill: #0a0e16; stroke: #1b2a38; stroke-width: .7; }
  #zmap .zm-land.context { fill: #070a10; stroke: #111a24; }
  #zmap .zm-land.playable { fill: #1a2b3a; cursor: pointer; }
  #zmap .zm-land.unplayable { cursor: pointer; }
  #zmap .zm-land.held { fill-opacity: .8; }
  #zmap .zm-land:not(.context):hover { stroke: #6d8aa3; }
  #zmap .mine { stroke: var(--hi); stroke-width: 1.4; }
  #zmap .ally { stroke: var(--ally); stroke-width: 1.4; stroke-dasharray: 4 3; }
  #zmap .zm-land.own-free, #zmap .zm-district.own-free, #zmap .zm-square.own-free {
    stroke: #9fb3c8; stroke-width: 1.6; stroke-dasharray: 1 5; stroke-linecap: round; }
  #zmap .zm-label.owner-own { fill: var(--hi); }
  #zmap .zm-label.owner-gang { fill: var(--warn); }
  #zmap .zm-label.owner-ally { fill: var(--ally); }
  #zmap .zm-label.owner-free { fill: #9fb3c8; }
  #zmap .selected { stroke: #fff; stroke-width: 1.8; }
  #zmap .live { stroke: #00e5ff; stroke-width: 1.6; }
  #zmap .zm-heat { fill: #ff3b2f; pointer-events: none; stroke: none; }
  #zmap .zm-district { fill: #1a2b3a; stroke: #4c6378; stroke-width: 1; cursor: pointer; }
  #zmap .zm-district:hover { stroke: #9fb3c8; }
  /* The city grid (#780, #915): one tile per cell of the grid, its fill the
     district's and its holder's, a dashed edge where a corporation's offices
     stand, the squad's square in our highlight, the clicked one white. A
     transit or a skipped square keeps its district's tint, greyed out and
     dimmed; a square of the city no district covers is open ground. */
  #zmap .zm-square { fill: #1a2b3a; stroke: #4c6378; stroke-width: 1; cursor: pointer; }
  #zmap .zm-square:hover { stroke: #9fb3c8; }
  #zmap .zm-square.held { fill-opacity: .8; }
  #zmap .zm-square.has-offices { stroke-dasharray: 5 2; }
  #zmap .zm-square.squad { stroke: var(--hi); stroke-width: 3; }
  #zmap .zm-square.selected { stroke: #fff; stroke-width: 2.5; }
  #zmap .zm-square.zm-open { fill: #10161e; stroke: #26323f; stroke-width: .6; }
  #zmap .zm-square.zm-kind-transit { fill-opacity: .55; stroke: #33424f; }
  #zmap .zm-square.zm-kind-skipped { fill-opacity: .3; stroke: #26303a;
                                     stroke-dasharray: 2 3; }
  #zmap .zm-square.zm-kind-skipped:hover { stroke: #9fb3c8; }
  #zmap .zm-square-office { pointer-events: none; stroke: #02030a; stroke-width: .6; }
  /* What a square is: only readable while a tile is wide enough on screen,
     which the map keeps in data-tiles (zoommap.js). */
  #zmap .zm-square-label { fill: #9fb3c8; text-anchor: middle; pointer-events: none;
                           font-family: inherit; paint-order: stroke; stroke: #02030a; }
  #zmap[data-tiles="small"] .zm-square-label { display: none; }
  #zmap-info .zm-kind.transit, #zmap-info .zm-kind.skipped,
  #zmap-info .zm-kind.uncut { color: var(--dim); }
  #zmap[data-level="1"] #zm-districts, #zmap[data-level="2"] #zm-districts { display: none; }
  #zmap[data-level="4"] .zm-district, #zmap[data-level="4"] .zm-square { fill-opacity: .25; }
  #zmap .zm-ground { fill: #0d121b; stroke: #26303d; stroke-width: 1; }
  #zmap .zm-water { fill: #0b2238; stroke: none; }
  #zmap .zm-road { fill: none; stroke: #1d2531; stroke-linecap: round; stroke-linejoin: round;
                   vector-effect: none; }
  #zmap .zm-building { fill: #2a3442; stroke: #3b4757; stroke-width: .5; }
  #zmap .zm-building.outside { opacity: .35; }
  #zmap .zm-building.office { stroke-width: 1.5; cursor: pointer; }
  #zmap .zm-building.office.gang { fill: #e8a23c; }
  #zmap .zm-building.office.free { fill: #d8d8d8; }
  #zmap .zm-building.office.unlisted { fill: #2a3442; stroke: #8c8ca0; stroke-dasharray: 3 2; }
  #zmap .zm-building.office.mine { fill: var(--hi); stroke: #fff; stroke-width: 2.5; }
  #zmap .zm-outline { fill: none; stroke: #fff; stroke-width: 1.4; stroke-dasharray: 6 4;
                      pointer-events: none; }
  /* A label's halo is as wide as its letters are tall, so zoommap.js sets
     its stroke-width with the font-size, in map units. */
  #zmap .zm-label { fill: var(--ink); paint-order: stroke; stroke: #02030a;
                    pointer-events: none; font-family: inherit; }
  #zmap .zm-label.city, #zmap .zm-label.district { fill: #e6eef6; }
  #zmap .zm-label.people { fill: var(--ally); }
  #zmap .zm-label.trip { fill: #f0d070; }
  #zmap .zm-label.mine { fill: var(--hi); }
  #zmap .zm-label.gang { fill: #e8a23c; }
  #zmap .zm-city { fill: #e6eef6; stroke: #02030a; stroke-width: 1.5; cursor: pointer; }
  #zmap .zm-office { stroke: #000; stroke-width: .8; }
  #zmap .zm-office.mine { fill: var(--hi); }
  #zmap .zm-office.ally { fill: var(--ally); }
  #zmap .zm-office.rival { fill: var(--warn); }
  #zmap .zm-office.gang { fill: #e8a23c; }
  #zmap .zm-office.free { fill: #d8d8d8; }
  #zmap .zm-route { stroke: #f0d070; fill: none; pointer-events: none; }
  #zmap .zm-trip { fill: #f0d070; stroke: #02030a; stroke-width: 1.2; }
  #zmap .zm-pulse { fill: #ff3b2f; fill-opacity: .55; stroke: #ffb0a8; stroke-width: 1;
                    transform-box: fill-box; transform-origin: center;
                    animation: zm-pulse 1.6s ease-out infinite; pointer-events: none; }
  #zmap .zm-pulse.big { fill-opacity: .25; }
  @keyframes zm-pulse { from { transform: scale(.6); opacity: 1; }
                        to { transform: scale(2.2); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { #zmap .zm-pulse { animation: none; } }
  #zmap-credit { position: absolute; right: 6px; bottom: 4px; font-size: 11px;
                 color: var(--dim); pointer-events: none; }
  #zmap-credit a { color: var(--dim); pointer-events: auto; }
  #zmap-bar { display: flex; justify-content: space-between; align-items: center;
              gap: 8px; padding: 0 0 6px; color: var(--dim); }
  #zmap-bar.hidden { display: none; }
  #zmap-bar .zmap-zoom { display: flex; gap: 4px; flex: 0 0 auto; }
  #zmap-bar .zmap-zoom button { width: 28px; padding: 2px 0; }
  button.crumb { width: auto; padding: 1px 6px; border-color: var(--line); color: var(--ally); }
  #zmap-info { padding: 6px 2px 0; }
  #zmap-info .dim, #zmap-info td { color: var(--dim); }
  #zmap-info .zm-match { margin-top: 4px; }
  #zmap-info a.zm-watch { flex: 0 0 auto; color: var(--ally); padding: 7px 9px;
                          border: 1px solid #1d3a4a; }
  #zmap-info .row { margin-top: 6px; margin-bottom: 0; }

  #activity { max-height: 150px; overflow-y: auto; margin-top: 16px;
              border-top: 1px solid var(--line); padding-top: 10px; }
  #activity div { color: var(--dim); padding: 1px 0; }
  #activity div.mine { color: var(--ink); }
  #activity div.bad { color: #e8a49b; }

  /* The press (docs/gameplay.md 9.3): a ticker of what districts saw, newest
     first, and the selected district's own items under the map. */
  #news-ticker { margin-top: 8px; border-top: 1px solid var(--line);
                 padding-top: 6px; overflow: hidden; white-space: nowrap; }
  #news-ticker .label { color: var(--hi); margin-right: 12px; }
  #news-ticker .track { display: inline-block; padding-left: 100%;
                        animation: news-scroll var(--news-time, 60s) linear infinite; }
  #news-ticker:hover .track { animation-play-state: paused; }
  #news-ticker .item { margin-right: 48px; }
  #news-ticker .item.bad, #district-news .bad { color: #e8a49b; }
  @keyframes news-scroll { from { transform: translateX(0); }
                           to { transform: translateX(-100%); } }
  @media (prefers-reduced-motion: reduce) {
    #news-ticker { white-space: normal; }
    #news-ticker .track { animation: none; padding-left: 0; }
    /* The pulse is a slow one kept up until the job is done - too insistent
       a thing for a page that asks for stillness. The outline stays. */
    #map path.job { animation: none; }
    /* A blink is the loud kind of motion: still, it stays a thick red outline. */
    #map path.watch { animation: none; }
  }
  #district-news { margin-top: 10px; color: var(--dim); }
  #district-news h3 { font-size: 11px; letter-spacing: .3em; font-weight: normal;
                      margin: 0 0 4px; }
  #district-news .when { font-size: 11px; margin-right: 8px; }
  .image-good { color: var(--hi); }
  .image-bad { color: var(--warn); }
  #map-label {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 6px 2px 0; color: var(--dim);
  }
  #map-label b { color: var(--ink); font-weight: normal; }

  /* Which build this is. In the footer rather than the topbar because it is
     read, not used, and because the topbar has three things on it already. */
  footer { margin-top: 20px; padding-top: 10px; border-top: 1px solid var(--line); }
  #version-line { display: inline-block; width: auto; padding: 3px 7px;
                  background: none; border-color: var(--line); color: var(--dim);
                  font-size: 11px; letter-spacing: .05em; }
  #version-line:hover { background: var(--panel); color: var(--ink); }

  /* The changelog: a board over the page, drawn like everything else. The
     .hidden rule is repeated with an id so this display:flex does not win. */
  #changelog { position: fixed; inset: 0; z-index: 20; padding: 16px;
               background: #03040ad9; display: flex;
               align-items: center; justify-content: center; }
  #changelog.hidden { display: none; }
  #changelog-box { width: 100%; max-width: 720px; max-height: 80vh; overflow-y: auto;
                   background: var(--panel); border: 1px solid var(--line);
                   padding: 16px; }
  #changelog-box h2 { margin-top: 0; }
  #changelog-box p { color: var(--dim); margin: 0 0 12px; }
  .change { display: flex; gap: 8px; align-items: baseline;
            padding: 5px 0; border-bottom: 1px solid #10141f; }
  .change .when { flex: 0 0 84px; color: var(--dim); font-size: 11px; }
  .change .what { flex: 1 1 auto; min-width: 0; }
  .change .who { flex: 0 0 auto; color: var(--dim); font-size: 11px; }
  /* Which of the two repositories a change came from. The tag is the only
     thing on the line that says whether it is the engine or this page. */
  .tag { flex: 0 0 auto; font-size: 10px; letter-spacing: .1em;
         text-transform: uppercase; padding: 1px 4px;
         border: 1px solid var(--line); color: var(--dim); }
  .tag.game { color: var(--ally); border-color: #1d3a4a; }
  .tag.terminal { color: var(--hi); border-color: #23402f; }

  /* A job accepted on a phone (issue #212): one line at the top of the page
     with the launch, square, in the console green. */
  #accepted-job {
    display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
    justify-content: space-between; margin: 0 0 12px; padding: 8px 12px;
    background: var(--panel); border: 1px solid var(--hi); border-radius: 0;
    color: var(--hi); letter-spacing: .12em; text-transform: uppercase;
  }
  #accepted-job.hidden { display: none; }
  #accepted-job button { border-radius: 0; letter-spacing: .12em; }

  /* An attacked office (issue #326): the alert, in the warning colour, with the
     Defend button. */
  #defence-alerts { margin: 0 0 12px; padding: 8px 12px; background: #1a0b0b;
    border: 1px solid var(--warn); border-radius: 0; color: var(--warn); }
  #defence-alerts.hidden { display: none; }
  #defence-alerts .row { align-items: center; margin: 4px 0; }
  #defence-alerts button { border-radius: 0; letter-spacing: .12em; text-transform: uppercase; }

  /* While you were away and Coming up (issue #311): short lists of lines, each
     a link to where to act. */
  #away, #hooks { margin: 0 0 12px; }
  #away.hidden, #hooks.hidden { display: none; }
  #away ul, #hooks ul { list-style: none; margin: 0 0 8px; padding: 0; }
  #away li, #hooks li { padding: 4px 0; border-bottom: 1px solid #10141f; }
  #away li a, #hooks li a { color: var(--hi); text-decoration: none; }
  #away li a:hover, #hooks li a:hover { text-decoration: underline; }
  #away .when, #hooks .when { color: var(--dim); font-size: .85em; margin-left: 6px; }
  #away-span { color: var(--dim); letter-spacing: normal; text-transform: none; }

  /* The job card (issue #208): one district is named, and it is the one
     line this screen spends its glow on. [ LAUNCH ] is the button-primary
     of the moment: the accent under the finger, not a hairline away. */
  #job #job-district { color: var(--hi-bright); text-shadow: 0 0 8px var(--hi); }
  #job-reward { color: var(--dim); }
  #job-launch {
    width: auto; margin-top: 10px; background: var(--hi); color: var(--bg);
    border-color: var(--hi); text-transform: uppercase; letter-spacing: .1em;
  }
  #job-launch:hover:not(:disabled) {
    background: var(--hi-bright); border-color: var(--hi-bright);
  }

  /* A transmission (DESIGN.md): a panel that interrupts the terminal with one
     action. Square corners, the corporation's accent, and the glow on the
     sender line alone - it is the one headline that matters while it is up.
     Anchored to the bottom so it reads as sliding in under the page, over a
     dimmed world rather than replacing it. */
  #transmission {
    position: fixed; inset: 0; z-index: 30; padding: 16px;
    display: flex; align-items: flex-end; justify-content: center;
    background: #03040a99; outline: none;
  }
  #transmission.hidden { display: none; }
  #transmission-panel {
    width: 100%; max-width: 640px;
    background: var(--panel); border: 1px solid var(--line);
    border-left: 2px solid var(--hi); padding: 16px;
    animation: transmission-in .22s ease-out;
  }
  @keyframes transmission-in { from { transform: translateY(12px); opacity: 0; } }
  #transmission-sender {
    color: var(--hi); font-size: 12px; letter-spacing: .3em;
    text-transform: uppercase; text-shadow: 0 0 8px var(--hi);
    margin-bottom: 10px;
  }
  #transmission-body {
    margin: 0 0 16px; color: var(--ink); white-space: pre-wrap;
    min-height: 1.6em;
  }
  #transmission-cursor { color: var(--hi); margin-left: 1px; }
  #transmission-body:not(.typing) #transmission-cursor { display: none; }
  #transmission-body.typing #transmission-cursor {
    animation: transmission-blink 1s steps(2, start) infinite;
  }
  @keyframes transmission-blink { 50% { opacity: 0; } }
  #transmission-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  #transmission-actions button { width: auto; text-transform: uppercase;
                                 letter-spacing: .1em; }
  #transmission-primary {
    background: var(--hi); color: var(--bg); border-color: var(--hi);
  }
  #transmission-primary:hover:not(:disabled) {
    background: var(--hi-bright); border-color: var(--hi-bright);
  }
  #transmission-secondary {
    background: transparent; color: var(--hi); border: 1px solid var(--hi);
  }
  #transmission-secondary:hover:not(:disabled) { background: #0d1a13; }
  @media (prefers-reduced-motion: reduce) {
    #transmission-panel { animation: none; }
    #transmission-body.typing #transmission-cursor { animation: none; }
  }

  /* The squad view (issue #207): the four awake agents a new corporation
     starts with, shown once from the welcome transmission. It is a board over
     the page like the changelog, but centred and read-only: there is nothing
     to set up before the first job. */
  #squad-view {
    position: fixed; inset: 0; z-index: 31; padding: 16px;
    display: flex; align-items: center; justify-content: center;
    background: #03040ad9; outline: none;
  }
  #squad-view.hidden { display: none; }
  #squad-view-panel {
    width: 100%; max-width: 720px; max-height: 80vh; overflow-y: auto;
    background: var(--panel); border: 1px solid var(--line); padding: 16px;
    animation: transmission-in .22s ease-out;
  }
  #squad-view-kicker {
    color: var(--hi); font-size: 12px; letter-spacing: .3em;
    text-transform: uppercase;
  }
  #squad-view-title {
    font-family: var(--font-display);
    margin: 4px 0 16px; font-size: 18px; letter-spacing: .4em;
    color: var(--hi-bright); text-shadow: 0 0 8px var(--hi);
  }
  #squad-view-agents {
    display: grid; gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  @media (max-width: 560px) {
    #squad-view-agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  .squad-agent {
    display: grid; gap: 6px; justify-items: center; min-width: 0;
    border: 1px solid var(--line); padding: 10px 8px;
  }
  .squad-portrait {
    width: 64px; height: 64px; image-rendering: pixelated;
    border: 1px solid var(--line); background: #070910;
  }
  .squad-agent-name {
    color: var(--hi); text-transform: uppercase; letter-spacing: .15em;
    overflow-wrap: anywhere; text-align: center;
  }
  .squad-agent-weapons {
    display: grid; gap: 2px; color: var(--dim); font-size: 11px;
    text-align: center;
  }
  #squad-view-actions { margin-top: 16px; display: flex; justify-content: flex-end; }
  #squad-view-actions button {
    width: auto; text-transform: uppercase; letter-spacing: .1em;
    background: var(--hi); color: var(--bg); border-color: var(--hi);
  }
  #squad-view-actions button:hover:not(:disabled) {
    background: var(--hi-bright); border-color: var(--hi-bright);
  }
  @media (prefers-reduced-motion: reduce) {
    #squad-view-panel { animation: none; }
  }

/* The squad-elsewhere dialog (issue #293): a board over the page like the
   squad view, with its buttons stacked so it holds at phone width. */
#squad-travel {
  position: fixed; inset: 0; z-index: 32; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: #03040ad9;
}
#squad-travel.hidden { display: none; }
#squad-travel-panel {
  width: 100%; max-width: 560px; max-height: 80vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); padding: 16px;
}
#squad-travel-title {
  font-family: var(--font-display); margin: 0 0 12px; font-size: 16px;
  letter-spacing: .3em; color: var(--hi-bright); text-shadow: 0 0 8px var(--hi);
  overflow-wrap: anywhere;
}
#squad-travel-away { margin: 0 0 12px; padding-left: 18px; }
#squad-travel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#squad-travel-actions button { width: auto; flex: 1 1 220px; }
#squad-travel-actions button[hidden] { display: none; }

#offline-ai-row { display: block; }
#offline-ai-row.hidden { display: none; }

/* The Defend dialog (issue #326), like the squad-elsewhere one. */
#defend {
  position: fixed; inset: 0; z-index: 33; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: #03040ad9;
}
#defend.hidden { display: none; }
#defend-panel {
  width: 100%; max-width: 600px; max-height: 85vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--warn); padding: 16px;
}
#defend-title {
  font-family: var(--font-display); margin: 0 0 8px; font-size: 16px;
  letter-spacing: .3em; color: var(--warn); overflow-wrap: anywhere;
}
#defend .hidden { display: none; }
#defend h3 { margin: 12px 0 4px; color: var(--dim); font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; }
#defend ul { list-style: none; margin: 0; padding: 0; }
#defend li { padding: 4px 0; border-bottom: 1px solid #10141f; }
#defend li label { display: flex; gap: 8px; align-items: baseline; }
#defend li .eta { margin-left: auto; color: var(--dim); white-space: nowrap; }
#defend-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#defend-actions button { width: auto; flex: 1 1 200px; border-radius: 0; letter-spacing: .12em; }

/* The AI mark of a bot corporation (docs/gameplay.md section 14). */
.ai-icon { vertical-align: -2px; color: var(--ally); }
#bot-access summary { cursor: pointer; color: var(--hi); }
#bot-access table { width: 100%; border-collapse: collapse; margin-top: 8px; }
#bot-access th, #bot-access td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); }
  /* The mission result screen (issue #209). Under the transmission (z 30),
     but transmissions queue behind it while it is open (issue #405) instead
     of sliding in over its [ CLOSE ]. */
  #mission-result {
    position: fixed; inset: 0; z-index: 29; padding: 16px;
    display: flex; align-items: center; justify-content: center;
    background: #03040af2; outline: none;
  }
  #mission-result.hidden { display: none; }
  #mission-result-panel {
    width: 100%; max-width: 720px; max-height: 90vh; overflow-y: auto;
    background: var(--panel); border: 1px solid var(--line);
    border-left: 2px solid var(--hi); padding: 20px;
    animation: transmission-in .22s ease-out;
  }
  #mission-result.lost #mission-result-panel { border-left-color: var(--warn); }
  #mission-result-kicker {
    color: var(--dim); font-size: 12px; letter-spacing: .3em;
    text-transform: uppercase;
  }
  #mission-result-title {
    margin: 6px 0 8px; font: 400 clamp(34px, 8vw, 64px)/1 'VT323', monospace;
    letter-spacing: .06em; text-transform: uppercase;
    color: var(--hi-bright); text-shadow: 0 0 14px var(--hi), 0 0 2px var(--hi);
    animation: result-glow 2.4s ease-in-out infinite alternate;
  }
  #mission-result.lost #mission-result-title {
    color: var(--warn); text-shadow: none; animation: none;
  }
  @keyframes result-glow {
    from { text-shadow: 0 0 6px var(--hi), 0 0 2px var(--hi); }
    to { text-shadow: 0 0 18px var(--hi), 0 0 2px var(--hi); }
  }
  #mission-result-line { margin: 0 0 16px; color: var(--ink); }
  #mission-result-spin {
    margin: 0 0 16px; padding: 6px 10px; border-left: 2px solid var(--hi);
    color: var(--hi); font-style: italic;
  }
  #mission-result-spin.hidden { display: none; }
  #mission-result.lost #mission-result-spin { border-left-color: var(--warn); }
  #mission-result-stats {
    display: grid; gap: 8px; margin: 0 0 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #mission-result-stats > div { border: 1px solid var(--line); padding: 10px; }
  #mission-result-stats dt {
    color: var(--dim); font-size: 11px; letter-spacing: .15em;
    text-transform: uppercase;
  }
  #mission-result-stats dd {
    margin: 4px 0 0; color: var(--hi);
    font: 400 28px/1 'VT323', monospace;
  }
  #mission-result-stats dd.warn { color: var(--warn); }
  #mission-result-agents {
    display: grid; gap: 8px; margin-bottom: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .result-agent {
    border: 1px solid var(--line); padding: 8px; min-width: 0;
    display: grid; gap: 4px; justify-items: center; text-align: center;
  }
  .result-agent .squad-portrait { width: 48px; height: 48px; }
  .result-agent-state { color: var(--hi); font-size: 12px; }
  .result-agent.down .result-agent-state { color: var(--warn); }
  @media (max-width: 560px) {
    #mission-result-stats { grid-template-columns: 1fr; }
    #mission-result-agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  #mission-result-actions { display: flex; justify-content: flex-end; gap: 8px; }
  #mission-result-actions button {
    width: auto; text-transform: uppercase; letter-spacing: .1em;
  }
  #mission-result-again {
    background: var(--hi); color: var(--bg); border-color: var(--hi);
  }
  @media (prefers-reduced-motion: reduce) {
    #mission-result-panel { animation: none; }
    #mission-result-title { animation: none; }
  }


/* The squad page and the agent page (issue #282). A board over the terminal,
   like the changelog, but tall: it scrolls in its own panel and the page under
   it stays put. Square corners, no shadows; the one glowing element is the
   agent's name (or the squad's title). A level is never told by colour alone:
   every coloured cell and part has its V1-V3 (or none) written on it. */
.pagelink { color: var(--hi); text-decoration: none; letter-spacing: .1em;
            font-size: 11px; text-transform: uppercase; }
.pagelink:hover, .pagelink:focus-visible { color: var(--hi-bright); text-decoration: underline; }
h2 .pagelink { margin-left: 8px; }
body.board-open { overflow: hidden; }
/* On a phone the page under the board is not there at all: it is wider than
   the screen (its tables), which would widen the board with it. Its place is
   kept by the script, which scrolls back to it on close. */
@media (max-width: 760px) { body.board-open main, body.board-open footer { display: none; } }
#agentboard {
  position: fixed; inset: 0; z-index: 25; padding: 16px;
  display: flex; align-items: flex-start; justify-content: center;
  background: #03040af2; outline: none;
}
#agentboard.hidden { display: none; }
#agentboard-panel {
  width: 100%; max-width: 1100px; max-height: 100%; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); padding: 16px;
}
#agentboard .dim, .dim { color: var(--dim); }
#agentboard .label { color: var(--dim); font-size: 11px; letter-spacing: .2em;
                     font-weight: normal; margin: 0 0 4px; text-transform: uppercase; }
#agentboard .kicker { color: var(--hi); font-size: 12px; letter-spacing: .3em; }
.ap-head { display: flex; flex-wrap: wrap; justify-content: space-between;
           align-items: flex-start; gap: 8px 16px; margin-bottom: 12px; }
.ap-title {
  font-family: var(--font-display); margin: 4px 0 0; font-size: 18px;
  letter-spacing: .4em; color: var(--hi-bright); text-shadow: 0 0 8px var(--hi);
  text-transform: uppercase;
}
.ap-links { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
#agentboard button { width: auto; padding: 4px 8px; letter-spacing: .1em;
                     text-transform: uppercase; font-size: 11px; }
#agentboard button.primary { background: var(--hi); color: var(--bg); border-color: var(--hi); }
#agentboard button.primary:hover:not(:disabled) { background: var(--hi-bright); border-color: var(--hi-bright); }
#agentboard .msg { margin-top: 8px; }
#agentboard .scroll { overflow-x: auto; }

/* The levels: none is an empty dashed outline, V1..V3 fill up the one accent
   (dark to bright). The text on a cell or badge always says which. */
.bp.lv0 > :not(title) { fill: var(--panel); stroke: var(--dim); stroke-width: 1; stroke-dasharray: 2 2; }
.bp.lv1 > :not(title) { fill: #17402c; stroke: #2c7a52; stroke-width: 1; }
.bp.lv2 > :not(title) { fill: #2a9d62; stroke: var(--hi); stroke-width: 1; }
.bp.lv3 > :not(title) { fill: var(--hi); stroke: var(--hi-bright); stroke-width: 1.5; }
.bp[tabindex] { cursor: pointer; }
.bp[tabindex]:focus-visible > :not(title), .bp[tabindex]:hover > :not(title) { stroke: var(--caution, #e0b44b); }
.cell, .lvbadge { display: inline-flex; flex-direction: column; align-items: center;
                  justify-content: center; min-width: 0; line-height: 1.15;
                  border: 1px solid var(--line); padding: 1px 3px; font-size: 10px; }
.lvbadge { flex-direction: row; min-width: 40px; padding: 1px 6px; font-size: 12px; }
.cell.lv0, .lvbadge.lv0 { color: var(--dim); border-style: dashed; background: transparent; }
.cell.lv1, .lvbadge.lv1 { color: #9fe3bd; background: #17402c; border-color: #2c7a52; }
.cell.lv2, .lvbadge.lv2 { color: var(--bg); background: #2a9d62; border-color: var(--hi); }
.cell.lv3, .lvbadge.lv3 { color: var(--bg); background: var(--hi); border-color: var(--hi-bright);
                          font-weight: 700; }
.cell-code { letter-spacing: .05em; opacity: .85; }
.cell-level { font-weight: 700; }
.figure { display: block; width: 100%; height: auto; }
.callout { stroke: var(--line); stroke-width: .6; }
.callout-text { font: 8.5px var(--font-body); fill: var(--dim); letter-spacing: .04em; }
.callout-text.lv1 { fill: #7fd6a6; } .callout-text.lv2 { fill: var(--hi); }
.callout-text.lv3 { fill: var(--hi-bright); font-weight: 700; }
.legend { margin-top: 12px; font-size: 11px; }
.legend .cell { flex-direction: row; padding: 0 6px; }

/* Health: a bar and a number, and a word when it is low. */
.bar { display: inline-block; width: 90px; height: 8px; vertical-align: middle;
       background: #070910; border: 1px solid var(--line); margin-right: 8px; }
.bar > span { display: block; height: 100%; background: var(--hi); }
.bar.low > span { background: var(--caution, #e0b44b); }
.bar-text { color: var(--ink); }

/* The squad page: four cards side by side; on a phone one card per screen. */
.sq-sub { margin: 0 0 8px; }
.sq-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
            outline: none; }
.sq-pager { display: none; align-items: center; justify-content: center; gap: 12px;
            margin-bottom: 8px; }
.sq-dots { display: inline-flex; gap: 6px; }
.sq-dots .dot { width: 8px; height: 8px; border: 1px solid var(--dim); }
.sq-dots .dot.on { background: var(--hi); border-color: var(--hi); }
.sq-card { display: grid; gap: 6px; align-content: start; min-width: 0; padding: 10px;
           border: 1px solid var(--line); background: #070910; color: var(--ink);
           text-decoration: none; }
a.sq-card:hover, a.sq-card:focus-visible { border-color: var(--hi); background: #0d1a13; outline: none; }
.sq-slot { color: var(--dim); font-size: 11px; letter-spacing: .15em; }
.sq-name { color: var(--hi); text-transform: uppercase; letter-spacing: .15em;
           overflow-wrap: anywhere; }
.sq-card .figure { width: 96px; height: auto; justify-self: center; }
.sq-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.sq-strip .cell { padding: 1px 0; }
.sq-health { white-space: nowrap; }
.sq-health .bar { width: 60px; }
.sq-weapons { list-style: none; margin: 0; padding: 0; font-size: 11px; }
.sq-weapons li { display: flex; justify-content: space-between; gap: 8px; }
.sq-open { color: var(--hi); font-size: 11px; letter-spacing: .1em; justify-self: end; }
.sq-empty { border-style: dashed; justify-items: start; min-height: 120px; }
@media (max-width: 760px) {
  #agentboard { padding: 0; }
  #agentboard-panel { border: 0; min-height: 100%; }
  .sq-pager { display: flex; }
  .sq-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
              scrollbar-width: none; overscroll-behavior-x: contain; }
  .sq-track::-webkit-scrollbar { display: none; }
  .sq-track > * { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
  .sq-card .figure { width: 150px; }
}
@media (prefers-reduced-motion: no-preference) { .sq-track { scroll-behavior: smooth; } }

/* The agent page: the figure and the vitals, the seven parts, then the gear. */
.ap-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) {
  .ap-grid { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); }
  .ap-gearbox { grid-column: 1 / -1; }
}
.ap-body .figure-big { max-width: 380px; }
.vitals { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 12px 0; }
.vitals dt { color: var(--dim); font-size: 11px; letter-spacing: .15em; }
.vitals dd { margin: 0; }
.ap-parts { display: grid; gap: 8px; align-content: start; }
.ap-part { border: 1px solid var(--line); padding: 8px 10px; background: #070910; }
.ap-part.focus { border-color: var(--hi); }
.ap-part-head { margin-bottom: 4px; }
.ap-line { display: flex; gap: 8px; }
.ap-part .label { flex: 0 0 76px; margin: 0; }
.ap-next { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.ap-part .notyet { color: var(--dim); font-size: 11px; padding-left: 84px; }
.ap-next .notyet { padding-left: 0; }
.ap-part .price { color: var(--dim); font-size: 11px; }
.ap-part .act { margin-top: 4px; }
.ap-part .blocked { color: #e8a49b; font-size: 12px; }
.ap-gear { border: 1px solid var(--line); padding: 10px; background: #070910; }
.ap-gear h3 { font-size: 11px; }
.ap-buy { margin: 8px 0 0; }


/* The briefing before a match and the details of the debriefing after it
   (issue #310). Same panel language as the mission result; a phone gets one
   column and a panel that scrolls on its own. */
#briefing {
  position: fixed; inset: 0; z-index: 28; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: #03040af2; outline: none;
}
#briefing.hidden { display: none; }
#briefing { box-sizing: border-box; }
#briefing-panel {
  box-sizing: border-box; width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 2px solid var(--hi); padding: 20px;
}
#briefing-kicker {
  color: var(--dim); font-size: 12px; letter-spacing: .3em; text-transform: uppercase;
}
#briefing-title {
  margin: 6px 0 4px; font: 400 clamp(30px, 7vw, 52px)/1 'VT323', monospace;
  letter-spacing: .06em; text-transform: uppercase; color: var(--hi-bright);
  overflow-wrap: anywhere;
}
#briefing-where { margin: 0 0 14px; color: var(--ink); }
#briefing h3 {
  margin: 14px 0 6px; font-size: 12px; font-weight: 400; color: var(--dim);
  letter-spacing: .15em; text-transform: uppercase;
}
#briefing-facts {
  display: grid; gap: 8px; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr));
}
#briefing-facts > div { border: 1px solid var(--line); padding: 10px; min-width: 0; }
#briefing-facts dt {
  color: var(--dim); font-size: 11px; letter-spacing: .15em; text-transform: uppercase;
}
#briefing-facts dd { margin: 4px 0 0; color: var(--ink); overflow-wrap: anywhere; }
#briefing-facts dd strong { color: var(--hi); font-weight: 400; }
#briefing-facts dd .warn, .debrief-table .warn { color: var(--warn); }
#briefing-squad { display: grid; gap: 6px; }
.briefing-agent {
  border: 1px solid var(--line); padding: 8px; display: grid; gap: 2px; min-width: 0;
}
.briefing-agent .weapons { color: var(--dim); font-size: 12px; overflow-wrap: anywhere; }
#briefing-intel { color: var(--dim); margin: 12px 0; }
#briefing-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
#briefing-actions button { width: auto; text-transform: uppercase; letter-spacing: .1em; }
#briefing-launch { background: var(--hi); color: var(--bg); border-color: var(--hi); }
#briefing-launch:disabled { opacity: .5; }
@media (max-width: 560px) {
  #briefing-facts { grid-template-columns: 1fr; }
  #briefing-actions button { flex: 1 1 100%; }
}

#mission-result-details { display: grid; gap: 10px; margin-bottom: 16px; }
#mission-result-details h3 {
  margin: 0 0 4px; font-size: 12px; font-weight: 400; color: var(--dim);
  letter-spacing: .15em; text-transform: uppercase;
}
.debrief-table { width: 100%; border-collapse: collapse; }
.debrief-table td { padding: 2px 0; }
.debrief-table td:last-child { text-align: right; }
.debrief-table tr.total td { border-top: 1px solid var(--line); color: var(--hi); }
#mission-result-details ul { margin: 0; padding-left: 18px; }
#mission-result-details .news { border-left: 2px solid var(--line); padding-left: 10px; }
#history-list { margin: 6px 0 0; padding: 0; list-style: none; }
#history-list li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
#history-list button { width: auto; flex: none; }
#history-list .won { color: var(--hi); }
#history-list .lost { color: var(--warn); }
#history-new { color: var(--hi-bright); }
