/* Design tokens. Light is a warm paper; dark follows the system setting. */
:root {
  color-scheme: light dark;

  --sr-bg: #f2f0e9;
  --sr-surface: #faf9f5;
  --sr-sunken: #e8e5da;
  --sr-ink: #16150f;
  --sr-ink-2: #4a473c;
  --sr-ink-3: #6a6659;
  --sr-line: rgba(22, 21, 15, 0.13);
  --sr-line-strong: rgba(22, 21, 15, 0.3);
  --sr-accent: #d6420b;
  --sr-accent-ink: #ffffff;
  --sr-ok: #2c7a4b;

  --sr-strip-bg: #16150f;
  --sr-strip-ink: #f2f0e9;
  --sr-strip-dim: #a9a595;

  --sr-font-sans: "Instrument Sans Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sr-font-mono: "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --sr-radius: 6px;
  --sr-wrap: 1120px;
  --sr-gutter: 24px;
  --sr-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --sr-bg: #0f0f0d;
    --sr-surface: #171714;
    --sr-sunken: #090908;
    --sr-ink: #ecebe3;
    --sr-ink-2: #b9b6a8;
    --sr-ink-3: #8f8c7e;
    --sr-line: rgba(236, 235, 227, 0.11);
    --sr-line-strong: rgba(236, 235, 227, 0.28);
    --sr-accent: #ff6a2c;
    --sr-accent-ink: #160a04;
    --sr-ok: #5fc88a;

    --sr-strip-bg: #1d1d19;
    --sr-strip-ink: #ecebe3;
    --sr-strip-dim: #8f8c7e;
  }
}

@media (max-width: 640px) {
  :root {
    --sr-gutter: 16px;
  }
}

/* Console. Same tokens as the website; system fonts, no web fonts. */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--sr-bg); color: var(--sr-ink); }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-underline-offset: 3px; }
code, pre, .mono { font-family: var(--sr-font-mono); font-size: 0.9em; }
.dim { color: var(--sr-ink-3); }
.small { font-size: 13px; }
.wrap { max-width: var(--sr-wrap); margin: 0 auto; padding: 0 var(--sr-gutter); }

.bar { border-bottom: 1px solid var(--sr-line); background: var(--sr-surface); }
.bar-row { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.mark { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.glyph { width: 14px; height: 14px; border-radius: 3px; background: var(--sr-accent); }
.bar nav { display: flex; gap: 4px; }
.bar nav a, .tabs a { padding: 6px 10px; border-radius: var(--sr-radius); text-decoration: none; color: var(--sr-ink-2); }
.bar nav a[aria-current], .tabs a[aria-current] { background: var(--sr-sunken); color: var(--sr-ink); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; }

main.wrap { padding-top: 32px; padding-bottom: 64px; }
h1 { font-size: 24px; letter-spacing: -0.01em; margin: 0 0 16px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.head h1 { margin: 0; }
.tabs { display: flex; gap: 4px; }

.card { background: var(--sr-surface); border: 1px solid var(--sr-line); border-radius: var(--sr-radius); padding: 24px; }
.narrow { max-width: 620px; }
pre { background: var(--sr-sunken); padding: 10px 12px; border-radius: var(--sr-radius); overflow-x: auto; }
.err { color: var(--sr-accent); font-weight: 600; }

.table-wrap { overflow-x: auto; border: 1px solid var(--sr-line); border-radius: var(--sr-radius); background: var(--sr-surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--sr-line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sr-ink-3); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td.note { max-width: 420px; white-space: pre-wrap; overflow-wrap: anywhere; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }

.btn { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: var(--sr-radius); border: 1px solid transparent;
  background: var(--sr-accent); color: var(--sr-accent-ink); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--sr-ink-2); border-color: var(--sr-line-strong); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--sr-accent); outline-offset: 2px; }

.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--sr-sunken); color: var(--sr-ink-2); }
.pill.approved { color: var(--sr-ok); }
.pill.rejected { color: var(--sr-ink-3); text-decoration: line-through; }
.pill.waiting { color: var(--sr-accent); }
.flash { padding: 10px 12px; border-radius: var(--sr-radius); background: var(--sr-sunken); }
.empty { padding: 32px; text-align: center; color: var(--sr-ink-3); border: 1px dashed var(--sr-line-strong); border-radius: var(--sr-radius); }

/* Sign-in pages */
.stack { display: grid; gap: 0.75rem; margin-top: 1rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.btn.wide { display: block; text-align: center; text-decoration: none; }
label { display: grid; gap: 0.35rem; }
input { font: inherit; color: var(--sr-ink); background: var(--sr-surface); border: 1px solid var(--sr-line-strong); border-radius: var(--sr-radius); padding: 0.55rem 0.7rem; min-width: 0; }
.row input { flex: 1 1 12rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
