:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-hover: #fbfdff;
  --ink: #182131;
  --muted: #64748b;
  --blue: #1d56d9;
  --blue-dark: #1747b8;
  --blue-soft: #f4f7ff;
  --line: #d7e1ef;
  --line-strong: #bfcce0;
  --progress-track: #edf2f8;
  --header-bg: rgba(255,255,255,.97);
  --option-hover-line: #9fb9e8;
  --open-active-line: #afc3e6;
  --success: #17804a;
  --success-soft: #f0faf5;
  --success-line: #b9e0cc;
  --danger: #c53535;
  --danger-soft: #fff4f4;
  --danger-line: #efc4c4;
  --inverse-bg: #182131;
  --inverse-ink: #ffffff;
  --radius: 14px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f141d;
  --surface: #151c27;
  --surface-hover: #192332;
  --ink: #edf2f7;
  --muted: #9aa8bb;
  --blue: #6f9cff;
  --blue-dark: #86aaff;
  --blue-soft: #172642;
  --line: #2c394c;
  --line-strong: #3b4c63;
  --progress-track: #222d3b;
  --header-bg: rgba(15,20,29,.97);
  --option-hover-line: #526d98;
  --open-active-line: #5874a1;
  --success: #61c991;
  --success-soft: #12291f;
  --success-line: #285940;
  --danger: #ff8585;
  --danger-soft: #32191d;
  --danger-line: #67333a;
  --inverse-bg: #edf2f7;
  --inverse-ink: #0f141d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .16s ease, color .16s ease;
}
html[data-theme="dark"] input { color-scheme: dark; }
button, input { font: inherit; }
button { color: inherit; }
a { color: var(--blue); }
.hidden { display: none !important; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(29, 86, 217, .2);
  outline-offset: 2px;
}

/* Shared typography: deliberately narrow scale, matching the supplied reference. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}
.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--blue);
}
.brand-button { border: 0; background: none; padding: 0; cursor: pointer; }
.auth-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.theme-toggle {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.theme-toggle:hover { border-color: var(--blue); background: var(--surface-hover); }
.theme-icon { width: 16px; color: var(--blue); font-size: 16px; line-height: 1; text-align: center; }
.theme-toggle--header { height: 40px; }
.kicker {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}
.lead {
  max-width: 650px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}
.lead.compact { font-size: 15px; line-height: 1.55; }

.button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 17px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.button:hover { border-color: var(--blue); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button--primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button--ghost { background: var(--surface); }
.button--wide { width: 100%; justify-content: space-between; }
.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.icon-button:hover { border-color: var(--blue); }

/* Login */
.auth-view { min-height: 100vh; padding: 28px; }
.auth-wrap { max-width: 1040px; margin: 0 auto; }
.auth-grid {
  min-height: calc(100vh - 84px);
  display: grid;
  grid-template-columns: 1fr 430px;
  align-items: center;
  gap: 72px;
  padding: 56px 0;
}
.auth-intro h1 {
  max-width: 590px;
  margin: 0;
  font-size: 34px;
  line-height: 1.22;
  letter-spacing: -.02em;
  font-weight: 700;
}
.auth-intro .lead { margin-top: 18px; }
.auth-metrics { display: flex; gap: 30px; margin-top: 30px; }
.auth-metrics div { display: flex; flex-direction: column; gap: 2px; }
.auth-metrics strong { font-size: 20px; color: var(--blue); }
.auth-metrics span { color: var(--muted); font-size: 13px; }
.auth-card {
  width: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.auth-tab {
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.auth-tab.active { background: var(--blue); color: #fff; }
.auth-form { display: none; }
.auth-form.active { display: flex; flex-direction: column; gap: 16px; }
.form-heading { margin-bottom: 2px; }
.form-heading h2 { margin: 0 0 5px; font-size: 22px; line-height: 1.3; }
.form-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 7px; }
.auth-form label > span { font-size: 14px; font-weight: 700; }
.auth-form input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
}
.auth-form input:focus { border-color: var(--blue); outline: 0; }
.test-login {
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
}
.test-login:hover { border-color: var(--blue); }
.test-login > span:first-child { display: flex; flex-direction: column; gap: 1px; }
.test-login strong { font-size: 14px; }
.test-login small { color: var(--muted); font-size: 13px; }
.test-login > span:last-child { color: var(--blue); font-size: 13px; font-weight: 700; }
.form-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 13px; font-weight: 700; }

/* App header */
.app-view { min-height: 100vh; }
.app-header {
  height: 66px;
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
}
.header-inner {
  height: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-pill, .user-pill {
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 7px;
}
.header-pill { cursor: pointer; }
.header-pill:hover { border-color: var(--blue); }
.header-pill strong { font-size: 14px; }
.header-pill span { color: var(--muted); font-size: 13px; }
.header-pill .spark { color: var(--blue); }
.user-pill { padding: 4px 10px 4px 5px; }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.user-copy { display: flex; flex-direction: column; line-height: 1.12; }
.user-copy strong { font-size: 13px; }
.user-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.app-main { max-width: 1040px; margin: 0 auto; padding: 40px 20px 80px; }
.screen { animation: screenIn .18s ease; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }

/* Topics */
.page-head {
  display: grid;
  grid-template-columns: minmax(0,1fr) 310px;
  gap: 48px;
  align-items: end;
  margin-bottom: 30px;
}
.page-head h1, .mode-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -.01em;
  font-weight: 700;
}
.overall-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.overall-top, .overall-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.overall-top { font-size: 14px; font-weight: 700; }
.overall-top strong { color: var(--blue); font-size: 16px; }
.overall-bottom { margin-top: 8px; color: var(--muted); font-size: 12px; }
.progress { height: 6px; margin-top: 11px; overflow: hidden; border-radius: 99px; background: var(--progress-track); }
.progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .25s ease; }
.topic-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.topic-card {
  min-height: 126px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: grid;
  grid-template-columns: 38px 1fr auto;
  grid-template-rows: auto 1fr auto;
  column-gap: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.topic-card:hover:not(:disabled) { border-color: var(--blue); background: var(--surface-hover); }
.topic-card:disabled { opacity: .46; cursor: not-allowed; }
.topic-number {
  grid-row: 1/3;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}
.topic-card h2 { margin: 5px 0 0; font-size: 17px; line-height: 1.35; font-weight: 700; }
.topic-arrow { margin-top: 4px; color: var(--blue); font-size: 18px; }
.topic-status { grid-column: 2/4; margin-top: 15px; display: flex; align-items: center; gap: 12px; }
.topic-status span { color: var(--muted); font-size: 12px; }
.topic-status .wrong-count { color: var(--blue); font-weight: 700; white-space: nowrap; }
.topic-mini-progress { height: 4px; flex: 1; overflow: hidden; border-radius: 99px; background: var(--progress-track); }
.topic-mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.topic-card.complete .topic-number { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Mode selection */
.back-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.back-link:hover { text-decoration: underline; }
.mode-head { max-width: 760px; margin: 32px 0 26px; }
.mode-stats { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 15px; }
.mode-stats span { color: var(--muted); font-size: 14px; }
.mode-stats strong { color: var(--ink); font-size: 14px; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.mode-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: grid;
  grid-template-columns: 42px 1fr auto;
  grid-template-rows: 1fr auto;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.mode-card:hover:not(:disabled) { border-color: var(--blue); background: var(--surface-hover); }
.mode-card:disabled { opacity: .46; cursor: not-allowed; }
.mode-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
}
.mode-card--review .mode-icon { color: var(--blue); background: var(--blue-soft); }
.mode-copy { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.mode-copy strong { font-size: 18px; line-height: 1.35; }
.mode-copy span { max-width: 390px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.mode-meta { grid-column: 2; display: flex; align-items: baseline; gap: 5px; }
.mode-meta strong { color: var(--blue); font-size: 20px; }
.mode-meta span { color: var(--muted); font-size: 12px; }
.mode-arrow { grid-column: 3; grid-row: 2; align-self: end; color: var(--blue); font-size: 18px; }
.mode-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

/* Questions — sized directly from the supplied immerfragen.de screenshot. */
.question-toolbar {
  max-width: 900px;
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.question-toolbar-center { display: flex; flex-direction: column; gap: 1px; text-align: center; }
.question-toolbar-center span { color: var(--muted); font-size: 12px; }
.question-toolbar-center strong { font-size: 13px; }
.question-count { justify-self: end; display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.question-count strong { color: var(--ink); font-size: 15px; }
.question-progress {
  max-width: 900px;
  height: 3px;
  margin: 0 auto 24px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--progress-track);
}
.question-progress i { display: block; width: 0; height: 100%; background: var(--blue); transition: width .25s ease; }
.question-card {
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: var(--surface);
}
.question-heading { max-width: 880px; margin: 0 0 23px; }
.question-heading-top{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-bottom:7px}
.question-title { display: none; }
.question-feedback-button{
  min-height:30px;padding:0 9px;border:1px solid var(--line);border-radius:9px;background:var(--surface);
  color:var(--muted);font:700 11px Arial,Helvetica,sans-serif;cursor:pointer;white-space:nowrap
}
.question-feedback-button:hover{color:var(--blue);border-color:var(--blue);background:var(--blue-soft)}
.question-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.48;
  letter-spacing: 0;
  font-weight: 700;
}
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  width: 100%;
  min-height: 62px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.option:hover:not(.locked) { border-color: var(--option-hover-line); background: var(--surface-hover); }
.option-letter {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--surface);
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
}
.option-text { color: var(--ink); font-size: 17px; line-height: 1.45; font-weight: 400; }
.option-key { display: none; }
.option.selected { border-color: var(--blue); background: var(--blue-soft); }
.option.selected .option-letter { border-color: var(--blue); background: var(--blue); color: #fff; }
.option.pending { opacity: .72; }
.option.locked { cursor: default; }
.option.correct { border-color: var(--success-line); background: var(--success-soft); }
.option.correct .option-letter { border-color: var(--success); background: var(--success); color: #fff; }
.option.wrong { border-color: var(--danger-line); background: var(--danger-soft); }
.option.wrong .option-letter { border-color: var(--danger); background: var(--danger); color: #fff; }
.answer-hint { margin: 14px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

.feedback-panel {
  max-width: 900px;
  margin: 18px auto 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.feedback-result { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.result-badge {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--success-line);
  border-radius: 9px;
  background: var(--success-soft);
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.feedback-panel.is-wrong .result-badge { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.feedback-result h2 { margin: 0 0 6px; font-size: 18px; line-height: 1.35; }
.feedback-result p { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.55; }
.feedback-divider { height: 1px; margin: 20px 0; background: var(--line); }
.feedback-options-head h3 { margin: 0 0 4px; font-size: 17px; line-height: 1.35; }
.feedback-options-head p { margin: 0; color: var(--muted); font-size: 14px; }
.option-feedback-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.option-feedback {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.feedback-letter {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
}
.option-feedback p { margin: 2px 0 0; color: var(--ink); font-size: 14px; line-height: 1.55; }
.option-feedback.is-correct { border-color: var(--success-line); background: var(--success-soft); }
.option-feedback.is-correct .feedback-letter { border-color: var(--success); background: var(--success); color: #fff; }
.option-feedback.is-selected-wrong { border-color: var(--danger-line); background: var(--danger-soft); }
.option-feedback.is-selected-wrong .feedback-letter { border-color: var(--danger); background: var(--danger); color: #fff; }
.feedback-tag { display: inline; margin-right: 4px; color: var(--success); font-weight: 700; }
.is-selected-wrong .feedback-tag { color: var(--danger); }
.source-link { display: inline-flex; margin-top: 16px; color: var(--blue); font-size: 14px; font-weight: 700; text-decoration: none; }
.source-link:hover { text-decoration: underline; }
.question-nav { max-width: 900px; margin: 16px auto 0; display: flex; justify-content: space-between; gap: 10px; }

/* Completion */
.complete-card {
  max-width: 620px;
  margin: 40px auto 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.complete-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 15px;
  border-radius: 11px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
}
.complete-card h1 { margin: 0; font-size: 26px; line-height: 1.3; }
.complete-card .lead { margin: 10px auto 0; }
.complete-actions { display: flex; gap: 9px; justify-content: center; margin-top: 22px; }

/* Rewards */

/* Feedbacksystem */
.feedback-submit-modal{
  width:min(560px,100%);max-height:min(760px,92vh);overflow:auto;padding:22px;border:1px solid var(--line);
  border-radius:15px;background:var(--surface);box-shadow:0 18px 60px rgba(0,0,0,.18)
}
.feedback-submit-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}
.feedback-submit-head h2{margin:2px 0 0;color:var(--ink);font-size:22px}
.feedback-context{
  margin:13px 0 17px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;
  background:var(--surface-hover);color:var(--muted);font-size:12px;line-height:1.45
}
.feedback-field{display:grid;gap:7px;margin-bottom:14px}
.feedback-field>span{color:var(--ink);font-size:12px;font-weight:700}
.feedback-field select,.feedback-field textarea{
  width:100%;border:1px solid var(--line);border-radius:11px;background:var(--input-bg,var(--surface));
  color:var(--ink);font:14px/1.5 Arial,Helvetica,sans-serif;outline:0
}
.feedback-field select{min-height:42px;padding:0 11px}
.feedback-field textarea{min-height:132px;padding:11px 12px;resize:vertical}
.feedback-field select:focus,.feedback-field textarea:focus{border-color:var(--blue)}
.feedback-form-meta{display:flex;justify-content:space-between;gap:15px;color:var(--muted);font-size:11px;line-height:1.4}
.feedback-form-meta strong{color:var(--ink)}
.feedback-submit-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:8px}
.feedback-submit-actions .button{min-width:130px}
@media(max-width:620px){
  .question-feedback-button{font-size:10px;padding:0 7px}
  .open-question-top .question-feedback-button{width:30px;padding:0;font-size:0}
  .open-question-top .question-feedback-button::before{content:"✎";font-size:14px}
  .feedback-submit-modal{padding:17px}
  .feedback-form-meta{display:block}
  .feedback-form-meta span:last-child{display:block;margin-top:5px}
  .feedback-submit-actions{flex-direction:column-reverse}
  .feedback-submit-actions .button{width:100%}
}

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(24,33,49,.26); }
.drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(500px,100%);
  height: 100%;
  padding: 24px;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.drawer-head h2 { margin: 0; font-size: 23px; }
.drawer-intro { margin: 15px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.reward-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reward-card { min-height: 76px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; align-items: center; gap: 10px; }
.reward-card.locked { opacity: .46; }
.reward-icon { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; font-size: 20px; }
.reward-card strong { font-size: 14px; }
.reward-card span:last-child { color: var(--muted); font-size: 12px; }
.modal-backdrop { display: grid; place-items: center; padding: 20px; }
.reward-modal { width: min(400px,100%); padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.reward-spark { display: none; }
.object-preview { width: 76px; height: 76px; margin: 0 auto 15px; border: 1px solid var(--line); border-radius: 14px; display: grid; place-items: center; font-size: 38px; }
.reward-modal h2 { margin: 0 0 7px; font-size: 22px; }
.reward-modal > p:not(.kicker) { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 120; transform: translateX(-50%); padding: 10px 14px; border-radius: 10px; background: var(--inverse-bg); color: var(--inverse-ink); font-size: 14px; font-weight: 700; }

@media (max-width: 820px) {
  .auth-grid { grid-template-columns: 1fr; gap: 34px; padding: 38px 0; }
  .auth-card { max-width: 520px; }
  .page-head { grid-template-columns: 1fr; gap: 20px; }
  .overall-card { max-width: 420px; }
  .topic-grid, .mode-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .auth-view { padding: 18px; }
  .auth-grid { padding: 34px 0; }
  .auth-intro h1 { font-size: 28px; line-height: 1.28; }
  .auth-metrics { gap: 20px; }
  .auth-card { padding: 18px; }
  .app-header { height: 62px; }
  .header-inner { padding: 0 12px; }
  .brand { font-size: 16px; }
  .hide-mobile, .user-copy { display: none; }
  .user-pill { padding: 4px; }
  .header-actions { gap: 5px; }
  .header-pill { padding: 0 8px; }
  .app-main { padding: 28px 12px 64px; }
  .page-head h1, .mode-head h1 { font-size: 24px; }
  .page-head { margin-bottom: 22px; }
  .topic-card { min-height: 120px; padding: 14px; grid-template-columns: 36px 1fr auto; }
  .topic-card h2 { font-size: 16px; }
  .topic-status { gap: 8px; flex-wrap: wrap; }
  .topic-mini-progress { flex-basis: 100%; }
  .mode-head { margin: 27px 0 21px; }
  .mode-card { min-height: 142px; padding: 15px; grid-template-columns: 40px 1fr auto; }
  .mode-copy strong { font-size: 17px; }
  .question-toolbar { grid-template-columns: 1fr auto; }
  .question-toolbar-center { display: none; }
  .question-progress { margin-bottom: 20px; }
  .question-heading { margin-bottom: 19px; }
  .question-heading h1 { font-size: 21px; line-height: 1.45; }
  .option { min-height: 60px; padding: 11px 12px; grid-template-columns: 34px 1fr; gap: 11px; }
  .option-text { font-size: 16px; line-height: 1.42; }
  .feedback-panel { padding: 15px; }
  .feedback-result { grid-template-columns: 1fr; gap: 10px; }
  .result-badge { width: max-content; }
  .feedback-result h2 { font-size: 17px; }
  .feedback-result p { font-size: 14px; }
  .option-feedback { grid-template-columns: 32px 1fr; gap: 10px; padding: 10px; }
  .question-nav { flex-direction: column-reverse; }
  .question-nav .button { width: 100%; }
  .complete-card { margin-top: 28px; padding: 22px 16px; }
  .complete-card h1 { font-size: 23px; }
  .complete-actions { flex-direction: column; }
  .reward-grid { grid-template-columns: 1fr; }
}

/* Learning type selection */
.learning-type-card { min-height: 164px; }
.learning-type-card .mode-icon { letter-spacing: -.02em; }

/* Open questions */
.view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.view-switch-button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.view-switch-button.active { background: var(--blue); color: #fff; }
.open-bulk-actions { display: flex; align-items: center; gap: 16px; }
.open-single-status {
  max-width: 900px;
  margin: -7px auto 11px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}
.open-single-status strong { color: var(--ink); font-size: 15px; }
.open-single-nav {
  max-width: 900px;
  margin: 14px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.open-toolbar {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.open-toolbar-actions { display: flex; align-items: center; gap: 16px; }
.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.text-button:hover { text-decoration: underline; }
.open-head {
  max-width: 900px;
  margin: 31px auto 23px;
}
.open-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -.01em;
  font-weight: 700;
}
.open-question-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.open-question {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color .12s ease;
}
.open-question.is-open { border-color: var(--open-active-line); }
.open-question--single { min-height: 220px; }
.open-question--single .open-question-top { padding-top: 21px; }
.open-question--single .open-question-copy h2 { font-size: 20px; line-height: 1.52; }
.open-question-top {
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) auto;
  gap: 13px;
  align-items: start;
  padding: 17px 17px 11px;
}
.open-number {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--surface);
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}
.open-question-copy { min-width: 0; }
.open-area {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}
.open-question-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
}
.open-toggle {
  width: calc(100% - 66px);
  min-height: 39px;
  margin: 0 17px 15px 49px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  color: var(--blue);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.open-toggle:hover span:first-child { text-decoration: underline; }
.open-toggle-icon {
  width: 26px;
  height: 26px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 18px;
  line-height: 1;
  text-decoration: none !important;
}
.open-answer {
  margin: -1px 17px 17px 49px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--blue-soft);
}
.open-answer-label {
  margin: 0 0 6px !important;
  color: var(--blue) !important;
  font-size: 12px !important;
  font-weight: 700;
}
.open-answer p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.62;
}

@media (max-width: 620px) {
  .learning-type-card { min-height: 150px; }
  .open-toolbar { align-items: flex-start; }
  .open-toolbar-actions { gap: 10px; flex-direction: column; align-items: flex-end; }
  .open-bulk-actions { gap: 10px; flex-direction: column; align-items: flex-end; }
  .view-switch-button { padding: 0 8px; font-size: 12px; }
  .text-button { font-size: 13px; }
  .open-head { margin: 27px auto 20px; }
  .open-head h1 { font-size: 24px; }
  .open-question-top { grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; padding: 14px 12px 10px; }
  .open-question-copy h2 { font-size: 17px; line-height: 1.48; }
  .open-area { font-size: 11px; }
  .open-toggle { width: calc(100% - 58px); margin: 0 12px 13px 46px; font-size: 13px; }
  .open-answer { margin: -1px 12px 14px 46px; padding: 13px; }
  .open-answer p { font-size: 15px; line-height: 1.58; }
  .open-question--single { min-height: 190px; }
  .open-question--single .open-question-copy h2 { font-size: 18px; }
  .open-single-nav { flex-direction: column-reverse; }
  .open-single-nav .button { width: 100%; }
}

.open-answer p { white-space: pre-line; }

/* Alpha access, privacy and auxiliary learning content */
.header-text-link {
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.header-text-link:hover { color: var(--blue); }
.header-feedback-link{display:inline-flex;align-items:center;gap:5px}

.privacy-note {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.privacy-note strong { color: var(--ink); }
.terms-check {
  display: grid !important;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 9px !important;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-hover);
  cursor: pointer;
}
.terms-check input {
  width: 16px !important;
  height: 16px !important;
  min-height: 0 !important;
  margin: 3px 0 0;
  padding: 0 !important;
  accent-color: var(--blue);
}
.terms-check > span {
  color: var(--muted);
  font-size: 12px !important;
  line-height: 1.5;
  font-weight: 400 !important;
}
.privacy-mini { margin: -4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 0 24px;
  color: var(--muted);
  font-size: 12px;
}
.auth-footer a { color: var(--muted); text-decoration: none; }
.auth-footer a:hover { color: var(--blue); text-decoration: underline; }
.app-footer {
  max-width: 1040px;
  margin: -42px auto 0;
  padding: 0 20px 28px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--blue); text-decoration: underline; }

.gate-page, .legal-page {
  min-height: 100vh;
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.gate-topbar, .legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 64px;
}
.gate-card {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.gate-card h1, .legal-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.25;
}
.gate-disclaimer {
  margin: 16px 0 22px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}
.gate-form { display: flex; flex-direction: column; gap: 14px; }
.gate-form label { display: flex; flex-direction: column; gap: 7px; }
.gate-form label > span { font-size: 14px; font-weight: 700; }
.gate-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
}
.gate-form input:focus { border-color: var(--blue); outline: 0; }
.gate-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}
.gate-footer a { color: var(--muted); }

.extras-head { max-width: 720px; margin: 28px 0 34px; }
.extras-head h1 { margin: 0; font-size: 28px; line-height: 1.25; }
.extras-section { margin-top: 34px; }
.extras-section-head { margin-bottom: 14px; }
.extras-section-head h2 { margin: 0 0 4px; font-size: 19px; line-height: 1.35; }
.extras-section-head p { margin: 0; color: var(--muted); font-size: 14px; }
.extras-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; max-width: 760px; }
.extras-grid--cases { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 100%; }
.extra-card {
  min-height: 82px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .14s ease, background .14s ease;
}
.extra-card:hover { border-color: var(--blue); background: var(--surface-hover); }
.extra-index {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}
.extra-card span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.extra-card strong { font-size: 15px; line-height: 1.35; }
.extra-card small { color: var(--muted); font-size: 12px; }
.extra-card b { color: var(--blue); font-size: 17px; }
.extra-card--game { max-width: 520px; }

.legal-page { max-width: 860px; }
.legal-topbar { margin-bottom: 34px; }
.legal-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.legal-card h2 { margin: 30px 0 8px; font-size: 18px; line-height: 1.4; }
.legal-card p, .legal-card li { color: var(--ink); font-size: 15px; line-height: 1.65; }
.legal-card ul { padding-left: 22px; }
.legal-warning {
  margin: 20px 0 8px;
  padding: 13px 14px;
  border: 1px solid var(--danger-line);
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}
.legal-card code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; }
.legal-footnote { margin-top: 36px !important; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted) !important; font-size: 12px !important; }

@media (max-width: 820px) {
  .extras-grid--cases { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .header-text-link { padding: 0 5px; font-size: 12px; }
  .app-footer { margin-top: -34px; padding: 0 12px 20px; flex-direction: column; gap: 4px; }
  .gate-page, .legal-page { padding: 18px 12px 40px; }
  .gate-topbar, .legal-topbar { margin-bottom: 34px; }
  .gate-card, .legal-card { padding: 19px 16px; }
  .gate-card h1, .legal-card h1 { font-size: 24px; }
  .gate-footer { flex-direction: column; gap: 6px; }
  .extras-head h1 { font-size: 24px; }
  .extra-card { min-height: 74px; }
}
