/* ==========================================================
   Schrift-Werkstatt – "Desk & Window" Layout
   Warmer Sand-Schreibtisch, weiße Fenster, Haarlinien statt Schatten.
   ========================================================== */

@font-face { font-family: "Inter"; src: url("../fonts/Inter-Regular/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Bold/inter-700.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Black/inter-900.woff2") format("woff2"); font-weight: 800 900; font-display: swap; }

:root {
  --fs: 1; /* globaler Schriftfaktor, wird über die Werkzeugleiste (14–22 px) gesetzt */
  /* Akzente */
  --blue: #2f80fa;
  --amber: #eb9d2a;
  --amber-dark: #cd8407;
  --gold: #b17816;
  --marigold: #f1a82c;
  --flame: #f54e00;
  --moss: #6aa84f;

  /* Neutrale */
  --ink: #23251d;
  --olive: #4d4f46;
  --sage: #65675e;
  --ash: #9ea096;
  --line: #bfc1b7;
  --desk: #e1d7c2;
  --stone: #e5e7e0;
  --linen: #eeefe9;
  --cream: #fdfdf8;
  --paper: #ffffff;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --r: 4px;
  --r-win: 6px;
  --ease: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--olive);
  font-family: var(--font);
  font-size: calc(15px * var(--fs, 1));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Illustration als Hintergrund: rechtsbündig, beginnt unter dem Kontakt-Ordner und ist
   immer so breit, dass die Zeichnung links ein Stück neben dem Hauptfenster hervorschaut
   (der transparente Bildrand liegt hinter der Ordner-Leiste; scrollt nicht mit) */
body::before {
  content: "";
  position: fixed; z-index: -1;
  top: 192px; right: 0; bottom: 0;
  left: calc(max(0px, (100vw - 1230px) / 2) + 66px);
  background: url("../img/backdrop-werkstatt.webp") right top / 100% auto no-repeat;
  pointer-events: none;
}
.win-collapsed body::before { position: absolute; bottom: auto; aspect-ratio: 1600 / 1195; }
/* … und die Fußzeile rutscht unter das Bild (Bildhöhe = Bildbreite × 1195/1600) */
.win-collapsed .desk { min-height: calc((100vw - max(0px, (100vw - 1230px) / 2) - 66px) * 0.7469 + 150px); }
@media (max-width: 760px) { .win-collapsed .desk { min-height: 0; } }
@media (max-width: 760px) { body::before { display: none; } }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: var(--r); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1230px;
  margin: 0 auto;
  padding: 12px 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
}
.brand-logo { width: 34px; height: 36px; transition: transform .3s ease; }
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.05); }
.brand-name { font-weight: 800; font-size: calc(18px * var(--fs, 1)); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font); font-weight: 600; line-height: 1.4; font-size: calc(14px * var(--fs, 1));
  padding: 6px 12px; border-radius: var(--r);
  text-decoration: none; cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.btn-amber { background: var(--amber); color: var(--ink); border: 0; }
.btn-amber:hover { background: var(--amber-dark); }
.btn-outline { background: transparent; color: var(--gold); border: 1.5px solid var(--gold); padding: 4.5px 10.5px; }
.btn-outline:hover { background: #fbf3e4; }
.btn-lg { font-size: calc(15px * var(--fs, 1)); padding: 9px 16px; }
.btn-outline.btn-lg { padding: 7.5px 14.5px; }

/* ---------- Desk-Layout ---------- */
.desk {
  display: grid;
  grid-template-columns: 92px minmax(0, 958px) 92px;
  justify-content: center;
  gap: 20px;
  max-width: 1230px;
  margin: 0 auto;
  padding: 8px 24px 32px;
  align-items: start;
}

/* Sidebar mit Datei-Icons */
.sidebar {
  position: sticky; top: 16px;
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 8px;
}
.sidebar a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px; border-radius: var(--r);
  font-size: calc(12px * var(--fs, 1)); font-weight: 600; color: var(--olive);
  text-decoration: none; text-align: center;
  transition: background var(--ease);
}
.sidebar a:hover { background: var(--stone); }
.sidebar img { width: 64px; height: auto; transition: transform var(--ease); }
.sidebar a:hover img { transform: translateY(-2px); }
.sidebar svg .fill { fill: var(--paper); transition: fill var(--ease); }
.sidebar a[aria-current="page"] svg .fill { fill: var(--blue); }
.sidebar a[aria-current="page"] span { background: var(--blue); color: #fff; border-radius: 3px; padding: 0 4px; }

/* ---------- Fenster ---------- */
.window {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-win);
  overflow: clip;
  min-width: 0;
}
.titlebar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 38px; padding: 0 12px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.titlebar .file-icon { display: flex; align-items: center; gap: 6px; font-size: calc(12px * var(--fs, 1)); color: var(--sage); }
.titlebar .file-icon svg { width: 16px; height: 16px; }
.titlebar .filename { font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--ink); }
.titlebar .controls { justify-self: end; display: flex; gap: 8px; }
/* Fensterknöpfe im Mac-Farbschema (gespiegelt: Rot sitzt außen) */
.titlebar .dot {
  position: relative; width: 12px; height: 12px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(0, 0, 0, .18);
  font: 700 9px/1 var(--font); color: rgba(0, 0, 0, .55);
}
.titlebar .dot-green { background: #28c840; }
.titlebar .dot-yellow { background: #febc2e; }
.titlebar .dot-red { background: #ff5f57; }
.titlebar .dot::before { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity var(--ease); }
.titlebar .dot-green::before { content: "+"; font-size: 11px; }
.titlebar .dot-yellow::before { content: "−"; font-size: 11px; }
.titlebar .dot-red::before { content: "×"; font-size: 11px; }
.titlebar .controls:hover .dot::before, .titlebar .dot:focus-visible::before { opacity: 1; }

/* Eingeklapptes Fenster: nur die Titelleiste bleibt stehen */
main.window { transition: height .45s cubic-bezier(.3, .7, .3, 1); }
.win-collapsed main.window { overflow: hidden; }
.win-collapsed main.window .titlebar { border-bottom-color: transparent; }
@media (prefers-reduced-motion: reduce) { main.window { transition: none; } }

/* Tabs */
.tabs {
  display: flex; gap: 2px; padding: 6px 12px 0;
  background: var(--linen);
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none;
  font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--sage);
  text-decoration: none; padding: 9px 12px 8px;
  border-radius: var(--r-win) var(--r-win) 0 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--ease), background var(--ease);
}
.tabs a:hover { color: var(--ink); background: var(--stone); }
.tabs a.active { background: var(--paper); color: var(--blue); border-bottom-color: var(--blue); }

/* Editor-Toolbar (Deko) */
.toolbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 6px 32px;
  border-bottom: 1px solid var(--line);
  font-size: calc(13px * var(--fs, 1)); color: var(--ink);
  user-select: none;
}
.toolbar .tb { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 2px 6px; border-radius: var(--r); }
.toolbar .tb:hover { background: var(--stone); }
.toolbar .select { border: 1px solid var(--line); border-radius: var(--r); padding: 2px 8px; height: 26px; display: inline-flex; align-items: center; gap: 8px; color: var(--olive); }
.toolbar .select::after { content: "▾"; font-size: calc(10px * var(--fs, 1)); color: var(--ash); }
.toolbar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.toolbar .hint { margin-left: auto; font-family: var(--mono); font-size: calc(12px * var(--fs, 1)); color: var(--ash); }

/* Inhalt */
.doc section { padding: 48px 32px; border-bottom: 1px solid var(--line); }
.doc section:last-child { border-bottom: 0; }

.tag {
  display: inline-block;
  font-size: calc(12px * var(--fs, 1)); font-weight: 600; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 9999px;
  background: #fdeedd; color: #9a4a12; border: 1px solid #f3c9a4;
}
.tag.blue { background: #e6f0ff; color: #1f5fc4; border-color: #b9d3fb; }
.tag.green { background: #ebf4e6; color: #3f7a29; border-color: #c4dfb7; }

h1, h2, h3, h4 { color: var(--ink); margin: 0; letter-spacing: -0.025em; }
h1 { font-size: calc(clamp(30px, 4.2vw, 44px) * var(--fs, 1)); line-height: 1.12; font-weight: 800; margin: 16px 0 16px; max-width: 18ch; }
h1 .hl { color: var(--blue); }
h2 { font-size: calc(26px * var(--fs, 1)); line-height: 1.25; font-weight: 800; margin: 10px 0 14px; }
h3 { font-size: calc(19px * var(--fs, 1)); line-height: 1.4; font-weight: 700; }
h4 { font-size: calc(17px * var(--fs, 1)); line-height: 1.4; font-weight: 700; }
p { margin: 0 0 12px; }
.lead { font-size: calc(17px * var(--fs, 1)); line-height: 1.6; color: var(--olive); max-width: 62ch; }
.eyebrow { font-family: var(--mono); font-size: calc(12px * var(--fs, 1)); color: var(--sage); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.muted { color: var(--sage); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 32px; align-items: end; }
.hero-meta {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--cream);
  font-size: calc(13px * var(--fs, 1));
}
.hero-meta div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.hero-meta div:last-child { border-bottom: 0; }
.hero-meta dt { color: var(--sage); margin: 0; }
.hero-meta dd { color: var(--ink); font-weight: 700; margin: 0; text-align: right; }

/* Karten */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  transition: background var(--ease);
}
.card:hover { background: var(--cream); }
.card.nested { background: var(--linen); }
.card.nested:hover { background: var(--linen); }
.card .icon {
  width: 36px; height: 36px; border-radius: var(--r);
  display: grid; place-items: center; margin-bottom: 12px;
  border: 1px solid var(--line); background: var(--linen);
}
.card .icon svg { width: 20px; height: 20px; }
.card h3 { margin-bottom: 4px; }
.card .strong { color: var(--ink); font-weight: 700; }
.card .note { font-size: calc(13px * var(--fs, 1)); color: var(--sage); border-top: 1px dashed var(--line); padding-top: 10px; margin: 14px 0 0; font-style: italic; }

.feature { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.feature img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-bottom: 1px solid var(--line); }
.feature .body { padding: 16px; }
.feature p { font-size: calc(14px * var(--fs, 1)); margin: 6px 0 0; }

.section-head { margin-bottom: 24px; max-width: 64ch; }

/* Portfolio als Dateien */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.file {
  display: block; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper); overflow: hidden;
  transition: background var(--ease), border-color var(--ease);
}
.file:hover { background: var(--cream); border-color: var(--ash); }
.file .bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-bottom: 1px solid var(--line);
  background: var(--linen); font-size: calc(12px * var(--fs, 1)); color: var(--sage);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file .bar::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--moss); }
.file img { aspect-ratio: 3 / 2; object-fit: cover; object-position: top; width: 100%; transition: transform .4s ease; }
.file:hover img { transform: scale(1.02); }
.file .cap { padding: 10px 12px; font-size: calc(14px * var(--fs, 1)); color: var(--ink); font-weight: 600; border-top: 1px solid var(--line); position: relative; background: inherit; }

/* Abschluss */
.cta-box {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: var(--linen); border: 1px solid var(--line); border-radius: var(--r); padding: 24px;
}
.cta-box h2 { margin: 4px 0 0; }

/* Statusleiste */
.statusbar {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 6px 16px; border-top: 1px solid var(--line);
  background: var(--linen);
  font-family: var(--mono); font-size: calc(12px * var(--fs, 1)); color: var(--sage);
}
.statusbar .ok::before { content: "● "; color: var(--moss); }
.statusbar span:last-child { margin-left: auto; }

/* Rechte Spalte: Kontakt-Ordner */
.rail { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rail .rail-nav { position: static; width: 92px; }

/* Footer */
.footer {
  max-width: 1230px; margin: 0 auto;
  padding: 0 24px 32px calc(24px + 92px + 20px);
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center;
  font-size: calc(13px * var(--fs, 1)); color: var(--olive);
}
.footer nav { display: flex; gap: 4px; }
.footer nav a { text-decoration: none; padding: 4px 8px; border-radius: var(--r); }
.footer nav a:hover { background: var(--stone); }
.footer .copy { margin-left: auto; color: var(--sage); }

/* ---------- Unterseiten ---------- */
.hero-img {
  margin: 28px 0 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--linen);
}
.hero-img .bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: calc(12px * var(--fs, 1)); color: var(--sage); }
.hero-img .bar::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--marigold); }
.hero-img img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.hero-img figcaption { padding: 6px 10px; font-size: calc(12px * var(--fs, 1)); color: var(--sage); border-top: 1px solid var(--line); }

.prose { max-width: 68ch; }
.prose p { margin: 0 0 14px; }
.prose strong { color: var(--ink); }
.prose h3 { margin: 28px 0 8px; }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.list li { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li strong { color: var(--ink); display: block; margin-bottom: 2px; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding: 12px 16px 12px 52px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 12px;
  width: 24px; height: 24px; border-radius: var(--r); background: var(--ink); color: var(--marigold);
  display: grid; place-items: center; font-weight: 800; font-size: calc(13px * var(--fs, 1));
}
.steps li strong { color: var(--ink); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }

/* Toolbox: App-Liste */
.apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.app {
  display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); padding: 12px;
  text-decoration: none; color: inherit; transition: background var(--ease), border-color var(--ease);
}
.app:hover { background: var(--cream); border-color: var(--ash); }
.app img { width: 120px; height: 120px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }
.app h3 { margin: 4px 0 6px; font-size: calc(17px * var(--fs, 1)); }
.app p { font-size: calc(14px * var(--fs, 1)); margin: 0 0 8px; }
.app .open { font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: var(--gold); }
.app:hover .open { text-decoration: underline; text-underline-offset: 3px; }

/* Eingebettete Tools */
.embed { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.embed .bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--linen); font-family: var(--mono); font-size: calc(12px * var(--fs, 1)); color: var(--sage); }
.embed .bar::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--moss); }
.embed iframe { display: block; width: 100%; border: 0; }

/* Kontakt */
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); margin: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.kv dt, .kv dd { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--sage); font-size: calc(13px * var(--fs, 1)); font-weight: 600; background: var(--cream); border-right: 1px solid var(--line); }
.kv dd { color: var(--ink); }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv a, .prose a, .legal a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: var(--marigold); }
.kv a:hover, .prose a:hover, .legal a:hover { color: var(--blue); text-decoration-color: var(--blue); }

/* Rechtstexte */
.legal { max-width: 72ch; }
.legal > header { margin-bottom: 20px; }
.legal > header h1 { margin: 10px 0 4px; }
.legal > header p { color: var(--sage); }
.legal section { padding: 20px 0 !important; border-bottom: 1px solid var(--line) !important; }
.legal section:last-of-type { border-bottom: 0 !important; }
.legal h2 { font-size: calc(19px * var(--fs, 1)); margin: 0 0 8px; }
.legal p, .legal li { font-size: calc(15px * var(--fs, 1)); }
.legal ul { padding-left: 20px; }
.legal footer { margin-top: 16px; font-size: calc(13px * var(--fs, 1)); color: var(--sage); }

/* Tool-Widgets im neuen Look */
#solar-calculator-widget { font-family: var(--font) !important; box-shadow: none !important; border: 1px solid var(--line) !important; border-radius: var(--r) !important; background: var(--paper) !important; max-width: 520px !important; margin: 0 !important; }
#solar-calculator-widget h3 { color: var(--ink) !important; text-align: left !important; }
#solar-calculator-widget label { color: var(--olive) !important; }
#solar-calculator-widget input, #solar-calculator-widget select { border: 1px solid var(--line) !important; border-radius: var(--r) !important; height: 40px !important; font-family: var(--font) !important; }
#solar-calculator-widget input:focus, #solar-calculator-widget select:focus { outline: 2px solid var(--blue); border-color: var(--blue) !important; }
#solar-calculator-widget .sc-btn { background: var(--amber) !important; color: var(--ink) !important; border-radius: var(--r) !important; font-family: var(--font) !important; font-size: calc(15px * var(--fs, 1)) !important; }
#solar-calculator-widget .sc-btn:hover { background: var(--amber-dark) !important; }
#solar-calculator-widget #sc-result { background: var(--linen) !important; border-radius: var(--r) !important; border-left-color: var(--moss) !important; }

.doc .generator-container { font-family: var(--font); box-shadow: none !important; border: 1px solid var(--line); border-radius: var(--r) !important; max-width: none !important; }
.doc .generator-container h2 { color: var(--ink) !important; font-size: calc(21px * var(--fs, 1)); }
.doc .generator-container h3 { border-bottom: 1px solid var(--line) !important; font-size: calc(15px * var(--fs, 1)) !important; color: var(--ink) !important; }
.doc .generator-container label { color: var(--olive) !important; }
.doc .generator-container select, .doc .generator-container input[type="text"], .doc .generator-container input[type="url"],
.doc .generator-container input[type="email"], .doc .generator-container input[type="tel"], .doc .generator-container textarea {
  border: 1px solid var(--line) !important; border-radius: var(--r) !important; font-family: var(--font) !important; padding: 9px 12px !important;
}
.doc .generator-container select:focus, .doc .generator-container input:focus, .doc .generator-container textarea:focus { border-color: var(--blue) !important; }
.doc .generator-container input[type="color"] { border: 1px solid var(--line); border-radius: var(--r); }
.doc .generator-container .output-section { background: var(--linen) !important; border: 1px dashed var(--line) !important; border-radius: var(--r) !important; }
.doc .generator-container #qrcode-wrapper { box-shadow: none !important; border: 1px solid var(--line); border-radius: var(--r) !important; }
.doc .generator-container .btn-dl { border: 1.5px solid var(--gold) !important; color: var(--gold) !important; border-radius: var(--r) !important; font-family: var(--font); }
.doc .generator-container .btn-dl:hover { background: var(--amber) !important; border-color: var(--amber) !important; color: var(--ink) !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .desk { grid-template-columns: 92px minmax(0, 1fr) 92px; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-meta { max-width: 320px; }
  .apps, .split { grid-template-columns: 1fr; }
  .toolbar .hint { display: none; }
}
@media (max-width: 760px) {
  .topbar { padding: 12px 16px 4px; }
  .brand-name { font-size: calc(16px * var(--fs, 1)); }
  .desk { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "side rail" "main main"; gap: 8px 4px; padding: 4px 10px 24px; }
  .desk > .sidebar { grid-area: side; flex-direction: row; position: static; padding: 0; gap: 0; overflow-x: auto; scrollbar-width: none; }
  .desk > .sidebar::-webkit-scrollbar { display: none; }
  .desk > .window { grid-area: main; }
  .rail { grid-area: rail; position: static; }
  .rail .rail-nav { width: auto; padding: 0; }
  .sidebar a { flex: 1 1 0; min-width: 56px; padding: 6px 0; font-size: calc(10px * var(--fs, 1)); letter-spacing: -0.01em; }
  .rail .rail-nav a { min-width: 58px; }
  .sidebar img { width: 44px; }
  .titlebar .file-icon { font-size: 0; }
  .doc section { padding: 32px 18px; }
  .toolbar { padding: 6px 18px; }
  .toolbar .opt { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .app { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
  .app img { width: 84px; height: 84px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-right: 0; border-bottom: 0; padding-bottom: 2px; }
  .hero-img img { aspect-ratio: 4 / 3; }
  .footer { padding: 0 16px 24px; }
  .footer .copy { margin-left: 0; width: 100%; }
  .statusbar span:last-child { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .file img { transition: none; }
}

/* ---------- Cookie-Hinweis (Startseite) ---------- */
.cookie {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  width: 390px; max-width: calc(100vw - 20px);
  padding: 14px 16px 16px; padding-right: 150px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-win);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
  font-size: calc(13px * var(--fs, 1)); line-height: 1.45; color: var(--sage);
  overflow: visible;
  opacity: 0; transform: translateY(16px);
  transition: opacity .25s ease, transform .25s ease;
}
.cookie.show { opacity: 1; transform: none; }
.cookie p { margin: 0 0 8px; position: relative; z-index: 1; }
.cookie p:last-of-type { margin-bottom: 0; }
.cookie .cookie-title { font-size: calc(15px * var(--fs, 1)); font-weight: 700; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 6px; padding-right: 0; white-space: nowrap; }
.cookie p:nth-of-type(2) { margin-right: -134px; }
.cookie-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 0; border-radius: var(--r); background: transparent; color: var(--ink); cursor: pointer;
  transition: background var(--ease);
}
.cookie-close:hover { background: var(--stone); }
.cookie-img { position: absolute; right: -16px; bottom: 0; width: 180px; height: auto; pointer-events: none; }
@media (max-width: 760px) {
  .cookie { right: 10px; bottom: 10px; padding-right: 120px; }
  .cookie .cookie-title { white-space: normal; padding-right: 0; margin-right: -90px; }
  .cookie p:nth-of-type(2) { margin-right: -104px; }
  .cookie-img { width: 140px; right: -8px; }
}
@media (prefers-reduced-motion: reduce) { .cookie { transition: none; transform: none; } }

/* Pfad in der Titelleiste der Tool-Seiten: toolbox/ (Link) + App-Name */
.titlebar .crumb { color: var(--ink); text-decoration: none; border-radius: 3px; padding: 1px 2px; margin: 0 -2px; transition: background var(--ease); }
.titlebar .crumb:hover { background: var(--stone); text-decoration: underline; text-underline-offset: 3px; }
.titlebar .crumb-file { color: var(--sage); }

/* Formel-Kasten (Break-Even) */
.prose .formula { font-family: var(--mono); font-size: calc(14px * var(--fs, 1)); color: var(--ink); background: var(--linen); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; text-align: center; }

/* Suchbegriff-Zeile in der Hauptüberschrift */
.h1-kicker {
  display: table; margin-bottom: 14px;
  font-size: calc(13px * var(--fs, 1)); font-weight: 700; letter-spacing: .04em; line-height: 1.4; text-transform: uppercase;
  padding: 4px 12px; border-radius: 9999px;
  background: #fdeedd; color: #9a4a12; border: 1px solid #f3c9a4;
}

/* Leistungs-Karten (Startseite) */
.card.service { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: start; }
.card.service img { width: 48px; height: auto; margin-top: 2px; }
.card.service p { font-size: calc(14px * var(--fs, 1)); margin: 4px 0 8px; }
.more { font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: var(--gold); text-decoration: none; }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Nur für Screenreader und Suchmaschinen sichtbar */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sidebar a[aria-current="page"] span.sr-only { background: none; padding: 0; }

/* Schalke / BVB – Farbe der Textakzente */
.topbar { justify-content: space-between; }
.team { display: flex; align-items: center; gap: 4px; font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: var(--sage); }
.team button {
  font: inherit; color: var(--olive); background: none; border: 0; cursor: pointer;
  padding: 4px 6px; border-radius: var(--r); transition: background var(--ease), color var(--ease);
}
.team button:hover { background: rgba(255, 255, 255, .5); color: var(--ink); }
.team button[data-team="s04"][aria-pressed="true"] { color: var(--blue); }
.team button[data-team="bvb"][aria-pressed="true"] { color: #000; background: #f5bd00; }
/* BVB: sattes Gelb ohne Kontur */
.bvb .hl { color: #f5bd00; }
@media (max-width: 760px) {
  .brand-name { font-size: calc(14px * var(--fs, 1)); letter-spacing: .04em; white-space: nowrap; }
  .brand-logo { width: 28px; height: 30px; }
  .team { font-size: calc(12px * var(--fs, 1)); gap: 2px; }
  .team button { padding: 4px; }
}

/* Schriftgröße in der Werkzeugleiste */
.toolbar .fs { display: inline-flex; align-items: center; gap: 2px; }
.toolbar .fs button {
  min-width: 26px; height: 26px; padding: 0 6px; border: 0; border-radius: var(--r); background: transparent;
  font-family: var(--font); font-weight: 700; color: var(--ink); cursor: pointer; transition: background var(--ease);
}
.toolbar .fs button:hover { background: var(--stone); }
.toolbar .fs button:disabled { color: var(--ash); cursor: default; background: transparent; }
.toolbar .fs .fs-down { font-size: 11px; }
.toolbar .fs .fs-up { font-size: 15px; }
.toolbar .fs select {
  height: 26px; padding: 0 22px 0 8px; border: 1px solid var(--line); border-radius: var(--r);
  font: 400 13px var(--font); color: var(--olive); cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0h8L4 5z' fill='%239ea096'/%3E%3C/svg%3E") right 8px center no-repeat;
}
.toolbar .fs select:hover { border-color: var(--ash); }

/* Bedienleisten behalten ihre Größe – nur der Inhalt wächst mit der Schriftgröße */
.topbar, .sidebar, .rail, .titlebar, .tabs, .toolbar, .statusbar, .footer { --fs: 1; }
/* Lange deutsche Wörter in Überschriften trennen statt über den Rand laufen lassen */
h1, h2, h3, .lead { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
