/* Poppins - selbst gehostet (Datenschutz: kein externer Font-CDN) */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/poppins-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/poppins-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/poppins-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/poppins-700.woff2') format('woff2');
}

/* Raleway - selbst gehosteter, sehr duenner Display-Font (Variable Font) */
@font-face {
    font-family: 'Raleway';
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url('fonts/raleway.woff2') format('woff2');
}

:root {
    /* Hintergrund: warmes Rose-Peach im Stil des X-Banners */
    --bg: #f3e2d5;
    --glow-green: rgba(var(--accent-rgb), .08);
    --glow-warm: rgba(206, 168, 154, .15);

    /* sehr duenner Display-Font fuer Ueberschrift + Menue */
    --font-display: 'Raleway', 'Poppins', 'Segoe UI', system-ui, sans-serif;

    /* Glasflaechen - leicht rosé statt creme */
    --surface: #fffaf3;
    --glass: rgba(255, 248, 242, .62);
    --glass-strong: rgba(255, 248, 242, .85);
    --glass-border: rgba(255, 240, 232, .72);
    --glass-edge: rgba(255, 245, 240, .6);

    /* warme Textfarben mit leichtem Rose-Stich (kein Olivton mehr) */
    --ink: #2c2024;
    --ink-soft: #6b545b;
    --ink-faint: #9b8a90;
    --line: #ebd9d2;
    --line-soft: rgba(122, 56, 64, .14);

    /* Akzent: pastellige Terrakotta aus dem Logo-Kreis - weicher, waermer,
       deutlich naeher am Marken-Bildzeichen als der Banner-Burgunder. */
    --accent: #cb7e62;
    --accent-strong: #a85a3f;
    --accent-soft: #f6e1d4;
    --accent-light: #e29f81;
    --accent-rgb: 203, 126, 98;
    --accent-glow: rgba(var(--accent-rgb), .28);
    --accent-box: linear-gradient(155deg, #f8e6d9, #efcab7);
    --accent-box-shade: 168, 90, 63;

    --sidebar-top: #c47961;
    --sidebar-bot: #8a4a35;

    --radius: 18px;
    --radius-sm: 12px;

    /* maximale Inhaltsbreite - fuellt grosse Bildschirme deutlich besser aus */
    --content-max: 1320px;
    --shadow-sm: 0 1px 2px rgba(40, 45, 28, .07);
    --shadow: 0 2px 5px rgba(40, 45, 28, .05), 0 18px 36px -20px rgba(38, 50, 28, .34);
    --shadow-lg: 0 10px 24px -10px rgba(38, 50, 28, .22), 0 30px 54px -26px rgba(38, 50, 28, .42);
    /* glossy 3D: heller Lichtsaum oben, weicher Innenschatten unten, gestaffelte Schlagschatten */
    --shadow-3d: inset 0 1.6px 0 rgba(255, 255, 255, .92), inset 0 -16px 28px -24px rgba(46, 56, 32, .2), 0 2px 6px rgba(40, 45, 28, .05), 0 22px 42px -24px rgba(38, 50, 28, .42);
    --gloss-green: linear-gradient(165deg, var(--accent-light), var(--accent) 52%, var(--accent-strong));
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

/* Sicherheitsnetz: alle direkten Page-Kinder von .content (Bund, Laender,
   Regierung, ...) duerfen nicht breiter werden als der Layout-Container.
   Muss UNSCOPED stehen, weil die Kinder Blazor-Scope-Attribute der jeweiligen
   Page-Komponenten tragen, nicht das der Layout-Komponente. Sonst wuerde
   z. B. ".dash" mit seinem max-width:1320px den .content (mobil ~430px)
   sprengen und horizontaler Overflow waere geclippt - aber nicht behoben. */
/* Safety-Net nur fuer Mobil (<=1080px): wenn .content schmaler als
   --content-max ist, duerfen Page-Kinder wie .dash nicht ihre eigene
   max-width:1320px erzwingen. Auf Desktop dagegen behalten alle Seiten
   die einheitliche --content-max-Breite (zentriert), damit Bund, Laender,
   Regierung und der Topbar-Header gleich breit ausfluchten. */
@media (max-width: 1080px) {
    .content > * {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Mobile: Body-Scrollbar verbergen, damit die Bottom-Tab-Bar visuell
       ueber allem liegt. Scrollen funktioniert weiterhin per Touch/Wheel. */
    html, body {
        scrollbar-width: none;
    }
    html::-webkit-scrollbar,
    body::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }
}

body {
    font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.55;
    cursor: default;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-user-select: none;
    user-select: none;

    background-color: var(--bg);
}

/* Warmer Rose-Peach-Verlauf - holt das Premium-Feel des X-Banners auf die
   Webseite. Keine externe Grafik mehr, damit das Branding konsistent bleibt
   und die Ladezeit besser wird. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 18% 12%, rgba(245, 198, 187, .72), transparent 55%),
        radial-gradient(ellipse at 85% 0%, rgba(232, 191, 197, .55), transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(247, 215, 198, .50), transparent 60%),
        linear-gradient(168deg, #f7e2d5 0%, #efcec3 55%, #e8c0b6 100%);
}

/* zusaetzlicher heller Schleier - dampft die Sättigung leicht ab, damit der
   Hintergrund nicht mit dem Content konkurriert. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(255, 248, 242, .30);
    pointer-events: none;
}

h1, h2, h3, h4 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -.018em;
}

/* Ueberschrift wird beim Navigieren programmatisch fokussiert - kein sichtbarer Rahmen. */
h1:focus,
h1:focus-visible {
    outline: none;
}

a {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

    a:hover {
        text-decoration: underline;
    }

button {
    font-family: inherit;
}

/* Icon-Groessen (global, da die SVGs in der Icon-Komponente liegen) */
svg.icon,
svg.nav-ico,
svg.ctl-ico,
svg.meta-svg,
svg.section-svg,
svg.badge-ico,
svg.chip-n-ico,
svg.placeholder-ico {
    display: block;
    flex-shrink: 0;
}

svg.placeholder-ico {
    width: 44px;
    height: 44px;
    opacity: .55;
    color: var(--accent);
}

/* Stuhl-Symbol im Bundeslaender-Sitz-Badge */
svg.chip-n-ico {
    width: 10px;
    height: 10px;
    opacity: .75;
}

svg.icon {
    width: 16px;
    height: 16px;
}

svg.nav-ico {
    width: 18px;
    height: 18px;
}

svg.ctl-ico {
    width: 14px;
    height: 14px;
}

svg.meta-svg {
    width: 21px;
    height: 21px;
}

svg.section-svg {
    width: 17px;
    height: 17px;
}

svg.badge-ico {
    width: 13px;
    height: 13px;
}

/* Eigene, schlanke Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: #b7bda3 transparent;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #b7bda3;
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #98a083;
        background-clip: padding-box;
    }

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Tabelle: sehr duenne, gruenliche Scrollbar */
.matrix-wrap {
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-rgb), .2) transparent;
}

.matrix-wrap::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.matrix-wrap::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), .2);
    border-radius: 999px;
}

    .matrix-wrap::-webkit-scrollbar-thumb:hover {
        background: rgba(var(--accent-rgb), .38);
    }

/* Chip-Leiste: extrem dezente, gruenliche Scrollbar - beim Hover etwas deutlicher */
.chips {
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-rgb), .13) transparent;
}

.chips::-webkit-scrollbar {
    height: 4px;
}

.chips::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), .13);
    border-radius: 999px;
}

.chips:hover {
    scrollbar-color: rgba(var(--accent-rgb), .3) transparent;
}

    .chips:hover::-webkit-scrollbar-thumb {
        background: rgba(var(--accent-rgb), .3);
    }

/* Rand-Verlauf der Chip-Leiste - als <number> registriert, damit das
   Ein-/Ausblenden weich animiert werden kann. */
@property --fade-l {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

@property --fade-r {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

/* ===== Wahltrend: zentrierte Zusammenfassung oben im Diagramm ===== */
/* Subheadline mit dem gewaehlten Bundesland direkt ueber der Chart-Summary -
   nur auf der Laender-Seite gerendert, damit das geteilte Bild und die
   Webansicht eindeutig zeigen, fuer welches Land der Wahltrend gilt. */
.chart-land {
    margin: 0 auto 4px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: .02em;
}

.chart-summary {
    margin: 0 auto 18px;
    /* rechts genug Polster, damit der absolut positionierte Teilen-Knopf
       (~95px Breite incl. Beschriftung, rechts: 18px) den Text nicht ueber-
       deckt - frueher waren es nur 56px und der Text rutschte unter den Knopf. */
    padding: 0 110px;
    max-width: 80ch;
    text-align: center;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
    .chart-summary {
        /* rechts genug Polster, damit der absolut positionierte Share-Knopf
           (~36px Breite, rechts: 18px) nicht ueber dem Text liegt */
        padding: 0 60px 0 8px;
        font-size: .82rem;
        text-align: left;
    }
}

/* ===== Seitenfuss mit Rechts-Links (auf jeder Seite sichtbar) ===== */
.site-foot {
    /* direkt unter dem Inhalt - kein margin-top:auto, das wuerde den Footer
       bei kurzem Inhalt nach unten druecken und einen leeren Riesen-Streifen
       erzeugen. Footer haengt jetzt sauber an den Content an, mit ausreichend
       Atem nach oben und unten. */
    margin: 40px auto 0;
    width: 100%;
    max-width: var(--content-max);
    padding: 26px 4px 22px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
    font-size: .8rem;
    color: var(--ink-faint);
}

.site-foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

    .site-foot-links a {
        color: var(--ink-soft);
        font-weight: 500;
    }

        .site-foot-links a:hover {
            color: var(--accent-strong);
        }

.site-foot-meta {
    margin-left: auto;
}

    .site-foot-meta a {
        color: var(--accent);
    }

@media (max-width: 820px) {
    /* die feste Tab-Leiste am Boden ist schon durch .content's
       padding-bottom abgedeckt - hier kein zusaetzliches margin nach unten,
       oben aber bewusst etwas Atem zum vorhergehenden Inhalt */
    .site-foot {
        margin: 28px auto 0;
        padding: 20px 4px 16px;
    }

    .site-foot-meta {
        margin-left: 0;
    }
}

/* ===== Einfache Inhaltsseiten (Impressum, Datenschutz, Offene Daten) ===== */
/* ===== EINHEITLICHE SEITENBREITE =======================================
   Alle Hauptseiten (Bund, Laender, Regierung, Impressum, Datenschutz,
   Offene Daten) teilen sich dieselbe Container-Klasse. Diese Regel ist
   GLOBAL definiert (nicht scoped), damit sich keine page-spezifischen
   Werte einschleichen koennen. Topbar nutzt den gleichen --content-max-Wert. */
.dash,
.infopage {
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
}

/* Eingangs-Animation: statt eines einzigen Block-Fades steigen die Inhalts-
   bloecke der Seite dezent GESTAFFELT ein. Laeuft bei jeder Navigation neu,
   weil die Page-Komponente (und damit .dash) frisch gemountet wird. */
.dash > * {
    animation: riseIn .55s cubic-bezier(.22, .61, .36, 1) both;
}

.dash > *:nth-child(1) { animation-delay: .03s; }
.dash > *:nth-child(2) { animation-delay: .09s; }
.dash > *:nth-child(3) { animation-delay: .15s; }
.dash > *:nth-child(4) { animation-delay: .21s; }
.dash > *:nth-child(5) { animation-delay: .27s; }
.dash > *:nth-child(6) { animation-delay: .33s; }
.dash > *:nth-child(7) { animation-delay: .39s; }
.dash > *:nth-child(n+8) { animation-delay: .45s; }

/* Übersicht-Kacheln zusaetzlich einzeln staffeln (der Grid-Container selbst
   animiert nicht, sonst doppelter Fade). */
.ueb-grid {
    animation: none !important;
}

.ueb-grid > * {
    animation: riseIn .55s cubic-bezier(.22, .61, .36, 1) both;
}

.ueb-grid > *:nth-child(1) { animation-delay: .10s; }
.ueb-grid > *:nth-child(2) { animation-delay: .17s; }
.ueb-grid > *:nth-child(3) { animation-delay: .24s; }
.ueb-grid > *:nth-child(4) { animation-delay: .31s; }
.ueb-grid > *:nth-child(n+5) { animation-delay: .38s; }

.infopage {
    margin-bottom: 28px;
    animation: infoIn .45s ease both;
}

/* infopage-Kinder ebenfalls gestaffelt einblenden */
.infopage > * {
    animation: riseIn .5s cubic-bezier(.22, .61, .36, 1) both;
}

.infopage > *:nth-child(1) { animation-delay: .04s; }
.infopage > *:nth-child(2) { animation-delay: .10s; }
.infopage > *:nth-child(3) { animation-delay: .16s; }
.infopage > *:nth-child(n+4) { animation-delay: .22s; }

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reduzierte Bewegung respektieren - barrierearm. */
@media (prefers-reduced-motion: reduce) {
    .dash > *,
    .ueb-grid > *,
    .infopage > * {
        animation: none !important;
    }
}

/* ===== Lade-Kringel - dezent, zentriert, kein Layout-Sprung ===== */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 360px;
    padding: 40px 12px;
    animation: loaderFade .25s ease both;
}

.loader-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--line-soft);
    border-top-color: var(--accent);
    animation: loaderSpin .85s linear infinite;
}

.loader-label {
    font-size: .82rem;
    color: var(--ink-soft);
    letter-spacing: .03em;
}

@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}

@keyframes loaderFade {
    from { opacity: 0; }
}

@keyframes infoIn {
    from {
        opacity: 0;
        transform: translateY(9px);
    }
}

.infopage-head {
    margin-bottom: 24px;
}

.infopage-kicker {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.infopage-title {
    margin: 6px 0 0;
    font-family: var(--font-display);
    font-weight: 200;
    font-size: 2.7rem;
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--ink);
}

.infopage-lead {
    margin: 10px 0 0;
    color: var(--ink-soft);
    font-size: 1rem;
    max-width: 70ch;
}

.panel {
    background: linear-gradient(157deg, rgba(255, 255, 255, .82), rgba(255, 253, 244, .5) 70%);
    backdrop-filter: blur(20px) saturate(165%);
    -webkit-backdrop-filter: blur(20px) saturate(165%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-3d);
    padding: 26px 32px;
    margin-bottom: 22px;
}

.legal h2 {
    margin: 22px 0 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.18rem;
    color: var(--ink);
}

    .legal h2:first-child {
        margin-top: 0;
    }

.legal h3 {
    margin: 16px 0 4px;
    font-size: .96rem;
    font-weight: 700;
    color: var(--ink);
}

.legal p,
.legal li {
    font-size: .92rem;
    line-height: 1.62;
    color: var(--ink-soft);
    /* lesbare Zeilenlaenge, auch wenn die Karte die volle Inhaltsbreite hat */
    max-width: 78ch;
}

.legal p {
    margin: 6px 0;
}

.legal ul {
    margin: 6px 0;
    padding-left: 20px;
}

/* Ueberschriften duerfen die volle Kartenbreite ausnutzen */
.legal h2,
.legal h3 {
    max-width: none;
}

.legal a {
    color: var(--accent-strong);
}

.legal strong {
    color: var(--ink);
}

/* Markierung fuer noch zu ergaenzende Pflichtangaben (z. B. Adresse) */
.legal-todo {
    display: block;
    margin: 10px 0;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    background: #fdebc4;
    border: 1px dashed #d8a93b;
    color: #6b4e00;
    font-size: .86rem;
    line-height: 1.5;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fdebc4;
    color: #6b4e00;
    bottom: 0;
    left: 0;
    width: 100%;
    position: fixed;
    z-index: 1000;
    display: none;
    padding: .9rem 2.6rem .9rem 1.4rem;
    font-size: .9rem;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, .18);
}

    #blazor-error-ui .reload {
        color: #6b4e00;
        font-weight: 600;
    }

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 1rem;
        top: .8rem;
    }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: #fff;
    border-radius: var(--radius-sm);
}

    .blazor-error-boundary::after {
        content: "Ein Fehler ist aufgetreten.";
    }

/* Hinweisbanner im Wahltrend-Diagramm.
   - Standard (Fallback "keine Umfragen im Zeitraum"): warmer Sand-Ton.
   - .chart-notice-info (Wahltermin-Cutoff aktiv): ruhiges Blaugruen. */
.chart-notice {
    display: flex;
    gap: .55rem;
    align-items: center;
    margin: 0 0 .85rem;
    padding: .55rem .8rem;
    border-radius: 12px;
    background: rgba(243, 200, 80, .14);
    border: 1px solid rgba(180, 130, 30, .22);
    color: var(--ink);
    font-size: .86rem;
    line-height: 1.35;
}

.chart-notice b { font-weight: 600; }

.chart-notice svg.ctl-ico {
    width: 16px;
    height: 16px;
    color: rgba(140, 95, 20, .85);
    flex-shrink: 0;
}

.chart-notice-info {
    background: rgba(80, 150, 130, .12);
    border-color: rgba(40, 110, 95, .22);
}

.chart-notice-info svg.ctl-ico {
    color: rgba(35, 105, 90, .9);
}

/* Leerstand-Karte im Chart-Bereich: ersetzt das Diagramm, wenn es nichts
   sinnvoll zu zeigen gibt (z.B. "Letzte Wahl"-Modus ohne Post-Wahl-Umfragen). */
.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    padding: 36px 24px 30px;
    text-align: center;
    color: var(--ink-soft);
    font-size: .92rem;
    line-height: 1.45;
}

.chart-empty strong {
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 700;
    max-width: 36rem;
}

.chart-empty span {
    max-width: 38rem;
}

.chart-empty .chart-empty-ico {
    width: 44px;
    height: 44px;
    padding: 10px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-radius: 13px;
}

.chart-empty .hint-action {
    margin-top: 6px;
}

/* Erhebungen-Zeilen, die im Kontext gezeigt aber NICHT zum aktuellen Schnitt
   beitragen (z.B. vor dem Wahltermin-Cutoff): gedaempft, damit der Beitrag
   zum gerade gezeigten Trend visuell unterscheidbar bleibt. */
.matrix tbody tr.row-outscope {
    opacity: .68;
    filter: saturate(.8);
}

.matrix tbody tr.row-outscope:hover {
    opacity: 1;
    filter: none;
}

.matrix-subnote {
    margin: 4px 6px 10px;
    font-size: .78rem;
    color: var(--ink-soft);
    font-style: italic;
}

/* Disabled-Variante des Segment-Buttons: nicht klickbar, leicht ausgegraut. */
.seg.seg-disabled,
.seg[disabled] {
    opacity: .42;
    cursor: not-allowed;
    pointer-events: auto;
}

/* "Seit Wahl"-Pill im Wahltrend-Chart: optionaler Override, der das Fenster
   auf Polls seit dem Wahltermin reduziert. Nur bei recent Wahl sichtbar. */
.seit-wahl-pill {
    display: inline-flex;
    align-self: flex-start;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: .45rem;
    margin: 0 0 12px;
    padding: .42rem .9rem .42rem .7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
    border: 1px solid var(--line-soft);
    color: var(--ink-soft);
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .12s;
}

.seit-wahl-pill:hover {
    background: rgba(255, 255, 255, .85);
    color: var(--ink);
}

.seit-wahl-pill:active {
    transform: scale(.97);
}

.seit-wahl-pill.on {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.seit-wahl-pill.on:hover {
    background: var(--accent);
    filter: brightness(.95);
}

.seit-wahl-pill svg.ctl-ico {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Kleines Help-Icon neben Filter-Labels. Zeigt auf Hover den Tooltip
   per native title-Attribut. Bewusst dezent, damit die Filter-Zeile
   nicht visuell ueberladen wirkt. */
.ctl-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 4px;
    border-radius: 50%;
    background: rgba(60, 50, 30, .12);
    color: var(--ink-soft);
    font-size: .65rem;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    transition: background .15s, color .15s;
    user-select: none;
}

.ctl-help:hover {
    background: var(--accent);
    color: #fff;
}

/* Warn-Variante des chart-notice: das wechselt der User mit einem Klick aufs
   passende Zeitraum-Fenster (Quick-Action im selben Banner). */
.chart-notice-warn {
    background: rgba(220, 165, 60, .14);
    border-color: rgba(170, 120, 30, .26);
    /* Icon oben an die erste Textzeile heften, Button darf unter den Text
       rutschen, wenn die Karte schmal ist. */
    align-items: flex-start;
    flex-wrap: wrap;
}

.chart-notice-warn svg.ctl-ico {
    color: rgba(155, 100, 25, .9);
    margin-top: 3px;
    flex-shrink: 0;
}

.chart-notice-warn > span {
    flex: 1 1 220px;
    min-width: 0;
}

.hint-action {
    margin-left: auto;
    padding: .35rem .75rem;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: filter .15s, transform .12s;
}

.hint-action:hover {
    filter: brightness(.92);
}

.hint-action:active {
    transform: scale(.97);
}

/* ============================================================
   Sidebar einklappen (Desktop >1080px)
   - Sanftes Aus-/Einklappen ueber width-Transition.
   - Eingeklappte Sidebar hat exakt dasselbe vertikale Layout wie die
     ausgeklappte, nur ohne Text. Texte werden via opacity/width ausgeblendet
     (nicht display:none) damit der Width-Uebergang stabil laeuft.
   - Alle anklickbaren Elemente (Toggle, Brand-Logo, Nav-Tiles) sind im
     eingeklappten Zustand exakt gleich gross (40x40) und identisch zentriert.
   ============================================================ */

/* --- Generelle Transitions: gelten in beide Richtungen --- */
.sidebar {
    transition: width .32s cubic-bezier(.4, 0, .2, 1);
}

.brand,
.brand-mark,
.brand-meta,
.nav,
.nav ::deep .nav-link,
.nav-link,
.nav ::deep .nav-ico,
.nav-ico,
.nav ::deep .nav-label,
.nav-label,
.nav-section,
.nav ::deep .nav-new,
.nav-new,
.side-foot,
.sidebar-toggle {
    transition: width .28s cubic-bezier(.4, 0, .2, 1),
                height .28s cubic-bezier(.4, 0, .2, 1),
                padding .28s cubic-bezier(.4, 0, .2, 1),
                margin .28s cubic-bezier(.4, 0, .2, 1),
                opacity .2s ease,
                background .15s ease,
                color .15s ease,
                border-color .15s ease,
                transform .25s cubic-bezier(.4, 0, .2, 1);
}

/* --- Einklapp-Knopf: sitzt rechts in der Brand-Zeile (Desktop). Im
   eingeklappten Modus wird er via .sidebar-collapsed neu positioniert. --- */
.sidebar-toggle {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, .6);
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: #fff;
    border-color: var(--accent);
}

.sidebar-toggle-chevron {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-left: 2px solid var(--ink-soft);
    border-top: 2px solid var(--ink-soft);
    transform: translateX(1px) rotate(-45deg);
}

body.sidebar-collapsed .sidebar-toggle-chevron {
    transform: translateX(-1px) rotate(135deg);
}

@media (min-width: 1081px) {
    /* --- Eingeklappte Sidebar --------------------------------------------- */
    body.sidebar-collapsed .sidebar {
        width: 64px !important;
    }

    /* Brand: Logo zentriert, Toggle darunter (statt rechts daneben). */
    body.sidebar-collapsed .brand {
        padding: 12px 0 10px;
        margin-bottom: 0;
        flex-direction: column;
        gap: 8px;
        justify-content: center;
        border-bottom: 1px solid var(--line-soft);
    }

    body.sidebar-collapsed .brand-mark {
        width: 40px;
        height: 40px;
    }

    body.sidebar-collapsed .brand .sidebar-toggle {
        margin-left: 0;
    }

    /* Text-Elemente komplett ausblenden, wenn die Sidebar eingeklappt ist.
       display:none ist robuster als opacity+width:0 - die scoped Razor-CSS
       kann sonst auf gleicher Spezifitaet die Width zurueckkippen. */
    body.sidebar-collapsed .brand-meta,
    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .nav-section,
    body.sidebar-collapsed .nav-new,
    body.sidebar-collapsed .nav-soon,
    body.sidebar-collapsed .side-foot {
        display: none !important;
    }

    /* Nav-Container */
    body.sidebar-collapsed .nav {
        padding: 10px 12px 0;
        gap: 4px;
        align-items: center;
    }

    /* Nav-Tiles: identisch 40x40, zentriert, gleiche Form wie Toggle/Brand */
    body.sidebar-collapsed .nav ::deep .nav-link,
    body.sidebar-collapsed .nav-link {
        width: 40px;
        height: 40px;
        padding: 0;
        gap: 0;
        border-radius: 11px;
        justify-content: center;
        align-items: center;
        align-self: center;
    }

    /* Icon mittig auf dem Tile */
    body.sidebar-collapsed .nav ::deep .nav-ico,
    body.sidebar-collapsed .nav-ico {
        width: 22px;
        height: 22px;
        flex: 0 0 22px;
    }
}

/* Auf Mobil ist die Sidebar ohnehin via media-query auf height:0,
   der Toggle dort sinnlos - verstecken. */
@media (max-width: 1080px) {
    .sidebar-toggle {
        display: none;
    }
}
