body { margin: 0; font-family: system-ui, sans-serif; color: #222; background: #fff; }
header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #ccc; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { width: 12px; height: 12px; border-radius: 50%; background: #c8102e; }
body.game .brand-mark { background: var(--accent); }
.brand-area { color: #5f5f5a; font-size: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
form.stacked label { display: block; margin-top: 12px; }
form.stacked input { display: block; padding: 6px; width: 100%; max-width: 320px; box-sizing: border-box; }
form.stacked button { margin-top: 12px; }
button { padding: 6px 12px; }
table { border-collapse: collapse; width: 100%; margin: 12px 0; }
th, td { border-bottom: 1px solid #ddd; padding: 6px; text-align: left; }
td.number { text-align: right; }
.message { padding: 8px 12px; }
.success { background: #e6f4e6; }
.error { background: #fbe6e6; }
.field-validation-error, .validation-summary-errors { color: #a00000; }
.validation-summary-valid { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.section { border-top: 1px solid #ccc; margin-top: 16px; padding-top: 4px; }
form.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
form.inline input { padding: 6px; }
form.stacked label.check { display: flex; align-items: center; gap: 8px; }
form.stacked label.check input { width: auto; }
.message-item { border-top: 1px solid #ccc; padding-top: 4px; }
.message-body { white-space: pre-wrap; }
/* nextOne3's standard messages are HTML: their own paragraphs and lists, without the kept line breaks. */
.message-body.message-html { white-space: normal; }
.message-html > :first-child { margin-top: 0; }
.message-html > :last-child { margin-bottom: 0; }
.message-html h3 { font-size: 16px; margin: 16px 0 6px; }
textarea { display: block; width: 100%; box-sizing: border-box; padding: 6px; }
.itemTable { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid #eee; }
.itemLabel { flex: 1 1 200px; }
.valueResultContainer { display: flex; gap: 12px; }
.itemResultValue { min-width: 100px; text-align: right; }
.itemTrend { min-width: 56px; text-align: right; color: #555; }
.itemValue input, .itemValue select { padding: 4px; text-align: right; }
.infoButton { cursor: help; border: 1px solid #888; border-radius: 50%; padding: 0 6px; font-size: 12px; }
.feedback { background: #fff6e0; }
.missingNode { color: #a00000; }
.page-nav { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }

/* Charts, drawn by Chart.js from these colours. They passed the palette check for colour blindness. Two are below 3:1 on white, so every chart also has its figures in a table. */
:root {
    --series-0: #2a78d6;
    --series-1: #eb6834;
    --series-2: #1baf7a;
    --series-3: #eda100;
    --series-4: #e87ba4;
    --series-5: #008300;
    --series-6: #6250d6;
    --chart-surface: #fff;
    --chart-grid: #eee;
    --chart-baseline: #888;
    --chart-text: #555;
}
.chart { margin: 16px 0; }
.chart figcaption { font-weight: 600; margin-bottom: 4px; }
.chart-canvas { position: relative; height: 260px; }
.chart-figures { font-size: 14px; }
.benchmarkRow .itemResultBMValue { flex: 0 0 90px; text-align: right; }
.benchmarkHeader .itemResultBMValue { font-weight: 600; }
.feedback { color: #8a4b00; }

/* The office: results beside decisions, as in nextOne3, so teams can read one while filling in the other. */
main.wide { max-width: 1600px; }
.office { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 16px; }
.office-panel { min-width: 0; }
.panel-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; border-bottom: 2px solid #ccc; padding-bottom: 8px; }
.panel-title h2 { margin: 0; }
.panel-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-picker select { padding: 6px; }
.has-script .panel-show { display: none; }
#save-decisions { margin-left: auto; font-weight: 600; }
#save-conflict { background: #fff4e0; padding: 8px 12px; margin: 12px 0; }
#save-conflict h3 { margin: 4px 0; }
/* Each panel scrolls on its own, so results stay in view while filling in decisions. */
@media (min-width: 1101px) {
    .office { height: calc(100vh - 150px); min-height: 480px; }
    .office-panel { display: flex; flex-direction: column; min-height: 0; }
    .panel-body { flex: 1; min-height: 0; overflow-y: auto; padding-right: 8px; }
}
@media (max-width: 1100px) { .office { grid-template-columns: minmax(0, 1fr); } }

/* The menu of the game. */
.game-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 8px 16px; border-bottom: 1px solid #ccc; }
.game-nav a[aria-current] { font-weight: 600; }
.game-nav-links { display: flex; flex-wrap: wrap; gap: 2px; }
.game-nav-status { margin-left: auto; font-size: 14px; color: #555; }

/* Home. The offices sit at nextOne3's places on the map; Mission control styles them (see the end of this file). */
.globe-point.Amsterdam { left: 47.6%; top: 19%; }
.globe-point.Seattle { left: 23.8%; top: 16%; }
.globe-point.SanFrancisco { left: 15.9%; top: 30%; }
.globe-point.Taipei { left: 73.8%; top: 44%; }
.globe-point.HongKong { left: 61.1%; top: 54%; }
.globe-point.SaoPaulo { left: 34.1%; top: 86%; }
.office-photo { max-width: 100%; height: auto; display: block; }
.ranking-choices { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-bottom: 16px; }
.ranking-choices a[aria-current] { font-weight: 600; }
.hint { border-top: 1px solid #ccc; padding: 8px 0; }
.hint summary { cursor: pointer; font-weight: 600; }
.team-analysis { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 24px; align-items: start; }
.team-analysis tr.selected { font-weight: 600; }
#team-issues h2 { margin-top: 0; }
#team-issues tr.issue { background: #fff6e0; }
#team-issues tr.issue th { color: #8a4b00; }
#team-issues .issue-heading th { padding-top: 16px; }
@media (max-width: 800px) { .team-analysis { grid-template-columns: minmax(0, 1fr); } }
.table-scroll { max-width: 100%; overflow-x: auto; }
#raw-data th.number { text-align: right; }
#raw-data td.number { white-space: nowrap; }
#raw-data .raw-heading th { padding-top: 16px; text-align: left; }
#raw-data .raw-gap td { height: 12px; }

/* Staff pages: a menu per session beside the page, and each section as a card with its next step (the "control room"). */
body.staff { --accent: #c8102e; --accent-dark: #a30d22; --ink: #1c1c1c; --muted: #5f5f5a; --line: #e2e2de; --soft: #f4f4f2; background: var(--soft); color: var(--ink); }
body.staff header { background: #fff; border-bottom-color: var(--line); min-height: 40px; }
body.staff a { color: var(--accent-dark); }
body.staff button { font: inherit; padding: 8px 14px; min-height: 40px; border: 1px solid #cfcfca; border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
body.staff button:hover { border-color: #9a9a95; }
body.staff button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
body.staff button.primary:hover { background: var(--accent-dark); }
body.staff button.danger { color: #8f0a1d; border-color: #e3b4bb; }
body.staff button.link { border: none; background: none; padding: 0; min-height: 0; color: var(--accent-dark); text-decoration: underline; }
body.staff input, body.staff select, body.staff textarea { font: inherit; border: 1px solid #cfcfca; border-radius: 6px; }
body.staff table { background: #fff; }
body.staff th, body.staff td { border-bottom-color: #efefec; padding: 8px 10px; }
body.staff th { font-size: 14px; color: var(--muted); font-weight: 600; }
.admin-shell { display: flex; flex-wrap: wrap; gap: 24px; max-width: 1440px; margin: 0 auto; padding: 24px; box-sizing: border-box; }
.admin-main { flex: 999 1 560px; min-width: 0; max-width: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.admin-main > h1, .admin-main > h2, .admin-main > p, .admin-main > form, .admin-main > table, .admin-main > div { margin-top: 0; margin-bottom: 0; }
.admin-nav { flex: 1 1 200px; max-width: 240px; display: flex; flex-direction: column; gap: 20px; }
body.staff .admin-nav a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.admin-nav a:hover { background: #ebebe8; }
.admin-nav a[aria-current] { background: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
body.staff .admin-nav .admin-nav-back { color: var(--muted); padding-left: 0; }
.admin-nav-group { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-title { padding: 0 12px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.admin-nav-groups { display: flex; flex-direction: column; gap: 20px; }
.admin-nav-toggle { display: none; }
/* On a phone the session menu folds away behind a Menu button; open, its groups sit side by side. Without a script it stays open. */
@media (max-width: 760px) {
    .admin-shell { padding: 16px; gap: 16px; }
    .admin-nav { max-width: none; flex-basis: 100%; gap: 10px; }
    .admin-nav-session { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 0; }
    body.staff .admin-nav .admin-nav-back { padding: 0; }
    .has-script .admin-nav-toggle { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; }
    body.staff .admin-nav-toggle { padding: 8px 14px; min-height: 40px; border: 1px solid #cfcfca; border-radius: 8px; background: #fff; color: var(--ink); font-weight: 600; }
    .admin-nav-current { font-weight: 400; color: var(--muted); }
    .has-script .admin-nav:not(.is-open) .admin-nav-groups { display: none; }
    .admin-nav-groups { flex-direction: row; flex-wrap: wrap; gap: 12px 24px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
    .admin-nav-group { flex: 1 1 140px; }
    .admin-nav-title { padding-left: 12px; }
}
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0; font-size: 30px; letter-spacing: -0.02em; }
.page-head .actions { margin: 0; }
.page-kicker { margin: 0 0 4px; color: var(--muted); }
.page-kicker strong { color: var(--ink); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card h2 { margin: 0; font-size: 21px; }
.card p { margin: 0; }
.card table { margin: 0; }
.card-quiet { background: transparent; border-style: dashed; }
body.staff .section { border-top: 1px solid var(--line); margin-top: 0; padding-top: 24px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-head .actions { margin: 0; }
.section-title { display: flex; flex-direction: column; gap: 6px; }
.section-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.section-progress-text { color: #4a4a46; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge-open { background: #e3f1e6; color: #1d5a2c; }
.badge-closed { background: #efefec; color: #3d3d39; }
.quarter-bar { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.quarter-bar li { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.quarter-bar li.done { background: var(--ink); }
.quarter-bar li.current { background: var(--accent); }
.teams td:last-child { text-align: right; }
.teams { min-width: 600px; }
.teams td:last-child { white-space: nowrap; }
.actions-end { justify-content: flex-end; align-items: center; margin: 0; gap: 12px; }
/* The other staff pages: a heading with the page's actions, and the content in cards. */
.admin-main.admin-narrow { max-width: 960px; margin: 0 auto; }
.admin-nav-session { margin: 0; padding: 0 12px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.admin-nav-session strong { color: var(--ink); font-size: 16px; }
.admin-nav-session span { color: var(--ink); font-size: 15px; font-weight: 400; }
.page-lead { margin: 6px 0 0; color: #4a4a46; max-width: 70ch; }
.page-kicker a { text-decoration: none; }
body.staff a.button { display: inline-flex; align-items: center; padding: 8px 14px; min-height: 40px; box-sizing: border-box; border: 1px solid #cfcfca; border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; }
body.staff a.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
body.staff a.button.primary:hover { background: var(--accent-dark); }
.empty { color: var(--muted); }
.card-notice { background: #fff6e0; border-color: #f0d9a8; }
.card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
body.staff th.number { text-align: right; }
.cell-end { text-align: right; }
.quarter-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-right: 8px; }
body.staff form.stacked input:not([type=checkbox]), body.staff form.stacked select { display: block; width: 100%; box-sizing: border-box; max-width: 420px; padding: 8px; }
body.staff form.stacked button { margin-top: 16px; }
body.staff fieldset.card { display: block; margin: 0; min-width: 0; }
body.staff fieldset.card legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-size: 18px; font-weight: 600; }
body.staff fieldset.card legend + * { clear: both; }
form.settings, form.stacked:has(> fieldset) { display: flex; flex-direction: column; gap: 20px; }
form.stacked:has(> fieldset) label:first-of-type { margin-top: 0; }
.form-actions { display: flex; gap: 8px; }
.form-actions button { margin-top: 0 !important; }
.participants td { vertical-align: middle; }
body.staff .team-analysis { gap: 20px; }
body.staff form.stacked label:not(.check) > input, body.staff form.stacked label:not(.check) > select { display: block; width: 100%; margin-top: 4px; }
body.staff tbody th { color: var(--ink); font-size: inherit; font-weight: 500; }
body.staff tbody th[scope=rowgroup] { font-weight: 600; font-size: 13px; letter-spacing: 0.04em; color: var(--muted); }

/* Game pages, in the look of the staff pages. Trends show direction only: blue up, orange down, told apart by more than hue. */
.trend-up { color: #1f5fa8; }
.trend-down { color: #b8520a; }
/* nextOne3's orange; the darker one is for links and hover, where text needs more contrast. */
body.game { --accent: #ff5722; --accent-dark: #c4410f; --ink: #1c1c1c; --muted: #5f5f5a; --line: #e2e2de; --soft: #f4f4f2; background: var(--soft); color: var(--ink); }
body.game header { background: #fff; border-bottom-color: var(--line); }
body.game a { color: var(--accent-dark); }
body.game button { font: inherit; padding: 8px 14px; min-height: 40px; border: 1px solid #cfcfca; border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
body.game select, body.game input { font: inherit; }
body.game .game-nav { background: #fff; border-bottom: 1px solid var(--line); gap: 8px 16px; padding: 10px 16px; }
body.game .game-nav-links { padding: 3px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }
body.game .game-nav-links > a { padding: 6px 14px; border-radius: 7px; color: #4a4a46; text-decoration: none; }
body.game .game-nav-links > a:hover { color: var(--ink); background: rgba(0, 0, 0, 0.04); }
body.game .game-nav-links > a[aria-current] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
body.game .game-nav-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: #4a4a46; }
.quarter-badge { padding: 4px 10px; border-radius: 999px; background: #e3f1e6; color: #1d5a2c; font-weight: 600; }
body.game main.wide { padding: 20px 24px; box-sizing: border-box; }
/*
 * The ticker (ADR-060): one line that runs from right to left. Two copies of the list follow each other, so moving the
 * track by half its width brings the second copy exactly where the first began. It stops under the pointer and with its
 * pause button; with reduced motion it stands still and scrolls by hand.
 * It is a strip under the menu on every page, lined up with the page like the menu. Only the track moves, on a layer of
 * its own; the faded edges are fixed overlays rather than a mask, so a browser without a graphics card does not redraw
 * the strip for every frame.
 */
.game-ticker { background: #fafaf8; border-bottom: 1px solid var(--line); }
body.game .game-ticker {
    padding-left: max(var(--game-gutter), calc((100% - var(--game-width)) / 2 + var(--game-gutter)));
    padding-right: max(var(--game-gutter), calc((100% - var(--game-width)) / 2 + var(--game-gutter)));
}
.ticker { display: flex; align-items: center; gap: 8px; }
.ticker-window { position: relative; flex: 1; min-width: 0; overflow: hidden; padding: 9px 0; }
.ticker-window::before, .ticker-window::after { content: ""; position: absolute; z-index: 1; top: 0; bottom: 0; width: 24px; pointer-events: none; }
.ticker-window::before { left: 0; background: linear-gradient(to right, #fafaf8, rgba(250, 250, 248, 0)); }
.ticker-window::after { right: 0; background: linear-gradient(to left, #fafaf8, rgba(250, 250, 248, 0)); }
.ticker-track { display: flex; width: max-content; will-change: transform; animation: ticker-run var(--ticker-duration, 40s) linear infinite; }
.ticker-window:hover .ticker-track, .ticker.is-paused .ticker-track { animation-play-state: paused; }
@keyframes ticker-run { to { transform: translateX(-50%); } }
.ticker-list { display: flex; gap: 40px; margin: 0; padding-right: 40px; white-space: nowrap; }
.ticker-item { display: flex; align-items: baseline; gap: 8px; }
.ticker dt { font-size: 13px; color: var(--muted); }
.ticker dd { margin: 0; display: flex; align-items: baseline; gap: 5px; }
.ticker dd strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.ticker-unit { font-size: 12px; color: var(--muted); }
.ticker-trend { margin-left: 3px; font-size: 13px; font-weight: 600; }
body.game button.ticker-pause { display: none; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 8px; border-color: var(--line); color: var(--muted); }
body.game button.ticker-pause:hover { color: var(--ink); }
.ticker.can-pause button.ticker-pause { display: inline-flex; }
.ticker-icon-play, .ticker.is-paused .ticker-icon-pause { display: none; }
.ticker.is-paused .ticker-icon-play { display: inline; }
@media (prefers-reduced-motion: reduce) {
    .ticker-track { animation: none; }
    .ticker-window { overflow-x: auto; }
    .ticker-window::before, .ticker-window::after { display: none; }
    .ticker-list[aria-hidden] { display: none; }
    .ticker.can-pause button.ticker-pause { display: none; }
}
body.game .office { gap: 20px; }
body.game .office-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
body.game .panel-title { border-bottom: 1px solid var(--line); padding: 14px 20px; justify-content: space-between; }
body.game .panel-title h2 { font-size: 20px; }
body.game .panel-picker select { min-height: 36px; padding: 6px 8px; border: 1px solid #cfcfca; border-radius: 6px; background: #fff; font-weight: 600; }
body.game .panel-picker select.panel-screens { max-width: 100%; min-width: 200px; }
body.game .panel-picker { min-width: 0; max-width: 100%; }
body.game .panel-body { padding: 8px 20px 20px; }
.save-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fafaf8; font-size: 14px; color: #4a4a46; }
.save-bar.has-changes { background: #fff6e0; border-top-color: #f0d9a8; color: #6b3a00; font-weight: 600; }
body.game #save-decisions { margin-left: 0; background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; min-height: 44px; padding: 10px 20px; }
body.game #save-decisions:hover { background: var(--accent-dark); }
@media (min-width: 1101px) {
    body.game .office { height: calc(100vh - 270px); min-height: 480px; }
    body.game .panel-body { padding-right: 16px; }
}
/* The other game pages: a heading and the content in cards, as on the staff pages. */
body.game main { display: flex; flex-direction: column; gap: 20px; }
body.game main.game-page { max-width: 960px; padding: 20px 24px; box-sizing: border-box; }
body.game main.wide.game-page { max-width: 1280px; }
body.game main > .office { margin-top: 0; }
body.game .page-head h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
body.game button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
body.game button.primary:hover { background: var(--accent-dark); }
body.game a.button { display: inline-flex; align-items: center; padding: 8px 14px; min-height: 40px; box-sizing: border-box; border: 1px solid #cfcfca; border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; }
body.game a.button:hover { border-color: #9a9a95; }
.ranking-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.ranking-choice { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: #4a4a46; }
body.game .ranking-choice a { padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--ink); }
body.game .ranking-choice a[aria-current] { background: var(--ink); color: #fff; font-weight: 600; }
.document-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
body.game .hint { border-top-color: var(--line); padding: 10px 0; }
body.game .hint summary { min-height: 28px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; }
.hint-text { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
body.game form.stacked input { max-width: 420px; padding: 8px; border: 1px solid #cfcfca; border-radius: 6px; }
body.game form.stacked button { margin-top: 16px; }
body.game .globe-point { color: #333; }
body.game .globe-point:hover, body.game .globe-point[aria-current] { color: var(--accent-dark); font-weight: 600; }

/* Login and password pages: one card in the middle, in the staff look, for staff and participants alike. */
main.account-main { max-width: 440px; padding: 56px 16px; }
.account-card h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.account-card .page-lead { margin-top: 6px; }
body.staff .account-card form.stacked input:not([type=checkbox]) { max-width: none; }
body.staff .account-card form.stacked button { width: 100%; margin-top: 24px; }
.account-card .message { border-radius: 8px; }

body.staff .account-card form.stacked input.input-short { max-width: 160px; }
.label-note { font-weight: normal; color: var(--muted); font-size: 14px; }

/* The list of sessions: a row per session, the whole row a link, and the new session form folded away. */
.table-scroll { overflow-x: auto; }
.session-list { min-width: 640px; }
.session-list tbody tr { position: relative; }
.session-list tbody tr:hover { background: #fafaf8; }
.session-list .row-link { font-weight: 600; text-decoration: none; }
.session-list .row-link::after { content: ""; position: absolute; inset: 0; }
.session-list .row-link:focus-visible { outline: none; }
.session-list tbody tr:has(.row-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.session-list td.number, .session-list th.number { text-align: right; width: 1%; white-space: nowrap; }
.session-list td { white-space: nowrap; }
.session-list td:nth-child(2) { white-space: normal; width: 40%; }
.new-session:not(.is-open):not(:target), .fold:not(.is-open):not(:target) { display: none; }
.admin-main:has(.new-session.is-open, .new-session:target) #new-session-link { display: none; }
.admin-main:has(.fold.is-open, .fold:target) .page-head .button.primary { display: none; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }

/* Staff pages without a session: a small menu in the header, and clients with their departments. */
.staff-top { display: flex; gap: 4px; margin-right: auto; margin-left: 24px; }
body.staff .staff-top a { padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
body.staff .staff-top a:hover { background: var(--soft); }
body.staff .staff-top a[aria-current] { font-weight: 600; background: var(--soft); }
.cell-note { display: block; color: var(--muted); font-size: 14px; }
.session-list td.cell-wrap { white-space: normal; color: #4a4a46; }
.field-note { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.inline-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.department-list td { vertical-align: top; }
.department-list td:first-child { width: 40%; }
body.staff form.stacked textarea { max-width: 420px; padding: 8px; box-sizing: border-box; }
body.staff form.stacked .actions { margin: 16px 0 0; align-items: center; }
body.staff form.stacked .actions button { margin-top: 0; }

/* Staff logins: a role as a choice with its meaning, and departments as boxes per client. */
.choice-group { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.choice-group legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
body.staff form.stacked label.choice { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; max-width: 420px; box-sizing: border-box; cursor: pointer; }
body.staff form.stacked label.choice:has(input:checked) { border-color: var(--accent); background: #fdf3f4; }
body.staff form.stacked label.choice input { width: auto; margin: 3px 0 0; display: inline-block; }
body.staff form.stacked label.choice-compact { padding: 6px 10px; }
.choice-client { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.choice-client-name { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.admin-departments-note { display: none; }
form.staff-form:has(input[name$="Role"][value="Administrator"]:checked) .staff-departments { display: none; }
form.staff-form:has(input[name$="Role"][value="Administrator"]:checked) .admin-departments-note { display: block; }
.staff-clients .staff-line { display: block; min-height: 1.4em; }

/* Deleting a session: a card that says what goes, and a solid red button only there. */
.card-danger { border-color: #e3b4bb; }
.card-danger h2 { color: #8f0a1d; }
.delete-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
body.staff a.button.danger { color: #8f0a1d; border-color: #e3b4bb; }
body.staff button.danger-solid { background: #8f0a1d; border-color: #8f0a1d; color: #fff; font-weight: 600; }
body.staff button.danger-solid:hover { background: #6e0816; }
body.staff form.stacked input.input-short { max-width: 160px; }

/* The session page: each section's teams and settings fold away below its head, which keeps its main buttons. */
.section-fold { border-top: 1px solid #efefec; padding-top: 12px; }
.section-fold-summary { cursor: pointer; display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; min-height: 40px; box-sizing: border-box; border: 1px solid #cfcfca; border-radius: 8px; background: var(--soft); color: var(--ink); font-weight: 600; list-style: none; user-select: none; }
.section-fold-summary:hover { border-color: #9a9a95; background: #ebebe8; }
.section-fold-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.section-fold-summary::-webkit-details-marker { display: none; }
.section-fold-summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; margin-right: 2px; }
.section-fold[open] > .section-fold-summary::before { transform: rotate(45deg); margin-top: -4px; }
.section-fold[open] > .section-fold-summary { margin-bottom: 16px; }
.section-fold .when-open, .section-fold[open] > summary .when-folded { display: none; }
.section-fold[open] > summary .when-open { display: inline; }
.section-body { display: flex; flex-direction: column; gap: 16px; }
.account-links { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; color: var(--muted); }
body.staff header a.header-account { color: var(--ink); text-decoration: none; padding: 6px 8px; border-radius: 6px; }
body.staff header a.header-account:hover { background: var(--soft); text-decoration: underline; }

/* A section's settings and resets: a gear after its name that opens a small panel below it. */
.section-settings { position: relative; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); cursor: pointer; list-style: none; }
.icon-button::-webkit-details-marker { display: none; }
.icon-button:hover, .section-settings[open] > .icon-button { color: var(--ink); background: var(--soft); border-color: var(--line); }
.icon-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.section-settings-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 10; width: max-content; max-width: min(560px, calc(100vw - 48px)); padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); display: flex; flex-direction: column; gap: 12px; }
.section-settings-panel h3 { margin: 0; font-size: 16px; }
.section-settings-panel .actions { margin: 0; }

/* The join link on the Participants page, and participants still waiting for a team. */
.copy-field { display: flex; gap: 8px; max-width: 640px; }
body.staff .copy-field input { flex: 1; min-width: 0; padding: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; background: var(--soft); }
.participants tr.row-waiting td { background: #fff8e6; }

/* A help popup behind a question mark next to a heading. */
.heading-with-help { display: flex; align-items: center; gap: 8px; }
.help-popup { position: relative; }
.help-popup[open] > .icon-button { color: var(--ink); background: var(--soft); border-color: var(--line); }
.popup-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 10; width: min(520px, calc(100vw - 48px)); padding: 16px 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); font-size: 15px; }
.popup-panel h3 { margin: 12px 0 4px; font-size: 15px; }
.popup-panel h3:first-child { margin-top: 0; }
.popup-panel ul, .popup-panel ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* The Participants page: a summary line under the heading, and the joining rules behind the gear. */
.participant-summary { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.participant-summary li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); }
.participant-summary li strong { color: var(--ink); }
.participant-summary li.summary-attention { background: #fff8e6; border-color: #f1dfb0; color: #6b4e00; }
.joining-rules { width: min(480px, calc(100vw - 48px)); gap: 20px; }
.joining-rules > section + section { padding-top: 16px; border-top: 1px solid var(--line); }
.joining-rules h3 { margin: 0 0 6px; }
.joining-rules p { margin: 0 0 8px; }

/* Tabs in a card: one panel at a time once the script runs; without it, every panel under its own heading. */
.tab-list[hidden] { display: none; }
.tab-list { display: flex; gap: 2px; overflow-x: auto; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
body.staff .tab-list [role=tab] { padding: 10px 12px 9px; border: none; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); white-space: nowrap; font: inherit; font-size: 15px; cursor: pointer; }
body.staff .tab-list [role=tab]:hover { color: var(--ink); }
body.staff .tab-list [role=tab][aria-selected=true] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tab-list [role=tab]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
[data-tabs] [role=tabpanel] + [role=tabpanel] { margin-top: 24px; }
[data-tabs].tabs-ready [role=tabpanel] { margin-top: 0; }
[data-tabs].tabs-ready .tab-heading { display: none; }
.tab-intro { margin-top: 0; }

/* The logins on the Participants page: a toolbar, light rows, and a menu per login and for the checked logins. */
.logins-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.logins-find { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; }
.logins-find[hidden] { display: none; }
/* Search, filter and the Actions button line up at the height of a button. */
body.staff .logins-find input[type=search], body.staff .logins-find select, body.staff .logins-toolbar .menu-button { box-sizing: border-box; height: 40px; min-height: 40px; }
body.staff .logins-find input[type=search] { flex: 1 1 220px; max-width: 320px; padding: 0 10px; }
body.staff .logins-find select { padding: 0 8px; }
body.staff .logins-toolbar .menu-button { padding: 0 12px 0 14px; }
.logins-count, .logins-empty { color: var(--muted); font-size: 14px; }
#bulk-logins { margin-left: auto; }
.logins td { vertical-align: middle; }
.logins tr[hidden] { display: none; }
.logins .col-check { width: 32px; padding-right: 0; }
.logins .col-check input { width: 18px; height: 18px; margin: 0; vertical-align: middle; }
.logins .col-menu { width: 40px; text-align: right; }
.logins .login-name { font-weight: 500; }
.logins td[data-label=Status] .badge + .badge { margin-left: 4px; }
.participants tr.row-checked td { background: #f1f5fb; }
.logins form.inline select { padding: 6px; }

.menu { position: relative; display: inline-block; text-align: left; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
body.staff .menu-button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px 8px 14px; min-height: 40px; border: 1px solid #cfcfca; border-radius: 8px; background: #fff; cursor: pointer; }
.menu-button:hover, .menu[open] > .menu-button { border-color: #9a9a95; }
.menu-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu[open] > .icon-button { color: var(--ink); background: var(--soft); border-color: var(--line); }
.menu-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: max-content; min-width: 220px; max-width: min(360px, calc(100vw - 48px)); padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); display: flex; flex-direction: column; gap: 4px; }
.menu-panel-end { left: auto; right: 0; }
.menu-panel hr { width: 100%; margin: 4px 0; border: none; border-top: 1px solid var(--line); }
.menu-panel form { margin: 0; }
body.staff .menu-panel > button, body.staff .menu-panel > form:not(.menu-row) > button { width: 100%; text-align: left; border-color: transparent; background: none; }
body.staff .menu-panel > button:hover:not(:disabled), body.staff .menu-panel > form:not(.menu-row) > button:hover { background: var(--soft); border-color: transparent; }
body.staff .menu-panel button:disabled { color: #9a9a95; cursor: default; }
.menu-note { margin: 4px 8px; color: var(--muted); font-size: 13px; }
.menu-row { display: flex; gap: 6px; padding: 4px; }
body.staff .menu-row input, body.staff .menu-row select { flex: 1; min-width: 140px; padding: 6px 8px; }
body.staff .menu-row button { flex: none; }

/* On a phone each login is a small card: name and checkbox on top, the rest under it. */
@media (max-width: 760px) {
    .logins, .logins tbody { display: block; }
    .logins thead { display: none; }
    .logins tbody tr { display: grid; grid-template-columns: 32px 1fr 40px; gap: 4px 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
    .logins tbody td { display: block; padding: 0; border: none; }
    .logins .col-check { grid-row: 1; grid-column: 1; }
    .logins .col-name { grid-row: 1; grid-column: 2; }
    .logins .col-menu { grid-row: 1; grid-column: 3; }
    .logins td[data-label] { grid-column: 2 / 4; }
    .logins td[data-label]:empty { display: none; }
    .logins td[data-label=Section]::before, .logins td[data-label=Team]::before { content: attr(data-label) ": "; color: var(--muted); }
    #bulk-logins { margin-left: 0; }
}

/* Cards that fold under their heading (Participants page): the heading is the button, with a chevron before it. */
details.card.card-fold { display: block; }
.card-fold-summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; user-select: none; }
.card-fold-summary::-webkit-details-marker { display: none; }
.card-fold-summary::before { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s; margin: 0 4px 4px 2px; }
details.card-fold:not([open]) > .card-fold-summary::before { transform: rotate(-45deg); margin-bottom: 0; }
.card-fold-summary:hover h2 { color: var(--accent-dark); }
.card-fold-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.card-fold-body { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.card-fold-links { margin: 0; font-size: 14px; }

/* The starting password: its fields only while the box is ticked, and "Give it to every login" set apart below. */
.starting-form:has([data-starting-switch]:not(:checked)) .starting-fields { display: none; }
.starting-give { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.starting-give form { margin: 0; }

/* Every game page has one width, and the header and menu start where the page does; their backgrounds stay full width. */
body.game { --game-width: 1440px; --game-gutter: 24px; }
/* The scrollbar keeps its space, so the page does not shift sideways between pages that scroll (Home) and pages that do not (Office). */
html:has(> body.game) { scrollbar-gutter: stable; }
body.game main, body.game main.wide, body.game main.game-page, body.game main.wide.game-page { max-width: var(--game-width); padding: 20px var(--game-gutter); box-sizing: border-box; }
body.game header, body.game .game-nav {
    padding-left: max(var(--game-gutter), calc((100% - var(--game-width)) / 2 + var(--game-gutter)));
    padding-right: max(var(--game-gutter), calc((100% - var(--game-width)) / 2 + var(--game-gutter)));
}

body.game header { padding-top: 14px; padding-bottom: 14px; }
body.game .brand { gap: 12px; }
body.game .brand-mark { width: 28px; height: 28px; }
body.game .brand strong { font-size: 30px; letter-spacing: -0.02em; }

/* The inbox: messages grouped by quarter, a chip per quarter to jump to it, and each message folding under its subject. */
.inbox-quarters { display: flex; flex-wrap: wrap; gap: 8px; }
body.game .inbox-quarter { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-size: 14px; }
body.game .inbox-quarter:hover { border-color: #9a9a95; }
body.game .inbox-quarter[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.inbox-quarter-count { min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 13px; font-weight: 600; text-align: center; box-sizing: border-box; }
.inbox-group { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 16px; }
.inbox-group-title { margin: 8px 0 0; font-size: 18px; }
.inbox-fold-all { display: flex; gap: 8px; }
.inbox-group-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
body.game button.inbox-group-fold { min-height: 32px; padding: 4px 12px; font-size: 14px; }
.inbox-group-title span { margin-left: 6px; font-size: 14px; font-weight: 400; color: var(--muted); }
body.game details.message-item { display: block; border-top: 1px solid var(--line); padding: 16px 20px; }
.message-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; cursor: pointer; list-style: none; }
.message-summary::-webkit-details-marker { display: none; }
.message-summary::before { content: ""; flex: none; align-self: center; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; }
details.message-item[open] > .message-summary::before { transform: rotate(45deg); }
.message-summary h3 { margin: 0; font-size: 17px; }
.message-summary:hover h3 { color: var(--accent-dark); }
.message-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.message-from { margin-left: auto; font-size: 14px; color: var(--muted); }
.message-content { margin-top: 12px; padding-left: 21px; }

/*
 * Mission control, the team's home (ADR-059). Every colour comes from the --mc variables, so a theme (a dark one, say)
 * only has to set these. Up and down reuse the trend colours: blue for up, amber-brown for down.
 */
.mission {
    --mc-surface: #fff;
    --mc-raised: var(--soft);
    --mc-line: var(--line);
    --mc-ink: var(--ink);
    --mc-muted: var(--muted);
    --mc-track: #e4e4df;
    --mc-up: #1f5fa8;
    --mc-up-soft: rgba(31, 95, 168, 0.14);
    --mc-down: #b8520a;
    --mc-down-soft: rgba(184, 82, 10, 0.14);
    --mc-down-line: #e9c9a8;
    --mc-own: #eaf1fa;
    --mc-own-line: #9cbbe0;
    --mc-cta: var(--accent);
    --mc-cta-hover: var(--accent-dark);
    --mc-cta-ink: #fff;
    --mc-cash: #3d4a57;
    --mc-other: #b9c0c6;
    display: flex; flex-direction: column; gap: 20px; color: var(--mc-ink);
}
.mission h1, .mission h2, .mission h3, .mission p { margin: 0; }
.mission .empty { color: var(--mc-muted); }
.mc-up { color: var(--mc-up); }
.mc-down { color: var(--mc-down); }
.mc-flat { color: var(--mc-muted); }

.mc-card { padding: 20px 24px; border-radius: 16px; background: var(--mc-surface); border: 1px solid var(--mc-line); display: flex; flex-direction: column; gap: 14px; min-width: 0; box-sizing: border-box; }
.mc-card h2 { font-size: 20px; letter-spacing: -0.01em; }
.mc-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.mc-card-head > span { color: var(--mc-muted); font-size: 14px; }
.mc-card-head-split { justify-content: space-between; }
.mc-card-head-split a { font-size: 14px; }

/* The quarter: a ring for how far the game is, where things stand, and the way to the office. */
.mc-status { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; padding: 20px 24px; border-radius: 16px; background: var(--mc-surface); border: 1px solid var(--mc-line); }
.mc-ring { flex: none; }
.mc-ring circle { fill: none; stroke-width: 8; }
.mc-ring-track { stroke: var(--mc-track); }
.mc-ring-done { stroke: var(--mc-up); stroke-linecap: round; }
.mc-ring-quarter { fill: var(--mc-ink); font-size: 22px; font-weight: 700; }
.mc-ring-of { fill: var(--mc-muted); font-size: 11px; }
.mc-status-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mc-eyebrow { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mc-muted); }
.mc-status h1 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.02em; line-height: 1.15; }
.mc-status p { color: var(--mc-muted); }
body.game a.mc-cta { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 12px; background: var(--mc-cta); color: var(--mc-cta-ink); font-weight: 700; text-decoration: none; }
body.game a.mc-cta:hover { background: var(--mc-cta-hover); }

/* Key figures: a tile each, with the change, a note and a line over every quarter played. A fall gets a warm edge. */
.mc-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.mc-figure { padding: 18px 20px; border-radius: 14px; background: var(--mc-surface); border: 1px solid var(--mc-line); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mc-figure-down { border-color: var(--mc-down-line); }
.mc-label { font-size: 13px; color: var(--mc-muted); }
.mc-value { font-size: 32px; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mc-value span { font-size: 16px; font-weight: 500; color: var(--mc-muted); }
.mc-change { font-size: 14px; font-weight: 600; min-height: 1.3em; }
.mc-spark { width: 100%; height: 40px; margin-top: 4px; }
.mc-spark polyline { fill: none; stroke: var(--mc-up); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.mc-figure-down .mc-spark polyline { stroke: var(--mc-down); }
.mc-spark-zero { stroke: var(--mc-track); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }

/* The board's four scores as bars out of 10; the one that moved most stands out. */
.mc-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 12px 40px; }
.mc-board-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 48px 60px; align-items: center; gap: 12px; }
.mc-board-notable > span:first-child { font-weight: 600; }
.mc-bar { height: 10px; border-radius: 999px; background: var(--mc-track); overflow: hidden; }
.mc-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--mc-up); }
.mc-bar > span.mc-bar-down { background: var(--mc-down); }
.mc-board-value { text-align: right; font-variant-numeric: tabular-nums; }
.mc-board-change { font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* The map beside the ranking and the new mail. */
.mc-columns { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.mc-flows { flex: 999 1 600px; position: relative; }
.mc-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* The map is stretched a little in height, so two-line labels fit; the offices keep their places in per cent. */
.mission .world-map { position: relative; height: clamp(260px, 24vw, 320px); border-radius: 12px; background: var(--mc-raised) url(/images/home/world.png) center / 100% 100% no-repeat; }
body.game .mission .globe-point { position: absolute; display: flex; align-items: center; gap: 8px; transform: translate(-8px, -50%); color: var(--mc-ink); text-decoration: none; font-size: 13px; line-height: 1.3; white-space: nowrap; border-radius: 8px; }
body.game .mission .globe-point.HongKong { flex-direction: row-reverse; text-align: right; transform: translate(calc(-100% + 8px), -50%); }
.globe-marker { flex: none; width: var(--marker); height: var(--marker); border-radius: 50%; background: var(--mc-up-soft); border: 2px solid var(--mc-up); box-sizing: border-box; }
.globe-point.is-site .globe-marker { border-radius: 4px; }
.globe-point.mc-down .globe-marker { background: var(--mc-down-soft); border-color: var(--mc-down); }
.globe-label { display: flex; flex-direction: column; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--mc-surface) 80%, transparent); }
.globe-city { font-weight: 600; }
.globe-figure { color: var(--mc-muted); }
.globe-point:hover .globe-city, .globe-point[aria-current] .globe-city { text-decoration: underline; text-underline-offset: 3px; }
.globe-point[aria-current] .globe-label { box-shadow: 0 0 0 2px var(--mc-up); }
.globe-point:focus-visible { outline: 2px solid var(--mc-up); outline-offset: 2px; }

.mc-office { display: flex; flex-direction: column; gap: 12px; }
.mc-office .office-photo { width: 100%; height: 56px; object-fit: cover; border-radius: 10px; }
.mc-office-text { display: flex; flex-direction: column; gap: 8px; }
.mc-office-text h3 { font-size: 17px; }
.mc-office-text h3 span { margin-left: 6px; font-size: 14px; font-weight: 400; color: var(--mc-muted); }

.mc-ranking { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.mc-ranking li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--mc-raised); border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.mc-ranking li.own-team { background: var(--mc-own); border-color: var(--mc-own-line); font-weight: 600; }
.mc-place { width: 24px; color: var(--mc-muted); }
.mc-team { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-you { color: var(--mc-muted); font-weight: 400; }
.mc-move { width: 40px; text-align: right; font-size: 13px; font-weight: 600; }
.mc-note { color: var(--mc-muted); font-size: 13px; }
.mc-ranking li.mc-ranking-gap { justify-content: center; padding: 0; background: none; color: var(--mc-muted); line-height: 1; }

body.game a.mc-message { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--mc-raised); color: var(--mc-ink); text-decoration: none; }
body.game a.mc-message:hover strong { text-decoration: underline; }
.mc-message span { font-size: 13px; color: var(--mc-muted); }

/* Goods, money and offices (ADR-061): a switch in the card's corner; each view keeps its own heading. */
.mc-switch { position: absolute; top: 14px; right: 18px; display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--mc-raised); border: 1px solid var(--mc-line); }
.mc-switch[hidden] { display: none; }
body.game button.mc-seg { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--mc-muted); font-weight: 600; }
body.game button.mc-seg:hover { color: var(--mc-ink); }
body.game button.mc-seg[aria-pressed="true"] { background: var(--mc-surface); color: var(--mc-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.mc-flows.has-switch .mc-view > h2, .mc-flows.has-switch .mc-view > .mc-card-head { min-height: 44px; display: flex; align-items: center; padding-right: 330px; }
.mc-view { display: flex; flex-direction: column; gap: 16px; }
.mc-view[hidden] { display: none; }
.mc-flows:not(.has-switch) .mc-view + .mc-view { padding-top: 20px; border-top: 1px solid var(--mc-line); }
.mc-flow-summary { color: var(--mc-muted); }

/* Goods: start stock + made − sold = end stock, with what machines and people could make. */
.mc-equation { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 2fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; }
.mc-eq { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--mc-raised); min-width: 0; }
.mc-eq strong { font-size: 26px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mc-eq-note { font-size: 13px; color: var(--mc-muted); }
.mc-eq-op { align-self: center; font-size: 22px; font-weight: 600; color: var(--mc-muted); }
.mc-limits { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mc-limits li { display: grid; grid-template-columns: minmax(0, 1fr) 90px; grid-template-areas: "name bar" "value value"; gap: 2px 10px; align-items: center; font-size: 13px; }
.mc-limit-name { grid-area: name; }
.mc-limits .mc-bar { grid-area: bar; height: 8px; }
.mc-limit-value { grid-area: value; color: var(--mc-muted); font-variant-numeric: tabular-nums; }
.mc-limits li.is-lowest .mc-limit-name { font-weight: 600; }
.mc-limits li.is-lowest .mc-bar > span { background: var(--mc-down); }
.mc-stock { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; align-items: center; font-size: 13px; }
.mc-stock-label { color: var(--mc-muted); }
.mc-stock-bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: var(--mc-track); }
.mc-stock-bar > span { display: flex; align-items: center; padding: 0 8px; min-width: 0; overflow: hidden; white-space: nowrap; color: #fff; font-weight: 600; box-sizing: border-box; }
.mc-stock-start, .mc-stock-end { background: var(--mc-cash); }
.mc-stock-made { background: var(--mc-up); }
.mc-stock-sold { background: var(--mc-down); }

/* Money: a waterfall from last quarter's cash to this quarter's. Bars sit at their level as a share of the plot's height. */
.mc-waterfall { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.mc-step { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
/* The room above the plot keeps the tallest bar's amount clear of the heading. */
.mc-step-plot { position: relative; height: 240px; margin-top: 24px; border-bottom: 1px solid var(--mc-line); }
.mc-step-bar { position: absolute; left: 0; right: 0; border-radius: 6px; background: var(--mc-cash); }
.mc-step-value { position: absolute; bottom: calc(100% + 4px); left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc-step-label { font-size: 13px; color: var(--mc-muted); text-align: center; overflow-wrap: anywhere; }
.mc-step-in .mc-step-bar, .mc-key.mc-step-in { background: var(--mc-up); }
.mc-step-out .mc-step-bar, .mc-key.mc-step-out { background: var(--mc-down); }
.mc-step-other .mc-step-bar, .mc-key.mc-step-other { background: var(--mc-other); }
.mc-key.mc-step-cash { background: var(--mc-cash); }
.mc-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--mc-muted); }
.mc-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.mc-key { width: 12px; height: 12px; border-radius: 3px; }

@media (max-width: 900px) {
    .mc-switch { position: static; align-self: flex-start; }
    .mc-flows.has-switch .mc-view > h2, .mc-flows.has-switch .mc-view > .mc-card-head { padding-right: 0; }
    .mc-equation { grid-template-columns: minmax(0, 1fr); }
    .mc-eq-op { justify-self: center; }
    .mc-waterfall { grid-auto-flow: row; grid-auto-columns: auto; gap: 6px; }
    .mc-step { flex-direction: row; justify-content: space-between; padding: 8px 10px; border-radius: 8px; background: var(--mc-raised); }
    .mc-step-plot { display: none; }
    .mc-step-label { text-align: left; color: var(--mc-ink); }
    .mc-step .mc-step-amount { display: inline; }
}
.mc-step-amount { display: none; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    body.game .mission .globe-point .globe-figure { display: none; }
    .mc-board-row { grid-template-columns: 64px minmax(0, 1fr) 44px 56px; gap: 8px; }
}

/* Countdowns: the session page's Countdown button and panel, and the time left in the game's menu bar. */
.deadline-popup { position: relative; }
.deadline-popup > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.deadline-popup > summary::-webkit-details-marker { display: none; }
body.staff .deadline-popup > summary.button { padding: 8px 14px; min-height: 40px; box-sizing: border-box; border: 1px solid #cfcfca; border-radius: 8px; background: #fff; color: var(--ink); }
body.staff .deadline-popup > summary.button:hover, .deadline-popup[open] > summary.button { border-color: #9a9a95; }
.deadline-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 10; width: min(360px, calc(100vw - 48px)); padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); display: flex; flex-direction: column; gap: 10px; text-align: left; }
.deadline-panel h3 { margin: 0; font-size: 16px; }
.deadline-panel .hint { margin: 0; font-size: 14px; color: var(--muted); }
.deadline-panel form { margin: 0; }
.deadline-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
body.staff .deadline-quick button { min-height: 32px; padding: 4px 10px; font-size: 14px; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 600; }
.deadline-popup .countdown { padding: 2px 8px; border-radius: 999px; background: var(--soft); font-size: 13px; }
.countdown.is-low { background: #fff1e0; color: #a14a00; }
.countdown.is-up { background: #fbe6e6; color: #a30d22; }
.game-countdown { padding: 4px 10px; border-radius: 999px; background: #eef0f4; color: #2a2f3a; }
.game-countdown[hidden] { display: none; }
.game-closing { font-weight: 600; }

/* Feedback in game play: saving, the saved message, a new quarter on an open page, and the new quarter on Mission control.
   Motion only for those who did not ask their system for less of it. */
body.game .message.success { display: flex; align-items: center; gap: 10px; border-radius: 10px; background: #e6f4ea; color: #1d5a2c; font-weight: 600; }
body.game .message.success::before { content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%; background: #2e7d43 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat; }
body.game #save-decisions.is-saving { opacity: 0.8; cursor: progress; }
body.game #save-decisions.is-saving::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px; vertical-align: -1px; border: 2px solid rgba(255, 255, 255, 0.5); border-top-color: #fff; border-radius: 50%; }
.game-new-quarter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; background: #fff3ec; border: 1px solid #ffc9b3; color: #6b2a0f; font-weight: 600; }
body.game .game-new-quarter a.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
    body.game .message.success { animation: game-pop 0.35s ease-out both; }
    body.game .message.success::before { animation: game-check 0.45s 0.15s ease-out both; }
    body.game #save-decisions.is-saving::after { animation: game-spin 0.8s linear infinite; }
    .game-new-quarter, .game-closing { animation: game-drop 0.4s ease-out both; }
    .mission.is-new-quarter > * { animation: game-rise 0.5s var(--enter-delay, 0ms) ease-out both; }
    .mission.is-new-quarter .mc-ring-done { animation: game-ring 1s 0.2s ease-out both; }
    .countdown.is-up { animation: game-pulse 1.2s ease-in-out 3; }
}
@keyframes game-pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes game-check { from { transform: scale(0); } 70% { transform: scale(1.15); } to { transform: scale(1); } }
@keyframes game-spin { to { transform: rotate(360deg); } }
@keyframes game-drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes game-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes game-ring { from { stroke-dasharray: 0 999; } }
@keyframes game-pulse { 50% { transform: scale(1.06); } }

/* The participants' login, with nextOne3's intro video behind it. The card stays readable on a dimmed video. */
.login-background { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
body.login-video { background: #1c1c1c; }
body.login-video::before { content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(15, 15, 15, 0.45); }
body.login-video > header { background: rgba(255, 255, 255, 0.92); }
body.login-video .account-card { box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35); }
@media (prefers-reduced-motion: reduce) {
    .login-background { display: none; }
}
body.staff .message.success { transition: opacity 0.6s ease, max-height 0.6s ease, margin 0.6s ease, padding 0.6s ease; max-height: 200px; overflow: hidden; }
body.staff .message.success.is-fading { opacity: 0; max-height: 0; margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }

/* The message editor on the staff pages: a toolbar over an area that shows the text as the inbox will. */
.html-editor { border: 1px solid #cfcfca; border-radius: 8px; background: #fff; overflow: hidden; }
.html-editor[hidden] { display: none; }
.html-editor:focus-within { border-color: var(--accent); }
.html-editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--soft); }
body.staff .html-editor-toolbar button { min-height: 32px; padding: 4px 10px; font-size: 14px; }
body.staff .html-editor-toolbar button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.html-editor-area { min-height: 220px; max-height: 60vh; overflow-y: auto; padding: 10px 12px; line-height: 1.5; outline: none; }
.html-editor-area > :first-child { margin-top: 0; }
.html-editor-area a { color: var(--accent-dark); }

/* The report downloads as icons by the results heading, as in nextOne3. */
.panel-heading { display: flex; align-items: center; gap: 10px; }
.report-icons { display: inline-flex; gap: 4px; }
.report-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; }
.report-icon:hover { background: var(--soft); }
.report-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* The participants' login: the logo larger and in the middle, over the video. */
body.login-video > header { justify-content: center; padding: 18px 16px; }
body.login-video .brand { gap: 14px; }
body.login-video .brand-mark { width: 34px; height: 34px; background: #ff5722; }
body.login-video .brand strong { font-size: 38px; letter-spacing: -0.02em; }

/* A participant's new password, with a QR code to choose their own instead. */
.password-qr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 24px; margin-top: 8px; }
.password-qr-code { flex: none; width: 168px; height: 168px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.password-qr-code svg { display: block; width: 100%; height: 100%; }
.password-qr h3 { margin: 0 0 4px; font-size: 16px; }
.password-qr > div:last-child { flex: 1 1 260px; min-width: 0; }

/* The Upload Excel tab: room between the explanation, the download link and the form. */
.upload-panel .tab-intro { margin-bottom: 16px; line-height: 1.5; }
.upload-panel .upload-download { margin: 0 0 24px; }
.upload-panel .upload-form { padding-top: 8px; border-top: 1px solid var(--line); }
.upload-panel .upload-form label { margin-top: 16px; }
.upload-panel .upload-form input[type=file] { margin-top: 8px; padding: 10px; border: 1px dashed #cfcfca; border-radius: 8px; background: var(--soft); }
.upload-panel .upload-form button { margin-top: 24px; }

/* A session's first and last day, side by side. */
.date-range { display: flex; flex-wrap: wrap; gap: 0 16px; }
.date-range > div { flex: 0 1 200px; min-width: 0; }

/* A person's first and last name, side by side. */
.name-fields { display: flex; flex-wrap: wrap; gap: 0 16px; }
.name-fields > div { flex: 1 1 180px; min-width: 0; max-width: 260px; }

/* The waiting screen while a section calculates. */
dialog.calculating { border: 0; border-radius: 14px; padding: 28px 32px; width: min(420px, calc(100vw - 48px)); box-sizing: border-box; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
dialog.calculating::backdrop { background: rgba(20, 20, 20, 0.45); }
dialog.calculating h2 { margin: 12px 0 4px; font-size: 18px; }
.calculating-time { margin: 0; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.calculating-note { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.calculating-spinner { width: 36px; height: 36px; margin: 0 auto; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) {
    .calculating-spinner { animation: game-spin 0.9s linear infinite; }
}
body.staff form[data-calculate] button[aria-disabled="true"] { opacity: 0.6; cursor: progress; }

/* Password fields with a button to show what was typed. */
.password-field { position: relative; display: block; max-width: 420px; }
.password-field input { padding-right: 44px !important; }
/* Forms style their buttons broadly (full width, margins), so the eye button sets its own size firmly. */
.password-field .password-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 36px !important; height: 32px; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 6px; background: transparent !important; color: var(--muted, #5f5f5a) !important; cursor: pointer; }
.password-field .password-toggle:hover, .password-field .password-toggle[aria-pressed="true"] { color: var(--ink, #1c1c1c) !important; background: var(--soft, #f4f4f2) !important; }
.password-field .password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.validation-summary-errors[hidden], .field-validation-error[hidden] { display: none; }
