/* IamLearn — design tokens */
:root {
  --green: #58cc02; --green-d: #58a700; --green-l: #d7ffb8; --green-t: #3d8c00;
  --blue: #1cb0f6; --blue-d: #1899d6; --blue-l: #ddf4ff;
  --red: #ff4b4b; --red-d: #ea2b2b; --red-l: #ffdfe0;
  --gold: #ffc800; --gold-d: #e5b400; --orange: #ff9600; --purple: #ce82ff;
  --bg: #ffffff; --bg2: #f7f7f7; --card: #ffffff; --line: #e5e5e5; --line-d: #cfcfcf;
  --text: #3c3c3c; --muted: #777777; --shadow: 0 2px 0 var(--line);
  --radius: 16px; --nav-h: 64px; --side-w: 248px;
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131f24; --bg2: #1a2a31; --card: #1f323a; --line: #37464f; --line-d: #4b5c66;
    --text: #e8eef1; --muted: #9fb0b8; --green-l: #1f3a1a; --blue-l: #12384a; --red-l: #4a2124; --green-t: #7fe02f;
    --shadow: 0 2px 0 var(--line);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
input, select, textarea { font-size: 16px; } /* iOS zooms into smaller inputs on focus */
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 800; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
a { color: var(--blue-d); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center-text { text-align: center; } .center { text-align: center; }
.lead { font-size: 1.1rem; color: var(--muted); }
.ico { display: inline-flex; vertical-align: middle; flex: none; }
.stack { display: flex; flex-direction: column; gap: 16px; } .stack.tight { gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; } .row.gap { gap: 12px; } .row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; } .row.center { justify-content: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.nowrap { white-space: nowrap; }
.spinner { width: 36px; height: 36px; border: 4px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot, .fatal { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; background: var(--card); color: var(--blue-d); font-weight: 800; letter-spacing: .03em; text-transform: uppercase; font-size: .9rem; transition: transform .05s, filter .15s; min-height: 46px; }
.btn:hover { filter: brightness(.97); } .btn:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.btn.primary { background: var(--green); border-color: var(--green-d); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red-d); color: #fff; }
.btn.ghost { background: var(--card); color: var(--blue-d); }
.btn.small { padding: 8px 14px; min-height: 38px; font-size: .8rem; } .btn.big { padding: 14px 28px; font-size: 1rem; min-height: 52px; } .btn.wide { width: 100%; }
.btn:disabled { background: var(--bg2); color: var(--muted); border-color: var(--line); cursor: not-allowed; filter: none; }
.btn.busy { opacity: .7; pointer-events: none; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 10px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
.icon-btn:hover { background: var(--bg2); color: var(--text); } .icon-btn.tiny { min-width: 28px; min-height: 28px; padding: 4px; }
.link-btn { background: none; border: 0; color: var(--blue-d); font-weight: 700; padding: 8px; text-decoration: underline; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; } .field-label { font-weight: 700; font-size: .9rem; } .field-hint { font-size: .8rem; color: var(--muted); }
.text-input { width: 100%; padding: 12px 14px; font: inherit; color: var(--text); background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; min-height: 46px; }
.text-input:focus { border-color: var(--blue); outline: none; background: var(--card); }
.text-input.ok { border-color: var(--green); } .text-input.bad { border-color: var(--red); }
textarea.text-input { resize: vertical; }
.form-error { color: var(--red-d); font-weight: 700; min-height: 1.2em; font-size: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; } .toggle input { width: 20px; height: 20px; accent-color: var(--green); }
.search { margin: 0; }

/* Cards, chips, tags */
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); font-size: .75rem; font-weight: 800; margin-left: 6px; text-transform: uppercase; letter-spacing: .03em; }
.tag.ok { background: var(--green-l); color: var(--green-t); border-color: transparent; } .tag.bad { background: var(--red-l); color: var(--red-d); border-color: transparent; } .tag.big { font-size: .9rem; padding: 4px 12px; margin: 0; text-transform: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--bg2); border: 2px solid var(--line); font-weight: 800; font-size: .9rem; }
.chip.streak { color: var(--orange); } .chip.xp { color: var(--gold-d); } .chip.level { color: var(--blue-d); cursor: pointer; }
.chip-btn { border: 2px solid var(--line); background: var(--card); padding: 6px 14px; border-radius: 99px; font-weight: 700; } .chip-btn.active { background: var(--blue-l); border-color: var(--blue); color: var(--blue-d); }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: .9rem; } .avatar.lg { width: 84px; height: 84px; font-size: 2.2rem; } .avatar.bot { background: var(--purple); }
.flame { color: var(--orange); } .gold { color: var(--gold); }
.big-emoji { font-size: 4rem; line-height: 1.1; margin-bottom: 8px; }

/* Layout shell */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--side-w) 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 2px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--green); font-weight: 900; font-size: 1.5rem; padding: 4px 10px 14px; }
.logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--green); color: #fff; font-weight: 900; border-bottom: 4px solid var(--green-d); }
.logo.big { width: 72px; height: 72px; font-size: 2.4rem; border-radius: 20px; margin-bottom: 14px; background: #fff; color: var(--green-d); border-color: rgba(0,0,0,.15); }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: .85rem; border: 2px solid transparent; }
.nav-link:hover { background: var(--bg2); } .nav-link.active { background: var(--blue-l); border-color: var(--blue); color: var(--blue-d); }
.side-user { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px; border-top: 2px solid var(--line); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 28px 32px 48px; flex: 1; }
.page-narrow, .page-wide { margin: 0 auto; display: flex; flex-direction: column; gap: 16px; } .page-narrow { max-width: 680px; } .page-wide { max-width: 1100px; }
.page-head { display: flex; align-items: center; gap: 12px; } .page-head h1 { margin: 0; flex: 1; }
.bottom-nav { display: none; }
.section-title { margin: 8px 0; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); overflow-x: auto; flex: none; }
.tab { background: none; border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px; padding: 10px 16px; font-weight: 800; color: var(--muted); text-transform: uppercase; font-size: .85rem; letter-spacing: .04em; white-space: nowrap; }
.tab.active { color: var(--blue-d); border-bottom-color: var(--blue); }

/* Home / path */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; max-width: 1000px; margin: 0 auto; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; }
.hero-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--green); color: #fff; border-radius: var(--radius); padding: 20px 24px; margin-bottom: 20px; border-bottom: 5px solid var(--green-d); }
.hero-card h2 { margin: 2px 0; font-size: 1.4rem; } .hero-card .muted { color: rgba(255,255,255,.85); } .hero-card .eyebrow { color: rgba(255,255,255,.8); }
.hero-card .btn { background: #fff; color: var(--green-t); border-color: #d6d6d6; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-weight: 800; font-size: .75rem; color: var(--muted); }
.unit { margin-bottom: 36px; --uc: var(--green); --ud: var(--green-d); }
.unit.c1 { --uc: var(--blue); --ud: var(--blue-d); } .unit.c2 { --uc: var(--purple); --ud: #a559d6; } .unit.c3 { --uc: var(--orange); --ud: #d97c00; } .unit.c4 { --uc: #ff6f91; --ud: #d9486b; } .unit.c5 { --uc: #00cd9c; --ud: #00a37c; }
.unit-head { display: flex; align-items: center; justify-content: space-between; background: var(--uc); color: #fff; border-radius: 16px; padding: 14px 18px; border-bottom: 5px solid var(--ud); margin-bottom: 18px; }
.unit-head h3 { margin: 0; font-size: 1.15rem; } .unit-head .eyebrow { color: rgba(255,255,255,.85); } .unit-prog { font-weight: 800; background: rgba(0,0,0,.15); padding: 4px 12px; border-radius: 99px; }
.nodes { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.node-wrap { position: relative; width: 100%; height: 108px; }
.node { position: relative; width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--uc); color: #fff; box-shadow: 0 6px 0 var(--ud); display: grid; place-items: center; transition: transform .1s; }
.node:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--ud); }
.node.done { background: var(--gold); box-shadow: 0 6px 0 var(--gold-d); } .node.locked { background: var(--bg2); color: var(--line-d); box-shadow: 0 6px 0 var(--line); cursor: not-allowed; }
.node.current { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 6px 0 var(--ud), 0 0 0 0 color-mix(in srgb, var(--uc) 50%, transparent); } 50% { box-shadow: 0 6px 0 var(--ud), 0 0 0 12px transparent; } }
.node-wrap @keyframes bob { to { transform: translateY(-4px); } }
.mini-stars i { width: 10px; height: 10px; background: var(--line); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); } .mini-stars i.on { background: var(--gold); }
.slot { position: relative; width: 72px; }
.start-bubble { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--card); color: var(--uc); border: 2px solid var(--line); padding: 3px 12px; border-radius: 12px; font-weight: 800; text-transform: uppercase; font-size: .8rem; z-index: 1; animation: bob 1s infinite alternate; pointer-events: none; }
@keyframes bob { to { margin-top: -4px; } }
.mini-stars { position: absolute; display: flex; gap: 2px; left: 50%; transform: translateX(-50%); bottom: -14px; }
.ring { position: relative; width: 104px; height: 104px; flex: none; } .ring svg { display: block; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 10; } .ring-fg { fill: none; stroke: var(--green); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; } .ring-text strong { font-size: 1.5rem; } .ring-text span { font-size: .7rem; color: var(--muted); }
.stat-line { display: flex; align-items: center; gap: 6px; } .stat-line strong { font-size: 1.2rem; }
.week { display: flex; justify-content: space-between; gap: 6px; margin-top: 14px; }
.wd { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .7rem; color: var(--muted); font-weight: 700; }
.wd-bar { width: 100%; height: 48px; background: var(--bg2); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; } .wd-bar i { display: block; width: 100%; background: var(--blue); border-radius: 6px; } .wd.goal .wd-bar i { background: var(--green); }

.goal-strip { display: none; align-items: center; gap: 10px; font-weight: 800; font-size: .85rem; margin-bottom: 14px; } .goal-strip .progress { flex: 1; }
/* Practice / lists */
.practice-card, .act-card { display: flex; align-items: center; gap: 16px; text-align: left; width: 100%; }
.act-card { cursor: pointer; } .act-card:hover { border-color: var(--blue); }
.pc-emoji { font-size: 2.4rem; } .pc-body { flex: 1; } .pc-body h3 { margin: 0 0 2px; } .pc-body p { margin: 0; }
.vocab-level { margin: 20px 0 6px; color: var(--green-t); text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; }
.vocab-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.v-emoji { font-size: 1.7rem; width: 40px; text-align: center; } .v-main { flex: 1; min-width: 0; } .v-en { font-weight: 800; } .v-meta { display: flex; align-items: center; gap: 6px; }
.strength { display: flex; gap: 2px; } .strength i { width: 8px; height: 18px; border-radius: 3px; background: var(--line); } .strength i.on { background: var(--green); }
.lb { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); } .lb-row.me { border-color: var(--blue); background: var(--blue-l); }
.lb-rank { width: 32px; text-align: center; font-weight: 800; font-size: 1.2rem; } .lb-name { flex: 1; font-weight: 700; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); } .empty.small { padding: 16px; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; } .ph-main { flex: 1; min-width: 200px; } .ph-main h1 { margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; } .stat strong { font-size: 1.5rem; line-height: 1.2; } .stat span { color: var(--muted); font-size: .85rem; font-weight: 700; } .stat-emoji { font-size: 1.4rem; }
.chart svg { width: 100%; height: auto; display: block; } .chart-axis { stroke: var(--line); } .chart-lbl { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.bars { display: flex; flex-direction: column; gap: 10px; } .bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 54px; align-items: center; gap: 10px; } .bar-label { font-weight: 700; font-size: .9rem; } .bar-val { text-align: right; font-weight: 800; font-size: .85rem; color: var(--muted); }
.progress { height: 16px; background: var(--line); border-radius: 99px; overflow: hidden; flex: 1; } .progress.thin { height: 12px; } .progress-fill { height: 100%; background: var(--green); border-radius: 99px; transition: width .35s; position: relative; } .progress-fill::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; background: rgba(255,255,255,.35); border-radius: 4px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach { border: 2px dashed var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; opacity: .55; filter: grayscale(1); } .ach.on { opacity: 1; filter: none; border-style: solid; border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--card)); } .ach span { font-size: .78rem; color: var(--muted); } .ach-ico { font-size: 1.8rem; }

/* Tables */
.table-wrap { overflow-x: auto; } .tbl { width: 100%; border-collapse: collapse; font-size: .92rem; } .tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); } .tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; } .tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover td { background: var(--bg2); }
.split { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; } .tree { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; } .tree-unit { margin: 0; } .tree-lessons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* Modal & toast */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal { background: var(--card); border-radius: 20px; width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); } .modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; } .modal-head h2 { margin: 0; } .modal-body { padding: 16px 20px 20px; overflow: auto; }
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 300; width: min(92vw, 420px); }
.toast { background: #333; color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.3); animation: slide .25s; } .toast.ok { background: var(--green-d); } .toast.bad { background: var(--red-d); } .toast.out { opacity: 0; transition: opacity .4s; }
@keyframes slide { from { transform: translateY(-12px); opacity: 0; } }

/* Auth & onboarding */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; } .auth.single { grid-template-columns: 1fr; }
.auth-hero { background: linear-gradient(135deg, var(--green), #2fb344 60%, var(--blue)); color: #fff; display: flex; align-items: center; justify-content: center; padding: 48px; }
.hero-inner { max-width: 440px; } .hero-inner h1 { font-size: 2.6rem; } .hero-inner .lead { color: rgba(255,255,255,.92); } .hero-points { list-style: none; padding: 0; font-weight: 800; line-height: 2; font-size: 1.05rem; }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; } .switch { text-align: center; margin-top: 16px; } .switch a { font-weight: 800; }
.lang-switch { display: flex; gap: 6px; align-self: flex-end; } .lang-btn { border: 2px solid var(--line); background: var(--card); border-radius: 10px; padding: 4px 10px; font-weight: 800; } .lang-btn.active { background: var(--blue-l); border-color: var(--blue); color: var(--blue-d); }
.onboard { max-width: 720px; margin: 0 auto; min-height: 100vh; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.ob-top { display: flex; justify-content: space-between; align-items: center; min-height: 40px; } .ob-body { flex: 1; } .ob-foot { display: flex; justify-content: flex-end; gap: 12px; position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 2px solid var(--line); }
.dots { display: flex; gap: 6px; } .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); } .dots i.on { background: var(--green); }
.choice { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; } .choice-btn { flex: 1; min-width: 140px; padding: 14px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; background: var(--card); font-weight: 800; } .choice-btn.sel { border-color: var(--blue); background: var(--blue-l); color: var(--blue-d); }
.level-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; } .level-card { text-align: left; padding: 16px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px; background: var(--card); display: flex; flex-direction: column; gap: 6px; } .level-card.sel { border-color: var(--blue); background: var(--blue-l); }
.level-title { font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; } .cefr { font-size: .7rem; padding: 2px 8px; border-radius: 99px; background: var(--bg2); color: var(--muted); border: 1px solid var(--line); } .level-desc { color: var(--muted); font-size: .88rem; }
.level-bars { display: flex; gap: 3px; align-items: flex-end; height: 22px; } .level-bars i { width: 8px; background: var(--line); border-radius: 2px; } .level-bars i:nth-child(1) { height: 25%; } .level-bars i:nth-child(2) { height: 50%; } .level-bars i:nth-child(3) { height: 75%; } .level-bars i:nth-child(4) { height: 100%; } .level-bars i.on { background: var(--green); }
.goal-cards { display: grid; gap: 10px; } .goal-card { display: flex; justify-content: space-between; padding: 16px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; background: var(--card); } .goal-card.sel { border-color: var(--blue); background: var(--blue-l); } .goal-card span { color: var(--muted); font-weight: 700; }
.check-list { text-align: left; display: inline-block; line-height: 2; }
.test-q { font-size: 1.4rem; margin: 24px 0; }

/* Session */
.session { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; z-index: 50; }
.session-top { display: flex; align-items: center; gap: 14px; padding: 14px 20px; max-width: 820px; width: 100%; margin: 0 auto; }
.session-stage { flex: 1; overflow-y: auto; padding: 8px 20px 24px; max-width: 820px; width: 100%; margin: 0 auto; } .session-stage.center { display: flex; align-items: center; justify-content: center; }
.ex { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; } .ex.enter { animation: enter .25s; } @keyframes enter { from { opacity: 0; transform: translateX(24px); } }
.ex-title { font-size: 1.5rem; font-weight: 800; }
.prompt { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 1.3rem; font-weight: 700; } .prompt.sentence { font-size: 1.4rem; line-height: 1.9; } .prompt.listen { justify-content: center; padding: 14px 0; } .prompt.picture { justify-content: center; } .prompt-sub { color: var(--muted); font-size: 1rem; font-weight: 600; width: 100%; }
.big-emoji { text-align: center; } .prompt .big-emoji { font-size: 6rem; } .prompt-emoji { font-size: 2rem; }
.blank { display: inline-block; min-width: 90px; border-bottom: 3px solid var(--line-d); margin: 0 6px; } .hint { color: var(--muted); font-style: italic; }
.speak-btn { border: 2px solid var(--blue); border-bottom-width: 4px; background: var(--blue-l); color: var(--blue-d); border-radius: 14px; width: 48px; height: 48px; display: grid; place-items: center; flex: none; } .speak-btn.small { width: 36px; height: 36px; border-radius: 10px; } .speak-btn.big { width: 44px; height: 44px; } .speak-btn.huge { width: 96px; height: 96px; border-radius: 24px; } .speak-btn.slow { background: var(--card); border-color: var(--line); color: var(--muted); } .speak-btn.playing { background: var(--blue); color: #fff; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; background: var(--card); font-size: 1.1rem; font-weight: 700; min-height: 56px; width: 100%; }
.option:hover:not(:disabled) { background: var(--bg2); } .option.selected { border-color: var(--blue); background: var(--blue-l); color: var(--blue-d); } .option.correct { border-color: var(--green); background: var(--green-l); color: var(--green-t); } .option.wrong { border-color: var(--red); background: var(--red-l); color: var(--red-d); }
.option .kbd { width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 8px; display: grid; place-items: center; font-size: .8rem; color: var(--muted); flex: none; } .reply .kbd { display: none; }
@media (hover: none) { .option .kbd { display: none; } }
.intro-card { text-align: center; padding: 28px 16px; border: 2px solid var(--line); border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.intro-emoji { font-size: 5.5rem; line-height: 1; } .intro-en { font-size: 2.2rem; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; } .intro-tr { font-size: 1.5rem; color: var(--green-t); font-weight: 800; } .intro-ex { color: var(--muted); display: flex; align-items: center; gap: 8px; font-style: italic; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .pairs .col { display: flex; flex-direction: column; gap: 10px; }
.pair { padding: 14px 10px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; background: var(--card); font-weight: 700; min-height: 56px; } .pair.sel { border-color: var(--blue); background: var(--blue-l); } .pair.done { opacity: .35; pointer-events: none; border-color: var(--green); }
.shake { animation: shake .4s; border-color: var(--red) !important; } @keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.order-area { min-height: 72px; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); padding: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 100%; }
.order-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 6px; }
.tile { padding: 10px 14px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; background: var(--card); font-weight: 700; font-size: 1.05rem; } .tile.ghost { background: var(--bg2); color: transparent; border-color: var(--bg2); }
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; } .mic { width: 88px; height: 88px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; box-shadow: 0 6px 0 var(--blue-d); display: grid; place-items: center; } .mic.live { background: var(--red); box-shadow: 0 6px 0 var(--red-d); animation: pulse2 1s infinite; } @keyframes pulse2 { 50% { transform: scale(1.08); } } .speak-result { min-height: 1.6em; font-weight: 700; }
.session-footer { border-top: 2px solid var(--line); background: var(--bg); } .footer-inner { max-width: 820px; margin: 0 auto; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; gap: 12px; } .footer-inner .btn { min-width: 160px; } .footer-inner.two { justify-content: space-between; }
.session-footer.good { background: var(--green-l); border-color: transparent; } .session-footer.bad { background: var(--red-l); border-color: transparent; }
.feedback { max-width: 820px; margin: 0 auto; padding: 14px 20px 0; display: flex; gap: 14px; align-items: center; } .fb-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; flex: none; } .good .fb-icon { color: var(--green); } .bad .fb-icon { color: var(--red); } .good .fb-text { color: var(--green-t); } .bad .fb-text { color: var(--red-d); } .fb-text strong { font-size: 1.15rem; } .fb-detail { font-weight: 700; } .fb-note { font-size: .9rem; opacity: .85; }
.result-card { text-align: center; max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.stars { display: flex; gap: 6px; } .star { color: var(--line); } .star.on { color: var(--gold); animation: pop .5s backwards; } @keyframes pop { from { transform: scale(0) rotate(-40deg); } }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; } .rs { border: 2px solid; border-radius: 14px; padding: 8px 4px 10px; display: flex; flex-direction: column; gap: 2px; } .rs span { font-size: .7rem; text-transform: uppercase; font-weight: 800; letter-spacing: .05em; } .rs strong { font-size: 1.4rem; } .rs.xp { border-color: var(--gold); color: var(--gold-d); } .rs.acc { border-color: var(--green); color: var(--green-t); } .rs.time { border-color: var(--blue); color: var(--blue-d); }
.goal-line { width: 100%; } .goal-text { font-weight: 700; margin-bottom: 6px; font-size: .9rem; }
.ach-chip { background: color-mix(in srgb, var(--gold) 20%, var(--card)); border: 2px solid var(--gold); padding: 6px 14px; border-radius: 99px; font-weight: 800; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; } .confetti i { position: absolute; top: -20px; width: 10px; height: 16px; animation: fall linear forwards; } @keyframes fall { to { top: 110vh; transform: rotate(720deg); } }

/* Reading + chat */
.reading { position: relative; font-size: 1.15rem; line-height: 1.9; margin-bottom: 18px; } .reading-p { margin-bottom: 1rem; } .rw { cursor: pointer; border-radius: 4px; } .rw:hover { background: var(--blue-l); }
.word-tip { position: absolute; z-index: 5; background: #333; color: #fff; padding: 6px 12px; border-radius: 10px; font-size: .95rem; font-weight: 700; max-width: 260px; } .gist { background: var(--blue-l); border-radius: 12px; padding: 12px 16px; margin: 12px 0; font-weight: 600; }
.quiz-fb { min-height: 1.6em; margin: 14px 0; font-weight: 800; }
.chat { display: flex; flex-direction: column; min-height: calc(100vh - 140px); } .chat-log { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 8px 0 16px; } .bubble-row { display: flex; gap: 8px; align-items: flex-end; } .bubble-row.me { justify-content: flex-end; }
.bubble { max-width: 80%; padding: 12px 16px; border-radius: 18px; display: flex; align-items: center; gap: 8px; font-size: 1.05rem; } .bubble.bot { background: var(--bg2); border: 2px solid var(--line); border-bottom-left-radius: 4px; } .bubble.me { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; } .bubble.me .icon-btn { color: #fff; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; } .typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; } @keyframes blink { 50% { opacity: .2; } }
.chat-dock { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0 12px; border-top: 2px solid var(--line); }

/* Mobile */
@media (max-width: 960px) {
  .home { grid-template-columns: 1fr; } .rail { position: static; flex-direction: row; flex-wrap: wrap; } .rail .card { min-width: 280px; flex: 1; }
  .split { grid-template-columns: 1fr; } .tree { position: static; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; } .sidebar { display: none; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 10px 14px; border-bottom: 2px solid var(--line); padding-top: calc(10px + env(safe-area-inset-top)); } .topbar .brand { padding: 0; } .topbar .chip.level { margin-right: auto; max-width: 48vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .content { padding: 16px 14px calc(var(--nav-h) + 28px); }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--bg); border-top: 2px solid var(--line); padding-bottom: env(safe-area-inset-bottom); } .bottom-nav .nav-link { flex: 1; flex-direction: column; gap: 2px; padding: 8px 2px; border-radius: 0; font-size: .6rem; letter-spacing: 0; text-align: center; min-height: var(--nav-h); justify-content: center; } .bottom-nav .nav-link.active { background: none; border-color: transparent; color: var(--blue-d); }
  .auth { grid-template-columns: 1fr; } .auth-hero { padding: 28px 20px; } .hero-inner h1 { font-size: 1.8rem; } .hero-points { display: none; } .logo.big { width: 56px; height: 56px; font-size: 1.8rem; }
  .chat-dock { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .goal-strip { display: flex; } .goal-card2 { display: none; }
  .hero-card { flex-direction: column; align-items: flex-start; } .hero-card .btn { width: 100%; }
  .ex-title { font-size: 1.25rem; } .prompt { font-size: 1.15rem; } .footer-inner .btn { flex: 1; } .session-stage { padding: 4px 16px 16px; }
  .bar-row { grid-template-columns: 90px 1fr 44px; } .modal { max-height: 96vh; border-radius: 20px 20px 0 0; align-self: flex-end; max-width: none; } .overlay { padding: 0; }
  .page-head h1 { font-size: 1.35rem; } .profile-head { flex-direction: column; text-align: center; } .tbl th:nth-child(n+4), .tbl td:nth-child(n+4) { display: none; }
  .node-wrap }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.home-main { display: flex; flex-direction: column; } .home-main > .page-head { margin-bottom: 16px; }

.side-user-info { flex: 1; min-width: 0; } .side-user-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
