/* MechatronikerDev · Industriedesign
   Graphit, Stahlgrau, ein Signalton. Scharfe Kanten, technische Typografie. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

[hidden] { display: none !important; }

:root {
  --bg: #e9ebed;            /* Stahlgrau hell */
  --flaeche: #ffffff;
  --flaeche-2: #f4f5f6;
  --tinte: #16191d;         /* Graphit */
  --text: #2b3036;
  --grau: #5f6770;
  --grau-hell: #8a929b;
  --linie: #c8cdd2;
  --linie-hell: #dde1e4;
  --signal: #e35a0c;        /* Signalorange */
  --signal-dunkel: #c44c08;
  --ok: #2f9e44;
  --warn: #e8a400;
  --leiste: #16191d;
  --leiste-2: #22272d;
  --leiste-linie: #343b43;
  --leiste-text: #c9ced4;
  --raster: rgba(22, 25, 29, .045);
  --schrift: "Barlow", "Segoe UI", system-ui, sans-serif;
  --schrift-kopf: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --schrift-mono: "Plex Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1215; --flaeche: #171b1f; --flaeche-2: #1c2126; --tinte: #f1f3f5; --text: #d3d8dd; --grau: #9aa2ab; --grau-hell: #6f7882;
    --linie: #2e353c; --linie-hell: #252b31; --leiste: #0b0d0f; --leiste-2: #15191d; --leiste-linie: #262c32; --raster: rgba(255, 255, 255, .03);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1215; --flaeche: #171b1f; --flaeche-2: #1c2126; --tinte: #f1f3f5; --text: #d3d8dd; --grau: #9aa2ab; --grau-hell: #6f7882;
  --linie: #2e353c; --linie-hell: #252b31; --leiste: #0b0d0f; --leiste-2: #15191d; --leiste-linie: #262c32; --raster: rgba(255, 255, 255, .03);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
html, body { margin: 0; }
body { font-family: var(--schrift); font-size: 16px; line-height: 1.55; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.app-offen { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
h1, h2, h3 { margin: 0; color: var(--tinte); }
a { color: inherit; }
.rahmen { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Kennungen und Labels im Stil technischer Beschriftung */
.kennung, .nummer, .abschnitt-info, .datenblatt-kopf, .ts-kopf, .planung th, .status, .leiste-link, .quellcode-adresse {
  font-family: var(--schrift-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
}

/* ---------- Obere Leiste ---------- */
.leiste { position: sticky; top: 0; z-index: 20; display: flex; align-items: stretch; height: 56px; padding-top: env(safe-area-inset-top); background: var(--leiste); color: var(--leiste-text); border-bottom: 1px solid var(--leiste-linie); flex-shrink: 0; }
.marke { display: flex; align-items: center; gap: 11px; padding: 0 22px; text-decoration: none; color: #fff; border-right: 1px solid var(--leiste-linie); }
.marke-zeichen { width: 26px; height: 26px; color: var(--signal); flex-shrink: 0; }
.marke-text { font-family: var(--schrift-kopf); font-weight: 700; font-size: 1.15rem; letter-spacing: .06em; color: #fff; white-space: nowrap; }
.marke-text b { color: var(--signal); font-weight: 700; }
.tabs { display: flex; align-items: stretch; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 9px; padding: 0 20px; color: var(--leiste-text); text-decoration: none; font-weight: 500; font-size: .93rem; border-right: 1px solid var(--leiste-linie); position: relative; white-space: nowrap; transition: background .15s, color .15s; }
.tab em { font-style: normal; }
.tab svg { width: 17px; height: 17px; opacity: .75; }
.tab:hover { background: var(--leiste-2); color: #fff; }
.tab.aktiv { background: var(--leiste-2); color: #fff; }
.tab.aktiv::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--signal); }
.tab.aktiv svg { opacity: 1; color: var(--signal); }
.leiste-rechts { display: flex; align-items: center; padding: 0 18px; }
.leiste-link { color: var(--leiste-text); text-decoration: none; padding: 7px 12px; border: 1px solid var(--leiste-linie); }
.leiste-link:hover { color: #fff; border-color: var(--grau-hell); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 22px; font-family: var(--schrift); font-weight: 600; font-size: .95rem; letter-spacing: .01em; text-decoration: none; border: 1px solid transparent; border-radius: 2px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn-primaer { background: var(--signal); color: #fff; }
.btn-primaer:hover { background: var(--signal-dunkel); }
.btn-linie { border-color: var(--linie); color: var(--tinte); background: var(--flaeche); }
.btn-linie:hover { border-color: var(--tinte); }

/* ---------- Einstieg ---------- */
.held { position: relative; padding: 76px 0 72px; border-bottom: 1px solid var(--linie);
  background-color: var(--bg);
  background-image: linear-gradient(var(--raster) 1px, transparent 1px), linear-gradient(90deg, var(--raster) 1px, transparent 1px);
  background-size: 32px 32px; }
.held-raster { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.kennung { color: var(--signal); margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.kennung::before { content: ""; width: 28px; height: 2px; background: var(--signal); }
.held h1 { font-family: var(--schrift-kopf); font-weight: 700; font-size: clamp(2.6rem, 5.4vw, 4.4rem); line-height: .98; letter-spacing: -.005em; text-transform: uppercase; max-width: 15ch; }
.held-lead { font-size: 1.14rem; color: var(--grau); max-width: 54ch; margin: 24px 0 34px; }
.held-aktionen { display: flex; gap: 12px; flex-wrap: wrap; }

.datenblatt { margin: 0; background: var(--flaeche); border: 1px solid var(--linie); border-top: 3px solid var(--tinte); }
.datenblatt-kopf { display: flex; justify-content: space-between; padding: 12px 18px; background: var(--flaeche-2); border-bottom: 1px solid var(--linie); color: var(--grau); }
.datenblatt > div:not(.datenblatt-kopf) { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--linie-hell); }
.datenblatt > div:last-child { border-bottom: 0; }
.datenblatt dt { color: var(--grau); font-size: .93rem; }
.datenblatt dd { margin: 0; color: var(--tinte); font-weight: 600; font-size: .95rem; text-align: right; }

/* ---------- Abschnitte ---------- */
.abschnitt { padding: 72px 0; }
.abschnitt-grau { background: var(--flaeche-2); border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); }
.abschnitt-kopf { display: flex; align-items: baseline; gap: 16px; padding-bottom: 16px; margin-bottom: 28px; border-bottom: 2px solid var(--tinte); }
.nummer { color: var(--signal); font-size: .8rem; }
.abschnitt-kopf h2 { font-family: var(--schrift-kopf); font-weight: 700; font-size: 1.9rem; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.abschnitt-info { margin-left: auto; color: var(--grau); }

/* ---------- Typenschilder (Werkzeuge) ---------- */
.typenschilder { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; }
.ts { display: flex; flex-direction: column; background: var(--flaeche); border: 1px solid var(--linie); transition: border-color .15s; }
.ts:hover { border-color: var(--tinte); }
.ts-kopf { display: flex; justify-content: space-between; align-items: center; padding: 11px 18px; background: var(--leiste); color: var(--leiste-text); }
.ts-id { color: #fff; }
.status { display: inline-flex; align-items: center; gap: 8px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(47, 158, 68, .22); }
.status.geplant::before { background: var(--warn); box-shadow: 0 0 0 3px rgba(232, 164, 0, .2); }
.ts-haupt { display: grid; grid-template-columns: 52px 1fr; gap: 16px; padding: 22px 18px 18px; }
.ts-icon { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--linie); background: var(--flaeche-2); color: var(--tinte); }
.ts-icon svg { width: 28px; height: 28px; }
.ts h3 { font-family: var(--schrift-kopf); font-weight: 700; font-size: 1.55rem; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
.ts-text { color: var(--grau); margin: 8px 0 0; font-size: .97rem; }
.ts-daten { margin: 0 18px; border-top: 1px solid var(--linie); }
.ts-daten div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--linie-hell); font-size: .9rem; }
.ts-daten dt { color: var(--grau-hell); font-family: var(--schrift-mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; padding-top: 2px; }
.ts-daten dd { margin: 0; color: var(--text); }
.ts-fuss { margin-top: auto; padding: 18px; }
.ts-fuss .btn { width: 100%; justify-content: space-between; }
.ts-fuss .btn span:last-child { font-size: 1.1rem; }
.ts-fuss .ohne { color: var(--grau); font-size: .9rem; }

/* Quellcode-Hinweis */
.quellcode { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-top: 24px; padding: 20px 22px; background: var(--flaeche); border: 1px solid var(--linie); border-left: 3px solid var(--signal); text-decoration: none; transition: border-color .15s; }
.quellcode:hover { border-color: var(--tinte); border-left-color: var(--signal); }
.quellcode-icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--leiste); color: #fff; }
.quellcode-icon svg { width: 22px; height: 22px; }
.quellcode-text { display: grid; gap: 2px; }
.quellcode-text b { color: var(--tinte); font-weight: 600; font-size: 1.02rem; }
.quellcode-text span { color: var(--grau); font-size: .93rem; }
.quellcode-adresse { color: var(--tinte); white-space: nowrap; }

/* ---------- Planung ---------- */
.tabelle-huelle { overflow-x: auto; border: 1px solid var(--linie); background: var(--flaeche); }
.planung { width: 100%; border-collapse: collapse; min-width: 640px; }
.planung th { text-align: left; color: var(--grau); font-weight: 500; padding: 12px 18px; background: var(--flaeche-2); border-bottom: 1px solid var(--linie); }
.planung td { padding: 16px 18px; border-bottom: 1px solid var(--linie-hell); vertical-align: top; font-size: .95rem; }
.planung tr:last-child td { border-bottom: 0; }
.planung td:first-child { font-family: var(--schrift-mono); color: var(--grau); font-size: .8rem; width: 80px; padding-top: 18px; }
.planung td:nth-child(2) { font-weight: 600; color: var(--tinte); width: 230px; }
.planung td:nth-child(3) { color: var(--grau); }
.planung td:last-child { width: 150px; white-space: nowrap; }
.planung .status { color: var(--grau); }

/* ---------- Fußbereich ---------- */
.fuss { background: var(--leiste); color: var(--leiste-text); padding: 52px 0 0; }
.fuss-raster { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.marke-text.klein { font-size: 1.05rem; }
.fuss p { color: #8f979f; font-size: .92rem; max-width: 46ch; margin: 12px 0 0; }
.fuss h3 { font-family: var(--schrift-mono); font-weight: 500; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #8f979f; margin-bottom: 14px; }
.fuss-raster a { display: block; color: var(--leiste-text); text-decoration: none; padding: 3px 0; font-size: .95rem; }
.fuss-raster a:hover { color: #fff; }
.fuss-unten { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 22px; border-top: 1px solid var(--leiste-linie); font-size: .82rem; color: #7c858e; }

/* ---------- Geöffnetes Werkzeug ---------- */
.app-ansicht { flex: 1; position: relative; min-height: 0; background: var(--bg); }
.app-ansicht iframe { width: 100%; height: 100%; border: 0; display: block; }
.laden { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--bg); }
.laden-balken { width: 220px; height: 3px; background: var(--linie); overflow: hidden; }
.laden-balken span { display: block; width: 40%; height: 100%; background: var(--signal); animation: laden 1s ease-in-out infinite; }
.laden-text { font-family: var(--schrift-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--grau); }
@keyframes laden { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* ---------- Rechtstexte ---------- */
.rechtstext { max-width: 820px; margin: 0 auto; padding: 56px 24px 80px; }
.rechtstext h1 { font-family: var(--schrift-kopf); font-weight: 700; font-size: 2.6rem; text-transform: uppercase; letter-spacing: .01em; padding-bottom: 14px; border-bottom: 2px solid var(--tinte); margin-bottom: 8px; }
.rechtstext h2 { font-family: var(--schrift-kopf); font-weight: 700; font-size: 1.3rem; text-transform: uppercase; letter-spacing: .03em; margin: 36px 0 10px; }
.rechtstext p, .rechtstext li { font-size: 1rem; }
.rechtstext ul { padding-left: 20px; display: grid; gap: 6px; }
.rechtstext a { color: var(--signal-dunkel); }
.rechtstext .meta { color: var(--grau); font-family: var(--schrift-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .held-raster { grid-template-columns: 1fr; gap: 40px; }
  .fuss-raster { grid-template-columns: 1fr 1fr; }
  .fuss-raster > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .rahmen { padding: 0 16px; }
  .marke { padding: 0 14px; }
  .marke-text { display: none; }
  .tab { padding: 0 14px; }
  .tab:not(.aktiv) em { display: none; }
  .leiste-rechts { display: none; }
  .held { padding: 48px 0; }
  .abschnitt { padding: 52px 0; }
  .typenschilder { grid-template-columns: 1fr; }
  .quellcode { grid-template-columns: auto 1fr; }
  .quellcode-adresse { grid-column: 1 / -1; }
  .abschnitt-info { display: none; }
  .ts-daten div { grid-template-columns: 100px 1fr; }
}
.fuss-unten a { color: var(--leiste-text); text-decoration: none; }
.fuss-unten a:hover { color: #fff; }
