:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #efede8;
  --text: #1c1b19;
  --muted: #6b6862;
  --line: #e2dfd8;
  --accent: #2f6f5e;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe5;
  --danger: #b4443a;
  --live: #d4553f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141513;
    --surface: #1d1f1c;
    --surface-2: #262924;
    --text: #ecebe6;
    --muted: #9b9a93;
    --line: #2f322d;
    --accent: #6fbfa6;
    --accent-ink: #0f1a16;
    --accent-soft: #23362f;
    --danger: #e0786d;
    --live: #ef7a63;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
.wide { max-width: 1040px; }

header.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.brand { font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.bar nav { display: flex; gap: 14px; font-size: 14px; }
.bar nav a, .linkish { color: var(--muted); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
label.field { display: block; font-size: 13px; color: var(--muted); }
label.field input, label.field select, .input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  outline: none;
}
label.field input:focus, .input:focus { border-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.seg button {
  border: 0; background: none; padding: 10px; border-radius: 9px; cursor: pointer;
  font-weight: 600; color: var(--muted);
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.big-start {
  width: 100%; padding: 20px; font-size: 18px; border-radius: 16px;
}
.big-start.live { background: var(--surface); color: var(--live); border-color: var(--live); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.live .dot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-height: 20px; }
.status .ind { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.status.hearing .ind { background: var(--live); }
.status.thinking .ind { background: var(--accent); animation: pulse .8s infinite; }

.suggestions { display: grid; gap: 10px; }
.sugg {
  text-align: left; width: 100%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  font-size: 19px; line-height: 1.35; font-weight: 500;
  transition: opacity .3s, border-color .2s, background .2s;
  animation: rise .25s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.sugg .cat { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.sugg.draft { opacity: .55; border-style: dashed; box-shadow: none; }
.sugg.draft .cat::after { content: " · drafting"; color: var(--muted); }
.sugg.used { border-color: var(--accent); background: var(--accent-soft); }
.sugg.used .cat::after { content: " · used ✓"; }
.sugg.stale { opacity: .45; }
.placeholder { text-align: center; padding: 28px 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

.transcript { font-size: 14px; color: var(--muted); max-height: 180px; overflow-y: auto; }
.transcript p { margin: 0 0 6px; }
.transcript .partial { font-style: italic; opacity: .7; }
.who { display: inline-block; min-width: 48px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.who.you { color: var(--accent); }

.voice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.voice .tick { color: var(--accent); font-weight: 700; }
.passage { margin: 0; font-size: 17px; line-height: 1.5; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.meter { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }

details summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.error { color: var(--danger); font-size: 14px; }
.hidden { display: none !important; }

/* admin */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tile .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.pill.admin { background: var(--accent-soft); color: var(--accent); }
.bars .row { display: grid; grid-template-columns: 96px 1fr 72px; gap: 10px; align-items: center; font-size: 14px; margin: 8px 0; }
.bars .track { background: var(--surface-2); border-radius: 6px; height: 14px; position: relative; overflow: hidden; }
.bars .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 6px; }
.bars .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.daily { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.daily .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 6px; position: relative; }
.daily .shown { background: var(--surface-2); border-radius: 4px 4px 0 0; position: relative; }
.daily .used { position: absolute; bottom: 0; left: 0; right: 0; background: var(--accent); border-radius: 4px 4px 0 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
h2 { font-size: 15px; margin: 0 0 10px; }
.invite-box { display: flex; gap: 8px; }
.invite-box input { flex: 1; min-width: 0; }
