/* The Blotter — phone capture device for the Desk study.
   Tokens are a synced copy of WebDev/shared-theme/theme.css (no build step). */

:root {
  --r: 3px;
  --bg: #171715; --card: #201f1d; --bg3: #262523;
  --ink: #e2e0d8; --muted: #98968b; --faint: #6b6a61;
  --line: #343330; --line2: #454440;
  --accent: #C96B3A; --accent2: #da7c4a;
  --ok: #3fa06a; --warn: #d9a13b; --fail: #cf5b40; --idle: #6b6a61;
  --long: #6a9e7c; --short: #c05468;
  --font: "Cascadia Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --pad: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* a display rule beats the hidden attribute — the sheet would swallow every tap */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}
body {
  min-height: 100vh; min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background-image:
    linear-gradient(rgba(226,224,216,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226,224,216,0.035) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ---------- header ---------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad) 10px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  background: rgba(23,23,21,.93); backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 8px; }
h1 { font-size: 11px; letter-spacing: .18em; font-weight: 600; margin: 0; color: var(--ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--idle); flex: none; }
.dot.open { background: var(--accent); box-shadow: 0 0 0 3px rgba(201,107,58,.18); }
.clock { font-size: 11px; color: var(--muted); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.tzlab { color: var(--faint); font-size: 9.5px; letter-spacing: .1em; }

main { padding: 0 var(--pad) 40px; max-width: 520px; margin: 0 auto; }

/* ---------- section head ---------- */
.sec {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint);
  margin: 24px 0 8px; display: flex; align-items: baseline; gap: 8px; font-weight: 600;
}
.sec .cnt { letter-spacing: 0; font-weight: 400; }
.sec::after { content: ""; flex: 1; border-top: 1px solid var(--line); transform: translateY(-3px); }
.voicetag {
  letter-spacing: .08em; font-weight: 600; color: var(--accent);
  border: 1px solid rgba(201,107,58,.4); border-radius: 2px; padding: 1px 5px; font-size: 8.5px;
}
.voicetag:empty { display: none; }

/* ---------- hero ---------- */
.hero {
  margin-top: 18px; background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--ac, var(--line2)); border-radius: var(--r);
  padding: 18px 16px 16px;
}
.hero.open { --ac: var(--accent); border-color: var(--line2); }
.hero.done { --ac: var(--ok); }
.hero.shut { --ac: var(--line2); }
.hero-kick { font-size: 9px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); font-weight: 600; }
.hero-time { font-size: 40px; line-height: 1.05; font-weight: 600; margin: 6px 0 2px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.hero.open .hero-time { color: var(--accent2); }
.hero-sub { font-size: 11.5px; color: var(--muted); }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; }
.hero-actions:empty { display: none; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font); font-size: 13px; letter-spacing: .1em; font-weight: 600;
  color: var(--ink); background: var(--bg3); border: 1px solid var(--line2);
  border-radius: var(--r); padding: 15px 14px; min-height: 52px; cursor: pointer;
  flex: 1; transition: background .12s, border-color .12s, opacity .12s;
}
.btn:active { background: #2f2e2b; }
.btn:disabled { opacity: .3; cursor: default; }
.btn.big { width: 100%; min-height: 60px; font-size: 15px; margin-top: 22px; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:active { background: var(--bg3); }
.btn.take { border-color: rgba(106,158,124,.5); color: #a9cfb6; }
.btn.pass { border-color: var(--line2); color: var(--muted); }
.btn.ok { border-color: rgba(63,160,106,.55); color: #9ecfb3; }
.btn.dir.long  { border-color: rgba(106,158,124,.5); color: #a9cfb6; }
.btn.dir.short { border-color: rgba(192,84,104,.5); color: #dc9aa6; }
.btn.dir.sel.long  { background: rgba(106,158,124,.16); }
.btn.dir.sel.short { background: rgba(192,84,104,.16); }
.rowbtns { display: flex; gap: 10px; margin-top: 26px; }
.linkbtn {
  background: none; border: 0; color: var(--muted); font-family: var(--font);
  font-size: 12px; padding: 10px 0; cursor: pointer; letter-spacing: .04em;
  text-decoration: none; display: inline-block;
}
.linkbtn:active { color: var(--ink); }
.footlinks { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 8px; }

/* ---------- checkpoint rows ---------- */
.cps { display: flex; flex-direction: column; gap: 6px; }
.cp {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--ac, var(--line2)); border-radius: var(--r);
}
.cp.is-open { --ac: var(--accent); }
.cp.is-done { --ac: var(--ok); }
.cp.is-pass { --ac: var(--line2); }
.cp.is-miss { --ac: var(--warn); }
.cp-t { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 58px; }
.cp-l { font-size: 9px; color: var(--faint); letter-spacing: .1em; text-transform: uppercase; }
.cp.tap { cursor: pointer; }
.cp.tap:active { background: var(--bg3); }
.cp-s { margin-left: auto; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.cp.is-open .cp-s { color: var(--accent2); }
.cp.is-done .cp-s { color: var(--ok); }
.cp.is-miss .cp-s { color: var(--warn); }

/* ---------- declared names ---------- */
.names { display: flex; flex-direction: column; gap: 6px; }
.empty { color: var(--faint); font-size: 11.5px; padding: 8px 2px; }
.nm {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--ac, var(--line2)); border-radius: var(--r); padding: 11px 12px;
}
.nm.long { --ac: var(--long); } .nm.short { --ac: var(--short); }
.nm-top { display: flex; align-items: baseline; gap: 9px; }
.nm-tk { font-size: 16px; font-weight: 600; letter-spacing: .04em; }
.nm-dir { font-size: 9.5px; letter-spacing: .12em; font-weight: 600; }
.nm.long .nm-dir { color: var(--long); } .nm.short .nm-dir { color: var(--short); }
.nm-at { margin-left: auto; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nm-at .late { color: var(--warn); }
.nm-taps { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.nm-taps b { color: var(--ink); font-weight: 400; }
.nm-foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.chk {
  font-family: var(--font); font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  background: transparent; color: var(--muted); border: 1px solid var(--line2);
  border-radius: 2px; padding: 8px 11px; min-height: 38px; cursor: pointer;
}
.chk.on { color: var(--ok); border-color: rgba(63,160,106,.5); background: rgba(63,160,106,.1); }
.nm-notes { margin-left: auto; font-size: 9.5px; color: var(--faint); }

/* ---------- declare ---------- */
.crumb { display: flex; align-items: center; gap: 12px; padding-top: 6px; font-size: 10px; letter-spacing: .1em; color: var(--faint); text-transform: uppercase; }
.crumb .linkbtn { text-transform: none; letter-spacing: .04em; }
.ticker {
  width: 100%; font-family: var(--font); font-size: 34px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; text-align: center; color: var(--ink);
  background: var(--card); border: 1px solid var(--line2); border-radius: var(--r);
  padding: 16px 12px; outline: none;
}
.ticker:focus { border-color: var(--accent); }
.ticker::placeholder { color: var(--line2); }
.dirbtns { display: flex; gap: 10px; margin-top: 12px; }
.tapshead { font-size: 18px; font-weight: 600; letter-spacing: .05em; padding-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--font); font-size: 12px; color: var(--muted);
  background: var(--card); border: 1px solid var(--line2); border-radius: var(--r);
  padding: 11px 12px; min-height: 42px; cursor: pointer;
}
.chip:active { background: var(--bg3); }
.chip.sel { color: var(--ink); border-color: var(--accent); background: rgba(201,107,58,.13); }
.chip.other { border-style: dashed; }
.chipin {
  font-family: var(--font); font-size: 12px; color: var(--ink); background: var(--bg3);
  border: 1px solid var(--accent); border-radius: var(--r); padding: 11px 12px;
  min-height: 42px; width: 100%; outline: none; margin-top: 6px;
}

/* ---------- talk sheet ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 20; background: rgba(15,15,14,.82);
  backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center;
}
.sheet-card {
  width: 100%; max-width: 520px; background: var(--card);
  border: 1px solid var(--line2); border-bottom: 0;
  border-radius: 10px 10px 0 0; padding: 22px var(--pad) calc(26px + env(safe-area-inset-bottom));
  text-align: center;
}
.sheet-kick { font-size: 9px; letter-spacing: .14em; color: var(--faint); text-transform: uppercase; font-weight: 600; }
.sheet-sub { font-size: 14px; color: var(--ink); margin: 6px 0 20px; }
.rec {
  width: 104px; height: 104px; border-radius: 50%; margin: 0 auto;
  background: transparent; border: 2px solid var(--line2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.rec-inner { width: 74px; height: 74px; border-radius: 50%; background: var(--fail); transition: all .18s ease; }
.rec.on { border-color: var(--fail); animation: pulse 1.6s ease-in-out infinite; }
.rec.on .rec-inner { width: 40px; height: 40px; border-radius: 6px; }
.rec:disabled { opacity: .35; cursor: default; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }
.rec-time { font-size: 24px; font-variant-numeric: tabular-nums; margin-top: 14px; letter-spacing: .04em; }
.rec-hint { font-size: 10.5px; color: var(--faint); margin-top: 4px; min-height: 16px; }
.rec-hint.bad { color: var(--warn); }
.sheet-btns { margin-top: 20px; }
.sheet-btns .btn { width: 100%; }
.notelist { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.notelist audio { width: 100%; height: 34px; }

/* ---------- misc ---------- */
.sendnote { font-size: 11.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.55; }
.fineprint { font-size: 11.5px; color: var(--muted); margin: 26px 0 0; line-height: 1.5; }
.fineprint2 { font-size: 11px; color: var(--faint); margin: 4px 0 0; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 40;
  background: var(--bg3); border: 1px solid var(--line2); border-radius: var(--r);
  padding: 11px 16px; font-size: 12px; color: var(--ink); max-width: 90vw; text-align: center;
}
.hday { margin-top: 20px; }
.hday h3 { font-size: 12px; font-weight: 600; margin: 0 0 6px; letter-spacing: .05em; }
.hday .nm { margin-bottom: 6px; }

@media (min-width: 560px) { :root { --pad: 22px; } }
