/* Spector Tac command dashboard. Dark only, as on the phones: olive-black surfaces, olive drab for actions,
   amber only for warnings, red for errors and EMERGENCY. */

:root {
    color-scheme: dark;
    --bg: #0D0F0C;
    --surface: #141712;
    --surface-2: #191C17;
    --surface-3: #1F231C;
    --surface-4: #262A22;
    --outline: #5A6152;
    --outline-soft: #30342B;
    --text: #E6E8E1;
    --text-dim: #A9AE9F;
    --accent: #8F9A5E;
    --accent-soft: #363C21;
    --od: #4B5320;
    --od-hover: #5A6427;
    --on-od: #ECEBD5;
    --amber: #E0A43A;
    --amber-soft: #3A2C10;
    --red: #E5584F;
    --red-soft: #4A1512;
    --ok: #9DB36B;
    --cond: "Roboto Condensed", "Arial Narrow", "Bahnschrift SemiCondensed", sans-serif;
    --body: "Roboto", "Segoe UI", system-ui, sans-serif;
    --mono: "Roboto Mono", Consolas, monospace;
    --radius: 4px;
    --radius-lg: 6px;
    --side-width: clamp(480px, 36vw, 620px);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.4 var(--body);
}

body { overflow: hidden; }

#app { height: 100%; }

[hidden] { display: none !important; }

h1, h2, h3, legend, .field-label, .btn, .chip, .tab, .menu-item, .card-title, .panel-title, .sub-title,
.k, th, .brand, .brand-sub, .seg-item span, .check-strong, .sb-team, .sb-me, .sb-link, .alert-line strong {
    font-family: var(--cond);
    letter-spacing: 0.06em;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.muted { color: var(--text-dim); }
.mono { font-family: var(--mono); font-size: 13px; }
.pre { white-space: pre-wrap; }
.empty { color: var(--text-dim); padding: 8px 0; }

/* Buttons */
.btn {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    background: var(--surface-3);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-4); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-filled { background: var(--od); border-color: var(--od); color: var(--on-od); }
.btn-filled:hover:not(:disabled) { background: var(--od-hover); }
.btn-danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); }
.btn-text { border-color: transparent; background: transparent; color: var(--accent); }
.btn-text:hover:not(:disabled) { background: var(--surface-3); }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-large { min-height: 48px; padding: 0 22px; font-size: 16px; }
.btn-map { background: rgba(20, 23, 18, 0.92); }

/* Chips */
.chip {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 7px;
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text);
}
.chip-ok { border-color: var(--ok); color: var(--ok); }
.chip-accent { border-color: var(--accent); color: var(--accent); }
.chip-warn { border-color: var(--amber); color: var(--amber); }
.chip-bad { border-color: var(--red); color: var(--red); }
.chip-muted { border-color: var(--outline-soft); color: var(--text-dim); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.form-inline { flex-direction: row; align-items: flex-end; gap: 8px; }
.form-inline .field { flex: 1; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.field-hint, .check-hint { font-size: 13px; color: var(--text-dim); }
input[type=text], input[type=password], input[type=number], select, textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 34px; cursor: pointer; }
.check-strong { font-weight: 700; font-size: 14px; }
.check-strong .check-hint { flex-basis: 100%; padding-left: 26px; font-family: var(--body); letter-spacing: 0; font-weight: 400; }
.form-error { margin: 0; color: var(--red); min-height: 0; }
.form-error:empty { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.form-actions-start { justify-content: flex-start; }
.setup-status { margin: 0; font-size: 13px; color: var(--text-dim); }
.setup-status:empty { display: none; }
.setup-status-ok { color: var(--ok); }
.setup-status-bad { color: var(--red); }
fieldset.pick-group {
    margin: 0;
    padding: 8px 12px 10px;
    border: 1px solid var(--outline-soft);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
fieldset.pick-group:disabled { opacity: 0.6; }
legend { padding: 0 4px; font-size: 13px; font-weight: 700; color: var(--accent); }
.warn-box {
    margin: 0;
    padding: 10px 12px;
    border-left: 3px solid var(--amber);
    background: var(--amber-soft);
    border-radius: var(--radius);
}
.warn-box-bad { border-left-color: var(--red); background: var(--red-soft); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; flex: none; border: 1px solid rgba(0, 0, 0, 0.5); }
.swatch-diamond { transform: rotate(45deg) scale(0.8); }

/* Segmented control */
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--outline); border-radius: var(--radius); overflow: hidden; }
.seg-item { position: relative; cursor: pointer; }
.seg-item input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.seg-item span {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
    background: var(--surface);
    border-right: 1px solid var(--outline-soft);
}
.seg-item:last-child span { border-right: none; }
.seg-item input:checked + span { background: var(--od); color: var(--on-od); }
.seg-item input:disabled + span { opacity: 0.4; cursor: default; }
.seg-item input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Start screen */
.start { height: 100%; overflow: auto; }
.start-inner { max-width: 1400px; margin: 0 auto; padding: 24px 24px 32px; }
.start-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.brand-logo { width: 56px; height: 56px; }
.lock-logo { width: 112px; height: 112px; margin: 0 auto; }
.brand { margin: 0; font-size: 30px; font-weight: 700; color: var(--on-od); }
.brand-sub { font-size: 16px; font-weight: 700; color: var(--accent); }
.start-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--outline-soft); border-radius: var(--radius-lg); padding: 16px 18px 18px; }
.card-title { margin: 0 0 14px; font-size: 19px; color: var(--on-od); }
.start-foot { margin-top: 20px; color: var(--text-dim); font-size: 13px; max-width: 900px; }
.start-fatal { margin-bottom: 16px; padding: 12px; background: var(--red-soft); border-radius: var(--radius); }
.kept-list { display: flex; flex-direction: column; gap: 6px; }
.kept-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kept-name { font-weight: 700; }

/* Main screen */
.main { height: 100%; display: flex; flex-direction: column; }
.statusbar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 56px;
    padding: 6px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--outline-soft);
}
.sb-brand { font-family: var(--cond); font-weight: 700; letter-spacing: 0.08em; color: var(--accent); }
.sb-info { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.sb-team { font-size: 18px; font-weight: 700; color: var(--on-od); }
.sb-me { color: var(--text-dim); font-size: 14px; }
.sb-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.sb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim); }
.sb-link-ok .sb-dot { background: var(--ok); }
.sb-link-busy { color: var(--amber); }
.sb-link-busy .sb-dot { background: var(--amber); }
.sb-link-bad { color: var(--red); }
.sb-link-bad .sb-dot { background: var(--red); }
.sb-detail { color: var(--text-dim); font-size: 13px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-detail-bad { color: var(--red); white-space: normal; }
.sb-actions { display: flex; gap: 8px; flex: none; }

/* Team voice */
.voicebar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 60px;
    padding: 6px 12px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--outline-soft);
}
.talk-btn { min-width: 128px; touch-action: none; user-select: none; -webkit-user-select: none; }
.talk-btn.talk-on, .talk-btn.talk-on:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: #fff; }
.voicebar select.voice-target { width: auto; max-width: 240px; }
.voice-status { flex: 1; min-width: 220px; margin: 0; font-size: 14px; color: var(--text-dim); }
.voice-status-on { color: var(--red); font-family: var(--cond); font-weight: 700; font-size: 16px; letter-spacing: 0.06em; }
.voice-status-on .voice-status-warn { font-family: var(--body); font-size: 14px; letter-spacing: 0; }
.voice-status-warn { color: var(--amber); }
.voice-status-bad { color: var(--red); }
.talker { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 10px; border: 1px solid var(--ok); border-left-width: 6px; border-radius: var(--radius-lg); background: var(--surface-3); }
.talker-bad { border-color: var(--red); background: var(--red-soft); }
.talker-chip:empty { display: none; }
.talker-line { font-family: var(--cond); font-weight: 700; font-size: 16px; letter-spacing: 0.06em; color: var(--on-od); }
.sound-prompt { display: flex; align-items: center; gap: 8px; color: var(--amber); font-size: 14px; }
.voice-note { margin: 0; color: var(--amber); font-size: 14px; }
.voice-switch { flex: none; }

.workspace { flex: 1; display: flex; min-height: 0; }
.map-col { flex: 1; position: relative; min-width: 0; }
.map-wrap { position: absolute; inset: 0; }
.map-canvas { position: absolute; inset: 0; }
.map-failed { padding: 40px; max-width: 520px; }
.side {
    flex: none;
    width: var(--side-width);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-left: 1px solid var(--outline-soft);
    min-height: 0;
}

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--outline-soft); flex: none; }
.tab {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 0 6px;
    letter-spacing: 0.04em;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab[aria-selected=true] { color: var(--on-od); border-bottom-color: var(--accent); }
.tab-badge { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; font-size: 12px; line-height: 20px; text-align: center; color: #111; }
.tab-badge-warn { background: var(--amber); }
.tab-badge-accent { background: var(--accent); }

.panel-body { flex: 1; overflow-y: auto; padding: 12px 14px 20px; min-height: 0; }
.panel-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-title { margin: 0; flex: 1; font-size: 18px; color: var(--on-od); }
.panel-count { flex: 1; font-family: var(--cond); font-weight: 700; letter-spacing: 0.06em; color: var(--accent); }
.sub-title { margin: 16px 0 6px; font-size: 14px; color: var(--accent); }
.subsection { margin-top: 12px; }
.plain-list { margin: 0; padding-left: 18px; color: var(--text-dim); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Orders board */
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order { border: 1px solid var(--outline-soft); border-left: 4px solid transparent; border-radius: var(--radius-lg); background: var(--surface-2); }
.order-ended { opacity: 0.7; }
.order-unverified .order-title { color: var(--text-dim); }
.order-head { display: block; width: 100%; padding: 10px 12px; border: none; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.order-head:hover { background: var(--surface-3); }
.order-line1, .order-line2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-line2 { margin-top: 6px; justify-content: space-between; }
.order-title { font-weight: 700; font-size: 16px; margin-right: auto; }
.order-to { color: var(--text-dim); font-size: 13px; }
.order-detail { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.order-text { margin: 0 0 4px; white-space: pre-wrap; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.kv { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.kv .k { flex: 0 0 110px; font-size: 12px; font-weight: 700; color: var(--accent); }
.kv .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kv-block { flex-direction: column; gap: 2px; }
.kv-block .k { flex: none; }
.kv-block .v { margin: 0; }
.rcp-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rcp { padding: 6px 8px; border-left: 3px solid var(--outline); background: var(--surface); border-radius: var(--radius); }
.rcp-overdue { background: var(--amber-soft); }
.rcp-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rcp-name { font-weight: 700; }
.rcp-answer { margin-left: auto; }
.rcp-facts { font-size: 13px; color: var(--text-dim); }
.rcp-overdue .rcp-facts { color: var(--amber); }
.rcp-note { font-size: 13px; font-style: italic; }

/* Composer */
.recipients { display: flex; flex-direction: column; gap: 6px; }
.point-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.point-coords { font-family: var(--mono); font-size: 13px; }

/* Incident, groups, team */
.incident { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.group-list, .member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.group, .member { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--outline-soft); border-radius: var(--radius-lg); }
.group-head, .member-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-name, .member-name { font-weight: 700; font-size: 16px; }
.group-head .chips, .member-head .chips { margin-left: auto; }
.group-members, .member-facts { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.member-gone { opacity: 0.6; }
.colour-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.colour-item { display: flex; align-items: center; gap: 6px; min-height: 34px; font-family: var(--cond); font-weight: 700; font-size: 13px; cursor: pointer; }
.team-top { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--outline-soft); }
.settings { display: flex; flex-direction: column; gap: 10px; }
.setting { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

/* Drones */
.feed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feed { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--outline-soft); border-radius: var(--radius-lg); }
.feed-ended { opacity: 0.7; }
.feed-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feed-name { font-weight: 700; font-size: 16px; }
.feed-head .chips { margin-left: auto; }
.feed-facts { font-size: 13px; color: var(--text-dim); margin-top: 4px; overflow-wrap: anywhere; }
.feed-note { margin: 6px 0 0; font-size: 13px; color: var(--amber); }
.drone-watch { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; padding: 10px; background: var(--surface-2); border: 1px solid var(--outline); border-radius: var(--radius-lg); }
.watch-head { display: flex; align-items: center; gap: 8px; }
.watch-title { flex: 1; min-width: 0; margin: 0; font-size: 17px; color: var(--on-od); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.watch-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.watch-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.6); color: var(--text-dim); font: 700 22px/1 var(--cond); letter-spacing: 0.1em; }
.watch-detail { margin: 0; font-size: 13px; color: var(--text-dim); overflow-wrap: anywhere; }
.watch-detail:empty { display: none; }
.watch-notice { margin: 0; padding: 8px 10px; border-left: 3px solid var(--amber); background: var(--amber-soft); border-radius: var(--radius); font-size: 13px; }

/* Chat */
.panel-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-lg); max-width: 92%; }
.msg-mine { align-self: flex-end; background: var(--accent-soft); }
.msg-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.msg-from { font-family: var(--cond); font-weight: 700; letter-spacing: 0.04em; color: var(--accent); }
.msg-time { color: var(--text-dim); }
.msg-text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-photo { display: block; margin-top: 6px; padding: 0; border: 1px solid var(--outline-soft); border-radius: var(--radius); background: none; cursor: zoom-in; }
.msg-photo img { display: block; max-width: 100%; max-height: 220px; border-radius: var(--radius); }
.msg-wpt { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.chat-send { flex: none; display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px 12px; border-top: 1px solid var(--outline-soft); }
.chat-send .chat-input { flex: 1; }
.panel-chat > .form-error { padding: 0 14px; }
.msg-emergency { border-left: 4px solid var(--red); }
.msg-voice-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.msg-voice-label { font-family: var(--cond); font-weight: 700; letter-spacing: 0.04em; }

/* Audit */
.audit { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit th { text-align: left; font-size: 12px; color: var(--accent); padding: 4px 6px; border-bottom: 1px solid var(--outline); position: sticky; top: -12px; background: var(--surface); }
.audit td { padding: 4px 6px; border-bottom: 1px solid var(--outline-soft); vertical-align: top; overflow-wrap: anywhere; }

/* Alerts */
.alerts { position: absolute; z-index: 5; top: 8px; left: 50%; transform: translateX(-50%); width: min(720px, calc(100% - 140px)); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.alert {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--outline);
    background: rgba(20, 23, 18, 0.97);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}
.alert-bad { border-color: var(--red); border-left: 6px solid var(--red); }
.alert-warn { border-color: var(--amber); border-left: 6px solid var(--amber); }
.alert-body { flex: 1; min-width: 0; }
.alert-time { margin-left: 8px; color: var(--text-dim); font-size: 13px; }
.alert-text { color: var(--text-dim); font-size: 14px; overflow-wrap: anywhere; }

/* Map */
.map-tools { position: absolute; z-index: 3; top: 10px; left: 10px; display: flex; gap: 8px; align-items: flex-start; }
.map-tools .seg { background: rgba(20, 23, 18, 0.92); }
.map-banner {
    position: absolute;
    z-index: 4;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(20, 23, 18, 0.95);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    max-width: calc(100% - 40px);
}
.picking .maplibregl-canvas { cursor: crosshair; }
.map-crosshair { display: none; position: absolute; z-index: 2; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; pointer-events: none; }
.map-crosshair::before, .map-crosshair::after { content: ""; position: absolute; background: var(--on-od); box-shadow: 0 0 0 1px #000; }
.map-crosshair::before { left: 13px; top: 0; width: 2px; height: 28px; }
.map-crosshair::after { top: 13px; left: 0; height: 2px; width: 28px; }
.map-wrap:has(.maplibregl-canvas:focus-visible) .map-crosshair { display: block; }
.map-menu {
    position: absolute;
    z-index: 6;
    min-width: 220px;
    padding: 4px 0;
    background: var(--surface-2);
    border: 1px solid var(--outline);
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}
.menu-head { padding: 6px 12px; font-family: var(--mono); font-size: 12px; color: var(--text-dim); border-bottom: 1px solid var(--outline-soft); }
.menu-item { display: block; width: 100%; min-height: 40px; padding: 0 14px; border: none; background: none; color: var(--text); text-align: left; font-size: 14px; font-weight: 700; cursor: pointer; }
.menu-item:hover, .menu-item:focus { background: var(--od); color: var(--on-od); outline: none; }

/* Map markers: the element is the dot, so MapLibre centres the dot on the position; the label hangs beside it. */
.mk { position: relative; width: 18px; height: 18px; padding: 0; border: none; background: none; cursor: pointer; }
.mk-label {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(13, 15, 12, 0.85);
    color: var(--text);
    font: 700 12px/1.3 var(--cond);
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.mk-dot { position: absolute; inset: 1px; border-radius: 50%; border: 2px solid #0D0F0C; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8); }
.mk-stale .mk-dot { opacity: 0.8; }
.mk-stale .mk-label { color: var(--text-dim); }
.mk-diamond { position: absolute; inset: 3px; transform: rotate(45deg); border: 2px solid #0D0F0C; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7); }
.mk-pending .mk-diamond { opacity: 0.6; }
.mk-order { width: 26px; height: 26px; }
.mk-order .mk-label { left: 30px; border: 1px solid currentColor; }
.mk-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--accent); box-shadow: 0 0 0 2px rgba(13, 15, 12, 0.8), inset 0 0 0 2px rgba(13, 15, 12, 0.8); }
.mk-ring::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--on-od); }
.mk-unverified { opacity: 0.6; }
.mk-draft { width: 26px; height: 26px; pointer-events: none; }
.mk-cross { position: absolute; inset: 0; border: 2px dashed var(--on-od); border-radius: 50%; }
.mk-draft .mk-label { left: 30px; color: var(--on-od); }
/* A drone: a light square crossed like a quadcopter, apart from the members' dots and the waypoints' diamonds. Its
   dashed label says the position was placed by hand. */
.mk-drone { width: 24px; height: 24px; }
.mk-drone .mk-label { left: 30px; border: 1px dashed var(--text-dim); }
.mk-drone-body {
    position: absolute;
    inset: 3px;
    border: 2px solid #0D0F0C;
    border-radius: 3px;
    background:
        linear-gradient(45deg, transparent 40%, #0D0F0C 40% 60%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, #0D0F0C 40% 60%, transparent 60%),
        var(--on-od);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}
.mk-pending .mk-drone-body { opacity: 0.6; }
.mk-heading { position: absolute; inset: -10px; pointer-events: none; }
.mk-heading::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    margin-left: -6px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 9px solid var(--on-od);
    filter: drop-shadow(0 0 1px #000);
}
.mk-talking::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 3px solid var(--ok);
    pointer-events: none;
    animation: mk-talking 1.2s ease-out infinite;
}
.mk-talking-bad::before { border-color: var(--red); }
@keyframes mk-talking {
    from { transform: scale(0.8); opacity: 1; }
    to { transform: scale(1.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .mk-talking::before { animation: none; }
}

/* MapLibre's own controls and popups, in the dashboard's colours */
.maplibregl-ctrl-group { background: var(--surface-2) !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--outline-soft) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(0.9); }
.maplibregl-ctrl-scale { background: rgba(20, 23, 18, 0.8) !important; color: var(--text) !important; border-color: var(--text) !important; }
.maplibregl-ctrl-attrib { background: rgba(20, 23, 18, 0.8) !important; color: var(--text-dim) !important; }
.maplibregl-ctrl-attrib a { color: var(--text-dim) !important; }
.tac-popup .maplibregl-popup-content { background: var(--surface-2); color: var(--text); border: 1px solid var(--outline); border-radius: var(--radius-lg); padding: 12px 14px; }
.tac-popup .maplibregl-popup-tip { border-top-color: var(--outline) !important; border-bottom-color: var(--outline) !important; }
.tac-popup .maplibregl-popup-close-button { color: var(--text-dim); font-size: 20px; width: 32px; height: 32px; }
.popup { display: flex; flex-direction: column; gap: 6px; padding-right: 18px; }
.popup-title { font-family: var(--cond); font-weight: 700; font-size: 17px; letter-spacing: 0.06em; }
.popup-facts { font-size: 13px; color: var(--text-dim); }
.popup-note { margin: 0; font-size: 13px; white-space: pre-wrap; }

/* Dialogs */
.dlg {
    max-width: min(560px, calc(100vw - 32px));
    padding: 18px 20px;
    border: 1px solid var(--outline);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    color: var(--text);
}
.dlg::backdrop { background: rgba(0, 0, 0, 0.7); }
.dlg-title { margin: 0 0 10px; font-size: 20px; color: var(--on-od); }
.dlg-body { margin: 0 0 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.dlg-photo { max-width: calc(100vw - 32px); }
.photo-large { display: block; max-width: calc(100vw - 80px); max-height: calc(100vh - 160px); }
.dlg-invite { width: 520px; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 12px; }
.qr { display: block; image-rendering: pixelated; }
.qr-countdown { margin: 0; font-family: var(--cond); font-weight: 700; letter-spacing: 0.06em; color: var(--amber); }

/* Lock */
.lock { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.lock-inner { width: min(360px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.lock-title { margin: 0; font-size: 20px; color: var(--accent); }
.lock-alerts { margin: 0; color: var(--amber); font-family: var(--cond); font-weight: 700; letter-spacing: 0.06em; min-height: 1.4em; }
.lock-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
#app.is-locked { visibility: hidden; }

/* Toast */
.toast {
    position: fixed;
    z-index: 50;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    max-width: min(640px, calc(100vw - 32px));
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    background: var(--surface-4);
    border: 1px solid var(--outline);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.toast-show { opacity: 1; transform: translate(-50%, 0); }
.toast-bad { border-color: var(--red); color: var(--text); }
.noscript { padding: 24px; }
/* The hosted release's version (deploy.py), under the lock screen and out of the way of every control. */
.release { position: fixed; left: 8px; bottom: 4px; z-index: 40; margin: 0; font: 11px var(--mono); color: var(--text-dim); opacity: 0.75; pointer-events: none; }

@media (max-width: 1100px) {
    :root { --side-width: 420px; }
    .sb-detail { display: none; }
}
