/* Arlanda Rising — every style of the page: the map, the HUD, the tray, the toolbar, the plan panel, the cards and the
   screens. Dark translucent panels over the map, the hi-vis yellow and the beacon amber of the airport as accents. */

:root {
  --panel: rgba(13, 27, 42, 0.88);
  --panel2: rgba(22, 40, 58, 0.95);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef3f7;
  --dim: #9fb0c3;
  --accent: #ffb000;
  --ok: #5ee07a;
  --bad: #ff6b5e;
  --blue: #1f3f8f;
}
html, body {
  margin: 0; padding: 0; overflow: hidden; width: 100%; height: 100%;
  background: #203445; color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif; font-size: 15px;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
html.cursor-hidden, html.cursor-hidden * { cursor: none !important; }
canvas { display: block; touch-action: none; }
#map { position: fixed; inset: 0; }
button { font-family: inherit; touch-action: manipulation; color: inherit; }
[hidden] { display: none !important; }
small { color: var(--dim); }

/* ---------- the HUD ---------- */
#hud {
  position: fixed; z-index: 10; pointer-events: none;
  top: calc(6px + env(safe-area-inset-top)); left: calc(6px + env(safe-area-inset-left)); right: calc(6px + env(safe-area-inset-right));
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px;
}
.hudRow { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.chip {
  display: flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; box-sizing: border-box;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: #fff;
  font-size: 13px; white-space: nowrap; pointer-events: auto;
}
.chip b { font-weight: 600; font-variant-numeric: tabular-nums; }
button.chip { cursor: pointer; }
.chip.debt b { color: var(--bad); }
/* the mission's result so far beside the money; the stage's time as a line under the date */
.mwrap { display: flex; align-items: baseline; gap: 5px; }
#trend { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--dim); }
#trend.up { color: var(--ok); }
#trend.down { color: #ff9c8c; }
#dateChip { position: relative; }
#dateChip .prog { position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 1px; background: rgba(255,255,255,0.15); overflow: hidden; }
#dateChip .prog i { display: block; height: 100%; width: 0; background: var(--accent); }
.gLeft { color: var(--dim); font-size: 11.5px; margin: -1px 0 3px; }
.gMission { margin-top: 5px; padding-top: 4px; border-top: 1px solid var(--line); }
#meters { pointer-events: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 3px 8px; gap: 8px; }
.meter { display: flex; align-items: center; gap: 3px; font-size: 12px; }
.meter .mi { font-size: 13px; }
.mbar { width: 26px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.15); overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--ok); }
.mbar i.mid { background: #e8c547; }
.mbar i.low { background: var(--bad); }
.meter b { font-weight: 600; min-width: 22px; font-variant-numeric: tabular-nums; }
.speeds { display: flex; padding: 2px; gap: 2px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); pointer-events: auto; }
.speeds button { height: 28px; min-width: 32px; padding: 0 5px; border: 0; border-radius: 14px; background: none; color: var(--dim); font-size: 10px; letter-spacing: -2px; cursor: pointer; }
.speeds button.on { background: var(--accent); color: #1b2733; }
.round {
  width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--panel);
  color: #fff; font-size: 16px; cursor: pointer; pointer-events: auto; display: flex; align-items: center; justify-content: center;
}
.round:disabled { opacity: 0.35; }
/* the roofs off: the 🏠 button lit */
#roofBtn.on { background: var(--accent); border-color: var(--accent); }

/* ---------- the goals ---------- */
#goalsBox {
  position: fixed; z-index: 9; right: calc(6px + env(safe-area-inset-right)); top: calc(var(--hudH, 40px) + 12px + env(safe-area-inset-top));
  width: 250px; max-width: 42vw; padding: 7px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 12px;
}
.gHead { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 3px; }
.gHead span { color: var(--dim); }
ul.goals { list-style: none; margin: 4px 0; padding: 0; }
ul.goals li { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; }
ul.goals li .g { flex: 1; }
ul.goals li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
ul.goals li.ok .mark, ul.goals li.ok b { color: var(--ok); }
ul.goals li.no .mark, ul.goals li.no b { color: #ffb4a8; }
ul.goals.plain li::before { content: '•'; color: var(--accent); }

/* ---------- the task tray ---------- */
#tray {
  position: fixed; z-index: 9; left: calc(6px + env(safe-area-inset-left)); top: calc(var(--hudH, 40px) + 12px + env(safe-area-inset-top));
  width: 230px; max-width: 46vw; display: flex; flex-direction: column; gap: 5px; max-height: calc(100% - 130px); overflow: hidden;
}
.task, .task.ghost {
  display: flex; align-items: center; gap: 7px; padding: 6px 7px; border-radius: 12px; background: var(--panel);
  border: 1px solid rgba(255,176,0,0.55); font-size: 12.5px; line-height: 1.2; cursor: pointer; touch-action: none; position: relative;
}
.task:active { background: var(--panel2); }
.task.late { border-color: var(--bad); animation: blink 0.9s steps(2) infinite; }
@keyframes blink { 50% { border-color: rgba(255,107,94,0.3); } }
.task.ghost { position: fixed; z-index: 50; width: 200px; pointer-events: none; opacity: 0.9; }
.task .ring { width: 28px; height: 28px; flex: 0 0 auto; transform: rotate(-90deg); position: absolute; left: 6px; }
.task .ring circle { fill: none; stroke: rgba(255,255,255,0.15); stroke-width: 3; }
.task .ring circle.left { stroke: var(--accent); stroke-dasharray: 97.4; stroke-linecap: round; }
.task.late .ring circle.left { stroke: var(--bad); }
.task .logo, .task .ticon { width: 20px; height: 20px; flex: 0 0 auto; margin: 0 4px; border-radius: 5px; z-index: 1; text-align: center; font-size: 15px; }
.task .tt { flex: 1; }
.task .pick { border: 1px solid var(--line); background: rgba(255,255,255,0.08); border-radius: 9px; padding: 4px 7px; font-size: 11.5px; cursor: pointer; }
.task .pick.on { background: var(--accent); color: #1b2733; }
.trayEmpty { display: none; font-size: 12px; color: var(--dim); padding: 4px 8px; background: rgba(13,27,42,0.6); border-radius: 10px; align-self: flex-start; }

/* ---------- the toolbar ---------- */
#toolbar {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
  padding: 5px calc(6px + env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) calc(6px + env(safe-area-inset-left));
  display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; justify-content: safe center; align-items: stretch;
  background: linear-gradient(0deg, rgba(13,27,42,0.92), rgba(13,27,42,0.7)); border-top: 1px solid var(--line);
}
#toolbar::-webkit-scrollbar { display: none; }
#toolbar:empty { display: none; }
.tgroup { display: flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 10px; background: rgba(255,255,255,0.05); white-space: nowrap; font-size: 12.5px; }
.tl b { color: var(--accent); }
.tgroup.fullGroup .tl b { color: var(--ok); }
.tb em { font-style: normal; color: var(--accent); font-weight: 600; }
.tb {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 40px; padding: 3px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.07);
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.tb small { font-size: 10.5px; }
.tb.small { min-height: 30px; padding: 2px 9px; flex-direction: row; gap: 4px; }
.tb:disabled { opacity: 0.4; cursor: default; }
.tb.on { background: var(--accent); color: #1b2733; border-color: var(--accent); }
.tb.on small { color: #3a2a00; }
.tb.confirm { background: var(--ok); color: #10301a; }
.tb.busy { border-color: var(--accent); }
.tb[data-poor] small { color: var(--bad); }

/* ---------- the plan panel ---------- */
#planPanel {
  position: fixed; z-index: 9; right: calc(6px + env(safe-area-inset-right)); top: calc(var(--hudH, 40px) + 12px + env(safe-area-inset-top)); bottom: calc(58px + env(safe-area-inset-bottom));
  width: 330px; max-width: 52vw; overflow-y: auto; padding: 8px 10px; box-sizing: border-box;
  border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 13px;
}
.pGoals { font-size: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pHead { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.pHead span { color: var(--dim); font-size: 12px; }
.proj { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }
.proj h3 { margin: 0 0 4px; font-size: 14px; }
.stageRow { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 0; }
.stageRow.isDone { opacity: 0.65; }
.sn { display: flex; flex-direction: column; min-width: 0; }
.sn em { font-style: normal; color: var(--dim); font-weight: 400; font-size: 11px; }
.sr { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.sr .done { color: var(--ok); }
.sr .wait { color: var(--dim); font-size: 11.5px; max-width: 120px; text-align: right; }
.bar { width: 70px; height: 7px; border-radius: 4px; background: rgba(255,255,255,0.15); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.mods, .fin { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.fin span { color: var(--dim); font-size: 12px; margin-right: 2px; }
.mods .modNote { flex-basis: 100%; color: var(--dim); font-size: 11.5px; }
.buyRow { font-size: 12px; color: var(--dim); margin-top: 4px; }

/* ---------- cards over the map ---------- */
.card { position: fixed; z-index: 20; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
#flightCard { left: calc(244px + env(safe-area-inset-left)); bottom: calc(64px + env(safe-area-inset-bottom)); width: 250px; padding: 10px 12px; font-size: 13px; }
#flightCard .x { position: absolute; right: 6px; top: 6px; border: 0; background: none; font-size: 15px; cursor: pointer; color: var(--dim); }
.fcHead { display: flex; gap: 8px; align-items: center; }
.fcHead .logo { width: 34px; height: 34px; border-radius: 8px; }
.fcHead div { display: flex; flex-direction: column; }
#flightCard .state { margin: 6px 0; color: var(--accent); }
#flightCard table { width: 100%; border-collapse: collapse; font-size: 12px; }
#flightCard td { padding: 1px 0; }
#flightCard td:first-child { color: var(--dim); }
/* the turnaround in the flight's card: the bar as over the aircraft (colours from render/traffic.js STEP_COL), then each
   step with its swatch — the legend —, what it does and, small, why it waits */
#flightCard { max-height: calc(100vh - var(--hudH, 60px) - 84px); overflow-y: auto; box-sizing: border-box; }
.tbar { display: flex; gap: 2px; height: 8px; padding: 2px; margin: 8px 0 4px; background: rgba(13,27,42,0.8); border-radius: 4px; }
.tbar span { flex: 1; position: relative; overflow: hidden; border-radius: 1px; background-color: rgba(255,255,255,0.15); }
.tbar i { position: absolute; left: 0; top: 0; bottom: 0; }
.tbar i.pale { opacity: 0.4; }
.tbar .dx { flex: 0 0 8px; margin-left: 2px; }
.tbar .dx i { top: auto; width: 100%; }
#flightCard table.steps td { vertical-align: top; padding: 2px 0; }
#flightCard table.steps td:first-child { white-space: nowrap; padding-right: 8px; }
.steps .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.steps td.held { color: #ffb08f; }
.steps small { display: block; font-size: 11px; }
#flightCard .legend { margin: 4px 0 0; color: var(--dim); font-size: 11px; }
.hintLine { color: var(--ok); margin: 6px 0 0; }
/* the card of a building or a vehicle tapped on the map: where the flight's card opens, a little wider; it scrolls when
   long (a terminal's brands and shops); opaque, as it opens over the plan panel on a phone */
#siteCard { left: calc(244px + env(safe-area-inset-left)); bottom: calc(64px + env(safe-area-inset-bottom)); width: 290px; padding: 10px 12px; font-size: 13px; background: rgb(22, 40, 58);
  max-height: calc(100vh - var(--hudH, 60px) - 84px); overflow-y: auto; box-sizing: border-box; }
#siteCard .x { position: absolute; right: 6px; top: 6px; border: 0; background: none; font-size: 15px; cursor: pointer; color: var(--dim); }
.scHead { display: flex; gap: 8px; align-items: center; padding-right: 18px; }
.scIcon { font-size: 26px; line-height: 1; }
.scHead div { display: flex; flex-direction: column; }
.scHead small { color: var(--accent); }
#siteCard .about { margin: 6px 0; color: var(--dim); font-size: 12px; line-height: 1.35; }
#siteCard h4 { margin: 8px 0 2px; font-size: 12px; color: var(--accent); font-weight: 600; }
#siteCard table { width: 100%; border-collapse: collapse; font-size: 12px; }
#siteCard td { padding: 1px 0; vertical-align: top; overflow-wrap: anywhere; }
#siteCard td:first-child { color: var(--dim); padding-right: 8px; width: 45%; }
/* a terminal's own shops in its cells: the shop, the cells it takes, its Sell button */
#siteCard table.cells td { vertical-align: middle; padding: 2px 0; }
#siteCard table.cells td:first-child { color: inherit; width: auto; }
#siteCard table.cells td:nth-child(2) { color: var(--dim); white-space: nowrap; padding-right: 6px; }
#siteCard table.cells td:last-child { text-align: right; white-space: nowrap; }
#siteCard table.cells tr.free td:first-child { color: var(--ok); }
#siteCard table.cells td.fine:last-child { color: var(--dim); font-size: 11px; text-align: left; white-space: normal; }
#siteCard .tb.sell { display: inline-flex; min-height: 26px; padding: 2px 8px; font-size: 11.5px; }
#decision { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 420px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow-y: auto; padding: 14px 16px; box-sizing: border-box; z-index: 30; }
#decision h2 { margin: 2px 0 6px; font-size: 19px; }
#decision p { margin: 0 0 10px; line-height: 1.4; }
.decIcon { font-size: 30px; }
.opts { display: flex; flex-direction: column; gap: 6px; }
.opt { text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.07); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.opt:hover, .opt:focus { border-color: var(--accent); }
.opt small { color: #c8d4df; }

/* ---------- Kaj, the finger, the banner ---------- */
#hint {
  position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: calc(66px + env(safe-area-inset-bottom));
  max-width: min(520px, 86vw); display: flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 16px;
  background: #f4f1e8; color: #1b2733; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.35); pointer-events: none;
}
#hint .kaj { font-size: 22px; }
#finger { position: fixed; z-index: 40; font-size: 34px; pointer-events: none; animation: tapme 1s ease-in-out infinite; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5)); }
@keyframes tapme { 50% { transform: translate(4px, 8px) scale(0.9); } }
#banner {
  position: fixed; z-index: 45; left: 50%; top: calc(50px + env(safe-area-inset-top)); transform: translateX(-50%);
  max-width: 90vw; padding: 7px 16px; border-radius: 18px; background: rgba(13,27,42,0.94); border: 1px solid var(--accent);
  font-size: 14px; text-align: center; opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
#banner.on { opacity: 1; }

/* ---------- the screens ---------- */
#overlay {
  position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(13,27,42,0.35), rgba(13,27,42,0.7));
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.panel {
  width: 470px; max-width: calc(100vw - 20px); max-height: calc(100vh - 20px); overflow-y: auto; box-sizing: border-box;
  padding: 16px 20px; border-radius: 18px; background: rgba(13,27,42,0.93); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.panel.wide { width: 860px; }
.panel h1 { margin: 2px 0 6px; font-size: 24px; }
.panel p { line-height: 1.4; }
.title { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 8px; }
.title h1 { font-size: 30px; letter-spacing: 0.5px; }
.logoIcon { width: 52px; height: 52px; }
.tagline { text-align: center; color: #c8d4df; margin: 4px 0 12px; }
.saveInfo { text-align: center; color: var(--dim); font-size: 13px; margin: 2px 0 10px; }
.label { color: var(--accent); font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
.fine { color: var(--dim); font-size: 12.5px; }
.fine.warn { color: #ffb4a8; }
.about { text-align: center; margin-top: 12px; font-size: 11.5px; }
.btnRow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 8px 0; }
.btnRow.small { font-size: 13px; color: var(--dim); }
.btnCol { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.btn {
  min-height: 40px; padding: 0 18px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255,255,255,0.08);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn.default { background: var(--accent); color: #1b2733; border-color: var(--accent); }
.btn.big { min-height: 46px; padding: 0 26px; font-size: 16px; }
.btn.secondary { background: rgba(255,255,255,0.06); }
.btn.toggle { min-height: 32px; padding: 0 12px; font-size: 13px; font-weight: 500; }
.btn.toggle.on { background: #2f6fb3; border-color: #2f6fb3; color: #fff; }
.btn:disabled { opacity: 0.4; }
.btn:focus-visible, .tb:focus-visible, .opt:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.diffBox { text-align: center; }
.diffText { min-height: 18px; margin: 2px 0; }
.setRow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.setRow > span { width: 90px; color: var(--dim); }

/* the language picker (docs/languages.md) */
.langPick { display: inline-flex; gap: 4px; padding: 4px; border-radius: 22px; background: rgba(13,27,42,0.85); border: 1px solid rgba(255,255,255,0.12); }
.langPick button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 16px; background: none; color: #9fb0c3; font-size: 12px; font-weight: 600; cursor: pointer; }
.langPick button img { width: 21px; height: 14px; border-radius: 2px; opacity: 0.6; }
.langPick button[aria-pressed="true"] { background: rgba(255,255,255,0.12); color: #fff; }
.langPick button[aria-pressed="true"] img { opacity: 1; }

/* stars */
.star { color: rgba(255,255,255,0.22); }
.star.on { color: #ffd54f; }
.bigStars { font-size: 44px; text-align: center; letter-spacing: 6px; }
.record { text-align: center; color: #ffd54f; font-weight: 700; }

/* the timeline */
.eras { display: flex; flex-direction: column; gap: 10px; }
.era h2 { margin: 6px 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.era h2 span { display: inline-flex; width: 24px; height: 24px; border-radius: 12px; background: #2f6fb3; align-items: center; justify-content: center; font-size: 13px; }
.era h2 small { font-weight: 400; }
.era.locked { opacity: 0.45; }
.stops { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.panel, .stops, #planPanel { scrollbar-color: rgba(255,255,255,0.28) transparent; }
.stop {
  flex: 0 0 120px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px; border-radius: 12px; text-align: left;
  border: 1px solid var(--line); background: rgba(255,255,255,0.06); cursor: pointer; font-size: 12.5px; min-height: 96px;
}
.stop .num { color: var(--dim); font-size: 11px; }
.stop b { line-height: 1.15; }
.stop.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.stop.lockedStop { opacity: 0.5; cursor: default; }

/* the mission card */
.chap { color: var(--dim); font-size: 12.5px; margin: 0; }
.when { color: #c8d4df; margin: 0 0 8px; font-size: 13px; }
.astrid { display: flex; gap: 10px; align-items: flex-start; }
.astrid .face { font-size: 34px; }
.bubbles { display: flex; flex-direction: column; gap: 6px; }
.bubble { margin: 0; padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: #f4f1e8; color: #1b2733; font-size: 14px; }
.goalLine { margin: 10px 0 4px; font-weight: 600; }
.starGoals { list-style: none; padding: 0; margin: 4px 0; font-size: 13.5px; }
.starGoals li { margin: 3px 0; }
.best { font-size: 13px; color: var(--dim); margin: 4px 0; }
.stagesList { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.stg { padding: 4px 9px; border-radius: 10px; background: rgba(255,255,255,0.07); font-size: 12.5px; }
/* the mission's info from the pause menu: the stage being played, those done */
.stg.on { background: #2f6fb3; color: #fff; }
.stg.on small { color: #dce8f5; }
.stg.done { opacity: 0.6; }
.label small { color: var(--dim); font-weight: 400; }
ul.goals.starGoals li .mark { white-space: nowrap; }
.news p { margin: 3px 0; font-size: 13.5px; }
.meanwhile { padding: 8px 12px; border-radius: 12px; background: rgba(47,111,179,0.25); border: 1px solid rgba(47,111,179,0.6); margin: 6px 0; }
.meanwhile p { margin: 4px 0 0; font-size: 13.5px; }

/* the stage card and the results */
.verdict.ok { color: var(--ok); font-weight: 600; }
.verdict.no { color: #ffb4a8; font-weight: 600; }
.work { font-size: 13px; color: #c8d4df; margin: 4px 0; }
.meterRow { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 14px; margin: 8px 0; }
.quote { font-style: italic; color: #e8dcc0; text-align: center; }
.paper { background: #f3eedf; color: #1d1d1d; padding: 10px 14px; border-radius: 4px; margin-bottom: 10px; font-family: Georgia, 'Times New Roman', serif; transform: rotate(-1deg); }
.paper .mast { font-weight: 900; font-size: 22px; letter-spacing: 2px; border-bottom: 3px double #1d1d1d; display: flex; justify-content: space-between; align-items: baseline; }
.paper .mast small { font-size: 11px; color: #444; letter-spacing: 0; }
.paper h2 { font-size: 20px; margin: 8px 0 4px; }
.paper p { font-size: 13.5px; margin: 0; }

/* the Office */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ocard { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); font-size: 13.5px; }
.ocard h3 { margin: 0 0 6px; font-size: 15px; }
.ocard .big { font-size: 22px; font-weight: 700; margin: 2px 0; }
.neg { color: var(--bad); }
.pos { color: var(--ok); }
table.books { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.books th { color: var(--dim); font-weight: 500; text-align: right; }
table.books td { text-align: right; padding: 2px 0 2px 6px; white-space: nowrap; }
table.books td:first-child { text-align: left; padding-left: 0; white-space: normal; }
/* a card in the grid may shrink below its longest word's line (a Russian line of the books), never stick out */
.ocard { min-width: 0; }
/* the tables of the screens break a long word with a hyphen rather than grow past a phone's width (<html lang> set) */
table.ops td, table.ops th, table.books td { hyphens: auto; overflow-wrap: break-word; }
ul.has { margin: 0; padding-left: 18px; }

/* phones */
@media (max-height: 500px) {
  .panel { padding: 10px 14px; }
  .panel h1 { font-size: 20px; }
  .title h1 { font-size: 24px; }
  .logoIcon { width: 40px; height: 40px; }
  #tray { width: 200px; }
  .task { font-size: 11.5px; padding: 4px 6px; }
  #goalsBox { width: 220px; }
  #flightCard, #siteCard { left: calc(212px + env(safe-area-inset-left)); }
  #siteCard { bottom: calc(56px + env(safe-area-inset-bottom)); max-height: calc(100vh - var(--hudH, 60px) - 70px); }
}
@media (max-width: 600px) {
  #tray { width: 168px; }
  #goalsBox { width: 46vw; }
  #planPanel { top: auto; bottom: calc(56px + env(safe-area-inset-bottom)); left: 6px; right: 6px; width: auto; max-width: none; max-height: 46vh; }
  #flightCard, #siteCard { left: 6px; right: 6px; width: auto; bottom: calc(60px + env(safe-area-inset-bottom)); }
  #siteCard { max-height: 52vh; }
  .meter .mbar { width: 18px; }
}
/* a phone held upright: the money's chip keeps one width while the sum changes */
@media (max-width: 600px) and (orientation: portrait) {
  #money { display: inline-block; min-width: 4.6em; text-align: right; }
  .mwrap { flex-direction: column; align-items: flex-end; gap: 0; line-height: 1.05; }
  #trend { font-size: 10px; }
}

/* session 3: the People screen, the Ops Center, the teams in the bar, managers in a decision */
.kv { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.mbar.small { width: 70px; display: inline-block; vertical-align: middle; }
.mgrBox { margin: 6px 0; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,0.05); line-height: 1.35; }
.warn { color: #f0c36a; }
.ocard h3 small { font-weight: 400; opacity: 0.7; font-size: 12px; }
.wideCard { margin-top: 10px; }
table.ops { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ops th { text-align: left; font-weight: 600; opacity: 0.7; padding: 4px 6px; }
table.ops td { padding: 6px; border-top: 1px solid var(--line); vertical-align: top; }
table.ops td small { display: block; opacity: 0.7; font-size: 11.5px; }
table.ops .acts { display: flex; flex-wrap: wrap; gap: 4px; }
table.ops .acts.under { display: none; }
table.ops .btn small, .ocard .btn small { opacity: 0.75; font-size: 11px; }
.tgroup.warnGroup .tl { color: #f0c36a; }
.opt .mgr { font-size: 12px; opacity: 0.85; line-height: 1.35; }
/* a narrow screen: the Ops Center drops its uptime and readiness; the investments keep every column, packed tighter */
@media (max-width: 640px) {
  #opsCenter table.ops th:nth-child(3), #opsCenter table.ops td:nth-child(3), #opsCenter table.ops th:nth-child(5), #opsCenter table.ops td:nth-child(5) { display: none; }
  #opsCenter table.ops { font-size: 12px; }
  #opsCenter table.ops td, #opsCenter table.ops th { padding: 5px 4px; }
  #opsCenter table.ops td:nth-child(-n+2) { overflow-wrap: anywhere; min-width: 7em; }
  #opsCenter table.ops th:nth-child(4), #opsCenter table.ops td:nth-child(4) { white-space: nowrap; }
  /* the buttons under the area's name, not in a column of their own */
  #opsCenter .actCol { display: none; }
  #opsCenter .acts.under { display: flex; margin-top: 5px; }
  table.inv { font-size: 12px; }
  table.inv th, table.inv td { padding: 5px 2px; }
  table.inv td:first-child { padding-left: 0; }
  table.inv td small { font-size: 10.5px; }
  /* a long word may break, an ordinary one keeps its column's least width; the sums never break */
  table.inv td:first-child { overflow-wrap: anywhere; min-width: 7.2em; }
  table.inv td:nth-child(4) { overflow-wrap: anywhere; min-width: 5.6em; }
  table.inv th:nth-child(-n+3), table.inv td:nth-child(2), table.inv td:nth-child(3), table.inv td:nth-child(5) { white-space: nowrap; }
  table.inv td small { white-space: normal; }
}
/* the net present value's column: its name, or "NPV" where it would make the table wider than the screen */
table.inv th .short { display: none; }
@media (max-width: 640px) { table.inv th .long { display: none; } table.inv th .short { display: inline; } }

/* the start screen's account row: the cloud copy of the save (core/cloud.js) */
.account { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; margin: 12px auto 0; max-width: 420px; }
.account .fine { flex-basis: 100%; margin: 0; }
.btn.cloudIn { display: inline-flex; align-items: center; gap: 8px; }
.gLogo { width: 16px; height: 16px; flex: none; }
.cloudState { display: inline-flex; align-items: center; gap: 7px; color: #c3d1de; font-size: 13px; }
.cloudState::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #6f8193; flex: none; }
.cloudState.synced::before { background: #7de08a; }
.cloudState.syncing::before { background: #6fb1e8; }
.cloudState.error::before, .cloudState.signedOut::before, .cloudState.loadFailed::before { background: #f0c36a; }
.cloudState.local::before { background: #6f8193; }
.cloudState.local { flex: 1 1 200px; text-align: left; }
.account .cloudChoice { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; }
.account .cloudNotice { color: #f0c36a; }
.account .btn.small { padding: 6px 12px; font-size: 13px; }

/* ---------- session 4: the Terminal view, Finance, Airlines, the Challenge Days ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
#termCanvas, #cashChart { width: 100%; border-radius: 10px; touch-action: manipulation; }
#termCanvas { cursor: pointer; }
#termInfo { margin: 6px 0; }
.brandList { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-top: 6px; }
.brandOpt { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 6px 8px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.06); cursor: pointer; }
.brandOpt:hover, .brandOpt:focus { border-color: var(--accent); }
.brandOpt:disabled { cursor: default; opacity: 0.75; }
.brandOpt small { color: #c8d4df; font-size: 11.5px; }
img.brandImg { width: 128px; height: 32px; vertical-align: middle; }
.ocard h3 img.brandImg { width: 96px; height: 24px; }
img.emb { width: 26px; height: 26px; border-radius: 6px; vertical-align: middle; }
table.inv td small { display: block; }
table.books tr.sum td { border-top: 1px solid var(--line); font-weight: 700; padding-top: 4px; }
.btn.details { margin: 6px 0; }
.score { text-align: center; font-size: 26px; font-weight: 700; margin: 0 0 6px; color: var(--accent); }
table.parts { max-width: 420px; margin: 6px auto; }
.cvWrap { width: 100%; }

/* the analytics tabs of Finance (ui/analytics.js): on a narrow screen the tabs show their icon only, the open one its name */
#statsChart { width: 100%; border-radius: 10px; }
.tabs.stats .btn { padding: 0 10px; }
@media (max-width: 600px) { .tabs.stats .tn { display: none; } .tabs.stats .on .tn { display: inline; } }
table.fac td:nth-child(2) { color: var(--dim); }
table.fac td:last-child { min-width: 2.6em; font-weight: 600; }
table.brk td.nw { white-space: nowrap; }
table.brk td small.dir { display: inline; }
table.brk td:nth-child(n+2), table.brk th:nth-child(n+2) { text-align: right; }
/* a phone held upright: the departments' table drops the union's mood and packs tighter, the names keep whole words */
@media (max-width: 600px) {
  #finance table.brk.depts th:nth-child(5), #finance table.brk.depts td:nth-child(5) { display: none; }
  #finance table.brk td, #finance table.brk th { padding: 5px 3px; }
}
.meter, #greenChip { cursor: pointer; }
