/* English Trainer — design system v3 (matches design/Design.md tokens) */
:root{
  --white:#FFFFFF; --surface:#F9FAFB; --surface-blue:#F0F7FF;
  --track:#EEF0F3; --border:#E5E7EB; --ink:#111827; --muted:#6B7280; --muted-2:#9CA3AF;
  --blue:#2563EB; --teal:#0FB8B8; --green:#10B981; --amber:#F59E0B; --red:#EF4444;
  --grad:linear-gradient(135deg,#0FB8B8,#2563EB);
  --highlight:#FEF08A;
  --badge-due:#FEF3C7; --badge-due-t:#92400E;
  --badge-new:#EFF6FF; --badge-new-t:#1D4ED8;
  --badge-done:#ECFDF5; --badge-done-t:#065F46;
  --badge-none:#F3F4F6; --badge-none-t:#6B7280;
  --r-card:16px; --r-sm:14px; --r-btn:12px; --r-pill:999px;
  --sh:0 1px 3px rgba(0,0,0,.06),0 8px 24px rgba(0,0,0,.05);
  --sh-hover:0 6px 20px rgba(17,24,39,.10);
  --sidebar-w:260px; --content-max:680px;
  --font-body:'DM Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --font-mono:'DM Mono',ui-monospace,Menlo,monospace;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:var(--font-body); background:var(--surface); color:var(--ink); line-height:1.55; -webkit-font-smoothing:antialiased}
button{font-family:inherit; cursor:pointer; border:none; background:none}
.mono{font-family:var(--font-mono)}
.hidden{display:none !important}
.muted{color:var(--muted)} .small{font-size:13px}

/* ── Login (auth) ─────────────────────────────────────────── */
.auth-body{min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; background:var(--grad)}
.auth-card{width:100%; max-width:360px; background:#fff; border-radius:18px; box-shadow:var(--sh); padding:34px 28px; text-align:center}
.auth-logo{font-size:22px; font-weight:700; letter-spacing:-.3px}
.auth-sub{color:var(--muted); font-size:14px; margin:8px 0 22px}
.auth-input{width:100%; border:1px solid var(--border); border-radius:12px; padding:13px 14px; font-family:inherit; font-size:16px; text-align:center}
.auth-input:focus{outline:none; border-color:var(--teal); box-shadow:0 0 0 3px rgba(15,184,184,.14)}
.auth-err{color:#B91C1C; background:#FEF2F2; border-radius:10px; padding:9px; font-size:13px; margin-top:12px}
.auth-btn{width:100%; margin-top:16px; padding:13px; border-radius:12px; background:var(--grad); color:#fff; font-weight:600; font-size:15px}
.auth-btn:hover{filter:brightness(1.05)}

/* ── Layout shell ─────────────────────────────────────────── */
.layout{display:block}
.sidebar{display:none}
.main{padding:18px 16px 84px; max-width:760px; margin:0 auto}
.logo-mark{width:30px; height:30px; border-radius:9px; background:var(--grad); color:#fff; font-weight:700; display:inline-flex; align-items:center; justify-content:center; font-size:17px; flex:0 0 auto}

/* top bar (mobile, home only) */
.topbar{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:16px}
.topbar .brand{display:flex; align-items:center; gap:9px; font-weight:700}
.streak{display:inline-flex; align-items:center; gap:4px; background:#FFF7ED; border:1px solid #FED7AA; color:#9A3412; font-weight:700; font-size:13px; border-radius:var(--r-pill); padding:4px 11px}

/* in-content header (deeper screens) */
.vhead{display:flex; align-items:center; gap:12px; margin-bottom:6px}
.backbtn{width:40px; height:40px; border-radius:11px; border:1px solid var(--border); background:#fff; font-size:18px; display:flex; align-items:center; justify-content:center; flex:0 0 auto}
.backbtn:hover{background:var(--surface)}
.vtitle{font-size:21px; font-weight:700; letter-spacing:-.2px}
.crumb{font-family:var(--font-mono); font-size:11.5px; color:var(--muted-2); margin:2px 0 14px; padding-left:52px}

/* ── Buttons ──────────────────────────────────────────────── */
.btn{padding:12px 18px; border-radius:var(--r-btn); font-weight:600; font-size:14.5px; background:var(--surface); color:var(--ink); border:1px solid transparent; transition:.18s; min-height:48px; display:inline-flex; align-items:center; justify-content:center; gap:7px}
.btn:active{transform:scale(.98)}
.btn.primary{background:var(--grad); color:#fff; box-shadow:0 6px 16px rgba(37,99,235,.22)}
.btn.primary:hover{filter:brightness(1.04)}
.btn.ghost{background:#fff; border:1px solid var(--border); color:var(--ink)}
.btn.ghost:hover{background:var(--surface)}
.btn.dark{background:var(--ink); color:#fff}
.btn.block{display:flex; width:100%}
.btn:disabled{background:var(--border); color:var(--muted-2); cursor:not-allowed; box-shadow:none}
.btn-xs{min-height:0; padding:7px 13px; font-size:12.5px; border-radius:10px}
.row{display:flex; gap:10px; flex-wrap:wrap} .grow{flex:1}

/* ── Cards & primitives ───────────────────────────────────── */
.card{background:#fff; border:1px solid var(--border); border-radius:var(--r-card); box-shadow:var(--sh); padding:20px; margin-bottom:14px}
.eyebrow{font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.1em}
.seclabel{font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:var(--muted); margin:18px 2px 10px}
.track{height:8px; border-radius:var(--r-pill); background:var(--track); overflow:hidden}
.track.h6{height:6px} .track.h4{height:4px}
.track>i{display:block; height:100%; background:var(--grad); border-radius:var(--r-pill); transition:width .4s ease}
.pill{display:inline-flex; align-items:center; gap:5px; padding:5px 11px; border-radius:var(--r-pill); font-size:11px; font-weight:700; letter-spacing:.02em; background:var(--surface); border:1px solid var(--border); color:var(--muted)}
.badge{display:inline-flex; align-items:center; gap:4px; padding:5px 10px; border-radius:var(--r-pill); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.02em}
.badge.due{background:var(--badge-due); color:var(--badge-due-t)}
.badge.new{background:var(--badge-new); color:var(--badge-new-t)}
.badge.done{background:var(--badge-done); color:var(--badge-done-t)}
.badge.progress{background:var(--badge-none); color:var(--badge-none-t)}
.spread{display:flex; align-items:center; justify-content:space-between; gap:10px}

/* ── Today card ───────────────────────────────────────────── */
.today{display:flex; align-items:center; gap:16px; flex-wrap:wrap}
.today .t-left{flex:1; min-width:200px}
.today .t-eyebrow{margin-bottom:8px}
.today .t-eyebrow.due{color:var(--badge-due-t)} .today .t-eyebrow.caught{color:var(--badge-done-t)} .today .t-eyebrow.newu{color:var(--badge-new-t)}
.today .t-count{font-size:30px; font-weight:700; line-height:1.1}
.today .t-count small{font-size:18px; font-weight:400; color:var(--muted)}
.today .t-sub{font-size:14px; color:var(--muted); margin-top:2px}
/* guided daily-plan card */
.today.guided{align-items:stretch}
.dp-list{list-style:none; margin:10px 0 0; padding:0; display:flex; flex-direction:column; gap:8px}
.dp-list li{display:flex; align-items:center; gap:10px; font-size:15.5px; font-weight:600}
.dp-ic{display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:9px; background:var(--surface); font-size:16px; flex:none}
.how-strip{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:14px; padding-top:12px; border-top:1px dashed var(--border); font-size:12.5px; color:var(--muted)}
.how-strip b{display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background:var(--grad); color:#fff; font-size:11px; margin-right:5px}
.how-arr{color:var(--muted-2)}
.btn.big{min-height:54px; padding:14px 26px; font-size:16px; align-self:center}
.today.done .btn.big{align-self:center}
.dc-recap{margin:16px auto; max-width:320px; display:flex; flex-direction:column; gap:8px}
.dc-line{display:flex; justify-content:space-between; background:#fff; border:1px solid var(--border); border-radius:var(--r-sm); padding:11px 14px; font-weight:600; font-size:14.5px}
/* interview-focus card (reuses .today flex layout) */
.ifocus{display:flex; align-items:center; gap:16px; flex-wrap:wrap; border:1px solid var(--border)}
.ifocus .t-left{flex:1; min-width:200px}
.ifocus .t-eyebrow{margin-bottom:6px; color:var(--badge-due-t)}
/* learn→practice break screen */
.view-centered{display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:50vh; text-align:center; padding:32px}
.break-icon{font-size:46px; line-height:1; margin-bottom:8px; color:var(--green)}
.break-sub{max-width:340px}
/* customize-for-a-company */
.cz-intro{font-size:14px;line-height:1.55;color:var(--muted);background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:12px 14px;margin-bottom:14px}
.cz-intro code,.callout code{background:var(--border);padding:1px 5px;border-radius:5px;font-size:12px;font-family:var(--font-mono,monospace)}
.cz-in{width:100%;border:1px solid var(--border);border-radius:10px;padding:11px 12px;font-family:inherit;font-size:14px;background:#fff}
.cz-in:focus{outline:none;border-color:var(--blue,#2563EB)}
textarea.cz-in{resize:vertical;line-height:1.5}
.cz-prompt{min-height:240px;font-family:var(--font-mono,monospace);font-size:12.5px;white-space:pre;overflow:auto}
.today .t-chips{display:flex; flex-wrap:wrap; gap:7px; margin-top:12px}

/* ── Skill rows / cards (Home) ────────────────────────────── */
.skill-row{background:#fff; border:1px solid var(--border); border-radius:var(--r-card); box-shadow:var(--sh); padding:18px; margin-bottom:12px; cursor:pointer; transition:.18s}
.skill-row:hover{transform:translateY(-2px); box-shadow:var(--sh-hover); border-color:#D1D5DB}
.skill-row .sr-top{display:flex; align-items:center; gap:10px}
.skill-row .sr-emoji{font-size:22px} .skill-row .sr-name{font-size:16px; font-weight:700; flex:1} .skill-row .sr-arrow{color:#C4C9D2; font-size:18px}
.skill-row .sr-foot{display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:12px; color:var(--muted); margin-top:9px}

/* ── Category / deck cards ────────────────────────────────── */
.gcard{background:#fff; border:1px solid var(--border); border-radius:var(--r-card); box-shadow:var(--sh); padding:17px 18px; margin-bottom:12px; cursor:pointer; transition:.18s}
.gcard:hover{transform:translateY(-2px); box-shadow:var(--sh-hover); border-color:#D1D5DB}
.gcard .gc-top{display:flex; align-items:flex-start; justify-content:space-between; gap:10px}
.gcard .gc-title{font-size:16px; font-weight:700}
.gcard .gc-sub{font-size:13px; color:var(--muted); margin-top:2px}
.gcard .gc-foot{font-family:var(--font-mono); font-size:12px; color:var(--muted-2); margin-top:10px; display:flex; justify-content:space-between}

/* ── Session chrome ───────────────────────────────────────── */
.session-wrap{transition:background-color .3s ease}
.phase-ind{display:flex; align-items:center; justify-content:center; gap:0; margin:14px 0 6px}
.phase-dot{width:14px; height:14px; border-radius:50%; border:2px solid var(--border); background:#fff; flex:0 0 auto}
.phase-dot.on{background:var(--blue); border-color:var(--blue)}
.phase-line{width:44px; height:2px; background:var(--border); margin:0 8px}
.phase-lbl{font-size:11px; font-weight:700; letter-spacing:.08em; color:var(--muted-2)}
.phase-lbl.on{color:var(--blue)}
.phase-row{display:flex; align-items:center; justify-content:center; gap:8px; margin-bottom:4px}
.mode-label{font-size:13px; color:var(--muted); text-align:center; margin-bottom:14px}
.eyebrow-q{color:var(--muted); margin-bottom:6px}
.prompt{font-size:21px; font-weight:600; line-height:1.4; margin:2px 0}
.ctx-line{font-style:italic; color:var(--muted); background:var(--surface); border-radius:10px; padding:8px 12px; font-size:14px; margin-bottom:10px}
.bubble{background:#F3F4F6; border-radius:14px 14px 14px 4px; padding:12px 15px; font-size:16px; margin:10px 0}
.bubble.you{background:var(--badge-done); border:1px solid #A7F3D0; border-radius:14px 14px 4px 14px; color:#065F46}

.model-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm); padding:15px; font-size:15px; line-height:1.65; white-space:pre-wrap}
.model-card.green{background:var(--badge-done); border-color:#A7F3D0}
.model-card mark{background:var(--highlight); padding:0 2px; border-radius:3px}
.keypts{margin:10px 0}
.keypt{display:flex; gap:9px; padding:6px 0; font-size:14.5px; line-height:1.5}
.keypt .dot{color:var(--blue); font-weight:700}
.keypt.hit .ic{color:#047857; font-weight:700} .keypt.miss .ic{color:var(--muted-2); font-weight:700}

.listen-btn{background:#EEF2FF; color:var(--blue); border:1px solid #E0E7FF; border-radius:var(--r-pill); padding:8px 15px; font-weight:600; font-size:13px; display:inline-flex; gap:6px; align-items:center}
.shadow-row{display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:14px 0}
.rep-dots{display:flex; gap:6px}
.rep-dot{width:11px; height:11px; border-radius:50%; border:1.5px solid var(--blue); background:#fff}
.rep-dot.on{background:var(--blue)}
.rep-n{font-family:var(--font-mono); font-size:12px; color:var(--muted)}

.tabs{display:flex; gap:6px; margin:14px 0 10px}
.tab{padding:9px 16px; border-radius:10px; font-size:13px; font-weight:600; background:var(--surface); color:var(--muted); border:1px solid transparent}
.tab.on{background:#EFF6FF; color:var(--blue); border-color:#BFDBFE}
.microw{display:flex; align-items:center; gap:12px; margin:8px 0}
.micbtn{width:50px; height:50px; border-radius:50%; background:var(--grad); color:#fff; font-size:19px; display:flex; align-items:center; justify-content:center; flex:0 0 auto}
.micbtn.rec{background:var(--red); animation:pulse 1.2s infinite}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(239,68,68,.5)}70%{box-shadow:0 0 0 13px rgba(239,68,68,0)}100%{box-shadow:0 0 0 0 rgba(239,68,68,0)}}
.mic-hint{font-size:13px; color:var(--muted)}
textarea{width:100%; min-height:130px; border:1px solid var(--border); border-radius:12px; padding:13px; font-family:inherit; font-size:15px; resize:vertical; line-height:1.55}
textarea:focus{outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(37,99,235,.12)}

.cover-num{font-family:var(--font-mono); font-size:30px; font-weight:700}
.cover-num.hi{color:var(--green)} .cover-num.mid{color:var(--amber)} .cover-num.lo{color:var(--red)}
details{margin:10px 0} summary{cursor:pointer; font-weight:600; font-size:14px; color:var(--blue); padding:5px 0}
.callout{background:#F0FDFA; border-left:3px solid var(--teal); border-radius:8px; padding:11px 14px; font-size:14px; line-height:1.6; margin:12px 0}
.callout b{display:block; font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:#0E7490; margin-bottom:2px}
.chips{display:flex; flex-wrap:wrap; gap:7px} .chip{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-pill); padding:5px 12px; font-size:13px; font-weight:500}
.alt{background:#fff; border:1px solid var(--border); border-radius:10px; padding:10px 13px; font-size:14px; margin-bottom:8px}
.check{display:flex; align-items:flex-start; gap:10px; padding:8px 0; font-size:14.5px; cursor:pointer}
.check .box{width:20px; height:20px; border-radius:6px; border:2px solid var(--border); flex:0 0 auto; margin-top:1px; display:flex; align-items:center; justify-content:center; font-size:13px; color:#fff}
.check.on .box{background:var(--green); border-color:var(--green)}
.cue{margin:10px 0 0; padding-left:20px} .cue li{margin:4px 0}
.bullets{margin:6px 0 0; padding-left:20px} .bullets li{margin:4px 0; font-size:14px}

/* grade buttons */
.grades{display:grid; gap:8px; margin-top:6px}
.grades.g4{grid-template-columns:repeat(4,1fr)} .grades.g3{grid-template-columns:repeat(3,1fr)} .grades.g2{grid-template-columns:repeat(2,1fr)}
.grades button{padding:12px 6px; border-radius:11px; font-weight:700; font-size:13.5px; border:1px solid transparent}
.g-forgot{background:#FEF2F2; color:#B91C1C; border-color:#FECACA}
.g-hard{background:#FFFBEB; color:#B45309; border-color:#FDE68A}
.g-good{background:#ECFDF5; color:#047857; border-color:#A7F3D0}
.g-easy{background:#EFF6FF; color:#1D4ED8; border-color:#BFDBFE}

/* leitner box dots */
.boxdots{display:inline-flex; gap:4px}
.bd{width:9px; height:9px; border-radius:50%; background:var(--border)}
.bd.on{background:var(--blue)}

/* teleprompter */
.tele-time{font-family:var(--font-mono); font-size:22px; font-weight:700}
.tele-time.over{color:var(--red)}
.tele-body{background:#fff; border:1px solid var(--border); border-radius:var(--r-card); padding:24px; white-space:pre-wrap; line-height:1.7; box-shadow:var(--sh)}
input[type=range]{accent-color:var(--teal)}

/* flashcard */
.flash{background:#fff; border:1px solid var(--border); border-radius:var(--r-card); box-shadow:var(--sh); padding:34px 22px; text-align:center; margin:10px 0}
.flash .head{font-size:27px; font-weight:700; letter-spacing:-.3px}

/* completion */
.complete{text-align:center; padding:24px 0}
.check-circle{width:84px; height:84px; border-radius:50%; background:var(--badge-done); border:1px solid #A7F3D0; color:#10B981; font-size:40px; display:flex; align-items:center; justify-content:center; margin:0 auto 16px; animation:pop .5s ease}
@keyframes pop{0%{transform:scale(.6); opacity:0}60%{transform:scale(1.08)}100%{transform:scale(1); opacity:1}}
.comp-stats{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:18px 0}
.comp-stat{background:#fff; border:1px solid var(--border); border-radius:var(--r-sm); padding:14px 8px}
.comp-stat .v{font-size:22px; font-weight:700; font-family:var(--font-mono)} .comp-stat .l{font-size:11px; color:var(--muted); margin-top:3px}

/* feedback rise anim */
.rise{animation:rise .3s ease}
@keyframes rise{from{transform:translateY(8px); opacity:0}to{transform:translateY(0); opacity:1}}

/* ── Bottom nav (mobile) ──────────────────────────────────── */
.bottomnav{position:fixed; bottom:0; left:0; right:0; height:62px; background:#fff; border-top:1px solid var(--border); display:flex; z-index:40}
.bottomnav button{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; color:var(--muted-2); font-size:11px; font-weight:600; position:relative; padding-top:3px}
.bottomnav button .bn-ic{font-size:21px; filter:grayscale(1); opacity:.6}
.bottomnav button.on{color:var(--blue)}
.bottomnav button.on .bn-ic{filter:none; opacity:1}
.bottomnav button.on::before{content:''; position:absolute; top:0; left:50%; transform:translateX(-50%); width:34px; height:3px; background:var(--blue); border-radius:0 0 3px 3px}

/* ── Sidebar (desktop) ────────────────────────────────────── */
@media(min-width:768px){
  .sidebar{display:flex; flex-direction:column; position:fixed; top:0; left:0; width:var(--sidebar-w); height:100vh; overflow-y:auto; background:#fff; border-right:1px solid var(--border); padding:20px 14px}
  .main{margin-left:var(--sidebar-w); max-width:calc(var(--sidebar-w) + var(--content-max)); padding:32px; margin-right:0}
  .bottomnav{display:none}
  .topbar{display:none}
  .crumb{padding-left:0}
  .sb-brand{display:flex; align-items:center; gap:9px; font-weight:700; font-size:16px; padding:4px 6px 14px}
  .sb-streak{margin:0 6px 14px}
  .sb-today{margin:0 6px 16px; background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:12px}
  .sb-today .lbl{font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--muted)}
  .sb-today .big{font-size:15px; font-weight:700; margin:3px 0 8px}
  .sb-today.done{background:var(--badge-done); border-color:transparent}
  .sb-today.done .big{color:var(--badge-done-t)}
  .sb-sec{font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--muted-2); padding:6px 6px 4px}
  .sb-skill{display:flex; align-items:center; gap:8px; padding:9px 8px; border-radius:9px; font-weight:600; font-size:14px; cursor:pointer}
  .sb-skill:hover{background:var(--surface)}
  .sb-skill .chev{margin-left:auto; color:var(--muted-2); font-size:11px}
  .sb-cat{display:flex; align-items:center; gap:7px; padding:7px 8px 7px 30px; border-radius:8px; font-size:13.5px; color:var(--muted); cursor:pointer; border-left:2px solid transparent}
  .sb-cat:hover{background:var(--surface); color:var(--ink)}
  .sb-cat.on{border-left:2px solid var(--blue); background:#F0F7FF; color:var(--ink); font-weight:700}
  .sb-cat .due-dot{margin-left:auto; width:7px; height:7px; border-radius:50%; background:var(--amber)}
  .sb-admin{margin-top:auto; padding-top:14px}
  .home-foot{display:none}
  .desk-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px}
  .h1{font-size:26px; font-weight:700; letter-spacing:-.3px; margin:0 0 16px}
}
@media(max-width:767px){ .h1{display:none} .desk-only{display:none} }

/* toast */
.toast{position:fixed; bottom:78px; left:50%; transform:translateX(-50%); background:var(--ink); color:#fff; padding:12px 22px; border-radius:var(--r-pill); font-size:14px; font-weight:600; box-shadow:0 10px 30px rgba(0,0,0,.25); opacity:0; transition:.25s; pointer-events:none; z-index:60}
.toast.show{opacity:1}
@media(min-width:768px){.toast{bottom:24px}}
.empty{text-align:center; color:var(--muted); padding:40px 16px}
.home-foot{text-align:center; margin-top:26px}
.adminlink{color:var(--muted-2); font-size:13px; font-weight:600; padding:8px}
.adminlink:hover{color:var(--ink)}
