/* ════════════════════════════════════════════════════════════════
   Neurify — committed app styles
   Look: "Gemini Soft" · Google four colors · Roboto · Material symbols (SVG)
   Reader inspired by clinical-reference apps (outline, Cave/Merke/Tipp,
   high-yield, cross-links) — original design, Google palette.
   ════════════════════════════════════════════════════════════════ */

:root {
  --g-blue:#1a73e8; --g-blue-deep:#0b57d0; --g-blue-tint:#e8f0fe;
  --g-red:#ea4335;  --g-red-deep:#c5221f;  --g-red-tint:#fce8e6;
  --g-yellow:#f9ab00; --g-yellow-deep:#e37400; --g-yellow-tint:#fef7e0;
  --g-green:#1e8e3e; --g-green-deep:#137333; --g-green-tint:#e6f4ea;
  --g-purple:#9b72cb;

  --grey-900:#202124; --grey-800:#28292c; --grey-700:#3c4043;
  --grey-600:#5f6368; --grey-500:#80868b; --grey-400:#9aa0a6;
  --grey-300:#dadce0; --grey-200:#e8eaed; --grey-100:#f1f3f4; --grey-50:#f8f9fa;

  --bg:#f6f8fd; --surface:#ffffff;
  --accent:#1a73e8; --accent-deep:#0b57d0; --accent-tint:#e8f0fe;

  --font:'Roboto', system-ui, -apple-system, sans-serif;
  --font-flex:'Roboto Flex','Roboto', system-ui, sans-serif;
  --shadow-1:0 1px 3px rgba(60,64,67,0.10);
  --shadow-2:0 4px 16px rgba(60,64,67,0.14);
  --shadow-3:0 10px 30px rgba(60,64,67,0.18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: #0c1626;
  font-family: var(--font);
  color: var(--grey-900);
  display: grid; place-items: center;
  overflow: hidden;
}

/* ───────────── Scaling stage (fits any viewport) ───────────── */
#stage { position: fixed; inset: 0; display: grid; place-items: center; }
.device-scale { transform-origin: center center; }
.device {
  width: 393px; height: 852px; position: relative;
  background: var(--bg); border-radius: 46px;
  box-shadow: 0 40px 90px rgba(0,0,0,0.5), 0 0 0 11px #0a0a0c, 0 0 0 13px #2a2c30;
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* status bar */
.statusbar {
  height: 50px; flex: none; z-index: 20;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 26px 6px; font-size: 14px; font-weight: 600; letter-spacing: 0.2px;
  color: var(--grey-900); position: relative; pointer-events: none;
}
.statusbar .si { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.notch { position: absolute; left: 50%; top: 11px; transform: translateX(-50%); width: 92px; height: 26px; background: #0a0a0c; border-radius: 16px; }

.app { flex: 1; position: relative; overflow: hidden; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { display: none; }
.scroll { scrollbar-width: none; }
.pb-nav { padding-bottom: 104px; }

/* screen transition — transform-only so content is NEVER hidden if the
   animation is paused/frozen (offscreen iframe, reduced-motion, print). */
@keyframes screenIn { from { transform: translateY(10px); } to { transform: none; } }
@keyframes slideIn { from { transform: translateX(22px); } to { transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .anim-in { animation: screenIn 0.26s cubic-bezier(0.2,0.7,0.3,1); }
  .anim-slide { animation: slideIn 0.28s cubic-bezier(0.2,0.7,0.3,1); }
}

/* ───────────── Generic atoms ───────────── */
.ic { display: inline-block; vertical-align: middle; line-height: 1; }
.gradient-text {
  background: linear-gradient(90deg,#4285f4,#9b72cb,#d96570);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.spark {
  background: linear-gradient(135deg,#4285f4,#9b72cb,#d96570);
  color: #fff; display: grid; place-items: center; border-radius: 9px;
}

/* color helper classes */
.c-blue   { --c:var(--g-blue);   --c-deep:var(--g-blue-deep);   --c-tint:var(--g-blue-tint); }
.c-red    { --c:var(--g-red);    --c-deep:var(--g-red-deep);    --c-tint:var(--g-red-tint); }
.c-yellow { --c:var(--g-yellow); --c-deep:var(--g-yellow-deep); --c-tint:var(--g-yellow-tint); }
.c-green  { --c:var(--g-green);  --c-deep:var(--g-green-deep);  --c-tint:var(--g-green-tint); }

/* ═══════════ HOME (Gemini Soft) ═══════════ */
.hm-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 18px 4px; }
.hm-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; letter-spacing: -0.3px; font-family: var(--font-flex); }
.hm-brand .spark { width: 30px; height: 30px; font-size: 19px; }
.hm-av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#9b72cb,#4285f4); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 600; border: none; cursor: pointer; }
.hm-greet { padding: 12px 20px 4px; }
.hm-greet .d { font-size: 13px; color: var(--grey-500); font-weight: 500; }
.hm-greet h1 { margin: 3px 0 0; font-size: 26px; font-weight: 500; letter-spacing: -0.6px; font-family: var(--font-flex); }
.hm-greet h1 em { font-style: normal; }

.focus-card {
  margin: 16px 16px 0; border-radius: 28px; padding: 22px 22px 20px;
  background: linear-gradient(135deg,#e9f0ff 0%, #f3ecff 52%, #ffeef0 100%);
  position: relative; overflow: hidden; cursor: pointer; border: none; width: calc(100% - 32px); text-align: left;
  display: block;
}
.focus-card .fk { font-size: 12px; font-weight: 600; color: var(--grey-600); letter-spacing: 0.3px; display: flex; align-items: center; gap: 6px; }
.focus-card .fk .spark { width: 18px; height: 18px; border-radius: 6px; font-size: 12px; }
.focus-card h2 { margin: 11px 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -0.4px; font-family: var(--font-flex); line-height: 1.18; }
.focus-card p { margin: 0 0 16px; font-size: 14px; color: var(--grey-700); line-height: 1.45; max-width: 30ch; }
.focus-cta { display: inline-flex; align-items: center; gap: 8px; background: var(--grey-900); color: var(--bg); padding: 11px 18px; border-radius: 100px; font-size: 14px; font-weight: 600; }

.stat-row { display: flex; gap: 12px; padding: 14px 16px 4px; }
.stat { flex: 1; background: var(--surface); border-radius: 22px; padding: 15px 16px; box-shadow: var(--shadow-1); border: none; text-align: left; cursor: pointer; }
.stat .sk { font-size: 12px; color: var(--grey-600); font-weight: 500; display: flex; align-items: center; justify-content: space-between; }
.stat .sv { font-size: 30px; font-weight: 500; letter-spacing: -0.8px; margin-top: 4px; font-family: var(--font-flex); line-height: 1; }
.stat .sv small { font-size: 15px; color: var(--grey-500); font-weight: 500; }
.stat.blue .sv { color: var(--g-blue); }
.stat.green .sv { color: var(--g-green); }
.stat .strack { height: 5px; border-radius: 3px; background: var(--grey-100); margin-top: 10px; overflow: hidden; }
.stat .strack i { display: block; height: 100%; border-radius: 3px; }

/* continue / weiterlesen */
.cont-card {
  margin: 14px 16px 0; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-1);
  display: flex; align-items: center; gap: 14px; padding: 15px 16px; width: calc(100% - 32px); border: none; text-align: left; cursor: pointer;
}
.cont-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--c-tint,var(--accent-tint)); color: var(--c-deep,var(--accent-deep)); display: grid; place-items: center; flex: none; }
.cont-t { flex: 1; min-width: 0; }
.cont-k { font-size: 11px; font-weight: 700; color: var(--c-deep,var(--accent-deep)); letter-spacing: 0.3px; text-transform: uppercase; }
.cont-h { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; margin: 2px 0 6px; }
.cont-bar { height: 5px; border-radius: 3px; background: var(--grey-100); overflow: hidden; }
.cont-bar i { display: block; height: 100%; border-radius: 3px; background: var(--c,var(--accent)); }
.cont-m { font-size: 12px; color: var(--grey-600); margin-top: 6px; }

/* section heads */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; padding: 24px 20px 10px; }
.sec-head b { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
.sec-head a { font-size: 13px; color: var(--accent); font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }

/* Daily Pearl */
.pearl-head { display: flex; align-items: center; gap: 11px; padding: 22px 20px 12px; }
.pearl-head .pl-ic { color: var(--accent-deep); display: grid; place-items: center; flex: none; }
.pearl-head b { font-size: 22px; font-weight: 800; letter-spacing: -0.6px; color: var(--grey-900); }
.pearl-card {
  position: relative; margin: 0 16px; background: var(--surface);
  border-radius: 18px; padding: 20px 20px 16px 24px; box-shadow: var(--shadow-1); overflow: hidden;
}
.pearl-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.pearl-cat { font-size: 12px; font-weight: 800; letter-spacing: 0.9px; text-transform: uppercase; color: var(--accent-deep); }
.pearl-quote { font-family: 'Lora', Georgia, serif; font-style: italic; font-size: 19px; line-height: 1.5; color: var(--grey-800); margin: 12px 0 0; text-wrap: pretty; }
.pearl-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--grey-100); color: var(--grey-500); font-size: 13px; font-weight: 500; }
.pearl-foot .ic { color: var(--grey-400); flex: none; }
.pf-time { display: inline-flex; align-items: center; gap: 6px; }
.pearl-refresh { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--accent-tint); color: var(--accent-deep); display: grid; place-items: center; cursor: pointer; transition: transform 0.25s; z-index: 1; }
.pearl-refresh:active { transform: rotate(-180deg); }
.pearl-src { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent-deep); cursor: pointer; flex: none; }
.pearl-src svg { flex: none; }
.pearl-cat { padding-right: 38px; }
/* highlight pulse when reached from a pearl */
@keyframes rdHl { 0%,100% { box-shadow: 0 0 0 0 transparent; } 30%,70% { box-shadow: 0 0 0 3px var(--accent); } }
.rd-hl { animation: rdHl 1.4s ease-in-out 2; border-radius: 12px; outline: 2px solid var(--accent); outline-offset: 3px; transition: outline 0.3s; }

/* Neuro-Rechner promo card */
.calc-card {
  position: relative; overflow: hidden; display: block; width: calc(100% - 32px);
  margin: 16px 16px 0; padding: 22px; border: none; border-radius: 24px; cursor: pointer;
  text-align: left; font: inherit; color: #fff;
  background: #16233c;
}
.calc-card .cc-title { display: block; font-size: 21px; font-weight: 700; letter-spacing: -0.5px; position: relative; }
.calc-card .cc-sub { display: block; font-size: 13.5px; line-height: 1.45; color: rgba(255,255,255,0.62); margin-top: 7px; max-width: 78%; position: relative; }
.calc-card .cc-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; position: relative;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  padding: 11px 18px; border-radius: 100px;
}
.calc-card .cc-mark {
  position: absolute; right: 4px; bottom: -34px; font-size: 150px; font-weight: 800; font-style: italic;
  font-family: 'Lora', Georgia, serif; color: rgba(255,255,255,0.06); line-height: 1; pointer-events: none;
}
.calc-card:active { transform: scale(0.99); }

/* ═══════════ TOOLS (Diagnose-Rechner) ═══════════ */
.tools-head { padding: 20px 20px 4px; }
.tools-head .crumb { display: inline-flex; align-items: center; gap: 3px; background: none; border: none; padding: 0 0 12px; font: inherit; font-size: 14px; font-weight: 700; color: var(--accent-deep); cursor: pointer; }
.tools-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -1px; color: var(--grey-900); margin: 0; }
.tools-head .th-sub { font-size: 14.5px; line-height: 1.45; color: var(--grey-600); margin: 8px 0 0; max-width: 92%; }
.tool-search { display: flex; align-items: center; gap: 11px; margin: 16px 16px 0; padding: 13px 16px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-1); color: var(--grey-500); }
.tool-search input { flex: 1; border: none; background: none; outline: none; font: inherit; font-size: 15px; color: var(--grey-900); }
.tool-search input::placeholder { color: var(--grey-500); }

.fav-list, .all-list { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 0; }
.tool-card { background: var(--surface); border-radius: 18px; padding: 16px 17px; box-shadow: var(--shadow-1); }
.tc-top { display: flex; align-items: center; gap: 12px; }
.tc-ic { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-deep); }
.tc-name { font-size: 19px; font-weight: 700; letter-spacing: -0.4px; color: var(--grey-900); flex: 1; }
.tc-star { background: none; border: none; padding: 4px; cursor: pointer; color: var(--grey-300); flex: none; line-height: 0; }
.tc-star.on { color: var(--accent); }
.tc-desc { font-size: 14px; line-height: 1.45; color: var(--grey-600); margin: 11px 0 0; text-wrap: pretty; }
.tc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; }
.tc-flag { font-size: 11.5px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; }
.tc-flag.accent { color: var(--accent-deep); }
.tc-flag.red { color: var(--g-red-deep); }
.tc-calc { background: var(--accent); color: #fff; border: none; border-radius: 100px; padding: 11px 22px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; flex: none; }
.tc-calc:active { transform: scale(0.97); }

.tc-titlerow { display: flex; align-items: center; gap: 10px; }
.tc-ic.sm { width: 30px; height: 30px; border-radius: 9px; }
.tc-ic.sm svg { width: 18px; height: 18px; }
.tc-title2 { font-size: 18px; font-weight: 700; letter-spacing: -0.4px; color: var(--grey-900); }
.tc-pill { font-size: 11px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; padding: 4px 9px; border-radius: 7px; flex: none; }
.tc-pill.accent { color: var(--accent-deep); background: var(--accent-tint); }
.tc-pill.red { color: var(--g-red-deep); background: var(--g-red-tint); }
.tc-pill.grey { color: var(--grey-600); background: var(--grey-100); }
.tc-foot2 { display: flex; align-items: center; gap: 14px; margin-top: 15px; }
.tc-star2 { background: none; border: none; padding: 2px; cursor: pointer; color: var(--grey-300); flex: none; line-height: 0; }
.tc-calc.ghost { background: none; color: var(--accent-deep); border: 1.5px solid var(--accent); padding: 8px 18px; }

.tool-stat { margin: 18px 16px 0; padding: 22px; border-radius: 22px; background: #16233c; color: #fff; }
.tool-stat .ts-k { font-size: 11.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--g-green-deep); }
.tool-stat .ts-h { font-size: 25px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.12; margin-top: 9px; max-width: 80%; }
.tool-stat .ts-sub { font-size: 13.5px; line-height: 1.4; color: rgba(255,255,255,0.55); margin-top: 9px; }
.tool-guide { margin: 12px 16px 0; padding: 17px 20px; border-radius: 18px; background: var(--accent-tint); }
.tool-guide .tg-k { font-size: 11.5px; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase; color: var(--accent-deep); }
.tool-guide .tg-t { font-size: 14.5px; line-height: 1.4; color: var(--grey-800); margin-top: 5px; }
.ts-clear { background: none; border: none; padding: 2px; color: var(--grey-400); cursor: pointer; flex: none; line-height: 0; }
.sec-head.cat { display: flex; align-items: center; gap: 9px; }
.sec-head.cat .ch-ic { width: 27px; height: 27px; border-radius: 8px; background: var(--accent-tint); color: var(--accent-deep); display: grid; place-items: center; flex: none; }
.sec-head.cat b { flex: 1; min-width: 0; }
.sec-head.cat .ch-n { font-size: 12px; font-weight: 700; color: var(--grey-400); background: var(--grey-100); border-radius: 20px; padding: 2px 9px; flex: none; }
.tool-empty { text-align: center; color: var(--grey-500); font-size: 14px; padding: 30px 24px; }
.fav-empty { display: flex; align-items: center; gap: 11px; margin: 0 16px; padding: 16px 17px; border-radius: 16px; background: var(--grey-50); color: var(--grey-500); font-size: 13.5px; line-height: 1.4; }
.fav-empty svg { flex: none; color: var(--grey-400); }

/* floating category menu */
.fab-wrap { position: absolute; right: 16px; bottom: 18px; z-index: 55; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.fab { width: 56px; height: 56px; border-radius: 18px; border: none; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 26px -6px color-mix(in srgb, var(--accent) 60%, transparent); transition: transform 0.18s; flex: none; }
.fab:active { transform: scale(0.94); }
.fab-menu { display: flex; flex-direction: column; gap: 7px; max-height: 60vh; overflow-y: auto; align-items: flex-end; animation: fabIn 0.2s ease; }
@keyframes fabIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fab-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: none; border-radius: 12px; padding: 9px 13px; cursor: pointer; font: inherit; box-shadow: var(--shadow-2); max-width: 248px; }
.fab-item-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-tint); color: var(--accent-deep); display: grid; place-items: center; flex: none; }
.fab-item-l { font-size: 13px; font-weight: 600; color: var(--grey-800); text-align: left; line-height: 1.15; }
.fab-scrim { position: absolute; inset: 0; z-index: 54; background: rgba(20,26,40,0.18); animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════ CALCULATOR MODAL ═══════════ */
.calc-modal { position: absolute; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; }
@keyframes cmIn { from { transform: translateY(14px); } to { transform: none; } }
@media (prefers-reduced-motion: no-preference) { .calc-modal { animation: cmIn 0.26s cubic-bezier(0.2,0.8,0.3,1); } }
.cm-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; flex: none; }
.cm-close { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--surface); box-shadow: var(--shadow-1); color: var(--grey-700); display: grid; place-items: center; cursor: pointer; flex: none; }
.cm-ttl { flex: 1; min-width: 0; }
.cm-ttl b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -0.4px; color: var(--grey-900); }
.cm-ttl span { font-size: 12.5px; color: var(--grey-500); }
.cm-reset { background: none; border: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent-deep); cursor: pointer; flex: none; }
.cm-fav { background: none; border: none; padding: 4px; cursor: pointer; color: var(--grey-300); flex: none; line-height: 0; }
.cm-fav.on { color: var(--accent); }
.cm-score { display: flex; align-items: center; gap: 14px; margin: 0 16px 12px; padding: 16px 20px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-1); flex: none; }
.cm-num { font-size: 44px; font-weight: 800; letter-spacing: -2px; color: var(--grey-900); line-height: 1; font-family: 'Archivo', sans-serif; }
.cm-num small { font-size: 20px; font-weight: 700; color: var(--grey-400); letter-spacing: -0.5px; }
.cm-grade { font-size: 30px; letter-spacing: -1px; }
.cm-band { flex: 1; font-size: 14px; font-weight: 700; line-height: 1.25; padding: 8px 13px; border-radius: 12px; text-wrap: pretty; }
.cm-band.good { background: var(--g-green-tint); color: var(--g-green-deep); }
.cm-band.mild { background: var(--g-yellow-tint); color: var(--g-yellow-deep); }
.cm-band.mod  { background: #fdebd6; color: #b3590a; }
.cm-band.high { background: #fbe0d0; color: #c5430a; }
.cm-band.sev  { background: var(--g-red-tint); color: var(--g-red-deep); }
.cm-scroll { flex: 1; overflow-y: auto; padding: 0 16px; -webkit-overflow-scrolling: touch; }
.cm-flag { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border-radius: 13px; font-size: 13.5px; font-weight: 600; line-height: 1.35; margin-bottom: 10px; }
.cm-flag svg { flex: none; margin-top: 1px; }
.cm-flag.sev { background: var(--g-red-tint); color: var(--g-red-deep); }
.cm-flag.warn { background: #fdebd6; color: #b3590a; }
.cm-note { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--grey-500); margin-bottom: 12px; padding: 0 2px; }
.cm-note svg { flex: none; }
.cm-item { background: var(--surface); border-radius: 16px; padding: 13px 14px; box-shadow: var(--shadow-1); margin-bottom: 11px; }
.cm-item-h { font-size: 14.5px; font-weight: 700; color: var(--grey-800); margin-bottom: 10px; letter-spacing: -0.2px; }
.cm-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.cm-opts.vert { flex-direction: column; }
.cm-opt { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 10px; border: 1.5px solid var(--grey-200); background: var(--surface); cursor: pointer; font: inherit; text-align: left; color: var(--grey-700); transition: border-color 0.12s, background 0.12s; }
.cm-opts.vert .cm-opt { width: 100%; }
.cm-optv { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--grey-100); color: var(--grey-500); }
.cm-optl { font-size: 13.5px; font-weight: 500; line-height: 1.25; }
.cm-opt.on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-deep); }
.cm-opt.on .cm-optv { background: var(--accent); color: #fff; }
.cm-opt.on .cm-optl { font-weight: 700; }
.cm-doc { background: var(--grey-50); border-radius: 14px; padding: 14px 15px; margin-top: 4px; }
.cm-doc-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.cm-doc-h span { font-size: 11px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--grey-500); }
.cm-doc-h button { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent-deep); cursor: pointer; }
.cm-doc-t { font-size: 14px; line-height: 1.5; color: var(--grey-800); margin: 0; }
.cm-disc { font-size: 11px; line-height: 1.4; color: var(--grey-400); margin-top: 14px; padding: 0 2px; }
.cm-textband { flex: 1; font-size: 17px; font-weight: 700; line-height: 1.25; letter-spacing: -0.3px; padding: 12px 16px; border-radius: 14px; text-wrap: pretty; }
.cm-textband.good { background: var(--g-green-tint); color: var(--g-green-deep); }
.cm-textband.mild { background: var(--g-yellow-tint); color: var(--g-yellow-deep); }
.cm-textband.mod { background: #fdebd6; color: #b3590a; }
.cm-textband.high { background: #fbe0d0; color: #c5430a; }
.cm-textband.sev { background: var(--g-red-tint); color: var(--g-red-deep); }
.cm-textband.info { background: var(--grey-100); color: var(--grey-600); }
.cm-band.info { background: var(--grey-100); color: var(--grey-600); }
/* check rows */
.cm-check { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--surface); border: 1.5px solid var(--grey-200); border-radius: 14px; padding: 13px 15px; margin-bottom: 9px; cursor: pointer; font: inherit; text-align: left; transition: border-color 0.12s, background 0.12s; }
.cm-box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--grey-300); display: grid; place-items: center; flex: none; color: #fff; }
.cm-clabel { font-size: 14.5px; font-weight: 500; color: var(--grey-700); line-height: 1.3; }
.cm-check.on { border-color: var(--accent); background: var(--accent-tint); }
.cm-check.on .cm-box { background: var(--accent); border-color: var(--accent); }
.cm-check.on .cm-clabel { font-weight: 700; color: var(--accent-deep); }
/* numeric inputs */
.cm-numrow { display: flex; align-items: center; gap: 12px; }
.cm-numrow .cm-item-h { margin-bottom: 0; flex: 1; }
.cm-numfield { display: inline-flex; align-items: baseline; gap: 4px; flex: none; }
.cm-numfield input { width: 78px; text-align: right; font: inherit; font-size: 18px; font-weight: 700; font-family: 'Archivo', sans-serif; color: var(--grey-900); border: none; border-bottom: 2px solid var(--grey-200); background: none; padding: 4px 2px; outline: none; -moz-appearance: textfield; }
.cm-numfield input::-webkit-outer-spin-button, .cm-numfield input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cm-numfield input:focus { border-bottom-color: var(--accent); }
.cm-numfield i { font-style: normal; font-size: 13px; font-weight: 600; color: var(--grey-400); }

/* quick actions row */
.qa-row { display: flex; gap: 10px; padding: 0 16px; }
.qa { flex: 1; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1); border: none; cursor: pointer; padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.qa .qic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; }
.qa .ql { font-size: 13px; font-weight: 600; color: var(--grey-800); letter-spacing: -0.1px; }

/* topic pills */
.pills { display: flex; flex-wrap: wrap; gap: 9px; padding: 0 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--grey-200); border-radius: 100px;
  padding: 9px 16px 9px 12px; font-size: 14px; font-weight: 500; cursor: pointer; box-shadow: 0 1px 2px rgba(60,64,67,0.05);
}
.pill .pd { width: 10px; height: 10px; border-radius: 50%; background: var(--c,var(--accent)); }
.pill .pc { color: var(--grey-500); font-size: 12px; font-weight: 500; }

/* ═══════════ BOTTOM NAV (floating pill) ═══════════ */
.nav {
  position: absolute; left: 16px; right: 16px; bottom: 20px; height: 64px; z-index: 30;
  background: rgba(255,255,255,0);
  backdrop-filter: blur(40px) saturate(200%); -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.6); border-radius: 100px;
  display: flex; align-items: center; justify-content: space-around;
  box-shadow: var(--shadow-2), inset 0 1px 1px rgba(255,255,255,0.7), inset 0 -1px 2px rgba(255,255,255,0.15);
}
.nav-search {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg,#4285f4,#9b72cb); color: #fff;
  display: grid; place-items: center; border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(66,133,244,0.4);
}
.nav-search:active { transform: scale(0.94); }
.nav .nb { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--grey-500); font-size: 10px; font-weight: 600; background: none; border: none; cursor: pointer; padding: 6px 4px; }
.nav .nb .nbic { width: 46px; height: 30px; border-radius: 100px; display: grid; place-items: center; transition: background 0.18s; }
.nav .nb.on { color: var(--accent); }
.nav .nb.on .nbic { background: var(--accent-tint); }
.nav-fab {
  position: absolute; left: 50%; transform: translateX(-50%); top: -26px;
  width: 56px; height: 56px; border-radius: 20px;
  background: linear-gradient(135deg,#4285f4,#9b72cb); color: #fff;
  display: grid; place-items: center; border: 4px solid var(--bg); cursor: pointer;
  box-shadow: 0 8px 20px rgba(66,133,244,0.4);
}

/* ═══════════ ATLAS ═══════════ */
.page-head { padding: 10px 20px 6px; }

/* Bibliothek (library) layout */
.lib-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 4px; }
.lib-headtext { flex: 1; min-width: 0; }
.lib-head h1 { margin: 0; font-size: 38px; font-weight: 800; letter-spacing: -1.4px; color: var(--grey-900); font-family: var(--font-flex); }
.lib-sub { font-size: 16px; line-height: 1.4; color: var(--grey-500); margin: 10px 0 0; }
.lib-hero { width: 116px; height: 96px; flex: none; margin-top: 6px; border-radius: 18px; }

.lib-stat { display: flex; align-items: center; gap: 16px; margin: 18px 16px 6px; padding: 16px 18px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.lib-stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--g-blue); }
.lib-stat .ls-ic { width: 54px; height: 54px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--g-blue-tint); color: var(--g-blue-deep); }
.lib-stat .ls-figs { flex: none; }
.lib-stat .ls-k, .lib-stat .ls-k2 { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--grey-500); }
.lib-stat .ls-n { font-size: 30px; font-weight: 800; letter-spacing: -1px; color: var(--g-blue-deep); line-height: 1.05; font-family: var(--font-flex); }
.lib-stat .ls-div { width: 1px; align-self: stretch; background: var(--grey-200); margin: 2px 2px; flex: none; }
.lib-stat .ls-tag { font-size: 15px; line-height: 1.4; font-weight: 500; color: var(--grey-700); }

.lib-list { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 8px; }
.lib-card {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; font: inherit;
  background: var(--surface); border: none; border-radius: 14px; padding: 10px 12px 10px 16px; box-shadow: var(--shadow-1); overflow: hidden;
}
.lib-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--accent)); }
.lc-ic { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--c-tint, var(--accent-tint)); color: var(--c-deep, var(--accent-deep)); }
.lc-ic svg { width: 18px; height: 18px; }
.lc-mid { flex: 1; min-width: 0; }
.lc-title { font-size: 16px; font-weight: 700; letter-spacing: -0.4px; color: var(--grey-900); }
.lc-sub { font-size: 12px; color: var(--grey-500); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-bar { height: 4px; border-radius: 100px; background: var(--grey-100); margin-top: 7px; overflow: hidden; }
.lc-bar i { display: block; height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--c-deep, var(--accent-deep)) 0%, var(--c, var(--accent)) 100%); }
.lc-stat { text-align: right; line-height: 1.1; flex: none; white-space: nowrap; align-self: flex-start; margin-top: 1px; }
.lc-kap { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: var(--c-deep, var(--accent-deep)); white-space: nowrap; }
.lc-pct { display: block; font-size: 15px; font-weight: 800; letter-spacing: -0.3px; color: var(--c-deep, var(--accent-deep)); margin-top: 1px; white-space: nowrap; }
.lc-chev { color: var(--grey-300); flex: none; align-self: center; }
.page-head .pk { font-size: 13px; color: var(--grey-500); font-weight: 500; }
.page-head h1 { margin: 2px 0 0; font-size: 29px; font-weight: 500; letter-spacing: -0.7px; font-family: var(--font-flex); }
.page-head .psub { font-size: 13px; color: var(--grey-600); margin-top: 4px; }

.seg { display: flex; gap: 4px; margin: 12px 16px 6px; background: var(--grey-100); border-radius: 100px; padding: 4px; }
.seg button { flex: 1; border: none; background: none; cursor: pointer; font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--grey-600); padding: 8px 0; border-radius: 100px; }
.seg button.on { background: var(--surface); color: var(--grey-900); box-shadow: var(--shadow-1); }

/* atlas list (no letters — clean) */
.atlas-list { padding: 6px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.atlas-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: none; border-radius: 20px; padding: 16px 16px; box-shadow: var(--shadow-1);
  position: relative; overflow: hidden;
}
.atlas-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c,var(--accent)); }
.atlas-row .art { flex: 1; min-width: 0; padding-left: 4px; }
.atlas-row .ah { font-size: 17px; font-weight: 600; letter-spacing: -0.3px; }
.atlas-row .as { font-size: 13px; color: var(--grey-600); margin-top: 2px; }
.atlas-row .acount { font-size: 12px; color: var(--c-deep,var(--accent-deep)); font-weight: 600; background: var(--c-tint,var(--accent-tint)); padding: 4px 10px; border-radius: 100px; flex: none; }
.atlas-row .achev { color: var(--grey-400); flex: none; }

/* atlas cards variant */
.atlas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 6px 16px 8px; }
.atlas-card2 { background: var(--c-tint,var(--accent-tint)); border-radius: 22px; padding: 16px 15px; min-height: 124px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; border: none; text-align: left; }
.atlas-card2 .ah { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.2; color: var(--grey-900); }
.atlas-card2 .as { font-size: 12px; color: var(--c-deep,var(--accent-deep)); font-weight: 600; margin-top: 6px; }
.atlas-card2 .adot { width: 14px; height: 14px; border-radius: 50%; background: var(--c,var(--accent)); }

/* ═══════════ SECTION PAGE (chapters) ═══════════ */
.sec-hero { padding: 8px 20px 14px; position: relative; }
.sec-hero .crumb { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--accent); font-weight: 600; background: none; border: none; cursor: pointer; padding: 6px 0; }
.sec-hero h1 { margin: 8px 0 6px; font-size: 30px; font-weight: 600; letter-spacing: -0.7px; font-family: var(--font-flex); }
.sec-hero .shsub { font-size: 14px; color: var(--grey-600); line-height: 1.4; }
.sec-hero .shmeta { display: flex; gap: 8px; margin-top: 14px; }
.sec-hero .shtag { font-size: 12px; font-weight: 600; color: var(--c-deep,var(--accent-deep)); background: var(--c-tint,var(--accent-tint)); padding: 6px 12px; border-radius: 100px; }
.sec-hero .shtag.ghost { color: var(--grey-600); background: var(--grey-100); }

.chap-list { padding: 4px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.chap-row { display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left; cursor: pointer; background: var(--surface); border: none; border-radius: 18px; padding: 15px 16px; box-shadow: var(--shadow-1); }
.chap-num { width: 30px; height: 30px; border-radius: 9px; background: var(--c-tint,var(--accent-tint)); color: var(--c-deep,var(--accent-deep)); display: grid; place-items: center; font-size: 14px; font-weight: 700; flex: none; font-family: var(--font-flex); }
.chap-main { flex: 1; min-width: 0; }
.chap-h { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.25; }
.chap-sub { font-size: 12.5px; color: var(--grey-600); margin-top: 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chap-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--grey-500); font-weight: 600; letter-spacing: 0.2px; text-transform: uppercase; }
.chap-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--grey-400); }
.chap-row .achev { color: var(--grey-300); flex: none; align-self: center; }

/* ═══════════ READER (Editorial) ═══════════ */
.rd-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grey-100); z-index: 12; }
.rd-bar i { display: block; width: 100%; height: 100%; background: var(--accent); border-radius: 0 3px 3px 0; transform: scaleX(0); transform-origin: left center; will-change: transform; }
.rd-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; position: relative; z-index: 10; }
.rd-top .grp { display: flex; gap: 8px; }
.rd-pill { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); display: grid; place-items: center; color: var(--grey-700); border: none; cursor: pointer; }
.rd-pill.on { background: var(--accent-tint); color: var(--accent-deep); }

.reader { padding: 4px 0 40px; }
.rd-hero { padding: 8px 24px 0; }
.rd-hero .crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--c-deep,var(--accent-deep)); letter-spacing: 0.3px; text-transform: uppercase; white-space: nowrap; }
.rd-hero h1 { font-family: var(--font-flex); font-size: 30px; font-weight: 600; letter-spacing: -0.8px; line-height: 1.12; margin: 12px 0 12px; }
.rd-stand { font-size: 17px; line-height: 1.5; color: var(--grey-700); font-weight: 400; margin: 0 0 16px; }
.rd-byline { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--grey-500); font-weight: 500; padding-bottom: 16px; border-bottom: 1px solid var(--grey-200); }
.rd-byline .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--grey-400); }

/* jump outline chips */
.rd-jump { display: flex; gap: 8px; padding: 14px 24px 4px; overflow-x: auto; }
.rd-jump::-webkit-scrollbar { display: none; }
.rd-jump { scrollbar-width: none; }
.rd-jump button { flex: none; border: 1px solid var(--grey-200); background: var(--surface); border-radius: 100px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: var(--grey-700); cursor: pointer; }
.rd-jump button.on { background: var(--grey-900); color: #fff; border-color: var(--grey-900); }

.rd-body { padding: 8px 24px 0; }
.rd-h2 { font-family: var(--font-flex); font-size: 13px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--grey-900); margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.rd-h2::before { content: ''; width: 20px; height: 3px; border-radius: 2px; background: var(--c,var(--accent)); flex: none; }
.rd-body p { font-size: 16px; line-height: 1.6; color: var(--grey-800); margin: 0 0 14px; }
.rd-body p b, .rd-body li b { font-weight: 700; color: var(--grey-900); }
.hy { background: linear-gradient(180deg, transparent 58%, var(--g-yellow-tint) 58%); padding: 0 2px; font-weight: 600; }
.rd-ul { list-style: none; margin: 4px 0 16px; padding: 0; }
.rd-ul li { font-size: 15.5px; line-height: 1.5; color: var(--grey-800); padding: 0 0 0 20px; margin: 0 0 9px; position: relative; }
.rd-ul li::before { content: ''; position: absolute; left: 3px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--c,var(--accent)); }

/* callouts — left-border accent, inline icon + label */
.callout { border-radius: 12px; padding: 13px 16px 14px; margin: 16px 0 18px; border-left: 3px solid var(--co, var(--accent)); }
.callout .cl { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--co); margin-bottom: 7px; }
.callout .ci { flex: none; line-height: 0; color: var(--co); }
.callout .ct { font-size: 14.5px; line-height: 1.55; color: var(--grey-800); }
.callout .co-p { margin: 0; }
.callout.cave { --co: var(--g-red-deep); background: var(--g-red-tint); }
.callout.merke { --co: var(--g-blue-deep); background: var(--g-blue-tint); }
.callout.tipp { --co: var(--g-green-deep); background: var(--g-green-tint); }
.callout.redflag { --co: var(--g-red-deep); background: var(--g-red-tint); }
.callout.pitfall { --co: var(--g-red-deep); background: var(--g-red-tint); }
.callout.faustregel { --co: var(--g-green-deep); background: var(--g-green-tint); }
.callout.algorithm { --co: var(--g-blue-deep); background: var(--g-blue-tint); }
.callout.praxistipp { --co: var(--g-green-deep); background: var(--g-green-tint); }
.callout.hinweis { --co: var(--grey-500); background: var(--grey-50); }
.callout .co-list { list-style: none; margin: 6px 0 0; padding: 0; }
.callout .co-list li { position: relative; padding: 0 0 0 16px; margin: 0 0 6px; font-size: 14px; line-height: 1.45; }
.callout .co-list li:last-child { margin-bottom: 0; }
.callout .co-list li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--co); opacity: 0.55; }
/* numbered algorithm steps */
.callout .co-num { counter-reset: alg; }
.callout .co-num li { padding: 2px 0 2px 32px; margin: 0 0 11px; counter-increment: alg; min-height: 22px; }
.callout .co-num li:last-child { margin-bottom: 0; }
.callout .co-num li::before { content: counter(alg); top: 0; left: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--co); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; opacity: 1; }
.callout.redflag .co-list li::before, .callout.pitfall .co-list li::before { background: var(--co); opacity: 0.55; }

/* sub-heading (level 3) */
.rd-h3 { font-family: var(--font-flex); font-size: 17px; font-weight: 600; letter-spacing: -0.2px; color: var(--grey-900); margin: 22px 0 8px; padding-left: 12px; border-left: 3px solid var(--c, var(--accent)); }

/* numbered list */
.rd-ol { margin: 4px 0 16px; padding: 0 0 0 4px; list-style: none; counter-reset: rdol; }
.rd-ol li { counter-increment: rdol; font-size: 15.5px; line-height: 1.5; color: var(--grey-800); padding: 0 0 0 30px; margin: 0 0 10px; position: relative; }
.rd-ol li::before { content: counter(rdol); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--c-tint, var(--accent-tint)); color: var(--c-deep, var(--accent-deep)); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* sources / Quellen */
.rd-quellen { margin: 6px 0 16px; padding: 0 0 0 22px; list-style: decimal; }
.rd-quellen li { font-size: 12.5px; line-height: 1.45; color: var(--grey-500); margin: 0 0 7px; padding-left: 4px; }

/* citation markers */
.cite { font-size: 0.72em; font-weight: 700; color: var(--c-deep, var(--accent-deep)); vertical-align: super; line-height: 0; margin-left: 1px; }

/* table */
.rd-table-wrap { margin: 6px 0 18px; overflow-x: auto; border-radius: 12px; border: 1px solid var(--grey-200); }
.rd-table-wrap::-webkit-scrollbar { display: none; }
.rd-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 100%; }
.rd-table th { text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--grey-500); padding: 9px 12px; background: var(--grey-50); border-bottom: 1px solid var(--grey-200); }
.rd-table td { padding: 10px 12px; border-bottom: 1px solid var(--grey-100); color: var(--grey-800); vertical-align: top; }
.rd-table tr:last-child td { border-bottom: none; }
.rd-table td:first-child { font-weight: 600; color: var(--grey-900); }

/* "Themen in diesem Kapitel" outline */
.outline { margin: 8px 0 8px; }
.outline-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--grey-100); }
.outline-item:first-child { border-top: none; }
.outline-code { font-size: 12px; font-weight: 700; color: var(--c-deep,var(--accent-deep)); font-family: var(--font-flex); min-width: 30px; padding-top: 1px; }
.outline-t { font-size: 15px; color: var(--grey-800); line-height: 1.4; }

/* cross-links */
.xlink { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; background: var(--c-tint,var(--accent-tint)); border: none; border-radius: 14px; padding: 13px 15px; margin-bottom: 9px; }
.xlink .xt { flex: 1; min-width: 0; }
.xlink .xk { font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--c-deep,var(--accent-deep)); opacity: 0.8; }
.xlink .xh { font-size: 14.5px; font-weight: 600; color: var(--grey-900); margin-top: 2px; }
.xlink .xchev { color: var(--c-deep,var(--accent-deep)); flex: none; }

/* reader footer next/prev */
.rd-foot { display: flex; gap: 10px; padding: 20px 24px 8px; }
.rd-foot button { flex: 1; border: 1px solid var(--grey-200); background: var(--surface); border-radius: 16px; padding: 13px 14px; cursor: pointer; text-align: left; }
.rd-foot button.next { background: var(--accent); border-color: var(--accent); color: #fff; text-align: right; }
.rd-foot .fk { font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; opacity: 0.7; }
.rd-foot .fh { font-size: 13px; font-weight: 600; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* mastery self-rating */
.mastery { margin: 22px 0 6px; }
.mastery .mh { font-size: 13px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--grey-600); margin-bottom: 4px; }
.mastery .mhint { font-size: 13px; color: var(--grey-500); margin-bottom: 12px; }
.ms-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.ms-box { border: 1.5px solid var(--grey-200); background: var(--surface); border-radius: 14px; padding: 12px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.ms-box .msd { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--mc); }
.ms-box .msl { font-size: 12.5px; font-weight: 600; color: var(--grey-800); }
.ms-box.beherrscht { --mc: var(--g-green); } .ms-box.teilweise { --mc: var(--g-yellow-deep); } .ms-box.wiederholen { --mc: var(--g-red); }
.ms-box.on { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 9%, #fff); }
.ms-box.on .msd { background: var(--mc); }

/* ═══════════ SEARCH ═══════════ */
.search-top { padding: 8px 16px 10px; display: flex; align-items: center; gap: 10px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 10px; height: 48px; border-radius: 100px; background: var(--surface); box-shadow: var(--shadow-1); padding: 0 16px; }
.search-field input { flex: 1; border: none; outline: none; background: none; font-family: var(--font); font-size: 16px; color: var(--grey-900); }
.search-field input::placeholder { color: var(--grey-500); }
.search-cancel { border: none; background: none; color: var(--accent); font-size: 15px; font-weight: 600; cursor: pointer; font-family: var(--font); }
.search-lbl { padding: 14px 22px 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--grey-500); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px; }
.tagchip { border: 1px solid var(--grey-200); background: var(--surface); border-radius: 100px; padding: 8px 14px; font-size: 13px; font-weight: 500; color: var(--grey-700); cursor: pointer; }
.sr-list { padding: 4px 16px 8px; display: flex; flex-direction: column; gap: 8px; }
.sr-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; background: var(--surface); border: none; border-radius: 16px; padding: 13px 15px; box-shadow: var(--shadow-1); }
.sr-main { flex: 1; min-width: 0; }
.sr-meta { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--grey-500); margin-bottom: 4px; }
.sr-badge { padding: 2px 8px; border-radius: 100px; color: #fff; }
.sr-h { font-size: 15px; font-weight: 600; color: var(--grey-900); letter-spacing: -0.2px; }
.sr-s { font-size: 12.5px; color: var(--grey-600); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* ═══════════ FRAGEN (quiz) ═══════════ */
.quiz-wrap { padding: 4px 18px 0; }
.quiz-prog { display: flex; align-items: center; gap: 4px; padding: 10px 0 16px; }
.quiz-prog i { flex: 1; height: 4px; border-radius: 2px; background: var(--grey-200); }
.quiz-prog i.done { background: var(--g-green); }
.quiz-prog i.cur { background: var(--accent); }
.quiz-vignette { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-1); padding: 16px 18px; font-size: 15px; line-height: 1.55; color: var(--grey-800); margin-bottom: 14px; }
.quiz-vignette .qk { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 8px; }
.quiz-q { font-size: 17px; font-weight: 600; letter-spacing: -0.3px; line-height: 1.3; margin: 4px 0 14px; font-family: var(--font-flex); }
.quiz-opts { display: flex; flex-direction: column; gap: 9px; }
.quiz-opt { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1.5px solid var(--grey-200); border-radius: 14px; padding: 13px 15px; cursor: pointer; text-align: left; font-size: 15px; color: var(--grey-800); }
.quiz-opt .qletter { width: 26px; height: 26px; border-radius: 50%; background: var(--grey-100); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--grey-600); flex: none; }
.quiz-opt.sel { border-color: var(--accent); }
.quiz-opt.correct { border-color: var(--g-green); background: var(--g-green-tint); } .quiz-opt.correct .qletter { background: var(--g-green); color: #fff; }
.quiz-opt.wrong { border-color: var(--g-red); background: var(--g-red-tint); } .quiz-opt.wrong .qletter { background: var(--g-red); color: #fff; }
.quiz-expl { background: var(--g-blue-tint); border-radius: 14px; padding: 14px 16px; margin-top: 14px; font-size: 14px; line-height: 1.5; color: var(--grey-800); }
.quiz-expl b { color: var(--g-blue-deep); }
.quiz-cta { width: 100%; margin-top: 16px; background: var(--accent); color: #fff; border: none; border-radius: 100px; padding: 14px; font-size: 15px; font-weight: 600; font-family: var(--font); cursor: pointer; }
.quiz-cta.ghost { background: var(--grey-100); color: var(--grey-700); }

/* ─────── Flashcards (Karteikarten) — theme-aware via --grad / --accent ─────── */
.fc-wrap { padding: 6px 18px 0; }
.fc-cats { display: flex; gap: 8px; overflow-x: auto; padding: 4px 18px 14px; margin: 0 -18px; scrollbar-width: none; }
.fc-cats::-webkit-scrollbar { display: none; }
.fc-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--grey-200); background: var(--surface); border-radius: 100px; padding: 8px 13px; font-size: 13px; font-weight: 600; color: var(--grey-700); cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.fc-chip .fc-n { font-size: 11px; font-weight: 700; color: var(--grey-500); background: var(--grey-100); border-radius: 100px; padding: 1px 7px; }
.fc-chip.on { background: var(--grad); color: #fff; border-color: transparent; }
.fc-chip.on .fc-n { color: #fff; background: rgba(255,255,255,0.24); }

.fc-card { position: relative; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-2); padding: 22px 20px 46px; min-height: 320px; display: flex; flex-direction: column; cursor: pointer; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.fc-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--grad); }
.fc-meta { font-size: 11px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 14px; padding-left: 4px; }
.fc-side { flex: 1; display: flex; flex-direction: column; padding-left: 4px; animation: fc-turn 0.34s ease; }
@keyframes fc-turn { from { opacity: 0; transform: perspective(700px) rotateX(10deg) translateY(6px); } to { opacity: 1; transform: none; } }
.fc-role { font-size: 12px; font-weight: 700; color: var(--grey-400); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 9px; }
.fc-text { font-size: 17px; line-height: 1.5; color: var(--grey-900); font-weight: 500; }
.fc-card.flipped .fc-text { font-size: 15.5px; line-height: 1.58; font-weight: 400; color: var(--grey-800); }
.fc-hint { position: absolute; bottom: 15px; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; color: var(--grey-400); pointer-events: none; }

.fc-ctrl { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.fc-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--grey-200); background: var(--surface); color: var(--grey-700); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-1); }
.fc-btn:active { transform: scale(0.94); }
.fc-btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.fc-btn:disabled { opacity: 0.4; cursor: default; }
.fc-count { min-width: 74px; text-align: center; font-size: 14px; font-weight: 600; color: var(--grey-600); font-variant-numeric: tabular-nums; }

/* theme picker grid */
.th-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 18px 4px; }
.th-tile { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--grey-200); border-radius: 20px; padding: 16px 15px; text-align: left; cursor: pointer; box-shadow: var(--shadow-1); }
.th-tile:active { transform: scale(0.98); }
.th-tile.th-all { grid-column: 1 / -1; flex-direction: row; align-items: center; }
.th-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 7px 16px -7px color-mix(in srgb, var(--accent) 65%, transparent); flex: none; }
.th-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.th-name { font-size: 14px; font-weight: 700; color: var(--grey-900); line-height: 1.2; letter-spacing: -0.2px; }
.th-all .th-name { font-size: 17px; }
.th-sub { font-size: 12px; color: var(--grey-500); font-weight: 500; }
.th-bar { display: block; width: 100%; height: 4px; border-radius: 3px; background: var(--grey-100); overflow: hidden; margin-top: 2px; }
.th-bar i { display: block; height: 100%; background: var(--grad); border-radius: 3px; transition: width 0.3s; }

/* study: session line + Anki-style grade buttons */
.fc-sess { display: flex; align-items: center; gap: 14px; padding: 2px 2px 12px; font-size: 12.5px; color: var(--grey-500); font-weight: 600; }
.fc-grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.fc-gcol { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.fc-gcol .fg-i { font-size: 11px; font-weight: 600; color: var(--grey-500); font-variant-numeric: tabular-nums; }
.fc-grade { width: 100%; border: none; border-radius: 12px; padding: 12px 4px; font-size: 13.5px; font-weight: 700; font-family: var(--font); cursor: pointer; }
.fc-grade:active { transform: scale(0.95); }
.fc-grade.g-again { background: var(--g-red-tint); color: var(--g-red-deep); }
.fc-grade.g-hard { background: var(--g-yellow-tint); color: var(--g-yellow-deep); }
.fc-grade.g-good { background: var(--g-green-tint); color: var(--g-green-deep); }
.fc-grade.g-easy { background: var(--g-blue-tint); color: var(--g-blue-deep); }

/* ═══════════ PROFILE ═══════════ */
.pf-head { padding: 14px 22px 18px; display: flex; align-items: center; gap: 16px; }
.pf-av { width: 68px; height: 68px; border-radius: 50%; background: linear-gradient(135deg,#9b72cb,#4285f4); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 600; flex: none; }
.pf-name { font-size: 23px; font-weight: 600; letter-spacing: -0.4px; font-family: var(--font-flex); }
.pf-role { font-size: 14px; color: var(--grey-600); margin-top: 2px; }
.pf-stats { display: grid; grid-template-columns: repeat(3,1fr); background: var(--surface); margin: 0 16px; border-radius: 20px; box-shadow: var(--shadow-1); overflow: hidden; }
.pf-stat { padding: 18px 10px; text-align: center; border-right: 1px solid var(--grey-100); }
.pf-stat:last-child { border-right: none; }
.pf-stat .v { font-size: 26px; font-weight: 600; font-family: var(--font-flex); letter-spacing: -0.5px; }
.pf-stat .v.accent { color: var(--accent); }
.pf-stat .l { font-size: 12px; color: var(--grey-600); margin-top: 3px; }
.pf-prog-card { margin: 16px 16px 0; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1); padding: 18px; }
.pf-prog-card .ph { display: flex; justify-content: space-between; align-items: baseline; }
.pf-prog-card .pt { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
.pf-prog-card .pf-frac { font-size: 14px; font-weight: 700; color: var(--grey-500); }
.pf-track { height: 9px; border-radius: 5px; background: var(--grey-100); overflow: hidden; margin: 14px 0; }
.pf-track i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg,#4285f4,#9b72cb); }
.pf-list { margin: 16px 16px 0; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1); overflow: hidden; }
.pf-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.pf-row + .pf-row { border-top: 1px solid var(--grey-100); }
.pf-row .pic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.pf-row .ptext { flex: 1; }
.pf-row .ptitle { font-size: 15px; font-weight: 500; color: var(--grey-900); }
.pf-row .psub { font-size: 12.5px; color: var(--grey-600); margin-top: 1px; }
.pf-row .pchev { color: var(--grey-400); }

/* iOS-ish switch */
.switch { width: 50px; height: 30px; border-radius: 30px; background: var(--grey-300); border: none; cursor: pointer; padding: 0; flex: none; transition: background 0.2s; }
.switch.on { background: var(--g-green); }
.switch .knob { display: block; width: 26px; height: 26px; margin: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: transform 0.2s; }
.switch.on .knob { transform: translateX(20px); }

/* ═══════════ TWEAKS PANEL ═══════════ */
.tweaks { position: fixed; right: 20px; bottom: 20px; z-index: 9999; width: 248px; background: rgba(32,33,36,0.96); color: #e8eaed; backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 16px; font-family: var(--font); box-shadow: var(--shadow-3); display: none; }
.tweaks.show { display: block; }
.tweaks h4 { margin: 0 0 12px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.55); font-weight: 600; }
.tw-row { padding: 8px 0; }
.tw-row .twl { font-size: 12px; color: rgba(255,255,255,0.65); margin-bottom: 7px; font-weight: 500; }
.tw-seg { display: flex; gap: 5px; background: rgba(255,255,255,0.07); border-radius: 9px; padding: 4px; }
.tw-seg button { flex: 1; border: none; background: none; color: rgba(255,255,255,0.6); border-radius: 6px; cursor: pointer; font-size: 11.5px; font-weight: 600; padding: 6px 4px; font-family: var(--font); }
.tw-seg button.on { background: rgba(255,255,255,0.16); color: #fff; }
.tw-swatches { display: flex; gap: 8px; }
.tw-swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.tw-swatch.on { border-color: #fff; }

/* toast */
.toast { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 40; background: var(--grey-900); color: #fff; border-radius: 100px; padding: 11px 18px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 9px; box-shadow: var(--shadow-2); animation: screenIn 0.3s; max-width: 320px; }
.toast .tdelta { color: #81c995; font-weight: 700; }
.toast { color: var(--bg); }

/* ═══════════ DARK MODE ═══════════ */
.device[data-theme="dark"] {
  --bg: #101114; --surface: #1c1d20;
  --grey-900:#e8eaed; --grey-800:#dfe1e5; --grey-700:#c4c7c5; --grey-600:#9aa0a6; --grey-500:#80868b;
  --grey-400:#5f6368; --grey-300:#44474a; --grey-200:#303134; --grey-100:#28292c; --grey-50:#202124;
  --g-blue-tint:rgba(138,180,248,0.16); --g-red-tint:rgba(242,139,130,0.16); --g-yellow-tint:rgba(253,214,99,0.15); --g-green-tint:rgba(129,201,149,0.16);
  --g-blue-deep:#8ab4f8; --g-red-deep:#f28b82; --g-yellow-deep:#fdd663; --g-green-deep:#81c995;
  --shadow-1:0 1px 3px rgba(0,0,0,0.45); --shadow-2:0 6px 22px rgba(0,0,0,0.55); --shadow-3:0 14px 34px rgba(0,0,0,0.6);
}
.device[data-theme="dark"] .focus-card { background: linear-gradient(135deg,#13233f 0%, #221d39 52%, #2e1c28 100%); }
.device[data-theme="dark"] .nav { background: rgba(28,29,32,0); border-color: rgba(255,255,255,0.14); box-shadow: var(--shadow-2), inset 0 1px 1px rgba(255,255,255,0.12), inset 0 -1px 2px rgba(255,255,255,0.04); }
.device[data-theme="dark"] .focus-card .focus-cta { background: #e8eaed; color: #101114; }
.device[data-theme="dark"] .hy { background: linear-gradient(180deg, transparent 58%, rgba(253,214,99,0.28) 58%); }

/* ═══════════ HOME — Homepage-Verbesserungen ═══════════ */
.hm-sub2 { font-size: 14px; color: var(--grey-600); font-weight: 500; margin-top: 6px; }

/* clinical chips inside focus card */
.focus-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; }
.focus-chip { font-size: 11.5px; font-weight: 700; letter-spacing: 0.2px; padding: 5px 11px; border-radius: 100px; background: rgba(255,255,255,0.22); color: #fff; }

/* readiness caption */
.ov-cap { margin: 9px 22px 0; font-size: 12.5px; color: var(--grey-500); font-weight: 500; }

/* thicker continue progress bar */
.cont-card .cont-bar { height: 7px; }

/* Heute empfohlen — Tagesplan */
.sec-head .plan-tot { font-size: 13px; color: var(--grey-500); font-weight: 600; }
.plan-list { margin: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.plan-row { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px 15px; border: none; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-1); text-align: left; cursor: pointer; }
.plan-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.plan-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--accent-deep); }
.plan-t { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; color: var(--grey-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-row:active { transform: scale(0.985); transition: transform 0.14s ease; }

/* Fall des Tages */
.case-card {
  position: relative; display: block; width: calc(100% - 32px); margin: 0 16px;
  padding: 20px 22px; border: none; border-radius: 24px; cursor: pointer; text-align: left; font: inherit; overflow: hidden;
  background: linear-gradient(150deg, #1f2c45 0%, #2b2140 100%); color: #fff;
  box-shadow: var(--shadow-1);
}
.case-card .case-k { display: block; font-size: 11.5px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: rgba(255,255,255,0.66); }
.case-card .case-h { display: block; font-size: 21px; font-weight: 700; letter-spacing: -0.5px; font-family: var(--font-flex); margin-top: 9px; line-height: 1.2; }
.case-card .case-p { display: block; font-size: 13.5px; line-height: 1.5; color: rgba(255,255,255,0.66); margin-top: 9px; max-width: 36ch; }
.case-card .case-cta { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; background: #fff; color: #16233c; font-weight: 700; font-size: 14px; padding: 10px 17px; border-radius: 100px; }
.case-badge { position: absolute; top: 18px; right: 18px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; padding: 4px 9px; border-radius: 100px; background: rgba(255,255,255,0.16); color: #fff; }
.case-card:active { transform: scale(0.99); transition: transform 0.14s ease; }

/* titles inherit dark ink from the global button rule — force white on the dark cards */
.device .calc-card .cc-title, .device .case-card .case-h { color: #fff; }
