/* Deutsch Trainer — bordeaux texture (default) and light paper; yellow accent */
:root, :root[data-theme="bordeaux"] {
  --bg: #320611; --card: rgba(16, 1, 6, .46); --card-solid: #2a0510; --card2: rgba(255, 255, 255, .08); --text: #fff; --muted: rgba(255, 255, 255, .68);
  --line: rgba(255, 255, 255, .16); --accent: #ffbb00; --accent-ink: #1b0309; --accent-soft: rgba(255, 187, 0, .14); --ink: #ffbb00; --ink-text: #1b0309;
  --der: #82b4ff; --die: #ff8a9d; --das: #5fdc9c;
  --good: #5fdc9c; --good-bg: rgba(40, 160, 100, .22); --bad: #ff8a9d; --bad-bg: rgba(255, 90, 120, .18); --ok: #ffc44d; --ok-bg: rgba(255, 190, 60, .16);
  --c-nom: #ffcf4a; --c-akk: #4fd6c8; --c-dat: #c49bff; --c-gen: #b9b0a8; --c-verb: #ff8a5c; --c-oth: rgba(255, 255, 255, .55);
  --art-ink: #fff; --art-card: #3b0a17; --muted-c: rgba(255, 255, 255, .7);
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 6px 20px rgba(0, 0, 0, .18);
  --blur: blur(8px); --r: 16px; --tab-h: 66px; --sheet: #2a0510;
}
:root[data-theme="light"] {
  --bg: #f3ede4; --card: rgba(255, 255, 255, .86); --card-solid: #fff; --card2: rgba(74, 13, 28, .06); --text: #22060d; --muted: #6e5a5f;
  --line: rgba(74, 13, 28, .14); --accent: #ffbb00; --accent-ink: #1b0309; --accent-soft: #fff1c4; --ink: #4a0d1c; --ink-text: #fff;
  --der: #1f63e0; --die: #d92b4b; --das: #14915a;
  --good: #14915a; --good-bg: #dff5e8; --bad: #d92b4b; --bad-bg: #fde4e8; --ok: #a86c00; --ok-bg: #fff1cc;
  --c-nom: #e8a800; --c-akk: #0e9e90; --c-dat: #8a55e0; --c-gen: #8a807a; --c-verb: #e8622a; --c-oth: rgba(74, 13, 28, .4);
  --art-ink: #4a0d1c; --art-card: #fff; --muted-c: #6e5a5f;
  --shadow: 0 1px 2px rgba(60, 10, 20, .06), 0 4px 14px rgba(60, 10, 20, .06); --sheet: #f3ede4;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
/* the textures: woven threads over soft clouds */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 35%, rgba(0,0,0,0) 45%, rgba(16,0,5,.42) 100%), url("../img/weave.webp") 0 0 / 400px 400px, url("../img/clouds.jpg") center / cover; }
:root[data-theme="light"] body::before { background: url("../img/weave.webp") 0 0 / 400px 400px; mix-blend-mode: multiply; opacity: .9; }
.stage, .reels { background: var(--bg) url("../img/clouds.jpg") center / cover; }
:root[data-theme="light"] .stage, :root[data-theme="light"] .reels { background: var(--bg); }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
.hidden { display: none !important; }
.ic { width: 22px; height: 22px; display: inline-block; vertical-align: middle; }
[lang="de"] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.wd { border-radius: 4px; transition: background .2s; }
.wd.wd-on { background: var(--accent); color: var(--accent-ink); }

#app { max-width: 720px; margin: 0 auto; min-height: 100%; position: relative; }
#view { padding: 12px 16px calc(var(--tab-h) + 30px); }
body.staged #view { padding-bottom: 0; }
body.staged #tabs { display: none; }

/* ---------- tab bar ---------- */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  background: rgba(33, 4, 12, .82); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 1px solid var(--line);
  display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
:root[data-theme="light"] #tabs { background: rgba(255, 255, 255, .9); }
#tabs .tabs-in { display: flex; width: 100%; max-width: 560px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 650; color: var(--muted); position: relative; }
.tab .ico .ic { width: 24px; height: 24px; }
.tab.on { color: var(--accent); }
:root[data-theme="light"] .tab.on { color: var(--ink); }
.tab.on::before { content: ""; position: absolute; top: 0; width: 30px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tab-biscuit .ico { width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; background: linear-gradient(160deg, #ffd36b, #e59a2e);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(0,0,0,.35), 0 0 0 4px rgba(50, 6, 17, .9); transition: transform .2s; }
:root[data-theme="light"] .tab-biscuit .ico { box-shadow: 0 6px 16px rgba(60,10,20,.25), 0 0 0 4px #fff; }
.tab-biscuit .cookie { width: 40px; height: 40px; }
.tab-biscuit.on .ico { transform: rotate(-14deg) scale(1.06); }
.tab-biscuit.on::before { display: none; }
.tab-biscuit .lbl { color: var(--accent); font-weight: 800; }
:root[data-theme="light"] .tab-biscuit .lbl { color: #9c6428; }
.tab-n { position: absolute; top: -16px; left: calc(50% + 14px); background: var(--text); color: var(--bg); font-size: 10px; font-weight: 850; border-radius: 9px; padding: 1px 6px; min-width: 18px; text-align: center; }
:root[data-theme="light"] .tab-n { background: var(--ink); color: #fff; }

/* ---------- common ---------- */
.page-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; min-height: 40px; }
.page-head h1 { font-size: 24px; font-weight: 850; letter-spacing: -.02em; flex: 1; min-width: 0; }
.page-head .sub, .sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.icon-btn:active { transform: scale(.94); }
.card { background: var(--card); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card.tap { display: block; width: 100%; }
.card.tap:active { transform: scale(.985); }
.card h3 { font-size: 16px; font-weight: 750; }
.card.list { padding: 4px 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
.sec { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 2px 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .card { margin: 0; }
.center { text-align: center; }
.chev { color: var(--muted); font-size: 22px; line-height: 1; }
.emoji-big { font-size: 30px; line-height: 1; flex: none; width: 44px; text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px;
  border-radius: 14px; font-weight: 750; background: var(--card2); color: var(--text); text-align: center; border: 1px solid var(--line); }
.btn .cookie { width: 26px; height: 26px; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 3px 0 #9a6f00; }
.btn.primary:active { box-shadow: 0 1px 0 #9a6f00; transform: translateY(2px); }
.btn.dark { background: var(--ink); color: var(--ink-text); }
.btn.ghost { background: transparent; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 56px; font-size: 18px; border-radius: 18px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.small-btn { min-height: 40px; font-size: 14px; padding: 6px 12px; margin-top: 12px; width: 100%; }
.btn.small-btn .cookie { width: 22px; height: 22px; }
.btn.small-btn.on { opacity: .7; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 7px 13px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 650; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; vertical-align: middle; letter-spacing: .02em; }
.badge.sie { background: var(--text); color: var(--bg); }
.badge.du { background: var(--accent); color: var(--accent-ink); }
.der { color: var(--der); } .die { color: var(--die); } .das { color: var(--das); }
.bg-der { background: var(--der); color: #fff; } .bg-die { background: var(--die); color: #fff; } .bg-das { background: var(--das); color: #fff; }

.bar { height: 8px; border-radius: 99px; background: var(--card2); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .35s ease; }
.stars { letter-spacing: 1px; font-size: 15px; white-space: nowrap; color: var(--accent); }
.stars .off { opacity: .25; color: var(--muted); }

/* list rows */
.lrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; }
.lrow:last-child { border-bottom: 0; }
.list > .lrow:only-child { border-bottom: 0; }
.lrow:active { opacity: .7; }
.lrow-i { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 19px; }
.lrow .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lrow .t { font-weight: 700; }
.lrow .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body > .lrow, #view > .lrow { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }

/* ---------- home ---------- */
.home-top { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.home-top > div:first-child { flex: 1; }
.home-top h1 { font-size: 28px; font-weight: 900; letter-spacing: -.02em; }
.today { display: block; width: 100%; text-align: left; border-radius: 22px; padding: 20px 20px 18px; margin-bottom: 14px;
  background: linear-gradient(135deg, #ffcb2e, #ffa600); color: var(--accent-ink); box-shadow: 0 5px 0 #9a6f00, 0 14px 30px rgba(0,0,0,.25); position: relative; overflow: hidden; }
.today::after { content: ""; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; border: 18px solid rgba(255,255,255,.18); }
.today:active { transform: translateY(3px); box-shadow: 0 2px 0 #9a6f00; }
.today-k { font-size: 11px; font-weight: 900; letter-spacing: .12em; opacity: .7; }
.today-t { font-size: 30px; font-weight: 900; letter-spacing: -.02em; margin: 2px 0; }
.today-s { font-size: 14px; font-weight: 600; opacity: .8; }

/* ---------- biscuit bar ---------- */
.bbar { position: sticky; top: 8px; z-index: 15; display: flex; align-items: stretch; margin: 0 0 14px; border-radius: 18px;
  background: rgba(20, 2, 7, .72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 8px 24px rgba(0,0,0,.28); color: #fff; }
:root[data-theme="light"] .bbar { background: rgba(255,255,255,.92); color: var(--text); border-color: var(--line); }
.bbar-in { flex: 1; display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 10px; min-width: 0; text-align: left; perspective: 600px; }
.bbar-ico .cookie { width: 34px; height: 34px; display: block; }
.bbar-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bbar-h { font-size: 10px; font-weight: 850; letter-spacing: .1em; opacity: .55; }
.bbar-empty { font-size: 13px; opacity: .85; }
.bbar-next { width: 44px; font-size: 24px; opacity: .7; border-left: 1px solid rgba(255,255,255,.12); }
.bbar .bc-flip { height: 24px; }
.bbar .bc-word, .bbar .bc-mean { font-size: 16px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bbar .bc-sub { display: none; }
/* flip card (bar + Biscuit tab) */
.bc-flip { position: relative; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3,1.4,.5,1); }
.bc-flip.flipped { transform: rotateX(180deg); }
.bc-face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; }
.bc-back { transform: rotateX(180deg); color: var(--accent); }
:root[data-theme="light"] .bc-back { color: #9c6428; }

/* ---------- Biscuit tab ---------- */
.b-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.b-head h1 { font-size: 28px; font-weight: 900; }
.cookie-xl { width: 54px; height: 54px; display: block; }
.biscuit-big { margin-bottom: 8px; }
.b-card { display: block; width: 100%; perspective: 900px; }
.b-card .bc-flip { height: 190px; border-radius: 24px; }
.b-card .bc-face { border-radius: 24px; padding: 20px; text-align: center; align-items: center; background: linear-gradient(160deg, #ffd36b, #e5962a); color: var(--accent-ink);
  box-shadow: 0 6px 0 #9c6428, 0 18px 40px rgba(0,0,0,.3); }
.b-card .bc-back { background: var(--card-solid); color: var(--text); border: 2px solid var(--accent); }
.b-card .bc-word { font-size: 34px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.b-card .bc-word .der, .b-card .bc-word .die, .b-card .bc-word .das { color: inherit; opacity: .7; }
.b-card .bc-mean { font-size: 24px; font-weight: 800; }
.b-card .bc-sub { font-size: 15px; margin-top: 8px; opacity: .8; }
.b-actions { display: flex; gap: 8px; margin-top: 14px; }
.b-actions .btn { flex: 1; padding: 8px; font-size: 14px; }
.b-actions .ic { width: 18px; height: 18px; }
.b-empty { text-align: center; padding: 26px 12px; background: var(--card); border: 1px dashed var(--line); border-radius: 22px; }
.b-empty .cookie { width: 60px; height: 60px; filter: grayscale(.4); opacity: .8; }
.b-empty p { margin-top: 6px; }
.blist { padding: 2px 12px; }
.brow { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.brow:last-child { border-bottom: 0; }
.brow > .grow { flex: 1; text-align: left; padding: 10px 0; min-width: 0; }
.brow .t { font-weight: 750; }
.brow .s { font-size: 13px; color: var(--muted); }
.brow.done { opacity: .65; }
.mini { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; color: var(--muted); }
.mini:active { background: var(--card2); }
.cookie-btn { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--card2); border: 1.5px solid var(--line); flex: none; transition: transform .15s; }
.cookie-btn .cookie { width: 30px; height: 30px; filter: grayscale(.85); opacity: .75; transition: filter .2s, opacity .2s; }
.cookie-btn.on { background: var(--accent-soft); border-color: var(--accent); }
.cookie-btn.on .cookie { filter: none; opacity: 1; }
.cookie-btn.sm { width: 38px; height: 38px; }
.cookie-btn.sm .cookie { width: 24px; height: 24px; }
.cookie-btn.pop { animation: cpop .45s ease; }
@keyframes cpop { 30% { transform: scale(1.3) rotate(-18deg); } 60% { transform: scale(.92) rotate(6deg); } }
.card-bis { display: flex; justify-content: center; margin-top: 8px; }

/* ---------- learn hubs ---------- */
.hub { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px; margin-bottom: 12px; border-radius: 20px;
  background: var(--card); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hub:active { transform: scale(.985); }
.hub-art { width: 110px; flex: none; }
.hub-art svg { width: 100%; display: block; }
.hub-t { flex: 1; min-width: 0; }
.hub h2 { font-size: 20px; font-weight: 850; letter-spacing: -.01em; }
.hub p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.reels-cta { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; margin-bottom: 12px; border-radius: 20px;
  background: linear-gradient(135deg, #ffcb2e, #ffa600); color: var(--accent-ink); box-shadow: 0 4px 0 #9a6f00; --art-ink: #1b0309; --art-card: #fff6dc; --accent: #fff; }
.reels-cta .rc-art { width: 92px; flex: none; }
.reels-cta h2 { font-size: 20px; font-weight: 900; }
.reels-cta p { font-size: 13px; opacity: .8; }
.reels-cta .play { width: 44px; height: 44px; border-radius: 50%; background: #1b0309; color: #ffcb2e; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.topic { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: left; }
.topic .ti { font-size: 22px; }
.topic .tn { font-weight: 700; font-size: 14px; line-height: 1.25; }
.topic .tc { font-size: 12px; color: var(--muted); }
.wlist { padding: 2px 12px; }
.wl { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.wl:last-child { border-bottom: 0; }
.wl > .grow { flex: 1; text-align: left; padding: 9px 0; min-width: 0; }
.wl .t { font-weight: 750; }
.wl .s { font-size: 13px; color: var(--muted); }
.week .wk { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; height: 100px; margin-top: 8px; }
.wkd { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.wkd i { display: block; width: 100%; max-width: 30px; border-radius: 6px 6px 3px 3px; background: var(--card2); border: 1px solid var(--line); }
.wkd i.full { background: var(--accent); border-color: transparent; }
.wkd .wkv { font-size: 10px; color: var(--muted); }
.wkd .wkl { font-size: 11px; font-weight: 700; color: var(--muted); }
.wkd.today .wkl { color: var(--accent); }
.order-svg { width: 100%; display: block; }
.case-t tr.nom td:first-child { color: var(--c-nom); } .case-t tr.akk td:first-child { color: var(--c-akk); } .case-t tr.dat td:first-child { color: var(--c-dat); }
.case-t tr.nom td { border-bottom: 2px solid var(--c-nom); } .case-t tr.akk td { border-bottom: 2px solid var(--c-akk); } .case-t tr.dat td { border-bottom: 2px solid var(--c-dat); }

/* ---------- German line + context ---------- */
.de-line { padding: 12px 0; border-bottom: 1px solid var(--line); }
.de-line:last-child { border-bottom: 0; padding-bottom: 2px; }
.de-line:first-child { padding-top: 2px; }
.de-main { display: flex; align-items: flex-start; gap: 6px; }
.de-text { flex: 1; font-size: 18px; font-weight: 650; line-height: 1.35; text-align: left; }
.de-text.speaking { color: var(--accent); }
.de-tools { display: flex; gap: 2px; flex: none; }
.de-tools button { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; opacity: .8; }
.de-tools button:active { background: var(--card2); }
.de-more { color: var(--muted); transition: transform .2s; }
.de-more.has { color: var(--accent); opacity: 1 !important; }
.de-line.open .de-more { transform: rotate(180deg); }
.de-note { font-size: 14px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--card2); text-align: left; }
.tr-toggle { font-size: 13px; color: var(--muted); text-decoration: underline dotted; margin-top: 3px; }
.ctx-body { margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); font-size: 15px; animation: up .2s ease; text-align: left; }
.ctx-tr { color: var(--muted); margin-bottom: 8px; }
.ctx-key { padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); border-left: 3px solid var(--accent); margin-bottom: 10px; }
.ctx-k { font-weight: 850; font-size: 17px; color: var(--accent); margin-bottom: 2px; }
:root[data-theme="light"] .ctx-k { color: #9c6428; }
.ctx-spoken { padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); margin-bottom: 10px; font-size: 14px; }
.ctx-ex > div { padding: 4px 0; }
.ex-de { font-weight: 650; text-align: left; }
.ctx-h { font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; display: flex; align-items: center; gap: 6px; }
.ctx-h .ic { width: 16px; height: 16px; }
.ctx-drop { margin-top: 10px; }
.ctx-sum { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--muted); }
.ctx-sum .chev .ic { width: 18px; height: 18px; transition: transform .2s; }
.ctx-drop.open .ctx-sum .chev .ic { transform: rotate(180deg); }
.ctx-drop:not(.open) .ctx-body { display: none; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.wchip .m { font-weight: 500; color: var(--muted); font-size: 13px; }

/* sentence X-ray */
.xray { margin: 2px 0 4px; }
.xr { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.xc { display: inline-flex; flex-direction: column; align-items: center; min-width: 26px; }
.xc .xt { font-size: 17px; font-weight: 750; padding: 0 2px 3px; border-bottom: 3px solid var(--c-oth); white-space: nowrap; }
.xc .xl { font-size: 10.5px; font-weight: 800; margin-top: 3px; color: var(--c-oth); white-space: nowrap; text-transform: none; }
.xc .xh { font-size: 10.5px; font-style: italic; color: var(--muted); max-width: 140px; text-align: center; line-height: 1.2; margin-top: 1px; }
.xc.nom .xt { border-color: var(--c-nom); } .xc.nom .xl { color: var(--c-nom); }
.xc.akk .xt { border-color: var(--c-akk); } .xc.akk .xl { color: var(--c-akk); }
.xc.dat .xt { border-color: var(--c-dat); } .xc.dat .xl { color: var(--c-dat); }
.xc.gen .xt { border-color: var(--c-gen); } .xc.gen .xl { color: var(--c-gen); }
.xc.verb .xt { border-color: var(--c-verb); border-bottom-width: 4px; } .xc.verb .xl { color: var(--c-verb); }
.xc.prep .xt { border-bottom-style: dashed; }
.xc.x .xt { border-bottom-style: dotted; }
.xnote { font-size: 13px; color: var(--muted); margin-top: 10px; }
.xnote b { color: var(--text); }
.xleg { font-size: 11px; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.lg { font-weight: 800; display: inline-flex; align-items: center; gap: 4px; }
.lg::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: currentColor; }
.lg.nom { color: var(--c-nom); } .lg.akk { color: var(--c-akk); } .lg.dat { color: var(--c-dat); } .lg.verb { color: var(--c-verb); }
.xtap { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.xtap-c { padding: 10px 14px; border-radius: 12px; background: var(--card); border: 2px solid var(--line); font-size: 18px; font-weight: 700; }
.xtap-c.right { border-color: var(--good); background: var(--good-bg); }
.xtap-c.wrong { border-color: var(--bad); background: var(--bad-bg); }

.tip { border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; font-size: 15px; display: flex; gap: 10px; }
.tip .tip-ico { font-size: 20px; flex: none; }
.tip.culture { background: var(--accent-soft); }
.tip.turk { background: var(--card); border: 1.5px dashed var(--die); }
.tip b { font-weight: 750; }

/* ---------- situations ---------- */
.sit-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 10px; text-align: left; }
.sit-row:active { transform: scale(.985); }
.sit-row .t { font-weight: 750; font-size: 16px; }
.sit-row .s { font-size: 13px; color: var(--muted); }
.sit-row.next { outline: 2px solid var(--accent); }
.next-tag { font-size: 10px; font-weight: 850; background: var(--accent); color: var(--accent-ink); padding: 2px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 2px; letter-spacing: .05em; }
.sit-hero { text-align: center; padding: 0 0 14px; }
.sit-hero .e { font-size: 58px; line-height: 1.1; }
.sit-hero h1 { font-size: 26px; font-weight: 850; letter-spacing: -.02em; }
.part { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 10px; text-align: left; }
.part .n { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.part.done .n { background: var(--accent); }
.part .t { font-weight: 750; }
.part .s { font-size: 13px; color: var(--muted); }
.word-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.word-row:last-child { border-bottom: 0; }
.word-row .w { font-weight: 700; flex: 0 0 46%; text-align: left; }
.word-row .m { color: var(--muted); font-size: 14px; }

/* ---------- stage (full-screen activity) ---------- */
.stage { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; }
.stage-in { width: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.stage-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px 8px; flex: none; }
.stage-top .x, .reels .x { width: 36px; height: 36px; border-radius: 10px; font-size: 20px; color: var(--muted); flex: none; display: flex; align-items: center; justify-content: center; }
.stage-top .bar { flex: 1; }
.stage-top .meta { font-size: 14px; font-weight: 800; min-width: 34px; text-align: right; white-space: nowrap; }
.stage-body { flex: 1; overflow-y: auto; padding: 10px 16px 20px; -webkit-overflow-scrolling: touch; }
.stage-foot { flex: none; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid transparent; }
.stage-foot.good { background: var(--good-bg); border-color: var(--good); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.stage-foot.bad { background: var(--bad-bg); border-color: var(--bad); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.stage-foot.okay { background: var(--ok-bg); border-color: var(--ok); }
.fb-title { font-weight: 850; font-size: 17px; margin-bottom: 2px; }
.good .fb-title { color: var(--good); } .bad .fb-title { color: var(--bad); } .okay .fb-title { color: var(--ok); }
.fb-text { font-size: 15px; margin-bottom: 10px; }
.fb-text .ans { font-weight: 750; }

.q-kicker { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.q-kicker .ic { width: 18px; height: 18px; }
.q-text { font-size: 21px; font-weight: 750; line-height: 1.3; margin-bottom: 6px; }
.q-sub { color: var(--muted); margin-bottom: 14px; }
.q-de { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); margin-bottom: 16px; width: 100%; }
.q-de .t { font-size: 20px; font-weight: 700; line-height: 1.3; flex: 1; }
.speaker { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.speaker .ic { width: 22px; height: 22px; }
.speaker.big { width: 96px; height: 96px; font-size: 42px; box-shadow: 0 5px 0 #9a6f00; }
.speaker:active { transform: translateY(2px); }
.listen-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 0 20px; }
.listen-box .mini { display: flex; gap: 10px; width: auto; height: auto; }
.opts { display: grid; gap: 10px; }
.opts.cols2 { grid-template-columns: 1fr 1fr; }
.opts.cols3 { grid-template-columns: 1fr 1fr 1fr; }
.opt { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 13px 14px; font-size: 16px; font-weight: 600; text-align: left; min-height: 52px; width: 100%; }
.opts.cols2 .opt, .opts.cols3 .opt { text-align: center; }
.opt:active { transform: scale(.985); }
.opt.right { border-color: var(--good); background: var(--good-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.dim { opacity: .45; }
.opts.locked .opt { pointer-events: none; }

.tiles { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; }
.answer-line { border-bottom: 2px solid var(--line); padding: 6px 0 10px; margin-bottom: 18px; min-height: 62px; align-content: flex-start; }
.tile { background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; padding: 8px 12px; font-size: 17px; font-weight: 650; }
.tile.used { visibility: hidden; }
.type-in { width: 100%; padding: 13px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-size: 18px; outline: none; }
.type-in:focus { border-color: var(--accent); }
.umlauts { display: flex; gap: 6px; margin: 8px 0 4px; }
.umlauts button { width: 40px; height: 38px; border-radius: 10px; background: var(--card); border: 1.5px solid var(--line); font-weight: 700; text-align: center; }

/* flashcard */
.flash { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 24px 18px; text-align: center; min-height: 250px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.flash .cue { font-size: 22px; font-weight: 750; line-height: 1.3; }
.flash .hint { color: var(--muted); font-size: 14px; }
.flash .de { font-size: 26px; font-weight: 850; line-height: 1.25; }
.flash .ex { font-size: 16px; margin-top: 6px; font-weight: 600; }
.flash hr { border: 0; border-top: 1px dashed var(--line); width: 60%; margin: 8px auto; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rate .btn { flex-direction: column; gap: 0; padding: 8px 4px; min-height: 56px; font-size: 15px; }
.rate .btn small { font-weight: 600; font-size: 11px; opacity: .75; }
.rate .r0 { background: var(--bad-bg); color: var(--bad); } .rate .r1 { background: var(--ok-bg); color: var(--ok); }
.rate .r2 { background: var(--good-bg); color: var(--good); } .rate .r3 { background: var(--accent); color: var(--accent-ink); }

/* ---------- word reels ---------- */
.reels { position: fixed; top: 0; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 5; display: flex; flex-direction: column; }
.reel-top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; max-width: 720px; margin: 0 auto;
  background: linear-gradient(to bottom, rgba(30,3,10,.85), rgba(30,3,10,0)); }
:root[data-theme="light"] .reel-top { background: linear-gradient(to bottom, rgba(243,237,228,.95), rgba(243,237,228,0)); }
.reel-chips { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.reel-chips::-webkit-scrollbar { display: none; }
.reel-chips .chip { white-space: nowrap; padding: 6px 11px; font-size: 13px; }
.reel-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; color: var(--muted); gap: 8px; }
.rex-en { font-size: 18px; font-weight: 650; line-height: 1.35; }
.rback .ruse { font-size: 15px; margin-top: 12px; opacity: .85; }
.reel-t { flex: 1; font-weight: 800; font-size: 15px; }
.reel-n { font-size: 13px; color: var(--muted); font-weight: 700; }
.reel-scroll { flex: 1; overflow-y: scroll; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.reel-scroll::-webkit-scrollbar { display: none; }
.reel { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; padding: 54px 16px 14px; position: relative; }
.rwrap { position: relative; width: 100%; max-width: 440px; height: 100%; max-height: 640px; }
.rcard { width: 100%; height: 100%; perspective: 1400px; position: relative; z-index: 0; isolation: isolate; }
.rinner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3,1.25,.45,1); }
.rcard.flipped .rinner { transform: rotateY(180deg); }
.rcard.flipped .rinner, .rcard .rinner { will-change: transform; }
.rface { position: absolute; inset: 0; border-radius: 28px; overflow: hidden; display: flex; flex-direction: column; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: var(--card-solid); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.rface.rback { transform: rotateY(180deg); background: linear-gradient(170deg, #ffcb2e, #f5a300); color: var(--accent-ink); --muted: rgba(27,3,9,.6); }
.rhalf { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px 22px; text-align: center; min-height: 0; }
.rtop { border-bottom: 1px dashed var(--line); padding-bottom: 40px; }
.rbot { padding-top: 40px; }
.rback .rtop { border-color: rgba(27,3,9,.18); }
.rkind { font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.rword { font-size: 40px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; word-break: break-word; }
.rsub { font-size: 16px; color: var(--muted); margin-top: 10px; font-weight: 600; }
.rex { font-size: 20px; font-weight: 650; line-height: 1.35; }
.rmean { font-size: 30px; font-weight: 900; line-height: 1.2; }
.ruse { font-size: 17px; line-height: 1.45; font-weight: 550; }
.rmid { position: absolute; left: 0; right: 0; top: 50%; transform: translate3d(0, -50%, 1px); display: flex; align-items: center; justify-content: center; gap: 22px; z-index: 3; pointer-events: none; }
.rmid > * { pointer-events: auto; }
.flip-btn { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 6px var(--card-solid), 0 8px 20px rgba(0,0,0,.35); }
.flip-btn .ic { width: 34px; height: 34px; stroke-width: 2.3; }
.flip-btn.spin .ic { animation: spin .55s cubic-bezier(.3,1.25,.45,1); }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.r-say { width: 52px; height: 52px; border-radius: 50%; background: var(--card-solid); border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; }
.rmid .cookie-btn { width: 56px; height: 56px; background: var(--card-solid); }
.rmid .cookie-btn .cookie { width: 36px; height: 36px; }
.reel-hint { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); animation: bob 1.4s ease-in-out infinite; display: flex; flex-direction: column; align-items: center; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* pairs */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mcol { display: flex; flex-direction: column; gap: 10px; }
.mcard { min-height: 58px; padding: 10px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); font-weight: 700; font-size: 15px; text-align: center; transition: opacity .25s, transform .25s; }
.mcard.sel { border-color: var(--accent); background: var(--accent-soft); }
.mcard.gone { opacity: 0; transform: scale(.9); pointer-events: none; }

/* role-play chat */
.chat { display: flex; flex-direction: column; gap: 10px; }
.bub { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 17px; line-height: 1.35; box-shadow: var(--shadow); text-align: left; }
.bub.npc { align-self: flex-start; background: var(--card-solid); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bub.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; font-weight: 600; }
.bub .trl { display: block; font-size: 13px; opacity: .7; margin-top: 3px; font-weight: 500; }
.bub.blur .txt { filter: blur(6px); }
.chat-fb { align-self: flex-end; max-width: 92%; font-size: 14px; padding: 8px 12px; border-radius: 12px; }
.chat-fb.q2 { background: var(--good-bg); color: var(--good); font-weight: 700; }
.chat-fb.q1 { background: var(--ok-bg); } .chat-fb.q0 { background: var(--bad-bg); }
.chat-fb b { font-weight: 750; }
.chat-intro { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.who { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }

/* summary */
.summary { text-align: center; padding: 30px 10px; }
.summary .big { font-size: 74px; line-height: 1.1; }
.summary h2 { font-size: 26px; font-weight: 850; margin: 8px 0 4px; }
.summary .nums { display: flex; justify-content: center; gap: 12px; margin: 20px 0; }
.summary .nums .stat { max-width: 130px; }
.statline { display: flex; gap: 10px; margin-bottom: 12px; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 20px; font-weight: 850; }
.stat span { font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* grammar */
.g-table { width: 100%; border-collapse: collapse; margin: 10px 0 4px; font-size: 15px; }
.g-table td { border: 1px solid var(--line); padding: 6px 8px; }
.g-table tr:first-child td { font-weight: 800; background: var(--card2); }
.g-table td:first-child { font-weight: 700; }

/* gender game */
.gender-word { text-align: center; padding: 26px 0 10px; }
.gender-word .w { font-size: 40px; font-weight: 850; letter-spacing: -.02em; word-break: break-word; }
.gender-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.combo { text-align: center; font-weight: 850; min-height: 26px; color: var(--ok); }
.opts .opt.bg-der { background: var(--der); color: #fff; }
.opts .opt.bg-die { background: var(--die); color: #fff; }
.opts .opt.bg-das { background: var(--das); color: #fff; }
.opts .opt[class*="bg-"] { border: 0; min-height: 76px; font-size: 23px; font-weight: 850; text-align: center; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
:root[data-theme="bordeaux"] .opts .opt[class*="bg-"] { color: #1b0309; }
.opts .opt[class*="bg-"].right { outline: 4px solid var(--text); outline-offset: 2px; }
.opts .opt[class*="bg-"].wrong { opacity: .35; text-decoration: line-through; }
.q-text.gword { font-size: 38px; font-weight: 850; text-align: center; padding-top: 22px; letter-spacing: -.02em; word-break: break-word; }
.q-sub.gsub { text-align: center; font-size: 17px; margin-bottom: 22px; }

/* misc */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 26px); transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-weight: 700; z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90%; text-align: center; animation: pop .2s ease; }
@keyframes pop { from { transform: translateX(-50%) scale(.9); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--sheet); width: 100%; max-width: 720px; max-height: 88%; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); animation: up .22s ease; border-top: 1px solid var(--line); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.ws-top { display: flex; align-items: center; gap: 12px; }
.ws-word { font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.ws-mean { font-size: 19px; font-weight: 700; margin: 6px 0 10px; }
.ws-ex { margin: 6px 0 14px; }
.ws .ctx-key { margin-top: 4px; }
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; z-index: 70; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
.setting { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .grow { flex: 1; min-width: 0; }
.setting .grow b { display: block; font-weight: 700; }
.setting select { padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card-solid); max-width: 170px; }
.switch { width: 50px; height: 30px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.on { background: var(--accent); }
.switch.on::after { left: 23px; }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ach div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; font-size: 12px; font-weight: 650; }
.ach div i { display: block; font-size: 28px; font-style: normal; }
.ach div.off { opacity: .3; filter: grayscale(1); }
.banner { background: var(--ok-bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.timerbar { height: 6px; border-radius: 9px; background: var(--card2); overflow: hidden; margin: 0 16px; }
.timerbar > i { display: block; height: 100%; background: var(--die); width: 100%; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

@media (min-width: 760px) { #view { padding-top: 22px; } }
@media (max-width: 380px) {
  .q-text { font-size: 19px; } .de-text { font-size: 17px; } .rword { font-size: 34px; }
  .card { padding: 14px; } .hub-art { width: 84px; } .hub h2 { font-size: 18px; }
}
@media (max-height: 640px) { .rword { font-size: 32px; } .rhalf { padding: 16px; } .rtop { padding-bottom: 36px; } .rbot { padding-top: 36px; } }
@media (prefers-reduced-motion: reduce) { .rinner, .bc-flip { transition-duration: .01s; } .flip-btn.spin .ic { animation: none; } }

/* ---------- R2: five tabs, heroes, folders, kits, connected pages ---------- */
#tabs .tabs-in { max-width: 620px; }
.tab-hot .ico { width: 34px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #ff5f8a, #ffbb00); color: #1b0309; }
.tab-hot .ico .ic { width: 20px; height: 20px; }
.tab-hot.on .ico { box-shadow: 0 0 0 2px var(--accent), 0 4px 14px rgba(255, 120, 80, .45); }
.tab-hot .lbl { font-weight: 800; }

/* page entrance: everything slides up a little, one after another */
#view > * { animation: rise .38s cubic-bezier(.2,.8,.2,1) both; }
#view > *:nth-child(2) { animation-delay: .03s; } #view > *:nth-child(3) { animation-delay: .06s; } #view > *:nth-child(4) { animation-delay: .09s; }
#view > *:nth-child(5) { animation-delay: .12s; } #view > *:nth-child(6) { animation-delay: .15s; } #view > *:nth-child(n+7) { animation-delay: .18s; }
#view > .bbar, #view > .reels { animation: none; }
@keyframes rise { from { opacity: .55; transform: translateY(14px); } }
.stage, .modal-bg.sheet .modal { animation: stagein .28s cubic-bezier(.2,.8,.2,1) both; }
@keyframes stagein { from { opacity: .6; transform: translateY(24px); } }
@media (prefers-reduced-motion: reduce) { #view > *, .stage { animation: none !important; } }

.page-title { margin: 6px 2px 14px; }
.page-title h1 { font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.page-title p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 18px; margin-bottom: 14px; border-radius: 24px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255,187,0,.22), rgba(255,187,0,0) 55%), linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.16); box-shadow: 0 14px 34px rgba(0,0,0,.25); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
:root[data-theme="light"] .hero { background: radial-gradient(120% 140% at 0% 0%, rgba(255,187,0,.3), rgba(255,187,0,0) 55%), #fff; border-color: var(--line); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 160px; height: 160px; border-radius: 50%; border: 22px solid rgba(255,187,0,.08); pointer-events: none; }
.hero-art { width: 96px; flex: none; }
.hero-art svg { width: 100%; display: block; }
.hero-e { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 22px; font-size: 40px;
  background: linear-gradient(150deg, rgba(255,187,0,.35), rgba(255,187,0,.08)); border: 1px solid rgba(255,187,0,.4); }
.hero-t { flex: 1; min-width: 0; }
.hero h1 { font-size: 25px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.hero p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.hero.h-rescue { background: radial-gradient(120% 140% at 0% 0%, rgba(255,95,120,.28), rgba(255,95,120,0) 55%), linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.02)); }
.hero.h-rescue .hero-e { background: linear-gradient(150deg, rgba(255,95,120,.4), rgba(255,95,120,.1)); border-color: rgba(255,95,120,.5); }

.search { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 48px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); margin-bottom: 14px; }
.search-i { font-size: 20px; color: var(--muted); }
.search-in { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; }
.search-in::placeholder { color: var(--muted); }

.cont { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 14px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,187,0,.18), rgba(255,187,0,.04)); border: 1.5px solid rgba(255,187,0,.55); box-shadow: 0 10px 26px rgba(0,0,0,.2); }
.cont:active { transform: scale(.985); }
.cont-e { font-size: 34px; width: 54px; height: 54px; border-radius: 16px; background: var(--card-solid); display: flex; align-items: center; justify-content: center; flex: none; }
.cont .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cont-k { font-size: 10.5px; font-weight: 900; letter-spacing: .1em; color: var(--accent); }
:root[data-theme="light"] .cont-k { color: #9c6428; }
.cont-t { font-size: 18px; font-weight: 850; }
.cont-s { font-size: 13px; color: var(--muted); }

.sec-row { display: flex; align-items: baseline; justify-content: space-between; }
.sec-link { font-size: 13px; font-weight: 750; color: var(--accent); }
.fstrip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.fstrip::-webkit-scrollbar { display: none; }
.fchip { flex: none; width: 128px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); text-align: left; }
.fchip-e { font-size: 28px; }
.fchip-t { font-weight: 800; font-size: 14px; line-height: 1.2; min-height: 34px; }
.fchip-s { font-size: 12px; color: var(--muted); }
.folders { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.folder { display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: 20px; text-align: left; min-height: 132px;
  background: linear-gradient(160deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); border: 1px solid var(--line); box-shadow: var(--shadow); }
:root[data-theme="light"] .folder { background: #fff; }
.folder:active { transform: scale(.97); }
.folder-e { font-size: 30px; width: 50px; height: 50px; border-radius: 15px; display: flex; align-items: center; justify-content: center; background: rgba(255,187,0,.16); margin-bottom: 4px; }
.folder-t { font-weight: 850; font-size: 15px; line-height: 1.2; }
.folder-s { font-size: 12px; color: var(--muted); flex: 1; }
.folder-bar .bar { height: 5px; }

.path { position: relative; padding-left: 4px; margin-bottom: 6px; }
.path::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 3px; border-radius: 3px; background: var(--line); }
.step { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 6px 0; position: relative; }
.step-dot { width: 36px; height: 36px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px;
  background: var(--card-solid); border: 2px solid var(--line); z-index: 1; }
.step.done .step-dot { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step.now .step-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 5px rgba(255,187,0,.18); }
.step-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.step.now .step-card { border-color: rgba(255,187,0,.6); }
.step-e { font-size: 26px; }
.step-card .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.step-card .t { font-weight: 800; }
.step-card .s { font-size: 13px; color: var(--muted); }
.step:active .step-card { transform: scale(.985); }
.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--card2) 0); position: relative; font-weight: 850; font-size: 11px; }
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--card-solid); }
.ring span { position: relative; }

.crumb { font-size: 13px; font-weight: 750; color: var(--accent); margin: -4px 2px 10px; display: inline-block; }
:root[data-theme="light"] .crumb { color: #9c6428; }
.scene { padding: 14px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); margin-bottom: 12px; font-size: 15px; }
.scene-k { font-size: 10.5px; font-weight: 900; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.parts .part { margin-bottom: 8px; }
.part.done .n { background: var(--accent); color: var(--accent-ink); font-weight: 900; }
.irl { margin-top: 14px; padding: 12px 14px; border-radius: 16px; border: 1px dashed var(--line); font-size: 14px; }
.irl b { display: block; margin-bottom: 2px; }
.pager { display: flex; gap: 10px; margin-top: 16px; }
.pager > * { flex: 1; min-width: 0; }
.pg { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-align: left; }
.pg.next { text-align: right; align-items: flex-end; border-color: rgba(255,187,0,.5); }
.pg b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.kit-cta { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; margin: 4px 0 6px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,95,120,.24), rgba(255,95,120,.06)); border: 1px solid rgba(255,95,120,.45); }
.kit-cta-i { font-size: 28px; }
.kit-cta .grow { flex: 1; display: flex; flex-direction: column; }
.kit-cta b { font-size: 16px; }
.kit-cta .grow span { font-size: 13px; color: var(--muted); }
.kit-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 14px; background: rgba(255,95,120,.12); border: 1px solid rgba(255,95,120,.35); font-weight: 700; font-size: 14px; text-align: left; }
.kit-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; }
.kit-row:last-child { border-bottom: 0; }
.kit-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kit-row .t { font-weight: 800; }
.kit-row .s { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kit-e { font-size: 24px; width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: rgba(255,95,120,.14); flex: none; }
.kit-basic { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; margin-bottom: 4px; }
.numbers { display: flex; gap: 8px; margin-bottom: 12px; }
.num { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 16px; text-decoration: none;
  background: rgba(255,95,120,.16); border: 1px solid rgba(255,95,120,.45); }
.num b { font-size: 19px; font-weight: 900; letter-spacing: .02em; }
.num span { font-size: 11px; color: var(--muted); text-align: center; }
.warn { display: flex; gap: 6px; padding: 12px 14px; border-radius: 16px; background: rgba(255,190,60,.14); border: 1px solid rgba(255,190,60,.45); margin-bottom: 12px; font-size: 14px; }
.plan { margin: 0 0 6px; padding: 0; list-style: none; counter-reset: st; }
.plan li { counter-increment: st; position: relative; padding: 12px 14px 12px 50px; margin-bottom: 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 15px; }
.plan li::before { content: counter(st); position: absolute; left: 12px; top: 11px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 900; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.dialog { gap: 8px; }
.dialog .bub { max-width: 90%; }

/* context: three small tabs */
.ctx-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.ctx-tab { padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 750; color: var(--muted); }
.ctx-tab.on { background: var(--accent); color: var(--accent-ink); }
.ctx-tabs .cookie-btn { margin-left: auto; }
.ctx-pane { animation: rise .2s ease both; }
.ctx-tip { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255,187,0,.35); font-size: 14px; }
.ctx-ex > div { padding: 5px 0; border-top: 1px solid var(--line); }
.ctx-ex > div:first-child { border-top: 0; }
.cookie-btn.xs { width: 34px; height: 34px; }
.cookie-btn.xs .cookie { width: 22px; height: 22px; }
.topic .tb .bar { height: 4px; margin-top: 6px; }
.page-head.bare { margin: 0 0 8px; min-height: 0; }
.page-head.bare .icon-btn { width: 36px; height: 36px; }
