/* Potoos review desk. Tokens from the Potoos dashboard (ops/potoos-dashboard/src/styles.css): graphite neutrals,
   Potoos gold only for the waiting count and the main action. 4px grid, 44px touch targets. */
:root {
  --bg: #FAFAFA;
  --bg2: #F4F4F5;
  --side: #F7F7F7;
  --card: #FFFFFF;
  --ink: #171717;
  --muted: #525252;
  --faint: #737373;
  --line: rgba(23, 23, 23, 0.08);
  --line-strong: rgba(23, 23, 23, 0.14);
  --bar: #D4D4D8;
  --bar-2: #A1A1AA;
  --accent: #A8841A;
  --accent-ink: #7A5F0E;
  --accent-soft: rgba(168, 132, 26, 0.12);
  --on-accent: #171717;
  --good: #15803D;
  --bad: #DC2626;
  --change: #B45309;
  --focus: #171717;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141415; --bg2: #232325; --side: #0F0F10; --card: #19191B; --ink: #EDEDED; --muted: #A1A1A6;
    --faint: #85858B; --line: rgba(237, 237, 237, 0.08); --line-strong: rgba(237, 237, 237, 0.14);
    --bar: #3F3F46; --bar-2: #71717A; --accent: #D4B25A; --accent-ink: #D4B25A;
    --accent-soft: rgba(212, 178, 90, 0.14); --on-accent: #141415; --good: #4CC38A; --bad: #EF6467;
    --change: #F0A35B; --focus: #EDEDED; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141415; --bg2: #232325; --side: #0F0F10; --card: #19191B; --ink: #EDEDED; --muted: #A1A1A6;
  --faint: #85858B; --line: rgba(237, 237, 237, 0.08); --line-strong: rgba(237, 237, 237, 0.14);
  --bar: #3F3F46; --bar-2: #71717A; --accent: #D4B25A; --accent-ink: #D4B25A;
  --accent-soft: rgba(212, 178, 90, 0.14); --on-accent: #141415; --good: #4CC38A; --bad: #EF6467;
  --change: #F0A35B; --focus: #EDEDED; --shadow: none; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
button, textarea, input { font: inherit; color: inherit; }

/* top bar */
.top { background: var(--side); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 960px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--accent); }
.brand-name { display: block; font-weight: 600; font-size: 15px; line-height: 20px; }
.brand-sub { display: block; font-size: 13px; line-height: 16px; color: var(--faint); }
.theme, .seg { display: inline-flex; padding: 2px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg2); }
.theme button, .seg button { min-height: 40px; min-width: 60px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.theme button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--card); color: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong); }

.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 64px; }
.state { padding: 48px 0; }
.sample { margin: 0 0 16px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg2);
  border: 1px dashed var(--line-strong); color: var(--muted); font-size: 14px; }
.h1 { font-size: 24px; line-height: 32px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
.h2 { font-size: 18px; line-height: 24px; font-weight: 600; margin: 0; }
.gold { color: var(--accent-ink); font-family: var(--font-mono); font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { margin: 0 0 16px; max-width: 60ch; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card);
  color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background 120ms var(--ease), border-color 120ms var(--ease); }
.btn:hover { background: var(--bg2); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.06); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-icon { width: 44px; padding: 0; font-size: 24px; line-height: 1; }
.btn-wide { width: 100%; }
@media (min-width: 640px) { .btn-wide { width: auto; justify-self: start; min-width: 280px; } }

.hero { margin-bottom: 20px; }
.hero .all-box:empty { display: none; }
.nudge { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; margin: 0 0 16px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.nudge p { margin: 0; }
.nudge .msg { grid-column: 1 / -1; }
.all-box { display: grid; gap: 8px; }
.confirm { padding: 12px; border-radius: var(--radius); background: var(--accent-soft);
  border: 1px solid var(--line-strong); }
.confirm-q { margin: 0 0 8px; font-weight: 500; }
.msg { margin: 0; font-size: 14px; color: var(--muted); }
.msg.err { color: var(--bad); }

/* calendar */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cal { padding: 12px; margin-bottom: 24px; }
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; text-align: center; }
.cal-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 12px; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dow { margin-bottom: 4px; }
.dow span { text-align: center; font-size: 12px; line-height: 16px; color: var(--faint); }
.cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 96px;
  padding: 8px 2px; border-radius: 10px; border: 1px solid transparent; background: var(--bg2);
  cursor: pointer; text-align: center; }
.cell:hover { border-color: var(--line-strong); }
.cell.empty-day { background: transparent; border-color: var(--line); cursor: default; }
.cell.out { opacity: 0.45; }
.cell[aria-selected="true"] { border-color: var(--ink); background: var(--card); box-shadow: 0 0 0 1px var(--ink); }
.cell .num { font-family: var(--font-mono); font-size: 15px; line-height: 24px; width: 28px; height: 24px;
  border-radius: 6px; }
.cell.today .num { background: var(--ink); color: var(--bg); font-weight: 500; }
.counts { display: grid; gap: 2px; width: 100%; justify-items: center; }
.cnt { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 12px;
  line-height: 16px; color: var(--muted); }
.cnt.waiting { color: var(--accent-ink); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.s-waiting { background: var(--accent); }
.s-approved { background: var(--bar-2); }
.s-change { background: var(--change); }
.s-live { background: var(--good); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 0; padding: 0;
  font-size: 13px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }

/* month view: compact cells */
.grid.month .cell { min-height: 64px; padding: 6px 2px; }
.grid.month .cnt.other { display: none; }
.grid.month .dots { display: flex; gap: 3px; justify-content: center; }
.grid.week .dots { display: none; }

/* day + page cards */
.day .h2 { margin-bottom: 4px; }
.cards { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.pc { padding: 16px; }
.pc-sec { margin: 0 0 4px; font-size: 13px; line-height: 16px; color: var(--faint); }
.pc-title { margin: 0 0 8px; font-size: 17px; line-height: 24px; font-weight: 500; overflow-wrap: anywhere; }
.pc-status { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; font-size: 14px; line-height: 20px;
  color: var(--muted); }
.pc-status .dot { margin-top: 6px; }
.pc.st-waiting .pc-status { color: var(--accent-ink); font-weight: 500; }
.pc-note { margin: -4px 0 12px 16px; font-size: 14px; color: var(--muted); }
.pc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .pc-actions .btn { flex: 0 0 auto; } }
.chg { margin-top: 12px; display: grid; gap: 8px; }
.chg label { font-size: 14px; font-weight: 500; }
.chg textarea { width: 100%; min-height: 96px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--bg); resize: vertical; font-size: 16px; }
.chg textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.empty { margin-top: 12px; }

/* sign-in check (email code) and sign out */
.top-right { display: flex; align-items: center; gap: 8px; }
.signout { min-height: 40px; padding: 0 8px; border: 0; background: transparent; color: var(--muted); font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.signout:hover { color: var(--ink); }
.otp { max-width: 480px; }
.otp-box { display: grid; gap: 8px; margin-top: 4px; }
.otp-box label { font-size: 14px; font-weight: 500; }
.otp-box input { width: 100%; max-width: 240px; min-height: 52px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font-family: var(--font-mono);
  font-size: 24px; letter-spacing: 0.3em; }
.otp-box input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.otp .msg { margin-top: 12px; }

@media (min-width: 900px) {
  .wrap { display: grid; grid-template-columns: 420px 1fr; gap: 24px; align-items: start; }
  .wrap > .sample, .wrap > .state { grid-column: 1 / -1; margin-bottom: 0; }
  #desk { display: contents; }
  .hero { grid-column: 1 / -1; }
  .cal { position: sticky; top: 76px; margin-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* tabs (Nash's view): Pages | Fixes */
.tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 20px; border: 1px solid var(--line-strong);
  border-radius: 12px; background: var(--bg2); }
.tabs [role="tab"] { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted);
  font-size: 15px; font-weight: 500; cursor: pointer; }
.tabs [role="tab"][aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* fixes */
.fixes { max-width: 720px; }
.fx .pc-title { margin-bottom: 8px; }
.fx-held .pc-sec { color: var(--change); }
.fx p { margin: 0 0 8px; font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.fx .fx-meta { font-size: 14px; color: var(--muted); }
.fx-label { font-weight: 600; color: var(--ink); }
.fx .fx-do { margin: 12px 0; padding: 12px; border-radius: var(--radius-sm); background: var(--bg2); }
.fx .fx-do p { margin: 0; }
.fx-done { opacity: 0.85; }
.fx .fx-result { margin: 12px 0 0; color: var(--ink); font-weight: 500; }
.quiet { margin-top: 32px; }
.quiet .h2 { font-size: 16px; margin-bottom: 4px; }
.quiet-list { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.qi { padding: 12px 0; border-bottom: 1px solid var(--line); }
.qi p { margin: 0; }
.qi-title { font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.qi-line { font-size: 14px; line-height: 20px; color: var(--muted); }
@media (min-width: 900px) {
  .tabs { grid-column: 1 / -1; max-width: 420px; margin-bottom: 0; }
  .panel-pages { display: contents; }
  .fixes { grid-column: 1 / -1; }
}
