@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

/* ─────────────────────────────────────────────────────────────────────────────
   Tradability's visual identity - "Swiss Ledger Brutalism" (Design-MVP V3,
   bestätigte Gewinnrichtung, siehe docs/brand/BRAND.md)

   Der Markt, protokolliert wie ein Befund: eine einzige Mono-Schrift für
   alles (Überschrift, Fließtext, Zahl, UI), harte 1px-Linien statt Schatten
   als tragendes Strukturelement, keine gerundete Ecke irgendwo, gefüllte/
   hohle Quadrate als Status-Anzeige (● verfügbar / ○ geplant). Kein Glas,
   kein Foto, keine Collage - das Protokoll selbst ist der Auftritt.

   Regeln:
   - FARBE IST DATEN. Grün und Rot in Charts bedeuten gemessene Bewegung, sonst
     nichts. Der Akzent ist getrennt davon: ein Live-Punkt, eine Auswahl, ein
     Wort - nie ein Kurswert.
   - HARTE LINIE STATT SCHATTEN. Jede Fläche ist ein Rahmen mit 1px-Kante, nie
     ein Schlagschatten; jede Ecke ist eckig (--radius: 0).
   - KEINE DEKORATION OHNE FUNKTION. Kein Bild, das nur schmückt - Typografie,
     echte Daten und die Linie selbst tragen die Seite.

   Hell ist die Standardansicht. Dunkel ist dieselbe Fläche invertiert.
   [data-accent] tauscht nur die Akzentfarbe.
   ───────────────────────────────────────────────────────────────────────── */

:root,
:root[data-theme="light"] {
    --paper: #F4F4F2;
    --paper-raised: #FFFFFF;
    --paper-sunk: rgb(18 18 18 / 4%);
    --ink: #121212;

    --app-background: var(--paper);
    --sidebar-background: var(--paper);
    --surface-base: var(--paper);
    --surface-raised: var(--paper-raised);
    --surface-hover: rgb(18 18 18 / 5%);
    --surface-inset: var(--paper-sunk);
    --border-subtle: rgb(18 18 18 / 18%);
    --border-strong: #121212;
    --glass-edge: transparent;
    --text-primary: var(--ink);
    --text-secondary: #3A3B40;
    --text-muted: #55565C;
    --text-faint: rgb(18 18 18 / 22%);
    --text-quiet: rgb(18 18 18 / 62%);
    --positive: #121212;
    --negative: #C62820;
    --warning: #B26B00;
    --info: #0071E3;
    --violet: #7C5CFC;
    --tan: #121212;
    --on-tan: #F4F4F2;
    --chart-grid: rgb(18 18 18 / 12%);
    --shadow-card: none;
    --shadow-glass: none;
    --shadow-paper: none;
    --glass-blur: none;
    --glow-1: transparent;
    --glow-2: transparent;
    --grid-line: rgb(18 18 18 / 10%);
    --brand-cobalt: var(--accent);
    --brand-ink: #121212;
    --brand-counter: var(--app-background);
    color-scheme: light;
}

:root[data-theme="dark"] {
    --paper: #101010;
    --paper-raised: #181818;
    --paper-sunk: rgb(244 244 242 / 5%);
    --ink: #F4F4F2;

    --app-background: var(--paper);
    --sidebar-background: var(--paper);
    --surface-base: var(--paper);
    --surface-raised: var(--paper-raised);
    --surface-hover: rgb(244 244 242 / 8%);
    --surface-inset: var(--paper-sunk);
    --border-subtle: rgb(244 244 242 / 20%);
    --border-strong: #F4F4F2;
    --glass-edge: transparent;
    --text-primary: var(--ink);
    --text-secondary: #C7C8CE;
    --text-muted: #9A9BA3;
    --text-faint: rgb(244 244 242 / 24%);
    --text-quiet: rgb(244 244 242 / 56%);
    --positive: #F4F4F2;
    --negative: #FF4A3F;
    --warning: #FFB340;
    --info: #409CFF;
    --violet: #A98BFF;
    --tan: #F4F4F2;
    --on-tan: #101010;
    --chart-grid: rgb(244 244 242 / 14%);
    --shadow-card: none;
    --shadow-glass: none;
    --shadow-paper: none;
    --glass-blur: none;
    --glow-1: transparent;
    --glow-2: transparent;
    --grid-line: rgb(244 244 242 / 10%);
    --brand-cobalt: var(--accent);
    --brand-ink: #F4F4F2;
    --brand-counter: var(--app-background);
    color-scheme: dark;
}

/* Eine Akzentfarbe, Gold, kein Nutzer-Setting mehr (siehe Settings.razor). Der
   data-accent-Schlüssel "olive" ist historisch und bleibt, weil er so in Profilen und im
   localStorage steht - ein neuer Schlüssel würde jede gespeicherte Wahl verwerfen. */
:root,
:root[data-theme="light"][data-accent="olive"] {
    --accent: #8A5A22;
    --accent-bright: #7A5220;
    --accent-soft: rgb(156 107 46 / 10%);
    --on-accent: #F4F4F2;
}

/* Im Dunkeln muss dieselbe Farbe heller liegen, sonst verschwindet sie. */
:root[data-theme="dark"],
:root[data-theme="dark"][data-accent="olive"] {
    --accent: #D7BC91;
    --accent-bright: #F3DDB9;
    --accent-soft: rgb(215 188 145 / 16%);
    --on-accent: #101010;
}

:root {
    /* Depot-Ring: vier Stufen derselben Akzentfarbe, gegen den Grund gemischt. */
    --alloc-1: var(--accent);
    --alloc-2: color-mix(in oklab, var(--accent), var(--app-background) 30%);
    --alloc-3: color-mix(in oklab, var(--accent), var(--app-background) 52%);
    --alloc-4: color-mix(in oklab, var(--accent), var(--app-background) 70%);
    --accent-2: var(--accent);
    --accent-2-soft: var(--accent-soft);

    /* Chart-Tokens (Namen wie bei bklit-ui/shadcn). --chart-1 ist die Serie, die zählt;
       Bewegung ist Tinte, nicht Grün/Rot: Anstieg bleibt Ink, Rückgang ist der Akzent. */
    --chart-1: var(--ink);
    --chart-2: var(--text-primary);
    --chart-3: var(--info);
    --chart-4: var(--warning);
    --chart-5: var(--violet);
    --chart-up: var(--positive);
    --chart-down: var(--negative);
    --chart-crosshair: var(--border-strong);
    --chart-label: var(--text-muted);

    /* Kein Radius irgendwo: jede Fläche und jede Aktion ist eine scharfe Kante. */
    --radius: 0px;
    --radius-sm: 0px;
    --radius-pill: 0px;

    /* Eine Mono-Schrift trägt alles - Überschrift, Fließtext, Oberfläche, jede Zahl. */
    --font-display: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
    --font-body: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

    /* Ebenen: nur diese Werte, nirgends eine erfundene Zahl. */
    --z-base: 1;
    --z-sticky: 20;
    --z-overlay: 40;
    --z-modal: 60;
    --z-grain: 90;
    --z-toast: 1000;

    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-spring: cubic-bezier(.2, 1.1, .3, 1);
}

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

html {
    background: var(--app-background);
    min-width: 20rem;
    scroll-behavior: smooth;
}

body {
    background: var(--app-background);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    margin: 0;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    transition: background-color .3s ease, color .3s ease;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-variant-numeric: lining-nums;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.08;
    text-wrap: balance;
}

h2 {
    line-height: 1.16;
}

h3 {
    font-weight: 600;
    line-height: 1.24;
}

h1 {
    font-size: clamp(2rem, 3.6vw, 2.9rem);
}

h2 {
    font-size: 1.25rem;
}

h3 {
    font-size: .98rem;
}

/* Hervorhebung in einer Überschrift: derselbe Schnitt, nur der Akzent - keine Kursive,
   keine zweite Schriftfamilie. */
h1 em,
h2 em {
    color: var(--accent);
    font-style: normal;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

p {
    text-wrap: pretty;
}

h1:focus,
h2:focus,
h3:focus {
    outline: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--accent);
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
}

a:hover {
    color: var(--accent-bright);
    text-decoration-color: currentColor;
}

/* Sichtbarer Fokus überall, nur für die Tastatur. */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

::selection {
    background: var(--accent);
    color: var(--on-accent);
}

.visually-hidden {
    border: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}

.skip-link {
    background: var(--ink);
    color: var(--paper);
    font-size: .85rem;
    font-weight: 600;
    left: 1rem;
    padding: .6rem .9rem;
    position: fixed;
    text-decoration: none;
    top: -4rem;
    transition: top .2s var(--ease-out);
    z-index: var(--z-toast);
}

.skip-link:focus {
    color: var(--paper);
    top: 1rem;
}

/* Die eine Karte, aus der jedes Panel besteht: harte 1px-Kante, keine Ecke,
   kein Schatten - das Panel selbst ist die Linie im Protokoll. */
.dashboard-card,
.glass {
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    transition: background-color .25s var(--ease-out), border-color .25s var(--ease-out), transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}

/* Rubrik: Index-Nummer im Akzent plus gesperrtes Label, wie eine Abschnittszeile
   im Protokoll. */
.eyebrow {
    align-items: baseline;
    color: var(--text-muted);
    display: flex;
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 600;
    gap: .55rem;
    letter-spacing: .12em;
    margin: 0;
    text-transform: uppercase;
}

.eyebrow::before {
    background: none;
    color: var(--accent);
    content: "§";
    display: inline;
    font-weight: 700;
    height: auto;
    width: auto;
}

.mono-number {
    font-family: var(--font-mono);
    font-size: .93em;
    font-variant-numeric: tabular-nums slashed-zero;
    letter-spacing: -.01em;
}

.positive {
    color: var(--positive) !important;
}

.negative {
    color: var(--negative) !important;
}

.neutral {
    color: var(--text-secondary) !important;
}

/* ── Protokoll-Bausteine (Swiss Ledger Brutalism) ─────────────────────────────
   Der gefüllte/hohle Quadrat-Status und die Index-Nummer sind das immer
   wiederkehrende Vokabular: "verfügbar" vs. "geplant", "01" vs. "02". Beide
   sind reine Utility-Klassen, damit jede Seite sie gleich benutzt. */
.sq {
    display: inline-block;
    flex-shrink: 0;
    height: 8px;
    width: 8px;
}

.sq-live {
    background: var(--accent);
}

.sq-warn {
    background: var(--warning);
}

.sq-info {
    background: var(--info);
}

.sq-off {
    background: transparent;
    border: 1px solid var(--text-faint);
}

.status {
    align-items: center;
    color: var(--text-muted);
    display: inline-flex;
    font-family: var(--font-mono);
    font-size: .68rem;
    gap: .45rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.idx {
    color: var(--accent);
    font-weight: 700;
}

.label {
    color: var(--text-muted);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.tnum {
    font-variant-numeric: tabular-nums;
}

/* Eine Abschnittszeile wie über einer Kurstabelle: Index links, Kontext rechts,
   eine harte Regel darüber trennt vom vorherigen Abschnitt. */
.section-index {
    align-items: baseline;
    border-top: 1px solid var(--border-strong);
    color: var(--text-muted);
    display: flex;
    font-family: var(--font-mono);
    font-size: .72rem;
    justify-content: space-between;
    letter-spacing: .1em;
    margin-bottom: 1.6rem;
    padding-top: 1.4rem;
    text-transform: uppercase;
}

/* ── Bedienelemente ───────────────────────────────────────────────────────── */

.btn {
    align-items: center;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    font-family: var(--font-mono);
    font-size: .78rem;
    font-weight: 600;
    gap: .5rem;
    justify-content: center;
    letter-spacing: .06em;
    line-height: 1;
    padding: .9rem 1.5rem;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color .22s var(--ease-out), color .22s var(--ease-out), transform .15s var(--ease-out), box-shadow .22s var(--ease-out);
    white-space: nowrap;
}

.btn:hover {
    background: var(--ink);
    box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--ink) 45%, transparent);
    color: var(--paper);
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(.98);
}

/* Die primäre Aktion: gefüllt in Tinte, wie der "Score ansehen"-Knopf im
   Protokoll - nie die Akzentfarbe selbst, die bleibt dem Live-Punkt vorbehalten. */
.btn-primary {
    background: var(--tan);
    color: var(--on-tan);
}

.btn-primary:hover {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    border-color: var(--text-primary);
}

/* Die zweite Aktion daneben: derselbe umrandete Knopf, keine Unterstreichung. */
.btn-ghost {
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    padding: .9rem 1.5rem;
}

.btn-ghost:hover {
    background: var(--ink);
    color: var(--paper);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--positive);
}

.invalid {
    outline: 1px solid var(--negative);
}

.validation-message {
    color: var(--negative);
    font-size: .76rem;
}

.blazor-error-boundary {
    background: var(--surface-raised);
    border: 1px solid color-mix(in srgb, var(--negative) 45%, var(--border-subtle));
    border-radius: var(--radius-sm);
    color: var(--negative);
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "Dieser Bereich konnte nicht geladen werden.";
}

/* Entrances are finite Web Animations in js/motion.js. Content remains visible
   without JavaScript, observers or animation support; no persistent hidden state. */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* .nav-item lives here, not in MainLayout.razor.css: NavLink does not forward
   Blazor's CSS-isolation scope attribute to its rendered <a> (verified via the
   served HTML -- a plain <button class="nav-item"> in the same file carries
   the scope attribute, the NavLink-rendered <a> does not), so a scoped rule
   here would silently never match a real nav link. */
.nav-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    font-family: var(--font-mono);
    font-size: .78rem;
    font-weight: 500;
    gap: .4rem;
    letter-spacing: .03em;
    padding: .5rem .1rem;
    position: relative;
    text-decoration: none;
    transition: color .2s var(--ease-out);
    white-space: nowrap;
}

/* Eine Linie zieht sich beim Hover von links auf, statt nur die Farbe zu wechseln -
   dieselbe Bewegung, die aktiv bleibt, markiert danach auch "hier bin ich". */
.nav-item::after {
    background: currentColor;
    bottom: 0;
    content: "";
    height: 1.5px;
    left: .1rem;
    position: absolute;
    right: .1rem;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s var(--ease-out);
}

.nav-item:hover:not(:disabled) {
    background: transparent;
    color: var(--text-primary);
}

.nav-item:hover:not(:disabled)::after {
    transform: scaleX(1);
}

/* Der aktive Eintrag bekommt die Tinte statt einer Fläche - kein Radgrund passt zu
   einer Zeile aus harten Regeln, nur die Farbe selbst markiert "hier". */
.nav-item.active {
    background: transparent;
    color: var(--text-primary);
    font-weight: 700;
}

.nav-item.active::after {
    transform: scaleX(1);
}

.nav-item.planned {
    cursor: not-allowed;
    opacity: .6;
}

/* Im "Mehr"-Dropdown und im mobilen Menü füllt jeder Punkt die volle Breite, jede
   Zeile durch eine Regel getrennt statt durch Radius. */
/* Die Zeile trennt hier schon per border-bottom - die Hover-Linie aus
   .nav-item::after würde direkt darauf liegen, darum aus. */
.nav-more-panel .nav-item::after,
.primary-nav.is-open .nav-item::after {
    display: none;
}

.nav-more-panel .nav-item,
.primary-nav.is-open .nav-item {
    border-bottom: 1px solid var(--border-subtle);
    justify-content: space-between;
    padding: .75rem .1rem;
    width: 100%;
}

.nav-item .n {
    color: var(--accent);
    font-size: .72rem;
    margin-right: .1rem;
}

.nav-item small {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-quiet);
    font-family: var(--font-mono);
    font-size: .58rem;
    font-weight: 500;
    letter-spacing: .04em;
    line-height: 1;
    margin-left: auto;
    padding: .22rem .4rem;
    text-transform: uppercase;
}

/* Blazor WASM's own crash banner - hidden by default (Blazor's runtime clears this
   `display: none` when an unhandled exception/render error actually happens). Without
   this rule the element is visible from first paint, since nothing else sets it. */
#blazor-error-ui {
    background: var(--surface-raised);
    border-top: 2px solid var(--negative);
    bottom: 0;
    box-shadow: none;
    color: var(--text-primary);
    display: none;
    font-size: .84rem;
    left: 0;
    padding: .8rem 3rem .8rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: var(--z-toast);
}

#blazor-error-ui .reload {
    color: var(--accent);
    margin-left: .6rem;
}

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

/* Login.razor.css/Register.razor.css use InputText/ValidationMessage (framework
   built-in components) for these - like NavLink (see the .nav-item rule above),
   their rendered <input>/<div> never receives the calling component's CSS
   isolation scope attribute, so a scoped rule targeting them silently never
   matches. Verified by inspecting the live DOM: the <input> from <InputText>
   carries no b-xxxxxxxxxx attribute, only its plain-HTML siblings do. */
.field input {
    background: var(--surface-inset);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font: inherit;
    font-size: .95rem;
    padding: .72rem .8rem;
    transition: border-color .18s ease, box-shadow .18s ease;
    width: 100%;
}

.field input:hover {
    border-color: var(--text-muted);
}

.field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
    outline: none;
}

/* Shared across every page using the "auth-page" layout (Login, Register, Profile,
   WalletPair, WalletConfirm) - lives here rather than in one of those components'
   scoped .razor.css files because Blazor's CSS isolation means a scoped rule only
   ever applies to markup the OWNING component renders. */
.auth-page {
    margin: 0 auto;
    max-width: 27rem;
    padding: clamp(2rem, 7vh, 4rem) 1.4rem 3rem;
}

.auth-page header a {
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: 0;
    text-decoration: none;
}

.auth-page header a:hover {
    color: var(--text-primary);
}

.auth-page h1 {
    font-size: clamp(2rem, 4.4vw, 2.7rem);
    margin: 1.1rem 0 .6rem;
}

.auth-page header p {
    color: var(--text-muted);
    font-size: .9rem;
    line-height: 1.6;
    margin: 0 0 1.6rem;
}

/* Kein Kasten, kein Rand: das Formular liegt flach auf demselben Blatt wie alles
   andere - erst die Felder selbst (siehe .field input) markieren eine Fläche. */
.auth-panel {
    padding: 0;
}

.auth-panel .field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: 1.15rem;
}

.auth-panel .field label {
    color: var(--text-primary);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.auth-error {
    background: color-mix(in srgb, var(--negative) 12%, transparent);
    border-left: 2px solid var(--negative);
    color: var(--negative);
    font-size: .82rem;
    line-height: 1.55;
    list-style: none;
    margin: 0 0 1.1rem;
    padding: .6rem .7rem;
}

.auth-switch {
    color: var(--text-muted);
    font-size: .86rem;
    margin-top: 1.3rem;
}

.auth-panel button {
    background: var(--tan);
    border: 0;
    border-radius: var(--radius-pill);
    color: var(--on-tan);
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
    padding: .95rem 1.2rem;
    transition: background-color .18s ease, transform .12s ease;
    width: 100%;
}

.auth-panel button:hover {
    background: var(--accent);
    color: var(--on-accent);
}

.auth-panel button:active {
    transform: translateY(1px);
}

/* Same cross-component scoping gap as above. */
.page-state {
    color: var(--text-muted);
    font-size: .88rem;
}

/* ── Seitenkopf ──────────────────────────────────────────────────────────────
   Überschrift und Absatz, keine Bildmarke: das Protokoll trägt sich selbst. */
.page-header-row {
    align-items: flex-start;
    display: flex;
    gap: 1.6rem;
    justify-content: space-between;
}

.page-header-text {
    min-width: 0;
}

/* Opt-in ASCII identities: illustration beside the introduction, never on a chart. */
.page-header-row.has-ascii { align-items: center; }
.page-header-row.has-ascii .page-header-text { flex: 1 1 0; }
@media (max-width: 700px) {
    .page-header-row.has-ascii { flex-direction: column; gap: .75rem; }
    .page-header-row.has-ascii .page-header-text { flex-basis: auto; }
}

/* ── Höhenlinien ─────────────────────────────────────────────────────────────
   Muster unter dem Mauszeiger (Einstellungen → Hintergrund), im Ruhezustand
   unsichtbar. Die Linien sind nur Maske; die Farbe kommt aus der Akzentfarbe.
   Liegt fest hinter der ganzen Seite; die Hüllen der Layouts liegen darüber und
   haben dafür einen transparenten Grund. */
.topo {
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity .8s ease;
    z-index: 0;
    --ax: -9999px;
    --ay: -9999px;
    --bx: -9999px;
    --by: -9999px;
    -webkit-mask-image:
        radial-gradient(circle 60px at var(--ax) var(--ay),
            #000 0%, rgb(0 0 0 / 82%) 20%, rgb(0 0 0 / 52%) 42%, rgb(0 0 0 / 24%) 66%, rgb(0 0 0 / 7%) 86%, transparent 100%),
        radial-gradient(circle 90px at var(--bx) var(--by),
            rgb(0 0 0 / 55%) 0%, rgb(0 0 0 / 30%) 38%, rgb(0 0 0 / 10%) 70%, transparent 100%);
    mask-image:
        radial-gradient(circle 60px at var(--ax) var(--ay),
            #000 0%, rgb(0 0 0 / 82%) 20%, rgb(0 0 0 / 52%) 42%, rgb(0 0 0 / 24%) 66%, rgb(0 0 0 / 7%) 86%, transparent 100%),
        radial-gradient(circle 90px at var(--bx) var(--by),
            rgb(0 0 0 / 55%) 0%, rgb(0 0 0 / 30%) 38%, rgb(0 0 0 / 10%) 70%, transparent 100%);
}

.topo.is-on {
    opacity: 1;
}

.topo-lines {
    background: var(--accent);
    inset: 0;
    opacity: .5;
    position: absolute;
    -webkit-mask: url("img/topo.svg") center / cover no-repeat;
    mask: url("img/topo.svg") center / cover no-repeat;
}

:root[data-bg="stroemung"] .topo-lines {
    -webkit-mask-image: url("img/pattern-stroemung.svg");
    mask-image: url("img/pattern-stroemung.svg");
}

:root[data-bg="raster"] .topo-lines {
    -webkit-mask-image: url("img/pattern-raster.svg");
    mask-image: url("img/pattern-raster.svg");
}

:root[data-bg="kurslinien"] .topo-lines {
    -webkit-mask-image: url("img/pattern-kurslinien.svg");
    mask-image: url("img/pattern-kurslinien.svg");
}

:root[data-bg="aus"] .topo {
    display: none;
}

:root[data-theme="dark"] .topo-lines {
    opacity: .32;
}

/* Kein Hovern auf Touch: dort bleibt die Ebene schlicht aus. */
@media (hover: none) {
    .topo {
        display: none;
    }
}

/* Zähler für ungelesene Nachrichten: Navigation und Freundesliste teilen sich denselben. */
.unread-badge {
    background: var(--accent);
    border-radius: 999px;
    color: var(--on-accent);
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    margin-left: .45rem;
    min-width: 1.15rem;
    padding: .2rem .38rem;
    text-align: center;
    vertical-align: middle;
}
