:root {
  --bg: #12100e; --panel: #1d1a16; --panel2: #26221d; --ink: #f3ede4; --dim: #b3a899;
  --accent: #e8a34c; --accent2: #d97b3f; --ok: #7bc98a; --bad: #e2725b; --line: #332d26;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }

/* HOME */
.brand { display: flex; gap: 14px; align-items: center; margin: 14px 0 22px; }
.brand-mark { width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; color: #1a130a; }
h1 { font-size: 24px; letter-spacing: .2px; }
.tagline { color: var(--dim); font-size: 14px; margin-top: 2px; }
.stats-row { display: flex; gap: 10px; margin-bottom: 22px; }
.stat { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; }
.stat-num { display: block; font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-label { display: block; font-size: 11px; color: var(--dim); margin-top: 3px; }
.pick-title { font-size: 15px; margin-bottom: 10px; color: var(--ink); }
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.topic-chip { background: var(--panel); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 9px 14px; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.topic-chip.sel { border-color: var(--accent); background: #2c241a; color: var(--accent); }
.topic-chip .day { opacity: .55; font-size: 11px; margin-right: 5px; }
.cta { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #1a130a; border: 0; border-radius: 16px; padding: 16px; font-size: 17px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; margin-top: auto; }
.cta:disabled { opacity: .5; }
.fineprint { color: var(--dim); font-size: 12px; text-align: center; margin-top: 12px; line-height: 1.5; }

/* SESSION */
.sess-head { display: flex; justify-content: space-between; align-items: flex-start; margin: 8px 0 12px; }
.sess-topic { font-size: 16px; font-weight: 600; }
.sess-sub { color: var(--dim); font-size: 12px; margin-top: 2px; }
.sess-timer { text-align: right; font-variant-numeric: tabular-nums; }
#sess-clock { font-size: 22px; font-weight: 700; color: var(--accent); }
.sess-target { color: var(--dim); font-size: 13px; }
.captions { flex: 1; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.cap { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 15px; line-height: 1.45; }
.cap .who { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; opacity: .65; }
.cap.tutor { background: var(--panel2); align-self: flex-start; }
.cap.you { background: #2c241a; border: 1px solid #3d3223; align-self: flex-end; }
.cap.partial { opacity: .55; }
.cap.sys { background: none; align-self: center; color: var(--dim); font-size: 12px; padding: 2px; }
.sess-controls { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 0 4px; }
.mic-orb { width: 92px; height: 92px; border-radius: 50%; background: var(--panel2); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--accent); position: relative; }
.mic-orb.live { border-color: var(--accent); color: #ffd9a0; }
.mic-orb.live .mic-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent); opacity: .5; animation: pulse 1.8s ease-out infinite; }
.mic-orb.speaking { border-color: var(--ok); color: var(--ok); }
.mic-orb.speaking .mic-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--ok); opacity: .5; animation: pulse 1.1s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.35); opacity: 0; } }
.sess-status { color: var(--dim); font-size: 13px; min-height: 18px; }
.sess-buttons { display: flex; gap: 10px; }
.ghost-btn { background: none; border: 1px solid var(--line); color: var(--dim); border-radius: 12px; padding: 10px 16px; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.ghost-btn.danger { color: var(--bad); border-color: #4a2c24; }
.type-bar { display: flex; gap: 8px; padding-top: 10px; }
#type-input { flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); font-size: 16px; }
.send-btn { background: var(--accent); color: #1a130a; border: 0; border-radius: 12px; padding: 0 18px; font-weight: 700; font-size: 14px; cursor: pointer; }

/* DONE */
#done { align-items: center; text-align: center; justify-content: center; gap: 8px; }
.done-mark { width: 74px; height: 74px; border-radius: 50%; background: #1e2b1f; border: 2px solid var(--ok); color: var(--ok); font-size: 34px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.done-sub { color: var(--dim); font-size: 14px; margin-bottom: 14px; line-height: 1.5; }
#done .stats-row { width: 100%; margin-bottom: 18px; }
#done .cta { width: 100%; margin-top: 0; }
#done .ghost-btn { margin-top: 10px; }

.fineprint.en { font-size: 11px; opacity: .75; margin-top: 4px; }
.privacy { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.privacy summary { color: var(--dim); font-size: 12px; cursor: pointer; list-style: none; text-align: center; }
.privacy summary::before { content: "\1F512 "; }
.privacy p { color: var(--dim); font-size: 11.5px; line-height: 1.55; margin-top: 8px; }

.login-bar { display: flex; gap: 8px; }
#pass-input { flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; color: var(--ink); font-size: 16px; }
.logout-link { background:none; border:none; color: var(--dim); font-size: 11px; margin-top: 10px; cursor: pointer; text-decoration: underline; }
