/* UpKorean — design tokens and components (from "UpKorean Platform.dc.html") */
:root {
  --p: #D88B3F; --pd: #9A5516; --pdb: #9A5516; --pl: #FBE5CC; --pl2: #F8D4A8;
  --bg: #F7F4EF; --sf: #FFFFFF; --sf2: #FBF9F5;
  --ink: #111827; --ink2: #57534E; --ink3: #6F6A63;
  --line: #EDE8DF; --ok: #0B7A53; --okl: #E3F5EC; --okd: #0A5E42; --okm: #2F6B55;
  --bad: #B23B30; --badl: #FBE7E4; --badd: #8A3328;
  --on-pl: #3B1E07; --on-pl2: #6B4318; --on-pl3: #6B4318; --on-pl-line: rgba(124,63,11,.16);
  --locked: #9D968B; --locked2: #9D968B;
  --hero: linear-gradient(135deg, var(--pl) 0%, rgba(248,212,168,.8) 100%);
  --watermark: rgba(124,63,11,.15);
  --shadow-card: 0 18px 44px -28px rgba(17,24,39,.3);
  --shadow-p: 0 8px 20px -8px rgba(216,139,63,.65);
  --shadow-sel: 0 8px 24px -14px rgba(216,139,63,.65);
  /* Headings: a warm serif gives titles their own voice next to the sans-serif interface. */
  --display: "Fraunces", "Noto Sans KR", Georgia, serif;
  --ko: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --p: #D88B3F; --pd: #EBA462; --pdb: #9A5516; --pl: #3A2B1C; --pl2: #5B4127;
  --bg: #15120E; --sf: #1E1A15; --sf2: #241F19;
  --ink: #F3EEE7; --ink2: #B3AA9E; --ink3: #A39A8D;
  --line: #342D25; --ok: #3FBF8C; --okl: #14302A; --okd: #7EDDB5; --okm: #9FD9C0;
  --bad: #EE7466; --badl: #3A1F1B; --badd: #F4A89E;
  --on-pl: #FBE9D4; --on-pl2: #EBC7A0; --on-pl3: #CDA070; --on-pl-line: rgba(251,229,204,.16);
  --locked: #857D72; --locked2: #857D72;
  --hero: linear-gradient(135deg, #3A2B1C 0%, #4A3420 100%);
  --watermark: rgba(251,229,204,.08);
  --shadow-card: 0 18px 44px -28px rgba(0,0,0,.6);
  --shadow-p: 0 8px 20px -8px rgba(216,139,63,.45);
  --shadow-sel: 0 8px 24px -14px rgba(216,139,63,.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; color: var(--ink); font-size: 14px; line-height: 1.4;
}
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; color: var(--ink2); }
.boot .mark { animation: boot-pulse 1.2s ease-in-out infinite alternate; }
.boot-copy { font-size: 13px; }
.boot-error { padding: 24px; text-align: center; }
.boot-error p { max-width: 420px; margin: 0; line-height: 1.6; }
@keyframes boot-pulse { to { transform: scale(.84); opacity: .55; } }
noscript { display: block; max-width: 640px; margin: 60px auto; padding: 20px; text-align: center; color: var(--ink2); }
a { color: var(--pd); text-decoration: none; }
a:hover { color: var(--pd); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }

.ko { font-family: var(--ko); }
.mono { font-family: var(--mono); }
.muted { color: var(--ink2); }
.faint { color: var(--ink3); }
.accent { color: var(--pd); }
.okc { color: var(--ok); }
.badc { color: var(--bad); }
.upl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); }
.upl.s { font-weight: 600; letter-spacing: .07em; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; }
.sep { height: 1px; background: var(--line); }
.center { text-align: center; }
.link { color: var(--pd); font-weight: 600; font-size: 13px; }
.link:hover { color: var(--ink); }
.kbd-hint { font-family: var(--mono); font-size: 12px; color: var(--ink3); }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 26px; height: 26px; border-radius: 8px; background: var(--p); flex: none; }
.brand .name { font-weight: 800; font-size: 16px; letter-spacing: -.02em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 26px; border-radius: 12px;
  font-size: 15px; font-weight: 700; transition: transform .08s ease, filter .15s ease, background .15s ease; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.btn-p { background: var(--pdb); color: #fff; box-shadow: var(--shadow-p); }
.btn-p:hover { filter: brightness(1.05); color: #fff; }
.btn-pd { background: var(--pdb); color: #fff; box-shadow: 0 10px 22px -10px rgba(124,63,11,.6); }
.btn-pd:hover { filter: brightness(1.08); color: #fff; }
.btn-glass { background: rgba(255,255,255,.75); border: 1px solid rgba(124,63,11,.2); color: var(--on-pl2); font-weight: 600; padding: 14px 22px; }
:root[data-theme="dark"] .btn-glass { background: rgba(255,255,255,.06); border-color: var(--on-pl-line); }
.btn-sec { background: var(--sf); border: 1px solid var(--line); font-weight: 600; padding: 14px 22px; }
.btn-sec:hover { border-color: var(--pl2); }
.btn-soft { background: var(--pl2); color: var(--on-pl); }
.btn-ghost { color: var(--ink2); font-weight: 600; padding: 14px 18px; }
.btn-ghost:hover { color: var(--ink); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { padding: 10px 16px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

/* Inputs */
.field-label { font-size: 13px; font-weight: 600; margin-bottom: 7px; display: block; }
.input { width: 100%; padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; font-size: 15px; background: var(--sf2); outline: none; transition: border-color .15s, background .15s; }
.input::placeholder { color: var(--ink3); }
.input:focus { border: 1px solid var(--p); box-shadow: 0 0 0 1px var(--p); background: var(--sf); }
.input.err { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.form-err { color: var(--bad); font-size: 13px; margin: -8px 0 14px; }

/* Cards */
.card { background: var(--sf); border: 1px solid var(--line); border-radius: 14px; }
.card.pad { padding: 20px 22px; }
.card-pl { background: var(--pl); border-radius: 14px; color: var(--on-pl2); }
.card-title { font-size: 14px; font-weight: 700; }

/* Toggle */
.toggle { width: 42px; height: 24px; border-radius: 99px; background: var(--line); padding: 3px; display: inline-flex; flex: none; transition: background .15s; }
.toggle::after { content: ""; width: 18px; height: 18px; border-radius: 99px; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.toggle.on { background: var(--p); }
.toggle.on::after { transform: translateX(18px); }
.toggle.lg { width: 46px; height: 26px; }
.toggle.lg::after { width: 20px; height: 20px; }
.toggle.lg.on::after { transform: translateX(20px); }

/* Segmented */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: 10px; }
.seg button { padding: 6px 13px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.seg button.on { background: var(--sf); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(17,24,39,.06); }
.picks { display: flex; gap: 6px; }
.picks button { flex: 1; text-align: center; padding: 9px; border-radius: 9px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--ink2); }
.picks button.on { background: var(--pdb); color: #fff; font-weight: 700; }
.picks button:disabled { opacity: .55; cursor: not-allowed; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--ink2); }
.chip.on { background: var(--pl); color: var(--on-pl2); font-weight: 700; }
button.chip:hover { color: var(--ink); }
.tag { font-family: var(--mono); font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--pl); color: var(--pd); }
.offline-pill { font-family: var(--mono); font-size: 12px; padding: 4px 8px; border-radius: 7px; background: var(--pl); color: var(--pd); }
.coming-soon-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 64px); }
.coming-soon-card { width: min(560px, 100%); padding: 54px 42px; text-align: center; border: 1px solid var(--line); border-radius: 22px; background: var(--sf); box-shadow: var(--shadow-card); }
.coming-soon-card .page-p { max-width: 440px; margin: 14px auto 28px; line-height: 1.65; }
.coming-lock { width: 74px; height: 74px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 22px; background: var(--pl); color: var(--pd); font: 800 24px var(--mono); }

.check { width: 22px; height: 22px; border-radius: 99px; background: var(--pdb); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* Mastery bars */
.mbar { display: inline-flex; gap: 3px; flex: none; }
.mbar i { width: 16px; height: 4px; border-radius: 2px; background: var(--line); }
.mbar.sm i { width: 14px; }
.mbar i.on { background: var(--p); }
.mbar i.m { background: var(--pd); }
.mbar.weak i { background: rgba(201,72,60,.2); }
.mbar.weak i.on { background: var(--bad); }

/* Progress */
.prog { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.prog > div { height: 100%; border-radius: 4px; background: var(--p); transition: width .3s ease; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--sf); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink2); }
.nav a::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--line); flex: none; }
.nav a:hover { color: var(--ink); background: var(--sf2); }
.nav a.on { font-weight: 700; background: var(--pl); color: var(--on-pl2); }
.nav a.on::before { background: var(--p); }
.nav .cnt { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink3); }
.nav a.on .cnt { color: var(--pd); }
.nav .badge { margin-left: auto; font-family: var(--mono); font-size: 12px; color: #fff; background: var(--pdb); padding: 2px 6px; border-radius: 6px; }
.nav .div { height: 1px; background: var(--line); margin: 10px 12px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.lvl { padding: 14px; border-radius: 12px; background: var(--bg); }
.lvl .prog { height: 5px; margin-top: 8px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.me:hover { background: var(--sf2); }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: var(--pl); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--pd); flex: none; }
.iconbtn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: var(--ink2); flex: none; }
.iconbtn:hover { color: var(--ink); border-color: var(--pl2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; border-bottom: 1px solid var(--line); background: var(--sf); display: flex; align-items: center; gap: 18px; padding: 0 32px; position: sticky; top: 0; z-index: 5; }
.topbar .title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.topbar .sub { font-family: var(--mono); font-size: 12px; color: var(--ink3); }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar .back { font-size: 14px; font-weight: 600; color: var(--ink2); }
.topbar .back:hover { color: var(--ink); }
.pill { display: flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 9px; font-size: 13px; }
.pill.streak { background: var(--pl); color: var(--on-pl3); }
.pill.streak b { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--pd); }
.pill.xp { background: var(--sf2); border: 1px solid var(--line); color: var(--ink2); }
.pill.xp b { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink); }
.menu-btn { display: none; }

.page { flex: 1; padding: 24px 32px 40px; }
.page.wide { padding: 32px 40px 48px; }
h1, h2, h3, .modal-title { font-family: var(--display); font-optical-sizing: auto; }
.page-h { margin: 0 0 5px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.page-p { margin: 0; font-size: 15px; color: var(--ink2); }

/* Hero */
.hero { border-radius: 18px; background: var(--hero); padding: 24px 34px; display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 32px; align-items: center; overflow: hidden; }
.hero .eyebrow { font-family: var(--mono); font-size: 12px; color: var(--on-pl3); margin-bottom: 12px; }
.hero .big { font-family: var(--display); font-size: 46px; font-weight: 700; letter-spacing: -.03em; color: var(--on-pl); line-height: 1; }
.hero .bigsub { font-size: 21px; font-weight: 600; color: var(--on-pl2); }
.hero p { margin: 0 0 18px; font-size: 15px; color: var(--on-pl2); max-width: 440px; line-height: 1.45; }
.hero .bar { height: 8px; border-radius: 5px; background: rgba(124,63,11,.14); overflow: hidden; max-width: 420px; margin-bottom: 18px; }
.hero .bar > div { height: 100%; border-radius: 5px; background: var(--pdb); }
.hero .wm { font-family: var(--ko); font-size: 118px; font-weight: 900; line-height: .85; color: var(--watermark); letter-spacing: -.05em; text-align: right; user-select: none; }

/* Stat strip */
.strip { display: flex; border: 1px solid var(--line); border-radius: 14px; background: var(--sf); overflow: hidden; }
.strip > div { flex: 1; padding: 16px 20px; border-right: 1px solid var(--line); min-width: 0; }
.strip > div:last-child { border-right: 0; }
.strip .v { display: flex; align-items: baseline; gap: 5px; margin-top: 6px; }
.strip .v b { font-size: 23px; font-weight: 800; letter-spacing: -.03em; }
.strip .v span { font-size: 13px; color: var(--ink2); }
.strip.lg > div { padding: 22px 24px; }
.strip.lg .v b { font-size: 32px; }
.strip.lg .v span { font-size: 15px; }

/* Lists */
.list { border: 1px solid var(--line); border-radius: 14px; background: var(--sf); overflow: hidden; }
.list .li { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.list .li:last-child { border-bottom: 0; }
.list .li.bad { background: var(--badl); }
.list button.li { width: 100%; }
.list button.li:hover { background: var(--sf2); }
.list button.li.bad:hover { background: var(--badl); filter: brightness(.98); }
.list .kw { font-family: var(--ko); font-size: 18px; font-weight: 700; min-width: 96px; }
.list .mean { flex: 1; min-width: 0; font-size: 14px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { font-family: var(--mono); font-size: 12px; color: var(--ink3); text-align: right; }
.list .head { background: var(--sf2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); padding: 11px 20px; }
.empty { padding: 26px; text-align: center; color: var(--ink3); font-size: 14px; }

/* Day squares */
.days { display: flex; gap: 5px; flex-wrap: wrap; }
.mbar-wrap { display: inline-flex; align-items: center; gap: 8px; }
.mbar-n { font-family: var(--mono); font-size: 12px; color: var(--ink2); }
.streak-lost { color: var(--bad); font-weight: 600; }
.dsq { width: 30px; height: 30px; border-radius: 8px; font-family: var(--mono); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.dsq.mastered { background: var(--pdb); color: #fff; }
.dsq.completed { background: var(--p); color: #3B1E07; }
.dsq.progress { background: var(--pl); border: 1.5px solid var(--p); color: var(--pd); font-weight: 500; }
.dsq.available { background: var(--sf); border: 1px solid var(--line); color: var(--ink3); }
.dsq.locked { background: var(--sf2); border: 1px solid var(--line); color: var(--locked2); cursor: default; }

/* Roadmap tiles */
.dgrid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; }
.dtile { padding: 16px; border-radius: 13px; text-align: left; min-height: 104px; display: flex; flex-direction: column; transition: transform .1s; }
button.dtile:hover { transform: translateY(-1px); }
.dtile .dn { font-family: var(--mono); font-size: 12px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.dtile .dw { font-family: var(--ko); font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.dtile .ds { font-size: 13px; }
.dtile.mastered { background: var(--pdb); color: #fff; }
.dtile.completed { background: var(--p); color: #3B1E07; }
.dtile.mastered .dn, .dtile.completed .dn { opacity: .85; }
.dtile.completed .dn, .dtile.completed .dw, .dtile.completed .ds { color: #3B1E07; }
.dtile.progress { background: var(--pl); border: 1.5px solid var(--p); box-shadow: 0 10px 26px -14px rgba(216,139,63,.7); }
.dtile.progress .dn { color: var(--pd); }
.dtile.progress .dw { color: var(--on-pl); }
.dtile.progress .ds { color: var(--on-pl2); margin-bottom: 9px; }
.dtile.available { background: var(--sf); border: 1px solid var(--line); }
.dtile.available .dn { color: var(--ink3); }
.dtile.available .ds { color: var(--ink2); }
.dtile.locked { background: var(--sf2); border: 1px solid var(--line); color: var(--locked); cursor: default; }
.dtile .mini { height: 5px; border-radius: 3px; background: rgba(124,63,11,.15); overflow: hidden; margin-top: auto; }
.dtile .mini > div { height: 100%; background: var(--pdb); }

.legend { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Word tiles */
.wgrid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.wtile { padding: 14px 16px; border-radius: 12px; background: var(--sf); border: 1px solid var(--line); text-align: left; }
button.wtile:hover { border-color: var(--pl2); }
.wtile .k { font-family: var(--ko); font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.wtile .u { font-size: 13px; color: var(--ink2); }

/* Option cards (onboarding etc.) */
.opt { display: flex; align-items: center; gap: 20px; padding: 20px 24px; border-radius: 14px; background: var(--sf); border: 1.5px solid var(--line); text-align: left; width: 100%; transition: border-color .15s, box-shadow .15s; }
.opt:hover { border-color: var(--pl2); }
.opt.on { border-color: var(--p); box-shadow: var(--shadow-sel); }
.opt .glyph { font-family: var(--ko); font-size: 26px; font-weight: 700; color: var(--ink3); min-width: 56px; }
.opt.on .glyph { color: var(--pd); }
.opt .t { display: block; font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.opt .d { display: block; font-size: 14px; color: var(--ink2); line-height: 1.45; }
.opt .end { font-family: var(--mono); font-size: 12px; color: var(--ink3); display: flex; align-items: center; gap: 10px; }
.opt.on .end { color: var(--pd); }
.ocard { padding: 20px 22px; border-radius: 14px; background: var(--sf); border: 1.5px solid var(--line); text-align: left; display: flex; flex-direction: column; justify-content: flex-start; width: 100%; transition: border-color .15s, box-shadow .15s; }
.ocard:hover { border-color: var(--pl2); }
.ocard.on { border-color: var(--p); box-shadow: var(--shadow-sel); }
.ocard .glyph { font-family: var(--ko); font-size: 22px; font-weight: 700; color: var(--ink3); }
.ocard.on .glyph { color: var(--pd); }
.ocard .t { font-size: 16px; font-weight: 700; margin: 8px 0 3px; }
.ocard .d { font-size: 14px; color: var(--ink2); line-height: 1.45; }
.ocard.dim { background: var(--sf2); border-style: dashed; border-width: 1px; cursor: not-allowed; }
.ocard.dim .t { color: var(--ink2); }
.ocard.dim .d { color: var(--ink3); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 620px) minmax(0,1fr); background: var(--sf); }
.auth-art { background: var(--pl); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid rgba(124,63,11,.12); }
.auth-art .brand .name { color: var(--on-pl); font-size: 17px; }
.auth-art .brand .mark { width: 28px; height: 28px; border-radius: 9px; }
.auth-art .hangul { font-family: var(--ko); font-weight: 900; line-height: .9; letter-spacing: -.05em; color: var(--pd); }
.auth-art p { margin: 0; max-width: 430px; font-size: 17px; line-height: 1.55; color: var(--on-pl2); }
.auth-art .foot { font-family: var(--mono); font-size: 12px; color: var(--on-pl3); }
.auth-stats { display: flex; gap: 44px; margin-top: 40px; }
.auth-stats b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.03em; color: var(--pd); }
.auth-stats span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--on-pl3); }
.auth-steps { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.auth-steps div { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--on-pl2); font-weight: 600; }
.auth-steps i { width: 22px; height: 22px; border-radius: 7px; background: var(--pdb); color: #fff; font-size: 12px; font-weight: 700; font-style: normal; display: flex; align-items: center; justify-content: center; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 56px; }
.auth-form form { width: 100%; max-width: 400px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: 12px; margin-bottom: 34px; }
.tabs a { flex: 1; text-align: center; padding: 10px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.tabs a.on { font-weight: 700; background: var(--sf); color: var(--ink); box-shadow: 0 1px 2px rgba(17,24,39,.06); }
.auth h2 { margin: 0 0 8px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.auth .lead { margin: 0 0 30px; font-size: 15px; color: var(--ink2); line-height: 1.5; }
.strength { display: flex; gap: 5px; margin: 10px 0 26px; }
.strength i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.strength i.on { background: var(--p); }
.or { display: flex; align-items: center; gap: 12px; margin: 26px 0; font-size: 13px; color: var(--ink3); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Onboarding ---------- */
.ob { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.ob-top { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 48px; background: var(--sf); border-bottom: 1px solid var(--line); }
.ob-top .brand .mark { width: 24px; height: 24px; }
.ob-top .brand .name { font-size: 15px; }
.ob-steps { display: flex; align-items: center; gap: 8px; }
.ob-steps i { width: 44px; height: 3px; border-radius: 2px; background: var(--line); }
.ob-steps i.on { background: var(--p); }
.ob-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px; }
.eyebrow { font-family: var(--mono); font-size: 12px; color: var(--pd); margin-bottom: 14px; }
.ob h2 { margin: 0 0 10px; font-size: 38px; font-weight: 700; letter-spacing: -.02em; line-height: 1.12; }
.ob .lead { margin: 0 0 34px; font-size: 16px; color: var(--ink2); line-height: 1.55; max-width: 560px; }
.plan { padding: 28px 26px; border-radius: 16px; background: var(--pl); display: flex; flex-direction: column; gap: 22px; }
.plan .n { font-size: 30px; font-weight: 800; letter-spacing: -.03em; color: var(--pd); line-height: 1; }
.plan .n.xl { font-size: 44px; letter-spacing: -.04em; }
.plan .l { font-size: 14px; color: var(--on-pl2); }
.plan .sep { background: var(--on-pl-line); }
.time-input { font-family: var(--mono); font-size: 14px; font-weight: 500; padding: 8px 10px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); width: auto; min-width: 104px; color: var(--ink); }
.time-input.sm { min-width: 0; padding: 4px 8px; margin-left: 6px; font-size: 13px; }
.time-input:hover { border-color: var(--pl2); }
.time-input:focus { border-color: var(--p); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--p) 18%, transparent); }
.time-input:disabled { opacity: .45; cursor: not-allowed; }
.time-input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }
:root[data-theme="dark"] .time-input::-webkit-calendar-picker-indicator { filter: invert(1); }

/* ---------- Dropdown (U.dropdown) ---------- */
.dd { position: relative; display: inline-block; }
.dd.block { display: block; }
.dd-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 8px 12px 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--sf); font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; transition: border-color .15s, box-shadow .15s; }
.dd.block .dd-btn { width: 100%; }
.dd-btn:hover { border-color: var(--pl2); }
.dd-btn:focus-visible, .dd.open .dd-btn { border-color: var(--p); box-shadow: 0 0 0 3px color-mix(in srgb, var(--p) 18%, transparent); outline: none; }
.dd-chev { width: 12px; height: 12px; color: var(--ink3); flex: none; transition: transform .15s; }
.dd.open .dd-chev { transform: rotate(180deg); color: var(--pd); }
.dd-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 100%; max-height: 300px; overflow-y: auto; padding: 6px; background: var(--sf); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(17,24,39,.14), 0 2px 6px rgba(17,24,39,.06); }
.dd.block .dd-menu { left: 0; }
.dd-menu[hidden] { display: none; }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink2); white-space: nowrap; text-align: left; }
.dd-opt:hover, .dd-opt:focus-visible { background: var(--sf2); color: var(--ink); outline: none; }
.dd-opt.on { background: var(--pl); color: var(--pd); font-weight: 700; }
.dd-check { font-size: 12px; }

/* ---------- Settings rows (profile) ---------- */
.prof { padding: 36px 48px; }
.prof-head { display: flex; align-items: center; gap: 22px; margin-bottom: 34px; }
.prof-av { width: 76px; height: 76px; border-radius: 22px; font-size: 30px; }
.prof-id { flex: 1; min-width: 0; }
.prof-id .page-h { font-size: 26px; overflow-wrap: anywhere; }
.prof-id .page-p { font-size: 14px; overflow-wrap: anywhere; }
.prof-meta { margin: 2px 0 0; font-size: 13px; color: var(--ink3); }
.prof-edit { padding: 12px 22px; font-size: 14px; }
.set-card { padding: 20px 24px; }
.set-card .card-title { margin-bottom: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 8px 0; border-top: 1px solid var(--line); }
.card-title + .set-row, .set-note + .set-row, .set-card > .set-row:first-child { border-top: 0; }
.set-l { min-width: 0; }
.set-r { flex: none; display: flex; align-items: center; }
.set-v { font-weight: 600; }
.set-note { font-size: 13px; line-height: 1.5; margin: 6px 0 2px; }
.stat-n { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }

/* ---------- Onboarding reminders ---------- */
.ob-rem { padding: 4px 22px; }
.ob-rem-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; }
.ob-rem-row + .ob-rem-row { border-top: 1px solid var(--line); }
.ob-rem-row .t { font-size: 15px; font-weight: 700; }
.ob-rem-row .d { font-size: 13px; color: var(--ink2); margin-top: 2px; }
.ob-rem-row.off .t, .ob-rem-row.off .d { opacity: .5; }

/* ---------- Exercise / learning flow ---------- */
.ex { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.ex-top { height: 60px; border-bottom: 1px solid var(--line); background: var(--sf); display: flex; align-items: center; gap: 20px; padding: 0 28px; position: sticky; top: 0; z-index: 5; }
.ex-top .exit { font-size: 14px; font-weight: 600; color: var(--ink2); white-space: nowrap; }
.ex-top .exit:hover { color: var(--ink); }
.ex-top .lbl { font-family: var(--mono); font-size: 12px; color: var(--ink3); white-space: nowrap; }
.ex-top .prog { flex: 1; max-width: 520px; margin: 0 auto; }
.ex-top .cnt { font-family: var(--mono); font-size: 12px; color: var(--ink2); white-space: nowrap; }
.badge-ok, .badge-bad { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; font-family: var(--mono); font-size: 12px; }
.badge-ok { background: var(--okl); color: var(--ok); }
.badge-bad { background: var(--badl); color: var(--bad); }
.ex-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.ex-cap { font-family: var(--mono); font-size: 12px; color: var(--ink3); }

.fc { background: var(--sf); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-card); }
.fc-front { padding: 64px 56px; }
.fc .word { font-family: var(--ko); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.fc .rom { font-family: var(--mono); color: var(--ink3); }
.audio-pill { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 99px; background: var(--pl); color: var(--pd); font-size: 14px; font-weight: 700; }
.audio-dot { width: 38px; height: 38px; border-radius: 99px; background: var(--pl); color: var(--pd); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.fc-back { display: grid; grid-template-columns: minmax(0,1fr) 300px; overflow: hidden; }
.fc-back .l { padding: 40px 44px; border-right: 1px solid var(--line); }
.fc-back .r { padding: 32px 26px; background: var(--sf2); display: flex; flex-direction: column; gap: 22px; }
.example { padding: 20px 22px; border-radius: 14px; background: var(--sf2); border: 1px solid var(--line); margin-bottom: 14px; }
.example .s { font-family: var(--ko); font-size: 21px; font-weight: 500; line-height: 1.55; margin-bottom: 10px; }
.example .s b, .hl { color: var(--pd); font-weight: 700; }
.grade { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--sf); width: 100%; font-size: 14px; font-weight: 600; transition: transform .08s; }
.grade:hover { transform: translateX(2px); }
.grade .k { font-family: var(--mono); font-size: 12px; color: var(--ink3); margin-left: auto; }
.grade.g1 { background: var(--badl); border-color: rgba(201,72,60,.25); color: var(--bad); font-weight: 700; }
.grade.g1 .k { color: var(--bad); }
.grade.g3 { background: var(--pl); border: 1.5px solid var(--p); color: var(--on-pl2); font-weight: 700; }
.grade.g3 .k { color: var(--pd); }
.grade.g4 { background: var(--okl); border-color: rgba(15,138,95,.25); color: var(--ok); font-weight: 700; }
.grade.g4 .k { color: var(--ok); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { display: flex; align-items: center; gap: 14px; padding: 20px 22px; border-radius: 14px; background: var(--sf); border: 1.5px solid var(--line); text-align: left; font-size: 17px; font-weight: 600; transition: border-color .12s, transform .08s; }
.choice:hover:not(:disabled) { border-color: var(--pl2); }
.choice:disabled { cursor: default; }
.choice .n { font-family: var(--mono); font-size: 12px; width: 22px; height: 22px; border-radius: 7px; background: var(--bg); color: var(--ink2); display: flex; align-items: center; justify-content: center; flex: none; font-weight: 400; }
.choice .txt { flex: 1; }
.choice.ko { font-family: var(--ko); font-size: 28px; font-weight: 700; justify-content: center; padding: 22px; }
.choice.ko .n { font-family: var(--mono); }
.choice.right { background: var(--okl); border-color: var(--ok); color: var(--okd); font-weight: 700; box-shadow: 0 10px 26px -16px rgba(15,138,95,.6); }
.choice.right .n { background: var(--ok); color: #fff; }
.choice.wrong { background: var(--badl); border-color: var(--bad); color: var(--bad); }
.choice.wrong .n { background: var(--bad); color: #fff; }
.choice.fade { opacity: .55; }
.feedback { display: flex; align-items: center; gap: 20px; padding: 20px 24px; border-radius: 14px; background: var(--sf); border: 1px solid var(--line); }

.typebox { padding: 18px 22px; border-radius: 16px; background: var(--sf); border: 1.5px solid var(--line); display: flex; align-items: center; gap: 14px; }
.typebox:focus-within { border-color: var(--p); }
.typebox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-family: var(--ko); font-size: 34px; font-weight: 700; }
.typebox input::placeholder { color: var(--ink3); font-weight: 500; font-size: 22px; font-family: inherit; }
.typebox.wrong { border-color: var(--bad); }
.typebox.wrong .val { font-family: var(--ko); font-size: 34px; font-weight: 700; color: var(--bad); text-decoration: line-through; text-decoration-color: rgba(201,72,60,.4); flex: 1; }
.answer-ok { padding: 24px 26px; border-radius: 16px; background: var(--okl); border: 1px solid rgba(15,138,95,.25); }

.play-big { width: 132px; height: 132px; border-radius: 99px; background: var(--pdb); margin: 0 auto 22px; display: flex; align-items: center; justify-content: center; box-shadow: 0 20px 44px -18px rgba(216,139,63,.75); color: #fff; font-size: 42px; transition: transform .1s; }
.play-big:hover { transform: scale(1.03); }
.wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 34px; margin-bottom: 12px; }
.wave i { width: 4px; border-radius: 2px; background: var(--pl2); }
.wave i.on { background: var(--p); }
.wave.playing i { animation: wave 0.9s ease-in-out infinite; }
.wave.playing i:nth-child(2n) { animation-delay: .15s; }
.wave.playing i:nth-child(3n) { animation-delay: .3s; }
@keyframes wave { 50% { transform: scaleY(.45); } }

.cloze { padding: 44px 48px; border-radius: 20px; background: var(--sf); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.cloze .s { font-family: var(--ko); font-size: 34px; font-weight: 500; line-height: 1.7; margin-bottom: 18px; text-align: center; }
.blank { display: inline-block; min-width: 150px; border-bottom: 3px solid var(--p); text-align: center; color: var(--pd); font-weight: 700; }
.blank.right { color: var(--ok); border-color: var(--ok); }
.blank.wrong { color: var(--bad); border-color: var(--bad); }
.opts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.optk { padding: 16px 26px; border-radius: 12px; background: var(--sf); border: 1.5px solid var(--line); font-family: var(--ko); font-size: 22px; font-weight: 700; }
.optk:hover:not(:disabled) { border-color: var(--pl2); }
.optk.on { border-color: var(--p); background: var(--pl); }
.optk.right { border-color: var(--ok); background: var(--okl); color: var(--okd); }
.optk.wrong { border-color: var(--bad); background: var(--badl); color: var(--bad); }

.done-glyph { font-family: var(--ko); font-size: 54px; font-weight: 900; color: var(--pd); letter-spacing: -.04em; margin-bottom: 14px; }

/* ---------- Tutor ---------- */
.chat { display: grid; grid-template-columns: minmax(0,1fr) 320px; height: 100vh; background: var(--bg); }
.chat-main { min-width: 0; display: flex; flex-direction: column; background: var(--sf); }
.chat-head { height: 64px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 28px; flex: none; }
.chat-log { flex: 1; overflow-y: auto; padding: 28px 40px; display: flex; flex-direction: column; gap: 20px; }
.bub { max-width: 76%; padding: 18px 22px; border-radius: 16px 16px 16px 5px; background: var(--bg); }
.bub.me { margin-left: auto; border-radius: 16px 16px 5px 16px; background: var(--pl); color: var(--on-pl); }
.bub.fix { max-width: 82%; background: var(--sf); border: 1.5px solid var(--pl2); }
.bub .kt { font-family: var(--ko); font-size: 19px; font-weight: 500; line-height: 1.6; }
.bub .ut { font-size: 14px; color: var(--ink2); line-height: 1.5; margin-top: 10px; }
.bub .err-u { text-decoration: underline; text-decoration-color: var(--bad); text-decoration-thickness: 2px; }
.fixbox { flex: 1; padding: 14px 16px; border-radius: 11px; }
.fixbox .h { font-family: var(--mono); font-size: 12px; margin-bottom: 6px; }
.fixbox .v { font-family: var(--ko); font-size: 17px; }
.chat-foot { padding: 20px 40px 28px; border-top: 1px solid var(--line); flex: none; }
.chat-input { flex: 1; padding: 15px 18px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--sf); font-family: var(--ko); font-size: 17px; outline: none; resize: none; min-height: 54px; max-height: 160px; }
.chat-input:focus { border-color: var(--p); }
.send { width: 50px; height: 50px; border-radius: 13px; background: var(--pdb); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 8px 20px -8px rgba(216,139,63,.7); flex: none; }
.send:disabled { opacity: .5; }
.chat-side { border-left: 1px solid var(--line); padding: 24px 22px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--ink3); animation: blink 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .2s; }
.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* Bars chart */
.bars { display: flex; align-items: flex-end; gap: 8px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bars .col > div { width: 100%; border-radius: 5px; background: var(--p); min-height: 5px; }
.bars .col > div.cur { background: var(--pl2); }
.bars .col > div.zero { background: var(--line); }
.bars .col span { font-size: 13px; color: var(--ink3); }
.bars .col span.cur { font-weight: 700; color: var(--pd); }

/* Achievements */
.ach { padding: 20px; border-radius: 14px; background: var(--sf); border: 1.5px solid var(--p); text-align: center; }
.ach .g { font-family: var(--ko); font-size: 26px; font-weight: 700; color: var(--pd); margin-bottom: 10px; }
.ach .t { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.ach .d { font-size: 13px; color: var(--ink2); }
.ach.locked { background: var(--sf2); border: 1px dashed var(--line); color: var(--locked); }
.ach.locked .g, .ach.locked .d { color: var(--locked); }

/* Modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(17,24,39,.4); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; animation: fade .15s ease; }
.modal { background: var(--sf); border-radius: 18px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); animation: pop .18s ease; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-b { padding: 16px 24px 24px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 11px; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px -12px rgba(0,0,0,.4); animation: pop .18s ease; }

table.tbl { width: 100%; border-collapse: collapse; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .hide-lg { display: none !important; }
  .dgrid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .hero { grid-template-columns: minmax(0,1fr); }
  .hero .wm { display: none; }
  .auth { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .auth-art .hangul { font-size: 80px !important; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0,1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; gap: 12px; }
  .topbar .sub { display: none; }
  .page, .page.wide { padding: 20px 16px 40px; }
  .collapse-md { grid-template-columns: minmax(0,1fr) !important; }
  .auth { grid-template-columns: minmax(0,1fr); }
  .auth-art { display: none; }
  .auth-form { padding: 32px 16px; }
  .chat { grid-template-columns: minmax(0,1fr); }
  .chat-side { display: none; }
  .fc-back { grid-template-columns: minmax(0,1fr); }
  .fc-back .l { border-right: 0; border-bottom: 1px solid var(--line); }
  .strip { flex-wrap: wrap; }
  .strip > div { flex: 1 1 33%; border-bottom: 1px solid var(--line); }
  .ob-top { padding: 0 16px; }
  .ob-body, .ex-body { padding: 24px 16px; }
  .ex-top { padding: 0 16px; gap: 12px; }
  .ex-top .lbl { display: none; }
}
@media (max-width: 640px) {
  .topbar .right:has(.seg) .pill.streak { display: none; }
  .list .li .mbar-wrap { display: none; }
  .list .kw { min-width: 72px; }
  .prof-head { flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
  .prof-av { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
  .prof-id .page-h { font-size: 22px; }
  .prof-edit { width: 100%; }
  .set-card { padding: 16px 18px; }
  .dgrid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .wgrid, .choices { grid-template-columns: minmax(0,1fr); }
  .ob h2 { font-size: 28px; }
  .fc-front { padding: 40px 20px; }
  .fc .word { font-size: 56px !important; }
  .cloze { padding: 28px 20px; }
  .cloze .s { font-size: 24px; }
  .chat-log, .chat-foot { padding-left: 16px; padding-right: 16px; }
  .bub { max-width: 92%; }
  .hide-sm { display: none !important; }
  .two-sm { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}
