:root {
  --bg: #f5f5fb; --card: #ffffff; --text: #1c1b2e; --muted: #6b6a85; --line: #e6e5f0;
  --pri: #4f46e5; --pri2: #7c3aed; --pri-soft: #ecebff; --acc: #f59e0b;
  --ok: #16a34a; --ok-soft: #dcfce7; --bad: #dc2626; --bad-soft: #fee2e2;
  --lv-new: #94a3b8; --lv-learning: #f59e0b; --lv-known: #3b82f6; --lv-mastered: #16a34a;
  --r: 16px; --shadow: 0 1px 2px rgba(20,20,50,.06), 0 4px 16px rgba(20,20,50,.06);
  --font: system-ui, -apple-system, "Segoe UI", Rubik, Heebo, Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f1020; --card: #1a1b30; --text: #ececf7; --muted: #9a99b8; --line: #2c2d48;
  --pri: #818cf8; --pri2: #a78bfa; --pri-soft: #272a52; --ok-soft: #12351f; --bad-soft: #3d1717;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; }
body { min-height: 100vh; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
body.no-nav { padding-bottom: 0; }
body.no-nav .nav, body.no-nav .top #hdr-status { display: none; }
a { color: var(--pri); text-decoration: none; }
h1 { font-size: 1.6rem; margin: .2em 0 .4em; }
h2 { margin: .2em 0; } h3 { margin: .3em 0; }
p { margin: .4em 0; }
.en { font-family: var(--font); unicode-bidi: isolate; }
.muted { color: var(--muted); } .small, small { font-size: .85rem; }
.center { text-align: center; justify-content: center; } .pad { padding: 24px; }
.err { color: var(--bad); }
.row { display: flex; align-items: center; } .col { display: flex; flex-direction: column; }
.between { justify-content: space-between; } .end { justify-content: flex-end; } .wrap { flex-wrap: wrap; }
.gap-s { gap: 8px; } .grow { flex: 1; min-width: 0; } .full { width: 100%; }
code { background: var(--pri-soft); padding: 1px 6px; border-radius: 6px; font-size: .85em; }

/* ---- layout ---- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--text); direction: ltr; }
.brand span, .auth h1 span { color: var(--pri); }
.view { max-width: 720px; margin: 0 auto; padding: 4px 16px 24px; }
.nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: .72rem; color: var(--muted); padding: 4px 0; border-radius: 12px; }
.nav a span { font-size: 1.35rem; line-height: 1.2; filter: grayscale(.6); transition: transform .15s; }
.nav a.active { color: var(--pri); font-weight: 700; }
.nav a.active span { filter: none; transform: translateY(-2px) scale(1.1); }

/* ---- components ---- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin: 12px 0; border: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; transition: transform .08s, background .15s; text-align: center; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--pri), var(--pri2)); color: #fff; border: 0; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: .85rem; border-radius: 10px; }
.btn.big { padding: 14px 22px; font-size: 1.1rem; }
.btn.good { background: var(--ok); color: #fff; border: 0; } .btn.bad { background: var(--bad); color: #fff; border: 0; }
.link { background: none; border: 0; color: var(--pri); font: inherit; cursor: pointer; padding: 0; }
.icon-btn { border: 0; background: var(--pri-soft); width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1.1rem; cursor: pointer; flex-shrink: 0; }
.icon-btn.sm { width: 30px; height: 30px; font-size: .85rem; vertical-align: middle; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--pri-soft); color: var(--text); padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.pill.warn { background: #fef3c7; color: #92400e; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.sync { font-size: .9rem; } .sync.syncing { animation: spin 1s linear infinite; display: inline-block; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--pri); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--pri); }
input[type=range] { padding: 0; accent-color: var(--pri); }
input.good { border-color: var(--ok); background: var(--ok-soft); } input.bad { border-color: var(--bad); background: var(--bad-soft); }
.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.form label > input, .form label > select, .form label > textarea, .form label > .row { margin-top: 4px; }
label.inline { display: flex !important; align-items: center; gap: 8px; font-weight: 500; }
.tabs { display: flex; gap: 4px; background: var(--pri-soft); padding: 4px; border-radius: 14px; margin: 12px 0; overflow-x: auto; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.section-title { margin-top: 22px; font-size: 1rem; color: var(--muted); }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 16px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--pri), var(--pri2)); border-radius: 99px; transition: width .3s; }
.empty { text-align: center; padding: 40px 16px; }
.empty-ico { font-size: 3rem; } .empty p { color: var(--muted); }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; bottom: calc(90px + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 20px); background: #1c1b2e; color: #fff;
  padding: 10px 18px; border-radius: 12px; z-index: 100; opacity: 0; transition: .25s; max-width: 90vw; text-align: center; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.err { background: var(--bad); }
.modal-wrap { position: fixed; inset: 0; background: rgba(10,10,30,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.modal-wrap.closing { opacity: 0; transition: opacity .18s; }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); position: relative; animation: up .22s ease-out; }
.modal.wide { max-width: 680px; }
@media (min-width: 640px) { .modal-wrap { align-items: center; } .modal { border-radius: 22px; } }
.modal-x { position: absolute; top: 12px; left: 12px; border: 0; background: var(--pri-soft); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: var(--text); }
.modal h2 { padding-left: 36px; }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(40px); opacity: .5; } }
.menu { display: flex; flex-direction: column; gap: 6px; }
.menu button { text-align: start; border: 0; background: var(--bg); padding: 14px; border-radius: 12px; font: inherit; color: var(--text); cursor: pointer; }
.confirm-text { font-size: 1.05rem; margin: 10px 0 20px; }

/* ---- auth ---- */
.auth { max-width: 400px; margin: 6vh auto 0; text-align: center; }
.auth-logo { font-size: 3.5rem; } .auth h1 { font-size: 2.4rem; direction: ltr; margin: 0; }
.auth .form { text-align: start; }

/* ---- home ---- */
.hello { font-size: 1.4rem; margin-bottom: 0; }
.goal { display: flex; gap: 16px; align-items: center; }
.ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--pri) calc(var(--p) * 1%), var(--line) 0); }
.ring > div { width: 74px; height: 74px; background: var(--card); border-radius: 50%; display: grid; place-items: center; align-content: center; line-height: 1.1; }
.ring b { font-size: 1.4rem; } .ring small { color: var(--muted); }
.week { display: flex; gap: 6px; height: 54px; align-items: flex-end; margin-top: 6px; }
.week .bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.week .bar i { width: 100%; max-width: 22px; background: var(--pri-soft); border-radius: 6px; }
.week .bar.full i { background: var(--pri); } .week .bar span { font-size: .7rem; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .grid2 .card { margin: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .grid3 .card { margin: 0; }
.tile { display: flex; flex-direction: column; align-items: center; color: var(--text); text-align: center; }
.tile b { font-size: 2rem; line-height: 1.2; } .tile span { color: var(--muted); font-size: .9rem; } .tile-ico { font-size: 1.6rem; }
.tile.hot { background: linear-gradient(135deg, var(--pri), var(--pri2)); color: #fff; border: 0; } .tile.hot span { color: #e0e0ff; }
.levels { display: flex; justify-content: space-around; text-align: center; }
.lv { display: flex; flex-direction: column; } .lv b { font-size: 1.3rem; } .lv span { font-size: .8rem; color: var(--muted); }
.lv-new b { color: var(--lv-new); } .lv-learning b { color: var(--lv-learning); } .lv-known b { color: var(--lv-known); } .lv-mastered b { color: var(--lv-mastered); }
.wotd h2 { font-size: 1.8rem; } .wotd .he { font-size: 1.1rem; }
.ex { direction: ltr; text-align: left; background: var(--bg); padding: 10px 12px; border-radius: 12px; }
.cta { background: linear-gradient(135deg, var(--pri-soft), var(--card)); }
.note { display: block; background: #fef3c7; color: #78350f; border-color: #fde68a; }
[data-theme="dark"] .note { background: #3b2f12; color: #fde68a; border-color: #5b4615; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.q { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 6px; display: flex; flex-direction: column; align-items: center; color: var(--text); font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); }
.q span { font-size: 1.6rem; }

/* ---- words ---- */
.filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; } .filters select { width: auto; flex: 1; padding: 8px; }
.word-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 6px 0; cursor: pointer; }
.word-row.sel { border-color: var(--pri); background: var(--pri-soft); }
.w-en { font-weight: 700; direction: ltr; text-align: right; } .w-he { color: var(--muted); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check { font-size: 1.3rem; color: var(--pri); }
.lvl { font-size: .72rem; padding: 2px 8px; border-radius: 99px; color: #fff; white-space: nowrap; font-weight: 600; }
.lvl.lv-new { background: var(--lv-new); } .lvl.lv-learning { background: var(--lv-learning); } .lvl.lv-known { background: var(--lv-known); } .lvl.lv-mastered { background: var(--lv-mastered); }
.selbar { position: sticky; top: 60px; z-index: 5; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: var(--card); padding: 8px; border-radius: 14px; box-shadow: var(--shadow); }
.selbar span { flex: 1; font-weight: 600; }
.packs .pack { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.packs .pack small { display: block; }
.detail .he.big, .he.big { font-size: 1.25rem; }
.ex-box { background: var(--bg); padding: 10px 12px; border-radius: 12px; margin: 10px 0; } .ex-box p:first-child { direction: ltr; text-align: left; }
.note-txt { background: var(--pri-soft); padding: 8px 12px; border-radius: 10px; }
.stats-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 14px 0; }
.stats-mini div { background: var(--bg); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stats-mini b { font-size: .9rem; } .stats-mini span { font-size: .72rem; color: var(--muted); }

/* ---- practice hub ---- */
.acts { display: flex; flex-direction: column; gap: 8px; }
.act { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; color: var(--text); box-shadow: var(--shadow); }
.act small { display: block; color: var(--muted); } .act-ico { font-size: 1.6rem; width: 44px; height: 44px; display: grid; place-items: center; background: var(--pri-soft); border-radius: 12px; flex-shrink: 0; }
.act.disabled { opacity: .45; pointer-events: none; }

/* ---- game ---- */
.game, .review { padding-top: 4px; }
.prompt { text-align: center; padding: 18px 8px; }
.xl { font-size: 2.1rem; margin: .1em 0; word-break: break-word; } .he.xl { font-size: 1.8rem; }
.opts { display: grid; gap: 10px; }
.opt { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 15px; font: inherit; font-size: 1.05rem; color: var(--text); cursor: pointer; transition: .12s; }
.opt:active { transform: scale(.98); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); } .opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.feedback { position: fixed; bottom: calc(64px + env(safe-area-inset-bottom)); inset-inline: 0; margin: 0 auto; max-width: 720px; display: flex; gap: 10px; align-items: center;
  padding: 14px 16px; border-radius: 18px 18px 0 0; z-index: 25; animation: up .2s; box-shadow: 0 -4px 20px rgba(0,0,0,.1); }
.feedback.ok { background: var(--ok-soft); border-top: 3px solid var(--ok); } .feedback.bad { background: var(--bad-soft); border-top: 3px solid var(--bad); }
.feedback b { font-size: 1.1rem; }
.type-form { display: flex; flex-direction: column; gap: 10px; } .type-form input, .type-form textarea { font-size: 1.2rem; text-align: center; }
.type-form textarea { text-align: left; }
.hint { letter-spacing: 2px; font-family: monospace; font-size: 1.2rem; min-height: 1.5em; }
.big-play { width: 96px; height: 96px; border-radius: 50%; border: 0; font-size: 2.4rem; background: linear-gradient(135deg, var(--pri), var(--pri2)); color: #fff; cursor: pointer; box-shadow: var(--shadow); margin: 6px; }
.big-play:active { transform: scale(.95); }
.slots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.slot { width: 38px; height: 46px; border-bottom: 3px solid var(--pri); display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; }
.slots.good .slot { border-color: var(--ok); color: var(--ok); } .slots.bad .slot { border-color: var(--bad); color: var(--bad); }
.tiles { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.tile-l { width: 46px; height: 50px; border-radius: 12px; border: 0; background: var(--pri-soft); color: var(--text); font-size: 1.4rem; font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.tile-l:disabled { opacity: .2; }
.lives { font-size: 1.1rem; letter-spacing: 2px; } .hang { font-family: monospace; letter-spacing: 4px; font-size: 1.8rem; }
.kbd { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.kbd button { padding: 10px 0; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.kbd button.hit { background: var(--ok); color: #fff; } .kbd button.miss { background: var(--bad-soft); color: var(--muted); }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .match .col { gap: 8px; }
.m-card { padding: 14px 6px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font: inherit; color: var(--text); cursor: pointer; min-height: 56px; }
.m-card.sel { border-color: var(--pri); background: var(--pri-soft); } .m-card.done { opacity: .25; border-color: var(--ok); pointer-events: none; }
.shake { animation: shake .4s; border-color: var(--bad) !important; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.speed .timer { font-size: 1.4rem; font-weight: 800; color: var(--bad); }
.speed #sc { font-size: 1.4rem; color: var(--pri); }
.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .tf .btn { padding: 22px; }
.flash-ok { background: var(--ok-soft); border-radius: 16px; } .flash-bad { background: var(--bad-soft); border-radius: 16px; }
.finish { text-align: center; padding: 30px 8px; } .big-emoji { font-size: 4rem; } .finish h2 { font-size: 2.2rem; }
.mistakes { text-align: start; } .mistakes .row { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* ---- flashcards ---- */
.flash { position: relative; min-height: 300px; perspective: 1200px; cursor: pointer; margin-bottom: 16px; }
.flash .face { position: absolute; inset: 0; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; text-align: center; backface-visibility: hidden; transition: transform .45s; }
.flash .back { transform: rotateY(180deg); } .flash.flipped .front { transform: rotateY(-180deg); } .flash.flipped .back { transform: rotateY(0); }
.flash .ex-box { width: 100%; }
.badge-new { text-align: center; color: var(--ok); font-weight: 700; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.g { border: 0; border-radius: 14px; padding: 14px 4px; font: inherit; font-weight: 700; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.g small { font-weight: 400; font-size: .68rem; opacity: .85; }
.g0 { background: #ef4444; } .g1 { background: #f59e0b; } .g2 { background: #22c55e; } .g3 { background: #3b82f6; }

/* ---- sentences ---- */
.built, .bank { display: flex; flex-wrap: wrap; gap: 8px; min-height: 56px; padding: 10px; border-radius: 14px; margin: 10px 0; }
.built { border: 2px dashed var(--line); align-items: center; } .built.good { border-color: var(--ok); background: var(--ok-soft); } .built.bad { border-color: var(--bad); background: var(--bad-soft); }
.tok { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px; padding: 8px 12px; font: inherit; cursor: pointer; box-shadow: 0 2px 0 var(--line); }
.tok.on { background: var(--pri-soft); } .tok:disabled { opacity: .2; }
.sentence { font-size: 1.3rem; text-align: center; line-height: 1.6; }
.blank { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--pri); color: var(--pri); font-weight: 700; }
.blank.filled { border-color: var(--ok); color: var(--ok); }
.diff { line-height: 2; text-align: left; } .diff .ok { color: var(--ok); } .diff .miss { color: var(--bad); text-decoration: underline wavy; }
.ai-res p { margin: 8px 0; } .mist { padding-inline-start: 18px; } .mist s { color: var(--bad); } .mist b { color: var(--ok); }
.story-text { font-size: 1.1rem; line-height: 1.8; text-align: left; } .story-text mark { background: #fde68a; border-radius: 4px; padding: 0 2px; color: #1c1b2e; }
.sq p { margin-top: 0; }

/* ---- speaking ---- */
.mic-area { text-align: center; padding: 10px 0; }
.mic { width: 88px; height: 88px; border-radius: 50%; border: 0; font-size: 2.2rem; background: var(--pri-soft); cursor: pointer; transition: .2s; }
.mic.sm { width: 48px; height: 48px; font-size: 1.3rem; flex-shrink: 0; }
.mic.rec { background: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 100% { box-shadow: 0 0 0 22px rgba(220,38,38,0); } }

/* ---- chat ---- */
.scen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scen-b { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; color: var(--text); cursor: pointer; font-weight: 600; }
.scen-b span { font-size: 2rem; }
.chat { display: flex; flex-direction: column; height: calc(100vh - 150px - env(safe-area-inset-bottom)); }
.chat-top { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.msgs { flex: 1; overflow-y: auto; padding: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; } .msg .b { padding: 10px 14px; border-radius: 18px; text-align: left; }
.msg.me { align-self: flex-start; } .msg.me .b { background: linear-gradient(135deg, var(--pri), var(--pri2)); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-end; } .msg.ai .b { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.corr { font-size: .88rem; background: #fef3c7; color: #78350f; padding: 6px 10px; border-radius: 10px; margin-top: 4px; }
[data-theme="dark"] .corr { background: #3b2f12; color: #fde68a; }
.tr { font-size: .9rem; color: var(--muted); padding: 4px 8px; }
.chat-in { display: flex; gap: 8px; align-items: center; padding-top: 8px; }
.typing { display: flex; gap: 4px; } .typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-5px); opacity: .5; } }

/* ---- share ---- */
.code-form { display: flex; gap: 8px; } .code-form input { text-transform: uppercase; letter-spacing: 2px; text-align: center; }
.pack-card { display: flex; gap: 10px; align-items: center; width: 100%; font: inherit; color: var(--text); text-align: start; cursor: pointer; }
.pack-card small { display: block; }
.pick-list { max-height: 45vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; margin: 8px 0; }
.pick { padding: 6px; border-bottom: 1px solid var(--line); font-weight: 400 !important; } .pick.have { opacity: .55; }
.code-big { font-size: 2.4rem; font-weight: 800; letter-spacing: 6px; text-align: center; color: var(--pri); margin: 10px 0; }
.pack-hero { text-align: center; }
.sug { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
details summary { cursor: pointer; padding: 8px 0; }

/* ---- stats ---- */
.stat { text-align: center; display: flex; flex-direction: column; } .stat b { font-size: 1.4rem; } .stat span { font-size: .8rem; color: var(--muted); }
.stackbar { display: flex; height: 18px; border-radius: 99px; overflow: hidden; background: var(--line); }
.stackbar i.lv-new, .dot.lv-new { background: var(--lv-new); } .stackbar i.lv-learning, .dot.lv-learning { background: var(--lv-learning); }
.stackbar i.lv-known, .dot.lv-known { background: var(--lv-known); } .stackbar i.lv-mastered, .dot.lv-mastered { background: var(--lv-mastered); }
.legend { margin-top: 10px; font-size: .85rem; } .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 4px; }
.chart30 .bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; }
.chart30 .bars i { flex: 1; background: var(--pri-soft); border-radius: 3px 3px 0 0; } .chart30 .bars i.full { background: var(--pri); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; } .tbl th, .tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: start; }
.word-mini { padding: 6px 0; border-bottom: 1px solid var(--line); }
.settings .card h3 { margin-top: 0; }
