/* Base elements and shared building blocks from the boards (.btn, .chip, .card, .seg, .input, .sw, .tbl, .kbd, .veil). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--text-body)/var(--leading) var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
a:hover { color: var(--ink); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: var(--focus-ring); outline-offset: 2px; box-shadow: var(--focus-halo); }
.card :focus-visible, .tbl :focus-visible, [class*="__card"] :focus-visible, [class$="-list"] > * :focus-visible { outline-offset: -3px; }
.app-header :focus-visible, .mo-player :focus-visible, .ask-launcher:focus-visible, .toast :focus-visible, .btn-onnavy:focus-visible, .btn-dark:focus-visible, .veil :focus-visible { box-shadow: none; outline-color: var(--highlight); }
.gate-media { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
.disp { font-family: var(--font-display); letter-spacing: -.025em; }
h1.disp { font-size: 26px; font-weight: 670; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.eyebrow { color: var(--eyebrow); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 720; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--highlight); color: var(--action-ink); padding: 8px 14px; border-radius: var(--radius-control); font-weight: 650; text-decoration: none; }
.skip-link:focus { top: 12px; }
.noscript { padding: 24px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 13px; border-radius: var(--radius-control); border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); font: 650 13px/1.4 var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--paper-tint); color: var(--ink); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--highlight); border-color: var(--highlight); color: var(--action-ink); }
.btn-primary:hover { background: var(--highlight-hover); border-color: var(--highlight-hover); color: var(--action-ink); }
.btn-onnavy { background: transparent; border-color: var(--navy-line); color: var(--on-navy); }
.btn-onnavy:hover { background: var(--navy-2); color: #fff; }
.btn-dark { background: var(--navy-2); border-color: var(--navy-line); color: var(--on-navy); }
.btn-dark:hover { background: var(--navy-3); color: #fff; }
.btn-danger { color: var(--bad-ink); border-color: var(--bad-line); }
.btn-danger-solid { background: var(--bad-ink); border-color: var(--bad-ink); color: #fff; }
.btn-danger-solid:hover { background: #7d2121; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-cur { background: var(--navy-2); border-color: var(--highlight); color: #fff; }
.btn-sm { min-height: 30px; padding: 2px 10px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-record--active { background: var(--bad-ink); border-color: var(--bad-ink); color: #fff; }
.btn-record--active:hover { background: #7d2121; color: #fff; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: var(--radius-chip); font-size: var(--text-xs); font-weight: 650; line-height: 18px; white-space: nowrap; background: var(--paper-tint); color: var(--ink-2); border: 0; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip-ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip-warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip-bad { background: var(--bad-bg); color: var(--bad-ink); }
.chip-info { background: var(--info-bg); color: var(--info-ink); }
.chip-face { background: var(--face-bg); color: var(--face-ink); }
.chip-neutral { background: var(--paper-tint); color: var(--ink-2); }
.chip-onnavy { background: var(--navy-2); color: var(--on-navy); padding: 4px 10px; }

/* Cards, fields, switches, tables */
.card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-card); box-shadow: var(--shadow-card); min-width: 0; }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); flex-wrap: wrap; }
.card-hd h2 { font: 650 16px/1.2 var(--font-display); letter-spacing: -.02em; }
.input { min-height: 38px; padding: 7px 10px; border: 1px solid var(--control-edge); border-radius: var(--radius-control); background: var(--card); font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--text-xs); font-weight: 650; color: var(--ink-2); }
.field--inline { flex-direction: row; align-items: center; gap: 10px; }
.sw { appearance: none; width: 34px; height: 20px; border-radius: var(--radius-chip); background: var(--control-edge); position: relative; cursor: pointer; flex: none; margin: 0; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.sw:checked { background: var(--ok-ink); }
.sw:checked::after { left: 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--text-small); }
.tbl th { font-weight: 650; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-strong); color: var(--ink-2); font-size: var(--text-xs); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 4px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: #fff; color: var(--ink-2); font: 600 11px/1 var(--font-mono); }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: var(--radius-seg); background: var(--paper-tint); border: 1px solid var(--hairline); gap: 2px; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: var(--radius-control); font-weight: 650; font-size: var(--text-small); color: var(--ink-2); text-decoration: none; border: 0; background: transparent; cursor: pointer; }
.seg a[aria-current="true"], .seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* Footage slots and the veil */
[data-gate-slot] { position: relative; overflow: hidden; background: var(--veil-a); }
.gate-media { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.veil { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 10px 12px; background: repeating-linear-gradient(135deg, var(--veil-a) 0 14px, var(--veil-b) 14px 28px); color: var(--on-navy-soft); font-size: var(--text-small); }
.veil__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.veil__label { font-weight: 650; font-size: 14px; color: var(--on-navy); text-shadow: 0 1px 2px #0008; }
.veil__centre { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; flex: 1; text-align: center; }
.veil__meta { min-height: 16px; color: var(--on-navy-soft); }
.veil[data-tone="error"] .veil__icon { color: var(--highlight); }
.veil--compact { padding: 6px 8px; }
.veil--compact .veil__message { font-size: var(--text-xs); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
