/* Deutsch mit Dina — V5 design system. Mobile-first, RTL, light & dark. */
:root {
  --bg: #f5f3ee; --surface: #ffffff; --surface-2: #faf8f4; --ink: #142033; --ink-2: #3b4a5e; --muted: #6b7889; --line: #e4e0d6;
  --brand: #0f6e68; --brand-2: #0b5550; --brand-soft: #e3f1ef; --gold: #b4893a; --gold-soft: #f6eedc;
  --ok: #18794e; --ok-soft: #e4f4ea; --bad: #b42318; --bad-soft: #fdecea; --warn: #9a6700; --warn-soft: #fff4d6; --info: #1d4ed8; --info-soft: #e8efff;
  --radius: 18px; --radius-sm: 12px; --shadow: 0 1px 2px rgba(20, 32, 51, .06), 0 8px 24px rgba(20, 32, 51, .06);
  --font: "IBM Plex Sans Arabic", "Segoe UI", system-ui, -apple-system, "Noto Sans Arabic", Tahoma, sans-serif;
  --font-de: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1520; --surface: #151f2e; --surface-2: #1a2637; --ink: #edf1f6; --ink-2: #c7d0dc; --muted: #93a1b3; --line: #263449;
    --brand: #3cb3a8; --brand-2: #5cc7bc; --brand-soft: #143532; --gold: #d8b06a; --gold-soft: #3a3020;
    --ok: #4ac487; --ok-soft: #12321f; --bad: #ff8a80; --bad-soft: #3a1714; --warn: #f0c45a; --warn-soft: #3a3013; --info: #8fb0ff; --info-soft: #18264a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1520; --surface: #151f2e; --surface-2: #1a2637; --ink: #edf1f6; --ink-2: #c7d0dc; --muted: #93a1b3; --line: #263449;
  --brand: #3cb3a8; --brand-2: #5cc7bc; --brand-soft: #143532; --gold: #d8b06a; --gold-soft: #3a3020;
  --ok: #4ac487; --ok-soft: #12321f; --bad: #ff8a80; --bad-soft: #3a1714; --warn: #f0c45a; --warn-soft: #3a3013; --info: #8fb0ff; --info-soft: #18264a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 60%, transparent); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[lang="de"], .de { font-family: var(--font-de); direction: ltr; unicode-bidi: isolate; }
.de-block { font-family: var(--font-de); direction: ltr; text-align: left; }

/* ---------- App shell */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); padding: calc(8px + var(--safe-t)) 16px 8px; }
.topbar-in { max-width: 920px; margin: auto; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; margin-inline-end: auto; min-width: 0; flex: 1; }
.brand > span:last-child { min-width: 0; overflow: hidden; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), #123a5c); color: #fff; display: grid; place-items: center; font-family: var(--font-de); font-weight: 800; font-size: 15px; flex: none; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.2; }
.brand b { display: block; font-size: 15px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.streak { color: #c2410c; } .chip.xp { color: var(--gold); }
.back { border: 0; background: var(--surface); border: 1px solid var(--line); width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: none; }

main { max-width: 920px; margin: auto; padding: 16px 16px calc(96px + var(--safe-b)); }
.tabbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b)); }
.tabbar-in { max-width: 620px; margin: auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.tab { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 12px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--brand); background: var(--brand-soft); }

/* ---------- Typography & layout */
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .4em; letter-spacing: -.005em; }
h1 { font-size: clamp(24px, 6vw, 32px); } h2 { font-size: clamp(20px, 5vw, 24px); } h3 { font-size: 18px; } h4 { font-size: 16px; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .tiny { font-size: 12px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid-4 { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 719px) { .grid-4 { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.soft { background: var(--surface-2); box-shadow: none; }
.card h3:first-child, .card h2:first-child { margin-top: 0; }
.tile { display: block; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .15s, border-color .15s; width: 100%; }
.tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.tile .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; margin-bottom: 8px; background: var(--brand-soft); }
.tile b { display: block; font-size: 15.5px; } .tile span { color: var(--muted); font-size: 13px; }
.hero { position: relative; overflow: hidden; border-radius: 22px; color: #fff; padding: 22px; background: linear-gradient(130deg, #0f2c44 0%, #0f6e68 70%, #1b8a7f 100%); box-shadow: var(--shadow); }
.hero h1, .hero h2 { color: #fff; } .hero p { color: rgba(255, 255, 255, .86); }
.hero .pill { background: rgba(255, 255, 255, .15); color: #fff; border-color: rgba(255, 255, 255, .25); }
.hero-art { position: absolute; inset-inline-end: 18px; top: 18px; width: 34%; max-width: 260px; border-radius: 16px; overflow: hidden; opacity: .95; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.hero-art svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; }
.hero > :not(.hero-art) { position: relative; }
@media (max-width: 640px) { .hero-art { display: none; } }
@media (min-width: 641px) { .hero > :not(.hero-art) { max-width: 60%; } }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--brand-soft); color: var(--brand-2); border: 1px solid transparent; }
.pill.gold { background: var(--gold-soft); color: var(--gold); } .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.gray { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.stat { font-size: 26px; font-weight: 800; font-family: var(--font-de); line-height: 1.1; }
.kpi { text-align: center; padding: 14px 8px; } .kpi .small { margin-top: 4px; }

/* ---------- Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 700; background: var(--brand); color: #fff; text-decoration: none; min-height: 46px; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.07); } .btn:active { transform: scale(.98); }
.btn.alt { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--brand); padding-inline: 8px; }
.btn.gold { background: var(--gold); } .btn.danger { background: var(--bad); }
.btn.block { width: 100%; } .btn.sm { min-height: 36px; padding: 7px 12px; font-size: 14px; border-radius: 11px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; min-width: 40px; height: 40px; display: inline-grid; place-items: center; font-size: 17px; padding: 0 10px; }
input[type="text"], input[type="search"], input[type="url"], textarea, select { width: 100%; border: 1.5px solid var(--line); border-radius: 13px; background: var(--surface); padding: 11px 13px; min-height: 46px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
label { font-weight: 600; display: block; margin-bottom: 6px; }
.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.seg button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Progress */
.bar { height: 9px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; transition: width .35s; }
.bar.gold > i { background: linear-gradient(90deg, #c99a46, var(--gold)); }
.ring { --p: 0; width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-2) 0); display: grid; place-items: center; flex: none; }
.ring > span { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 12.5px; font-weight: 800; font-family: var(--font-de); }

/* ---------- Learning path map */
.path { position: relative; display: grid; gap: 10px; }
.unit { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); width: 100%; text-align: start; }
.unit .node { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-family: var(--font-de); background: var(--surface-2); border: 2px solid var(--line); flex: none; }
.unit.done .node { background: var(--ok); color: #fff; border-color: var(--ok); }
.unit.next { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.unit.next .node { background: var(--brand); color: #fff; border-color: var(--brand); }
.unit .meta { min-width: 0; flex: 1; } .unit .meta b { display: block; } .unit .meta span { color: var(--muted); font-size: 13px; }
.chapter { margin: 18px 0 6px; font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .02em; }

/* ---------- Lesson content */
.explain { font-size: 16.5px; }
.explain h4 { margin-top: 16px; color: var(--brand-2); }
.rule { border-inline-start: 4px solid var(--brand); background: var(--brand-soft); padding: 12px 14px; border-radius: 12px; margin: 12px 0; }
.tip { border-inline-start: 4px solid var(--gold); background: var(--gold-soft); padding: 12px 14px; border-radius: 12px; margin: 12px 0; }
.warnbox { border-inline-start: 4px solid var(--bad); background: var(--bad-soft); padding: 12px 14px; border-radius: 12px; margin: 12px 0; }
.table-wrap { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
th { background: var(--surface-2); font-size: 13.5px; } tr:last-child td { border-bottom: 0; }
td[lang="de"], th[lang="de"] { text-align: left; }
.ex { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.ex:last-child { border-bottom: 0; }
.ex .de { font-size: 17px; font-weight: 600; } .ex .ar { grid-column: 1; color: var(--ink-2); font-size: 15px; }
.ex .play { grid-row: 1 / span 2; grid-column: 2; }
.play { border: 1px solid var(--line); background: var(--surface); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--brand); flex: none; }
.play svg { width: 18px; height: 18px; } .play.on { background: var(--brand); color: #fff; }
.vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; }
.word { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.word .w { flex: 1; min-width: 0; } .word .w b { font-family: var(--font-de); direction: ltr; display: block; text-align: left; }
.word .w small { color: var(--muted); display: block; }
.art-m { color: #1d4ed8; } .art-f { color: #be123c; } .art-n { color: #15803d; }
:root[data-theme="dark"] .art-m, .dark .art-m { color: #8fb0ff; }
.dialog { display: grid; gap: 8px; }
.bubble { max-width: 88%; padding: 10px 13px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.bubble.me { margin-inline-start: auto; background: var(--brand-soft); border-color: transparent; }
.bubble .who { font-size: 12px; font-weight: 800; color: var(--muted); }
.bubble .de { display: block; font-size: 16px; } .bubble .ar { display: block; font-size: 14px; color: var(--ink-2); }
.scene-card { overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.scene-card .art { aspect-ratio: 16 / 9; background: var(--surface-2); }
.scene-card .art svg, .scene-card .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-card .body { padding: 14px 16px; }

/* ---------- Exercises */
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.q-stem { font-size: clamp(19px, 4.8vw, 23px); font-weight: 700; margin: 6px 0 14px; line-height: 1.55; }
.q-stem .gap { display: inline-block; min-width: 64px; border-bottom: 3px solid var(--brand); margin: 0 4px; }
.q-prompt { color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }
.options { display: grid; gap: 9px; }
.options.two { grid-template-columns: 1fr 1fr; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16.5px; font-weight: 600; min-height: 54px; transition: border-color .12s, background .12s; }
.opt .k { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; font-family: var(--font-de); color: var(--muted); flex: none; }
.opt:hover:not([disabled]) { border-color: var(--brand); }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); } .opt.right .k { background: var(--ok); color: #fff; border-color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); } .opt.wrong .k { background: var(--bad); color: #fff; border-color: var(--bad); }
.opt[disabled] { cursor: default; }
.opt .t { flex: 1; min-width: 0; }
.feedback { margin-top: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid; animation: pop .2s ease-out; }
.feedback.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.feedback.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.feedback.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.feedback h4 { margin: 0 0 6px; } .feedback ul { margin: 6px 0 0; padding-inline-start: 18px; } .feedback li { margin: 3px 0; }
@keyframes pop { from { transform: translateY(4px); opacity: 0; } to { transform: none; opacity: 1; } }
.tokens { display: flex; flex-wrap: wrap; gap: 8px; direction: ltr; justify-content: flex-start; }
.token { border: 1.5px solid var(--line); background: var(--surface); border-radius: 11px; padding: 8px 12px; font-family: var(--font-de); font-weight: 600; font-size: 16px; }
.token.used { opacity: .3; pointer-events: none; }
.answer-line { min-height: 58px; border: 2px dashed var(--line); border-radius: 14px; padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; direction: ltr; align-items: center; margin-bottom: 12px; }
.answer-line .token { background: var(--brand-soft); border-color: transparent; }
.typed { font-family: var(--font-de); direction: ltr; text-align: left; font-size: 18px; }
.keys { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; direction: ltr; }
.keys button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; min-width: 38px; height: 36px; font-family: var(--font-de); font-weight: 700; }
.text-box { white-space: pre-line; font-family: var(--font-de); direction: ltr; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 16px; line-height: 1.75; }
.audio-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.audio-box .big { width: 54px; height: 54px; border-radius: 50%; background: var(--brand); color: #fff; border: 0; display: grid; place-items: center; }
.audio-box .big svg { width: 24px; height: 24px; }
.speeds { display: flex; gap: 4px; }
.speeds button { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 4px 9px; font-size: 13px; font-weight: 700; font-family: var(--font-de); }
.speeds button.on { background: var(--ink); color: var(--bg); }
.timer { font-family: var(--font-de); font-weight: 800; font-size: 15px; padding: 5px 11px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.timer.low { color: var(--bad); border-color: var(--bad); }
.mic { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px color-mix(in srgb, var(--bad) 35%, transparent); }
.mic svg { width: 30px; height: 30px; }
.mic.rec { animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 55%, transparent); } 70% { box-shadow: 0 0 0 18px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.diff { font-family: var(--font-de); direction: ltr; text-align: left; line-height: 2; }
.diff .ok { color: var(--ok); font-weight: 700; } .diff .miss { color: var(--bad); text-decoration: line-through; } .diff .add { color: var(--warn); font-weight: 700; }

/* ---------- Flashcards */
.flash { perspective: 1000px; }
.flash-in { position: relative; min-height: 230px; transition: transform .45s; transform-style: preserve-3d; }
.flash.flipped .flash-in { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; text-align: center; padding: 20px; }
.face.back { transform: rotateY(180deg); background: var(--surface-2); }
.face .big { font-size: 30px; font-weight: 800; font-family: var(--font-de); }

/* ---------- Adventures */
.adv-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.adv { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); text-align: start; padding: 0; width: 100%; }
.adv .art { aspect-ratio: 16 / 9; } .adv .art svg { width: 100%; height: 100%; display: block; }
.adv .body { padding: 13px 15px 15px; } .adv .body b { font-size: 17px; display: block; }
.story { display: grid; gap: 12px; }
.narr { font-size: 16.5px; color: var(--ink-2); }
.npc { display: flex; gap: 10px; align-items: flex-start; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-family: var(--font-de); }
.hearts { letter-spacing: 2px; }

/* ---------- Charts */
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px; align-items: center; font-size: 14px; margin: 7px 0; }
.hbar .bar { height: 10px; }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.cols > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.cols i { display: block; width: 100%; max-width: 28px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.cols small { font-size: 11px; color: var(--muted); }

/* ---------- Misc */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .e { font-size: 40px; }
.toast { position: fixed; inset-inline: 16px; bottom: calc(84px + var(--safe-b)); z-index: 60; max-width: 520px; margin: auto; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; animation: pop .2s; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge { text-align: center; padding: 14px 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.badge .e { font-size: 30px; } .badge.locked { filter: grayscale(1); opacity: .45; }
.list { display: grid; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); width: 100%; text-align: start; }
.li .grow { flex: 1; min-width: 0; }
.notice { padding: 12px 14px; border-radius: 13px; background: var(--info-soft); color: var(--ink); font-size: 14.5px; border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
details { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--surface); }
details + details { margin-top: 8px; }
summary { cursor: pointer; font-weight: 700; }
.kbd { font-family: var(--font-de); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.sticky-actions { position: sticky; bottom: calc(76px + var(--safe-b)); z-index: 5; padding-top: 10px; background: linear-gradient(transparent, var(--bg) 35%); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .tabbar, .topbar { display: none; } main { padding: 0; } }

/* ---------- trial locks / paywall */
.paywall { text-align: center; padding: 28px 20px; background: linear-gradient(160deg, var(--surface), var(--brand-soft)); }
.paywall .pw-icon { font-size: 40px; margin-bottom: 6px; }
.paywall h2 { margin: 4px 0 8px; }
.lock { font-size: 14px; opacity: .85; margin-inline-start: 6px; }
.is-locked { opacity: .72; }
.is-locked .node { filter: grayscale(.6); }

/* ---------- premium sales page */
.lux-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 30px 22px 26px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #1d3b55 0%, #0d1b2a 55%, #08121c 100%); box-shadow: 0 18px 40px rgba(8, 18, 28, .35); border: 1px solid rgba(216, 176, 106, .35); }
.lux-hero h1 { color: #fff; font-size: clamp(24px, 6vw, 36px); line-height: 1.35; margin: 12px 0 8px; max-width: 560px; }
.lux-hero p { color: rgba(255, 255, 255, .82); max-width: 520px; }
.lux-hero::before { content: ""; position: absolute; width: 340px; height: 340px; inset-inline-start: -120px; bottom: -170px; border-radius: 50%; background: radial-gradient(circle, rgba(243, 217, 164, .28), rgba(243, 217, 164, 0) 70%); pointer-events: none; }
.lux-hero::after { content: ""; position: absolute; width: 220px; height: 220px; inset-inline-start: -60px; bottom: -110px; border-radius: 50%; border: 1px solid rgba(243, 217, 164, .35); pointer-events: none; }
.lux-hero > * { position: relative; z-index: 1; }
.lux-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .3px; color: #f3d9a4; border: 1px solid rgba(243, 217, 164, .45); background: rgba(243, 217, 164, .08); }
.lux-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 16px 0 18px; }
.lux-price b { font-size: clamp(38px, 10vw, 54px); font-weight: 800; color: #f3d9a4; font-family: var(--font-de); line-height: 1; }
.lux-price span { color: rgba(255, 255, 255, .8); }
.btn.lux-ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .28); }
.lux-f .ic { font-size: 26px; margin-bottom: 6px; }
.lux-f b { display: block; font-size: 16px; margin-bottom: 4px; }
.lux-table td:nth-child(3) { color: var(--brand-2); }
.lux-steps { margin: 6px 0 12px; padding-inline-start: 22px; display: grid; gap: 12px; }
.lux-steps li b { display: block; }
.lux-steps li span { color: var(--muted); font-size: 14px; }
.faq { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 8px 0 0; }

/* ---------- forms & account */
.form { display: grid; gap: 12px; }
input[type="email"], input[type="password"], input[type="number"], input[type="date"] { width: 100%; border: 1.5px solid var(--line); border-radius: 13px; background: var(--surface); padding: 11px 13px; min-height: 46px; }
input[type="email"]:focus, input[type="password"]:focus, input[type="number"]:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
.code-input { font-family: var(--font-de); font-size: 20px; letter-spacing: 2px; text-align: center; direction: ltr; text-transform: uppercase; }
.form-error { color: var(--bad); font-weight: 600; min-height: 1.2em; }
.license-card { border: 1.5px solid var(--gold); background: linear-gradient(160deg, var(--surface), var(--gold-soft)); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- admin */
.admin table { font-size: 13.5px; }
.admin td, .admin th { white-space: nowrap; }
.admin .codes-out { direction: ltr; font-family: var(--font-de); background: var(--surface-2); border-radius: 12px; padding: 12px; white-space: pre-wrap; user-select: all; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding-top: 6px; }
.bars span { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.meter { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--brand); }
.meter.warn > i { background: var(--warn); } .meter.bad > i { background: var(--bad); }
.trial-banner { text-decoration: none; color: inherit; border: 1.5px solid var(--gold); background: linear-gradient(160deg, var(--surface), var(--gold-soft)); }
.trial-banner .btn { pointer-events: none; }

#app:focus { outline: none; }
a.card { display: block; text-decoration: none; color: inherit; }
.mic.mic-sm { box-shadow: none; } .mic.mic-sm svg { width: 22px; height: 22px; }
