/* Fachenglisch Rechnungswesen – ruhiges, klares Design:
   weißer Hintergrund, feine Linien, eine Akzentfarbe (Marineblau), kaum Rundungen. */
:root {
  --ink: #14181f;
  --muted: #5b6472;
  --faint: #8a93a0;
  --line: #e2e5e9;
  --line-strong: #c9ced5;
  --bg: #ffffff;
  --soft: #f6f7f8;
  --accent: #1d3557;
  --accent-hover: #142640;
  --accent-soft: #eaf0f8;
  --warm: #d9822b;
  --warm-hover: #bf6f1f;
  --tint: #f4f7fb;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.06);
  --ok: #1e7a46;  --ok-bg: #f0f7f2;
  --warn: #8a5a00; --warn-bg: #fbf6ea;
  --bad: #a3271f;  --bad-bg: #fbf0ef;
  --radius: 6px;
  /* Fächer: Abstufung von Grau zu Marineblau */
  --box1: #c6d5ea; --box2: #9bb6dc; --box3: #6e95c8; --box4: #4a75ad; --box5: #2f5a8f; --box6: #1d3557;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 32px 16px 56px; outline: none; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; margin: 1.5em 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 1.02rem; margin: 0 0 .25em; font-weight: 650; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

/* Kopfzeile */
.topbar {
  background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; gap: 12px; flex-wrap: wrap;
}
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-mark {
  background: var(--accent); color: #fff; font-weight: 700; border-radius: 5px; width: 32px; height: 32px; box-shadow: inset 0 -3px 0 var(--warm);
  display: grid; place-items: center; font-size: .82rem; letter-spacing: .5px;
}
.brand-text { font-size: 1.02rem; }
#nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
#nav a, #nav button:not(.lang-switch button) {
  color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: var(--radius); background: none; border: 0;
  font: inherit; cursor: pointer;
}
#nav a:hover { background: var(--soft); }
#nav a.active { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
#nav a.btn { color: #fff; background: var(--accent); }
#nav a.btn:hover { background: var(--accent-hover); }
#nav a.btn-accent { background: var(--warm); border-color: var(--warm); }
#nav a.btn-accent:hover { background: var(--warm-hover); border-color: var(--warm-hover); }

/* Sprachumschalter */
.lang-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); margin-left: 8px; overflow: hidden; }
.lang-switch button {
  background: var(--bg); color: var(--muted); border: 0; font: inherit; font-size: .8rem; font-weight: 600; padding: 4px 9px; cursor: pointer;
}
.lang-switch button + button { border-left: 1px solid var(--line-strong); }
.lang-switch button.on { background: var(--accent); color: #fff; }
.lang-switch button:not(.on):hover { background: var(--soft); color: var(--ink); }

.footer {
  border-top: 1px solid var(--line); padding: 18px 16px; font-size: .85rem; color: var(--muted);
  display: flex; gap: 12px 24px; justify-content: space-between; flex-wrap: wrap;
}
.footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

/* Bausteine */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius); border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  min-height: 44px; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-accent { background: var(--warm); border-color: var(--warm); color: #fff; }
.btn-accent:hover { background: var(--warm-hover); border-color: var(--warm-hover); }
.btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--soft); border-color: var(--faint); }
.btn-ok { background: var(--ok); border-color: var(--ok); } .btn-ok:hover { background: #17623a; border-color: #17623a; }
.btn-bad { background: var(--bad); border-color: var(--bad); } .btn-bad:hover { background: #861f19; border-color: #861f19; }
.btn-lg { padding: 13px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit;
  background: var(--bg); color: var(--ink); min-height: 44px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,53,87,.12); }
.btn:focus-visible, .lang-switch button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.form { max-width: 440px; margin: 0 auto; }
.form .field { margin-bottom: 14px; }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .name-row { grid-template-columns: 1fr; } }
.error { color: var(--bad); background: var(--bad-bg); border-left: 4px solid var(--bad); padding: 10px 12px; margin-bottom: 14px; border-radius: 0 var(--radius) var(--radius) 0; }
.notice { background: var(--warn-bg); border-left: 4px solid #d9a441; padding: 12px 14px; border-radius: 0 var(--radius) var(--radius) 0; }
.success { background: var(--ok-bg); border-left: 4px solid var(--ok); padding: 12px 14px; border-radius: 0 var(--radius) var(--radius) 0; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); background: var(--tint); color: var(--muted); letter-spacing: .02em; }
.badge-accent { border-color: #f1d3b3; background: #fdf3e8; color: #a85d16; }

/* Übersicht */
.stat { font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 140px; margin-top: 8px; }
.boxcol { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.boxbar { width: 100%; border-radius: 4px 4px 1px 1px; min-height: 3px; }
.boxlabel { font-size: .75rem; color: var(--muted); text-align: center; }
.boxnum { font-size: .8rem; font-weight: 700; }
.b0 { background: #e6e9ed; } .b1 { background: var(--box1); } .b2 { background: var(--box2); } .b3 { background: var(--box3); }
.b4 { background: var(--box4); } .b5 { background: var(--box5); } .b6 { background: var(--box6); }

/* Bücher und Kapitel */
.book { padding: 0; overflow: hidden; }
.book > summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; gap: 14px; align-items: center; }
.book > summary::-webkit-details-marker { display: none; }
.book > summary:hover { background: var(--soft); }
.book[open] > summary { border-bottom: 1px solid var(--line); }
.book-cover {
  width: 40px; height: 56px; border-radius: 3px; background: var(--accent); color: #fff; display: grid; place-items: center;
  font-weight: 700; flex: none; box-shadow: inset 0 4px 0 var(--warm);
}
.chapter { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); align-items: center; }
.chapter:last-child { border-bottom: 0; }
.chapter .title-en { color: var(--muted); font-size: .9rem; }
.progress { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #edf0f2; margin-top: 6px; }
.progress span { display: block; height: 100%; }
.chapter-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chapter-actions .btn { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
@media (max-width: 560px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter-actions { justify-content: flex-start; }
}

/* Lernen */
.learn { max-width: 640px; margin: 0 auto; }
.learn-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.learn-progress { flex: 1; height: 6px; background: #edf0f2; overflow: hidden; border-radius: 3px; }
.learn-progress span { display: block; height: 100%; background: var(--warm); transition: width .3s; }
.flash { text-align: center; padding: 32px 24px; }
.flash .meta { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.prompt { font-size: clamp(1.4rem, 4.5vw, 2rem); font-weight: 650; margin: 8px 0 22px; overflow-wrap: anywhere; letter-spacing: -.01em; }
.answer-input { font-size: 1.15rem !important; text-align: center; }
.result { padding: 14px 16px; margin: 18px 0 8px; text-align: left; border-left: 4px solid var(--line-strong); background: var(--soft); border-radius: 0 var(--radius) var(--radius) 0; }
.result.correct { background: var(--ok-bg); border-left-color: var(--ok); }
.result.typo { background: var(--warn-bg); border-left-color: #c79a2e; }
.result.wrong { background: var(--bad-bg); border-left-color: var(--bad); }
.result .verdict { font-weight: 700; margin-bottom: 4px; }
.result.correct .verdict { color: var(--ok); } .result.typo .verdict { color: var(--warn); } .result.wrong .verdict { color: var(--bad); }
.solution { font-size: 1.3rem; font-weight: 650; }
.given { text-decoration: line-through; color: var(--muted); }
.details { text-align: left; margin-top: 18px; font-size: .95rem; border-top: 1px solid var(--line); padding-top: 14px; }
.details ul { padding-left: 1.2em; margin: 6px 0 12px; }
.details li { margin-bottom: 4px; }
mark { background: #fbe9d5; color: inherit; padding: 0 2px; }
.kbd { font-size: .75rem; color: var(--faint); margin-top: 6px; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* Rechtstexte */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.1rem; }
.draft { border-left: 3px solid #c79a2e; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120%); opacity: 0;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--radius); transition: .25s; max-width: calc(100% - 32px);
}
#toast.show { transform: translateX(-50%); opacity: 1; }

/* Buchcover (Startseite) */
.covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.book-card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 20px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--bg); }
.book-card .cover { width: 140px; aspect-ratio: 170 / 244; display: block; margin-bottom: 16px; }
.book-card .cover img, .book-card .cover .cover-css { width: 100%; height: 100%; border-radius: 2px 4px 4px 2px; box-shadow: 3px 6px 16px rgba(20,24,31,.22); object-fit: cover; display: block; }
.book-card a.cover[href]:hover img, .book-card a.cover[href]:hover .cover-css { transform: translateY(-2px); transition: transform .15s; }
.book-info { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; width: 100%; }
.book-info h3 { font-size: 1rem; overflow-wrap: anywhere; hyphens: auto; }
.book-info p { flex: 1; margin-bottom: 14px; hyphens: auto; }
.book-info .btn { min-height: 38px; padding: 7px 14px; font-size: .88rem; }
.band-no { font-size: .75rem; font-weight: 700; color: var(--warm); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.btn-amazon { background: var(--ink); border-color: var(--ink); }
.btn-amazon:hover { background: #000; border-color: #000; }
.btn-soon { cursor: default; color: var(--faint); }
.btn-soon:hover { background: var(--bg); border-color: var(--line-strong); }
.cover-css {
  background: #1b2433; color: #fff; padding: 10% 10% 8%; display: flex; flex-direction: column; position: relative; overflow: hidden;
  font-size: 9px; line-height: 1.25; text-align: left; border-top: 4px solid var(--accent-line, var(--accent));
}
.cover-series { font-size: 1.15em; letter-spacing: .02em; }
.cover-series b { font-size: 1.15em; }
.cover-series span { display: block; opacity: .7; font-size: .85em; margin-top: 2px; }
.cover-band { font-size: 5em; font-weight: 700; line-height: 1; margin-top: auto; color: #fff; }
.cover-title { font-weight: 700; font-size: 1.2em; margin-top: 3px; overflow-wrap: anywhere; hyphens: auto; }
.cover-tag { opacity: .7; font-size: .9em; margin-top: 3px; }
.cover-author { margin-top: 10%; font-size: .9em; opacity: .8; border-top: 1px solid rgba(255,255,255,.2); padding-top: 4px; }

@media (max-width: 860px) { .covers { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .covers { grid-template-columns: 1fr; } }

/* Kennzeichnung der Entwicklungsumgebung */
.env-badge { position: fixed; left: 12px; bottom: 12px; z-index: 50; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 2px; pointer-events: none; letter-spacing: .02em; }
