:root {
 --bg: #e7ece8;
 --panel: #ffffff;
 --grid: #cfd7d2;
 --grid-dark: #aeb9b2;
 --text: #1f2923;
 --muted: #65736a;
 --excel: #217346;
 --excel-dark: #185c37;
 --excel-soft: #e7f2eb;
 --row-hover: #f4f8f5;
 --wrong: #9b2f2f;
 --wrong-soft: #f8e7e7;
 --correct: #176b3a;
 --correct-soft: #e3f3e8;
 --shadow: 0 12px 35px rgba(28, 53, 39, 0.12);
}

* { box-sizing: border-box; }
html { color-scheme: light; }

body {
 margin: 0;
 min-width: 320px;
 background:
  liat-gradient(rgba(255,255,255,.55), rgba(255,255,255,.55)),
  repeating-liat-gradient(0deg, transparent 0 27px, rgba(78,104,88,.06) 27px 28px),
  var(--bg);
 color: var(--text);
 font-family: Arial, Helvetica, sans-serif;
 font-size: 15px;
}

button { font: inherit; }

.workbook {
 width: min(1080px, calc(100% - 32px));
 margin: 24px auto;
 overflow: hidden;
 background: var(--panel);
 border: 1px solid var(--grid-dark);
 box-shadow: var(--shadow);
}

.appbar {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 20px;
 min-height: 70px;
 padding: 12px 18px;
 background: var(--excel-dark);
 color: white;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
 display: grid;
 place-items: center;
 width: 42px;
 height: 42px;
 border: 1px solid rgba(255,255,255,.5);
 background: rgba(255,255,255,.12);
 font-weight: 700;
 letter-spacing: .04em;
}
.brand div { display: grid; gap: 2px; }
.brand strong { font-size: 17px; letter-spacing: .01em; }
.brand span:not(.brand-mark) { font-size: 12px; opacity: .78; }

.app-status { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: .9; }

.app-actions {
 display: flex;
 align-items: center;
 gap: 14px;
 margin-left: auto;
}
@media (max-width: 720px) {
 .appbar { align-items: flex-start; flex-direction: column; }
 .app-actions { width: 100%; justify-content: space-between; gap: 10px; }
}

.feedback-link {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 min-height: 34px;
 padding: 8px 12px;
 border: 1px solid rgba(255,255,255,.45);
 background: rgba(255,255,255,.12);
 color: #fff;
 text-decoration: none;
 font-size: 13px;
 font-weight: 700;
 white-space: nowrap;
}
.feedback-link:hover,
.feedback-link:focus-visible {
 background: rgba(255,255,255,.22);
 text-decoration: none;
}
@media (max-width: 640px) {
 .feedback-link {
  width: 100%;
  margin-top: 8px;
 }
}


.appbar > .visit-counter,
.header-actions > .visit-counter,
.contact-actions > .visit-counter,
.visit-counter {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 min-height: 28px;
 padding: 5px 9px;
 border: 1px solid rgba(255,255,255,.32);
 background: rgba(255,255,255,.08);
 color: #fff;
 font-size: 12px;
 font-weight: 700;
 white-space: nowrap;
}
.session-score-label { white-space: nowrap; }
@media (max-width: 460px) {
 .session-score-label { width: 100%; text-align: center; }
}

.status-dot {
 width: 8px;
 height: 8px;
 border-radius: 50%;
 background: #9ee6b8;
 box-shadow: 0 0 0 3px rgba(158,230,184,.16);
}

.toolbar {
 display: flex;
 align-items: flex-end;
 justify-content: space-between;
 gap: 18px;
 min-height: 56px;
 padding: 10px 14px 0;
 background: #f5f6f5;
 border-bottom: 1px solid var(--grid-dark);
}
.file-label { align-self: center; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sheet-tab {
 min-width: 130px;
 padding: 10px 14px 9px;
 border: 1px solid var(--grid);
 border-bottom: 0;
 background: white;
 color: var(--excel-dark);
 box-shadow: inset 0 3px 0 var(--excel);
 text-align: center;
 font-size: 13px;
 font-weight: 700;
}

.formula-bar {
 display: grid;
 grid-template-columns: 70px 42px 1fr;
 min-height: 38px;
 background: #fbfcfb;
 border-bottom: 1px solid var(--grid-dark);
 color: #536057;
 font-size: 13px;
}
.formula-bar > span {
 display: flex;
 align-items: center;
 padding: 0 10px;
 border-right: 1px solid var(--grid);
}
.name-box, .fx { justify-content: center; }
.fx { font-style: italic; font-weight: 700; }
.formula-text { overflow: hidden; font-family: Consolas, "Courier New", monospace; white-space: nowrap; text-overflow: ellipsis; }

.sheet-stage { padding: 20px; background: #eef2ef; }
.sheet { background: white; border: 1px solid var(--grid-dark); }

.sheet-heading {
 display: flex;
 justify-content: space-between;
 align-items: end;
 gap: 24px;
 padding: 22px 24px 18px;
 border-bottom: 1px solid var(--grid-dark);
}
.eyebrow {
 display: block;
 margin-bottom: 5px;
 color: var(--excel);
 font-size: 11px;
 font-weight: 700;
 letter-spacing: .12em;
 text-transform: uppercase;
}
.sheet-heading h1 { margin: 0; font-size: clamp(21px, 3vw, 30px); line-height: 1.15; }
.sheet-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sheet-meta span {
 padding: 6px 9px;
 border: 1px solid var(--grid);
 background: #f5f7f5;
 color: var(--muted);
 font-size: 11px;
}

.grid-header, .question-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 160px; }
.grid-header {
 min-height: 34px;
 background: #e9edea;
 border-bottom: 1px solid var(--grid-dark);
 color: #4b574f;
 font-size: 11px;
 font-weight: 700;
 text-transform: uppercase;
 letter-spacing: .05em;
}
.grid-header div { display: flex; align-items: center; padding: 0 11px; border-right: 1px solid var(--grid-dark); }
.grid-header div:last-child { border-right: 0; }

.question-row { min-height: 420px; background: white; }
.cell { min-width: 0; border-right: 1px solid var(--grid); }
.cell:last-child { border-right: 0; }
.number-cell {
 display: grid;
 place-items: start center;
 padding: 24px 6px;
 background: #f1f4f2;
 color: #68756d;
 font-family: Consolas, "Courier New", monospace;
 font-weight: 700;
}
.question-cell { padding: 30px clamp(20px, 5vw, 54px) 34px; }
.category {
 margin-bottom: 9px;
 color: var(--excel);
 font-size: 11px;
 font-weight: 700;
 letter-spacing: .09em;
 text-transform: uppercase;
}
.question-cell h2 { margin: 0 0 26px; font-size: clamp(22px, 3.5vw, 34px); line-height: 1.25; }

.options { display: grid; gap: 11px; }
.option-button {
 display: grid;
 grid-template-columns: 42px 1fr;
 align-items: center;
 width: 100%;
 min-height: 58px;
 padding: 0;
 overflow: hidden;
 border: 1px solid var(--grid-dark);
 background: white;
 color: var(--text);
 cursor: pointer;
 text-align: left;
 transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.option-button:hover:not(:disabled) { border-color: var(--excel); background: #f7faf8; transform: translateY(-1px); }
.option-button:focus-visible { outline: 3px solid rgba(33,115,70,.28); outline-offset: 2px; }
.option-button:disabled { cursor: default; }
.option-letter {
 display: grid;
 align-self: stretch;
 place-items: center;
 border-right: 1px solid var(--grid);
 background: #eef2ef;
 color: #4e5b52;
 font-weight: 700;
}
.option-text { padding: 14px 16px; font-size: 16px; }
.option-button.is-correct { border-color: var(--correct); background: var(--correct-soft); }
.option-button.is-correct .option-letter { border-color: var(--correct); background: var(--correct); color: white; }
.option-button.is-wrong { border-color: var(--wrong); background: var(--wrong-soft); }
.option-button.is-wrong .option-letter { border-color: var(--wrong); background: var(--wrong); color: white; }

.feedback {
 margin-top: 20px;
 padding: 14px 16px;
 border-left: 4px solid var(--excel);
 background: var(--excel-soft);
 line-height: 1.55;
}
.feedback strong { display: block; margin-bottom: 3px; }

.action-cell { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 24px 16px; background: #fafbfa; }
.status-box {
 padding: 9px 10px;
 border: 1px solid var(--grid);
 background: #f0f3f1;
 color: var(--muted);
 text-align: center;
 font-size: 12px;
 font-weight: 700;
 text-transform: uppercase;
}
.status-correct { border-color: #9fc9ae; background: var(--correct-soft); color: var(--correct); }
.status-wrong { border-color: #d4a3a3; background: var(--wrong-soft); color: var(--wrong); }
.next-button, .restart-button {
 min-height: 42px;
 padding: 10px 14px;
 border: 1px solid var(--excel-dark);
 background: var(--excel);
 color: white;
 cursor: pointer;
 font-weight: 700;
}
.next-button:hover, .restart-button:hover { background: var(--excel-dark); }
.next-button:focus-visible, .restart-button:focus-visible { outline: 3px solid rgba(33,115,70,.28); outline-offset: 2px; }

.result-panel { min-height: 420px; padding: 65px 24px; text-align: center; }
.result-label { display: block; margin-bottom: 12px; color: var(--excel); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.result-panel strong { display: block; font-size: clamp(30px, 6vw, 58px); line-height: 1.1; }
.result-panel p { max-width: 570px; margin: 18px auto 26px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.restart-button { min-width: 190px; }

.sheet-footer {
 display: flex;
 justify-content: space-between;
 gap: 16px;
 padding: 10px 14px;
 border-top: 1px solid var(--grid-dark);
 background: #f1f4f2;
 color: var(--muted);
 font-size: 11px;
}

.noscript {
 width: min(1080px, calc(100% - 32px));
 margin: 16px auto;
 padding: 14px;
 border: 1px solid #d4a3a3;
 background: var(--wrong-soft);
 color: var(--wrong);
}

[hidden] { display: none !important; }

@media (max-width: 720px) {
 body {
  min-width: 0;
  background: #eef2ef;
  font-size: 16px;
 }

 .workbook {
  width: 100%;
  margin: 0;
  border: 0;
  box-shadow: none;
 }

 .appbar {
  min-height: 62px;
  padding: 10px 14px;
 }

 .brand {
  min-width: 0;
 }

 .brand-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
 }

 .brand div {
  min-width: 0;
 }

 .brand strong,
 .brand span:not(.brand-mark) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
 }

 .app-status,
 .file-label {
  display: none;
 }

 .toolbar {
  min-height: 48px;
  padding: 8px 10px 0;
  justify-content: flex-end;
 }

 .sheet-tab {
  min-width: 140px;
  padding: 10px 14px 9px;
 }

 .formula-bar {
  grid-template-columns: 52px 38px minmax(0, 1fr);
  min-height: 36px;
 }

 .formula-bar > span {
  padding: 0 8px;
 }

 .sheet-stage {
  padding: 8px;
 }

 .sheet {
  border-color: var(--grid);
 }

 .sheet-heading {
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px 15px;
 }

 .sheet-heading h1 {
  font-size: 24px;
 }

 .sheet-meta {
  width: 100%;
  justify-content: flex-start;
 }

 .sheet-meta span {
  flex: 1 1 auto;
  text-align: center;
 }

 .grid-header {
  display: none;
 }

 .question-row {
  display: block;
  min-height: 0;
 }

 .number-cell {
  display: inline-flex;
  place-items: unset;
  margin: 14px 16px 0;
  padding: 5px 8px;
  border: 1px solid var(--grid);
  border-radius: 3px;
  background: #f1f4f2;
 }

 .question-cell {
  padding: 16px 16px 20px;
  border-right: 0;
 }

 .question-cell h2 {
  margin-bottom: 20px;
  font-size: 24px;
  line-height: 1.28;
 }

 .options {
  gap: 10px;
 }

 .option-button {
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 60px;
  border-radius: 3px;
  touch-action: manipulation;
 }

 .option-button:hover:not(:disabled) {
  transform: none;
 }

 .option-text {
  padding: 15px 14px;
  font-size: 16px;
  line-height: 1.35;
 }

 .feedback {
  margin-top: 16px;
  padding: 13px 14px;
 }

 .action-cell {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--grid);
  border-right: 0;
 }

 .status-box,
 .next-button {
  width: 100%;
  min-height: 46px;
 }

 .result-panel {
  min-height: 0;
  padding: 52px 18px;
 }

 .result-panel strong {
  font-size: 38px;
 }

 .result-panel p {
  font-size: 16px;
 }

 .restart-button {
  width: 100%;
  min-height: 48px;
 }

 .sheet-footer {
  flex-direction: column;
  gap: 5px;
  padding: 11px 14px;
  line-height: 1.4;
 }

 .noscript {
  width: calc(100% - 16px);
  margin: 8px;
 }
}

@media (max-width: 460px) {
 .appbar {
  padding: 9px 12px;
 }

 .brand-mark {
  width: 36px;
  height: 36px;
 }

 .brand strong {
  font-size: 16px;
 }

 .brand span:not(.brand-mark) {
  font-size: 11px;
 }

 .formula-bar {
  grid-template-columns: 46px 34px minmax(0, 1fr);
  font-size: 12px;
 }

 .sheet-stage {
  padding: 6px;
 }

 .sheet-heading {
  padding: 16px 14px 14px;
 }

 .sheet-heading h1 {
  font-size: 22px;
 }

 .number-cell {
  margin-left: 14px;
 }

 .question-cell {
  padding: 14px 14px 18px;
 }

 .question-cell h2 {
  font-size: 22px;
 }

 .option-button {
  grid-template-columns: 40px minmax(0, 1fr);
 }

 .option-text {
  padding: 14px 12px;
  font-size: 15px;
 }

 .action-cell {
  padding: 12px 14px 14px;
 }
}


/* Shared topic navigation for all quiz areas */
.quiz-tabs {
 display: flex;
 align-items: flex-end;
 gap: 6px;
 min-width: 0;
}
.quiz-tabs .sheet-tab {
 display: block;
 min-width: 108px;
 margin: 0;
 text-decoration: none;
 white-space: nowrap;
 transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.quiz-tabs .sheet-tab:not(.is-active) {
 background: #edf2ef;
 color: #536057;
 box-shadow: inset 0 3px 0 transparent;
}
.quiz-tabs .sheet-tab:hover:not(.is-active) {
 border-color: #aeb9b2;
 background: #e2ece6;
 color: #185c37;
}
.quiz-tabs .sheet-tab.is-active {
 background: #ffffff;
 color: #185c37;
 box-shadow: inset 0 3px 0 #217346;
 cursor: default;
}
.quiz-tabs .sheet-tab:focus-visible {
 position: relative;
 z-index: 2;
 outline: 3px solid rgba(33, 115, 70, .28);
 outline-offset: 2px;
}
.quiz-overview {
 margin: 0 auto 24px;
 max-width: 1180px;
 padding: 0 16px;
}
.quiz-overview-inner {
 border: 1px solid #c8d0cc;
 background: rgba(255, 255, 255, .94);
 padding: 22px 24px;
}
.quiz-overview h2 {
 margin: 0 0 10px;
 color: #1b2a22;
 font-size: clamp(22px, 3vw, 30px);
 line-height: 1.2;
}
.quiz-overview p {
 margin: 0 0 14px;
 color: #4c5952;
 line-height: 1.65;
}
.quiz-overview-links {
 display: flex;
 flex-wrap: wrap;
 gap: 8px 16px;
}
.quiz-overview-links a {
 color: #185c37;
 font-weight: 700;
 text-decoration-thickness: 1px;
 text-underline-offset: 3px;
}
@media (max-width: 900px) {
 .toolbar {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
 }
 .toolbar .file-label { display: none !important; }
 .quiz-tabs {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
 }
 .quiz-tabs .sheet-tab {
  min-width: 0 !important;
  width: auto !important;
  margin: 0 !important;
  padding: 12px 4px !important;
  border-top: 0;
  white-space: normal !important;
  text-align: center;
  font-size: 12px;
  line-height: 1.15;
  box-sizing: border-box !important;
 }
 .formula-bar {
  clear: both !important;
  position: relative !important;
  z-index: 1 !important;
 }
 .quiz-overview { padding: 0 10px; }
 .quiz-overview-inner { padding: 18px; }
 .quiz-overview-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
 }
}
@media (max-width: 420px) {
 .quiz-tabs .sheet-tab { font-size: 11px; padding: 11px 2px !important; }
}


/* Offline and online fallback: topic bar as a 4 plus 4 grid on mobile devices */
@media (max-width: 900px) {
 .toolbar {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
 }
 .toolbar .file-label { display: none !important; }
 .quiz-tabs {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
 }
 .quiz-tabs .sheet-tab {
  min-width: 0 !important;
  width: auto !important;
  margin: 0 !important;
  padding: 12px 4px !important;
  border-top: 0 !important;
  white-space: normal !important;
  text-align: center !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
  box-sizing: border-box !important;
 }
}
@media (max-width: 430px) {
 .quiz-tabs .sheet-tab { font-size: 11px !important; padding: 11px 2px !important; }
}


/* Desktop-Fix Themenleiste: alle 8 Tabs sichtbar, ohne HTML-change */
@media (min-width: 901px) {
 .toolbar {
  gap: 8px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  overflow: visible !important;
 }

 .toolbar .file-label {
  flex: 0 1 190px !important;
  max-width: 190px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 11px !important;
 }

 .toolbar .quiz-tabs {
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
 }

 .toolbar .quiz-tabs .sheet-tab {
  flex: 0 1 86px !important;
  min-width: 78px !important;
  max-width: 98px !important;
  width: auto !important;
  padding: 10px 6px 9px !important;
  font-size: 12px !important;
  line-height: 1.12 !important;
  white-space: nowrap !important;
  text-align: center !important;
 }
}

@media (min-width: 901px) and (max-width: 1040px) {
 .toolbar .file-label {
  max-width: 145px !important;
  font-size: 10.5px !important;
 }

 .toolbar .quiz-tabs {
  gap: 3px !important;
 }

 .toolbar .quiz-tabs .sheet-tab {
  flex-basis: 78px !important;
  min-width: 70px !important;
  max-width: 90px !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
  font-size: 11px !important;
 }
}

@media (min-width: 901px) and (max-width: 960px) {
 .toolbar .file-label {
  display: none !important;
 }

 .toolbar {
  justify-content: stretch !important;
 }

 .toolbar .quiz-tabs {
  justify-content: stretch !important;
 }

 .toolbar .quiz-tabs .sheet-tab {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  white-space: normal !important;
 }
}

.counter-strip {
 display: flex;
 justify-content: flex-end;
 align-items: center;
 gap: 10px;
 padding: 8px 18px;
 border-bottom: 1px solid var(--grid-dark);
 background: #eef4f0;
}
.counter-strip .visit-counter {
 color: #185c37;
 border: 1px solid #b9cabf;
 background: #ffffff;
 font-size: 12px;
 font-weight: 700;
}
@media (max-width: 640px) {
 .counter-strip { justify-content: flex-start; padding: 8px 14px; }
}


.more-quiz-ideas {
 max-width: 1120px;
 margin: 18px auto 10px;
 padding: 0 16px;
}

.more-quiz-ideas-inner {
 border: 1px solid #c7d2cc;
 background: #ffffff;
 padding: 18px 22px;
 box-shadow: 0 10px 30px rgba(20, 45, 32, 0.05);
}

.more-quiz-ideas h2 {
 margin: 0 0 10px;
 color: #185c37;
 font-size: 20px;
 line-height: 1.25;
}

.more-quiz-ideas-links {
 display: flex;
 flex-wrap: wrap;
 gap: 10px 20px;
}

.more-quiz-ideas-links a {
 color: #185c37;
 font-weight: 700;
 text-decoration: underline;
 text-underline-offset: 3px;
}

@media (max-width: 640px) {
 .more-quiz-ideas-inner {
  padding: 14px 16px;
 }
 .more-quiz-ideas-links {
  flex-direction: column;
  gap: 8px;
 }
}


/* Score update, sharing, feedback and search engine text */
.daily-round-note {
 max-width: 680px;
 margin: 9px 0 0;
 color: #536057;
 font-size: 13px;
 line-height: 1.45;
}
.question-report-holder {
 margin-top: 12px;
}
.question-report-link {
 display: inline-flex;
 align-items: center;
 min-height: 34px;
 padding: 7px 10px;
 border: 1px solid #b8c8bd;
 background: #f7faf8;
 color: #185c37;
 font-size: 12px;
 font-weight: 700;
 text-decoration: none;
}
.question-report-link:hover,
.question-report-link:focus-visible {
 background: #e7f2eb;
 text-decoration: underline;
 text-underline-offset: 3px;
}
.result-actions {
 display: flex;
 justify-content: center;
 gap: 10px;
 flex-wrap: wrap;
 margin: 0 auto 16px;
}
.share-result-button {
 border: 1px solid #185c37;
 background: #fff;
 color: #185c37;
 padding: 10px 16px;
 font-weight: 700;
 cursor: pointer;
}
.share-result-button:hover,
.share-result-button:focus-visible {
 background: #e7f2eb;
}
.seo-text-block {
 max-width: 1120px;
 margin: 0 auto 18px;
 padding: 0 16px;
}
.seo-text-inner {
 border: 1px solid #d3ded7;
 background: #fbfcfb;
 padding: 18px 22px;
 color: #3f4b44;
}
.seo-text-inner h2 {
 margin: 0 0 8px;
 color: #185c37;
 font-size: 21px;
 line-height: 1.25;
}
.seo-text-inner p {
 margin: 8px 0 0;
 line-height: 1.65;
}
@media (max-width: 640px) {
 .daily-round-note { font-size: 12px; }
 .seo-text-inner { padding: 14px 16px; }
 .question-report-link { width: 100%; justify-content: center; }
}
