:root { --bg:#f4f2ee; --ink:#1f1d1a; --mute:#6f6a62; --line:#dcd7ce; --accent:#6a4bd8; --accent-ink:#fff; --call:#17151f; --ok:#2e8b57; --warn:#c2571a; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font:16px/1.45 -apple-system, "Helvetica Neue", "Apple SD Gothic Neo", "Hiragino Sans", sans-serif; }
.phone { max-width:420px; margin:0 auto; min-height:100vh; display:flex; flex-direction:column; }
section { padding:28px 22px 32px; display:flex; flex-direction:column; flex:1; }
section[hidden] { display:none; }
h1 { font-size:28px; margin:0 0 4px; }
h2 { font-size:13px; letter-spacing:.06em; text-transform:uppercase; color:var(--mute); margin:26px 0 8px; }
.sub, .hint { color:var(--mute); margin:0; font-size:14px; }
.hint { min-height:42px; margin-top:8px; }
button { font:inherit; color:inherit; cursor:pointer; border:1px solid var(--line); background:#fff; border-radius:12px; padding:12px 14px; }
.choice { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.choice button { text-align:left; font-weight:600; }
.choice small { display:block; font-weight:400; color:var(--mute); font-size:13px; }
.choice .on { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent) inset; }
.switch { display:grid; grid-template-columns:1fr 1fr; background:#e7e3db; border-radius:14px; padding:4px; }
.switch button { border:0; background:transparent; font-weight:600; }
.switch .on { background:var(--accent); color:var(--accent-ink); }
.primary { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); font-weight:700; padding:16px; margin-top:28px; font-size:18px; }
.status { color:var(--mute); font-size:13px; margin:12px 0 0; }

#call { background:var(--call); color:#fff; align-items:center; text-align:center; }
.top { width:100%; display:flex; justify-content:space-between; font-size:14px; color:#b9b3c9; }
.avatar { width:150px; height:150px; border-radius:50%; background:var(--accent); display:grid; place-items:center; margin:40px 0 18px; font-size:64px; font-weight:700; transition:box-shadow .2s; }
.avatar.speaking { box-shadow:0 0 0 10px rgba(106,75,216,.45), 0 0 0 24px rgba(106,75,216,.2); }
.avatar.listening { box-shadow:0 0 0 10px rgba(46,139,87,.6), 0 0 0 24px rgba(46,139,87,.25); }
.avatar.thinking { opacity:.6; }
.state { font-size:22px; font-weight:600; margin:0; min-height:32px; }
.caption { font-size:20px; margin:14px 0 0; min-height:60px; color:#e9e5f5; }
.caption.off { visibility:hidden; }
.heard { font-size:16px; margin:8px 0 0; min-height:24px; color:#8fd3a8; }
#typeForm { width:100%; margin-top:10px; }
#typeBox { width:100%; font:inherit; padding:12px; border-radius:10px; border:0; }
.controls { width:100%; margin-top:auto; padding-top:20px; }
.controls button { background:#2a2636; border-color:#3a3550; color:#fff; }
.mic { width:100%; padding:18px; font-size:18px; font-weight:700; background:var(--accent) !important; border-color:var(--accent) !important; }
.mic.live { background:var(--ok) !important; border-color:var(--ok) !important; }
.row { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:10px; }
.row button { padding:10px 4px; font-size:14px; }
.voicehelp { color:#b9b3c9; font-size:14px; margin:auto 0 0; padding-top:20px; }
.end { background:transparent; border-color:#5a2b2b; color:#ff9c9c; margin-top:14px; width:100%; }
#call.handsfree .controls { display:none; }
#call.tap .voicehelp { display:none; }

.stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:16px; }
.stat { background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px; }
.stat b { display:block; font-size:24px; }
.stat span { font-size:12px; color:var(--mute); }
.fix { background:#fff; border:1px solid var(--line); border-radius:12px; padding:12px; margin-bottom:8px; }
.fix .said { color:var(--warn); text-decoration:line-through; }
.fix .better { font-weight:700; }
.fix .why { color:var(--mute); font-size:14px; }
.line { margin:4px 0; font-size:15px; }
.line.lily { color:var(--mute); }
.line b { font-weight:600; }
.voice { display:grid; grid-template-columns:1fr auto; gap:8px; }
.voice select { font:inherit; padding:10px; border-radius:12px; border:1px solid var(--line); background:#fff; min-width:0; }

/* study flow */
.field { font:inherit; width:100%; padding:12px; border-radius:12px; border:1px solid var(--line); background:#fff; }
.opts { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.opts.two { grid-template-columns:1fr 1fr; } .opts.three { grid-template-columns:repeat(3,1fr); }
.opts button { font-weight:600; padding:12px 4px; }
.opts .on { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
#after h2 { text-transform:none; letter-spacing:0; font-size:15px; color:var(--ink); margin:22px 0 8px; }
.cmp { width:100%; border-collapse:collapse; margin-top:18px; }
.cmp th, .cmp td { text-align:left; padding:10px 6px; border-bottom:1px solid var(--line); font-size:15px; }
button:disabled { opacity:.5; cursor:default; }
