/* ACONA AI Hub — Design-System "Console"
   Dunkel als Standard, helles Theme per Umschalter (data-theme auf <html>, serverseitig gesetzt, kein Aufblitzen).
   Geist für die Arbeitsoberfläche, Poppins (ACONA-CI) für Marke und Seitentitel, Geist Mono für Code und Keys.
   Zwei neutrale Ebenen: Chrome (Kopfleiste, Navigation) und Arbeitsfläche. Elevation über 1px-Linien,
   Schatten nur für schwebende Ebenen (Menüs, Dialoge, Toasts). */

@font-face { font-family: "Geist"; src: url("../fonts/geist-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* Dunkel (Standard) */
:root {
    color-scheme: dark;
    --bg: #0a0d16;
    --chrome: #0d111b;
    --surface: #11151f;
    --surface-2: #171c28;
    --surface-3: #1f2533;
    --line: #1d2230;
    --line-strong: #2b3243;
    --text: #e8eaf0;
    --text-2: #aab0bf;
    --text-3: #808799;
    --navy: #1c244b;
    --brand: #009fe3;
    --accent: #0b72ba;
    --accent-hover: #0a66a8;
    --accent-text: #5bb9ed;
    --accent-soft: rgba(0, 159, 227, 0.12);
    --on-accent: #ffffff;
    --ok: #46c085;      --ok-soft: rgba(70, 192, 133, 0.12);
    --warn: #e3a948;    --warn-soft: rgba(227, 169, 72, 0.12);
    --error: #f0786f;   --error-soft: rgba(240, 120, 111, 0.12);
    --info: #5bb9ed;    --info-soft: rgba(91, 185, 237, 0.12);
    --chart: #2a9de2;
    --chart-muted: #1f4c6e;
    --code-bg: #0c1019;
    --scrim: rgba(3, 5, 12, 0.66);
    --float-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.35);
    --focus: 0 0 0 3px rgba(0, 159, 227, 0.35);
    --logo-dark: block;
    --logo-light: none;

    --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-brand: "Poppins", "Geist", system-ui, sans-serif;
    --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --r-sm: 4px;
    --r: 6px;
    --r-lg: 8px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --topbar: 52px;
    --nav: 244px;
}

/* Hell (gewählt) */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f6f8;
    --chrome: #ffffff;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --surface-3: #e5e8ed;
    --line: #e2e5ea;
    --line-strong: #cdd2da;
    --text: #141824;
    --text-2: #474e60;
    --text-3: #626a7c;
    --accent: #0a6fb0;
    --accent-hover: #085d94;
    --accent-text: #0a6fb0;
    --accent-soft: #e6f2fa;
    --on-accent: #ffffff;
    --ok: #137744;      --ok-soft: #e3f3e9;
    --warn: #8d5900;    --warn-soft: #fbf0db;
    --error: #b42f28;   --error-soft: #fbe7e5;
    --info: #0a6fb0;    --info-soft: #e6f2fa;
    --chart: #0a8fd1;
    --chart-muted: #b9dcf1;
    --code-bg: #f3f5f8;
    --scrim: rgba(17, 22, 46, 0.42);
    --float-shadow: 0 12px 32px rgba(17, 22, 46, 0.16), 0 2px 6px rgba(17, 22, 46, 0.08);
    --logo-dark: none;
    --logo-light: block;
}

/* Grundlagen */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; accent-color: var(--accent); scrollbar-color: var(--line-strong) transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "ss01" 0; }
::selection { background: rgba(0, 159, 227, 0.32); color: inherit; }
h1, h2, h3, h4 { margin: 0; color: var(--text); font-weight: 600; line-height: 1.3; text-wrap: balance; }
h1 { font-family: var(--font-brand); font-size: 1.375rem; letter-spacing: -0.01em; }
h2 { font-size: 0.9375rem; letter-spacing: -0.005em; }
h3 { font-size: 0.875rem; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:root:not([data-theme="light"]) a:hover { color: #86cdf3; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-sm); }
img, svg { display: block; max-width: 100%; }
code, kbd, pre { font-family: var(--mono); font-size: 0.8125rem; }
.num, td.num, .table .t-num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; }
.icon--sm { width: 16px; height: 16px; }
.icon--xs { width: 14px; height: 14px; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: var(--r); background: var(--accent); color: var(--on-accent); }
.skip-link:focus { top: 12px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Logo je Theme */
.logo-on-dark { display: var(--logo-dark); }
.logo-on-light { display: var(--logo-light); }

/* App-Rahmen: Kopfleiste, Navigation, Inhalt */

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 14px;
    height: var(--topbar); padding: 0 14px 0 18px;
    background: var(--chrome); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand img { width: auto; height: 24px; }
.brand__product { padding-left: 12px; border-left: 1px solid var(--line-strong); color: var(--text); font: 500 0.9375rem/1 var(--font-brand); letter-spacing: -0.005em; }
.brand:hover { color: var(--text); }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-3); font-size: 0.8125rem; }
.crumbs a { color: var(--text-2); text-decoration: none; white-space: nowrap; }
.crumbs a:hover { color: var(--text); }
.crumbs .icon { width: 14px; height: 14px; color: var(--text-3); opacity: 0.6; }
.crumbs span:last-child, .crumbs a:last-child { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__search {
    display: inline-flex; align-items: center; gap: 8px;
    margin-left: auto; width: min(300px, 30vw); height: 32px; padding: 0 8px 0 10px;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text-3);
    font: inherit; font-size: 0.8125rem; cursor: pointer; transition: border-color 150ms var(--ease), color 150ms var(--ease);
}
.topbar__search:hover { border-color: var(--line-strong); color: var(--text-2); }
.topbar__search kbd { margin-left: auto; }
.topbar__actions { display: flex; align-items: center; gap: 2px; }
.topbar__links { display: flex; align-items: center; gap: 2px; margin-left: 12px; }
.topbar__links a { padding: 6px 10px; border-radius: var(--r); color: var(--text-2); font-size: 0.8125rem; font-weight: 500; text-decoration: none; transition: color 150ms var(--ease), background-color 150ms var(--ease); }
.topbar__links a:hover, .topbar__links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.topbar__cta { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar__menu { display: none; }
.topbar__menu .menu__panel { min-width: 240px; }
.icon-btn {
    display: inline-grid; place-items: center; width: 32px; height: 32px;
    border: 0; border-radius: var(--r); background: transparent; color: var(--text-2); cursor: pointer;
    transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em; }
[data-theme-icon="dark"] { display: none; }
:root[data-theme="light"] [data-theme-icon="light"] { display: block; }
:root:not([data-theme="light"]) [data-theme-icon="light"] { display: none; }
:root:not([data-theme="light"]) [data-theme-icon="dark"] { display: block; }
.nav-toggle { display: none; }

.shell { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.nav-col { background: var(--chrome); border-right: 1px solid var(--line); }
.nav {
    position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto;
    display: flex; flex-direction: column; gap: 1px; padding: 12px 10px 14px;
    background: var(--chrome);
}
.nav__group { display: flex; flex-direction: column; gap: 1px; }
.nav__group + .nav__group { margin-top: 18px; }
.nav__title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 4px; padding: 0 8px; color: var(--text-3); font-size: 0.75rem; font-weight: 500; }
.nav__title a { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-sm); color: var(--text-3); }
.nav__title a:hover { background: var(--surface-2); color: var(--text); }
.nav__link {
    display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 5px 8px;
    border-radius: var(--r); color: var(--text-2); text-decoration: none; font-size: 0.8125rem; font-weight: 500;
    transition: background-color 120ms var(--ease), color 120ms var(--ease);
}
.nav__link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__link:hover { background: var(--surface-2); color: var(--text); }
.nav__link[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.nav__link .icon { color: var(--text-3); }
.nav__link[aria-current="page"] .icon { color: var(--accent-text); }
.nav__foot { margin-top: auto; padding: 14px 8px 0; color: var(--text-3); font-size: 0.75rem; }
.nav__foot a { color: var(--text-3); }
.nav__foot a:hover { color: var(--text-2); }

/* Projektauswahl oben in der Navigation */
.switcher { position: relative; margin-bottom: 14px; }
.switcher__button {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px;
    border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text);
    font: inherit; text-align: left; cursor: pointer; transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.switcher__button:hover { border-color: var(--line-strong); background: var(--surface-2); }
.switcher__badge { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); font: 600 0.75rem/1 var(--font-brand); }
.switcher__text { display: grid; min-width: 0; line-height: 1.25; }
.switcher__label { color: var(--text-3); font-size: 0.6875rem; font-weight: 500; }
.switcher__name { overflow: hidden; color: var(--text); font-size: 0.8125rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.switcher__button > .icon { margin-left: auto; color: var(--text-3); }
.switcher .menu__panel { left: 0; right: 0; min-width: 0; max-height: 360px; overflow-y: auto; }
.menu__item[aria-current="true"] { background: var(--surface-2); }
.menu__item[aria-current="true"]::after { content: ""; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--accent-text); }
.menu__sep { height: 1px; margin: 6px 4px; background: var(--line); }

.main { min-width: 0; }
.page { max-width: 1280px; margin: 0 auto; padding: 26px 32px 72px; }
.page--narrow { max-width: 860px; }
.page--wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head__text { min-width: 0; }
.page-head__sub { margin: 4px 0 0; color: var(--text-2); max-width: 76ch; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { font-size: 0.9375rem; }
.section-head p { margin: 2px 0 0; color: var(--text-3); font-size: 0.8125rem; }

/* Flächen */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card--pad { padding: 18px 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.card__head h2, .card__head h3 { font-size: 0.875rem; }
.card__head .muted { font-size: 0.8125rem; }
.card__body { padding: 16px; }
.card__foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.stack > *, .grid-main > *, .grid-2 > *, .dash > * { min-width: 0; }

/* Buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r);
    background: var(--accent); color: var(--on-accent);
    font: 500 0.8125rem/1 var(--font); white-space: nowrap; text-decoration: none; cursor: pointer;
    transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 100ms var(--ease);
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 15px; height: 15px; }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn--secondary:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: #c4372f; color: #fff; }
.btn--danger:hover { background: #a92e27; color: #fff; }
.btn--sm { height: 28px; padding: 0 9px; font-size: 0.8125rem; }
.btn--lg { height: 40px; padding: 0 18px; font-size: 0.875rem; }
.btn--block { width: 100%; }
.btn--icon { width: 28px; padding: 0; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent-text); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Formulare */

.field { display: grid; gap: 6px; align-content: start; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.label, .field > label { color: var(--text); font-size: 0.8125rem; font-weight: 500; }
.optional { color: var(--text-3); font-weight: 400; }
.hint { margin: 0; color: var(--text-3); font-size: 0.8125rem; }
.error-text { margin: 0; color: var(--error); font-size: 0.8125rem; }
.input, .select, .textarea {
    width: 100%; min-height: 34px; padding: 6px 10px;
    border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); color: var(--text);
    font: inherit; transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
:root[data-theme="light"] .input, :root[data-theme="light"] .select, :root[data-theme="light"] .textarea { background-color: var(--surface); }
.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23808799' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; }
:root[data-theme="light"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23626a7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input[readonly] { background: var(--surface-2); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--error); }
.input--mono { font-family: var(--mono); font-size: 0.8125rem; }
::placeholder { color: var(--text-3); opacity: 1; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; margin-bottom: 16px; }
.field-row > .field { margin-bottom: 0; }
.field-row--plz { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.billing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.billing-note { display: grid; gap: 10px; color: var(--text-2); font-size: 0.8125rem; }
.billing-note strong { color: var(--text); font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 10px; color: var(--text); font-size: 0.875rem; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; }
.choices { display: grid; gap: 8px; border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.choices legend { margin-bottom: 6px; padding: 0; font-size: 0.8125rem; font-weight: 500; }
.choice {
    display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px;
    border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer;
    transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.choice:hover { border-color: var(--text-3); }
.choice:has(input:checked) { border-color: var(--accent-text); background: var(--accent-soft); }
.choice:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.choice input { margin: 3px 0 0; }
.choice__title { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.choice__hint { display: block; color: var(--text-2); font-size: 0.8125rem; }
.choice__price { margin-left: auto; color: var(--text-2); font-size: 0.8125rem; white-space: nowrap; }
.form-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 20px; }
details.advanced > summary { color: var(--text-2); font-size: 0.8125rem; margin-bottom: 12px; }

/* Meldungen */

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid transparent; border-radius: var(--r); background: var(--info-soft); color: var(--text); font-size: 0.8125rem; }
.notice .icon { color: var(--info); margin-top: 1px; }
.notice--warn { background: var(--warn-soft); }
.notice--warn .icon { color: var(--warn); }
.notice--error { background: var(--error-soft); }
.notice--error .icon { color: var(--error); }
.notice--ok { background: var(--ok-soft); }
.notice--ok .icon { color: var(--ok); }
.notice + .notice, .notice + .card, .notice + .grid-main { margin-top: 16px; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast {
    display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px;
    border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface-2); color: var(--text);
    box-shadow: var(--float-shadow); font-size: 0.8125rem;
    animation: toast-in 220ms var(--ease-out) both;
}
.toast .icon { color: var(--ok); margin-top: 1px; }
.toast--error .icon { color: var(--error); }
.toast__close { width: 24px; height: 24px; margin: -3px -4px -3px auto; }
.toast.is-leaving { animation: toast-out 180ms var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* Status, Kennzeichen */

.badge {
    display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 7px;
    border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2);
    font-size: 0.75rem; font-weight: 500; white-space: nowrap;
}
.badge--ok, .badge--done { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--error { background: var(--error-soft); color: var(--error); }
.badge--info, .badge--progress { background: var(--info-soft); color: var(--info); }
.badge--accent { background: var(--accent-soft); color: var(--accent-text); }
.badge--muted { background: var(--surface-2); color: var(--text-3); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge--progress .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-3); font-size: 0.6875rem; }

/* Tabellen */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.table th { height: 36px; padding: 0 16px; color: var(--text-3); font-size: 0.75rem; font-weight: 500; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--surface); }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 120ms var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table .t-num { text-align: right; white-space: nowrap; color: var(--text); }
.table th.t-num { color: var(--text-3); }
.table .t-actions { width: 1%; text-align: right; white-space: nowrap; }
.table .t-actions form { display: inline; }
.t-main { color: var(--text); font-weight: 500; }
.t-link { color: var(--text); font-weight: 500; text-decoration: none; }
.t-link:hover { color: var(--accent-text); text-decoration: underline; }
.t-sub { display: block; margin-top: 1px; color: var(--text-3); font-size: 0.75rem; }
.table--compact td { padding: 8px 16px; }
.is-muted td { color: var(--text-3); }
.table .code-inline { white-space: nowrap; overflow-wrap: normal; }
.code-inline { padding: 1px 5px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--code-bg); color: var(--text); font-family: var(--mono); font-size: 0.8125em; overflow-wrap: anywhere; }

/* Reiter */

.tabs { display: flex; gap: 4px; margin: -6px 0 22px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 10px; margin-bottom: -1px;
    border-bottom: 2px solid transparent; color: var(--text-2); font-size: 0.8125rem; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); }

.segmented { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.segmented a, .segmented button { padding: 4px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); font: 500 0.8125rem var(--font); text-decoration: none; cursor: pointer; }
.segmented a:hover, .segmented button:hover { color: var(--text); }
.segmented a[aria-current="page"], .segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }

/* Kennzahlen: eine Leiste, keine Kachelwand */

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.metric { padding: 14px 18px 15px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric__label { color: var(--text-3); font-size: 0.75rem; font-weight: 500; }
.metric__value { margin-top: 4px; color: var(--text); font-size: 1.5rem; font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.metric__note { margin-top: 3px; color: var(--text-3); font-size: 0.75rem; font-variant-numeric: tabular-nums; }

/* Skeletons beim Nachladen: dieselbe Tonlage wie die Flächen, nie heller als der Inhalt */

.skeleton { display: block; height: 10px; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 45%, var(--surface-2) 65%); background-size: 300% 100%; animation: shimmer 1.6s ease-in-out infinite; }
.skeleton--title { height: 20px; width: 40%; }
.skeleton--block { height: 180px; border-radius: var(--r); }
.skeleton-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.skeleton-row:last-child { border-bottom: 0; }
.w-20 { width: 20%; } .w-40 { width: 40%; } .w-60 { width: 60%; } .w-80 { width: 80%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
[data-fragment][aria-busy="true"] { min-height: 80px; }
[data-fragment] > * { animation: fade-in 200ms var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } }
.fragment-error { display: grid; justify-items: center; gap: 10px; padding: 24px; color: var(--text-2); text-align: center; }

/* Leere Zustände */

.empty { display: grid; justify-items: center; gap: 8px; padding: 44px 24px; text-align: center; }
.empty__icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 4px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface-2); color: var(--accent-text); }
.empty__icon .icon { width: 20px; height: 20px; }
.empty h2, .empty h3 { font-size: 0.9375rem; }
.empty p { max-width: 52ch; margin: 0; color: var(--text-2); }
.empty .btn { margin-top: 8px; }

/* Erste Schritte */

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; }
.step { position: relative; display: grid; gap: 3px; align-content: start; padding: 14px 16px 16px; }
.step + .step { border-left: 1px solid var(--line); }
.step__mark { display: grid; place-items: center; width: 22px; height: 22px; margin-bottom: 8px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--text-3); font-size: 0.6875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.step.is-done .step__mark { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.step.is-current .step__mark { border-color: var(--accent-text); color: var(--accent-text); }
.step__title { color: var(--text); font-size: 0.8125rem; font-weight: 600; }
.step.is-done .step__title { color: var(--text-2); }
.step__text { color: var(--text-3); font-size: 0.8125rem; }
.step a { justify-self: start; margin-top: 8px; font-size: 0.8125rem; font-weight: 500; }

/* Projektliste (Karten, z. B. im Admin-Bereich) */

.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.project-card { position: relative; display: grid; gap: 8px; padding: 14px 16px; transition: border-color 150ms var(--ease); }
.project-card:hover { border-color: var(--line-strong); }
.project-card__name { color: var(--text); font-weight: 600; text-decoration: none; }
.project-card__name::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.project-card__desc { margin: -2px 0 0; color: var(--text-2); font-size: 0.8125rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-card__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-3); font-size: 0.75rem; }
.project-card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.project-card--new { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 104px; border-style: dashed; color: var(--text-2); text-decoration: none; font-weight: 500; }
.project-card--new:hover { color: var(--accent-text); border-color: var(--accent-text); }

/* Übersicht: Projekte als Tabelle, Seitenspalte mit Konto und Katalog */

.dash { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.dash__side { display: grid; gap: 16px; }
.project-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.project-row__badge { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--text-2); font: 600 0.75rem/1 var(--font-brand); }
.project-row__text { min-width: 0; }
.project-row__text .t-sub { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); white-space: nowrap; }
.state .dot { width: 7px; height: 7px; }
.state--ok .dot { background: var(--ok); }
.state--progress .dot { background: var(--info); animation: pulse 1.4s ease-in-out infinite; }
.state--idle .dot { background: var(--line-strong); }
.kv { display: grid; gap: 0; margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 0.8125rem; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.list-links { margin: 0; padding: 4px; list-style: none; }
.list-links a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: var(--text); text-decoration: none; font-size: 0.8125rem; transition: background-color 120ms var(--ease); }
.list-links a:hover { background: var(--surface-2); color: var(--text); }
.list-links .mark { width: 26px; height: 26px; border-radius: var(--r); font-size: 0.625rem; }
.list-links__text { display: grid; min-width: 0; }
.list-links__text strong { font-weight: 500; }
.list-links__text span { color: var(--text-3); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.list-links .icon--arrow { margin-left: auto; color: var(--text-3); }

/* Modellkatalog */

.catalog-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.search-input { position: relative; flex: 1 1 280px; max-width: 400px; }
.search-input .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-input .input { padding-left: 34px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
    border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--text-2);
    font: 500 0.8125rem var(--font); cursor: pointer; transition: color 150ms var(--ease), border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip[aria-pressed="true"] { border-color: var(--accent-text); background: var(--accent-soft); color: var(--accent-text); }
.catalog-count { margin-left: auto; color: var(--text-3); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.catalog-bar .select { width: auto; min-width: 176px; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.model-card { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; padding: 16px; transition: border-color 150ms var(--ease), background-color 150ms var(--ease); }
.model-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.model-card[hidden] { display: none; }
.model-card__head { display: flex; align-items: center; gap: 12px; }
.model-card__name { color: var(--text); font-weight: 600; text-decoration: none; }
.model-card__name::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.model-card__provider { color: var(--text-3); font-size: 0.75rem; }
.model-card__text { margin: 0; color: var(--text-2); font-size: 0.8125rem; }
.model-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.model-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.model-card__foot strong { color: var(--text); font-weight: 600; }
.model-card__foot .icon { color: var(--text-3); transition: transform 150ms var(--ease), color 150ms var(--ease); }
.model-card:hover .model-card__foot .icon { transform: translateX(2px); color: var(--text); }
.mark {
    display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: var(--r);
    background: var(--surface-3); color: var(--text); font: 600 0.6875rem/1 var(--font); letter-spacing: 0.03em;
}
.mark--lg { width: 48px; height: 48px; border-radius: var(--r-lg); font-size: 0.875rem; }
/* Hersteller-Logos auf neutraler Kachel; die Logos tragen ihre eigenen Farben */
.mark--logo { border: 1px solid var(--line-strong); background: var(--surface-2); }
.mark--logo img { width: 58%; height: 58%; object-fit: contain; }
.mark--lg.mark--logo img { width: 54%; height: 54%; }
:root[data-theme="light"] .mark--logo { background: #ffffff; border-color: var(--line); }
.model-hero { display: flex; gap: 16px; align-items: center; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 0; font-size: 0.8125rem; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.price-table td, .price-table th { padding-left: 0; }
.gate { display: grid; gap: 12px; }
.gate p { margin: 0; color: var(--text-2); font-size: 0.8125rem; }

/* Code */

.code {
    position: relative; margin: 0; padding: 14px 16px; overflow-x: auto;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--code-bg); color: var(--text);
    font-size: 0.8125rem; line-height: 1.6; tab-size: 4;
}
.code-block { position: relative; }
.code-block .copy-btn { position: absolute; top: 8px; right: 8px; }
.copy-btn.is-copied { color: var(--ok); }
.endpoint-field { display: flex; gap: 8px; }
.endpoint-field .input { font-family: var(--mono); font-size: 0.8125rem; }

/* Neuer Key */

.secret { display: grid; gap: 12px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); border-radius: var(--r-lg); background: var(--ok-soft); }
.secret h2 { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; }
.secret h2 .icon { color: var(--ok); }
.secret__value { display: flex; gap: 8px; }
.secret__value code { flex: 1; min-width: 0; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--text); overflow-wrap: anywhere; user-select: all; }

/* Verbrauchsbalken */

.meter { display: block; height: 4px; margin-top: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter__fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--chart); transition: width 400ms var(--ease); }
.meter--high .meter__fill { background: var(--warn); }

/* Diagramm: Säulen je Tag */

.chart { margin: 0; }
.chart__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.chart__head h3 { font-size: 0.875rem; }
.chart__head p { margin: 0; color: var(--text-3); font-size: 0.75rem; }
.chart__plot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; height: 196px; }
.chart__axis { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 22px; color: var(--text-3); font-size: 0.6875rem; text-align: right; font-variant-numeric: tabular-nums; transform: translateY(-0.5em); }
.chart__bars { position: relative; display: flex; align-items: stretch; gap: 3px; padding-bottom: 22px; }
.chart__bars::before, .chart__bars::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.chart__bars::before { top: 0; background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 8px); }
.chart__bars::after { bottom: 22px; }
.chart__mid { position: absolute; left: 0; right: 0; top: calc((100% - 22px) / 2); height: 1px; background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 8px); }
.chart__slot { position: relative; flex: 1 1 0; display: flex; align-items: flex-end; justify-content: center; min-width: 0; border-radius: 3px 3px 0 0; }
.chart__slot:hover { background: var(--surface-2); }
.chart__bar { position: relative; display: block; width: 72%; max-width: 20px; height: 0; border-radius: 3px 3px 0 0; background: var(--chart); opacity: 0.85; transition: height 500ms var(--ease-out), opacity 120ms var(--ease); }
.chart__slot:hover .chart__bar { opacity: 1; }
.chart__slot.is-future::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); transform: translateX(-50%); }
.chart__slot.is-today .chart__label { color: var(--text); font-weight: 600; visibility: visible; }
.chart__label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); color: var(--text-3); font-size: 0.6875rem; font-variant-numeric: tabular-nums; visibility: hidden; }
.chart__slot:first-of-type .chart__label, .chart__slot:nth-of-type(5n) .chart__label { visibility: visible; }
.chart__tip {
    position: absolute; bottom: calc(100% - 18px); left: 50%; z-index: 5; display: none; gap: 2px; flex-direction: column;
    min-width: 160px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface-2); color: var(--text);
    font-size: 0.75rem; line-height: 1.4; white-space: nowrap; transform: translateX(-50%); pointer-events: none; box-shadow: var(--float-shadow);
}
.chart__tip span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.chart__slot:hover .chart__tip { display: flex; }
.chart__slot:nth-of-type(-n+3) .chart__tip { left: 0; transform: none; }
.chart__slot:nth-last-of-type(-n+3) .chart__tip { left: auto; right: 0; transform: none; }
.chart__table { margin-top: 14px; }
.chart__table summary { color: var(--text-2); font-size: 0.8125rem; }
.chart__table summary:hover { color: var(--text); }

.month-nav { display: inline-flex; align-items: center; gap: 4px; }
.month-nav__label { min-width: 120px; color: var(--text); font-weight: 600; text-align: center; }

/* Playground */

.playground { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; height: calc(100vh - var(--topbar) - 176px); min-height: 500px; overflow: hidden; }
.playground__side { display: flex; flex-direction: column; gap: 16px; padding: 16px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.playground__chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; background: var(--bg); }
:root[data-theme="light"] .playground__chat { background: var(--surface); }
.playground__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 6px 12px 6px 16px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text-3); font-size: 0.8125rem; }
.playground__log { display: flex; flex-direction: column; gap: 20px; padding: 24px clamp(16px, 4vw, 48px); overflow-y: auto; scroll-behavior: smooth; }
.playground__composer { display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.playground__composer .textarea { min-height: 42px; max-height: 200px; resize: none; }
.playground__composer .btn { height: 42px; }
.msg { display: grid; gap: 4px; max-width: 760px; }
.msg__who { color: var(--text-3); font-family: var(--mono); font-size: 0.75rem; }
.msg__body { color: var(--text); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__body pre { margin: 8px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--code-bg); white-space: pre; overflow-x: auto; }
.msg--user { align-self: flex-end; justify-items: end; }
.msg--user .msg__body { padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 2px var(--r-lg); background: var(--surface-2); }
.msg__meta { color: var(--text-3); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.msg--error .msg__body { color: var(--error); }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: typing 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.range { display: flex; align-items: center; gap: 10px; }
.range input { flex: 1; }
.range output { min-width: 32px; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; max-width: 640px; }
.suggestions .chip { height: auto; min-height: 32px; padding: 7px 12px; white-space: normal; text-align: left; line-height: 1.4; }
.pg-settings > summary { display: none; }
.pg-settings__body { display: flex; flex-direction: column; gap: 16px; }

/* Dialog, Befehlspalette, Menü */

dialog { padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--float-shadow); }
dialog::backdrop { background: var(--scrim); }
dialog[open] { animation: dialog-in 180ms var(--ease-out) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(6px) scale(0.985); } }
.dialog { width: min(480px, calc(100vw - 32px)); }
.dialog--wide { width: min(760px, calc(100vw - 32px)); }
.dialog__body { padding: 20px; }
.dialog__body h2 { margin-bottom: 8px; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.palette { width: min(620px, calc(100vw - 32px)); margin-top: 12vh; }
.palette__input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.palette__input input { flex: 1; height: 50px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.9375rem; outline: none; }
.palette__list { max-height: 380px; margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.palette__item a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: var(--text); text-decoration: none; font-size: 0.8125rem; }
.palette__item a .icon { color: var(--text-3); }
.palette__item small { margin-left: auto; color: var(--text-3); font-size: 0.75rem; }
.palette__item[aria-selected="true"] a, .palette__item a:hover { background: var(--surface-2); }
.palette__empty { padding: 20px; color: var(--text-3); text-align: center; }
.menu { position: relative; }
.menu__panel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; display: none; min-width: 232px; padding: 5px;
    border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--float-shadow);
}
.menu.is-open .menu__panel { display: block; animation: menu-in 140ms var(--ease-out) both; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu__head { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu__head strong { display: block; color: var(--text); font-weight: 600; }
.menu__head span { color: var(--text-3); font-size: 0.75rem; }
.menu__item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: var(--r); background: none; color: var(--text); font: inherit; font-size: 0.8125rem; text-align: left; text-decoration: none; cursor: pointer; }
.menu__item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__item:hover { background: var(--surface-2); color: var(--text); }
.menu__item .icon { color: var(--text-3); }

/* Seitenwechsel: dünner Ladebalken (keine Überblendung der ganzen Seite) */

.progress { position: fixed; top: 0; left: 0; z-index: 90; width: 100%; height: 2px; transform-origin: left; transform: scaleX(0); background: var(--brand); opacity: 0; pointer-events: none; }
.progress.is-active { opacity: 1; animation: progress 2.5s cubic-bezier(0.1, 0.7, 0.2, 1) forwards; }
@keyframes progress { to { transform: scaleX(0.85); } }

/* Öffentlicher Rahmen (ohne Anmeldung): gleiche Kopfleiste, keine Seitennavigation */

.public-main { min-height: calc(100vh - var(--topbar)); }
.public-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 16px; max-width: 1280px; margin: 0 auto; padding: 28px 32px 30px; color: var(--text-3); font-size: 0.8125rem; }
.public-foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.public-foot a { color: var(--text-2); text-decoration: none; }
.public-foot a:hover { color: var(--text); }
.public-foot > :last-child { justify-self: end; display: flex; gap: 18px; }

/* Anmeldung und Registrierung */

.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.auth--bare { min-height: 100vh; }
.auth__form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 96px); }
.auth__inner { width: 100%; max-width: 400px; margin: 0 auto; }
.auth__inner > .brand { margin-bottom: 36px; }
.auth__inner h1 { font-size: 1.75rem; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 8px; }
.auth__lead { margin-bottom: 26px; color: var(--text-2); }
.auth__alt { margin-top: 22px; color: var(--text-2); font-size: 0.875rem; }
.auth__legal { display: flex; gap: 16px; margin-top: 44px; font-size: 0.75rem; }
.auth__legal a { color: var(--text-3); }
.auth__aside { display: flex; flex-direction: column; justify-content: center; gap: 30px; padding: 48px clamp(24px, 5vw, 80px); background: var(--chrome); border-left: 1px solid var(--line); }
.auth__aside h2 { font: 500 clamp(1.5rem, 2.2vw, 2rem)/1.2 var(--font-brand); letter-spacing: -0.02em; max-width: 20ch; }
.auth__points { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; max-width: 46ch; }
.auth__points li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; color: var(--text-2); font-size: 0.875rem; }
.auth__points strong { display: block; color: var(--text); font-weight: 600; }
.auth__points .icon { color: var(--accent-text); margin-top: 2px; }
.demo { max-width: 480px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.demo__label { color: var(--text-3); font-size: 0.75rem; margin-bottom: 12px; }
.demo .msg { gap: 2px; }
.demo .msg + .msg { margin-top: 12px; }

/* Fehlerseite */

.error-page { display: grid; justify-items: start; gap: 12px; max-width: 520px; padding: 64px 0; }
.error-page__code { color: var(--text-3); font-family: var(--mono); font-size: 0.8125rem; }

/* Verbrauchsnachweis (Druckseite, im Browser als PDF speicherbar) */

.print-page { background: var(--bg); }
.print-toolbar { display: flex; justify-content: space-between; gap: 12px; max-width: 210mm; margin: 20px auto 12px; padding: 0 16px; flex-wrap: wrap; }
.statement { max-width: 210mm; margin: 0 auto 40px; padding: 18mm 16mm; overflow-x: auto; background: #fff; color: #1b2035; font-size: 0.8125rem; }
.statement h1, .statement h2 { color: #1c244b; }
.statement .table td, .statement .table th { border-color: #e2e5ec; color: #1b2035; background: #fff; }
.statement .table th { color: #687088; }
.statement .table tbody tr:hover { background: none; }
.statement__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.statement__head img { width: 140px; height: auto; }
.statement__meta h1 { margin-bottom: 8px; font-size: 1.25rem; text-align: right; }
.statement__meta dl { margin: 0; display: grid; gap: 2px; }
.statement__meta dl > div { display: flex; justify-content: flex-end; gap: 10px; }
.statement__meta dt { color: #687088; }
.statement__meta dd { margin: 0; font-weight: 500; }
.statement__customer { margin-bottom: 24px; }
.statement__customer p { margin: 0 0 4px; }
.statement__label, .statement__small { color: #687088; font-size: 0.75rem; }
.statement__table tfoot th, .statement__table tfoot td { padding: 10px 16px; border-top: 2px solid #1c244b; background: #f0f2f6; text-align: left; color: #1b2035; }
.statement__table tfoot td { text-align: right; }
.statement__subtitle { margin: 28px 0 8px; font-size: 0.9375rem; }
.statement__foot { margin-top: 32px; padding-top: 12px; border-top: 1px solid #e2e5ec; color: #687088; font-size: 0.6875rem; }

/* Kleinkram */

.form-notice { margin-bottom: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
ul.stack { margin: 0; padding: 0; list-style: none; }

/* Checkliste "Nächste Schritte" */
.todo { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.todo a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: var(--r); color: var(--text); text-decoration: none; font-size: 0.8125rem; font-weight: 500; transition: background-color 120ms var(--ease); }
.todo a:hover { background: var(--surface-2); color: var(--text); }
.todo__mark { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--text-3); }
.todo .is-done .todo__mark { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.todo .is-done span:last-child { color: var(--text-3); }
.todo a .icon--arrow { margin-left: auto; color: var(--text-3); }

/* Aufklappbereiche mit eigenem Pfeil statt Browser-Dreieck */
summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::before {
    content: ""; width: 14px; height: 14px; flex: none; background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 150ms var(--ease);
}
details[open] > summary::before { transform: rotate(90deg); }

/* Responsiv */

@media (max-width: 1100px) {
    .grid-main, .dash { grid-template-columns: minmax(0, 1fr); }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric:nth-child(3) { border-left: 0; }
    .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .step:nth-child(3) { border-left: 0; }
    .step:nth-child(n+3) { border-top: 1px solid var(--line); }
    .playground { grid-template-columns: 260px minmax(0, 1fr); }
    .topbar__links { display: none; }
    .topbar__menu { display: block; }
}
@media (max-width: 900px) {
    .nav-toggle { display: inline-grid; }
    .shell { display: block; }
    .table .hide-md { display: none; }
    .nav {
        position: fixed; top: var(--topbar); left: 0; bottom: 0; z-index: 40; width: min(300px, 85vw); height: auto;
        transform: translateX(-100%); transition: transform 220ms var(--ease-out); border-right: 1px solid var(--line);
    }
    .nav-col { border-right: 0; }
    body.nav-open .nav { transform: none; box-shadow: var(--float-shadow); }
    .nav-backdrop { position: fixed; inset: var(--topbar) 0 0 0; z-index: 35; background: var(--scrim); }
    .page { padding: 20px 16px 48px; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .grid-2, .field-row, .billing-layout { grid-template-columns: minmax(0, 1fr); }
    .crumbs { display: none; }
    .topbar { padding: 0 10px; gap: 8px; }
    .topbar__search { width: auto; margin-left: auto; }
    .topbar__search span, .topbar__search kbd { display: none; }
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth__aside { order: 2; border-left: 0; border-top: 1px solid var(--line); }
    .playground { grid-template-columns: minmax(0, 1fr); height: auto; }
    .playground__chat { order: 1; }
    .playground__side { order: 2; border-right: 0; border-top: 1px solid var(--line); }
    .playground__log { min-height: max(360px, calc(100svh - 440px)); }
    .pg-settings > summary { display: inline-flex; font-weight: 500; }
    .pg-settings[open] > summary { margin-bottom: 12px; }
    .project-card--new { min-height: 56px; }
    .suggestions { flex-direction: column; align-items: stretch; }
    .public-foot { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 24px clamp(16px, 2.6vw, 40px); }
    .public-foot > :last-child { justify-self: start; }
    .topbar__cta .btn--ghost { display: none; }
}
@media (max-width: 600px) {
    .brand__product { display: none; }
    .brand img { height: 22px; }
    .metrics, .steps { grid-template-columns: minmax(0, 1fr); }
    .metric + .metric, .step + .step { border-left: 0; border-top: 1px solid var(--line); }
    .statement { padding: 24px 16px; }
    .statement__head { flex-direction: column; }
    .statement__meta h1 { text-align: left; }
    .statement__meta dl > div { justify-content: flex-start; }
    .chart__plot { height: 170px; }
    .table .hide-sm { display: none; }
    .project-row__text .t-sub { max-width: 42vw; }
    .project-row__badge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print {
    @page { size: A4; margin: 14mm; }
    .topbar, .nav, .print-toolbar, .toasts { display: none !important; }
    .print-page, body, html { background: #fff; }
    .statement { max-width: none; margin: 0; padding: 0; overflow: visible; }
    .statement tr { break-inside: avoid; }
}
.card__foot .hint { margin-right: auto; }
