/* Considered Personal — calm surface. The green dot = Now (identity, not branding).
   Reassurance through visibility: nothing shouts, nothing is "overdue", nothing regresses. */
:root {
  --bg: #0b100e;
  --bg-soft: #0f1613;
  --panel: rgba(15, 22, 19, 0.92);
  --line: rgba(120, 180, 150, 0.16);
  --accent: #5fd39a;
  --accent-dim: #3f8f6a;
  --text: #e8efe9;
  --muted: #7d8a80;
  --me: #93a7bd;
  --warn: #e0a860;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  color: var(--text); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
  padding-top: var(--safe-top);
}

/* ── header ─────────────────────────────────────────────────────────── */
header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 10px; flex: none; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 650; font-size: 17px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(95, 211, 154, 0.55); animation: pulse 3.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px 1px rgba(95, 211, 154, 0.5); }
  50% { box-shadow: 0 0 16px 5px rgba(95, 211, 154, 0.18); }
}
.spacer { flex: 1; }
.who {
  font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 20px; padding: 4px 10px; cursor: pointer;
}
.who .conn { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.who .conn.off { background: var(--warn); }

/* ── segmented control ──────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; padding: 8px 12px; flex: none; }
.tabs button {
  flex: 1; background: transparent; color: var(--muted); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 8px; font-size: 12.5px; font-weight: 550; cursor: pointer;
}
.tabs button.on { color: var(--text); border-color: var(--accent-dim); background: rgba(95, 211, 154, 0.08); }

/* ── stage (helix / lists) ──────────────────────────────────────────── */
main { flex: 1; position: relative; overflow: hidden; }
#helix { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.list { position: absolute; inset: 0; overflow-y: auto; padding: 6px 14px 120px; display: none; }
.list.on { display: block; }
.item {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 9px;
  background: var(--bg-soft); cursor: pointer;
}
.item h4 { margin: 0 0 3px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.item .sub { color: var(--muted); font-size: 12px; }
.item .pill { font-size: 10.5px; color: var(--accent); border: 1px solid var(--accent-dim); border-radius: 20px; padding: 1px 8px; font-weight: 600; }
.item.done h4 { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent-dim); }
.empty { color: var(--muted); text-align: center; padding: 48px 20px; font-size: 14px; line-height: 1.7; }
.empty .big { font-size: 34px; display: block; margin-bottom: 10px; opacity: 0.8; }

/* ── capture bar (formless; zero structure imposed) ─────────────────── */
.capture {
  flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px;
  padding-bottom: calc(10px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--bg);
}
.capture textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 140px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text); border-radius: 22px; padding: 11px 16px;
  font: inherit; font-size: 15px; outline: none;
}
.capture textarea:focus { border-color: var(--accent-dim); }
.capture textarea::placeholder { color: var(--muted); }
.cbtn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cbtn.send { background: var(--accent); color: #06110b; border-color: var(--accent); font-size: 20px; }
/* attach — same weight as 🎤 and 📖: a photo of a page is a capture, not a
   special case, so it does not get a louder button than speaking does. */
.cbtn.attach { font-size: 17px; }
.cbtn.attach:active { transform: scale(0.94); }
.cbtn.mic.rec { background: var(--warn); color: #201400; border-color: var(--warn); animation: pulse 1.2s infinite; }
.cbtn:disabled { opacity: 0.4; }

/* ── detail sheet ───────────────────────────────────────────────────── */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 80%; z-index: 30;
  background: var(--panel); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0; transform: translateY(101%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex; flex-direction: column; padding-bottom: var(--safe-bottom);
}
.sheet.open { transform: translateY(0); }
.sheet .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 4px; flex: none; }
.sheet .shd { padding: 4px 18px 8px; flex: none; display: flex; align-items: baseline; gap: 8px; }
.sheet .shd h3 { margin: 0; font-size: 19px; font-weight: 650; }
.sheet .shd .ty { color: var(--muted); font-size: 12px; }
.sheet .shd .x { margin-left: auto; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.sheet .body { overflow-y: auto; padding: 4px 18px 22px; }

.quad { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 14px; }
.q { border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 58px; }
.q .qh { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
.q .qh .g { width: 7px; height: 7px; border-radius: 50%; }
.q.observed .g, .q.asserted .g { background: var(--accent); }
.q.intended .g, .q.simulated .g { background: var(--warn); }
.q .row { font-size: 13px; padding: 4px 0; border-bottom: 1px solid rgba(120,180,150,0.08); display: flex; gap: 8px; align-items: flex-start; }
.q .row:last-child { border-bottom: none; }
.q .row .c { flex: 1; }
.q .row .do { color: var(--accent); font-size: 11px; border: 1px solid var(--accent-dim); border-radius: 14px; padding: 2px 9px; cursor: pointer; white-space: nowrap; }
.q .qe { color: var(--muted); font-size: 12px; font-style: italic; }

.tl { margin-top: 6px; }
.tl .te { border-left: 2px solid var(--line); padding: 3px 0 8px 12px; margin-left: 3px; position: relative; }
.tl .te::before { content: ""; position: absolute; left: -5px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-dim); }
.tl .te .tm { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl .te .tx { font-size: 13.5px; margin-top: 1px; }
.tl .te .ev { font-size: 10px; color: var(--accent-dim); }

/* ── onboarding + toast ─────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: var(--bg); display: none;
  flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; gap: 14px;
}
.overlay.on { display: flex; }
.overlay .big-dot { width: 20px; height: 20px; }
.overlay h1 { font-weight: 650; font-size: 24px; margin: 6px 0 0; }
.overlay p { color: var(--muted); margin: 0 0 8px; max-width: 320px; }
.overlay .choose { display: flex; gap: 10px; }
.overlay .choose button {
  background: var(--bg-soft); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 26px; font-size: 16px; font-weight: 600; cursor: pointer;
}
.overlay .choose button:hover { border-color: var(--accent-dim); }
.overlay input {
  background: var(--bg-soft); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; font-size: 14px; width: 280px; outline: none; text-align: center;
}
.overlay .hint { font-size: 12px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 9px 16px; font-size: 13px;
  z-index: 40; opacity: 0; pointer-events: none; transition: all 0.25s; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── reader (the slice-0 reading surface) ───────────────────────────── */
.reader {
  position: fixed; inset: 0; z-index: 45; background: var(--bg); display: none;
  flex-direction: column; padding-top: env(safe-area-inset-top, 0);
}
.reader.open { display: flex; }
.reader .rhd { flex: none; display: flex; align-items: baseline; gap: 8px; padding: 16px 18px 8px; border-bottom: 1px solid var(--line); }
.reader .rhd h3 { margin: 0; font-size: 18px; font-weight: 650; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader .rhd .x { color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.reader .rbanner {
  flex: none; display: none; margin: 10px 18px 0; padding: 10px 14px; border-radius: 12px;
  background: var(--bg-soft); border: 1px solid var(--accent-dim); font-size: 14px;
}
.reader .rbanner.show { display: block; }
.reader .rbanner .ropts { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.reader .rbanner .ropts button {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.reader .rbanner .ropts button:hover { border-color: var(--accent-dim); }
.reader .rbody { flex: 1; overflow-y: auto; padding: 14px 20px calc(40px + var(--safe-bottom)); }
.reader .rbody p { font-size: 17px; line-height: 1.65; margin: 0 0 1.1em; max-width: 42em; }
.reader .rbody p.here { animation: herefade 2.4s ease-out; border-radius: 6px; }
@keyframes herefade { 0% { background: rgba(120, 220, 170, 0.22); } 100% { background: transparent; } }
