:root {
  --night: #071422;
  --ink: #e7f2f8;
  --muted: #93a8ba;
  --neon: #5ec8ff;
  --paper: #f4efe6;
  --paper-ink: #1c140c;
  --paper-muted: #6d6256;
  --line: #d9d0c2;
  --danger: #c44536;
  --ok: #2f7d4a;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-sans: "Outfit", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--night);
  color: var(--ink);
}

button, [role="tab"], .btn { cursor: pointer; }

button:disabled { cursor: not-allowed; }

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

h1, h2 { text-wrap: balance; }

.scene {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: var(--night);
}

.scene-still,
.scene video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shade {
  position: absolute;
  inset: 0;
  background: rgb(7 20 34 / 40%);
  pointer-events: none;
}

.top, .dock { position: relative; z-index: 1; }

.top {
  padding: 12px 16px;
  background: rgb(7 20 34 / 85%);
  border-bottom: 1px solid rgb(94 200 255 / 40%);
  backdrop-filter: blur(8px);
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.03em;
  color: var(--neon);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.briefing {
  max-width: 46rem;
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
}

.dock {
  display: flex;
  flex: 1;
  justify-content: center;
  min-height: 0;
  overflow: auto;
  padding: 16px 16px 40px;
}

.card {
  width: min(100%, 28rem);
  height: fit-content;
  padding: 20px;
  border-radius: 16px;
  background: var(--paper);
  color: var(--paper-ink);
  box-shadow: 0 24px 50px rgb(0 0 0 / 35%);
}

.kicker {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 0.95;
}

.copy, .hint, .slip p {
  font-size: 0.95rem;
  line-height: 1.5;
}

.copy { margin: 16px 0; }

.hint, .quiet { color: var(--paper-muted); }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 16px;
  padding: 4px;
  border-radius: 10px;
  background: var(--line);
}

.tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  color: var(--paper-muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.tabs a[aria-selected="true"] {
  background: var(--paper);
  color: var(--paper-ink);
  font-weight: 600;
}

.stack, .slip form { display: grid; gap: 12px; margin-top: 16px; }

label {
  display: grid;
  gap: 4px;
  font-size: 0.92rem;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--paper-ink);
  font: inherit;
  font-weight: 400;
}

.secret { display: grid; gap: 4px; }

.secret-row { display: flex; }

.secret-row input {
  min-width: 0;
  flex: 1;
  border-radius: 10px 0 0 10px;
}

h1, h2, .people span, .warrant dd { overflow-wrap: anywhere; }

@media (max-width: 699px) {
  .card { padding: 16px; }

  h2 { font-size: 2rem; }

  .dock {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .admin-page {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filters label,
  .filters .btn {
    width: 100%;
    min-width: 0;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions form,
  .actions .row-form,
  .actions .btn {
    width: 100%;
  }

  .actions input,
  .actions select {
    width: 100%;
    min-width: 0;
  }

  .warrant div { align-items: start; }

  .warrant dd { text-align: right; }
}

.who { margin: 0; color: var(--ink); }

.officers { text-align: center; }

.wait {
  color: #8a5a00;
  font-size: 0.85rem;
  font-weight: 700;
}

.secret-row button {
  min-width: 72px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: var(--paper);
  color: var(--paper-ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend { font-weight: 700; }

.steps { display: grid; gap: 8px; margin-top: 8px; }

.steps button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--paper-ink);
  font: inherit;
  text-align: left;
}

.steps button[aria-pressed="true"] {
  border-color: var(--ok);
  background: var(--ok);
  color: white;
  font-weight: 700;
}

.ok { margin: 8px 0 0; color: var(--ok); font-size: 0.92rem; }

.error { margin: 12px 0 0; color: var(--danger); font-size: 0.92rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.btn-night {
  width: 100%;
  background: var(--night);
  color: var(--ink);
}

.btn-night:disabled { opacity: 0.55; }

.btn-neon {
  background: var(--neon);
  color: var(--night);
}

.btn-ghost {
  border: 1px solid rgb(94 200 255 / 45%);
  background: transparent;
  color: var(--neon);
}

.btn-text {
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.btn-quiet {
  width: 100%;
  margin-top: 8px;
  background: transparent;
  color: var(--paper-muted);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.slip {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.slip p { margin: 0; }

.desk-shake { animation: desk-shake 0.28s ease; }

@keyframes desk-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (min-width: 700px) {
  h1 { font-size: 3rem; }
  .dock { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .desk-shake { animation: none; }
}

.admin-page {
  position: relative;
  min-height: 100dvh;
  padding: 16px 16px 40px;
  background: #071422;
}

.admin-page .scene-still,
.admin-page .shade {
  display: none;
}

.admin-page .card {
  width: min(100%, 28rem);
  margin: 0 auto;
}

.admin-page h1 {
  font-size: 2rem;
  text-align: center;
  text-shadow: 0 0 18px rgb(94 200 255 / 35%);
}

.admin-page h2 { font-size: 2rem; }

.admin-page select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--paper-ink);
  font: inherit;
}

.roster-wrap { overflow-x: auto; margin-top: 8px; }

table.roster {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.roster th,
table.roster td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

table.roster th {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.row-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn-small { width: auto; min-height: 40px; padding: 0 12px; }

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.office {
  position: relative;
  z-index: 2;
  width: min(100%, 28rem);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.office-top {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.warrant {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.warrant div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.warrant dt {
  margin: 0;
  color: var(--paper-muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.warrant dd {
  margin: 0;
  font-weight: 700;
}

.office-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.office-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgb(94 200 255 / 45%);
  border-radius: 10px;
  color: var(--neon);
  text-decoration: none;
}

.office-nav a[aria-current="page"] {
  background: var(--neon);
  border-color: var(--neon);
  color: var(--night);
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }

.stat {
  padding: 16px;
  border-radius: 16px;
  border-top: 3px solid var(--neon);
  background: var(--paper);
  color: var(--paper-ink);
  text-align: center;
  box-shadow: 0 16px 30px rgb(0 0 0 / 28%);
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 0.95;
}

.stat span { color: var(--paper-muted); font-size: 0.9rem; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.filters label { flex: 1; min-width: 12rem; }

.office-note { margin: 0; }

.office .card { width: 100%; }

.people {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.people li {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.people strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--line);
  color: var(--paper-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chip-ok { background: #d9efe1; color: var(--ok); }
.chip-wait { background: #fff1cc; color: #8a5a00; }
.chip-stop { background: #f8d9d4; color: var(--danger); }
.chip-live { background: #d7f1ff; color: #0b4f73; }

.people span { display: block; font-size: 0.9rem; }

.people .chips { display: flex; }

.people .chip { display: inline-flex; font-size: 0.75rem; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.actions .row-form { margin: 0; }

.actions input,
.actions select {
  width: auto;
  min-width: 8rem;
  flex: 1;
}

.btn-quiet.btn-small { width: auto; margin-top: 0; }
