:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #111827; --muted: #6b7280; --line: #e5e7eb;
  --accent: #2563eb; --accent-ink: #ffffff; --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
  --meeting: #2563eb; --call: #7c3aed; --solo_note: #0d9488; --conversation: #d97706; --ambient: #9ca3af; --pending: #cbd5e1;
  --radius: 12px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --panel: #121a2e; --ink: #e5e7eb; --muted: #94a3b8; --line: #1f2a44;
    --accent: #60a5fa; --accent-ink: #0b1020; --ok: #4ade80; --warn: #fbbf24; --bad: #f87171;
    --meeting: #60a5fa; --call: #a78bfa; --solo_note: #2dd4bf; --conversation: #fbbf24; --ambient: #64748b; --pending: #334155;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button, input { font: inherit; color: inherit; }
.boot { text-align: center; color: var(--muted); margin-top: 30vh; }

/* ---------- auth ---------- */
.auth { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; }
.auth h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.02em; }
.auth .sub { color: var(--muted); margin: 0 0 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=search], input[inputmode=numeric] {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 16px; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line);
  background: var(--panel); border-radius: 8px; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); width: 100%; padding: 11px; margin-top: 18px; font-weight: 600; }
.btn:disabled { opacity: .6; cursor: default; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; margin-top: 14px; font-size: 14px; }
.err { color: var(--bad); font-size: 14px; margin-top: 12px; min-height: 1em; }
.note { color: var(--muted); font-size: 13px; margin-top: 10px; }
.code-input { letter-spacing: .4em; text-align: center; font-size: 22px !important; }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: -.01em; margin-right: auto; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor; }
.pill.ok { color: var(--ok); } .pill.stale { color: var(--bad); } .pill.unknown { color: var(--muted); }
.search { flex: 1 1 100%; order: 3; }
@media (min-width: 760px) { .search { flex: 0 1 280px; order: 0; } }

.layout { max-width: 1200px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .layout { grid-template-columns: 220px 1fr; } }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
@media (min-width: 900px) { .days { flex-direction: column; overflow: visible; position: sticky; top: 70px; align-self: start; } }
.day-btn { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 10px;
  cursor: pointer; min-width: 120px; }
.day-btn[aria-current=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.day-btn .d { font-weight: 600; font-size: 14px; } .day-btn .m { color: var(--muted); font-size: 12px; }

section.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
h2 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0 4px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.stat .v { font-size: 22px; font-weight: 700; } .stat .k { font-size: 12px; color: var(--muted); }
ul.clean { margin: 0; padding-left: 18px; } ul.clean li { margin: 4px 0; }

.timeline { position: relative; height: 34px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.timeline .seg { position: absolute; top: 0; bottom: 0; min-width: 2px; cursor: pointer; }
.ticks { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.gaps { font-size: 13px; color: var(--warn); margin-top: 8px; }

.session { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.session > summary { list-style: none; cursor: pointer; padding: 12px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.session > summary::-webkit-details-marker { display: none; }
.session .time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; white-space: nowrap; }
.session .title { font-weight: 600; }
.session .meta { grid-column: 2; font-size: 13px; color: var(--muted); }
.kind { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: 1px 7px; border-radius: 999px; color: #fff; margin-right: 6px; vertical-align: 1px; }
.session .body { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.session .body p { margin: 10px 0; }
.transcript { max-height: 420px; overflow: auto; background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.transcript .ln { margin: 4px 0; } .transcript .ts { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; margin-right: 6px; }
.transcript .sp { font-weight: 600; margin-right: 4px; }
.actions li { list-style: none; margin-left: -18px; }
.actions .from { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; }
.result { padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.result:last-child { border-bottom: 0; }
.help { border-color: var(--warn); }
.help p { margin: 8px 0; } .help ol { margin: 6px 0; }
