/* Command Centre: phone-first, dark. Brand colours follow the Guardian palette (obsidian, charcoal, silver, gold). */
:root {
  --bg: #0a0a12;
  --panel: #161624;
  --panel-2: #1c1c2c;
  --line: #2a2a3e;
  --text: #f2f2f8;
  --muted: #a9a9c2;
  --gold: #c9a84c;
  --gold-bright: #e8c96a;
  --danger: #d94444;
  --danger-bg: #3a1620;
  --ok: #4caf7a;
  --radius: 12px;
  --gutter: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) env(safe-area-inset-bottom) max(var(--gutter), env(safe-area-inset-left));
}
#app { max-width: 760px; margin: 0 auto; padding-bottom: 32px; }
h1 { font-size: 1.5rem; color: var(--gold); margin: 20px 0 4px; letter-spacing: .02em; }
h2 { font-size: 1.05rem; margin: 0 0 8px; color: var(--text); }
p { margin: 0 0 10px; }
a { color: var(--gold-bright); }
code { font-family: ui-monospace, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 460px; margin: 0 auto; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0 8px; flex-wrap: wrap; }
.brand { color: var(--gold); font-size: 1.1rem; }
nav .tab { background: none; border: 0; color: var(--muted); font: inherit; padding: 10px 12px; min-height: 44px; border-bottom: 2px solid transparent; cursor: pointer; }
nav .tab.on { color: var(--text); border-bottom-color: var(--gold); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.warn { border-color: var(--gold); }
.card.danger-zone { border-color: #5a2430; background: #1c1220; }

label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); }
input, textarea, select {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; min-height: 44px; width: 100%;
}
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
textarea:disabled { opacity: .6; resize: none; }

.btn { font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid transparent; padding: 12px 18px; min-height: 48px; cursor: pointer; width: 100%; }
.btn.primary { background: var(--gold); color: #1a1405; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.quiet { background: transparent; color: var(--text); border-color: var(--line); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.row .btn { width: auto; flex: 1 1 140px; }

.link { background: none; border: 0; color: var(--gold-bright); font: inherit; text-decoration: underline; padding: 10px 0; min-height: 44px; cursor: pointer; text-align: left; }
.links { display: flex; flex-direction: column; align-items: flex-start; }

.problem { color: #ff9b9b; background: var(--danger-bg); border: 1px solid #5a2430; border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; }
.banner { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.banner.stopped { background: var(--danger-bg); border: 1px solid var(--danger); }

.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; background: none; border: 0; color: var(--muted); font: inherit; border-radius: 9px; padding: 10px 8px; min-height: 44px; cursor: pointer; }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--gold); }
.workspaces { margin: 4px 0 14px; }

.codes { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
.codes li { background: var(--panel-2); border: 1px dashed var(--gold); border-radius: 8px; padding: 10px 12px; text-align: center; letter-spacing: .06em; }
.secret { display: block; background: var(--panel-2); border-radius: 8px; padding: 12px; font-size: 1.1rem; letter-spacing: .08em; word-break: break-all; }
.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); margin: 14px 0; font-size: 1rem; }
.check input { width: 22px; height: 22px; min-height: 22px; flex: none; }
.list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
.list li { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); padding-bottom: 8px; }

@media (min-width: 560px) {
  .codes { grid-template-columns: 1fr 1fr; }
  .btn { width: auto; min-width: 200px; }
  .stack > .btn, .card > .btn { width: auto; }
}
@media (prefers-reduced-motion: no-preference) { .btn { transition: filter .15s; } .btn:hover:not(:disabled) { filter: brightness(1.08); } }
