/* PostWatchHQ / Fire (ADR-0029). The same layout as the PostWatchHQ / EMS and PostWatch/HQ sign-in and header; only
   the colours differ. Police is red and blue. EMS is blues, white and navy. Fire is red and black, with no blue.
   Night: black with red marks and near-white text. Day: white with black text and red marks.
   "Auto" follows the device; Day and Night are set by the switch.
   Red is the brand here, so it never means "something is wrong". A problem is shown in amber, with a mark and words,
   never by colour alone. Every text colour is at least 4.5:1 against its background. */

:root {
  color-scheme: light;
  --page: #f5f5f6;
  --card: #ffffff;
  --card-2: #f5f5f6;
  --line: #d4d4d8;
  --field-line: #7a7a83;
  --text: #111113;
  --muted: #55555c;
  --accent: #b3140f;
  --accent-solid: #b3140f;
  --on-accent: #ffffff;
  --button: #111113;
  --button-hover: #3a3a40;
  --on-button: #ffffff;
  --field: #ffffff;
  --focus: #b3140f;
  --warn-bg: #fff4d6;
  --warn-line: #7a4b00;
  --warn-text: #111113;
  --warn-mark: #7a4b00;
  --shadow: 0 14px 40px rgba(17, 17, 19, 0.12);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* Night values: used when Night is chosen, or when the device is dark and nothing is chosen. */
:root[data-theme="night"] {
  color-scheme: dark;
  --page: #0b0b0d;
  --card: #17171a;
  --card-2: #101012;
  --line: #2e2e33;
  --field-line: #7a7a83;
  --text: #f4f4f5;
  --muted: #b8b8bf;
  --accent: #ff6a5c;
  --accent-solid: #c8201a;
  --on-accent: #ffffff;
  --button: #c8201a;
  --button-hover: #a81a15;
  --on-button: #ffffff;
  --field: #0b0b0d;
  --focus: #ffffff;
  --warn-bg: #17171a;
  --warn-line: #ffc53d;
  --warn-text: #f4f4f5;
  --warn-mark: #ffc53d;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --page: #0b0b0d;
    --card: #17171a;
    --card-2: #101012;
    --line: #2e2e33;
    --field-line: #7a7a83;
    --text: #f4f4f5;
    --muted: #b8b8bf;
    --accent: #ff6a5c;
    --accent-solid: #c8201a;
    --on-accent: #ffffff;
    --button: #c8201a;
    --button-hover: #a81a15;
    --on-button: #ffffff;
    --field: #0b0b0d;
    --focus: #ffffff;
    --warn-bg: #17171a;
    --warn-line: #ffc53d;
    --warn-text: #f4f4f5;
    --warn-mark: #ffc53d;
    --shadow: none;
  }
}

/* Which colouring of the logo shows. */
html .for-night { display: none; }
:root[data-theme="night"] .for-day { display: none; }
:root[data-theme="night"] .for-night { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .for-day { display: none; }
  :root[data-theme="auto"] .for-night { display: block; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 16px/1.5 var(--font); }
h1, h2 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button, input { font: inherit; }

/* ---------- sign-in and set-up: a card under the logo, as in PostWatch/HQ ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: min(440px, 100%); padding: 32px;
  background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--accent-solid); border-radius: 0 0 12px 12px; box-shadow: var(--shadow);
}
.login-logo { display: block; width: 100%; max-width: 330px; height: auto; margin-bottom: 22px; }
.tenant {
  display: flex; flex-direction: column; gap: 1px; margin-bottom: 20px; padding: 10px 12px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 6px;
}
.tenant-kind { color: var(--accent); font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.tenant-name { font-weight: 600; }
.login-card h1 { font-size: 1.4rem; }
.step { margin: 0 0 6px; color: var(--accent); font-weight: 600; font-size: .9rem; }

.fields label { display: block; margin: 14px 0 5px; font-weight: 600; font-size: .92rem; }
.fields input:not([type="hidden"]) {
  width: 100%; padding: 9px 11px; min-height: 44px;
  background: var(--field); color: var(--text); border: 1px solid var(--field-line); border-radius: 6px;
}
.primary {
  width: 100%; margin-top: 22px; padding: 11px; min-height: 46px;
  border: 1px solid var(--button); border-radius: 6px; background: var(--button); color: var(--on-button);
  font-weight: 600; cursor: pointer;
}
.primary:hover { background: var(--button-hover); border-color: var(--button-hover); }
.login-error {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 9px 12px; color: var(--warn-text);
  background: var(--warn-bg); border: 2px solid var(--warn-line); border-radius: 6px;
}
.warn-mark { flex: none; width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: var(--warn-mark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.warn-word { font-weight: 700; }
.login-note { margin: 18px 0 0; color: var(--muted); font-size: .86rem; text-align: center; }
.hint { margin: 6px 0; color: var(--muted); font-size: .88rem; }
.setup-key {
  margin: 12px 0; padding: 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px;
  font: 600 1.02rem/1.5 Consolas, "SF Mono", Menlo, monospace; text-align: center; overflow-wrap: anywhere; user-select: all;
}

/* ---------- Day / Night / Auto ---------- */
.theme { display: flex; width: fit-content; margin: 16px auto 0; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card-2); }
.theme-btn {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  border-radius: 999px; padding: 5px 14px; min-height: 30px; font-size: .84rem; font-weight: 600;
}
.theme-btn[aria-pressed="true"] { background: var(--accent-solid); color: var(--on-accent); }

/* ---------- workspace header, as in PostWatch/HQ ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 16px; background: var(--card); border-top: 4px solid var(--accent-solid); border-bottom: 1px solid var(--line); }
.top-logo { display: block; }
.top-logo-img { width: 212px; height: auto; }
.top-tenant { display: flex; flex-direction: column; line-height: 1.25; padding-left: 16px; border-left: 1px solid var(--line); }
.top-tenant-name { font-weight: 600; }
.top-tenant-kind { color: var(--muted); font-size: .8rem; }
.top-right { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.top-right .theme { margin: 0; }
.top-user { color: var(--muted); font-size: .92rem; }
.link-button { padding: 4px 6px; background: none; border: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.link-button:hover { color: var(--text); }

/* ---------- the workspace ---------- */
.space-main { max-width: 960px; margin: 0 auto; padding: 36px 16px 48px; }
.space-head h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: .1em; }
.space-sub { color: var(--muted); }
.empty { margin-top: 26px; padding: 60px 24px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: 10px; }
.empty h2 { font-size: 1.2rem; margin: 14px 0 4px; }
.empty p { color: var(--muted); }
.space-note { margin-top: 18px; color: var(--muted); font-size: .86rem; }

/* ---------- pages inside the workspace ---------- */
.nav { display: flex; flex-wrap: wrap; gap: 0 4px; padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.nav a { padding: 10px 12px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent-solid); }

/* ---------- apparatus board ----------
   No cards. Each rig is a row on the page with a status bar down its left edge, a large unit name, and its crew
   as a line of seat tiles. A status is always a mark and words; the bar and the glow only add to them. */
.space {
  min-height: 100vh;
  background: radial-gradient(1100px 440px at 10% -6%, color-mix(in srgb, var(--accent-solid) 17%, transparent), transparent 70%) no-repeat, var(--page);
}
.space-head h1 { font-weight: 800; letter-spacing: -.01em; }

/* The counts, framed by the logo's corner brackets. */
.board-sum { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 30px; padding: 14px 6px; }
.board-sum::before, .board-sum::after { content: ""; position: absolute; width: 26px; height: 26px; border: 3px solid var(--accent-solid); }
.board-sum::before { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.board-sum::after { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.board-sum span { padding: 4px 18px; border-left: 1px solid var(--line); color: var(--muted); font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.board-sum span:first-child { border-left: 0; }
.board-sum b { display: block; margin-bottom: 6px; color: var(--text); font-size: clamp(2.6rem, 7vw, 4.2rem); font-weight: 800; line-height: .95; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.station { margin-top: 40px; }
.station h2 { display: flex; align-items: center; gap: 16px; margin: 0; color: var(--text); font-size: .8rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.station h2::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--accent-solid), transparent); }
.rigs { margin-top: 4px; }

.rig { position: relative; display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 4px 30px; min-width: 0; padding: 22px 0 22px 24px; border-bottom: 1px solid var(--line); }
.rig::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 5px; border-radius: 3px; background: var(--field-line); }
.rig-in_service::before { background: var(--text); }
.rig-on_call { background: linear-gradient(90deg, color-mix(in srgb, var(--accent-solid) 15%, transparent), transparent 60%); }
.rig-on_call::before { background: var(--accent-solid); box-shadow: 0 0 20px 3px color-mix(in srgb, var(--accent-solid) 65%, transparent); }
.rig-out_of_service::before { background: repeating-linear-gradient(-45deg, var(--warn-mark) 0 6px, transparent 6px 12px); }
.rig-head, .rig-note, .rig-since, .rig-change { grid-column: 1; }
.rig-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.rig-head h3 { margin: 0; font-size: clamp(1.55rem, 3.6vw, 2.1rem); font-weight: 800; line-height: 1; letter-spacing: .03em; text-transform: uppercase; }
.rig-type { color: var(--muted); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.status-mark { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.status-on_call { color: var(--accent); }
.status-on_call .status-mark { animation: rolling 1.1s ease-in-out infinite; }
.status-out_of_service .status-mark { stroke: var(--warn-mark); }
@keyframes rolling { 0%, 100% { transform: translateX(-2px); } 50% { transform: translateX(3px); } }
.rig-note { margin: 10px 0 0; font-weight: 600; }
.rig-since { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }

/* Who is on: one tile per seat, with a cut corner. An open seat is a dashed outline and the words "Open seat". */
.seats { grid-column: 2; grid-row: 1 / span 4; align-self: center; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; list-style: none; margin: 0; padding: 0; }
.seat { display: flex; flex-direction: column; flex: 1 1 150px; max-width: 230px; min-width: 0; padding: 9px 14px 11px; border-left: 3px solid var(--accent-solid);
  background: linear-gradient(135deg, color-mix(in srgb, var(--text) 9%, transparent), color-mix(in srgb, var(--text) 2%, transparent) 75%);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
.seat-position { color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.seat-name { font-size: 1.04rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.seat-rank { color: var(--muted); font-size: .8rem; }
.seat-open { background: none; border: 1px dashed var(--field-line); border-left: 3px dashed var(--field-line); }
.seat-open .seat-name { font-weight: 400; font-style: italic; color: var(--muted); }

.board-tip { margin-top: 14px; color: var(--muted); font-size: .86rem; }
.seat-edit summary { display: flex; flex-direction: column; list-style: none; cursor: pointer; margin: -9px -14px -11px; padding: 9px 14px 11px; }
.seat-edit summary::-webkit-details-marker { display: none; }
.seat-edit summary:hover .seat-name { text-decoration: underline; text-decoration-color: var(--accent-solid); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.seat-edit summary:focus-visible { outline-offset: -3px; }
.seat-edit[open] summary { margin-bottom: 0; }
.seat-form { display: grid; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.seat-form select { width: 100%; min-height: 40px; padding: 7px 8px; background: var(--field); color: var(--text); border: 1px solid var(--field-line); border-radius: 6px; font: inherit; }
.seat:has(.seat-edit[open]) { clip-path: none; background: var(--card); outline: 2px solid var(--accent-solid); }
.rig-change { margin-top: 12px; }
.rig-change summary { width: fit-content; cursor: pointer; color: var(--accent); font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.rig-form { display: grid; gap: 4px; max-width: 320px; margin-top: 8px; }
.rig-form label { margin-top: 6px; font-size: .86rem; font-weight: 600; }
.rig-form select, .rig-form input { width: 100%; padding: 8px 10px; min-height: 40px; background: var(--field); color: var(--text); border: 1px solid var(--field-line); border-radius: 6px; font: inherit; }
.rig-form .primary { margin-top: 10px; }
.space-main > .login-error { margin-top: 20px; }

.rig-head h3 a { color: inherit; text-decoration: none; }
.rig-head h3 a:hover { color: var(--accent); }
.rig-check { display: flex; align-items: center; gap: 7px; margin: 6px 0 0; color: var(--muted); font-size: .82rem; }
.rig-check .status-mark { width: 15px; height: 15px; }
.rig-check-problem { color: var(--text); font-weight: 600; }
.rig-check-problem .status-mark { stroke: var(--warn-mark); }

/* ---------- one rig's page, and the roster ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.back { margin-bottom: 14px; font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.back a { text-decoration: none; }
.back a::before { content: "\2190\00a0"; }
.rig-page { position: relative; padding-left: 24px; }
.rig-page::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 6px; border-radius: 3px; background: var(--text); }
.rig-page.rig-on_call::before { background: var(--accent-solid); box-shadow: 0 0 20px 3px color-mix(in srgb, var(--accent-solid) 65%, transparent); }
.rig-page.rig-out_of_service::before { background: repeating-linear-gradient(-45deg, var(--warn-mark) 0 6px, transparent 6px 12px); }
.rig-page h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.rig-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; }
.rig-state .rig-note { margin: 0; }
.part { margin-top: 40px; }
.part > h2 { display: flex; align-items: center; gap: 16px; margin: 0 0 6px; font-size: .8rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.part > h2::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--accent-solid), transparent); }
.part-sub { margin: 26px 0 4px; color: var(--muted); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; }
.crew, .check-board, .people, .check-history { list-style: none; margin: 0; padding: 0; }
.crew-row, .check-board li, .person { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.crew-row .seat-position { flex: 0 0 11em; }
.crew-who { flex: 1 1 160px; font-size: 1.08rem; font-weight: 700; }
.crew-open .crew-who { font-weight: 400; font-style: italic; color: var(--muted); }
.crew-set { display: flex; gap: 8px; }
.crew-set select, .build-form input, .check-form input:not([type="radio"]) { min-height: 40px; padding: 7px 10px; background: var(--field); color: var(--text); border: 1px solid var(--field-line); border-radius: 6px; font: inherit; }
.crew-set select { max-width: 220px; }
.small { min-height: 40px; padding: 7px 16px; border: 2px solid var(--accent-solid); background: transparent; color: var(--text); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%); }
.small:hover { background: var(--accent-solid); color: var(--on-accent); }
.build { margin-top: 16px; }
.build summary { width: fit-content; cursor: pointer; color: var(--accent); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.build-form { display: flex; flex-wrap: wrap; align-items: end; gap: 6px 12px; margin-top: 10px; }
.build-form label { flex-basis: 100%; font-size: .88rem; font-weight: 600; }
.build-form input { flex: 1 1 220px; max-width: 360px; }
.build-wide label { margin-top: 6px; }
.check-last { color: var(--muted); }
.check-label { flex: 1 1 220px; font-weight: 600; }
.found { display: inline-flex; align-items: center; gap: 7px; flex: 1 1 200px; color: var(--muted); font-size: .92rem; }
.found .status-mark { width: 17px; height: 17px; color: var(--text); }
.found-problem { color: var(--text); }
.found-problem .status-mark { stroke: var(--warn-mark); }
.check-form { display: grid; gap: 4px; margin-top: 10px; }
.ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); }
.ask legend { float: left; flex: 1 1 220px; padding: 0; font-weight: 600; }
.ask label { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.ask input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent-solid); }
.ask input:not([type="radio"]) { flex: 1 1 200px; }
.check-form .primary { max-width: 320px; }
.all-ok { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 18px; }
.all-ok .primary { width: auto; margin: 0; padding: 11px 26px; background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.check-history li { padding: 7px 0; color: var(--muted); font-size: .9rem; border-bottom: 1px solid var(--line); }
.person-name { flex: 1 1 180px; font-size: 1.08rem; font-weight: 700; }
.person .seat-rank { flex: 0 1 12em; }
.person-where { flex: 1 1 180px; color: var(--muted); font-size: .9rem; }
.person-off .person-name { font-weight: 400; color: var(--muted); }
.board-sum-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 420px; }

/* ---------- the county map, and building pre-plans ---------- */
.map-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; margin-top: 22px; }
.map-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.map-search input { width: 100%; min-height: 42px; padding: 8px 12px; background: var(--field); color: var(--text); border: 1px solid var(--field-line); border-radius: 6px; font: inherit; }
.map-found { position: absolute; z-index: 3; left: 0; right: 0; margin: 4px 0 0; padding: 0; list-style: none; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.map-found:empty { display: none; }
.map-found .hint { padding: 8px 12px; }
.m-hit { display: block; width: 100%; padding: 9px 12px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.m-hit:hover, .m-hit:focus-visible { background: var(--card-2); }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.map-tools .small[aria-pressed="true"] { background: var(--accent-solid); color: var(--on-accent); }
.map-status { min-height: 1.5em; margin-top: 8px; color: var(--muted); font-size: .9rem; }
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 0 22px; }
.map { display: block; width: 100%; height: min(70vh, 720px); min-height: 380px; background: var(--card-2); border-top: 3px solid var(--accent-solid); border-bottom: 1px solid var(--line); cursor: grab; touch-action: none; user-select: none; }
.map:active { cursor: grabbing; }
.m-county { fill: var(--card); stroke: var(--muted); stroke-width: 2; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; }
.m-road { fill: none; stroke: var(--field-line); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.m-r2 { stroke-width: 1; opacity: .75; }
.m-r1 { stroke: var(--text); stroke-width: 1.8; }
.m-r0 { stroke: var(--accent-solid); stroke-width: 2.6; }
.m-bld { fill: color-mix(in srgb, var(--text) 16%, transparent); stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.m-picked { fill: color-mix(in srgb, var(--accent-solid) 45%, transparent); stroke: var(--accent-solid); stroke-width: 3; }
.m-place { fill: var(--text); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: var(--card); pointer-events: none; }
.m-plan, .m-point { cursor: pointer; }
.m-plan path { fill: var(--accent-solid); stroke: var(--on-accent); }
.m-point circle { fill: var(--card); stroke: var(--text); }
.m-plan text, .m-point text { font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.m-plan text { fill: var(--on-accent); }
.m-point text { fill: var(--text); }
.m-new { fill: none; stroke: var(--accent-solid); stroke-linecap: round; }
.map-panel { padding: 4px 0 0 18px; border-left: 3px solid var(--accent-solid); min-width: 0; }
.map-panel h2 { font-size: .8rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.m-list { max-height: 220px; overflow: auto; margin: 0 0 12px; padding: 0; list-style: none; }
.m-list li { padding: 6px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.m-strong { font-weight: 700; }
.m-form { display: grid; gap: 4px; margin-top: 12px; }
.m-form label { margin-top: 8px; font-size: .86rem; font-weight: 600; }
.m-form input, .m-form select { width: 100%; min-height: 40px; padding: 7px 10px; background: var(--field); color: var(--text); border: 1px solid var(--field-line); border-radius: 6px; font: inherit; }
.m-form .small { margin-top: 12px; justify-self: start; }
.map-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; color: var(--muted); font-size: .86rem; }
.key-plan, .key-point { display: inline-grid; place-items: center; width: 22px; height: 22px; font-size: .7rem; font-weight: 800; }
.key-plan { background: var(--accent-solid); color: var(--on-accent); transform: rotate(45deg) scale(.8); }
.key-point { margin-left: 14px; border: 2px solid var(--text); border-radius: 50%; color: var(--text); }
/* ---------- admin portal ---------- */
.build-form > details { flex-basis: 100%; }
.admin-tabs { display: flex; gap: 6px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.admin-tabs a { padding: 8px 14px; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; border-bottom: 3px solid transparent; }
.admin-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent-solid); }
.perm-list, .role-list { flex-basis: 100%; display: grid; gap: 2px; margin: 12px 0 0; padding: 0; border: 0; }
.perm-list legend, .role-list legend { padding: 0; margin-bottom: 6px; font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.build-form label.perm { display: flex; align-items: flex-start; gap: 12px; flex-basis: 100%; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 400; cursor: pointer; }
.perm input { flex: none; width: 20px; height: 20px; min-height: 0; margin-top: 2px; accent-color: var(--accent-solid); }
.perm > span { display: grid; }
.perm-what { color: var(--muted); font-size: .86rem; }
.perm-admin { border-left: 3px solid var(--accent-solid); padding-left: 12px; }
.invite-link { font-size: .92rem; text-align: left; }
.map-load { margin-top: 0; align-self: center; }
.hint-list { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: .9rem; }
.hint-list li { margin: 4px 0; }
.file-form { margin-top: 18px; }
.file-form input[type="file"] { padding: 8px; border-style: dashed; }
.saved { display: inline-block; margin-top: 16px; padding: 4px 12px; border-left: 3px solid var(--text); font-weight: 700; }
.plan { margin: 0; }
.plan-row { display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr); gap: 4px 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.plan dt { color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.plan dd { margin: 0; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.plan-empty dd { font-weight: 400; font-style: italic; color: var(--muted); }
.plan-form { display: grid; gap: 4px; max-width: 640px; }
.plan-form label { margin-top: 12px; font-size: .9rem; font-weight: 600; }
.plan-form input, .plan-form textarea { width: 100%; padding: 9px 11px; min-height: 44px; background: var(--field); color: var(--text); border: 1px solid var(--field-line); border-radius: 6px; font: inherit; }
.plan-form .primary { max-width: 320px; }
@media (max-width: 760px) {
  .map-wrap { grid-template-columns: minmax(0, 1fr); }
  .map-panel { margin-top: 16px; }
  .plan-row { grid-template-columns: minmax(0, 1fr); }
}

.add-link { display: inline-block; margin-top: 12px; padding: 7px 14px; border: 2px solid var(--accent-solid); color: var(--text); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); }
.add-link:hover { background: var(--accent-solid); color: var(--on-accent); }
.add-form { display: grid; gap: 4px; max-width: 440px; margin-top: 26px; }
.add-form label { margin-top: 12px; font-size: .9rem; font-weight: 600; }
.add-form input { width: 100%; padding: 9px 11px; min-height: 44px; background: var(--field); color: var(--text); border: 1px solid var(--field-line); border-radius: 6px; font: inherit; }
.add-seats { margin: 18px 0 0; padding: 0; border: 0; display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 8px 14px; align-items: center; }
.add-seats legend { padding: 0; margin-bottom: 6px; font-size: .8rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.add-seats label { margin: 0; font-weight: 400; }
.add-seats .hint { grid-column: 1 / -1; }
.add-cancel { margin-top: 12px; text-align: center; }

@media (max-width: 640px) {
  .board-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .board-sum span:nth-child(odd) { border-left: 0; }
  .rig { grid-template-columns: minmax(0, 1fr); padding-left: 20px; }
  .seats { grid-column: 1; grid-row: auto; margin-top: 14px; }
  .seat { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .status-on_call .status-mark { animation: none; } }

/* ---------- sharing ---------- */
.share-state { margin-top: 26px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.share-state h2 { font-size: 1.2rem; }
.share-state p { color: var(--muted); }
.share-how { margin-top: 18px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.share-how h2 { font-size: 1.05rem; }
.share-how ul { margin: 8px 0 0; padding-left: 20px; }
.share-how li { margin: 4px 0; }
.rules { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: .94rem; }
.rules th, .rules td { padding: 8px 10px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.rules th { color: var(--muted); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.rule-off { display: inline-block; padding: 1px 8px; border: 1px solid var(--field-line); border-radius: 999px; font-weight: 600; }

@media (max-width: 560px) {
  .top-right { width: 100%; margin-left: 0; justify-content: flex-end; }
  .top-user { display: none; }
  .login-card { padding: 22px; }
}

/* ---------- PostWatchHQ control tower (ADR-0031): the wordmark and the standing chips ---------- */
.tower-head { margin: 0 0 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tower-home { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; text-decoration: none; }
.tower-mark { color: var(--text); font-size: 1.35rem; font-weight: 800; letter-spacing: .12em; }
.tower-mark b { color: var(--accent); font-weight: 800; }
.tower-tag { padding: 2px 9px; background: var(--accent-solid); color: var(--on-accent); font-size: .68rem; font-weight: 800; letter-spacing: .2em; }
.stands { flex: 2 1 320px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.stand-app { color: var(--muted); font-size: .86rem; }
.stand { display: inline-block; padding: 1px 9px; border: 1px solid var(--field-line); font-size: .8rem; font-weight: 700; color: var(--text); }
.stand-in { border-color: var(--text); border-left-width: 4px; }
.stand-waiting { border-style: dashed; }
.stand-none { border-color: transparent; padding-left: 0; font-weight: 400; color: var(--muted); }
.stand-off, .stand-unknown { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.build-form select, .crew-set select { min-height: 40px; padding: 7px 10px; background: var(--field); color: var(--text); border: 1px solid var(--field-line); border-radius: 6px; font: inherit; }
.first-time { margin: 0 0 18px; padding: 12px 14px; border-left: 4px solid var(--accent-solid); background: var(--card-2); font-size: .92rem; }
.first-time p { margin: 0 0 6px; }
.first-time ol { margin: 4px 0 8px; padding-left: 20px; }
.first-time li { margin: 3px 0; }

/* The QR code on the authenticator step: always black on white, with room round it, whatever the page colours. */
.qr { width: min(240px, 100%); margin: 12px auto; padding: 6px; background: #ffffff; border: 1px solid var(--line); border-radius: 6px; }
.qr-svg { display: block; width: 100%; height: auto; }
