/* Appearance controls and avatar colours shared by the site and game. */
.theme-choices { min-width: 0; margin: 0; padding: 0; border: 0; color: var(--text); }
.theme-choices legend { margin-bottom: 8px; padding: 0; font-size: 12px; font-weight: 650; }
.theme-options { display: flex; gap: 5px; }
.theme-options button { display: flex; flex: 1; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel, var(--card)); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.theme-options button:hover { border-color: var(--accent); background: var(--head); color: var(--text); }
.theme-options button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft, var(--sky-soft)); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-preview { display: inline-block; flex: none; width: 12px; height: 12px; border: 1px solid currentColor; border-radius: 50%; background: #f3efe4; }
.theme-preview.dark { background: #14232c; }
.theme-preview.system { background: linear-gradient(90deg, #f3efe4 50%, #14232c 50%); }
.theme-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

:root {
  --name-moderator: #6a3db8; --name-developer: #c8102e;
  --avatar-blue-bg: #e8edf4; --avatar-blue-fg: #537194;
  --avatar-gold-bg: #f1e8dc; --avatar-gold-fg: #a07d4a;
  --avatar-green-bg: #e3eeea; --avatar-green-fg: #568574;
  --avatar-purple-bg: #ebe6f1; --avatar-purple-fg: #8a70a4;
  --avatar-red-bg: #f2e3e1; --avatar-red-fg: #aa7a76;
  --avatar-teal-bg: #e1ebee; --avatar-teal-fg: #588b95;
}
:root[data-theme="dark"] {
  --name-moderator: #b48cf2; --name-developer: #ff3b55;
  --avatar-blue-bg: #203847; --avatar-blue-fg: #adc8dc;
  --avatar-gold-bg: #3a3021; --avatar-gold-fg: #d8bb8c;
  --avatar-green-bg: #20392f; --avatar-green-fg: #a0cbb8;
  --avatar-purple-bg: #332c40; --avatar-purple-fg: #c3abd9;
  --avatar-red-bg: #3c2b2a; --avatar-red-fg: #dbb2ac;
  --avatar-teal-bg: #20373d; --avatar-teal-fg: #9bc9d1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
  --name-moderator: #b48cf2; --name-developer: #ff3b55;
  --avatar-blue-bg: #203847; --avatar-blue-fg: #adc8dc;
  --avatar-gold-bg: #3a3021; --avatar-gold-fg: #d8bb8c;
  --avatar-green-bg: #20392f; --avatar-green-fg: #a0cbb8;
  --avatar-purple-bg: #332c40; --avatar-purple-fg: #c3abd9;
  --avatar-red-bg: #3c2b2a; --avatar-red-fg: #dbb2ac;
  --avatar-teal-bg: #20373d; --avatar-teal-fg: #9bc9d1;
  }
}

/* Names of the team: moderators in royal purple, developers in cherry red. */
:root .name-moderator.name-moderator.name-moderator.name-moderator { color: var(--name-moderator); }
:root .name-developer.name-developer.name-developer.name-developer { color: var(--name-developer); }
/* The world map (ui/WorldMap.tsx), in the game and on the website's Worlds page, which
   sets the colours it reads: --sea, --land, --land-line, --panel, --line, --text, --muted,
   --c1 and --bad. */

.map-wrap { position: relative; width: 100%; height: 100%; min-height: 240px; background: var(--sea); overflow: hidden; touch-action: none; user-select: none; }
.map-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 6px 18px #0003; padding: 5px 8px; font-size: 11.5px; max-width: 280px; }
.map-ctl { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 4; }
.map-ctl button { width: 28px; height: 28px; padding: 0; border-radius: 5px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font-size: 15px; font-weight: 400; display: flex; align-items: center; justify-content: center; }
.map-ctl button:hover { background: var(--panel); border-color: var(--muted); }
.map-credit { position: absolute; right: 4px; bottom: 2px; z-index: 3; font-size: 9.5px; color: var(--muted); background: color-mix(in srgb, var(--panel) 70%, transparent); padding: 0 4px; border-radius: 3px; }
.map-credit a { color: inherit; }
.map-legend { position: absolute; left: 8px; bottom: 8px; z-index: 4; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 11px; max-width: min(340px, calc(100% - 56px)); max-height: calc(100% - 48px); overflow-y: auto; overscroll-behavior: contain; }
.map-legend > summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style-position: inside; }
.map-legend[open] > summary { margin-bottom: 4px; }
.map-wrap.mini { min-height: 0; }
.map-wrap.mini .map-credit { font-size: 8px; white-space: nowrap; right: 2px; bottom: 1px; }
.map-daylight-key { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--muted); }
.map-daylight-swatch, .map-night-swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line); }
.map-daylight-swatch { background: #f5d58d; }
.map-night-swatch { background: #23334f; margin-left: 6px; }
.way-line { flex: none; vertical-align: middle; }
.way-tip { display: flex; align-items: center; gap: 5px; }
.map-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--text); box-shadow: 0 6px 18px #0003; }
.map-banner { position: absolute; left: 8px; top: 8px; z-index: 4; max-width: calc(100% - 56px); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; background: color-mix(in srgb, var(--panel) 94%, transparent); border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px 5px 9px; font-size: 12px; box-shadow: 0 6px 18px #0002; }
/* Chat, the one chat of the game and the website: the game's chat beside its screens and the
   pop-up under its Chat button, and the website's chat page and home page panel. Everything is
   scoped to a .gg-chat root, so neither host's own button and field styles reach in. It uses the
   game's colour names; the website maps its own onto them on .gg-chat. */

/* ---- Resets inside chat ---- */
.gg-chat { color: var(--text); font-size: 13px; line-height: 1.4; }
.gg-chat button { display: inline-flex; align-items: center; justify-content: center; gap: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font: inherit; font-weight: inherit; line-height: inherit; text-align: inherit; transition: none; cursor: pointer; }
.gg-chat button:hover { background: none; text-decoration: none; }
.gg-chat button:disabled { cursor: default; opacity: .55; }
.gg-chat input, .gg-chat select { margin: 0; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); font: inherit; font-size: 12px; }
.gg-chat input[type="checkbox"] { padding: 0; }
.gg-chat input:focus, .gg-chat select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.gg-chat a { color: var(--accent); }
.gg-chat label { margin: 0; font-weight: 400; }
.gg-chat p { margin: 0; }

/* ---- Small pieces ---- */
.gg-chat .cd-link { color: var(--accent); font-weight: 600; white-space: nowrap; }
.gg-chat .cd-link:hover { text-decoration: underline; }
.gg-chat .cd-muted { color: var(--muted); }
.gg-chat .cd-count { min-width: 16px; padding: 0 5px; border-radius: 8px; background: var(--amber); color: var(--navy); font-size: 10px; font-weight: 750; line-height: 1.5; text-align: center; }
.gg-chat .cd-blip { animation: cd-blip .5s ease-out; }
@keyframes cd-blip { 0% { transform: scale(1); box-shadow: 0 0 0 0 #efbc73aa; } 30% { transform: scale(1.3); } 100% { transform: scale(1); box-shadow: 0 0 0 7px #efbc7300; } }
@media (prefers-reduced-motion: reduce) { .gg-chat .cd-blip { animation: none; } }
.gg-chat .cd-dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #3fae6a; box-shadow: 0 0 0 2px #3fae6a33; }
/* Idle: away from every page for 10 minutes, the dot fades slowly to grey and back. */
.gg-chat .cd-dot.idle { animation: cd-idle 3s ease-in-out infinite; }
@keyframes cd-idle { 50% { background: #9aa3ad; box-shadow: 0 0 0 2px #9aa3ad33; } }
.gg-chat .cd-face .cd-dot.idle { animation-name: cd-idle-face; }
@keyframes cd-idle-face { 50% { background: #9aa3ad; } }
@media (prefers-reduced-motion: reduce) { .gg-chat .cd-dot.idle, .gg-chat .cd-face .cd-dot.idle { animation: none; background: #9aa3ad; } }
.gg-chat .cd-away { flex: none; width: 7px; height: 7px; border: 1px solid var(--faint); border-radius: 50%; box-sizing: border-box; }
.gg-chat .cd-face { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--avatar-blue-bg); color: var(--avatar-blue-fg); font-size: 11px; font-weight: 650; }
.gg-chat .cd-face.tone-1 { background: var(--avatar-gold-bg); color: var(--avatar-gold-fg); }
.gg-chat .cd-face.tone-2 { background: var(--avatar-green-bg); color: var(--avatar-green-fg); }
.gg-chat .cd-face.tone-3 { background: var(--avatar-purple-bg); color: var(--avatar-purple-fg); }
.gg-chat .cd-face.tone-4 { background: var(--avatar-red-bg); color: var(--avatar-red-fg); }
.gg-chat .cd-face.tone-5 { background: var(--avatar-teal-bg); color: var(--avatar-teal-fg); }

.gg-chat .cd-face .cd-dot { position: absolute; right: -2px; bottom: -2px; box-sizing: content-box; border: 2px solid var(--panel); box-shadow: none; }
.gg-chat .cd-rank { flex: none; display: inline-flex; flex-direction: column-reverse; gap: 1.5px; width: 13px; padding: 3px; border-radius: 3px; background: var(--navy); box-sizing: content-box; }
.gg-chat .cd-rank i { display: block; height: 2px; border-radius: 1px; background: var(--amber); }
.gg-chat .cd-team { flex: none; padding: 0 5px; border-radius: 3px; background: var(--head); color: var(--muted); font-size: 9px; font-weight: 650; }
.gg-chat .cd-send { height: 30px; padding: 0 12px; border: 1px solid var(--button); border-radius: 5px; background: var(--button); color: #fff; font-size: 12px; font-weight: 650; white-space: nowrap; }
.gg-chat .cd-send:hover:not(:disabled) { background: var(--button); filter: brightness(1.08); }
.gg-chat .cd-send-sm { height: 24px; padding: 0 8px; font-size: 11px; }
.gg-chat .cd-close { width: 26px; height: 26px; border-radius: 4px; color: var(--muted); }
.gg-chat .cd-close:hover, .gg-chat .cd-close.on { background: var(--hover); color: var(--text); }
.gg-chat .cd-hdr { padding: 4px 0; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.gg-chat .cd-check { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.4; cursor: pointer; }
.gg-chat .cd-check input { flex: none; margin: 2px 0 0; }
.gg-chat .cd-seg { display: inline-flex; height: 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.gg-chat .cd-seg button { padding: 0 9px; border-inline-end: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.gg-chat .cd-seg button:last-child { border-inline-end: 0; }
.gg-chat .cd-seg button.on, .gg-chat .cd-seg button.on:hover { background: var(--accent); color: var(--on-color); }
.gg-chat .cd-seg button:hover:not(.on) { background: var(--hover); color: var(--text); }
.gg-chat .cd-error { margin: 2px 0 4px; color: var(--bad); font-size: 11.5px; }
.gg-chat .cd-done { margin: 3px 0; color: var(--good); font-size: 11px; }
.gg-chat .cd-empty { margin: 16px 12px; color: var(--muted); }
.gg-chat .cd-note { padding: 8px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }

/* ---- The game's chat beside the screens ---- */
.chat-dock { position: fixed; top: var(--tb-h, 46px); right: 0; bottom: 0; z-index: 50; width: 340px; display: flex; flex-direction: column; background: var(--panel); border-inline-start: 1px solid var(--line); box-shadow: -10px 0 28px #0002; }
@media (min-width: 1380px) {
  .app.chat-docked .main { margin-inline-end: 340px; }
  .chat-dock { box-shadow: none; }
}
@media (max-width: 820px) { .chat-dock { width: 100%; z-index: 65; } }
@media (max-width: 599px) { .chat-dock { bottom: 54px; } }
/* Toasts keep clear of the box to write in: beside chat, or at the top where chat fills the screen. */
.app.chat-docked ~ .toasts { right: 352px; }
@media (max-width: 820px) { .app.chat-docked ~ .toasts { top: calc(var(--tb-h, 46px) + 8px); right: 12px; bottom: auto; } }
.gg-chat .cd-head { display: flex; flex: none; align-items: center; gap: 6px; height: 38px; padding: 0 6px 0 4px; border-bottom: 1px solid var(--line); background: var(--head); }
.gg-chat .cd-tabs { display: flex; flex: 1; min-width: 0; height: 100%; overflow-x: auto; }
.gg-chat .cd-tab { gap: 5px; max-width: 170px; padding: 0 9px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.gg-chat .cd-tab:hover { color: var(--text); }
.gg-chat .cd-tab.on { border-bottom-color: var(--amber); color: var(--accent); }
.gg-chat .cd-tab-name { overflow: hidden; text-overflow: ellipsis; }
.gg-chat .cd-online { gap: 5px; height: 24px; padding: 0 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font-size: 11px; font-weight: 650; }
.gg-chat .cd-online.on { border-color: var(--accent); }
.gg-chat .cd-panel { flex: none; max-height: 40%; overflow-y: auto; padding: 4px 10px 8px; border-bottom: 1px solid var(--line); }
.gg-chat .cd-direct-head { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: 7px; padding: 6px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.gg-chat .cd-direct-with { color: var(--text); font-weight: 700; }
.gg-chat .cd-direct-close { margin-inline-start: auto; }
.gg-chat .cd-local { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default; }
.gg-chat .cd-person .cd-local { margin-inline-start: auto; }
.gg-chat .cd-person .cd-local + .cd-person-dm { margin-inline-start: 6px; }

/* New messages under the game's Chat button while chat is closed, under the top bar's menus. */
.chat-anchor { position: relative; display: inline-flex; }
.chat-pop { position: absolute; top: calc(100% + 9px); right: 0; z-index: 55; width: 330px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px #0004; animation: pop-in .16s ease-out; }
.chat-pop::before { content: ''; position: absolute; top: -6px; right: 34px; width: 10px; height: 10px; background: var(--head); border: solid var(--line); border-width: 1px 0 0 1px; transform: rotate(45deg); }
@keyframes pop-in { from { transform: translateY(-6px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .chat-pop { animation: none; } }
@media (max-width: 599px) {
  .chat-pop { position: fixed; top: 52px; left: 8px; right: 8px; width: auto; }
  .chat-pop::before { display: none; }
}
.gg-chat .cp-head { position: relative; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 4px 0 12px; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; background: var(--head); }
.gg-chat .cp-channel { flex: 1; justify-content: flex-start; min-width: 0; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.gg-chat .cp-open { font-size: 11.5px; }
.gg-chat .cp-list { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 0 6px; }
.gg-chat .cp-msg { cursor: pointer; }
.gg-chat .cp-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.gg-chat .cp-msg .cd-gif img { max-height: 120px; }
.chat-pop .cd-input { border-top: 1px solid var(--line); }

/* ---- Who is online, and the alerts ---- */
.gg-chat .cd-person { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; padding: 3px 0; font-size: 12px; }
.gg-chat .cd-person-where { flex-basis: 100%; padding-inline-start: 13px; color: var(--muted); font-size: 10.5px; }
.gg-chat .cd-person a { color: var(--text); font-weight: 600; }
.gg-chat .cd-person-dm { margin-inline-start: auto; font-size: 11px; }
.gg-chat .cd-presence { margin: 4px 0; color: var(--muted); }
.gg-chat .cd-alerts { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.gg-chat .cd-alerts .cd-hdr { padding: 4px 0 0; }
.gg-chat .cd-alerts-note { color: var(--muted); font-size: 11.5px; line-height: 1.4; }

/* ---- Direct conversations, and finding a member to write to ---- */
.gg-chat .cd-find { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.gg-chat .cd-find-input { flex: none; height: 30px; margin: 10px 10px 4px; padding: 0 9px; font-size: 12.5px; }
.gg-chat .cd-direct-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 10px; }
.gg-chat .cd-direct { justify-content: flex-start; gap: 8px; width: 100%; padding: 7px 12px; border-bottom: 1px solid var(--line); color: var(--text); text-align: start; }
.gg-chat .cd-direct:hover, .gg-chat .cd-direct.on { background: var(--hover); }
.gg-chat .cd-direct-text { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.gg-chat .cd-direct-name { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; }
.gg-chat .cd-direct.unread .cd-direct-name { color: var(--accent); }
.gg-chat .cd-direct-last { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.gg-chat .cd-direct.unread .cd-direct-last { color: var(--text); }
.gg-chat .cd-direct-at { flex: none; color: var(--faint); font-size: 10px; }

/* ---- Messages ---- */
.gg-chat .cd-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 10px; }
.gg-chat .cd-older { display: flex; margin: 6px 12px; font-size: 11.5px; }
.gg-chat .cd-day { display: flex; align-items: center; gap: 8px; margin: 12px 12px 4px; color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.gg-chat .cd-day::before, .gg-chat .cd-day::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.gg-chat .cd-msg { position: relative; padding: 4px 12px 1px; }
.gg-chat .cd-msg.joined { padding-top: 0; }
.gg-chat .cd-msg:hover, .gg-chat .cd-msg:focus-within { background: var(--hover); }
.gg-chat .cd-msg:focus { outline: none; }
.gg-chat .cd-msg.mention { background: var(--warn-soft); box-shadow: inset 3px 0 var(--amber); }
.gg-chat .cd-meta { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; font-size: 11.5px; line-height: 1.4; }
.gg-chat .cd-name { color: var(--text); font-weight: 700; }
.gg-chat .cd-msg.mine .cd-name { color: var(--accent); }
.gg-chat .cd-meta time { color: var(--faint); font-size: 10px; }
.gg-chat .cd-text { font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.gg-chat .cd-mention { padding: 0 2px; border-radius: 3px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.gg-chat .cd-mention:hover { text-decoration: none; }
.gg-chat .cd-mention.me { background: #efbc7347; color: var(--text); }
.gg-chat .cd-gif { display: block; margin: 3px 0 1px; }
.gg-chat .cd-gif img { display: block; width: auto; max-width: min(220px, 100%); height: auto; max-height: 220px; border-radius: 6px; background: var(--head); }
.gg-chat .cd-reactions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 3px 0 1px; }
.gg-chat .cd-reaction { gap: 4px; height: 22px; padding: 0 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--text); font-size: 12.5px; }
.gg-chat .cd-reaction span { color: var(--muted); font-size: 10.5px; font-weight: 650; }
.gg-chat .cd-reaction:hover:not(:disabled), .gg-chat .cd-reaction.mine { border-color: var(--accent); background: var(--accent-soft); }
.gg-chat .cd-reaction.mine span { color: var(--accent); }
.gg-chat .cd-actions { position: absolute; top: 2px; right: 8px; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 2px 10px; max-width: calc(100% - 16px); box-sizing: border-box; padding: 1px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); box-shadow: 0 2px 8px #0001; font-size: 11px; opacity: 0; pointer-events: none; }
.gg-chat .cd-msg:hover .cd-actions, .gg-chat .cd-msg:focus-within .cd-actions { opacity: 1; pointer-events: auto; }
.gg-chat .cd-quick { display: flex; align-items: center; gap: 1px; margin-inline-end: -3px; padding-inline-end: 7px; border-inline-end: 1px solid var(--line); }
.gg-chat .cd-quick-react { min-width: 22px; height: 20px; padding: 0 2px; border-radius: 4px; color: var(--muted); font-size: 13px; line-height: 1; }
.gg-chat .cd-quick-react:hover { background: var(--hover); color: var(--text); }
.gg-chat .cd-react-more { gap: 0; font-size: 10.5px; font-weight: 750; }
.gg-chat .cd-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 5px 0 4px; }
.gg-chat .cd-inline input { flex: 1; min-width: 140px; height: 28px; }
.gg-chat .cd-inline select { height: 28px; }
@media (hover: none) {
  .gg-chat .cd-actions { position: static; margin: 2px 0; padding: 0; border: 0; background: none; box-shadow: none; opacity: 1; pointer-events: auto; }
  .gg-chat .cd-msg:not(:focus-within) .cd-actions { display: none; }
}

/* ---- Writing ---- */
.gg-chat .cd-compose { flex: none; border-top: 1px solid var(--line); }
.gg-chat .cd-compose > .cd-note { padding-bottom: 0; border-top: 0; }
.gg-chat .cd-input { position: relative; }
.gg-chat .cd-input > .cd-error { margin: 0; padding: 0 10px 6px; }
.gg-chat .cd-form { display: flex; gap: 6px; padding: 8px 10px; }
.gg-chat .cd-form input { flex: 1; min-width: 0; height: 30px; }
.gg-chat .cd-tool { flex: none; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--muted); }
.gg-chat .cd-tool:hover, .gg-chat .cd-tool.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.gg-chat .cd-tool-gif { font-size: 9.5px; font-weight: 800; letter-spacing: .4px; }
/* Members to @mention, above the box to write in. */
.gg-chat .cd-suggest { position: absolute; left: 8px; right: 8px; bottom: calc(100% - 3px); z-index: 5; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); box-shadow: 0 -6px 20px #0002; }
.gg-chat .cd-suggest ul { list-style: none; max-height: 240px; margin: 0; padding: 4px 0; overflow-y: auto; }
.gg-chat .cd-suggest li { display: flex; align-items: center; gap: 7px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.gg-chat .cd-suggest li.on { background: var(--sel); }
.gg-chat .cd-suggest-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-chat .cd-suggest-name b { color: var(--accent); font-weight: 750; }
.gg-chat .cd-suggest-where { margin-inline-start: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.gg-chat .cd-suggest-keys { padding: 4px 10px; border-top: 1px solid var(--line); background: var(--head); color: var(--faint); font-size: 10px; }
@media (hover: none) { .gg-chat .cd-suggest-keys { display: none; } }

/* ---- The picker: emoji and GIFs ---- */
.gg-chat .cd-picker { display: flex; flex: none; flex-direction: column; height: 290px; border-top: 1px solid var(--line); background: var(--panel); }
.gg-chat .cd-picker-head { display: flex; align-items: center; gap: 3px; padding: 5px 6px; border-bottom: 1px solid var(--line); background: var(--head); }
.gg-chat .cd-picker-head strong { padding: 0 6px; font-size: 12px; }
.gg-chat .cd-picker-tab { padding: 3px 10px; border-radius: 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.gg-chat .cd-picker-tab[aria-pressed="true"], .gg-chat .cd-picker-tab[aria-pressed="true"]:hover { background: var(--panel); color: var(--accent); box-shadow: 0 0 0 1px var(--line); }
.gg-chat .cd-picker-close { width: 24px; height: 24px; margin-inline-start: auto; border-radius: 4px; color: var(--muted); }
.gg-chat .cd-picker-close:hover { background: var(--panel); color: var(--text); }
.gg-chat .cd-picker-error { padding: 4px 10px 0; }
.gg-chat .cd-picker-body { flex: 1; min-height: 0; padding: 2px 8px 8px; overflow-y: auto; overscroll-behavior: contain; }
.gg-chat .cd-picker-group { margin: 7px 2px 3px; color: var(--muted); font-size: 9.5px; font-weight: 750; letter-spacing: 1px; text-transform: uppercase; }
.gg-chat .cd-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); }
.gg-chat .cd-emoji { height: 32px; border-radius: 5px; font-size: 19px; line-height: 1; }
.gg-chat .cd-emoji:hover, .gg-chat .cd-emoji:focus-visible { background: var(--accent-soft); }
.gg-chat .cd-gif-search { width: 100%; height: 30px; margin: 6px 0; padding: 0 9px; }
.gg-chat .cd-gif-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.gg-chat .cd-gif-tile { display: block; height: 92px; overflow: hidden; border-radius: 5px; background: var(--head); }
.gg-chat .cd-gif-tile:hover { background: var(--head); }
.gg-chat .cd-gif-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gg-chat .cd-gif-tile:hover, .gg-chat .cd-gif-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.gg-chat .cd-gif-more { grid-column: 1 / -1; justify-self: center; margin: 4px 0; font-size: 11.5px; }
.gg-chat .cd-gif-status { margin: 6px 2px; color: var(--muted); font-size: 11.5px; }
.gg-chat .cd-gif-credit { margin: 6px 2px 0; color: var(--faint); font-size: 9.5px; text-align: end; }

/* ---- The website's chat page: channels, direct messages and who is online beside
   the open channel, with sound and notifications under its settings button; on a phone the channels and conversations scroll across the top ---- */
.cs-page { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: min(760px, calc(100vh - 250px)); min-height: 460px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); box-shadow: var(--card-shadow); }
.gg-chat .cs-side { padding: 14px 0; overflow-y: auto; border-inline-end: 1px solid var(--line); background: var(--head); }
.gg-chat .cs-title { display: flex; gap: 6px; margin: 0 0 6px; padding: 0 16px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 1.6px; text-transform: uppercase; }
.gg-chat .cs-title-n { color: var(--text); }
.gg-chat .cs-list { display: flex; flex-direction: column; margin-bottom: 20px; }
.gg-chat .cs-channel { justify-content: flex-start; gap: 9px; width: 100%; padding: 7px 16px 7px 13px; border-inline-start: 3px solid transparent; color: var(--text); font-size: 13px; font-weight: 600; text-align: start; }
.gg-chat .cs-channel svg { flex: none; color: var(--muted); }
.gg-chat .cs-channel:hover { background: var(--hover); }
.gg-chat .cs-channel.on { border-inline-start-color: var(--amber); background: var(--panel); color: var(--accent); }
.gg-chat .cs-channel.on svg { color: var(--accent); }
.gg-chat .cs-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-chat .cs-new { color: var(--muted); }
.gg-chat .cs-directs .cd-direct { padding: 6px 16px 6px 13px; border-bottom: 0; border-inline-start: 3px solid transparent; }
.gg-chat .cs-directs .cd-direct.on { border-inline-start-color: var(--amber); background: var(--panel); }
.gg-chat .cs-directs .cd-face .cd-dot { border-color: var(--head); }
.gg-chat .cs-directs .cd-direct.on .cd-face .cd-dot { border-color: var(--panel); }
.gg-chat .cs-directs .cd-direct-at { display: none; }
.gg-chat .cs-people { margin-bottom: 20px; padding: 0 16px; }
.gg-chat .cs-settings { position: relative; align-self: center; }
.gg-chat .cs-settings-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; width: min(320px, calc(100vw - 32px)); padding: 10px 14px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.gg-chat .cs-settings-pop .cd-seg { width: 100%; height: auto; }
.gg-chat .cs-settings-pop .cd-seg button { flex: 1; padding: 4px 5px; line-height: 1.25; text-align: center; white-space: normal; }
.gg-chat .cs-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.gg-chat .cs-head { display: flex; flex: none; align-items: baseline; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.gg-chat .cs-head h1 { margin: 0; font-size: 17px; line-height: 1.3; }
.gg-chat .cs-head p { color: var(--muted); font-size: 12px; }
.gg-chat .cs-head-tools { display: flex; align-items: baseline; gap: 14px; margin-inline-start: auto; font-size: 12px; }
.gg-chat .cs-notice { display: flex; flex: none; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 18px; border-bottom: 1px solid var(--line); background: var(--accent-soft); font-size: 12px; }
.gg-chat .cs-notice.error { background: var(--bad-soft); }
.gg-chat .cs-notice span { flex: 1; min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.cs-page .cd-msg { padding-inline-end: 18px; padding-inline-start: 18px; }
.cs-page .cd-day { margin-inline-end: 18px; margin-inline-start: 18px; }
.cs-page .cd-text { font-size: 13.5px; line-height: 1.5; }
.cs-page .cd-meta { font-size: 12px; }
.cs-page .cd-form { padding: 12px 18px; }
.cs-page .cd-form input, .cs-page .cd-tool, .cs-page .cd-send { height: 38px; }
.cs-page .cd-tool { width: 38px; }
.cs-page .cs-settings .cd-tool { width: 30px; height: 30px; }
.cs-page .cd-send { padding: 0 16px; }
.cs-page .cd-find-input { height: 38px; margin: 14px 18px 6px; }
.cs-page .cd-find .cd-direct { padding-inline-end: 18px; padding-inline-start: 18px; }
.cs-page .cd-gif img { max-width: min(260px, 100%); max-height: 260px; }
@media (max-width: 780px) {
  .cs-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: calc(100vh - 210px); }
  .gg-chat .cs-side { display: flex; padding: 0; overflow-x: auto; overflow-y: visible; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .gg-chat .cs-title, .gg-chat .cs-people, .gg-chat .cs-head p, .gg-chat .cs-directs .cd-direct-last,
  .gg-chat .cs-directs .cd-rank, .gg-chat .cs-directs .cd-team { display: none; }
  .gg-chat .cs-list { flex: none; flex-direction: row; margin: 0; }
  .gg-chat .cs-directs { border-inline-start: 1px solid var(--line); }
  .gg-chat .cs-channel, .gg-chat .cs-directs .cd-direct { width: auto; padding: 10px 14px 8px; border-bottom: 3px solid transparent; border-inline-start: 0; white-space: nowrap; }
  .gg-chat .cs-channel.on, .gg-chat .cs-directs .cd-direct.on { border-bottom-color: var(--amber); }
  .gg-chat .cs-head { padding: 10px 14px; }
  .cs-page .cd-msg { padding-inline-end: 14px; padding-inline-start: 14px; }
  .cs-page .cd-form { padding: 10px 12px; }
}

/* ---- The website's home page panel ---- */
.cs-panel { display: flex; flex-direction: column; background: var(--panel); }
.gg-chat .cs-online { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.4; }
.cs-panel .cd-log { flex: none; height: 270px; }
.cs-panel .cd-msg { padding-inline-end: 14px; padding-inline-start: 14px; }
.cs-panel .cd-day { margin-inline-end: 14px; margin-inline-start: 14px; }
.cs-panel .cd-gif img { max-width: min(200px, 100%); max-height: 200px; }

/* Uploaded images share the composer and message layout on the site and in the game. */
.gg-chat .cd-file { display: none; }
.gg-chat .cd-tool:disabled { opacity: .45; cursor: default; }
.gg-chat .cd-drop { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.gg-chat .cd-drop-note { margin: 0; padding: 8px 10px 0; color: var(--accent); font-size: 12px; }
.gg-chat .cd-attachment { display: flex; align-items: center; gap: 9px; padding: 8px 10px 0; min-width: 0; font-size: 11px; }
.gg-chat .cd-attachment > img { width: 54px; height: 54px; object-fit: contain; border-radius: 5px; background: var(--head); }
.gg-chat .cd-attachment > div { flex: 1; min-width: 0; }
.gg-chat .cd-attachment strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-chat .cd-attachment p { margin: 3px 0; color: var(--muted); }
.gg-chat .cd-uploaded { margin: 4px 0; }
.gg-chat .cd-image-thumb { display: block; max-width: 100%; border: 0; padding: 0; border-radius: 6px; overflow: hidden; background: var(--head); cursor: zoom-in; }
.gg-chat .cd-image-thumb img { display: block; width: auto; height: auto; max-width: min(260px, 100%); max-height: 260px; object-fit: contain; }
.gg-chat .cp-msg .cd-image-thumb img { max-height: 120px; }
.gg-chat .cd-image-status { max-width: 300px; margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.gg-chat .cd-image-dialog { max-width: 96vw; max-height: 94dvh; border: 1px solid var(--line); border-radius: 8px; padding: 12px; color: var(--text); background: var(--panel); }
.gg-chat .cd-image-dialog::backdrop { background: #000c; }
.gg-chat .cd-image-dialog > div { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.gg-chat .cd-image-dialog .cd-send { align-self: flex-end; }
.gg-chat .cd-image-dialog img { display: block; width: auto; height: auto; max-width: min(1600px, 88vw); max-height: 76dvh; object-fit: contain; }
.gg-chat .cd-image-dialog p { max-width: 70ch; margin: 0; font-size: 13px; overflow-wrap: anywhere; }

.gg-chat .cd-image-age { margin:0; padding:0 10px 6px; color:var(--muted); font-size:11px; }

/* ---- Replies and threads ---- */
.gg-chat .cd-act { gap: 3px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.gg-chat .cd-act:hover { text-decoration: underline; }
.gg-chat .cd-quote { display: flex; justify-content: flex-start; gap: 5px; max-width: 100%; margin: 3px 0 1px; padding: 1px 0 1px 8px; border-inline-start: 2px solid var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.35; text-align: start; }
.gg-chat .cd-quote svg { flex: none; }
.gg-chat .cd-quote:hover:not(:disabled) { border-inline-start-color: var(--accent); color: var(--text); }
.gg-chat .cd-quote:disabled { opacity: 1; font-style: italic; }
.gg-chat .cd-quote-name { flex: none; color: var(--text); font-weight: 650; }
.gg-chat .cd-quote-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-chat .cd-thread-link { gap: 7px; margin: 4px 0 2px; padding: 3px 9px 3px 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--muted); font-size: 11.5px; }
.gg-chat .cd-thread-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.gg-chat .cd-thread-faces { display: inline-flex; }
.gg-chat .cd-thread-faces .cd-face { width: 18px; height: 18px; margin-inline-end: -4px; border: 1.5px solid var(--panel); font-size: 9px; }
.gg-chat .cd-thread-faces .cd-face:last-child { margin-inline-end: 0; }
.gg-chat .cd-thread-n { color: var(--accent); font-weight: 700; }
.gg-chat .cd-thread-link.unread .cd-thread-n { color: var(--text); }
.gg-chat .cd-thread-last { white-space: nowrap; }
.gg-chat .cd-deleted .cd-text { color: var(--muted); font-style: italic; }
.gg-chat .cd-deleted { padding-top: 6px; }
.gg-chat .cd-msg.cd-flash { animation: cd-flash 1.8s ease-out; }
@keyframes cd-flash { 0%, 35% { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); } }
@media (prefers-reduced-motion: reduce) { .gg-chat .cd-msg.cd-flash { animation: none; background: var(--accent-soft); } }
.gg-chat .cd-replying { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 6px 0 12px; color: var(--muted); font-size: 11.5px; }
.gg-chat .cd-replying svg { flex: none; }
.gg-chat .cd-replying-to { flex: none; }
.gg-chat .cd-replying-to b { color: var(--text); }
.gg-chat .cd-replying-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gg-chat .cd-replying .cd-close { flex: none; width: 22px; height: 22px; }
.gg-chat .cd-thread { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.gg-chat .cd-thread-head { display: flex; flex: none; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.gg-chat .cd-thread-head .cd-link { gap: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gg-chat .cd-thread-head strong { margin-inline-end: auto; }
.gg-chat .cd-thread-count { display: flex; align-items: center; gap: 8px; margin: 6px 12px 2px; color: var(--muted); font-size: 10.5px; font-weight: 650; }
.gg-chat .cd-thread-count::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.gg-chat .cd-thread-error { padding: 8px 12px; }
.cs-panel .cd-thread .cd-log { flex: none; height: 270px; }
/* The chat page shows a thread beside its channel, and in its place when the page is narrow. */
.cs-page.has-thread { grid-template-columns: 240px minmax(0, 1fr) minmax(320px, 38%); }
.gg-chat .cs-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-inline-start: 1px solid var(--line); }
.gg-chat .cs-thread .cd-thread-head { height: 50px; padding: 0 10px 0 18px; }
.gg-chat .cs-thread .cd-thread-head strong { font-size: 14px; }
.cs-page .cs-thread .cd-msg { padding-inline-end: 14px; padding-inline-start: 14px; }
.cs-page .cs-thread .cd-form { padding: 10px 14px; }
@media (max-width: 1100px) {
  .cs-page.has-thread { grid-template-columns: 240px minmax(0, 1fr); }
  .cs-page.has-thread .cs-main { display: none; }
  .gg-chat .cs-thread { border-inline-start: 0; }
}
@media (max-width: 780px) {
  .cs-page.has-thread { grid-template-columns: minmax(0, 1fr); }
}
.gg-chat a.cd-tool { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
/* Where chat is narrow, Reply and Thread show as icons, so a message's menu fits beside it. */
.chat-dock .cd-act-label, .cs-thread .cd-act-label, .cs-panel .cd-act-label { display: none; }
.chat-dock .cd-actions, .cs-thread .cd-actions, .cs-panel .cd-actions { gap: 8px; }

.gg-chat .cd-face > img { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
/* Gate & Globe game app. The site's colours, built dense: small type, tight rows, panels
   with thin rules rather than airy cards. */


:root {
  color-scheme: light;
  --tb-h: 46px; --navy: #102e46; --navy-2: #193f5c; --navy-3: #13334d; --sky: #24638a; --amber: #efbc73; --amber-2: #ffd299;
  --bg: #f3efe4; --panel: #fff; --panel-2: #faf8f2; --text: #1f3341; --muted: #6f7d86; --faint: #9aa6ad; --line: #e1e4e2; --line-2: #eceeec;
  --head: #f4f6f6; --accent: #24638a; --accent-soft: #e8f1f6; --hover: #f1f6f9; --sel: #e2eef5; --zebra: #f1f4f6; --btn-line: #193f5c; --ph-bg: #e8edf0; --card-shadow: 0 1px 2px #1f33410f, 0 3px 10px #1f334114;
  --good: #2f7a5d; --good-soft: #e6f3ec; --bad: #b2453d; --bad-soft: #f9e9e7; --warn: #a8701c; --warn-soft: #fbf1df;
  --c1: #24638a; --c2: #d8913a; --c3: #2f7a5d; --c4: #8b5aa6; --c5: #b2453d; --c6: #4f8fb3; --c7: #7c8b45; --c8: #c46a8f;
  --land: #e7e4da; --land-line: #cfcabb; --sea: #d6e4ec;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --route-lightness: 48%; --row: 28px; --button: #24638a; --on-color: #fff; --livery-sky: #e8f0f5; --gold: #946a21;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 13.5px; line-height: 1.4; color: var(--text); background: var(--bg);
  font-feature-settings: "tnum" 1, "cv11" 1;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --route-lightness: 65%; --navy: #0b2031; --navy-2: #133248; --navy-3: #102838; --button: #2e6c92; --on-color: #102330; --livery-sky: #203947; --gold: #e0bf84;
    --bg: #0d1820; --panel: #14232c; --panel-2: #172832; --text: #d9e3e8; --muted: #8da0ab; --faint: #8a9da8; --line: #24363f; --line-2: #1d2e37;
    --head: #182b35; --accent: #8ebbd5; --accent-soft: #1b3443; --hover: #1a2f3a; --sel: #1f3a4a; --zebra: #182a34; --btn-line: #3a5a73; --ph-bg: #1c3140; --card-shadow: 0 1px 2px #00000040, 0 3px 12px #00000038;
    --good: #8cc9ad; --good-soft: #17332a; --bad: #e39187; --bad-soft: #3a2220; --warn: #e0bf84; --warn-soft: #3a3020;
    --c1: #6fa8cc; --c2: #e0a35c; --c3: #6cb894; --c4: #b48ccc; --c5: #e08a80; --c6: #8ac0dd; --c7: #a7b86c; --c8: #e095b4;
    --land: #1d2e36; --land-line: #2c434e; --sea: #0f1d25;
  }

@media (prefers-color-scheme: dark) {
:root:not([data-theme]) {
    color-scheme: dark;
    --route-lightness: 65%; --navy: #0b2031; --navy-2: #133248; --navy-3: #102838; --button: #2e6c92; --on-color: #102330; --livery-sky: #203947; --gold: #e0bf84;
    --bg: #0d1820; --panel: #14232c; --panel-2: #172832; --text: #d9e3e8; --muted: #8da0ab; --faint: #8a9da8; --line: #24363f; --line-2: #1d2e37;
    --head: #182b35; --accent: #8ebbd5; --accent-soft: #1b3443; --hover: #1a2f3a; --sel: #1f3a4a; --zebra: #182a34; --btn-line: #3a5a73; --ph-bg: #1c3140; --card-shadow: 0 1px 2px #00000040, 0 3px 12px #00000038;
    --good: #8cc9ad; --good-soft: #17332a; --bad: #e39187; --bad-soft: #3a2220; --warn: #e0bf84; --warn-soft: #3a3020;
    --c1: #6fa8cc; --c2: #e0a35c; --c3: #6cb894; --c4: #b48ccc; --c5: #e08a80; --c6: #8ac0dd; --c7: #a7b86c; --c8: #e095b4;
    --land: #1d2e36; --land-line: #2c434e; --sea: #0f1d25;
  }

}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; overscroll-behavior-y: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.2px; }
p { margin: 0 0 8px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.num { text-align: end; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 650; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 6px; }
.gap4 { gap: 4px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb8 { margin-bottom: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide-sm { }
.show-sm { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- App shell ---- */
.app { display: grid; grid-template-columns: 196px minmax(0, 1fr); grid-template-rows: var(--tb-h) minmax(0, 1fr); min-height: 100vh; }
/* The top bar stacks above chat and the phone's bottom bar and menu, so the menus that open
   from it are not drawn under them; sheets and dialogs stack above it. */
.topbar { grid-column: 1 / -1; min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 10px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 75; box-shadow: 0 4px 14px #0b16204d; }
.topbar a { color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.4px; font-size: 15.5px; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; }
.brand .amp { color: var(--amber); font-weight: 400; }
.tb-season { display: flex; flex-direction: column; line-height: 1.15; flex: none; }
.tb-season .w { font-size: 11.5px; color: #a9c0cf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The world's name takes the clock's width and no more. */
.tb-season .w { margin-bottom: 3px; width: 0; min-width: 100%; }
.tb-meta, .tb-short { display: none; }
.flap-wd, .flap-s { display: contents; }
.tb-clock { display: flex; align-items: center; white-space: nowrap; }
.tb-clock .pace { font-weight: 500; color: var(--amber); font-size: 11.5px; margin-inline-start: 6px; font-variant-numeric: tabular-nums; }
/* Split-flap cards */
.flaps { display: inline-flex; align-items: center; gap: 4px; }
.flap-g { display: inline-flex; align-items: center; gap: 1px; }
.flap-d { display: contents; }
.flap-colon { color: #f4efe1; font: 700 12px/18px var(--mono); margin: 0 1px; }
.flap { position: relative; display: inline-block; height: 18px; font: 700 12px/18px var(--mono); color: #f4efe1; perspective: 60px; border-radius: 2px; box-shadow: 0 1px 0 #00000055; }
.flap .sizer { display: inline-block; visibility: hidden; padding: 0 2px; min-width: 7px; text-align: center; }
.flap .half { position: absolute; left: 0; right: 0; height: 9px; overflow: hidden; backface-visibility: hidden; }
.flap .half > span { display: block; height: 18px; text-align: center; }
.flap .top { top: 0; background: #0c2538; border-radius: 2px 2px 0 0; }
.flap::after { content: ''; position: absolute; z-index: 1; left: 0; right: 0; top: 9px; height: 1px; background: linear-gradient(90deg, #050f18 0 2px, #050f1830 2px calc(100% - 2px), #050f18 calc(100% - 2px)); pointer-events: none; }
.flap .bot { bottom: 0; background: #0a1f30; border-radius: 0 0 2px 2px; }
.flap .bot > span { margin-top: -9px; }
.flap .fold { z-index: 2; transform-origin: 50% 100%; }
.flap .unfold { z-index: 2; transform-origin: 50% 0; }
.flap.b1 .half > span { filter: url(#flap-blur-1); }
.flap.b2 .half > span { filter: url(#flap-blur-2); }
.flap.b3 .half > span { filter: url(#flap-blur-3); }
.flap.b4 .half > span { filter: url(#flap-blur-4); }
.tb-sep { width: 1px; height: 24px; background: #ffffff22; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 6px; background: transparent; border: 1px solid #ffffff26; color: #fff; cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.tb-btn:hover { background: #ffffff14; text-decoration: none; }
.tb-btn .count { background: var(--amber); color: var(--navy); border-radius: 8px; padding: 0 5px; font-size: 10.5px; font-weight: 750; min-width: 16px; text-align: center; }
.tb-btn .online-count { background: #3fae6a; color: #fff; }
.topbar a.tb-btn.go { background: var(--amber); border-color: var(--amber); color: var(--navy); font-weight: 700; }
.topbar a.tb-btn.go:hover { background: var(--amber-2); }
.tb-cash { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13px; }
.tb-cash.neg { color: #ffb4a8; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #777; flex: none; }
.dot.live { background: #5fd39b; } .dot.retrying { background: #f0b45e; } .dot.connecting { background: #8fb0c4; }
.sidebar { background: var(--navy-3); color: #c4d3dd; padding: 8px 0 24px; position: sticky; top: var(--tb-h); height: calc(100vh - var(--tb-h)); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ffffff22 transparent; box-shadow: 4px 0 14px #0b16203b; z-index: 1; }
.nav-group { padding: 6px 0 4px; }
.nav-group > div { font-size: 10px; font-weight: 750; letter-spacing: 1.3px; text-transform: uppercase; color: #7f9bae; padding: 4px 14px; }
.nav-link { display: flex; align-items: center; gap: 9px; padding: 5px 14px; color: #c9d7e0; font-size: 13px; border-inline-start: 3px solid transparent; }
.nav-link svg { width: 15px; height: 15px; opacity: .8; flex: none; }
.nav-link:hover { background: #ffffff0d; color: #fff; text-decoration: none; }
.nav-link.active { background: #ffffff14; color: #fff; border-inline-start-color: var(--amber); font-weight: 600; }
.nav-link .count { margin-inline-start: auto; background: var(--amber); color: var(--navy); border-radius: 8px; padding: 0 5px; font-size: 10.5px; font-weight: 750; }
.main { min-width: 0; padding: 12px 16px 40px; }
.main.flush { padding: 0; }
.bottombar { display: none; }

/* ---- Page structure ---- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; min-height: 26px; }
.page-head .grow { display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; }
.page-head h1 { font-size: 16.5px; line-height: 1.3; min-width: 0; flex: 0 0 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.page-head h1 .code { font-size: inherit; letter-spacing: 0; }
.name-en { font-weight: 400; color: var(--muted); margin-inline-start: 0.4em; }
.page-head .sub { color: var(--muted); font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1000; }
.page-head .btns { flex: none; flex-wrap: nowrap; }
.crumbs { font-size: 12.5px; color: var(--muted); flex: none; }
.crumbs::after { content: '›'; margin-inline-start: 8px; }
.crumbs a { color: var(--muted); }
.grid { display: grid; gap: 10px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.grid.side-l { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.grid.plan { grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); }
.span2 { grid-column: span 2; }
/* Capital & shares: wide tables in two thirds, the margin account and smaller lists beside. */
.pf-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) {
  .pf-grid { display: flex; flex-direction: column; }
  .pf-grid > .col { display: contents; }
  .pf-grid .pf-first { order: -1; }
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; min-width: 0; box-shadow: var(--card-shadow); }
.panel > .ph { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 7px 10px; border-bottom: 1px solid var(--line); min-height: 34px; background: var(--ph-bg); border-radius: 6px 6px 0 0; }
.panel > .ph h2, .panel > .ph h3 { font-size: 12.5px; font-weight: 700; letter-spacing: 0; }
.panel > .ph .acts { display: flex; gap: 6px; align-items: center; }
.panel > .pb { padding: 10px; }
.panel > .pb.tight { padding: 6px 10px; }
.panel > .pb.flush { padding: 0; }
.panel + .panel { margin-top: 10px; }
.grid > .panel + .panel { margin-top: 0; }
.profile-aircraft { display: flex; flex-direction: column; }
.profile-aircraft > .ph { flex: none; }
.profile-aircraft > .pb { display: flex; flex: 1; min-height: 0; }
.profile-aircraft .dt { flex: 1; min-height: 0; }
.profile-aircraft .dt-scroll { flex: 1 1 auto; height: 360px; }
/* A type's orders sit under its name, its counts level with the name. */
.profile-fleet .dt td { vertical-align: top; padding-top: 6px; padding-bottom: 6px; max-width: none; }
.profile-fleet .order-line { display: block; line-height: 1.4; }
.label { font-size: 10.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 13px; }
.kv > dt { color: var(--muted); }
.kv > dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; }
.kv.wide { gap: 7px 18px; } .kv.wide > dd { text-align: start; }
.kv.left > dd { text-align: start; }
.divider { height: 1px; background: var(--line); margin: 8px 0; }
.note { padding: 7px 10px; border-radius: 6px; background: var(--accent-soft); font-size: 12.5px; }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.good { background: var(--good-soft); color: var(--good); }
.note.warn { background: var(--warn-soft); color: var(--warn); }

/* ---- Needs attention: one line for each thing to act on, with its actions ---- */
.attention .att { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px; border-inline-start: 3px solid var(--accent); border-bottom: 1px solid var(--line-2); font-size: 13px; }
.attention .att:last-child { border-bottom: 0; }
.attention .att.t-bad { border-inline-start-color: var(--bad); }
.attention .att.t-warn { border-inline-start-color: var(--warn); }
.attention .att-note { padding: 7px 12px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.attention .att .btns { flex: none; }
@media (max-width: 720px) { .attention .att { flex-direction: column; align-items: flex-start; } }

/* ---- Stats strip ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stat { padding: 7px 10px 8px; border-inline-end: 1px solid var(--line-2); min-width: 0; }
.stat:last-child { border-inline-end: 0; }
.stat .l { font-size: 10.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--muted); line-height: 1.25; }
.stat .v { font-size: 17.5px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v .wrapv { display: block; white-space: normal; font-size: 14.5px; line-height: 1.3; letter-spacing: 0; }
.stat .d { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.stat .spark { margin-top: 2px; }

/* ---- Buttons and fields ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 29px; padding: 0 11px; border-radius: 6px; border: 1px solid var(--btn-line); background: var(--panel); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--button); border-color: var(--button); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.accent { background: var(--amber); border-color: var(--amber); color: var(--navy); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 24px; padding: 0 8px; font-size: 12px; }
.btn.xs { height: 21px; padding: 0 6px; font-size: 11.5px; border-radius: 5px; }
.btn:disabled, .btn.busy { opacity: .55; cursor: default; }
.btn .spin { width: 11px; height: 11px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn svg { width: 14px; height: 14px; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.input, .select, textarea.input { height: 29px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); min-width: 0; font-size: 13px; }
textarea.input { height: auto; padding: 6px 8px; resize: vertical; }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.input.num { text-align: end; }
.input.invalid { border-color: var(--bad); }
.input.sm, .select.sm { height: 24px; font-size: 12.5px; padding: 0 6px; }
.affix { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); overflow: hidden; height: 28px; }
.affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.affix > span { display: flex; align-items: center; padding: 0 7px; color: var(--muted); background: var(--head); font-size: 12.5px; }
.affix > input { border: 0; outline: 0; background: transparent; min-width: 0; width: 100%; padding: 0 7px; font-size: 13px; text-align: end; }
.affix.sm { height: 24px; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field > label, .field > .fl { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .err { font-size: 11.5px; color: var(--bad); }
.form { display: grid; gap: 9px; }
.form.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; user-select: none; border: 0; background: transparent; padding: 0; color: inherit; font-family: inherit; text-align: start; }
.check .tick { width: 14px; height: 14px; flex: none; border-radius: 5px; border: 1.5px solid var(--line); background: var(--panel); position: relative; transition: background .1s, border-color .1s; }
.check:hover .tick { border-color: var(--accent); }
.check .tick.on { background: var(--accent); border-color: var(--accent); }
.check .tick.on::after { content: ""; position: absolute; left: 4px; top: 1px; width: 3px; height: 7px; border: solid var(--on-color); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check .tick.part { background: var(--accent); border-color: var(--accent); }
.check .tick.part::after { content: ""; position: absolute; left: 2px; top: 4.5px; width: 7px; height: 2px; background: var(--on-color); }
.check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--panel); height: 26px; }
.seg button { border: 0; background: transparent; padding: 0 9px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-inline-end: 1px solid var(--line); white-space: nowrap; }
.seg button:last-child { border-inline-end: 0; }
.seg button.on { background: var(--accent); color: var(--on-color); }
.seg button:hover:not(.on) { background: var(--hover); color: var(--text); }
.seg-n { font-weight: 500; opacity: .7; margin-inline-start: 2px; font-variant-numeric: tabular-nums; }
.daystrip { display: flex; gap: 6px; align-items: stretch; }
.daystrip > .btn { height: auto; flex: none; }
.daystrip .day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); cursor: pointer; text-align: start; white-space: nowrap; overflow: hidden; }
.daystrip .day small { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.daystrip .day b { font-size: 14px; }
.daystrip .day.past b { color: var(--muted); font-weight: 600; }
.daystrip .day:hover:not(.on) { background: var(--hover); border-color: var(--accent); }
.daystrip .day.on { background: var(--accent); border-color: var(--accent); color: var(--on-color); }
.daystrip .day.on small, .daystrip .day.on b { color: inherit; }
.daystrip .day.on small { opacity: .8; }
@media (max-width: 640px) {
  .daystrip { gap: 4px; }
  .daystrip .day { align-items: center; padding: 5px 2px; }
  .daystrip .day .mon { display: none; }
  .daystrip .day small { font-size: 10px; letter-spacing: 0; }
}
.toggle { position: relative; width: 30px; height: 17px; border-radius: 9px; background: var(--line); border: 0; cursor: pointer; flex: none; padding: 0; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: left .12s; box-shadow: 0 1px 2px #0003; }
.toggle.on { background: var(--good); }
.toggle.on::after { left: 15px; }
.slider { width: 100%; accent-color: var(--accent); }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; border-radius: 9px; font-size: 11px; font-weight: 650; background: var(--head); color: var(--muted); white-space: nowrap; border: 1px solid var(--line-2); }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.solid { background: var(--navy); color: #fff; border-color: transparent; }
.code { display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 650; letter-spacing: .3px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 4px 1px 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 3px; font-size: 13.5px; line-height: 1; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex: none; }

/* ---- Tabs ---- */
.tabs { display: flex; min-width: 0; max-width: 100%; padding: 0 8px; border-bottom: 2px solid var(--button); margin-bottom: 10px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
/* With a mouse, a row of tabs too long for its space shows a thin scrollbar to reach the rest. */
@media (hover: hover) and (pointer: fine) { .tabs { scrollbar-width: thin; } }
.tabs button, .tabs a { position: relative; display: inline-flex; align-items: center; flex: none; height: 29px; padding: 0 13px; margin-inline-start: -1px; border: 1px solid var(--btn-line); border-bottom: 0; border-radius: 7px 7px 0 0; background: var(--panel); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button:first-child, .tabs a:first-child { margin-inline-start: 0; }
.tabs button:hover, .tabs a:hover { z-index: 1; border-color: var(--accent); background: var(--hover); text-decoration: none; }
.tabs .on, .tabs .on:hover { z-index: 2; background: var(--button); border-color: var(--btn-line); color: #fff; }
.tabs .on:hover { filter: brightness(1.08); }
/* The selected tab flares out into the bar beneath it, as Chrome's do. */
.tabs .on::before, .tabs .on::after { content: ""; position: absolute; bottom: 0; width: 10px; height: 8px; pointer-events: none; }
.tabs .on::before { left: -8px; background: radial-gradient(circle at 0 0, transparent 7px, var(--btn-line) 7.5px 8px, var(--button) 8.5px); }
.tabs .on::after { right: -8px; background: radial-gradient(circle at 100% 0, transparent 7px, var(--btn-line) 7.5px 8px, var(--button) 8.5px); }
.tabs .on .count { color: #ffffffb3; }
.tabs .count { margin-inline-start: 5px; font-size: 11px; color: var(--faint); font-weight: 600; }

/* ---- Data table ---- */
.dt { display: flex; flex-direction: column; min-width: 0; }
.dt-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dt-bar .input { height: 24px; font-size: 12.5px; width: 180px; }
.dt-bar .info { font-size: 11.5px; color: var(--muted); margin-inline-start: auto; white-space: nowrap; }
.dt-sel { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: var(--sel); border-bottom: 1px solid var(--line); font-size: 12.5px; flex-wrap: wrap; }
.dt-scroll { overflow: auto; position: relative; min-height: 0; }
.dt table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
.dt th { position: sticky; top: 0; z-index: 2; background: var(--head); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; text-align: start; padding: 0 7px; height: 28px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.dt th.sortable { cursor: pointer; }
.dt th.sortable:hover { color: var(--text); }
.dt th .arrow { font-size: 9px; margin-inline-start: 3px; color: var(--accent); }
.dt th.right, .dt td.right { text-align: end; }
.dt th.center, .dt td.center { text-align: center; }
.dt td { padding: 0 7px; height: var(--row); border-bottom: 1px solid var(--line-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; font-variant-numeric: tabular-nums; }
.dt td.wrap { white-space: normal; }
/* Compact tables (Settings, Display): tighter rows and spacing in every table. */
html[data-tables="compact"] { --row: 22px; }
html[data-tables="compact"] .dt td { padding: 0 5px; font-size: 12px; }
html[data-tables="compact"] .dt th { height: 24px; padding: 0 5px; font-size: 10.5px; }
html[data-tables="compact"] .dt-bar { padding: 4px 6px; }
.dt tbody tr { --rowbg: var(--panel); }
.dt tbody tr:nth-child(even) { --rowbg: var(--zebra); background: var(--zebra); }
.dt tbody tr:hover td { background: var(--hover); }
.dt tbody tr.clickable { cursor: pointer; }
.dt tbody tr.clickable:focus { outline: none; }
.dt tbody tr.clickable:focus-visible { outline: 2px solid var(--c1); outline-offset: -2px; }
.dt tbody tr.selected td { background: var(--sel); }
.dt tbody tr.dim td { color: var(--faint); }
.dt tbody tr.warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.dt tbody tr.bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.dt tbody tr.good td:first-child { box-shadow: inset 3px 0 0 var(--good); }
/* Order book depth: a bar from the right edge, as wide as --depth, for the shares standing from the spread out to the row. */
.dt tbody tr.depth-sell, .dt tbody tr.depth-buy { background-repeat: no-repeat; background-position: right center; background-size: var(--depth, 0%) 100%; }
.dt tbody tr.depth-sell { background-image: linear-gradient(color-mix(in srgb, var(--bad) 14%, transparent), color-mix(in srgb, var(--bad) 14%, transparent)); }
.dt tbody tr.depth-buy { background-image: linear-gradient(color-mix(in srgb, var(--good) 14%, transparent), color-mix(in srgb, var(--good) 14%, transparent)); }
.dt tbody tr.depth-sell:hover td, .dt tbody tr.depth-buy:hover td { background: color-mix(in srgb, var(--hover) 60%, transparent); }
/* Options chain: series in the money are shaded, and a line runs where the share price falls between strikes. */
.dt tbody td.itm { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.dt tbody tr.spot td { box-shadow: inset 0 2px 0 var(--accent); }
.dt td.cb, .dt th.cb { width: 28px; padding: 0 0 0 8px; text-overflow: clip; }
.dt td.cb .check, .dt th.cb .check { vertical-align: middle; }
.dt tfoot td { position: sticky; bottom: 0; background: var(--head); font-weight: 650; border-top: 1px solid var(--line); border-bottom: 0; }
.dt .first { position: sticky; left: 0; z-index: 1; background: var(--rowbg, var(--panel)); }
.dt th.first, .dt tfoot td.first { z-index: 3; background: var(--head); }
.dt-empty { padding: 18px 12px; color: var(--muted); text-align: center; font-size: 13px; }
.dt-menu { position: relative; }
.pop { position: absolute; z-index: 60; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 10px 30px #0003; padding: 6px; min-width: 180px; }
.pop.right { right: 0; }
.pop .item { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 5px; font-size: 12.5px; cursor: pointer; white-space: nowrap; border: 0; background: transparent; width: 100%; text-align: start; color: var(--text); }
.pop .item:hover { background: var(--hover); text-decoration: none; }
.pop .sep { height: 1px; background: var(--line); margin: 4px 0; }
.pop .hdr { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 4px 6px 2px; font-weight: 700; }
.ctx-menu { position: fixed; z-index: 1000; min-width: 210px; max-width: 340px; max-height: calc(100vh - 8px); overflow-y: auto; padding: 4px; }
.ctx-menu .hdr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-menu .item { padding: 5px 8px 5px 6px; }
.ctx-menu .item:focus { background: var(--hover); outline: none; }
.ctx-menu .item:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.ctx-menu .item:disabled { opacity: .45; cursor: default; background: transparent; }
.ctx-menu .item.danger { color: var(--bad); }
.ctx-menu .ic { width: 14px; flex: none; display: inline-flex; justify-content: center; color: var(--muted); }
.ctx-menu .item.danger .ic { color: inherit; }
.ctx-menu .lbl { overflow: hidden; text-overflow: ellipsis; }
.ctx-menu .keys { margin-inline-start: auto; padding-inline-start: 18px; color: var(--faint); font-size: 11px; }
.bar-cell { display: flex; align-items: center; gap: 6px; }
.bar-cell .bar { flex: 1; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; min-width: 30px; }
.bar-cell .bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar-cell .bar.stack { display: flex; } .bar-cell .bar.stack > i { border-radius: 0; flex: none; } .bar-cell .bar > i.other { background: var(--faint); }
.bar-cell .bar > i.good { background: var(--good); } .bar-cell .bar > i.warn { background: var(--warn); } .bar-cell .bar > i.bad { background: var(--bad); }

/* ---- Picker ---- */
.picker { position: relative; min-width: 0; }
.picker .pop { left: 0; right: 0; max-height: 320px; overflow-y: auto; padding: 4px; min-width: 260px; }
.picker .opt { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 4px; cursor: pointer; font-size: 12.5px; }
.picker .opt.on, .picker .opt:hover { background: var(--hover); }
.picker .opt .code { color: var(--accent); }
.ap { position: relative; display: flex; align-items: center; min-width: 0; height: 29px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 13px; }
.ap.sm { height: 24px; font-size: 12.5px; }
.ap:focus-within, .ap.open { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ap-in { position: absolute; inset: 0; width: 100%; padding: 0 44px 0 8px; border: 0; border-radius: inherit; background: transparent; outline: none; font-size: inherit; }
.ap.sm .ap-in { padding-inline-start: 6px; }
.ap-val { position: absolute; left: 8px; right: 44px; pointer-events: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap.sm .ap-val { left: 6px; }
.ap-val .code { color: var(--accent); }
.ap-val.ph { color: var(--muted); }
.ap.open .ap-val { opacity: .5; }
.ap-x { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14.5px; line-height: 1; padding: 2px 4px; border-radius: 3px; }
.ap-x:hover { color: var(--text); background: var(--hover); }
.ap-chev { position: absolute; right: 0; top: 0; bottom: 0; width: 20px; cursor: pointer; }
.ap-chev::after { content: ""; position: absolute; left: 4px; top: 50%; margin-top: -2px; border: 4px solid transparent; border-top-color: var(--muted); }
.ap.open .ap-chev::after { margin-top: -6px; border-top-color: transparent; border-bottom-color: var(--muted); }
.ap-menu { position: fixed; z-index: 110; overflow-y: auto; overscroll-behavior: contain; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px #0b162033; padding-bottom: 3px; }
.ap-h { position: sticky; top: 0; z-index: 1; display: flex; gap: 6px; padding: 5px 8px 3px; background: var(--panel); font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.ap-h span { font-weight: 600; color: var(--faint); }
.ap-h:not(:first-child) { margin-top: 3px; border-top: 1px solid var(--line-2); }
.ap-o { display: flex; align-items: baseline; gap: 6px; padding: 3px 8px; font-size: 12.5px; line-height: 18px; white-space: nowrap; cursor: pointer; }
.ap-o .code { flex: none; width: 30px; color: var(--accent); }
.ap-o b { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ap-o .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.ap-o .tag { flex: none; font-size: 10.5px; color: var(--muted); }
.ap-o.hi { background: var(--hover); }
.ap-o.on { background: var(--sel); box-shadow: inset 2px 0 0 var(--amber); }
.ap-empty { padding: 6px 8px 3px; font-size: 12.5px; color: var(--muted); }
@media (pointer: coarse) { .ap-o { padding: 7px 10px; font-size: 13.5px; } }

/* ---- Sheets, modals, toasts ---- */
.scrim { position: fixed; inset: 0; background: #0b16205c; z-index: 80; display: flex; justify-content: flex-end; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(580px, 100vw); height: 100%; background: var(--bg); box-shadow: -10px 0 40px #0003; display: flex; flex-direction: column; animation: slide .16s ease-out; }
.sheet.wide { width: min(900px, 100vw); }
@keyframes slide { from { transform: translateX(30px); opacity: .5; } }
.sheet > .sh { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px 11px 16px; background: var(--navy); color: #fff; border-bottom: 3px solid var(--amber); }
.sheet > .sh .sh-t { flex: 1; min-width: 0; }
.sheet > .sh h2 { font-size: 16.5px; line-height: 1.3; color: #fff; }
.sheet > .sh h2 .code, .sheet > .sh h2 a { color: var(--amber); }
.sheet > .sh .sh-sub { font-size: 12.5px; color: #b8cad6; margin-top: 2px; }
.sheet > .sh .sh-sub a { color: #e6eef3; }
.sheet > .sh .btn.ghost { color: #b8cad6; }
.sheet > .sh .btn.ghost:hover { color: #fff; background: #ffffff1a; }
.sheet > .sb { flex: 1; overflow-y: auto; padding: 14px 16px 18px; }
.sheet > .so { flex: none; max-height: 42vh; overflow-y: auto; padding: 10px 16px 12px; border-top: 1px solid var(--line); background: var(--panel); box-shadow: 0 -6px 16px #0b162010; }
@media (max-width: 600px), (max-height: 700px) { .sheet > .so { max-height: 30vh; } }
.sheet > .so .so-h { font-size: 10.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.sheet > .so .preview { border: 0; padding: 0; background: transparent; font-size: 13px; }
.sheet > .so .preview.no { padding: 8px 10px; background: var(--bad-soft); color: var(--bad); border-radius: 6px; }
.sheet > .so .preview.idle, .sheet > .so .preview.wait { color: var(--muted); }
.sheet > .sf { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; background: var(--panel-2); }
.btn .btn-cost { opacity: .8; font-weight: 600; }
.affix > span { white-space: nowrap; }
.preview .moved { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 6px; padding: 3px 0; border-top: 1px dashed var(--line); }
/* A checked timetable: its departure patterns and every flight, as compact tables. */
.ctt { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; align-self: flex-start; }
.ctt.wide { width: 100%; }
.ctt th { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); text-align: start; padding: 0 20px 2px 0; white-space: nowrap; }
.ctt td { padding: 2px 20px 2px 0; border-top: 1px dashed var(--line); white-space: nowrap; }
.ctt th:last-child, .ctt td:last-child { padding-inline-end: 0; }
.ctt td.t { font-family: var(--mono); font-weight: 650; }
.ctt-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.ctt-foot > details[open] { flex-basis: 100%; order: 1; }
.ctt-foot summary { cursor: pointer; color: var(--muted); }
.ctt-foot details .ctt { margin-top: 4px; }
.chips.inline { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; }
.chips.inline .chip { padding: 1px 7px; font-size: 11.5px; }
.cabin-fix { margin-inline-start: 6px; padding: 0 6px; height: 20px; font-size: 11.5px; }
.cabin-fix.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
/* A sheet's form: fields as cards on the sheet's ground, labels that read as questions. */
.sheet-form { display: flex; flex-direction: column; gap: 12px; }
.sheet .sb > .col > .field, .sheet-form > .field, .sheet-form > .form, .sheet-form > .rule-card { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px 11px; }
.sheet-form > .form > .field { background: transparent; border: 0; padding: 0; }
.sheet-form .field > .fl, .sheet-form .field > label { font-size: 13px; font-weight: 650; color: var(--text); margin-bottom: 3px; }
.sheet-form .field .hint { font-size: 12px; line-height: 1.4; }
.sheet-form > .small, .sheet-form > .note { line-height: 1.45; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.facts .fact { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-inline-end: 1px solid var(--line-2); min-width: 0; }
.facts .fact:last-child { border-inline-end: 0; }
.facts .k { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts .v { font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts .v.good { color: var(--good); } .facts .v.bad { color: var(--bad); } .facts .v.warn { color: var(--warn); }
.modal-wrap { position: fixed; inset: 0; z-index: 90; background: #0b16205c; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .12s; }
.modal { background: var(--panel); border-radius: 8px; width: min(440px, 100%); box-shadow: 0 20px 60px #0005; }
.modal > .mb { padding: 14px 16px; }
.modal > .mb h2 { font-size: 15.5px; margin-bottom: 6px; }
.check-wrap { z-index: 120; }
.check-box { margin-top: 12px; min-height: 65px; }
.check-error { margin-top: 8px; color: var(--bad); font-size: 13px; }
.modal > .mf { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; right: 12px; bottom: 12px; z-index: 100; display: flex; flex-direction: column; gap: 6px; width: min(360px, calc(100vw - 24px)); }
.toast { background: var(--panel); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: 6px; padding: 8px 10px; box-shadow: 0 8px 24px #0003; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; animation: slide .16s ease-out; }
.toast.ok { border-inline-start-color: var(--good); } .toast.error { border-inline-start-color: var(--bad); } .toast.notice { border-inline-start-color: var(--amber); }
.toast .t { font-weight: 650; }
.toast > button { margin-inline-start: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15.5px; line-height: 1; }
.preview { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; background: var(--panel-2); }
.preview.ok { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.preview.no { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: var(--bad-soft); }
.preview.wait { display: flex; align-items: center; gap: 8px; }
.purses { display: flex; flex-direction: column; }
.purse { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(150px, auto); column-gap: 14px; align-items: baseline; padding: 4px 0; font-size: 13.5px; }
.purse + .purse { border-top: 1px dashed var(--line); }
.purse .pn { font-weight: 600; }
.purse .num { text-align: end; font-variant-numeric: tabular-nums; }
.purse .pa { color: var(--muted); font-size: 12.5px; text-align: end; font-variant-numeric: tabular-nums; }
.purse .pp { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.purse .pp.bad { color: var(--bad); }
.purse .pp.warn { color: var(--warn); }
.purse.two { grid-template-columns: minmax(0, 1fr) auto; }
.purse.total { border-top: 1px solid var(--line) !important; font-weight: 650; }
/* In a narrow box, such as founding's beside the map, what is left goes under the figure. */
.purses { container-type: inline-size; }
@container (max-width: 380px) {
  .purse { grid-template-columns: minmax(0, 1fr) auto; }
  .purse .pa { grid-column: 1 / -1; text-align: start; }
}
.purse-h { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding: 8px 0 2px; }
.preview .purses + * { margin-top: 8px; }
.pv-extra > .mt8:first-child, .pv-extra > :first-child .mt8:first-child { margin-top: 0; }
.pv-extra + * { margin-top: 8px; }
.preview .spin { width: 11px; height: 11px; border: 2px solid var(--muted); border-inline-end-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
.preview .moves { width: 100%; border-collapse: collapse; font-size: 13px; }
.preview .moves + .moves, .preview .moves + *, .preview > .muted + * { margin-top: 8px; }
.preview .moves td { padding: 3px 0; }
.preview .moves td.mh { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding-bottom: 2px; }
.preview .moves td.num { text-align: end; font-weight: 600; white-space: nowrap; padding-inline-start: 12px; }
.preview .moves tr + tr td { border-top: 1px dashed var(--line); }
.preview .moves tr:nth-child(2) td { border-top: 0; }
.preview .moves tr.total td { border-top: 1px solid var(--line); font-weight: 600; }

/* ---- Charts ---- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 10.5px; }
.chart .grid line { stroke: var(--line-2); }
.chart .zero { stroke: var(--line); }
.chart .tip { position: absolute; pointer-events: none; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px #0002; padding: 5px 7px; font-size: 11.5px; white-space: nowrap; }
.chart .tip .r { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.chart .legend span { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.chart .legend span.off { opacity: .4; }
.meter { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); }

/* ---- Map ---- */
.map-screen { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - var(--tb-h)); min-height: 0; }
.map-screen.details-open { grid-template-columns: minmax(0, 1fr) 320px; }
.map-screen > .map-wrap { min-height: 0; }
.map-toolbar { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel); position: relative; z-index: 6; min-width: 0; }
.map-toolbar .dd { flex: 1 1 200px; min-width: 0; max-width: 300px; }
.map-toolbar .seg, .map-toolbar .btn { flex: none; }
.map-toolbar .map-details-toggle { margin-inline-start: auto; }
.map-screen .side { border-inline-start: 1px solid var(--line); background: var(--panel); overflow: hidden; min-height: 0; display: flex; flex-direction: column; }
.map-screen .side[hidden] { display: none; }
.map-side-head { padding: 8px 10px 0; flex: 0 1 auto; min-height: 0; max-height: 50%; overflow-y: auto; }
.map-compact-tabs { display: none; }
.map-side-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.map-side-split { flex: 1; min-height: 88px; display: grid; overflow: hidden; }
.map-side-section { overflow: hidden; }
.map-side-section.collapsed .map-side-content { display: none; }
.map-side-divider { cursor: row-resize; touch-action: none; user-select: none; background: var(--line); position: relative; }
.map-side-divider::after { content: ''; position: absolute; width: 32px; height: 2px; top: 3px; left: calc(50% - 16px); background: var(--muted); border-radius: 2px; }
.map-side-divider:hover, .map-side-divider:focus-visible { background: var(--accent); outline: none; }
.map-side-toggle { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px 8px; align-self: stretch; }
.map-side-toggle:hover { color: var(--accent); }
.map-side-tabs { padding: 0 10px; flex-shrink: 0; height: 40px; display: flex; align-items: flex-end; }
.map-side-tabs .map-side-toggle { align-self: center; }
.map-side-tabs .tabs { flex: 1; min-width: 0; margin-bottom: 0; }
.map-side-content { flex: 1; min-height: 0; overflow: auto; }

/* ---- Timetable charts ---- */
.gantt { position: relative; font-size: 11px; overflow-x: auto; user-select: none; }
.gantt.dragging, .gantt.dragging * { cursor: grabbing !important; }
.gantt-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); border-bottom: 1px solid var(--line-2); min-height: 28px; }
.gantt-row:hover > .gt { background: var(--hover); }
.gantt-row.drop > .gl, .gantt-row.drop > .gt { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.gantt-row > .gl { padding: 4px 8px; border-inline-end: 1px solid var(--line); background: var(--panel); position: sticky; left: 0; z-index: 4; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gl-in { display: flex; align-items: center; gap: 5px; min-width: 0; }
.gl-util { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gl-util .bar { width: 22px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.gl-util .bar i { display: block; height: 100%; background: var(--good); }
.gantt-row > .gt { position: relative; min-width: 700px; }
.gantt-blk { --rc: var(--accent); position: absolute; top: 3px; bottom: 3px; border-radius: 3px; background: var(--rc); color: var(--on-color); overflow: hidden; white-space: nowrap; padding: 0; line-height: 20px; cursor: pointer; font-weight: 600; border: 1px solid #0002; z-index: 2; transition: opacity .12s, filter .12s; }
.gantt-blk > span { position: relative; display: block; padding: 0 3px; }
.gantt-blk b { font-weight: 750; }
.gantt-blk .t { opacity: .85; font-weight: 500; }
.gantt-blk.mv { cursor: grab; touch-action: none; }
.gantt-blk.ret { background: color-mix(in srgb, var(--rc) 72%, #fff); color: #0e2233; border-color: color-mix(in srgb, var(--rc) 70%, #000); }
.gantt-blk.chr { background: repeating-linear-gradient(135deg, var(--rc) 0 5px, color-mix(in srgb, var(--rc) 75%, #fff) 5px 10px); }
.gantt-blk.past { opacity: .5; }
.gantt-blk.dim { opacity: .16; }
.gantt-blk:hover { filter: brightness(1.08); z-index: 3; }
.gantt-blk.sel { outline: 2px solid var(--amber); outline-offset: 1px; z-index: 3; opacity: 1; }
.gantt-blk.moved { box-shadow: 0 0 0 2px var(--amber); }
.gantt-blk.drag { z-index: 5; opacity: .9; box-shadow: 0 3px 10px #0004; }
.gantt-blk .prog { position: absolute; left: 0; top: 0; bottom: 0; background: #fff3; border-inline-end: 2px solid #fff; }
.gantt-gnd { position: absolute; top: 8px; bottom: 8px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); color: var(--faint); font-size: 10px; line-height: 10px; text-align: center; overflow: hidden; white-space: nowrap; z-index: 1; }
.gantt-gnd.idle { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--line-2) 4px 5px); }
.gantt-gnd.dim { opacity: .4; }
.gantt-head { display: grid; grid-template-columns: 190px minmax(0, 1fr); position: sticky; top: 0; z-index: 6; background: var(--head); border-bottom: 1px solid var(--line); }
.gantt-head .gt { position: relative; height: 24px; min-width: 700px; }
.gantt-head .gt span { position: absolute; top: 5px; font-size: 10.5px; color: var(--muted); font-weight: 700; transform: translateX(3px); }
.gantt-head .gday { position: absolute; top: 0; bottom: 0; border: 0; background: transparent; text-align: start; padding: 0 5px; font-size: 10.5px; font-weight: 750; color: var(--muted); cursor: zoom-in; }
.gantt-head .gday:hover { background: var(--hover); color: var(--accent); }
.gantt-head .now-tag { position: absolute; top: 3px; transform: translateX(-50%); background: var(--bad); color: var(--on-color); font-size: 10px; font-weight: 700; padding: 1px 4px; border-radius: 3px; z-index: 2; pointer-events: none; }
.gantt-head > .gl { padding: 5px 8px; border-inline-end: 1px solid var(--line); position: sticky; left: 0; z-index: 2; white-space: nowrap; background: var(--head); font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.gantt .vline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.gantt .vline.day { background: var(--line); }
.gantt .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); z-index: 4; opacity: .7; pointer-events: none; }
.tt-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tt-legend { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.tt-route { --rc: var(--accent); display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 2px 8px 2px 6px; font-size: 11.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.tt-route i { width: 10px; height: 10px; border-radius: 3px; background: var(--rc); }
.tt-route.chr i { background: repeating-linear-gradient(135deg, var(--rc) 0 3px, color-mix(in srgb, var(--rc) 70%, #fff) 3px 6px); }
.tt-route.chr { cursor: default; }
.tt-route:hover { border-color: var(--rc); }
.tt-route.on { border-color: var(--rc); box-shadow: inset 0 0 0 1px var(--rc); }
.tt-route.off { opacity: .45; }
.tt-draft { position: sticky; top: 0; z-index: 8; padding: 9px 12px; border-radius: 6px; background: var(--panel); border: 1px solid var(--amber); box-shadow: 0 4px 14px #0002; }
.tt-drag { cursor: grab; white-space: nowrap; }
.tt-drag:active { cursor: grabbing; }
.gantt-blk.shut { background-image: repeating-linear-gradient(135deg, transparent 0 4px, #0000004d 4px 7px); outline: 2px solid var(--bad); outline-offset: -1px; }
.tt-closed { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bad) 6%, var(--panel)); font-size: 12.5px; }
.tt-closure { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 2px 9px; font: inherit; font-size: 12px; color: var(--text); cursor: pointer; }
.tt-closure:hover { border-color: var(--bad); }
.gantt-row.closed-lane { min-height: 22px; background: var(--panel-2); }
.gantt-closed { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bad) 75%, transparent) 0 4px, color-mix(in srgb, var(--bad) 45%, transparent) 4px 8px); color: var(--on-color); font-size: 10.5px; font-weight: 700; line-height: 16px; padding: 0 4px; overflow: hidden; white-space: nowrap; }
.sb-shut { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bad) 60%, transparent) 0 4px, color-mix(in srgb, var(--bad) 20%, transparent) 4px 8px); pointer-events: none; z-index: 1; }
.sb-key .k.shut { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bad) 70%, transparent) 0 2px, color-mix(in srgb, var(--bad) 25%, transparent) 2px 4px); }
.fit.short { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.fit.short > .ph { background: color-mix(in srgb, var(--bad) 8%, var(--panel)); }
.fit-body { padding: 10px 12px; }
.fit-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: transparent; text-align: start; cursor: pointer; color: var(--text); font: inherit; }
.fit-toggle:hover { background: var(--hover); }
.fit-gauge { display: flex; gap: 2px; flex-wrap: wrap; }
.fit-gauge i { width: 14px; height: 14px; border-radius: 3px; background: var(--line); }
.fit-gauge i.used { background: var(--accent); }
.fit-gauge i.free { background: color-mix(in srgb, var(--good) 55%, transparent); }
.fit-gauge i.gap { background: repeating-linear-gradient(135deg, var(--bad) 0 3px, color-mix(in srgb, var(--bad) 30%, transparent) 3px 6px); }
.fit-gauge i.none { background: transparent; border: 1px dashed var(--line); }
.fit-tag { margin-inline-start: 6px; font-size: 10.5px; font-weight: 750; padding: 0 5px; border-radius: 8px; background: #ffffff33; }
.btn:not(.primary) .fit-tag { background: var(--accent-soft); color: var(--accent); }
.fit-routes { width: 100%; border-collapse: collapse; }
.fit-routes th { text-align: start; font-weight: 600; padding: 3px 6px; border-bottom: 1px solid var(--line); }
.fit-routes td { padding: 3px 6px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.fit-routes th.num, .fit-routes td.num { text-align: end; }
.fit-routes tr.ended td { opacity: .5; text-decoration: line-through; }
.fit-routes tr.ended td:last-child { opacity: 1; text-decoration: none; }
.fit-sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.fit-step { display: inline-flex; align-items: center; gap: 2px; }
.fit-step b { min-width: 20px; text-align: center; }
.mb4 { margin-bottom: 4px; }
.fit-more { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; padding: 0; font: inherit; font-size: 12.5px; font-weight: 650; color: var(--accent); cursor: pointer; }
.fit-more:hover { text-decoration: underline; }
.gantt-row.away { min-height: 42px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.gantt-row.away > .gt { cursor: pointer; }
.gl-peak { margin-inline-start: auto; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.gl-peak.bad { color: var(--bad); }
.away-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.away-area { fill: color-mix(in srgb, var(--accent) 30%, transparent); }
.away-over { fill: color-mix(in srgb, var(--bad) 70%, transparent); }
.away-line { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.away-past { fill: var(--panel-2); opacity: .7; }

/* ---- Route planner ---- */
.pl-map { position: relative; height: 420px; overflow: hidden; }
.pl-key { position: absolute; left: 10px; bottom: 30px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; max-width: calc(100% - 20px); padding: 6px 10px; border-radius: 6px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); font-size: 11.5px; box-shadow: 0 2px 8px #0001; pointer-events: none; }
.pl-key span { display: inline-flex; align-items: center; gap: 4px; }
.pl-key i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pl-ways { position: absolute; left: 10px; top: 10px; z-index: 5; display: flex; flex-direction: column; gap: 1px; padding: 3px; border-radius: 6px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); box-shadow: 0 2px 8px #0001; font-size: 11.5px; max-width: calc(100% - 60px); }
.pl-way { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border: 0; border-radius: 4px; background: none; color: var(--text); font: inherit; text-align: start; cursor: default; white-space: nowrap; }
.pl-way b { font-weight: 650; }
.pl-way:hover, .pl-way.on, .pl-way:focus-visible { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.pl-leg { margin: -4px -6px; padding: 4px 6px; border-radius: 6px; }
.pl-leg.on { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pl-tip { min-width: 210px; }
.pl-tip .kv { margin-top: 4px; }
.pl-gap { position: relative; display: inline-block; min-width: 56px; padding-bottom: 3px; }
.pl-gap i { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--good); opacity: .75; }
.pl-weekly { padding: 8px 10px; border-radius: 6px; background: var(--accent-soft); }
.pl-glance { grid-template-columns: repeat(3, 1fr); }
.pl-keep { padding: 8px 10px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; }
.pl-keep-days { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pl-keep-days > span:not(.tiny) { display: inline-flex; gap: 4px; align-items: baseline; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pl-keep-days > span b { font-weight: 600; color: var(--muted); }
.pl-keep-days > span.less { background: var(--warn-soft, var(--bad-soft)); }
.pl-keep-days > span.more { background: var(--good-soft, var(--accent-soft)); }
.change-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin-top: 8px; }
.change-sum > div { padding: 5px 8px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
.change-sum > div span { display: block; font-size: 11.5px; color: var(--muted); }
.change-sum > div b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.change-sum > div.bad b { color: var(--bad); }
.pl-glance > div:nth-child(3n) { border-inline-end: 0; }
.pl-glance > div:nth-child(n+4) { border-top: 1px solid var(--line-2); }
.sb-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.sb-bar .good, .sb-sel .good { color: var(--good); } .sb-bar .fair, .sb-sel .fair { color: var(--warn); } .sb-bar .poor, .sb-sel .poor { color: var(--bad); }
.sb-grid { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; user-select: none; }
.sb-head, .sb-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); }
.sb-head { background: var(--head); border-bottom: 1px solid var(--line); height: 20px; }
.sb-hours { position: relative; }
.sb-hours span { position: absolute; top: 3px; font-size: 10px; font-weight: 700; color: var(--muted); transform: translateX(2px); }
.sb-row { border-bottom: 1px solid var(--line-2); }
.sb-row:last-child { border-bottom: 0; }
.sb-day { display: flex; align-items: center; font-size: 11px; font-weight: 700; color: var(--muted); padding-inline-start: 7px; background: var(--head); border-inline-end: 1px solid var(--line); }
.sb-track { position: relative; height: 30px; background-image: repeating-linear-gradient(to right, var(--line-2) 0 1px, transparent 1px calc(100% / 8)); }
.sb-row.pref { background: var(--panel-2); }
.sb-row.pref .sb-day { font-size: 10px; color: var(--good); }
.sb-row.pref.back .sb-day { color: var(--accent); }
.sb-row.pref.back { border-bottom: 1px solid var(--line); }
.sb-pref { position: relative; height: 22px; background-image: repeating-linear-gradient(to right, var(--line-2) 0 1px, transparent 1px calc(100% / 8)); }
.sb-bar-h { position: absolute; bottom: 0; width: calc(100% / 24 - 2px); margin-inline-start: 1px; border-radius: 2px 2px 0 0; background: var(--good); pointer-events: none; }
.sb-row.pref.back .sb-bar-h { background: var(--accent); }
.sb-track.edit { cursor: copy; }
.sb-curfew { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bad) 35%, transparent) 0 3px, transparent 3px 7px); pointer-events: none; }
.sb-curfew.far { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--c4) 40%, transparent) 0 3px, transparent 3px 7px); }
.sb-busy { position: absolute; top: 0; height: 4px; background: var(--warn); pointer-events: none; }
.sb-gnd { position: absolute; height: 20px; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 1; }
.sb-gnd::before { content: ''; position: absolute; left: 0; right: 0; top: 9px; border-top: 2px solid color-mix(in srgb, var(--muted) 45%, transparent); }
.sb-pinch { position: absolute; top: 0; bottom: 0; background: #ffffff4d; pointer-events: none; }
.sb-blk > span { position: relative; text-shadow: 0 0 3px #0005; }
.sb-blk.back > span { text-shadow: 0 0 3px #fff9; }
.sb-gnd.hov::before, .sb-gnd.sel::before { border-top-color: var(--amber); }
.sb-gnd em { position: relative; font-style: normal; font-size: 10px; font-weight: 700; color: var(--muted); background: var(--panel); padding: 0 3px; border-radius: 3px; line-height: 12px; white-space: nowrap; overflow: hidden; max-width: 100%; }
.sb-blk { position: absolute; height: 20px; border-radius: 4px; color: var(--on-color); font-size: 10.5px; font-weight: 700; line-height: 20px; padding: 0 3px; overflow: hidden; white-space: nowrap; background: var(--accent); border: 1px solid #0003; z-index: 2; box-shadow: 0 1px 2px #0002; }
.sb-blk.back { margin-top: 2px; height: 16px; line-height: 16px; background: color-mix(in srgb, var(--accent) 65%, #fff); color: #0e2233; }
.sb-blk.good { background: var(--c3); } .sb-blk.fair { background: var(--c2); } .sb-blk.poor { background: var(--c5); }
.sb-blk.back.good { background: color-mix(in srgb, var(--c3) 60%, #fff); } .sb-blk.back.fair { background: color-mix(in srgb, var(--c2) 60%, #fff); } .sb-blk.back.poor { background: color-mix(in srgb, var(--c5) 55%, #fff); }
.sb-blk.mv { cursor: grab; touch-action: none; }
.sb-blk.sel { outline: 2px solid var(--amber); outline-offset: 1px; z-index: 3; }
.sb-blk.hov { filter: brightness(1.08); box-shadow: 0 0 0 1px var(--amber), 0 1px 3px #0003; z-index: 3; }
.sb-blk.bad { box-shadow: 0 0 0 2px var(--bad); }
.sb-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; align-items: center; }
.sb-key span { display: inline-flex; align-items: center; gap: 4px; }
.sb-key .k { width: 14px; height: 9px; border-radius: 2px; display: inline-block; }
.sb-key .k.bar { width: 4px; height: 10px; border-radius: 1px 1px 0 0; margin-inline-end: -2px; background: var(--good); } .sb-key .k.bar.back { background: var(--accent); margin-inline-end: 0; }
.sb-key .k.blk { width: 10px; margin-inline-end: -2px; }
.sb-key .k.blk.good { background: var(--c3); } .sb-key .k.blk.fair { background: var(--c2); } .sb-key .k.blk.poor { background: var(--c5); }
.sb-key .k.pinch { width: 16px; background: linear-gradient(to right, var(--c3) 6px, color-mix(in srgb, var(--c3) 55%, #fff) 6px 10px, var(--c3) 10px); }
.sb-key .k.gnd { height: 2px; border-radius: 0; background: color-mix(in srgb, var(--muted) 60%, transparent); }
.sb-key .k.curfew { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bad) 45%, transparent) 0 2px, transparent 2px 4px); }
.sb-key .k.curfew.far { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--c4) 50%, transparent) 0 2px, transparent 2px 4px); }
.sb-key .k.busy { height: 4px; background: var(--warn); }
.sb-sel { margin-top: 8px; padding: 8px 10px; border-radius: 6px; background: var(--accent-soft); font-size: 12.5px; }
.weekgrid { display: grid; grid-template-columns: 38px repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; font-size: 11px; user-select: none; }
.weekgrid .wh { background: var(--head); text-align: center; font-weight: 700; color: var(--muted); padding: 3px 0; border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line-2); }
.weekgrid .wh:first-child { border-inline-start: 0; }
.weekgrid .wt { position: relative; border-inline-end: 1px solid var(--line); background: var(--head); }
.weekgrid .wt span { position: absolute; right: 4px; color: var(--muted); transform: translateY(-50%); }
.weekgrid .wc { position: relative; border-inline-start: 1px solid var(--line-2); cursor: crosshair; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(100% / 24 - 1px), var(--line-2) calc(100% / 24 - 1px), var(--line-2) calc(100% / 24)); }
.weekgrid .wc .night { position: absolute; left: 0; right: 0; background: color-mix(in srgb, var(--navy) 7%, transparent); pointer-events: none; }
.weekgrid .wc .busy { position: absolute; left: 0; right: 0; background: color-mix(in srgb, var(--warn) 22%, transparent); border-inline-start: 3px solid var(--warn); pointer-events: none; }
.weekgrid .slot { position: absolute; left: 2px; right: 2px; border-radius: 3px; background: var(--accent); color: var(--on-color); padding: 0 3px; overflow: hidden; white-space: nowrap; cursor: grab; font-weight: 650; line-height: 14px; font-size: 10.5px; box-shadow: 0 1px 2px #0003; }
.weekgrid .slot.ret { background: var(--c6); cursor: default; opacity: .85; }
.weekgrid .slot.sel { outline: 2px solid var(--amber); z-index: 2; }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 1px; font-size: 10px; }
.heat .hd { color: var(--muted); text-align: center; }
.heat .dl { color: var(--muted); font-weight: 700; }
.heat .hc { height: 16px; border-radius: 2px; background: var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--text); font-weight: 650; font-size: 9px; }
.heat .hc.held { box-shadow: inset 0 0 0 1.5px var(--c2); }

/* ---- Cabin ---- */
.cabin-map { overflow-x: auto; padding: 6px 0; }
.cabin-map svg { display: block; }
.seat-F { fill: var(--c4); } .seat-C { fill: var(--c1); } .seat-W { fill: var(--c3); } .seat-Y { fill: var(--faint); } .seat-over { fill: var(--bad); }
.cabin-row { display: grid; grid-template-columns: 112px minmax(0, 1.4fr) 116px 132px 60px 30px; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.cabin-row.cabin-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.cabin-row.gone { color: var(--muted); }
.cabin-class { display: flex; align-items: center; gap: 6px; line-height: 1.2; }
.cabin-class .swatch { width: 10px; height: 10px; border-radius: 2px; border: 0; cursor: default; }
.cabin-class small { display: block; font-size: 11px; color: var(--muted); }
.cabin-row .stepper > button { width: 24px; height: 26px; }
.cabin-row .stepper > .affix { min-width: 0; flex: 1; }
.cabin-row .stepper { width: 100%; }
.cabin-fit { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 2px 0 2px; }
.cabin-fit-field { display: inline-flex; align-items: center; gap: 6px; }
.cabin-fit .stepper { width: auto; }
.cabin-fit .stepper > .affix { min-width: 76px; }
.cabin-comfort { margin-inline-start: auto; font-size: 12.5px; }
.lenbar { height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; display: flex; }
.lenbar > i { display: block; height: 100%; }

/* ---- Hub ---- */
.hub { max-width: 1180px; margin: 0 auto; padding: 16px; }
.hub-season { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); align-items: center; }
.hub-season:last-child { border-bottom: 0; }
.hub-season h3 { font-size: 15.5px; }
.hub-season.tournament { background: var(--warn-soft); box-shadow: inset 3px 0 0 var(--amber); }
.hub-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.co-card { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); min-width: 220px; color: var(--text); }
.co-card:hover { border-color: var(--accent); text-decoration: none; }
.logo-code { width: 32px; height: 32px; border-radius: 6px; background: var(--navy); color: var(--amber); font-family: var(--mono); font-weight: 750; display: flex; align-items: center; justify-content: center; font-size: 12.5px; flex: none; letter-spacing: .5px; }
.logo-code.sm { width: 22px; height: 22px; font-size: 10px; border-radius: 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches .swatch { width: 24px; height: 24px; border-radius: 5px; border: 1px solid rgba(0,0,0,.18); padding: 0; cursor: pointer; }
.swatches .swatch.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.colour-preview { display: flex; align-items: center; gap: 10px; }
.livery-preview { display: flex; align-items: center; gap: 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: linear-gradient(180deg, var(--livery-sky), var(--panel-2)); }
.livery-preview > :first-child { flex: 1; min-width: 0; max-width: 340px; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 14.5px; margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, var(--line-2) 0, var(--head) 50%, var(--line-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 4px; height: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-page { padding: 16px; display: grid; gap: 10px; }
/* A card loading, in the shape of what it shows (CardSkeleton): bars as tall as the text they stand for. */
.sk { display: inline-block; vertical-align: middle; height: .8em; max-width: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--line-2) 0, var(--head) 50%, var(--line-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.sk-card .stat .v .sk { height: .75em; }
.sk-tick { width: 13px; height: 13px; border-radius: 3px; }
.sk-input { width: 180px; height: 24px; border-radius: 5px; }
.sk-stack { display: flex; flex-direction: column; gap: 10px; }
.sk-chart { position: relative; width: 100%; background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), var(--line-2) calc(25% - 1px), var(--line-2) 25%); border-bottom: 1px solid var(--line); }
.sk-chart svg { width: 100%; height: 100%; display: block; }
.sk-line { fill: none; stroke: var(--line); stroke-width: 2.5; animation: sk-pulse 1.2s ease-in-out infinite alternate; }
.sk-bars { position: absolute; inset: 8px 4px 0; display: flex; align-items: flex-end; gap: 6px; }
.sk-bars .sk { flex: 1; border-radius: 3px 3px 0 0; }
@keyframes sk-pulse { from { opacity: .5; } to { opacity: 1; } }
.sk-list .sk-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 12.5px; line-height: 1.45; border-bottom: 1px solid var(--line-2); }
.sk-list .sk-row:last-child { border-bottom: 0; }
.sk-text { display: grid; gap: 4px; font-size: 13px; line-height: 1.45; }
.sk-form { display: grid; gap: 10px; font-size: 12.5px; }
.sk-field { display: grid; gap: 4px; }
.sk-field .sk-input { width: 100%; height: 30px; }
.sk-map { display: block; width: 100%; border-radius: 6px; }
/* A map loading: its sea, pulsing gently, rather than a grey block. */
.sk-sea { display: block; background: var(--sea); animation: sk-pulse 1.4s ease-in-out infinite alternate; }
.sk-card .dt td .sk, .sk-card .dt th .sk { height: .75em; }
/* The game's frame while a season loads (FrameSkeleton): bars on the navy of the top bar and
   menu, as internal/play/boot.html draws them before any code. */
.topbar .sk, .sidebar .sk { background: linear-gradient(90deg, #ffffff14 0, #ffffff24 50%, #ffffff14 100%); background-size: 200% 100%; }
.sk-season { gap: 5px; }
.sk-pill { width: 30px; height: 26px; border-radius: 6px; }
.sk-pill.sk-wide { width: 110px; }
.sk-icon { width: 15px; height: 15px; border-radius: 3px; flex: none; }
.sidebar .nav-group > div .sk { height: 7px; }
/* A load taking more than 5 seconds: a bar along the card's top, filling as its data comes in, or sweeping across while its size is unknown. */
.sk-card { position: relative; }
.load-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; overflow: hidden; z-index: 3; background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 6px 6px 0 0; }
.load-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); transition: width .3s ease-out; }
.load-bar > i.sweep { width: 30%; animation: load-sweep 1.4s ease-in-out infinite; }
@keyframes load-sweep { from { left: -30%; } to { left: 100%; } }
.board { font-family: var(--mono); font-size: 12.5px; }
.board td { height: 25px; }
.status-pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.timeline { display: flex; flex-direction: column; }
.timeline .ti { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.timeline .ti:last-child { border-bottom: 0; }
.timeline .ti .when { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.timeline .ti .what b { font-weight: 650; }
.timeline .ti.asked { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.timeline .ti.urgent { box-shadow: inset 3px 0 0 var(--bad); }

/* ---- Phones ---- */
@media (max-width: 1100px) {
  .grid.side { grid-template-columns: minmax(0, 1fr); }
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-screen.details-open { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(0, 40%); }
  .map-screen .side { border-inline-start: 0; border-top: 1px solid var(--line); }
  /* One table at a time leaves useful rows beneath a short map. The desktop keeps its split. */
  .map-compact-tabs { display: block; flex: none; padding: 0 8px; }
  .map-compact-tabs .tabs { margin-bottom: 0; }
  .map-side-split { display: flex; min-height: 0; }
  .map-side-tabs, .map-side-divider { display: none; }
  .map-side-section.collapsed .map-side-content { display: block; }
  .map-list-network .map-flights, .map-list-flights .map-network { display: none; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--tb-h) minmax(0, 1fr) 54px; }
  .sidebar { display: none; }
  .sidebar.open { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); align-content: start; column-gap: 8px; position: fixed; inset: var(--tb-h) 0 54px 0; height: auto; z-index: 70; width: auto; }
  .main { padding: 10px 10px 70px; }
  .hide-sm { display: none !important; }
  .show-sm { display: flex !important; }
  .grid.c2, .grid.c3, .grid.c4, .grid.side-l, .grid.plan { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .form.c3, .form.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottombar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 54px; background: var(--navy); z-index: 60; padding-bottom: env(safe-area-inset-bottom); }
  .bottombar a, .bottombar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #b8cad6; font-size: 10.5px; border: 0; background: transparent; }
  .bottombar svg { width: 19px; height: 19px; }
  .bottombar .active { color: var(--amber); }
  .sheet { width: 100vw; height: 92vh; margin-top: auto; border-radius: 12px 12px 0 0; animation: rise .18s ease-out; }
  .scrim { align-items: flex-end; }
  @keyframes rise { from { transform: translateY(40px); } }
  .stat .v { font-size: 15.5px; }
  .page-head { flex-wrap: wrap; }
  .page-head .btns { flex-wrap: wrap; flex: 1 1 100%; min-width: 0; }
  .page-head .sub { display: none; }
}
/* In one column the planner reads in the order it is used: the route, what it would do with
   the button to plan it, then fares and the rest. */
@media (max-width: 820px) {
  .grid.plan { display: flex; flex-direction: column; gap: 12px; }
  .grid.plan > .col { display: contents; }
  .grid.plan > .col > * { order: 4; }
  .grid.plan .pl-route { order: 1; }
  .grid.plan .pl-check { order: 2; }
  .grid.plan .pl-fares { order: 3; }
}
/* Between a phone and a desktop, such as a half-screen window, the menu stays as a rail of
   icons, so every screen is one click away rather than behind More. */
@media (min-width: 600px) and (max-width: 820px) {
  .app { grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: var(--tb-h) minmax(0, 1fr); }
  .sidebar, .sidebar.open { display: block; position: sticky; inset: auto; top: var(--tb-h); height: calc(100vh - var(--tb-h)); width: auto; z-index: auto; padding: 4px 0 16px; }
  .nav-group { padding: 3px 0; border-bottom: 1px solid #ffffff12; }
  .nav-group > div { display: none; }
  .nav-link { justify-content: center; padding: 8px 0; position: relative; }
  .nav-link svg { width: 17px; height: 17px; }
  .nav-link .nl { display: none; }
  .nav-link .count { position: absolute; top: 3px; right: 6px; margin: 0; }
  .bottombar { display: none; }
  .main { padding: 10px 12px 24px; }
}
@media (max-width: 599px) {
  .map-screen { height: calc(100dvh - var(--tb-h) - 54px); }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2n) { border-inline-end: 0; }
  .gantt-row, .gantt-head { grid-template-columns: 132px minmax(0, 1fr); }
  .gl-util { display: none; }
  .pl-map { height: 300px; }
  .pl-key { font-size: 11px; gap: 2px 8px; bottom: 38px; }
  .map-legend { bottom: 34px; }
  .pl-key .faint { display: none; }
  .pl-glance { grid-template-columns: repeat(2, 1fr); }
  .pl-glance > div:nth-child(3n) { border-inline-end: 1px solid var(--line-2); }
  .pl-glance > div:nth-child(2n) { border-inline-end: 0; }
  .pl-glance > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .choices.wide[style] { grid-template-columns: minmax(0, 1fr); }
  .tabs { animation: tabs-more linear both; animation-timeline: scroll(self inline); }
  .cabin-row { grid-template-columns: minmax(0, 1fr) 116px 60px 30px; }
  .cabin-row > :nth-child(1) { grid-area: 1 / 1; }
  .cabin-row > :nth-child(2) { grid-area: 2 / 1 / 3 / 3; }
  .cabin-row > :nth-child(3) { grid-area: 1 / 2; }
  .cabin-row > :nth-child(4) { grid-area: 1 / 3; }
  .cabin-row > :nth-child(5) { grid-area: 2 / 3; }
  .cabin-row > :nth-child(6) { grid-area: 1 / 4; }
  .cabin-row > .cabin-fit { grid-area: 3 / 1 / 4 / 5; }
  .cabin-comfort { margin-inline-start: 0; }
  @keyframes tabs-more { 0%, 96% { mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); } 100% { mask-image: none; } }
}

/* Ranking categories */
.catlist { position: relative; padding: 4px 0 8px; max-height: calc(100vh - 230px); overflow: auto; }
.catlist .cat-head { padding: 10px 12px 3px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.catlist .cat { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 12px; border: 0; background: transparent; text-align: start; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; box-shadow: inset 2px 0 0 transparent; }
.catlist .cat:hover { background: var(--hover); }
.catlist .cat.on { background: var(--sel); font-weight: 650; box-shadow: inset 2px 0 0 var(--accent); }
.catlist .cat .ellipsis { flex: 1; min-width: 0; }
.catlist .rank { font-size: 11.5px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.catlist .rank.gold { color: var(--gold, #b8862f); }
.report-title { margin: 0; font-size: 16.5px; font-weight: 700; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 44px; align-items: center; gap: 10px; }
.bar-row .num { text-align: end; }

/* ---- Choices, chips, steppers, game dates ---- */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.choices[style*="--cols"] { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.choice { display: flex; flex-direction: column; gap: 4px; text-align: start; padding: 9px 11px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); cursor: pointer; position: relative; min-width: 0; }
.choice:hover:not(.on) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--amber); }
.choice.off { cursor: not-allowed; opacity: .62; background: var(--panel-2); }
.choice.off:hover { border-color: var(--line); }
.choice .ct { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13.5px; }
.choice .cs { font-size: 12px; color: var(--muted); line-height: 1.35; }
.choice .cf { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; font-size: 12px; margin-top: 2px; }
.choice .cf .k { color: var(--muted); }
.choice .cf .v { text-align: end; font-weight: 600; font-variant-numeric: tabular-nums; }
.choice .co { font-size: 11.5px; color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { height: 22px; padding: 0 9px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-color); }
.chip:disabled { opacity: .45; cursor: default; }
.stepper { display: inline-flex; align-items: stretch; gap: 0; }
.stepper > button { width: 28px; height: 28px; border: 1px solid var(--line); background: var(--head); cursor: pointer; font-size: 15.5px; line-height: 1; color: var(--text); }
.stepper > button:first-child { border-radius: 5px 0 0 5px; border-inline-end: 0; }
.stepper > button:last-child { border-radius: 0 5px 5px 0; border-inline-start: 0; }
.stepper > button:hover:not(:disabled) { background: var(--hover); color: var(--accent); }
.stepper > button:disabled { opacity: .4; cursor: default; }
.stepper > .affix { border-radius: 0; width: auto; min-width: 72px; }
.stepper > .affix input { width: 6ch; min-width: 0; }
.stepper > .affix input { text-align: center; }
.gdate { position: relative; display: inline-flex; }
.gdate-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-width: 140px; text-align: start; }
.gdate-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; width: 248px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 8px 24px #0002; display: flex; flex-direction: column; gap: 8px; }
.gdate-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.gdate-grid .dow { font-size: 10.5px; color: var(--muted); text-align: center; font-weight: 700; }
.gdate-grid button { height: 26px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.gdate-grid button:hover:not(:disabled) { background: var(--hover); color: var(--accent); }
.gdate-grid button.today { box-shadow: inset 0 0 0 1px var(--amber); }
.gdate-grid button.on { background: var(--accent); color: var(--on-color); }
.gdate-grid button:disabled { color: var(--faint); cursor: default; }
.spec-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--panel-2); }
.spec-strip > div { padding: 6px 10px; border-inline-end: 1px solid var(--line-2); display: flex; flex-direction: column; min-width: 0; }
.spec-strip > div:last-child { border-inline-end: 0; }
.spec-strip span { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.spec-strip b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spec-strip b.wrapv { white-space: normal; overflow-wrap: anywhere; }
.spec-strip.c3 { grid-template-columns: repeat(3, 1fr); }
.spec-strip.c3 > div:nth-child(3n) { border-inline-end: 0; } .spec-strip.c3 > div:nth-child(n+4) { border-top: 1px solid var(--line-2); }
.label { font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.gdate-pop.up { top: auto; bottom: calc(100% + 4px); }
.gdate-pop.left { left: auto; right: 0; }
.checklist { display: flex; flex-direction: column; gap: 10px; }
.cl-head { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.cl-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.cl-bar i { display: block; height: 100%; background: var(--good); border-radius: 3px; transition: width .3s; }
.checklist ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.cl-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; border: 1.5px solid var(--accent); color: var(--accent); }
.checklist li.done .cl-mark { background: var(--good); border-color: var(--good); color: var(--on-color); }
.checklist li.done .cl-t, .checklist li.done .cl-t a { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.cl-t { font-weight: 650; }
.cl-d { font-size: 12px; color: var(--muted); margin-top: 1px; }
.cl-d .cl-now { color: var(--text); font-size: 13px; margin-top: 3px; }
.scale { display: flex; align-items: center; gap: 10px; min-width: 0; }
.scale-track { position: relative; flex: 1; height: 30px; display: flex; align-items: center; min-width: 120px; }
.scale-track::before { content: ""; position: absolute; left: 0; right: 0; height: 6px; border-radius: 3px; background: var(--line-2); }
.scale-fill { position: absolute; left: 0; height: 6px; border-radius: 3px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.scale-mark { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-inline-start: -1px; background: var(--muted); pointer-events: none; }
.scale-mark i { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.scale-mark.start i { left: 4px; transform: none; } .scale-mark.end i { left: auto; right: 4px; transform: none; }
.scale-mark.good { background: var(--good); } .scale-mark.good i { color: var(--good); }
.scale-mark.bad { background: var(--bad); } .scale-mark.bad i { color: var(--bad); }
.scale-mark.warn { background: var(--warn); } .scale-mark.warn i { color: var(--warn); }
.scale-track input[type=range] { position: relative; width: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; height: 30px; cursor: pointer; }
.scale-track input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 6px; }
.scale-track input[type=range]::-moz-range-track { background: transparent; height: 6px; }
.scale-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); box-shadow: 0 1px 3px #0003; }
.scale-track input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); }
.scale-track input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--amber); }
.scale-v { min-width: 44px; text-align: end; font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 650; }
.scale-mark.tick { top: 9px; bottom: 9px; width: 2px; background: var(--faint); }
.scale-mark.tick.good { background: var(--good); top: 7px; bottom: 7px; width: 3px; margin-inline-start: -1.5px; border-radius: 1px; }
.amount { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; padding: 5px 8px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; text-align: start; color: var(--text); }
.pick .pl { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pick b { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pick:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--hover); }
.pick.sug { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.pick.sug .pl { color: var(--good); }
.pick.sug svg { fill: currentColor; }
.pick.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--amber); }
.pick.on .pl { color: var(--accent); }
.pick.off { opacity: .5; cursor: not-allowed; }
.pick-why { font-size: 12px; color: var(--muted); line-height: 1.4; min-height: 32px; }
.pick-why b { color: var(--good); }
.amount-row { display: flex; align-items: flex-start; gap: 10px; }
.amount-in { flex: none; width: 168px; }
.amount-in .affix { width: 100%; height: 32px; }
.amount-in .affix > input { font-size: 14.5px; font-weight: 650; }
.amount-say { flex: 1; min-width: 0; font-size: 12.5px; padding: 7px 9px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line-2); line-height: 1.45; }
.amount-say:empty { display: none; }
.amount.compact { gap: 3px; }
.amount.compact .amount-row { align-items: center; flex-wrap: wrap; gap: 6px; }
.amount.compact .amount-in { width: 130px; }
.amount.compact .amount-in .affix { height: 28px; }
.amount.compact .amount-in .affix > input { font-size: 13px; }
.chip .cv { opacity: .75; font-variant-numeric: tabular-nums; }
.chip.sug:not(.on) { border-color: color-mix(in srgb, var(--good) 50%, var(--line)); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
button.link:hover { text-decoration: underline; }
@media (max-width: 560px) { .amount-row { flex-direction: column; align-items: stretch; } .amount-in { width: 100%; } }
.fare-rows { display: flex; flex-direction: column; gap: 14px; }
.fare-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 128px; gap: 12px; align-items: center; }
.fare-row .fr-l { display: flex; flex-direction: column; }
.fare-row .fr-l small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 640px) { .fare-row { grid-template-columns: 1fr; gap: 4px; } }
.rule-card { border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); }
.rule-card .rule-name { font-weight: 650; width: 220px; }
.rule-line { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: center; }
.rule-line .rl { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) { .rule-line { grid-template-columns: 1fr; gap: 4px; } }
.ladder-steps { display: flex; flex-direction: column; gap: 8px; }
.ladder-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.ladder-line > .btn:last-child { margin-inline-start: auto; }
.grade-ladder { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.grade-ladder .gl { text-align: center; font-size: 11.5px; font-weight: 700; padding: 6px 0; border-radius: 4px; color: var(--muted); }
.grade-ladder .gl.inv { background: var(--good-soft); } .grade-ladder .gl.spec { background: var(--warn-soft); } .grade-ladder .gl.junk { background: var(--bad-soft); }
.grade-ladder .gl.on { color: var(--on-color); transform: scale(1.12); box-shadow: 0 2px 6px #0003; }
.grade-ladder .gl.inv.on { background: var(--good); } .grade-ladder .gl.spec.on { background: var(--warn); } .grade-ladder .gl.junk.on { background: var(--bad); }
.gl-legend { grid-column: 1 / -1; display: grid; grid-template-columns: 4fr 2fr 4fr; font-size: 10.5px; color: var(--muted); text-align: center; }
.own { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; }
.own-bar { position: relative; display: flex; height: 14px; border-radius: 7px; background: var(--line-2); }
.own-bar > i { height: 100%; } .own-bar > i:first-child { border-radius: 7px 0 0 7px; } .own-bar > i:last-of-type { border-radius: 0 7px 7px 0; }
.own-bar i.float, .own-key i.float { background: repeating-linear-gradient(45deg, var(--line), var(--line) 4px, var(--line-2) 4px, var(--line-2) 8px); }
.own-line { position: absolute; top: -12px; bottom: -3px; width: 2px; margin-inline-start: -1px; background: var(--text); }
.own-line b { position: absolute; top: -2px; left: 5px; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.own-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.own-key span { display: inline-flex; align-items: center; gap: 5px; } .own-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.press-preview { border-inline-start: 3px solid var(--accent); padding: 4px 0 4px 12px; }
.press-preview h3 { margin: 0 0 6px; font-size: 15.5px; }
.press-preview p { margin: 0; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.swatch.closed { background: var(--bad-soft) !important; border: 1px dashed var(--bad); }
.swatch.corridor { background: repeating-linear-gradient(90deg, var(--good) 0 5px, transparent 5px 8px) !important; width: 16px; height: 3px; align-self: center; }
.swatch.dashed { background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 6px) !important; width: 16px; height: 3px; align-self: center; }
.dd { position: relative; display: inline-block; min-width: 140px; }
.dd-btn { width: 100%; text-align: start; cursor: pointer; display: flex; align-items: center; }
.dd-btn:disabled { cursor: default; opacity: .6; }
.dd-pop { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 100%; max-height: 300px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 10px 28px #0003; padding: 4px; }
.dd-q { width: 100%; margin-bottom: 4px; }
.dd-opt { padding: 6px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; font-size: 13.5px; }
.dd-opt.hi { background: var(--hover); }
.dd-opt.on { color: var(--accent); font-weight: 650; }
.dd-opt.off { color: var(--muted); cursor: default; }
.dd-btn { gap: 8px; color: var(--text); }
.split-btn { position: relative; display: inline-flex; }
.split-btn > .btn:first-child { border-start-end-radius: 0; border-end-end-radius: 0; }
.split-caret { width: 24px; padding: 0; border-start-start-radius: 0; border-end-start-radius: 0; border-inline-start-color: #fff4; }
.split-caret::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.split-btn .dd-pop { left: auto; right: 0; }
.dd-btn::after { content: ""; margin-inline-start: auto; flex: none; border: 4px solid transparent; border-top-color: var(--muted); transform: translateY(2px); }
.check-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; }

.compare { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare th, .compare td { padding: 6px 10px; border-bottom: 1px solid var(--line-2); text-align: start; vertical-align: top; }
.compare th { background: var(--panel-2); font-weight: 600; }
.compare td:first-child { width: 170px; }

/* Advertising at the foot of a screen */
.advert { max-width: 760px; margin: 28px 0 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); opacity: 0; visibility: hidden; }
.advert.in { opacity: 1; visibility: visible; transition: opacity .35s ease; }
.advert-label { font-size: 10.5px; letter-spacing: .3px; color: var(--faint); margin-bottom: 8px; }
.advert-label a { color: var(--muted); }
.advert-creative { display: flex; align-items: center; gap: 14px; color: inherit; overflow-wrap: anywhere; }
.advert-creative:hover { text-decoration: none; }
.advert-creative:hover strong { color: var(--accent); }
.advert-creative img { width: 132px; max-height: 88px; object-fit: contain; border-radius: 4px; flex: none; }
.advert-creative strong { font-size: 14px; color: var(--text); }
.advert-creative p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
@media (max-width: 520px) {
  .advert-creative { flex-direction: column; align-items: flex-start; gap: 8px; }
  .advert-creative img { width: 100%; max-height: 120px; }
}
.found-split { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 22px; align-items: start; padding: 12px 14px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); }
@media (max-width: 720px) { .found-split { grid-template-columns: minmax(0, 1fr); } }
.found-map { position: relative; height: 380px; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); }
/* Wide screens: the form beside a map filling the rest of the page, the founding card on it. */
.found-layout { display: grid; grid-template-columns: minmax(0, 620px) minmax(0, 1fr); gap: 12px; align-items: start; }
.found-layout > .found-map { position: sticky; top: calc(var(--tb-h) + 12px); height: calc(100vh - var(--tb-h) - 24px); min-height: 520px; border-radius: 6px; }
.found-act { position: absolute; top: 12px; left: 12px; z-index: 6; width: 320px; max-width: calc(100% - 70px); padding: 12px; box-shadow: 0 4px 16px #0002; }
@media (max-width: 720px) { .found-map { height: 280px; } }
.whereabouts { padding: 8px 12px; border-top: 1px solid var(--line-2); }
.route-peek { display: inline-flex; }
.route-card { position: fixed; z-index: 80; width: 300px; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px #0003; overflow: hidden; font-size: 12.5px; }
.route-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 8px; border-bottom: 1px solid var(--line-2); }
.route-card-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; font-weight: 600; min-width: 0; }
.route-card-meta { padding: 5px 8px 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.route-card-meta:last-child { padding-bottom: 6px; }
.route-card-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 8px; padding: 4px 8px 6px; }
.route-card-stats > div { display: flex; flex-direction: column; }
.route-card-stats span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.route-card-stats b { font-size: 13px; font-variant-numeric: tabular-nums; }
.route-card-meta.bad { color: var(--bad); }
.route-card-meta.warn { color: var(--warn); }
.ac-profile { width: 100%; }
.ac-profile svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ac-banner { background: linear-gradient(var(--accent-soft), var(--panel) 85%); padding: 6px 14px 4px; box-sizing: border-box; border-radius: 4px; }
.route-card .ac-banner { border-radius: 0; border-bottom: 1px solid var(--line-2); }
.ac-thumb { width: 60px; flex: none; }
.ac-title { width: 104px; flex: none; }
.type-bars { display: grid; gap: 3px; padding: 6px 8px 4px; }
.type-bars > div { display: grid; grid-template-columns: 46px 1fr 78px; align-items: center; gap: 6px; }
.type-bars b { font-size: 12.5px; text-align: end; font-variant-numeric: tabular-nums; }
.type-bars span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.type-bars i { display: block; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.type-bars em { display: block; height: 100%; border-radius: 3px; }

/* Financial statements: report typography and accounting rules. */
.financial-reports { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; justify-items: center; }
/* Each statement is an A4 sheet: 210mm wide, at least 297mm tall. */
.financial-report { min-width: 0; width: 210mm; max-width: 100%; aspect-ratio: 210 / 297; display: flex; flex-direction: column; box-shadow: 0 2px 10px rgb(0 0 0 / 8%); padding: 18px 22px 12px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--text); }
.financial-report-head { text-align: center; padding-bottom: 12px; }
.financial-company { font-size: 11.5px; font-weight: 650; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 2px; }
.financial-report-head h2 { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; font-weight: 400; }
.financial-report-head p { color: var(--muted); font-size: 11.5px; margin: 3px 0 0; }
.financial-scroll { overflow-x: auto; container-type: inline-size; }
.fin-row { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: start; display: inline-flex; align-items: baseline; gap: 4px; }
.fin-row:hover { color: var(--accent); }
.fin-caret { font-size: 9px; color: var(--faint); }
.fin-detail td { text-align: start !important; background: var(--accent-soft) !important; font-size: 12px; line-height: 1.45; padding: 6px 10px !important; white-space: normal; }
.fin-detail td > div + div { margin-top: 3px; }
.financial-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.financial-table th, .financial-table td { padding: 3px 8px; text-align: end; vertical-align: bottom; }
.financial-table thead th { padding-top: 5px; padding-bottom: 5px; border-top: 1px solid var(--text); border-bottom: 1px solid var(--text); white-space: nowrap; font-weight: 650; }
.financial-table thead small { display: block; font-weight: 400; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.financial-table tr > :first-child { text-align: start; position: sticky; left: 0; background: var(--panel); min-width: 170px; max-width: 260px; z-index: 1; }
.financial-table tbody th { font-weight: 400; padding-inline-start: 20px; }
.financial-table td { white-space: nowrap; }
.financial-table .financial-section th { padding: 12px 10px 3px; font-weight: 700; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; }
/* Headings and notes span every column, so their text keeps to the visible part while the columns scroll. */
.financial-table .financial-section th > span { display: inline-block; position: sticky; left: 10px; }
.fin-detail td > * { position: sticky; left: 10px; max-width: calc(100cqw - 20px); }
/* Figures scrolled under the labels fade into them rather than showing cut digits. */
.financial-table tbody tr:not(.financial-section):not(.fin-detail) > :first-child::after { content: ""; position: absolute; top: 0; bottom: 0; right: -28px; width: 28px; background: linear-gradient(to right, var(--panel), transparent); pointer-events: none; }
.financial-table .financial-subtotal > * { font-weight: 650; padding-top: 4px; padding-bottom: 4px; }
.financial-table .financial-subtotal th { padding-inline-start: 10px; }
.financial-table .financial-subtotal td { border-top: 1px solid var(--muted); }
.financial-table .financial-total > * { border-top: 1px solid var(--text); border-bottom: 3px double var(--text); font-weight: 700; }
.financial-note-mark { color: var(--muted); font-size: 10.5px; }
.financial-footnote { contain: inline-size; color: var(--muted); font-size: 11.5px; line-height: 1.5; margin: 12px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.financial-report > .financial-footnote:last-child { margin-top: auto; }
@media (max-width: 640px) {
  .financial-report { padding: 14px 8px 10px; }
  .financial-report-head h2 { font-size: 20px; }
  .financial-table tr > :first-child { min-width: 180px; max-width: 220px; }
  .financial-print { position: static; align-self: flex-end; margin-bottom: 4px; }
}
.financial-report { position: relative; }
.financial-print { position: absolute; top: 12px; right: 14px; z-index: 2; }

/* A printed statement: the reports alone, black on white, a page for each set of periods. */
#print-root { display: none; }
@media print {
  @page { margin: 14mm 14mm 12mm; }
  html.printing, html.printing body { background: #fff; color: #000; color-scheme: light; }
  html.printing body > :not(#print-root) { display: none !important; }
  html.printing #print-root { display: block; }
}
.print-page { break-after: page; font-size: 8.5pt; line-height: 1.3; color: #000; }
.print-page:last-child { break-after: auto; }
.print-head { text-align: center; margin-bottom: 5mm; }
.print-company { font-size: 8pt; font-weight: 650; letter-spacing: 1.4px; text-transform: uppercase; }
.print-head h1 { font-family: Georgia, 'Times New Roman', serif; font-size: 18pt; font-weight: 400; letter-spacing: 0; margin: 1mm 0; }
.print-head p { color: #555; font-size: 8pt; margin: 0; }
.print-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.print-table th, .print-table td { padding: 1.1mm 1.6mm; text-align: end; vertical-align: bottom; }
.print-table tr > :first-child { text-align: start; }
.print-table thead { display: table-header-group; }
.print-table thead th { border-top: 0.75pt solid #000; border-bottom: 0.75pt solid #000; font-weight: 650; white-space: nowrap; }
.print-table thead small { display: block; font-weight: 400; color: #555; font-size: 7pt; }
.print-table tr { break-inside: avoid; }
.print-table tbody th { font-weight: 400; padding-inline-start: 4mm; }
.print-table td { white-space: nowrap; }
.print-section th { padding-top: 3.5mm; font-size: 7.5pt; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding-inline-start: 1.6mm !important; break-after: avoid; }
.print-subtotal > * { font-weight: 650; }
.print-subtotal th { padding-inline-start: 1.6mm !important; }
.print-subtotal td { border-top: 0.5pt solid #777; }
.print-total > * { font-weight: 700; border-top: 0.75pt solid #000; border-bottom: 2.25pt double #000; }
.print-total th { padding-inline-start: 1.6mm !important; }
.print-foot { margin-top: 6mm; padding-top: 2mm; border-top: 0.5pt solid #999; color: #555; font-size: 7.5pt; break-inside: avoid; }
.print-foot p { margin: 0 0 2mm; }
.print-foot div { display: flex; justify-content: space-between; gap: 6mm; }

/* ---- Fleet picker: the chosen fleet's aircraft in livery, one row a fleet when open ---- */
.fp { position: relative; min-width: 0; container: fp / inline-size; }
.fp-btn { width: 100%; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto 16px; grid-template-rows: auto auto; column-gap: 10px; row-gap: 1px; align-items: center; text-align: start; padding: 6px 9px 6px 8px; border: 1px solid var(--accent); border-radius: 7px; background: linear-gradient(90deg, color-mix(in srgb, var(--sky) 14%, var(--accent-soft)), var(--accent-soft) 45%); box-shadow: inset 3px 0 0 var(--amber); color: var(--text); cursor: pointer; }
.fp-btn:hover, .fp-btn.open { background: linear-gradient(90deg, color-mix(in srgb, var(--sky) 20%, var(--accent-soft)), color-mix(in srgb, var(--accent) 6%, var(--accent-soft)) 45%); }
.fp-btn > .fp-ac { grid-column: 1; grid-row: 1 / 3; width: 72px; }
.fp-ac { display: flex; align-items: center; justify-content: center; min-width: 0; color: var(--accent); }
.fp-ac > .ac-profile { width: 100%; }
.fp-l1 { grid-column: 2; display: flex; align-items: center; gap: 6px; font-size: 14px; min-width: 0; }
.fp-l2 { grid-column: 2; font-size: 12px; color: var(--muted); }
.fp-btn > .fp-fleet { grid-column: 3; grid-row: 1 / 3; }
.fp-fleet { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 0; }
.fp-chev { grid-column: 4; grid-row: 1 / 3; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .12s; }
.fp-btn.open .fp-chev { transform: rotate(180deg); }
.fp-spare { font-weight: 650; }
.fp-planes { display: flex; align-items: center; gap: 1px; height: 13px; }
.fp-plane { width: 13px; height: 13px; flex: none; stroke-width: 1.6; stroke-linejoin: round; }
.fp-plane.busy { fill: var(--accent); stroke: none; }
.fp-plane.spare { fill: var(--good); stroke: none; }
.fp-plane.short { fill: var(--bad-soft); stroke: var(--bad); stroke-dasharray: 2.5 2; }
.fp-plane.order { fill: none; stroke: var(--muted); opacity: .7; }
.fp-planes.bar { gap: 4px; }
.fp-bar { display: flex; width: 58px; height: 6px; border-radius: 3px; overflow: hidden; gap: 1px; background: var(--line-2); }
.fp-bar i { display: block; }
.fp-bar .busy { background: var(--accent); }
.fp-bar .spare { background: var(--good); }
.fp-bar .short { background: var(--bad); }
.fp-bar .order { background: color-mix(in srgb, var(--muted) 35%, transparent); }
.fp-reach { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12.5px; white-space: nowrap; }
.fp-track { position: relative; width: 100%; height: 4px; border-radius: 2px; background: var(--line-2); }
.fp-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--sky); }
.fp-track.far i { background: var(--bad); }
.fp-track b { position: absolute; top: -3px; width: 2px; height: 10px; margin-inline-start: -1px; border-radius: 1px; background: var(--amber); box-shadow: 0 0 0 1px var(--panel); }
.fp-pop { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0; min-width: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 10px 28px #0003; padding: 4px; }
.fp-q { width: 100%; margin-bottom: 4px; }
.fp-list { position: relative; max-height: min(440px, 62vh); overflow-y: auto; }
.fp-head, .fp-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 84px 200px; gap: 10px; align-items: center; padding: 0 8px 0 4px; }
.fp-head { position: sticky; top: 0; z-index: 1; background: var(--panel); height: 22px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line-2); }
.fp-head > :nth-child(n+3) { text-align: end; }
.fp-row { min-height: 40px; padding-top: 3px; padding-bottom: 3px; border-radius: 6px; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.fp-row > .fp-ac { width: 56px; }
.fp-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.fp-name > span { font-size: 11.5px; color: var(--muted); }
.fp-name .mono { font-size: 11px; }
.fp-row.hi { background: var(--hover); }
.fp-row.on { background: var(--sel); box-shadow: inset 3px 0 0 var(--amber); }
.fp-row.far { opacity: .62; }
.fp-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--bad); font-weight: 700; padding: 8px 8px 3px; }
.fp-none { padding: 8px; font-size: 12.5px; }
.fp-row > .fp-fleet { white-space: normal; text-align: end; }
/* The picker sits in narrow side panels as often as wide pages, so it lays out by its own width:
   narrow, the aircraft and their counts take a line of their own under the fleet's name. */
@container fp (max-width: 599px) {
  .fp-btn { grid-template-columns: 64px minmax(0, 1fr) 16px; grid-template-rows: auto auto auto; }
  .fp-btn > .fp-ac { width: 64px; }
  .fp-btn > .fp-fleet { grid-column: 2; grid-row: 3; flex-direction: row; justify-content: flex-start; align-items: center; gap: 6px; margin-top: 2px; white-space: normal; }
  .fp-chev { grid-column: 3; grid-row: 1 / 4; }
  .fp-head, .fp-row { grid-template-columns: 48px minmax(0, 1fr) 84px; gap: 3px 10px; }
  .fp-head > :nth-child(4) { display: none; }
  .fp-row { padding-top: 5px; padding-bottom: 5px; }
  .fp-row > .fp-ac { grid-row: 1; width: 48px; }
  .fp-row > .fp-fleet { grid-column: 2 / 4; grid-row: 2; flex-direction: row; justify-content: flex-start; align-items: center; gap: 6px; text-align: start; }
}
@container fp (max-width: 379px) {
  .fp-btn { grid-template-columns: 52px minmax(0, 1fr) 16px; column-gap: 8px; }
  .fp-btn > .fp-ac { width: 52px; }
  .fp-head, .fp-row { grid-template-columns: 38px minmax(0, 1fr) 70px; column-gap: 7px; }
  .fp-row > .fp-ac { width: 38px; }
  .fp-row .fp-plane { width: 11px; height: 11px; }
}
.kv-rows .r { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; padding: 1px 0; }
.sheet:focus { outline: none; }
.modal.offer { width: min(580px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.offer h3 { font-size: 13.5px; margin: 12px 0 4px; }
.modal.offer ul { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }
.modal.offer p { margin: 0 0 6px; }
.modal.jump { width: min(560px, calc(100vw - 24px)); padding: 0; align-self: flex-start; margin-top: 12vh; }
.jump-in { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.jump-in .input { border: 0; box-shadow: none; flex: 1; font-size: 15.5px; padding: 4px 0; background: transparent; }
.jump-in .input:focus { outline: none; }
.jump-list { max-height: 50vh; overflow-y: auto; padding: 4px; }
.jump-list button { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: start; border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; }
.jump-list button.on { background: var(--accent-soft, #e6eef4); }
.jump-list .jk { width: 96px; flex: none; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.jump-foot { padding: 6px 12px; border-top: 1px solid var(--line); }

/* A route's airports in order in the planner: dots joined by a line, each leg's distance. */
.rp { display: flex; flex-direction: column; }
.rp-row { display: grid; grid-template-columns: 14px 40px minmax(0, 1fr) 28px; align-items: center; gap: 8px; }
.rp-label { font-size: 12px; color: var(--muted); }
.rp-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--c1); background: var(--panel); justify-self: center; }
.rp-dot.end { background: var(--c1); }
.rp-dot.tech { border-style: dashed; }
.rp-leg, .rp-add { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 18px; }
.rp-leg i, .rp-add i { justify-self: center; width: 2px; align-self: stretch; background: color-mix(in srgb, var(--c1) 45%, transparent); }
.rp-leg span { padding-inline-start: 48px; }
.rp-add button { justify-self: start; margin-inline-start: 48px; }
.fig-card { width: 320px; }
.fig-card .route-card-head { gap: 10px; }
.fig-rows { padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; font-variant-numeric: tabular-nums; }
.fig-row { display: grid; grid-template-columns: minmax(0, 1fr) 60px auto; gap: 8px; align-items: center; }
.fig-row > :last-child { text-align: end; min-width: 70px; }
.fig-bar { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.fig-bar i { display: block; height: 100%; background: var(--c1); }
.fig-bar i.neg { background: var(--c5); }
.fig-total { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; font-weight: 650; }
.financial-table td .route-peek { cursor: default; }
.financial-table td .route-peek:hover { text-decoration: underline dotted; text-underline-offset: 3px; }

/* A line of words above an unpadded panel's table. */
.panel-note { padding: 8px 12px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line-2); }

/* The clock and its time zone */
.tb-clockbtn { display: flex; align-items: center; margin: -3px -6px; padding: 3px 6px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.tb-clockbtn:hover, .tb-clockbtn[aria-expanded="true"] { background: #ffffff14; }
.tb-zone { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 8px; padding: 1px 4px 1px 6px; border: 1px solid #ffffff38; border-radius: 4px; color: #e8eef3; font-size: 11px; font-weight: 700; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.tb-clockbtn:hover .tb-zone, .tb-clockbtn[aria-expanded="true"] .tb-zone { border-color: var(--amber); color: #fff; }
.tz-pop { top: 30px; left: -6px; width: 330px; padding: 6px; color: var(--text); }
.tz-pop .hdr { padding-top: 8px; }
.tz-pop .hdr:first-child { padding-top: 2px; }
.tz-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 5px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.tz-row:hover { background: var(--hover); }
.tz-row.on { background: var(--accent-soft); }
.tz-row b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tz-row i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tz-on { display: inline-flex; color: var(--accent); }
.tz-time { text-align: end; }
.tz-time b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tz-find { padding: 2px 6px 4px; }
@media (max-width: 520px) {
  .tz-pop { position: fixed; top: var(--tb-h); left: 8px; right: 8px; width: auto; }
}

/* ---- Stock quotes and charts ---- */
.quote { padding-bottom: 4px; }
.q-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 12px 14px 6px; }
.q-title { flex: 1 1 100%; font-size: 13.5px; font-weight: 700; }
.q-price { display: flex; align-items: baseline; gap: 12px; }
.q-last { font-size: 30px; font-weight: 750; letter-spacing: -.6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.quote.small .q-last { font-size: 22px; }
.q-usd { color: var(--muted); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.q-move { font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.q-move i { font-style: normal; font-weight: 500; color: var(--muted); }
.q-bar .q-move { font-size: 12.5px; }
.q-up { color: var(--sc-up); }
.q-down { color: var(--sc-down); }
.q-when { color: var(--muted); font-size: 12px; }
.q-full { margin-inline-start: auto; font-size: 12.5px; font-weight: 600; }
.q-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 14px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.q-ranges { display: flex; gap: 2px; }
.q-ranges button, .q-tog { border: 0; background: transparent; padding: 3px 8px; border-radius: 4px; font-size: 12.5px; font-weight: 650; color: var(--muted); cursor: pointer; }
.q-ranges button:hover, .q-tog:hover { background: var(--hover); color: var(--text); }
.q-ranges button.on { background: var(--accent-soft); color: var(--accent); }
.q-tog { border: 1px solid var(--line); height: 26px; }
.q-tog.on { border-color: var(--c2); color: var(--c2); }
.q-chart { padding: 8px 6px 0 14px; }
.q-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); column-gap: 22px; margin: 8px 14px 6px; }
.q-stats > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; min-width: 0; }
.q-stats dt { color: var(--muted); white-space: nowrap; }
.q-stats dd { margin: 0; font-weight: 650; text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .q-stats { grid-template-columns: minmax(0, 1fr); } .q-last { font-size: 24px; } .q-chart { padding-inline-start: 8px; } }
.stock, .quote { --sc-up: #11834d; --sc-down: #c9372c; }

:where(:root[data-theme="dark"]) .stock, :where(:root[data-theme="dark"]) .quote { --sc-up: #4fc98a; --sc-down: #ef6e64; } 
@media (prefers-color-scheme: dark) {
:where(:root:not([data-theme])) .stock, :where(:root:not([data-theme])) .quote { --sc-up: #4fc98a; --sc-down: #ef6e64; } 
}
.stock { position: relative; user-select: none; touch-action: pan-y; }
.sc-read { display: flex; flex-wrap: wrap; gap: 2px 12px; min-height: 18px; margin-bottom: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sc-read b { color: var(--text); font-weight: 650; }
.sc-read i { font-style: normal; font-weight: 650; color: var(--text); }
.sc-read i.sc-up { color: var(--sc-up); }
.sc-read i.sc-down { color: var(--sc-down); }
.stock svg { display: block; overflow: visible; cursor: crosshair; }
.sc-grid { stroke: var(--line-2); }
.sc-ax { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.sc-base { stroke: var(--muted); stroke-dasharray: 2 3; opacity: .8; }
.sc-cu line, .sc-cu rect { stroke: var(--sc-up); fill: var(--sc-up); }
.sc-cd line, .sc-cd rect { stroke: var(--sc-down); fill: var(--sc-down); }
.sc-fair { fill: none; stroke: var(--c2); stroke-width: 1.4; stroke-dasharray: 5 3; }
.sc-vu { fill: var(--sc-up); opacity: .35; }
.sc-vd { fill: var(--sc-down); opacity: .35; }
.sc-div circle { fill: var(--panel); stroke: var(--c1); stroke-width: 1.3; }
.sc-div text { fill: var(--c1); font-size: 9px; font-weight: 750; pointer-events: none; }
.sc-ma50 { fill: none; stroke: var(--c4); stroke-width: 1.4; stroke-linejoin: round; pointer-events: none; }
.sc-ma200 { fill: none; stroke: var(--c1); stroke-width: 1.4; stroke-dasharray: 6 3; stroke-linejoin: round; pointer-events: none; }
.sc-prof { fill: var(--muted); fill-opacity: 0.17; pointer-events: none; }
.sc-ma50-key i { color: var(--c4); }
.sc-ma200-key i { color: var(--c1); }
.sc-level line { stroke: var(--c8); stroke-width: 1.3; stroke-dasharray: 5 3; }
.sc-level text { fill: var(--c8); font-size: 11px; font-weight: 650; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; pointer-events: none; }
.sc-level-key i { color: var(--c8); }
.sc-step path { fill: none; stroke: var(--c8); stroke-width: 1.6; stroke-linejoin: round; pointer-events: none; }
.sc-step text { fill: var(--c8); font-size: 11px; font-weight: 650; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; pointer-events: none; }
.sc-step-key i { color: var(--c8); }
.sc-level.buy line { stroke: var(--sc-up); stroke-dasharray: 2 3; }
.sc-level.sell line { stroke: var(--sc-down); stroke-dasharray: 2 3; }
.sc-level.buy text, .sc-level-key.buy i { fill: var(--sc-up); color: var(--sc-up); }
.sc-level.sell text, .sc-level-key.sell i { fill: var(--sc-down); color: var(--sc-down); }
.sc-cross line { stroke: var(--muted); stroke-dasharray: 3 3; pointer-events: none; }
.sc-tag rect { fill: currentColor; }
.sc-tag text { fill: var(--on-color); font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sc-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12.5px; border: 1px dashed var(--line); border-radius: 6px; }


/* ---- The top bar's Chat button; chat itself is in chat.css ---- */
.tb-btn.on { background: #ffffff1f; border-color: #ffffff4d; }
.count.blip { animation: count-blip .5s ease-out; }
@keyframes count-blip { 0% { transform: scale(1); box-shadow: 0 0 0 0 #efbc73aa; } 30% { transform: scale(1.3); } 100% { transform: scale(1); box-shadow: 0 0 0 7px #efbc7300; } }
@media (prefers-reduced-motion: reduce) { .count.blip { animation: none; } }

/* ---- Head to head on a route: each airline's departures over the day ---- */
.h2h td { vertical-align: top; padding-top: 5px; padding-bottom: 5px; }
.h2h tr.strong td { font-weight: 650; }
.h2h-side { display: flex; flex-direction: column; gap: 3px; min-width: 150px; }
.h2h-day { position: relative; height: 8px; border-radius: 2px; background: linear-gradient(90deg, var(--line-2) 0 25%, var(--line) 25% 75%, var(--line-2) 75%); }
.h2h-day i { position: absolute; top: -1px; width: 2px; height: 10px; margin-inline-start: -1px; background: var(--muted); border-radius: 1px; }
.h2h tr.strong .h2h-day i { background: var(--accent); }

/* ---- A production line's months ---- */
.line-cal { display: flex; align-items: flex-end; gap: 2px; height: 70px; padding-bottom: 14px; position: relative; }
.lc-month { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.lc-bar { flex: 1; display: flex; flex-direction: column-reverse; justify-content: flex-start; background: var(--line-2); border-radius: 2px 2px 0 0; overflow: hidden; }
.lc-bar i { display: block; width: 100%; }
.lc-month > span { position: absolute; bottom: -14px; left: 0; font-size: 10px; color: var(--muted); white-space: nowrap; }
.lc-order { background: var(--c2); }
.lc-yours { background: var(--c1); }
.lc-others { background: var(--faint); }
.panel.fold > summary { cursor: pointer; list-style: none; border-bottom: 0; }
.panel.fold > summary::-webkit-details-marker { display: none; }
.panel.fold > summary h2::before { content: '▸'; display: inline-block; width: 14px; color: var(--muted); }
.panel.fold[open] > summary { border-bottom: 1px solid var(--line); }
.panel.fold[open] > summary h2::before { content: '▾'; }
.pl-figs { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 1px; background: var(--line-2); }
.pl-figs > div { border-inline-end: 0; background: var(--panel-2); }
summary.link { cursor: pointer; color: var(--accent); }
.inbox-pop { width: 340px; max-width: calc(100vw - 16px); padding: 6px 0; }
.inbox-pop > .item, .inbox-pop > .sep { margin-inline-start: 6px; margin-inline-end: 6px; width: auto; }
.inbox-head { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 4px 6px; }
.inbox-list { max-height: min(420px, 60vh); overflow-y: auto; }
.topbar .inbox-item, .inbox-item { display: block; padding: 7px 12px 7px 14px; border-inline-start: 3px solid transparent; color: var(--text); font-size: 12.5px; line-height: 1.35; }
.inbox-item:hover { background: var(--hover); text-decoration: none; }
.inbox-item.unread { background: var(--accent-soft); border-inline-start-color: var(--accent); }
.inbox-item.urgent { border-inline-start-color: var(--bad); }
.inbox-item .inbox-title { display: block; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.inbox-item.unread .inbox-title { font-weight: 650; }
.inbox-item .inbox-meta { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-empty { padding: 10px 12px; color: var(--muted); font-size: 12.5px; white-space: normal; }
/* The top bar. Wide, it is one row; the brand's name, then the labels of Chat and Radio, give
   way first, and the radio's strip narrows. Narrower, the tools take a second row of their own,
   with the radio's strip across it, so nothing leaves the bar. On a phone the clock leaves out
   the weekday and the seconds, and the line above it gives the pace and the zone. */
.tb-tools { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; }
.rd-menu { min-width: 0; flex: none; }
.rd-menu.live { flex: 0 1 320px; }
.rd-menu .rd-btn { width: 100%; min-width: 0; }
.tb-coname { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1279px) { .tb-brandname { display: none; } }
@media (max-width: 1100px) { .tb-label { display: none; } .tb-coname { max-width: 120px; } }
@media (max-width: 980px) {
  :root { --tb-h: 84px; }
  .topbar { flex-wrap: wrap; column-gap: 10px; row-gap: 0; padding: 0 10px; }
  .topbar { align-content: flex-start; }
  .tb-season { justify-content: center; min-height: 46px; }
  .tb-tools { flex: 1 1 100%; order: 10; height: 38px; margin: 0 -10px; padding: 0 10px 6px; gap: 6px; border-top: 1px solid #ffffff14; padding-top: 5px; }
  .rd-menu, .rd-menu.live { flex: 1 1 auto; }
  .rd-menu .tb-label { display: inline; }
  .rd-ticker { max-width: none; }
  .tb-tools .tb-btn { height: 28px; }
}
@media (max-width: 520px) {
  .tb-season { flex: 1 1 0; min-width: 0; }
  .tb-season .w { width: auto; min-width: 0; }
  .tb-season + .grow { display: none; }
  .tb-long { display: none; }
  .tb-meta, .tb-short { display: inline; }
  .flap-wd, .flap-s, .tb-clock .pace, .tb-zone { display: none; }
  .tb-coname { display: none; }
  .tb-cash { font-size: 12.5px; }
}
@media (max-width: 360px) { .topbar .brand { display: none; } }

/* The radio in the top bar. */
.rd-btn.live { border-color: #efbc7366; }
.rd-bars { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 11px; }
.rd-bars i { display: block; width: 2px; height: 100%; border-radius: 1px; background: var(--amber); transform-origin: bottom; animation: rd-bar .9s ease-in-out infinite alternate; }
.rd-bars i:nth-child(2) { animation-duration: .7s; animation-delay: -.3s; }
.rd-bars i:nth-child(3) { animation-duration: 1.1s; animation-delay: -.6s; }
.rd-bars i:nth-child(4) { animation-duration: .8s; animation-delay: -.15s; }
.rd-bars.still i { animation: none; transform: scaleY(.3); }
.rd-ticker { flex: 1 1 auto; min-width: 0; max-width: 260px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 14px), transparent); }
.rd-run { display: inline-flex; white-space: nowrap; animation: rd-run linear infinite; }
.rd-run > span { padding: 0 2.5em 0 10px; }
.rd-btn:hover .rd-run { animation-play-state: paused; }
@keyframes rd-run { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .rd-run { animation: none; } .rd-run > span + span { display: none; } }
@keyframes rd-bar { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .rd-bars i { animation: none; transform: scaleY(.6); } }
.rd-pop { width: 320px; max-width: calc(100vw - 16px); max-height: calc(100dvh - var(--tb-h) - 16px); overflow-y: auto; padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.rd-head { display: flex; align-items: center; justify-content: space-between; }
.rd-head .hdr { padding: 0; }
.rd-power { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.rd-power.on { background: var(--navy); border-color: var(--navy); color: var(--amber); }
.rd-dial { position: relative; height: 38px; border-radius: 5px; background: linear-gradient(#0b2235, #102e46); overflow: hidden; box-shadow: inset 0 1px 4px #0008; }
.rd-dial::before { content: ""; position: absolute; left: 6px; right: 6px; top: 6px; height: 10px; background: repeating-linear-gradient(90deg, #ffffff40 0 1px, transparent 1px 100%) 0 0 / calc(100% / 41) 100%; }
.rd-scale { position: absolute; left: 6px; right: 6px; top: 0; bottom: 0; }
.rd-scale span { position: absolute; bottom: 4px; pointer-events: none; transform: translateX(-50%); font: 600 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: #9fb4c3; }
.rd-mark { position: absolute; top: 4px; width: 6px; height: 6px; transform: translateX(-50%); border-radius: 50%; background: #ffffff55; }
.rd-mark.cur { background: var(--amber); }
.rd-needle { position: absolute; top: 2px; bottom: 2px; width: 2px; margin-inline-start: -1px; background: #ff6b4a; box-shadow: 0 0 6px #ff6b4a; transition: left .45s cubic-bezier(.5, 0, .2, 1); opacity: .55; }
.rd-dial.on .rd-needle { opacity: 1; }
.rd-stations { display: flex; flex-direction: column; gap: 3px; }
.rd-station { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); cursor: pointer; text-align: start; }
.rd-station:hover { background: var(--hover); }
.rd-station.on { border-color: var(--accent); background: var(--accent-soft); }
.rd-freq { flex: none; width: 44px; font: 700 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); font-variant-numeric: tabular-nums; }
.rd-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rd-name b { font-size: 13px; }
.rd-name i { font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-station .rd-bars i { background: var(--accent); }
.rd-now { display: flex; flex-direction: column; gap: 3px; padding: 7px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line-2); }
.rd-label { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); }
.rd-track { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-progress { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rd-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rd-bar i { display: block; height: 100%; background: var(--accent); transition: width 1s linear; }
.rd-next { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-note { margin: 0; font-size: 12px; color: var(--muted); }
.rd-volume { display: flex; align-items: center; gap: 8px; }
.rd-volume input { flex: 1; accent-color: var(--accent); }
.rd-mute { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; display: inline-flex; }
.rd-pct { width: 32px; text-align: end; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rd-foot { margin: 0; font-size: 11px; color: var(--faint); line-height: 1.35; }
.rd-credits { max-height: 180px; overflow-y: auto; flex-shrink: 0; }
.rd-credits summary { cursor: pointer; }
.rd-credits p { margin: 6px 0; }
@media (max-width: 820px) { .rd-pop { position: fixed !important; left: 8px; right: 8px !important; top: calc(var(--tb-h) + 2px) !important; width: auto; } }

/* Personal preferences use the same sheet from the hub and every season. */
.preferences h3 { margin-bottom: 10px; font-size: 13.5px; }
.preferences .theme-options { max-width: 340px; }
.preferences .tz-inline { position: static; width: 100%; min-width: 0; padding: 0; box-shadow: none; border: 0; }
.preferences .tz-inline .hdr:first-child { display: none; }
.preferences .gg-chat .cd-alerts { padding: 0; }

.preferences-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: start; }
.preferences-nav { position: sticky; top: calc(var(--tb-h) + 12px); display: flex; flex-direction: column; padding: 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.preferences-nav a { display: flex; align-items: center; gap: 8px; padding: 9px 8px; border-radius: 4px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.preferences-nav a:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.preferences-nav a.active { background: var(--accent-soft); color: var(--accent); }
.preferences-body { min-width: 0; max-width: 1100px; }
.preferences .panel { margin: 0; }
.preferences .rd-inline { max-width: 480px; display: flex; flex-direction: column; gap: 12px; }
.server-settings .settings-grid, .server-settings .notify-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.server-settings .col-main { display: grid; gap: 12px; min-width: 0; }
.server-settings .card { min-width: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--panel); }
.server-settings .card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--head); font-size: 13.5px; }
.server-settings .card-title a { font-size: 11.5px; font-weight: 500; }
.server-settings .card-body { padding: 12px; }
.server-settings .stack { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.server-settings label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 12.5px; }
.server-settings input:not([type=checkbox]):not([type=hidden]), .server-settings textarea { width: 100%; min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); font: inherit; }
.server-settings textarea { resize: vertical; }
.server-settings input[type=file] { font-size: 11.5px; }
.server-settings .check-label { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; margin-bottom: 8px; }
.server-settings input[type=checkbox] { accent-color: var(--button); }
.server-settings .field-hint { font-size: 11.5px; color: var(--muted); margin: 0; }
.server-settings button, .server-settings .button { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--button); color: #fff; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.server-settings .button.secondary { background: var(--panel); color: var(--accent); }
.server-settings .link { padding: 0; border: 0; background: transparent; color: var(--accent); }
.server-settings .notice { padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 6px; }
.server-settings .notice.success { background: var(--good-soft); color: var(--good); }
.server-settings .error { color: var(--bad); font-size: 12.5px; }
.server-settings img { max-width: 100%; height: auto; }
.server-settings .blocked-list { margin: 0; padding: 0; list-style: none; }
.server-settings .blocked-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; gap: 12px; }
.server-settings .notify-layout { grid-template-columns: minmax(0, 1fr); }
.server-settings .table-scroll { overflow-x: auto; }
.server-settings table.grid { display: table; width: 100%; border-collapse: collapse; }
.server-settings .notify-grid th, .server-settings .notify-grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: start; font-size: 12.5px; }
.server-settings .notify-grid .notify-cell { width: 80px; text-align: center; }
.server-settings .notify-group { background: var(--head); }
.server-settings .notify-hint { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
@media (max-width: 1100px) { .server-settings .settings-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .preferences-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .preferences-nav { position: static; flex-direction: row; overflow-x: auto; }
  .preferences-nav a { flex: none; white-space: nowrap; }
}

.server-settings .rank-insignia { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 11.5px; font-weight: 600; color: var(--accent); }
.server-settings .settings-membership { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.server-settings .member-extra { display: flex; align-items: flex-start; gap: 8px; padding: 10px; background: var(--warn-soft); border-radius: 6px; color: var(--warn); }
.server-settings .icon { width: 16px; height: 16px; flex: none; }

/* Hints on market actions: what an action does, why, and what to watch. */
.hint-wrap { display: inline-flex; }
.hint-pop { position: fixed; z-index: 2000; width: 300px; max-width: calc(100vw - 16px); background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px #0003; padding: 8px 10px; font-size: 12.5px; font-weight: 400; line-height: 1.45; text-align: start; white-space: normal; pointer-events: none; display: flex; flex-direction: column; gap: 4px; }
.hint-pop.up { transform: translateY(-100%); }
.hint-pop .ht { font-size: 13px; }
.hint-pop .hw i { font-style: normal; font-weight: 700; font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin-inline-end: 6px; }
.term { text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; cursor: help; }
.report-tbl { width: 100%; font-size: 12.5px; }
.report-tbl tr.strong td { font-weight: 650; border-top: 1px solid var(--line); }
.report-tbl th { text-align: start; font-size: 11.5px; color: var(--muted); font-weight: 650; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.report-tbl td { padding: 3px 6px; }
.report-tbl .right { text-align: end; font-variant-numeric: tabular-nums; }
/* A full quote beside its key figures on a wide screen. */
@media (min-width: 1240px) {
  .quote.wide { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "head head" "bar stats" "chart stats"; grid-template-rows: auto auto 1fr; }
  .quote.wide .q-head { grid-area: head; }
  .quote.wide .q-bar { grid-area: bar; }
  .quote.wide .q-chart { grid-area: chart; }
  .quote.wide .q-stats { grid-area: stats; grid-template-columns: 1fr; margin: 0; padding: 0 14px 8px; border-inline-start: 1px solid var(--line-2); border-top: 1px solid var(--line-2); align-self: stretch; }
  .quote.wide .q-stats > div { padding: 4px 0; }
}
.server-settings img.picture-preview { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 50%; margin-bottom: 16px; background: var(--avatar-blue-bg); }

/* Shared numeric drafts, historical airport identity and keyboard timetable controls. */
.numeric-field { display: inline-flex; flex-direction: column; min-width: 0; max-width: 100%; vertical-align: top; }
.numeric-field > .affix { width: 100%; flex: none; }
.numeric-field .affix.invalid { border-color: var(--bad); }
.numeric-help { display: block; margin-top: 3px; white-space: normal; font-size: 11px; font-weight: 400; line-height: 1.35; color: var(--muted); }
.numeric-help.err { color: var(--bad); }
.amount-in > .numeric-field { width: 100%; }
.stepper { align-items: flex-start; }
.stepper > .numeric-field { flex: 1; min-width: 72px; }
.stepper > .numeric-field > .affix { border-radius: 0; }
.stepper > .numeric-field input { width: 6ch; min-width: 0; text-align: center; }
.cabin-row .stepper > .numeric-field { min-width: 0; flex: 1; }
.scale-wrap { flex: 1; min-width: 0; }
.ap.has-value, .ap.sm.has-value { height: auto; min-height: 66px; align-items: stretch; }
.ap.has-value .ap-val { position: relative; left: auto; right: auto; display: flex; flex: 1; flex-direction: column; padding: 5px 44px 5px 8px; overflow: visible; white-space: normal; line-height: 1.35; overflow-wrap: anywhere; }
.ap.has-value .ap-place { font-weight: 600; }
.ap-name, .ap-status { display: block; font-size: 11.5px; color: var(--muted); }
.ap-status.bad { color: var(--bad); }
.ap-o { white-space: normal; align-items: flex-start; padding-top: 5px; padding-bottom: 5px; }
.ap-o .ap-details { display: flex; flex: 1; min-width: 0; flex-direction: column; overflow-wrap: anywhere; }
.ap-o .ap-details b { max-width: none; overflow: visible; }
.ap-o .ap-details .nm { overflow: visible; text-overflow: clip; }
.airport-chip { max-width: 100%; white-space: normal; }
.heat button.hc { min-width: 0; padding: 0; border: 0; cursor: pointer; font-family: inherit; }
.heat button.hc:disabled { cursor: default; }
.heat button.hc:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; z-index: 1; }
.heat button.hc[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--accent); }
.weekgrid-pick, .weekgrid-editor label, .weekgrid-time { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12.5px; }
.weekgrid-pick > select { width: 100%; }
.weekgrid-editor { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; min-width: 0; margin: 8px 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.weekgrid-editor legend { max-width: 100%; padding: 0 4px; font-size: 12.5px; white-space: normal; }
.weekgrid button.slot { border: 0; text-align: start; touch-action: none; }
.weekgrid button.slot:focus-visible { outline: 2px solid var(--amber); z-index: 3; }
.stats { margin: 0; }
.stats dt, .stats dd { margin: 0; }
.dt tbody th.dt-rowhead { position: static; z-index: auto; padding: 0 7px; height: var(--row); border-bottom: 1px solid var(--line-2); background: transparent; color: inherit; font-size: inherit; font-weight: 400; letter-spacing: normal; text-transform: none; overflow: hidden; text-overflow: ellipsis; max-width: 340px; font-variant-numeric: tabular-nums; user-select: text; }
.dt tbody th.dt-rowhead.first { position: sticky; left: 0; z-index: 1; background: var(--rowbg, var(--panel)); }
.dt tbody th.dt-rowhead.wrap { white-space: normal; }
.dt tbody tr:hover th.dt-rowhead { background: var(--hover); }
.dt tbody tr.selected th.dt-rowhead { background: var(--sel); }
.dt tbody tr.dim th.dt-rowhead { color: var(--faint); }
.dt tbody tr.warn th.dt-rowhead:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.dt tbody tr.bad th.dt-rowhead:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.dt tbody tr.good th.dt-rowhead:first-child { box-shadow: inset 3px 0 0 var(--good); }
.dt tbody tr.depth-sell:hover th.dt-rowhead, .dt tbody tr.depth-buy:hover th.dt-rowhead { background: color-mix(in srgb, var(--hover) 60%, transparent); }
.dt tbody th.dt-rowhead.itm { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.dt tbody tr.spot th.dt-rowhead { box-shadow: inset 0 2px 0 var(--accent); }

/* A new airline's first flight, above every screen until it lands: a strip like a departures board. */
/* The strips above a company's screens: its first flight, and the weekly offer to install. */
.first-flight, .install-reminder { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 13px; box-shadow: var(--card-shadow); }
.first-flight > svg, .install-reminder > svg { color: var(--amber); flex: none; }
.first-flight .mono { color: var(--amber-2); font-weight: 600; }
.first-flight .muted { color: #c3d1db; }
.first-flight .btn:not(.primary), .install-reminder .btn:not(.primary) { background: transparent; color: #fff; border-color: #ffffff59; }
.first-flight .btn:not(.primary):hover, .install-reminder .btn:not(.primary):hover { background: #ffffff1a; }
.main.flush > .first-flight, .main.flush > .install-reminder { margin: 0; border-radius: 0; }
.away-list { margin: 4px 0 0; padding-inline-start: 18px; display: grid; gap: 3px; }
.away-list li.bad a, .away-list li.bad { color: var(--bad); }

/* Right-to-left languages turn the layout; maps, charts and timelines keep west on the left
   and time running rightwards. */
[dir=rtl] .maplibregl-map, [dir=rtl] .chart, [dir=rtl] svg { direction: ltr; }

/* Suggesting a better translation (TranslationSuggest.tsx) */
.tr-source, .tr-now { padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); white-space: pre-wrap; word-break: break-word; }
.tr-source { font-family: var(--mono); font-size: 12px; }
.tr-sugg { padding: 6px 0; border-bottom: 1px solid var(--line); }
.sheet .field textarea { width: 100%; font: inherit; resize: vertical; }
/* Arranged pages: a layout's columns, and the sheet that arranges them. */
.arr-col { min-width: 0; }
.arr-h { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.arr-list { border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.arr-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; min-height: 34px; }
.arr-row:last-child { border-bottom: 0; }
.arr-row.wrap { flex-wrap: wrap; }
.arr-row.top { align-items: flex-start; }
.arr-row .btn.xs svg { width: 12px; height: 12px; }
.arr-up { transform: rotate(180deg); }
.arr-note { padding: 8px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); }
.arr-pad { padding: 8px 10px; }
.grid > .arr-col > .found-map { position: sticky; top: calc(var(--tb-h) + 12px); height: calc(100vh - var(--tb-h) - 24px); min-height: 520px; border-radius: 6px; }
/* A tab group: its own tabs and columns, which stack when the group itself is narrow. */
.arr-group { container-type: inline-size; min-width: 0; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); }
.arr-group > .tabs { margin-top: -4px; }
@container (max-width: 900px) { .grid.arr-grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 640px) { .grid.arr-grid.c2, .grid.arr-grid.c3, .grid.arr-grid.side, .grid.arr-grid.plan { grid-template-columns: minmax(0, 1fr); } }
/* A tab group's tabs and cards in the Arrange sheet, beneath its row. */
.arr-nest { margin: 0 0 8px 14px; padding: 8px 0 4px 10px; border-inline-start: 2px solid var(--line); }
/* A page drawn out of sight for its cards on another page; its sheets and dialogs still show. */
.card-host { position: absolute; width: 0; height: 0; overflow: hidden; visibility: hidden; }
.card-host .scrim, .card-host .modal-wrap { visibility: visible; }
.card-slot:empty { display: none; }
/* A card Go to or a link asked for, picked out in the Arrange sheet. */
.arr-row.arr-pick { background: color-mix(in srgb, var(--accent, #2b7cd3) 12%, transparent); box-shadow: inset 3px 0 0 var(--accent, #2b7cd3); }
.arr-from { border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.arr-from > summary { padding: 6px 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.arr-from > .arr-list { border: 0; border-top: 1px solid var(--line-2); border-radius: 0 0 5px 5px; }
.arr-row-head .input { font-weight: 700; }
/* The icons a page may take. */
.icon-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.icon-pick button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); cursor: pointer; }
.icon-pick button:hover { border-color: var(--muted); }
.icon-pick button.on { border-color: var(--accent, #2b7cd3); box-shadow: 0 0 0 1px var(--accent, #2b7cd3); }
/* The sidebar's Edit menu, quieter than the pages above it. */
.nav-link.nav-edit { margin-top: 6px; border: 0; background: none; width: 100%; text-align: start; cursor: pointer; font: inherit; opacity: .75; }
.nav-link.nav-edit:hover { opacity: 1; }
/* A row's controls keep their width beside a long description. */
.arr-row > .select, .arr-row > span > .select { flex: none; }
/* The card catalogue: its tag chips and each page's heading in it. */
.arr-tags { flex-wrap: wrap; }
.arr-from-h { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
/* ---- Arranging on the page ---- */
/* The bar along the top while arranging, under the top bar as the page scrolls. */
.arr-editbar { position: sticky; top: calc(var(--tb-h) + 6px); z-index: 6; display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 4px; border-radius: 7px; background: var(--navy); color: #fff; border-bottom: 3px solid var(--amber); box-shadow: 0 6px 18px #0b162040; }
.arr-eb-t { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.arr-eb-t b { font-size: 13.5px; }
.arr-eb-t span { font-size: 12px; color: #b8cad6; }
.arr-eb-b { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.arr-editbar .btn:disabled { opacity: .5; }
/* A tab strip while arranging: the open tab's name is a field, with its own small buttons. */
.tabs.arr-tabs { overflow-x: auto; }
.tabs .arr-tab-on { position: relative; display: inline-flex; align-items: center; gap: 1px; flex: none; height: 29px; padding: 0 4px 0 6px; margin-inline-start: -1px; border: 1px solid var(--btn-line); border-bottom: 0; border-radius: 7px 7px 0 0; background: var(--button); color: #fff; z-index: 2; }
.tabs .arr-tab-on:first-child { margin-inline-start: 0; }
.tabs .arr-tab-on .arr-tab-name { height: 21px; min-width: 60px; max-width: 220px; padding: 0 5px; border: 1px dashed #ffffff70; border-radius: 4px; background: #ffffff14; color: #fff; font: inherit; font-size: 12.5px; font-weight: 600; }
.tabs .arr-tab-on .arr-tab-name:focus { outline: none; border-style: solid; border-color: var(--amber); background: #ffffff22; }
.tabs .arr-tab-on button { height: 21px; width: 21px; padding: 0; margin: 0; justify-content: center; border: 0; border-radius: 4px; background: transparent; color: #ffffffcc; }
.tabs .arr-tab-on button:hover:not(:disabled) { background: #ffffff26; color: #fff; }
.tabs .arr-tab-on button:disabled { opacity: .35; cursor: default; }
.tabs .arr-tab-on::before, .tabs .arr-tab-on::after { content: ""; position: absolute; bottom: 0; width: 10px; height: 8px; pointer-events: none; }
.tabs .arr-tab-on::before { left: -8px; background: radial-gradient(circle at 0 0, transparent 7px, var(--btn-line) 7.5px 8px, var(--button) 8.5px); }
.tabs .arr-tab-on::after { right: -8px; background: radial-gradient(circle at 100% 0, transparent 7px, var(--btn-line) 7.5px 8px, var(--button) 8.5px); }
.tabs button.arr-tab-add { gap: 3px; margin-inline-start: 6px; border-style: dashed; color: var(--accent); background: transparent; }
.tabs .arr-over, .tabs button.arr-over { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 30%, var(--panel)); }
/* The open tab's layouts as pictures, and what to add to it. */
.arr-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: -4px; }
.arr-tools-l { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.arr-tools-n { font-size: 12px; color: var(--muted); }
.arr-layouts { display: inline-flex; gap: 3px; }
.arr-layouts button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--muted); cursor: pointer; }
.arr-layouts button:hover { border-color: var(--accent); color: var(--accent); }
.arr-layouts button.on { border-color: var(--button); background: var(--button); color: #fff; }
/* A column, or the full width above or below the columns, as a place to drop cards. */
.arr-zone { position: relative; min-width: 0; min-height: 64px; padding: 8px; border: 1.5px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.arr-zone.arr-zone-full { min-height: 40px; }
.arr-zone-h { margin: -2px 0 -4px; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.arr-zone-empty { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 30px; font-size: 12.5px; color: var(--muted); text-align: center; }
.arr-zone.arr-zone-full > .arr-zone-empty { min-height: 18px; }
.arr-zone.arr-drop-into { border-color: var(--amber); border-style: solid; background: color-mix(in srgb, var(--amber) 16%, transparent); }
/* A card or tab group in its place: its bar to drag it by, over the card as it shows. */
.arr-item { position: relative; min-width: 0; border-radius: 8px; outline: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); background: var(--bg); }
.arr-bar { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 4px 3px 6px; border-radius: 8px 8px 0 0; background: var(--navy-2); color: #fff; font-size: 12.5px; cursor: grab; touch-action: none; user-select: none; }
.arr-bar:hover { background: var(--sky); }
.arr-grip { flex: none; opacity: .75; }
.arr-bar-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.arr-bar-note { flex: none; font-size: 11.5px; color: #b8cad6; }
.arr-bar-btns { display: flex; gap: 3px; flex: none; align-items: center; cursor: default; }
.arr-bar .btn.xs { height: 22px; }
.arr-bar .btn.xs svg { width: 12px; height: 12px; }
.arr-bar .select { color: var(--text); }
.select.xs { height: 22px; padding: 0 4px; font-size: 11.5px; border-radius: 5px; }
.arr-move { max-width: 116px; }
.arr-item-b { position: relative; padding: 6px 6px 0; }
.arr-tile-b.cut::after { content: ""; position: absolute; inset: auto 0 0; height: 56px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.arr-item-b .arr-fit > .panel { margin: 0; }
.arr-item-group > .arr-group { margin: 6px; }
.arr-group-edit { padding-top: 10px; }
/* Where a dragged card would go, and the card while it is dragged. */
.arr-drop-before::before, .arr-drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--amber); box-shadow: 0 0 0 2px #efbc7355; z-index: 3; pointer-events: none; }
.arr-drop-before::before { top: -8px; }
.arr-drop-after::after { bottom: -8px; }
.arr-item.arr-dragging { opacity: .35; }
.arr-ghost { position: fixed; left: 0; top: 0; z-index: 120; max-width: 280px; padding: 5px 10px; border-radius: 6px; background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 2px solid var(--amber); box-shadow: 0 8px 24px #0b162066; pointer-events: none; }
body.arr-drag-on, body.arr-drag-on * { cursor: grabbing !important; user-select: none !important; }
@keyframes arr-flash { from { box-shadow: 0 0 0 3px var(--amber); } to { box-shadow: 0 0 0 3px transparent; } }
.arr-item.arr-flash { animation: arr-flash 1.4s ease-out; }
/* The card catalogue: every card the page can add, drawn as it shows. */
.modal.arr-picker { width: min(1180px, calc(100vw - 24px)); height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.arr-picker-wrap { padding: 12px; }
.arr-pk-h { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; background: var(--navy); color: #fff; border-bottom: 3px solid var(--amber); }
.arr-pk-h h2 { font-size: 16.5px; color: #fff; }
.arr-pk-h .muted { color: #b8cad6; }
.arr-pk-h .select { max-width: min(360px, 60vw); color: var(--text); }
.arr-pk-h .input { color: var(--text); }
.arr-pk-h .chip:not(.on) { background: #ffffff12; border-color: #ffffff30; color: #e6eef3; }
.arr-pk-b { flex: 1; overflow-y: auto; padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.arr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.arr-tile { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--card-shadow); overflow: hidden; }
.arr-tile-h { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.arr-tile-t { gap: 2px; }
.arr-tile-t b { font-size: 13px; }
.arr-tile-b { position: relative; height: 260px; overflow: hidden; padding: 8px; background: var(--bg); }
.arr-tile-b.cut::after { background: linear-gradient(transparent, var(--bg)); }
.arr-tile-none { padding: 14px 10px; font-size: 12.5px; color: var(--muted); background: var(--bg); }
.arr-tile.added { border-color: color-mix(in srgb, var(--good, #2e7d4f) 45%, var(--line)); }
.arr-tile.added .arr-tile-h { border-bottom: 0; }
.arr-added { display: inline-flex; align-items: center; gap: 4px; flex: none; max-width: 45%; font-size: 12px; font-weight: 600; color: var(--good, #2e7d4f); }
.arr-tile.arr-pick { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
.arr-pk-b .arr-from-h { margin: 0; font-size: 12px; }
/* The page's name and icon. */
.modal.arr-look { width: min(520px, 100%); }
.arr-look-b { gap: 10px; }
.arr-look-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); flex: none; }
@media (max-width: 640px) {
  .arr-editbar { top: calc(var(--tb-h) + 4px); padding: 6px 8px; }
  .arr-eb-t span { display: none; }
  .arr-tiles { grid-template-columns: minmax(0, 1fr); }
  .modal.arr-picker { height: calc(100vh - 16px); width: calc(100vw - 12px); }
  .arr-picker-wrap { padding: 6px; }
  .arr-move { max-width: 90px; }
}
.tabs .arr-flash { animation: arr-flash 1.4s ease-out; }
.arr-hide { display: none !important; }
/* A card at the height the player gave it: its heading stays, what it shows scrolls. */
.arr-sized { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.arr-sized > *, .arr-sized > .card-slot > .panel { flex: 1 1 auto; min-height: 0; }
.arr-sized > .card-slot { display: flex; flex-direction: column; }
.arr-sized > :not(.panel):not(.card-slot) { overflow: auto; }
.arr-sized > .panel, .arr-sized > .card-slot > .panel { display: flex; flex-direction: column; }
.arr-sized > .panel > *, .arr-sized > .card-slot > .panel > * { flex: none; }
.arr-sized > .panel > .pb, .arr-sized > .card-slot > .panel > .pb { flex: 1 1 auto; min-height: 0; overflow: auto; }
.panel + .arr-fit, .arr-fit + .panel, .arr-fit + .arr-fit { margin-top: 0; }
/* A card's foot while arranging, dragged to set its height. */
.arr-resize { position: relative; display: flex; align-items: center; justify-content: center; height: 14px; margin-top: 2px; border-radius: 0 0 8px 8px; cursor: ns-resize; touch-action: none; user-select: none; }
.arr-resize > span { width: 44px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.arr-resize:hover > span, .arr-resize:focus-visible > span, .arr-resize.on > span { background: var(--amber); }
.arr-resize:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.arr-resize.on::after { content: attr(data-h); position: absolute; right: 8px; top: -26px; padding: 2px 7px; border-radius: 5px; background: var(--navy); color: #fff; font-size: 11.5px; font-weight: 650; border-bottom: 2px solid var(--amber); pointer-events: none; }
body.arr-size-on, body.arr-size-on * { cursor: ns-resize !important; user-select: none !important; }
/* Simple view (the Rust interface). Measured against Banished and Cities: Skylines at 1920x1080,
   where what stays on screen takes 2-8% of it: the map runs edge to edge, the game's bar is one
   strip of 44px along the foot (clock at the left, the folders in its middle, the company and
   tools at the right), the map's own controls sit in the top right corner, and everything else is
   a window opened from a folder or by picking something on the map. */
.app.simple { grid-template-columns: minmax(0, 1fr); }
.app.simple .sidebar, .app.simple .bottombar { display: none; }
.tb-dock { display: none; }
.desk { position: relative; height: calc(100dvh - var(--tb-h)); overflow: hidden; }
.desk .hidden { display: none !important; }
.desk-map { position: absolute; inset: 0; }
.desk-map .map-screen { height: 100%; }
.desk-world { height: 100%; }

/* The map's controls: a small group in the top right corner, beside the zoom buttons. */
.desk .map-screen, .desk .map-screen.details-open { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.desk .map-toolbar { position: absolute; top: 8px; right: 44px; z-index: 5; flex-wrap: nowrap; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: 0 4px 14px #0b162030; }
.desk .map-toolbar .dd { flex: 0 1 190px; }
.desk .map-toolbar .map-details-toggle { margin: 0; }
.desk .map-screen .side { position: absolute; z-index: 4; top: 48px; right: 8px; bottom: 8px; width: 310px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 26px #0b162038; }
.desk .map-ctl { top: 8px; right: 8px; }

/* The folders, in the middle of the bar. */
.desk-dock { display: flex; align-items: stretch; gap: 1px; height: 100%; }
.desk-folder-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 58px; padding: 2px 6px; border: 0; border-radius: 5px; background: none; color: #c4d3dd; font-size: 10.5px; line-height: 1.1; white-space: nowrap; cursor: pointer; }
.desk-folder-btn svg { width: 17px; height: 17px; }
.desk-folder-btn:hover, .desk-folder-btn.on { background: #ffffff17; color: #fff; }
.desk-folder-btn.on { box-shadow: inset 0 -2px 0 var(--amber); }

/* A folder opens upward from the bar, in two columns. */
.desk-folder { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 8; width: min(720px, calc(100% - 16px)); max-height: calc(100% - 60px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 -6px 30px #0b16204d; }
.desk-folder-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line); }
.desk-folder-head b { white-space: nowrap; }
.desk-folder-head .input { flex: 0 1 240px; min-width: 0; margin-inline-start: auto; }
.desk-folder-body { overflow: auto; padding: 0 12px 8px; columns: 2 300px; column-gap: 20px; }
.desk-page { break-inside: avoid; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.desk-page-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-weight: 600; font-size: 12.5px; }
.desk-page-head .link { font-weight: 600; }
.desk-cards, .desk-choices { display: flex; flex-wrap: wrap; gap: 3px; }
.desk-card-btn { padding: 2px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--text); font-size: 12px; line-height: 1.5; cursor: pointer; }
.desk-card-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Windows: one bar each, as in the games, and what they show to the edge. */
.desk-area { position: absolute; inset: 0; z-index: 6; isolation: isolate; pointer-events: none; }
.desk-win { position: absolute; display: flex; flex-direction: column; min-width: 240px; overflow: hidden; pointer-events: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 22px #0b162038; }
.desk-win.top { box-shadow: 0 10px 32px #0b162059; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.desk-win.waiting { display: none; }
.desk-bar { flex: none; display: flex; align-items: center; gap: 4px; min-height: 28px; padding: 1px 2px 1px 9px; background: var(--navy); color: #fff; cursor: grab; user-select: none; touch-action: none; }
.desk-bar:active { cursor: grabbing; }
.desk-win:not(.top) .desk-bar { background: var(--navy-2); }
.desk-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 12.5px; }
.desk-btn { display: inline-flex; align-items: center; gap: 3px; flex: none; height: 22px; padding: 0 5px; border: 0; border-radius: 4px; background: none; color: #c4d3dd; font-size: 11.5px; cursor: pointer; }
.desk-btn:hover { background: #ffffff1f; color: #fff; }
.desk-btn.txt { border: 1px solid #ffffff2e; }
.desk-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.desk-win.heading .desk-body { padding: 6px 8px 8px; }
.desk-grip { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 55%, var(--line) 55%, var(--line) 65%, transparent 65%, transparent 75%, var(--line) 75%, var(--line) 85%, transparent 85%); }
.desk-note { margin: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.desk-card.absent > .card-slot { display: none; }
.desk-card:not(.absent) > .absent-note { display: none; }
/* The bar names the card: its own title row goes, and its panel loses the frame the window gives it. */
.desk-card > .card-slot { gap: 0; }
.desk-card > .card-slot > * > .panel, .desk-card > .card-slot > .panel { border: 0; border-radius: 0; box-shadow: none; }
.desk-card .card-slot > div > .panel:first-child > .ph:not(:has(> :not(h2, h3))), .desk-card .card-slot > .panel:first-child > .ph:not(:has(> :not(h2, h3))) { display: none; }
.desk-card .card-slot > div > .panel:first-child > .ph > :is(h2, h3):first-child:not(:only-child) { display: none; }
.desk-card .card-slot > div > .panel:first-child > .ph { min-height: 0; padding: 3px 8px; border-radius: 0; justify-content: flex-end; }
.desk-card > .panel { margin: 8px; }
/* A page's heading in its window: the bar has its name; the line under it and its buttons stay. */
.desk-frame .page-head { margin: 0 0 6px; min-height: 0; flex-wrap: wrap; row-gap: 4px; }
.desk-frame .page-head h1, .desk-frame .page-head .crumbs { display: none; }
.desk-frame .page-head .grow { white-space: normal; }
.desk-frame .page-head .sub { font-size: 12px; }
.desk-frame .page-head .btns { flex-wrap: wrap; }
.desk-frame a[href$="/map"] { display: none; }
.desk-choices { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.desk-win .stats { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.desk-win .stat { padding: 4px 8px 5px; }
.desk-win .stat .l { font-size: 9.5px; letter-spacing: .6px; }
.desk-win .stat .v { font-size: 15px; }
.desk-win .stat .d { font-size: 10.5px; }
/* What a card shows answers to the size of its window rather than the screen's: each window's
   body carries a class for each width it is under (lt520, lt820, ...), and the layouts the
   game's pages change for a narrow screen change for a narrow window the same way. */
.desk-body.lt1240 .quote.wide { display: block; }
.desk-body.lt1240 .quote.wide .q-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin: 8px 14px 6px; padding: 0; border: 0; }
.desk-body.lt1240 .quote.wide .q-stats > div { padding: 6px 0; }
.desk-body.lt1100 .pf-grid { display: flex; flex-direction: column; }
.desk-body.lt1100 .pf-grid > .col { display: contents; }
.desk-body.lt1100 .pf-grid .pf-first { order: -1; }
.desk-body.lt1100 .grid.side { grid-template-columns: minmax(0, 1fr); }
.desk-body.lt1100 .grid.c4, .desk-body.lt1100 .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.desk-body.lt820 .hide-sm { display: none !important; }
.desk-body.lt820 .show-sm { display: flex !important; }
.desk-body.lt820 .grid.c2, .desk-body.lt820 .grid.c3, .desk-body.lt820 .grid.c4, .desk-body.lt820 .grid.side-l { grid-template-columns: minmax(0, 1fr); }
.desk-body.lt820 .span2 { grid-column: auto; }
.desk-body.lt820 .form.c3, .desk-body.lt820 .form.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.desk-body.lt820 .grid.plan { display: flex; flex-direction: column; gap: 12px; }
.desk-body.lt820 .grid.plan > .col { display: contents; }
.desk-body.lt820 .grid.plan > .col > * { order: 4; }
.desk-body.lt820 .grid.plan .pl-route { order: 1; }
.desk-body.lt820 .grid.plan .pl-check { order: 2; }
.desk-body.lt820 .grid.plan .pl-fares { order: 3; }
.desk-body.lt720 .attention .att { flex-direction: column; align-items: flex-start; }
.desk-body.lt720 .found-split { grid-template-columns: minmax(0, 1fr); }
.desk-body.lt720 .found-map { height: 280px; }
.desk-body.lt640 .daystrip { gap: 4px; }
.desk-body.lt640 .daystrip .day { align-items: center; padding: 5px 2px; }
.desk-body.lt640 .daystrip .day .mon { display: none; }
.desk-body.lt640 .daystrip .day small { font-size: 10px; letter-spacing: 0; }
.desk-body.lt640 .fare-row { grid-template-columns: 1fr; gap: 4px; }
.desk-body.lt640 .rule-line { grid-template-columns: 1fr; gap: 4px; }
.desk-body.lt640 .financial-report { padding: 14px 8px 10px; }
.desk-body.lt640 .financial-report-head h2 { font-size: 20px; }
.desk-body.lt640 .financial-table tr > :first-child { min-width: 180px; max-width: 220px; }
.desk-body.lt640 .financial-print { position: static; align-self: flex-end; margin-bottom: 4px; }
.desk-body.lt640 .arr-tiles { grid-template-columns: minmax(0, 1fr); }
.desk-body.lt600 .preferences-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.desk-body.lt600 .preferences-nav { position: static; flex-direction: row; overflow-x: auto; }
.desk-body.lt600 .preferences-nav a { flex: none; white-space: nowrap; }
.desk-body.lt560 .amount-row { flex-direction: column; align-items: stretch; }
.desk-body.lt560 .amount-in { width: 100%; }
/* A compact amount (a fare beside its quick picks) keeps its input's width in a narrow space,
   the picks wrapping beside and under it: a share of a row as wide as its content is nothing. */
.desk-body.lt560 .amount.compact .amount-row { flex-direction: row; align-items: center; }
.desk-body.lt560 .amount.compact .amount-in { width: 140px; }
@media (max-width: 560px) { .amount.compact .amount-row { flex-direction: row; align-items: center; } .amount.compact .amount-in { width: 140px; } }
.desk-body.lt560 .q-stats { grid-template-columns: minmax(0, 1fr); }
.desk-body.lt560 .q-last { font-size: 24px; }
.desk-body.lt560 .q-chart { padding-inline-start: 8px; }
.desk-body.lt520 .gantt-row, .desk-body.lt520 .gantt-head { grid-template-columns: 132px minmax(0, 1fr); }
.desk-body.lt520 .gl-util { display: none; }
.desk-body.lt520 .pl-map { height: 300px; }
.desk-body.lt520 .pl-key { font-size: 11px; gap: 2px 8px; bottom: 38px; }
.desk-body.lt520 .pl-key .faint { display: none; }
.desk-body.lt520 .pl-glance { grid-template-columns: repeat(2, 1fr); }
.desk-body.lt520 .pl-glance > div:nth-child(3n) { border-inline-end: 1px solid var(--line-2); }
.desk-body.lt520 .pl-glance > div:nth-child(2n) { border-inline-end: 0; }
.desk-body.lt520 .pl-glance > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
.desk-body.lt520 .choices.wide { grid-template-columns: minmax(0, 1fr) !important; }
.desk-body.lt520 .cabin-row { grid-template-columns: minmax(0, 1fr) 116px 60px 30px; }
.desk-body.lt520 .cabin-row > :nth-child(1) { grid-area: 1 / 1; }
.desk-body.lt520 .cabin-row > :nth-child(2) { grid-area: 2 / 1 / 3 / 3; }
.desk-body.lt520 .cabin-row > :nth-child(3) { grid-area: 1 / 2; }
.desk-body.lt520 .cabin-row > :nth-child(4) { grid-area: 1 / 3; }
.desk-body.lt520 .cabin-row > :nth-child(5) { grid-area: 2 / 3; }
.desk-body.lt520 .cabin-row > :nth-child(6) { grid-area: 1 / 4; }
.desk-body.lt520 .cabin-row > .cabin-fit { grid-area: 3 / 1 / 4 / 5; }
.desk-body.lt520 .cabin-comfort { margin-inline-start: 0; }
.desk-body.lt520 .advert-creative { flex-direction: column; align-items: flex-start; gap: 8px; }
.desk-body.lt520 .advert-creative img { width: 100%; max-height: 120px; }
/* A table too narrow for its columns shows each row as a card: its first field as the card's
   title, the rest named by their columns, as many across as fit. Sorting moves to its bar. */
.dt.cards thead { display: none; }
.dt.cards table, .dt.cards tbody, .dt.cards tfoot { display: block; }
.dt.cards tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 5px 14px; position: relative; padding: 8px 10px 9px; border-bottom: 1px solid var(--line-2); background: var(--rowbg, var(--panel)); }
.dt.cards tr.dt-spacer { display: block; padding: 0; border: 0; }
.dt.cards td, .dt.cards th[scope="row"] { display: block; position: static; height: auto; min-width: 0; max-width: none; padding: 0; border: 0; background: none; box-shadow: none; white-space: normal; overflow-wrap: anywhere; text-align: start; font-size: 12.5px; color: var(--text); text-transform: none; letter-spacing: 0; }
.dt.cards td::before, .dt.cards th[scope="row"]::before { content: attr(data-label); display: block; margin-bottom: 1px; color: var(--muted); font-size: 9.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.dt.cards td[data-label=""]::before { content: none; }
.dt.cards td.wrap { grid-column: span 2; }
.dt.cards td > *, .dt.cards th[scope="row"] > * { max-width: 100%; }
.dt.cards td .badge, .dt.cards td .chip, .dt.cards td .pill { white-space: normal; height: auto; }
.dt.cards .lead { grid-column: 1 / -1; padding-inline-end: 28px; font-size: 13.5px; font-weight: 650; }
.dt.cards .lead::before { content: none; }
.dt.cards td.cb { position: absolute; top: 8px; right: 8px; z-index: 2; width: auto; padding: 0; }
.dt.cards td.cb::before { content: none; }
.dt.cards tbody tr:hover { background: var(--hover); }
.dt.cards tbody tr:hover td, .dt.cards tbody tr.selected td { background: none; }
.dt.cards tbody tr.selected { background: var(--sel); }
.dt.cards tbody tr.warn { box-shadow: inset 3px 0 0 var(--warn); }
.dt.cards tbody tr.bad { box-shadow: inset 3px 0 0 var(--bad); }
.dt.cards tbody tr.good { box-shadow: inset 3px 0 0 var(--good); }
.dt.cards tfoot tr { position: sticky; bottom: 0; background: var(--head); border-top: 1px solid var(--line); font-weight: 650; }
.dt.cards tfoot td { position: static; border: 0; background: none; }
.dt-sortby { display: inline-flex; align-items: center; gap: 2px; }
.dt-sortby .input { width: auto; max-width: 150px; }
/* Headers and rows of buttons wrap in a narrow window rather than running out of it. */
.desk-body.lt520 .ph, .desk-body.lt520 .btns, .desk-body.lt520 .dt-bar { flex-wrap: wrap; row-gap: 4px; }
.desk-body.lt520 .dt-bar .input[type="search"] { flex: 1 1 120px; min-width: 0; }
.desk-pick { position: relative; flex: 0 1 180px; min-width: 100px; }
.desk-pick .input { width: 100%; height: 22px; color: var(--text); background: var(--panel); }
.desk-menu { position: relative; flex: none; }
.desk-pop { top: calc(100% + 4px); left: 0; max-height: 320px; overflow: auto; min-width: 240px; color: var(--text); cursor: default; }
.desk-menu .desk-pop { left: auto; right: 0; }
.desk-pop .item { white-space: normal; }
.desk-pop-note { padding: 4px 6px; }
.desk-tray { position: absolute; right: 8px; bottom: 8px; left: 50%; z-index: 7; display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: 4px; pointer-events: none; }
.desk-chip { display: inline-flex; gap: 5px; align-items: center; max-width: 240px; padding: 3px 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font-size: 11.5px; box-shadow: 0 3px 10px #0b162030; cursor: pointer; pointer-events: auto; }
.desk-chip:hover { border-color: var(--accent); }
.desk-hosts { position: absolute; width: 0; height: 0; overflow: hidden; }

/* The game's bar along the foot of the screen: one strip, as Cities: Skylines has. */
@media (min-width: 821px) {
  .app.simple { grid-template-rows: minmax(0, 1fr) 44px; }
  .app.simple .topbar { grid-row: 2; position: relative; top: auto; min-height: 44px; height: 44px; gap: 8px; padding: 0 6px 0 8px; box-shadow: 0 -4px 14px #0b16204d; }
  .app.simple .main { grid-row: 1; }
  .app.simple .tb-brandname, .app.simple .tb-sep, .app.simple .tb-long { display: none; }
  .app.simple .brand svg { width: 22px; height: 22px; }
  .app.simple .topbar > .grow { display: none; }
  .app.simple .tb-dock { display: flex; flex: 1 1 auto; justify-content: center; align-self: stretch; min-width: 0; padding: 3px 0; overflow-x: auto; scrollbar-width: none; }
  .app.simple .tb-btn { height: 28px; padding: 0 8px; }
  .app.simple .tb-tools { gap: 4px; }
  .app.simple .topbar .pop { top: auto !important; bottom: calc(100% + 6px) !important; }
  .desk { height: calc(100dvh - 44px); }
  /* A card's sheets and dialogs stop above the game's bar rather than under it. */
  .desk .scrim, .desk .modal-wrap { bottom: 44px; }
}
@media (max-width: 820px) {
  .app.simple .tb-dock { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 54px; z-index: 60; padding: 0 4px; overflow-x: auto; background: var(--navy); }
  .desk { height: calc(100dvh - var(--tb-h) - 54px); }
  .desk .map-toolbar { left: 8px; right: 44px; overflow-x: auto; }
  .desk-win { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto !important; height: 72% !important; max-height: none !important; border-radius: 10px 10px 0 0; }
  .desk-win:not(.top) { display: none; }
  .desk-bar { cursor: default; }
  .desk-grip { display: none; }
  .desk-tray { left: 8px; right: 8px; top: 52px; bottom: auto; justify-content: flex-start; }
  .desk-folder { left: 0; right: 0; bottom: 0; transform: none; width: auto; max-height: 78%; border-radius: 10px 10px 0 0; }
  .desk-folder-body { columns: 1; }
}

/* The 3D world map (ui/world_map.rs): space behind the globe while it loads, and a notice
   opened from its pin. */
.map-wrap.map-globe { background: #070b16; }
.map-globe .map-ctl button { font-weight: 650; }
.map-globe .map-ctl button.on { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.map-compass { display: block; }
.map-pin-pop { position: absolute; z-index: 6; width: min(330px, calc(100% - 24px)); max-height: min(60%, 420px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px #0005; padding: 8px 10px; font-size: 12.5px; }
.map-pin-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.map-pin-item { padding: 6px 0; border-top: 1px solid var(--line); }
.map-pin-item:first-of-type { border-top: 0; }

/* Simple view's dock opens a folder as a menu: its pages above the button, and the cards of the
   page pointed at beside them. */
.desk-menu { position: absolute; bottom: 6px; z-index: 8; display: flex; flex-direction: column; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 -6px 30px #0b16204d; }
.desk-menu-head { padding: 4px 8px 6px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.desk-menu-page { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 5px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: start; cursor: pointer; }
.desk-menu-page > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-menu-page svg { flex: none; width: 15px; height: 15px; color: var(--muted); }
.desk-menu-page:hover, .desk-menu-page.on { background: var(--hover); }
.desk-menu-page.on { color: var(--accent); }
.desk-menu-page.on svg { color: currentColor; }
.desk-menu-cards { position: absolute; bottom: -1px; width: 300px; max-height: min(70vh, 560px); overflow: auto; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 -6px 30px #0b16204d; }
.desk-menu-cards.right { left: calc(100% + 4px); }
.desk-menu-cards.left { right: calc(100% + 4px); }
.desk-menu-cards-head { display: flex; align-items: center; gap: 6px; padding: 4px 8px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.desk-menu-cards-head svg { width: 15px; height: 15px; color: var(--muted); }
.desk-menu-item { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 8px; border: 0; border-radius: 5px; background: none; color: var(--text); font: inherit; font-size: 12.5px; text-align: start; cursor: pointer; }
.desk-menu-item:hover, .desk-menu-item:focus-visible { background: var(--hover); color: var(--accent); }
.desk-menu-item.page { color: var(--muted); font-weight: 600; }

/* The bar along the foot keeps every folder in reach: centred while they fit, from the start
   when they do not, and only their icons on narrower screens; chat sits above it, beside the
   map rather than over the windows. */
@media (min-width: 821px) {
  .app.simple .tb-dock { justify-content: safe center; }
  .app.simple .chat-dock { top: 0; bottom: 44px; }
  .app.simple.chat-docked .main { margin-inline-end: 340px; }
}
@media (min-width: 821px) and (max-width: 1680px) {
  .app.simple .desk-folder-btn > span { display: none; }
  .app.simple .desk-folder-btn { min-width: 38px; }
  .app.simple .desk-folder-btn svg { width: 19px; height: 19px; }
  .app.simple .rd-ticker { max-width: 110px; }
  .app.simple .tb-meta { display: none; }
}
@media (min-width: 821px) and (max-width: 1180px) {
  .app.simple .tb-coname, .app.simple .tb-tools > a.tb-btn[href="/"], .app.simple .rd-ticker { display: none; }
  .app.simple .desk-folder-btn { min-width: 30px; padding: 2px 3px; }
}

/* The strips above a company's screens (its first flight, the weekly reminder to install) take
   their height from the map, rather than push the game's bar off the foot of the screen. */
.app.simple .main { display: flex; flex-direction: column; height: calc(100dvh - var(--tb-h)); }
.app.simple .main > .desk { flex: 1 1 0; height: auto; min-height: 0; }
@media (min-width: 821px) {
  .app.simple .main { height: calc(100dvh - 44px); }
}
@media (max-width: 820px) {
  .app.simple .main { height: calc(100dvh - var(--tb-h) - 54px); }
}

/* A map's key of its markets stands above the map's own key, not over it, and clear of the map's buttons. */
.pl-map, .found-map { --map-key-bottom: 8px; --map-key-height: 29px; }
.pl-map:has(.map-legend[open]), .found-map:has(.map-legend[open]) { --map-key-height: 96px; }
.pl-map .map-legend[open], .found-map .map-legend[open] { max-height: var(--map-key-height); }
.pl-map .pl-key, .found-map .pl-key, .desk-body.lt520 .pl-map .pl-key, .desk-body.lt520 .found-map .pl-key { bottom: calc(var(--map-key-bottom) + var(--map-key-height) + 4px); max-width: calc(100% - 60px); }
@media (max-width: 520px) { .pl-map, .found-map { --map-key-bottom: 34px; } }
