/* learnenglishwithai.com design system */
:root {
  --ink: #0d1530; --ink-2: #2c3654; --muted: #6b7493; --faint: #9aa2bd;
  --line: #e6e8f0; --line-2: #eef0f6; --bg: #f5f6fa; --card: #ffffff;
  --brand: #4f46e5; --brand-2: #6d5efc; --brand-soft: #eef0ff; --brand-ink: #3730a3;
  --ok: #0f9d74; --ok-soft: #e6f7f1; --bad: #e0424c; --bad-soft: #fdecee; --warn: #e89a12; --warn-soft: #fff5e1;
  --gold: #d4a24a; --night: #0b1229; --night-2: #141d3d;
  --r: 18px; --r-sm: 12px; --shadow: 0 1px 2px rgba(13, 21, 48, .04), 0 8px 24px rgba(13, 21, 48, .06);
  --shadow-lg: 0 24px 60px rgba(13, 21, 48, .14);
  --serif: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
.serif { font-family: var(--serif); font-optical-sizing: auto; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i.lg { width: 22px; height: 22px; } .i.sm { width: 15px; height: 15px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .ok { color: var(--ok); } .bad { color: var(--bad); }
.hide { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--night); color: #c9cfe6; display: flex; flex-direction: column; padding: 22px 14px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; font-weight: 700; letter-spacing: -0.01em; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #6d5efc, #22c3a6); display: grid; place-items: center; color: #fff; font-family: var(--serif); font-size: 19px; font-weight: 600; box-shadow: 0 6px 18px rgba(109, 94, 252, .45); }
.brand small { display: block; font-weight: 500; color: #8a93b8; font-size: 11.5px; letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #69729a; padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #c9cfe6; font-weight: 500; font-size: 14.5px; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.on { background: linear-gradient(90deg, rgba(109, 94, 252, .28), rgba(109, 94, 252, .08)); color: #fff; box-shadow: inset 2px 0 0 #8b7dff; }
.nav a .cnt { margin-left: auto; background: #e0424c; color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #6d5efc, #e86aa8); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.side .me b { color: #fff; font-size: 13.5px; display: block; }
.side .me span { font-size: 12px; color: #8a93b8; }
.main { min-width: 0; padding: 28px 36px 80px; max-width: 1280px; width: 100%; }
.tabbar { display: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 18px 16px 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 500; position: relative; }
  .tabbar a.on { color: var(--brand); }
  .tabbar a .cnt { position: absolute; top: 0; right: 22%; background: var(--bad); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 5px; }
}

/* ---------- page header ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ph .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.ph h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; letter-spacing: -0.02em; }
.ph h1 em { font-style: italic; color: var(--brand); }
.ph p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; font-weight: 500; margin-bottom: 14px; }
.back:hover { color: var(--ink); }

/* ---------- cards, grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { font-size: 15.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; } .ph h1 { font-size: 27px; } .card { padding: 18px; } }
.mt { margin-top: 18px; } .mt-l { margin-top: 28px; }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: 14.5px; cursor: pointer; background: var(--brand); color: #fff; transition: transform .08s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:hover { background: var(--brand-ink); box-shadow: 0 6px 16px rgba(79, 70, 229, .25); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: #cfd4e4; box-shadow: none; background: #fafbff; }
.btn.soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn.soft:hover { background: #e2e5ff; box-shadow: none; }
.btn.dark { background: var(--ink); } .btn.dark:hover { background: #000; }
.btn.okb { background: var(--ok); } .btn.okb:hover { background: #0b8462; }
.btn.danger { background: var(--bad); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 14px 22px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 13px; font-size: 13px; font-weight: 550; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: #cdd2e3; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.lv { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; padding: 2px 8px; border-radius: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; }
.lv-A1, .lv-A2 { background: #e7f6ee; color: #137a52; } .lv-B1 { background: #e8f0ff; color: #2952c7; } .lv-B2 { background: #f0eaff; color: #6a3fd1; } .lv-C1 { background: #fff0e3; color: #b8560f; } .lv-C2 { background: #fde8ef; color: #b3264f; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.bad { background: var(--bad-soft); color: var(--bad); } .tag.warn { background: var(--warn-soft); color: #a86a00; } .tag.brand { background: var(--brand-soft); color: var(--brand-ink); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea { font: inherit; width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px; background: #fff; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }
.search { position: relative; } .search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); } .search input { padding-left: 40px; }

/* ---------- dashboard ---------- */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 28px 30px; color: #fff; background: radial-gradient(900px 300px at 85% -20%, rgba(109, 94, 252, .55), transparent 60%), radial-gradient(500px 260px at 0% 120%, rgba(34, 195, 166, .35), transparent 60%), linear-gradient(135deg, #0b1229, #18214a); box-shadow: var(--shadow-lg); }
.hero .top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero .k { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #a9b1d6; font-weight: 600; }
.hero h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; margin-top: 6px; letter-spacing: -0.02em; }
.hero h2 em { color: #b3a9ff; }
.hero .big { font-family: var(--serif); font-size: 56px; line-height: 1; font-weight: 500; }
.hero .big small { font-size: 22px; color: #a9b1d6; }
.ladder { margin-top: 26px; position: relative; }
.ladder .track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .1); position: relative; overflow: visible; }
.ladder .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #22c3a6, #8b7dff); }
.ladder .pin { position: absolute; top: 50%; width: 22px; height: 22px; margin-left: -11px; margin-top: -11px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(139, 125, 255, .35); }
.ladder .marks { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; color: #a9b1d6; font-weight: 600; }
.ladder .marks span.on { color: #fff; }
.hero .meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 20px; font-size: 13.5px; color: #c9cfe6; }
.hero .meta b { color: #fff; }
.kpi { display: flex; align-items: center; gap: 16px; }
.kpi .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .v small { font-size: 14px; font-weight: 600; color: var(--muted); }
.kpi .l { font-size: 13px; color: var(--muted); }
.delta { font-size: 12px; font-weight: 700; } .delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan a.step { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; transition: border-color .15s, transform .1s; }
.plan a.step:hover { border-color: #c9cdf8; transform: translateX(2px); }
.plan .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 13px; flex: none; }
.plan .done .num { background: var(--ok); color: #fff; }
.plan .done b { text-decoration: line-through; color: var(--muted); }
.plan .step b { display: block; font-weight: 600; font-size: 14.5px; }
.plan .step span { font-size: 13px; color: var(--muted); }
.plan .step .go { margin-left: auto; color: var(--faint); }
.coach { background: linear-gradient(180deg, #fbfaff, #fff); border-color: #e4e1ff; }
.coach .hl { font-family: var(--serif); font-size: 21px; font-weight: 500; margin: 2px 0 14px; }
.coach .f { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.coach .f .n { width: 24px; height: 24px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.coach .f b { font-size: 14px; } .coach .f p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); } .coach .f p.a { color: var(--brand-ink); font-weight: 550; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; position: relative; padding-top: 10px; }
.bars .b { flex: 1; background: linear-gradient(180deg, #8b7dff, #4f46e5); border-radius: 6px 6px 3px 3px; min-height: 3px; position: relative; opacity: .9; }
.bars .b.zero { background: var(--line); }
.bars .b.today { background: linear-gradient(180deg, #2fd3b4, #0f9d74); }
.bars .b:hover { opacity: 1; }
.bars .goal { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(224, 66, 76, .5); }
.bars .goal span { position: absolute; right: 0; top: -20px; font-size: 11px; color: var(--bad); font-weight: 600; }
.xaxis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 6px; }
.tip-pop { position: fixed; pointer-events: none; z-index: 99; background: var(--ink); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 13px; height: 13px; border-radius: 3px; background: var(--line-2); display: block; }
.heat i.l1 { background: #d9d6ff; } .heat i.l2 { background: #a99fff; } .heat i.l3 { background: #6d5efc; } .heat i.l4 { background: #3f2fd6; }
.heat i.fut { background: transparent; }
.legend { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--faint); margin-top: 8px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.area { display: grid; grid-template-columns: minmax(0, 1fr) 110px 54px; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--ink); }
.area:first-child { border-top: 0; }
.meter { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.meter.ok > i { background: var(--ok); } .meter.warn > i { background: var(--warn); } .meter.bad > i { background: var(--bad); }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 12.5px; color: var(--muted); }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty .i { width: 34px; height: 34px; color: var(--faint); margin-bottom: 8px; }
.ring { position: relative; width: 64px; height: 64px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; }

/* ---------- library ---------- */
.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.tcard { display: flex; flex-direction: column; gap: 10px; color: var(--ink); transition: border-color .15s, transform .12s, box-shadow .15s; }
.tcard:hover { border-color: #cfd2fb; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tcard h4 { font-size: 16px; font-weight: 650; line-height: 1.3; }
.tcard p { margin: 0; font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .ft { display: flex; align-items: center; gap: 10px; margin-top: auto; font-size: 12.5px; color: var(--muted); }
.tcard .ft .meter { flex: 1; }
.cat-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 22px; }
.cat-strip a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.cat-strip a:hover { border-color: #cfd2fb; }
.cat-strip a.on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.cat-strip b { font-size: 14px; } .cat-strip span { font-size: 12.5px; color: var(--muted); }

/* ---------- topic ---------- */
.topic { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .topic { grid-template-columns: minmax(0, 1fr); } }
.lesson h2 { font-family: var(--serif); font-weight: 500; font-size: 23px; margin: 30px 0 10px; letter-spacing: -0.01em; }
.lesson .intro { font-size: 17px; color: var(--ink-2); line-height: 1.65; }
.lesson p { margin: 10px 0; color: var(--ink-2); line-height: 1.7; }
.lesson b, .lesson strong { color: var(--ink); }
.pattern { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 12px 0; background: #fcfcff; }
.pattern .lb { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pattern .parts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.pattern .pt { display: inline-flex; flex-direction: column; padding: 6px 11px; border-radius: 10px; font-weight: 600; font-size: 15px; border-bottom: 3px solid; }
.pattern .pt small { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.r0 { background: #eef0ff; border-color: #6d5efc !important; color: #3730a3; } .r1 { background: #e6f7f1; border-color: #0f9d74 !important; color: #0b6b50; } .r2 { background: #fff3e0; border-color: #e89a12 !important; color: #8a5a00; } .r3 { background: #fdecef; border-color: #e0424c !important; color: #a3202a; } .r4 { background: #e8f3fd; border-color: #2c86d6 !important; color: #17578f; } .r5 { background: #f4ecff; border-color: #9b5de5 !important; color: #5f2fa0; }
.ex { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-left: 3px solid var(--brand-2); background: #fafaff; border-radius: 0 10px 10px 0; margin: 6px 0; font-size: 15px; }
.say { border: 0; background: var(--brand-soft); color: var(--brand-ink); width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.say:hover { background: #dfe2ff; } .say.playing { background: var(--brand); color: #fff; }
.say .i { width: 15px; height: 15px; }
table.t { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.mist { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; }
.mist .w { color: var(--bad); text-decoration: line-through; text-decoration-color: rgba(224, 66, 76, .5); }
.mist .r { color: var(--ok); font-weight: 600; }
.mist .y { font-size: 13px; color: var(--muted); }
.tipbox { display: flex; gap: 12px; padding: 16px; border-radius: 14px; background: linear-gradient(135deg, #fff8ea, #fff); border: 1px solid #f6e3b8; margin-top: 20px; }
.sets { position: sticky; top: 20px; }
.setrow { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; color: var(--ink); border: 1px solid transparent; }
.setrow:hover { background: #f7f7fd; border-color: var(--line); }
.setrow .ty { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); flex: none; }
.setrow .nm { font-weight: 600; font-size: 14px; line-height: 1.3; }
.setrow .mt2 { font-size: 12px; color: var(--muted); }
.setrow .sc { margin-left: auto; font-size: 12.5px; font-weight: 700; }
.stage-h { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 14px 12px 4px; }

/* ---------- player ---------- */
.player { max-width: 780px; margin: 0 auto; }
.ptop { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ptop .x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--muted); cursor: pointer; flex: none; }
.pbar { flex: 1; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, #22c3a6, #6d5efc); border-radius: 99px; transition: width .35s ease; }
.pcount { font-size: 13px; color: var(--muted); font-weight: 600; min-width: 48px; text-align: right; }
.qcard { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 30px; box-shadow: var(--shadow); }
.qcard .ins { font-size: 13px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; gap: 8px; }
.qcard .st { font-size: 13px; color: var(--muted); margin-top: 4px; }
.q { font-size: 22px; line-height: 1.5; margin: 22px 0 24px; font-weight: 500; color: var(--ink); }
.q .blank { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--brand-2); text-align: center; color: var(--brand-ink); font-weight: 650; padding: 0 6px; }
.q .blank.okf { border-color: var(--ok); color: var(--ok); } .q .blank.badf { border-color: var(--bad); color: var(--bad); }
.q input.gap { display: inline-block; width: auto; min-width: 120px; max-width: 100%; padding: 4px 10px; font-size: 19px; border-radius: 10px; border-width: 2px; margin: 2px 4px; }
.q input.gap.okf { border-color: var(--ok); background: var(--ok-soft); } .q input.gap.badf { border-color: var(--bad); background: var(--bad-soft); }
.opts { display: grid; gap: 10px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; padding: 15px 18px; border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font-size: 16.5px; font-weight: 500; transition: border-color .12s, background .12s; }
.opt:hover { border-color: #c4c8f7; background: #fbfbff; }
.opt .key { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); flex: none; }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); } .opt.right .key { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); } .opt.wrong .key { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt[disabled] { cursor: default; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; font-size: 21px; line-height: 1.6; margin: 22px 0; }
.tok { border: 0; background: transparent; padding: 2px 6px; border-radius: 8px; cursor: pointer; font-size: inherit; border-bottom: 2px dotted #c9cde0; }
.tok:hover { background: var(--brand-soft); }
.tok.sel { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.tok.ans { background: var(--warn-soft); color: #8a5a00; border-color: var(--warn); }
.build { min-height: 62px; border: 2px dashed var(--line); border-radius: 14px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 12px; align-items: center; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; }
.wchip { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 13px; font-size: 16.5px; cursor: pointer; font-weight: 500; box-shadow: 0 2px 0 var(--line); }
.wchip:hover { border-color: #c4c8f7; }
.wchip.used { visibility: hidden; }
.passage { background: #fafaff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; font-size: 16.5px; line-height: 1.85; margin: 16px 0 20px; }
.passage .g { display: inline-block; min-width: 56px; padding: 0 8px; border-bottom: 2px solid #c9cde0; text-align: center; font-weight: 600; color: var(--muted); }
.passage .g.cur { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); border-radius: 6px 6px 0 0; }
.passage .g.okf { color: var(--ok); border-color: var(--ok); } .passage .g.badf { color: var(--bad); border-color: var(--bad); }
.fb { margin-top: 20px; border-radius: 16px; padding: 18px 20px; display: grid; gap: 6px; animation: rise .22s ease; }
.fb.okf { background: var(--ok-soft); border: 1px solid #bfe9da; }
.fb.badf { background: var(--bad-soft); border: 1px solid #f7c9cd; }
.fb .h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.fb.okf .h { color: var(--ok); } .fb.badf .h { color: var(--bad); }
.fb .ans { font-size: 15.5px; } .fb .ans b { color: var(--ink); }
.fb .why { color: var(--ink-2); font-size: 14.5px; }
.fb .more { margin-top: 6px; padding-top: 10px; border-top: 1px dashed rgba(0, 0, 0, .1); font-size: 14px; color: var(--ink-2); }
.fb .more ul { margin: 6px 0; padding-left: 20px; }
.pact { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.kbd { font-size: 12px; color: var(--faint); }
.kbd kbd { font-family: inherit; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font-size: 11px; background: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.result { text-align: center; padding: 10px 0; }
.result .score { font-family: var(--serif); font-size: 64px; font-weight: 500; line-height: 1; }
.result h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; margin: 10px 0 4px; }

/* ---------- speech ---------- */
.rec { width: 64px; height: 64px; border-radius: 50%; border: 0; background: linear-gradient(135deg, #e0424c, #f06a5a); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 24px rgba(224, 66, 76, .35); flex: none; transition: transform .1s; }
.rec:hover { transform: scale(1.04); }
.rec.on { animation: pulse 1.2s infinite; background: #b8222c; }
.rec.sm { width: 42px; height: 42px; box-shadow: 0 6px 14px rgba(224, 66, 76, .3); }
.rec .i { width: 24px; height: 24px; } .rec.sm .i { width: 18px; height: 18px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224, 66, 76, .5); } 70% { box-shadow: 0 0 0 16px rgba(224, 66, 76, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 66, 76, 0); } }
.level { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; width: 120px; }
.level i { display: block; height: 100%; background: var(--ok); width: 0; transition: width .06s; }
.sent { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.sent .line { display: flex; align-items: center; gap: 12px; }
.sent .txt { flex: 1; font-size: 17px; font-weight: 500; }
.words { display: flex; flex-wrap: wrap; gap: 6px; font-size: 16.5px; }
.w { padding: 3px 9px; border-radius: 8px; font-weight: 550; position: relative; }
.w.ok { background: var(--ok-soft); color: #0b6b50; } .w.unclear { background: var(--warn-soft); color: #8a5a00; } .w.wrong { background: var(--bad-soft); color: var(--bad); } .w.missed { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; } .w.extra { background: var(--line-2); color: var(--muted); font-style: italic; }
.w small { display: block; font-size: 10.5px; font-weight: 600; opacity: .8; }
.scorepill { font-weight: 800; font-size: 14px; padding: 4px 10px; border-radius: 99px; }
.sp-hi { background: var(--ok-soft); color: var(--ok); } .sp-mid { background: var(--warn-soft); color: #a86a00; } .sp-lo { background: var(--bad-soft); color: var(--bad); }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pair { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pair button.wd { border: 0; background: var(--line-2); padding: 6px 12px; border-radius: 9px; font-weight: 600; cursor: pointer; font-size: 15px; }
.pair button.wd:hover { background: var(--brand-soft); color: var(--brand-ink); }
.pair .vs { color: var(--faint); font-size: 12px; }
.ucard { display: flex; flex-direction: column; gap: 8px; color: var(--ink); }
.ucard:hover { border-color: #cfd2fb; }
.ucard .sym { font-family: var(--serif); font-size: 24px; color: var(--brand); }
.howto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .howto { grid-template-columns: 1fr; } }
.howto div { padding: 16px; border-radius: 14px; background: #fafaff; border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.howto b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 24px 0 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--brand); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 28px; }
.mark-bad { background: var(--bad-soft); color: var(--bad); border-radius: 4px; padding: 0 2px; text-decoration: underline wavy rgba(224, 66, 76, .6); text-underline-offset: 4px; }
.subs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .subs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.subs div { padding: 12px; border-radius: 12px; background: #fafaff; border: 1px solid var(--line); }
.subs b { font-size: 22px; display: block; }
.subs span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.corr { padding: 12px 0; border-top: 1px solid var(--line-2); display: grid; gap: 3px; }
.corr .o { color: var(--bad); text-decoration: line-through; } .corr .n { color: var(--ok); font-weight: 600; } .corr .y { font-size: 13px; color: var(--muted); }

/* ---------- toast, modal, loading ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 100; box-shadow: var(--shadow-lg); animation: rise .2s; }
@media (max-width: 960px) { .toast { bottom: 90px; } }
.loading { display: grid; place-items: center; padding: 60px; color: var(--muted); }
.spin { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--line-2), #f7f8fc, var(--line-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dh { font-size: 11px; color: var(--faint); text-align: center; font-weight: 600; }
.cal a, .cal span.d { aspect-ratio: 1; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12.5px; color: var(--ink-2); background: var(--line-2); }
.cal a b { font-size: 10px; font-weight: 600; }
.cal .l1 { background: #e3e0ff; } .cal .l2 { background: #b9b1ff; } .cal .l3 { background: #7d70ff; color: #fff; } .cal .l4 { background: #4f46e5; color: #fff; }
.cal .today { outline: 2px solid var(--ink); }
.cal .out { visibility: hidden; }

/* ---------- phone: premium mobile shell ---------- */
html.lock { overflow: hidden; }
.mtop, .sheet, .sheet-bg { display: none; }
button, a, .opt, .wchip, .tok { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (max-width: 960px) {
  body { font-size: 16px; }
  .mtop { display: flex; position: sticky; top: 0; z-index: 35; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(11, 18, 41, .97); backdrop-filter: blur(12px); color: #fff; }
  .brand-m { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em; }
  .brand-m b { color: #a99fff; font-weight: 700; }
  .brand-m .mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #6d5efc, #22c3a6); display: grid; place-items: center; font-family: var(--serif); font-size: 17px; }
  .avatar.sm { width: 32px; height: 32px; font-size: 12px; color: #fff; }
  .main { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar a { min-height: 50px; justify-content: center; }
  .tabbar a.on { color: var(--brand); }
  .tabbar a.on::before { content: ''; position: absolute; top: -6px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
  .sheet-bg { display: block; position: fixed; inset: 0; background: rgba(11, 18, 41, .45); z-index: 60; backdrop-filter: blur(2px); }
  .sheet { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: #fff; border-radius: 22px 22px 0 0; padding: 8px 14px calc(18px + env(safe-area-inset-bottom)); max-height: 82vh; overflow-y: auto; transform: translateY(105%); transition: transform .25s ease; box-shadow: 0 -20px 60px rgba(0,0,0,.2); }
  .sheet.open { transform: none; }
  .sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 4px auto 8px; }
  .sheet .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); padding: 12px 8px 4px; font-weight: 700; }
  .sheet a { display: flex; align-items: center; gap: 14px; padding: 13px 10px; border-radius: 12px; color: var(--ink); font-weight: 550; font-size: 16px; }
  .sheet a:active, .sheet a.on { background: var(--brand-soft); color: var(--brand-ink); }
  .ph { margin-bottom: 16px; }
  .ph h1 { font-size: 26px; }
  .ph p { font-size: 15px; }
  .hero { padding: 22px 18px; border-radius: 20px; }
  .hero h2 { font-size: 23px; }
  .hero .big { font-size: 44px; }
  .hero .top { gap: 12px; }
  .kpi .v { font-size: 22px; }
  .kpi .ic { width: 40px; height: 40px; }
  .grid { gap: 12px; }
  .card { border-radius: 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; padding: 8px 14px; font-size: 14px; }
  .cat-strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px 16px; padding: 0 14px 4px; }
  .cat-strip a { scroll-snap-align: start; }
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea { font-size: 16px; }
  .area { grid-template-columns: minmax(0, 1fr) 72px 48px; }
  .row .t { white-space: normal !important; }
  /* lesson reading comfort */
  .lesson .intro { font-size: 17px; }
  .lesson p { font-size: 16px; line-height: 1.7; }
  .lesson h2 { font-size: 21px; }
  .ex { font-size: 16px; }
  .sets { position: static; }
  .topic-jump { display: flex !important; }
  /* test player: big text, thumb-reach action bar */
  .player { max-width: none; }
  .ptop { position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 20; background: var(--bg); margin: -16px -14px 12px; padding: 12px 14px; }
  .qcard { padding: 20px 16px; border-radius: 18px; }
  .q { font-size: 20px; margin: 16px 0 18px; }
  .q input.gap { font-size: 17px; min-width: 110px; }
  .opt { padding: 15px 14px; font-size: 16.5px; min-height: 56px; }
  .opts.two { grid-template-columns: 1fr; }
  .tokens { font-size: 19px; gap: 4px; }
  .tok { padding: 6px 8px; }
  .wchip { font-size: 17px; padding: 10px 14px; }
  .passage { font-size: 16px; padding: 14px; max-height: 42vh; overflow-y: auto; }
  .pact { position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 30; margin: 0; padding: 10px 14px; background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .pact .kbd { display: none; }
  .pact > div { width: 100%; }
  .pact #go { flex: 1; }
  .qcard { margin-bottom: 90px; }
  .fb { font-size: 15px; }
  .result .score { font-size: 52px; }
  .sent .txt { font-size: 16px; }
  .rec.sm { width: 46px; height: 46px; }
  .subs b { font-size: 19px; }
  .toast { bottom: calc(140px + env(safe-area-inset-bottom)); width: calc(100% - 32px); text-align: center; }
}
.topic-jump { display: none; position: fixed; left: 14px; right: 14px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 30; }
@media (max-width: 960px) {
  .rankcard { gap: 12px !important; padding: 16px; }
  .rankcard > svg { width: 48px; height: 48px; flex: none; }
  .rankcard > .btn { display: none; }
  .rankcard h3 { font-size: 17px !important; }
  .hero .top { flex-direction: column; }
  .hero .top > div:last-child { text-align: left !important; display: flex; align-items: baseline; gap: 12px; }
  .hero .meta { gap: 8px 16px; font-size: 13px; }
  .ladder .marks { font-size: 12px; }
}

@media (max-width: 960px) {
  body.focus .mtop, body.focus .tabbar { display: none; }
  body.focus .ptop { top: env(safe-area-inset-top); }
  body.focus .pact { bottom: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body.focus .main { padding-bottom: 120px; }
}

/* one clean font everywhere: headings bold sans, no italics */
.ph h1, .hero h2, .hero .big, .lesson h2, .result h2, .result .score, .coach .hl, h1.serif, h2.serif, .serif { font-weight: 700 !important; letter-spacing: -0.025em; }
.ph h1 em, .hero h2 em, h1 em { font-style: normal !important; }
.hero .big { font-weight: 800 !important; }
body { letter-spacing: -0.005em; }

.whybox { background: #fff; border: 1px solid #f3c9cd; border-radius: 12px; padding: 10px 12px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 600px) {
  .kpi { gap: 10px; padding: 14px; align-items: flex-start; }
  .kpi .ic { width: 34px; height: 34px; border-radius: 10px; }
  .kpi .ic .i.lg { width: 18px; height: 18px; }
  .kpi .v { font-size: 20px; white-space: nowrap; }
  .kpi .v small { font-size: 12px; }
  .kpi .l { font-size: 12px; line-height: 1.35; }
  .kpi .ring { display: none; }
  .kpi { flex-direction: column; }
}
/* iPhone / Android hardening */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea { -webkit-appearance: none; appearance: none; }
.mtop, .tabbar, .pact { -webkit-backdrop-filter: blur(12px); }
body { overscroll-behavior-y: none; }
.opt, .wchip, .tok, .chip, .btn { -webkit-user-select: none; user-select: none; }
.main { min-height: 100dvh; }
@media (max-width: 600px) {
  .card-h { flex-wrap: wrap; }
  .row { flex-wrap: wrap; }
  .row .grow { min-width: 60%; }
  .area span { font-size: 13.5px; }
  .subs div { padding: 10px; }
  .howto div { padding: 14px; }
  .ptop { margin-top: -16px; }
  .whybox .spin { display: inline-block; vertical-align: middle; }
}
