:root {
  color-scheme: dark;
  --bg: #0b1714;
  --bg-soft: #10231f;
  --surface: #142a25;
  --surface-2: #19332d;
  --surface-3: #203d36;
  --border: rgba(220, 255, 239, 0.11);
  --border-strong: rgba(220, 255, 239, 0.2);
  --text: #f5fbf8;
  --muted: #9eb5ad;
  --accent: #b8f36b;
  --accent-strong: #95d94a;
  --accent-ink: #14220d;
  --coral: #ff9b77;
  --blue: #8ecdf3;
  --yellow: #f8d778;
  --danger: #ff827e;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --max: 1220px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 14% -8%, rgba(184, 243, 107, 0.1), transparent 29rem),
    radial-gradient(circle at 96% 12%, rgba(142, 205, 243, 0.08), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
svg { display: block; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(184, 243, 107, 0.52);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }

.app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 23, 20, 0.82);
  backdrop-filter: blur(20px) saturate(1.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 40px), var(--max));
  min-height: 74px;
  margin: auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  letter-spacing: -0.03em;
  font-size: 18px;
}

.brand span:last-child { display: flex; }
.brand strong { font-weight: 800; }
.brand em { color: var(--accent); font-style: normal; font-weight: 800; }

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 24px rgba(184, 243, 107, 0.18);
}
.brand-mark svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.desktop-nav {
  display: flex;
  align-items: center;
  padding: 5px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.desktop-nav button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 720;
  transition: background 160ms ease, color 160ms ease;
}
.desktop-nav button:hover { color: var(--text); }
.desktop-nav button.is-active { background: var(--surface-3); color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}
.icon-button:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.view { display: none; animation: view-in 340ms var(--ease); }
.view.is-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-shell { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; padding: 58px 0 90px; }
.narrow-shell { max-width: 1080px; }
.practice-shell { max-width: 1050px; }
.article-shell { max-width: 860px; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr); gap: 20px; }

.hero-card,
.progress-card,
.panel,
.article-card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 490px;
  padding: 48px 48px 24px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 91% 11%, rgba(184, 243, 107, 0.24), transparent 15rem),
    linear-gradient(140deg, #15362d 0%, #102a24 65%, #142c27 100%);
}
.hero-card::after {
  position: absolute;
  right: -42px;
  bottom: -62px;
  width: 270px;
  height: 270px;
  border: 42px solid rgba(184, 243, 107, 0.07);
  border-radius: 50%;
  content: "";
}

.eyebrow,
.overline {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.eyebrow { display: inline-flex; align-items: center; gap: 9px; }
.eyebrow.plain { margin-bottom: 7px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgba(184, 243, 107, 0.1); }

.hero-card h1,
.page-intro h1,
.article-card h1 {
  margin: 18px 0;
  font-weight: 830;
  letter-spacing: -0.055em;
  line-height: 0.98;
}
.hero-card h1 { max-width: 680px; font-size: clamp(48px, 6vw, 76px); }
.hero-card h1 span { color: var(--accent); }
.hero-copy { max-width: 660px; margin: 0; color: #c4d4cf; font-size: 18px; }
.hero-copy strong { color: var(--text); }
.hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease, background 160ms ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 28px rgba(184, 243, 107, 0.16); }
.button-primary:hover { filter: brightness(1.04); }
.button-secondary { border-color: var(--border-strong); background: var(--surface-3); color: var(--text); }
.button-ghost { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.04); color: var(--text); }
.full-width { width: 100%; }

.exam-facts {
  position: static;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  gap: 18px;
}
.exam-facts div { display: flex; flex-direction: column; }
.exam-facts strong { font-size: 22px; line-height: 1.1; }
.exam-facts span { margin-top: 4px; color: #9fb6ae; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.progress-card {
  display: flex;
  min-height: 490px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 35px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface) 0%, #11241f 100%);
  text-align: center;
}

.progress-ring {
  --progress: 0;
  display: grid;
  width: 180px;
  height: 180px;
  margin-bottom: 28px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--progress) * 1%), rgba(255,255,255,.07) 0);
  box-shadow: 0 0 55px rgba(184, 243, 107, 0.08);
}
.progress-ring::before { grid-area: 1 / 1; width: 146px; height: 146px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); content: ""; }
.progress-ring div { z-index: 1; grid-area: 1 / 1; display: flex; flex-direction: column; }
.progress-ring strong { font-size: 36px; letter-spacing: -0.05em; line-height: 1; }
.progress-ring span { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.progress-card h2 { margin: 7px 0; font-size: 22px; letter-spacing: -0.025em; }
.progress-card p { max-width: 300px; margin: 0; color: var(--muted); font-size: 14px; }
.mini-stats { display: grid; width: 100%; grid-template-columns: repeat(3, 1fr); margin-top: 30px; border-top: 1px solid var(--border); padding-top: 24px; }
.mini-stats div { display: flex; flex-direction: column; padding: 0 8px; border-right: 1px solid var(--border); }
.mini-stats div:last-child { border: 0; }
.mini-stats span { font-size: 21px; font-weight: 820; }
.mini-stats small { color: var(--muted); font-size: 9px; font-weight: 750; line-height: 1.3; text-transform: uppercase; }

.dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; margin-top: 20px; }
.panel { border-radius: var(--radius-md); background: rgba(20, 42, 37, 0.86); }
.focus-panel, .exam-panel { min-height: 250px; padding: 30px; }
.panel-heading, .section-heading, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel h2, .section-heading h2 { margin: 5px 0 0; letter-spacing: -0.035em; line-height: 1.1; }
.soft-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: rgba(184, 243, 107, 0.1); color: var(--accent); font-size: 11px; font-weight: 800; white-space: nowrap; }
.focus-topic { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 15px; margin-top: 24px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.025); }
.focus-topic .module-icon, .module-preview .module-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; background: var(--module-bg); color: var(--module-color); font-size: 19px; font-weight: 850; }
.focus-topic strong { display: block; font-size: 15px; }
.focus-topic small { color: var(--muted); }
.focus-topic button { border: 0; background: transparent; color: var(--accent); cursor: pointer; font-weight: 850; }
.exam-panel { background: linear-gradient(135deg, rgba(255, 155, 119, .13), rgba(20, 42, 37, .92) 58%); }
.exam-panel p { color: var(--muted); }
.text-link, .text-button { padding: 0; border: 0; background: transparent; cursor: pointer; color: var(--accent); font-weight: 800; }
.text-link:hover, .text-button:hover { text-decoration: underline; }

.section-block { margin-top: 64px; }
.section-heading { margin-bottom: 22px; }
.section-heading h2 { font-size: 30px; }
.module-preview-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 13px; }
.module-preview { position: relative; overflow: hidden; min-height: 195px; padding: 19px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); cursor: pointer; text-align: left; transition: transform 180ms var(--ease), border-color 180ms ease; }
.module-preview:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.module-preview .module-icon { margin-bottom: 22px; }
.module-preview strong { display: block; font-size: 14px; line-height: 1.3; }
.module-preview small { display: block; color: var(--muted); font-size: 11px; }
.module-preview .module-meter { position: absolute; right: 18px; bottom: 16px; left: 18px; height: 4px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }
.module-preview .module-meter i { display: block; height: 100%; border-radius: inherit; background: var(--module-color); }
.module-preview .module-percent { position: absolute; top: 21px; right: 18px; color: var(--muted); font-size: 11px; font-weight: 800; }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 32px; }
.page-intro > div:first-child { max-width: 650px; }
.page-intro h1, .article-card h1 { margin: 5px 0 12px; overflow-wrap: anywhere; font-size: clamp(42px, 5vw, 62px); }
.page-intro p { margin: 0; color: var(--muted); font-size: 16px; }
.compact-intro { align-items: center; }
.search-field { display: flex; width: min(330px, 100%); align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.search-field:focus-within { border-color: rgba(184,243,107,.5); }
.search-field svg { width: 18px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search-field input { width: 100%; height: 45px; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-field input::placeholder { color: #718981; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter-row button, .stacked-filters button { border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 750; transition: all 160ms ease; }
.filter-row button { min-height: 36px; padding: 0 13px; border-radius: 99px; }
.filter-row button:hover, .filter-row button.is-active { border-color: rgba(184,243,107,.42); background: rgba(184,243,107,.08); color: var(--accent); }

.learning-list { display: grid; gap: 16px; }
.learning-module { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.learning-module summary { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 16px; padding: 22px; cursor: pointer; list-style: none; }
.learning-module summary::-webkit-details-marker { display: none; }
.learning-module summary:hover { background: rgba(255,255,255,.018); }
.learning-module .module-number { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 15px; background: var(--module-bg); color: var(--module-color); font-weight: 850; }
.learning-module summary h2 { margin: 0; font-size: 18px; letter-spacing: -0.025em; }
.learning-module summary p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.summary-progress { display: flex; align-items: center; gap: 12px; }
.summary-progress span { min-width: 38px; color: var(--module-color); font-size: 12px; font-weight: 850; }
.summary-progress i { display: grid; width: 30px; height: 30px; place-items: center; color: var(--muted); font-style: normal; transition: transform 180ms ease; }
.learning-module[open] .summary-progress i { transform: rotate(180deg); }
.topic-list { padding: 4px 22px 22px; border-top: 1px solid var(--border); }
.topic-group { padding: 20px 0 6px; }
.topic-group + .topic-group { border-top: 1px solid var(--border); }
.topic-group h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 12px; font-size: 14px; }
.topic-group h3 span { color: var(--muted); font-size: 10px; font-weight: 700; }
.topic-check { display: flex; align-items: flex-start; gap: 12px; margin: 8px 0; padding: 10px 12px; border-radius: 11px; cursor: pointer; color: #c7d7d1; font-size: 13px; transition: background 130ms ease, color 130ms ease; }
.topic-check:hover { background: rgba(255,255,255,.025); color: var(--text); }
.topic-check input { position: absolute; opacity: 0; pointer-events: none; }
.topic-check i { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border: 1px solid var(--border-strong); border-radius: 7px; background: rgba(0,0,0,.12); font-style: normal; }
.topic-check input:checked + i { border-color: var(--module-color); background: var(--module-color); color: #102019; }
.topic-check input:checked + i::after { content: "✓"; font-size: 13px; font-weight: 900; }
.topic-check input:checked ~ span { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(158,181,173,.5); }
.no-results { padding: 60px 20px; color: var(--muted); text-align: center; }

.deck-stats, .score-pill { display: flex; gap: 12px; padding: 10px 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--muted); font-size: 12px; }
.deck-stats strong, .score-pill span { color: var(--text); font-size: 15px; }
.practice-layout, .math-layout { display: grid; grid-template-columns: 270px 1fr; gap: 20px; align-items: start; }
.practice-sidebar { padding: 23px; box-shadow: none; }
.practice-sidebar h2 { margin: 0 0 20px; font-size: 17px; }
.select-wrap label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.select-wrap select { width: 100%; height: 43px; padding: 0 35px 0 12px; border: 1px solid var(--border); border-radius: 11px; outline: none; background: var(--bg-soft); color: var(--text); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0; cursor: pointer; }
.toggle-row span { display: flex; flex-direction: column; }
.toggle-row strong { font-size: 13px; }
.toggle-row small { color: var(--muted); font-size: 10px; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row i { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 99px; background: #29453e; transition: background 160ms ease; }
.toggle-row i::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); content: ""; transition: transform 160ms ease, background 160ms ease; }
.toggle-row input:checked + i { background: rgba(184,243,107,.25); }
.toggle-row input:checked + i::after { transform: translateX(16px); background: var(--accent); }
.tip-box { margin-top: 18px; padding: 15px; border-radius: 13px; background: rgba(142,205,243,.07); color: var(--blue); font-size: 12px; }
.tip-box p { margin: 4px 0 0; color: var(--muted); }
.card-stage { min-width: 0; }
.flashcard { position: relative; min-height: 390px; transform-style: preserve-3d; cursor: pointer; transition: transform 600ms var(--ease); }
.flashcard.is-flipped { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 33px; border: 1px solid var(--border); border-radius: var(--radius-lg); backface-visibility: hidden; box-shadow: var(--shadow); }
.card-front { background: linear-gradient(145deg, var(--surface-2), var(--surface)); }
.card-back { transform: rotateY(180deg); background: linear-gradient(145deg, #1b3d31, #132a24); }
.card-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.card-face p { max-width: 650px; margin: auto; font-size: clamp(23px, 3.2vw, 34px); font-weight: 760; letter-spacing: -0.035em; line-height: 1.25; text-align: center; }
.card-back p { color: #d9e9e2; font-size: clamp(19px, 2.5vw, 27px); font-weight: 600; }
.flip-hint { color: var(--muted); font-size: 11px; text-align: center; }
kbd { margin-left: 4px; padding: 2px 6px; border: 1px solid var(--border-strong); border-radius: 5px; background: rgba(0,0,0,.16); font-family: inherit; }
.rating-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 13px; opacity: 0; pointer-events: none; transform: translateY(-5px); transition: opacity 160ms ease, transform 160ms ease; }
.rating-row.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.rating-row button { display: flex; min-height: 53px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.rating-row button:hover { border-color: var(--border-strong); background: var(--surface-2); }
.rating-row span { font-size: 12px; font-weight: 800; }
.rating-row small { color: var(--muted); font-size: 9px; }
.empty-state { min-height: 390px; padding: 50px 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); text-align: center; }
.empty-state > span { display: grid; width: 68px; height: 68px; margin: 30px auto 18px; place-items: center; border-radius: 50%; background: rgba(184,243,107,.12); color: var(--accent); font-size: 28px; }
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { margin-top: 0; color: var(--muted); }

.quiz-start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mode-card { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 16px; min-height: 120px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; text-align: left; transition: transform 180ms var(--ease), border-color 180ms ease; }
.mode-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.mode-card.featured { background: linear-gradient(135deg, rgba(184,243,107,.13), var(--surface) 62%); }
.mode-icon { display: grid; width: 60px; height: 60px; place-items: center; border-radius: 18px; background: rgba(184,243,107,.1); color: var(--accent); font-size: 22px; font-weight: 850; }
.mode-card strong, .mode-card small { display: block; }
.mode-card strong { font-size: 17px; }
.mode-card small { margin-top: 4px; color: var(--muted); }
.mode-card i { color: var(--accent); font-size: 22px; font-style: normal; }
.exam-note { grid-column: 1 / -1; padding: 23px 28px; box-shadow: none; }
.exam-note ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 15px 0 0; padding: 0; list-style: none; }
.exam-note li { position: relative; padding-left: 17px; color: var(--muted); font-size: 12px; }
.exam-note li::before { position: absolute; top: .55em; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); content: ""; }
.quiz-topbar { display: grid; grid-template-columns: 100px 1fr 100px; align-items: center; gap: 25px; margin-bottom: 18px; }
.quiz-progress > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; text-align: center; }
.quiz-progress > div { overflow: hidden; height: 5px; border-radius: 99px; background: var(--surface); }
.quiz-progress i { display: block; width: 10%; height: 100%; border-radius: inherit; background: var(--accent); transition: width 300ms var(--ease); }
.timer { justify-self: end; font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 800; }
.timer.is-warning { color: var(--coral); }
#quiz-active { scroll-margin-top: 76px; }
.quiz-card { min-height: 420px; padding: 37px; }
.quiz-card h2 { max-width: 760px; margin: 22px 0 28px; font-size: clamp(22px, 3vw, 30px); line-height: 1.25; }
.quiz-situation { margin-top: 22px; padding: 17px 19px 16px 20px; border-left: 3px solid var(--accent); border-radius: 0 13px 13px 0; background: linear-gradient(100deg, rgba(184,243,107,.09), rgba(184,243,107,.025)); }
.quiz-situation-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.quiz-situation-meta span:last-child { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.quiz-situation strong { display: block; margin-top: 8px; font-size: 16px; letter-spacing: -.015em; }
.quiz-situation p { max-width: 760px; margin: 4px 0 0; color: #c3d4cd; font-size: 13px; line-height: 1.5; }
.quiz-options { display: grid; gap: 9px; }
.quiz-option { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.018); cursor: pointer; transition: border-color 140ms ease, background 140ms ease; }
.quiz-option:hover { border-color: var(--border-strong); }
.quiz-option input { position: absolute; opacity: 0; }
.quiz-option i { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid var(--border-strong); border-radius: 9px; color: var(--muted); font-style: normal; font-size: 11px; font-weight: 850; }
.quiz-option:has(input:checked) { border-color: rgba(184,243,107,.48); background: rgba(184,243,107,.06); }
.quiz-option:has(input:checked) i { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.quiz-option.is-correct { border-color: rgba(184,243,107,.65); background: rgba(184,243,107,.08); }
.quiz-option.is-wrong { border-color: rgba(255,130,126,.65); background: rgba(255,130,126,.07); }
.quiz-number-answer { display: grid; width: min(100%, 360px); gap: 9px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.quiz-number-answer .answer-field { width: 100%; }
.quiz-feedback, .math-feedback { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: rgba(142,205,243,.07); color: #c3def0; font-size: 13px; }
.quiz-feedback strong, .math-feedback strong { display: block; margin-bottom: 4px; color: var(--text); }
.quiz-solution { display: inline-block; margin-top: 6px; color: var(--text); font-weight: 750; }
.quiz-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.button:disabled { cursor: not-allowed; filter: grayscale(.7); opacity: .45; transform: none; }
.result-card { padding: 48px; text-align: center; }
.result-score { display: grid; width: 150px; height: 150px; margin: 0 auto 24px; place-items: center; border: 10px solid rgba(184,243,107,.17); border-radius: 50%; background: rgba(184,243,107,.07); }
.result-score strong { display: block; color: var(--accent); font-size: 42px; line-height: 1; }
.result-score span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.result-card h2 { font-size: 28px; }
.result-card p { color: var(--muted); }
.result-breakdown { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 760px; margin: 30px auto; }
.result-breakdown div { padding: 12px 8px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.02); }
.result-breakdown strong, .result-breakdown small { display: block; }
.result-breakdown small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.25; }

.math-layout { grid-template-columns: 280px 1fr; }
.stacked-filters { display: grid; gap: 7px; }
.stacked-filters button { width: 100%; min-height: 39px; padding: 0 12px; border-radius: 10px; text-align: left; }
.stacked-filters button:hover, .stacked-filters button.is-active { border-color: rgba(184,243,107,.38); background: rgba(184,243,107,.07); color: var(--accent); }
.formula-box { display: grid; gap: 8px; margin-top: 22px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.025); }
.formula-box span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.formula-box strong { font-size: 10px; font-weight: 650; }
.math-card { min-height: 410px; padding: 38px; }
.math-context { color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.math-card h2 { max-width: 650px; margin: 18px 0 34px; font-size: clamp(24px, 3vw, 34px); line-height: 1.25; }
.math-card form { display: flex; align-items: stretch; gap: 10px; }
.answer-field { display: flex; width: 240px; align-items: center; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 13px; background: var(--bg-soft); }
.answer-field:focus-within { border-color: rgba(184,243,107,.55); }
.answer-field input { width: 100%; height: 50px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 22px; font-weight: 750; }
.answer-field span { color: var(--muted); font-weight: 750; }
.math-feedback { margin-bottom: 14px; }

.glossary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.glossary-card { padding: 22px; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); }
.glossary-card header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.glossary-card h2 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }
.glossary-card header span { color: var(--module-color); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.glossary-card > p { margin: 13px 0; color: #c3d4cd; font-size: 13px; }
.mnemonic { display: flex; gap: 9px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.mnemonic span { color: var(--yellow); }

.back-button { margin-bottom: 18px; }
.article-card { padding: clamp(28px, 6vw, 64px); border-radius: var(--radius-lg); background: var(--surface); }
.article-card .lead { color: #d4e3de; font-size: 20px; }
.article-card h2 { margin: 40px 0 12px; font-size: 22px; letter-spacing: -0.025em; }
.article-card p, .article-card li { color: var(--muted); }
.article-card li { margin-bottom: 8px; }
.article-meta { margin-top: 40px; padding-top: 15px; border-top: 1px solid var(--border); font-size: 12px; }
.callout, .legal-note { margin: 30px 0; padding: 20px 22px; border-left: 3px solid var(--accent); border-radius: 0 13px 13px 0; background: rgba(184,243,107,.06); }
.callout p, .legal-note p { margin: 6px 0 0; }
.legal-note { border-left-color: var(--coral); background: rgba(255,155,119,.06); }
.source-list { display: grid; gap: 10px; padding: 0; list-style: none; }
.source-list li { margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.source-list a { display: block; color: var(--text); font-weight: 750; }
.source-list span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.mobile-nav { display: none; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); }
.site-footer > div { display: flex; width: min(calc(100% - 40px), var(--max)); min-height: 82px; align-items: center; justify-content: space-between; gap: 20px; margin: auto; font-size: 11px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links button, .footer-links a { padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; text-decoration: none; }
.footer-links button:hover, .footer-links a:hover { color: var(--text); }
.settings-dialog { width: min(540px, calc(100% - 28px)); padding: 0; border: 1px solid var(--border-strong); border-radius: 23px; background: transparent; color: var(--text); box-shadow: var(--shadow); }
.settings-dialog::backdrop { background: rgba(3, 9, 7, .72); backdrop-filter: blur(7px); }
.dialog-card { padding: 28px; border-radius: inherit; background: var(--surface); }
.dialog-heading h2 { margin: 3px 0 0; }
.dialog-card > p { color: var(--muted); font-size: 13px; }
.dialog-actions { display: grid; gap: 9px; margin-top: 22px; }
.settings-action { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.018); color: var(--text); cursor: pointer; text-align: left; }
.settings-action:hover { border-color: var(--border-strong); background: rgba(255,255,255,.035); }
.settings-action > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: var(--surface-3); color: var(--accent); font-size: 20px; }
.settings-action strong, .settings-action small { display: block; }
.settings-action small { color: var(--muted); }
.settings-action input { display: none; }
.settings-action.danger > span { color: var(--danger); }
.dialog-foot { margin: 22px 0 0 !important; text-align: center; font-size: 10px !important; }
.dialog-foot a { color: var(--accent); }
.toast { position: fixed; z-index: 1000; right: 22px; bottom: 22px; max-width: min(390px, calc(100% - 44px)); padding: 13px 17px; border: 1px solid var(--border-strong); border-radius: 12px; background: #25443c; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(15px); transition: opacity 200ms ease, transform 200ms var(--ease); }
.toast.is-visible { opacity: 1; transform: none; }
.is-hidden { display: none !important; }

@media (max-width: 980px) {
  .desktop-nav { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .progress-card { min-height: auto; display: grid; grid-template-columns: 150px 1fr; gap: 25px; text-align: left; }
  .progress-ring { width: 140px; height: 140px; margin: 0; }
  .progress-ring::before { width: 112px; height: 112px; }
  .progress-ring strong { font-size: 29px; }
  .mini-stats { grid-column: 1 / -1; margin-top: 0; }
  .module-preview-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 740px) {
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .header-inner, .page-shell { width: min(calc(100% - 28px), var(--max)); }
  .site-footer > div { width: min(calc(100% - 28px), var(--max)); flex-direction: column; align-items: flex-start; justify-content: center; padding: 20px 0; }
  .header-inner { min-height: 64px; }
  .header-actions #install-button { display: none !important; }
  .page-shell { padding: 34px 0 55px; }
  .hero-card { min-height: auto; padding: 30px 24px; }
  .hero-card h1 { font-size: clamp(42px, 13vw, 62px); }
  .hero-copy { font-size: 16px; }
  .exam-facts { position: relative; right: auto; bottom: auto; left: auto; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 30px; }
  .dashboard-grid, .practice-layout, .math-layout, .glossary-grid { grid-template-columns: minmax(0, 1fr); }
  .section-block { margin-top: 44px; }
  .section-heading { align-items: flex-end; }
  .module-preview-grid { display: flex; overflow-x: auto; margin-right: -14px; padding: 0 14px 8px 0; scroll-snap-type: x mandatory; }
  .module-preview { min-width: 190px; scroll-snap-align: start; }
  .page-intro { display: grid; gap: 21px; }
  .page-intro h1, .article-card h1 { font-size: 43px; }
  .search-field { width: 100%; }
  .learning-module summary { grid-template-columns: 45px 1fr auto; padding: 17px 15px; }
  .learning-module .module-number { width: 43px; height: 43px; }
  .learning-module summary h2 { font-size: 15px; }
  .learning-module summary p { display: none; }
  .topic-list { padding: 2px 14px 15px; }
  .practice-layout, .math-layout { display: flex; flex-direction: column; }
  .practice-sidebar { width: 100%; }
  .card-stage { width: 100%; }
  .flashcard { min-height: 420px; }
  .card-face { padding: 25px; }
  .rating-row { grid-template-columns: repeat(2, 1fr); }
  .quiz-start-grid { grid-template-columns: 1fr; }
  .mode-card { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; padding: 18px; }
  .mode-icon { width: 52px; height: 52px; border-radius: 16px; }
  [data-view="pruefung"] .page-intro h1 { font-size: clamp(27px, 8.7vw, 34px); overflow-wrap: normal; }
  .exam-note { grid-column: auto; }
  .exam-note ul { grid-template-columns: 1fr; }
  .quiz-topbar { grid-template-columns: 88px 1fr 62px; gap: 10px; }
  .quiz-card { padding: 24px; }
  .quiz-situation { margin-top: 18px; padding: 15px 16px 14px 17px; }
  .quiz-situation-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .math-card { min-height: 380px; padding: 26px; }
  .math-card form { flex-direction: column; }
  .answer-field { width: 100%; }
  .result-breakdown { grid-template-columns: repeat(2, 1fr); }
  .article-card { padding: 27px 22px; }
  .mobile-nav { position: fixed; z-index: 60; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(6, 1fr); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: rgba(11,23,20,.94); backdrop-filter: blur(18px); }
  .mobile-nav button { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 3px; padding: 3px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 750; }
  .mobile-nav button.is-active { color: var(--accent); }
  .mobile-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .toast { right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .brand { font-size: 16px; }
  .brand-mark { width: 35px; height: 35px; }
  .hero-actions .button { width: 100%; }
  .progress-card { display: flex; text-align: center; }
  .progress-ring { margin-bottom: 20px; }
  .mini-stats { width: 100%; }
  .section-heading .text-link { display: none; }
  .summary-progress span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

@media print {
  .app-header, .mobile-nav, .hero-actions, .header-actions, .filter-row, .search-field { display: none !important; }
  body { background: white; color: black; }
  .view { display: none !important; }
  .view.is-active { display: block !important; }
  .page-shell { width: 100%; padding: 0; }
  .panel, .hero-card, .progress-card, .learning-module, .glossary-card { break-inside: avoid; box-shadow: none; }
}

body.auth-pending > :not(#auth-gate),
body.auth-ready > :not(#auth-gate) { display: none !important; }
body.auth-authenticated #auth-gate { display: none; }

.auth-gate {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 32px 20px;
  background: radial-gradient(circle at 50% 20%, rgba(184, 243, 107, .13), transparent 28rem), var(--bg);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  padding: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(25, 51, 45, .96), rgba(16, 35, 31, .96));
  box-shadow: var(--shadow);
}

.auth-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 56px; font-size: 18px; letter-spacing: -.03em; }
.auth-brand span:last-child { display: flex; }
.auth-brand strong { font-weight: 800; }
.auth-brand em { color: var(--accent); font-style: normal; font-weight: 800; }
.auth-brand .brand-mark { width: 38px; height: 38px; }
.auth-brand .brand-mark svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.auth-card h1 { max-width: 380px; margin: 12px 0 15px; font-size: clamp(35px, 7vw, 52px); line-height: .98; letter-spacing: -.06em; }
.auth-copy { max-width: 390px; margin: 0 0 30px; color: var(--muted); }
.auth-form { display: grid; gap: 9px; }
.auth-form label { color: var(--muted); font-size: 12px; font-weight: 750; }
.auth-form input { width: 100%; margin-bottom: 8px; padding: 13px 14px; border: 1px solid var(--border-strong); border-radius: 12px; outline: 0; background: rgba(11, 23, 20, .62); color: var(--text); }
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(184, 243, 107, .1); }
.auth-form .button { justify-content: center; margin-top: 10px; }
.auth-message { min-height: 24px; margin: 3px 0 0; color: var(--danger); font-size: 13px; }
.auth-foot { margin: 29px 0 0; color: rgba(158, 181, 173, .7); font-size: 12px; }
.auth-foot a { color: var(--accent); }
.auth-orbit { position: absolute; width: min(80vw, 700px); aspect-ratio: 1; border: 1px solid rgba(184, 243, 107, .08); border-radius: 50%; transform: translate(27%, 24%); }
.auth-orbit::before, .auth-orbit::after, .auth-orbit span { position: absolute; display: block; border-radius: 50%; content: ''; }
.auth-orbit::before { inset: 12%; border: 1px solid rgba(142, 205, 243, .08); }
.auth-orbit::after { inset: 27%; border: 1px solid rgba(255, 155, 119, .08); }
.auth-orbit span { width: 8px; height: 8px; background: var(--accent); box-shadow: 0 0 0 7px rgba(184, 243, 107, .08); }
.auth-orbit span:nth-child(1) { top: 16%; left: 22%; }
.auth-orbit span:nth-child(2) { right: 15%; bottom: 27%; background: var(--coral); }
.auth-orbit span:nth-child(3) { bottom: 10%; left: 42%; background: var(--blue); }

.account-label { display: inline-flex; max-width: 145px; min-height: 40px; align-items: center; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 750; text-decoration: none; }
.account-link:hover { border-color: var(--border-strong); color: var(--text); }

@media (max-width: 700px) {
  .auth-card { padding: 29px 24px; }
  .auth-brand { margin-bottom: 40px; }
  .account-label { display: none; }
  .account-link { padding: 0 9px; font-size: 11px; }
}
