/* ==========================================================================
   Parkett — Design-System

   Leitgedanke: eine Handelsoberflaeche, kein Werbeprospekt. Das heisst
   konkret:

     · Dichte statt Weissraum. Wer handelt, will viele Zahlen gleichzeitig
       sehen, nicht drei Karten mit viel Luft dazwischen.
     · Haarlinien statt Schatten. Ein 1px-Rahmen trennt sauberer als ein
       weicher Schlagschatten und bleibt auch bei 200 Zeilen ruhig.
     · Farbe ist Information, keine Dekoration. Gruen und Rot bedeuten
       Richtung. Bernstein bedeutet „hier ist die Handlung". Sonst nichts.
     · Zahlen laufen in Tabellenziffern, damit Spalten stehen und ein Kurs
       beim Aktualisieren nicht zappelt.
     · Keine Verlaeufe, keine Glasoptik, keine Emoji.

   Aufbau der Datei:
     1  Grundlagen (Variablen, Reset, Typografie)
     2  Geruest (Kopfzeile, Navigation, Inhalt)
     3  Bausteine (Panel, Tabelle, Kennzahl, Abzeichen)
     4  Formulare und Schaltflaechen
     5  Handel (Chart, Orderbuch, Orderticket)
     6  Meldungen, Tipps, Tutorial
     7  Anmeldeseiten
     8  Verwaltung
     9  Kleinere Bildschirme
   ========================================================================== */


/* ==========================================================================
   1 · GRUNDLAGEN
   ========================================================================== */

:root {
    /* Flaechen — von dunkel nach hell gestaffelt */
    --bg:          #0a0b0d;
    --bg-sunken:   #08090b;
    --panel:       #101216;
    --panel-hi:    #15181d;
    --panel-active:#1a1e24;

    /* Linien */
    --line:        #23272d;
    --line-soft:   #191c21;
    --line-strong: #2f343b;

    /* Schrift */
    --text:        #dfe4e9;
    --text-dim:    #97a0aa;
    --muted:       #737d87;
    --faint:       #545c65;

    /* Signale */
    --accent:      #e8b339;
    --accent-dim:  #8a6c26;
    --accent-wash: rgba(232, 179, 57, .10);
    --up:          #4fb286;
    --up-wash:     rgba(79, 178, 134, .12);
    --down:        #e0674c;
    --down-wash:   rgba(224, 103, 76, .12);
    --info:        #5b9bd5;
    --info-wash:   rgba(91, 155, 213, .12);

    /* Masse */
    --topbar-h:    52px;
    --tape-h:      26px;
    --rail-w:      212px;
    --radius:      3px;
    --radius-lg:   5px;

    /* Schriftfamilien */
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

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

/*
 * Das hidden-Attribut muss gewinnen.
 *
 * Browser setzen `[hidden] { display: none }` in ihrem eigenen Stylesheet —
 * und jede Autorenregel schlaegt das, egal wie unspezifisch sie ist. Eine
 * Zeile wie `.field { display: block }` macht damit versteckte Felder wieder
 * sichtbar. Genau das ist beim Orderticket passiert: das Limit-Feld stand
 * auch dann da, wenn „Market" gewaehlt war.
 */
[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    scrollbar-color: var(--line-strong) transparent;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.55 var(--sans);
    font-feature-settings: "tnum" 1, "cv05" 1;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-dim); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border: 3px solid var(--bg);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: #3d434b; }

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 1px;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.011em; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .93rem; }
p  { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }

small { font-size: .82em; }
code, kbd, .mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Zahlen: immer gleich breit, damit Spalten beim Aktualisieren nicht springen */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* Abschnittsueberschrift im Terminalstil */
.eyebrow {
    font-size: .688rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    font-weight: 600;
    margin: 0;
}

.dim   { color: var(--text-dim); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

.up    { color: var(--up); }
.down  { color: var(--down); }
.flat  { color: var(--muted); }
.accent{ color: var(--accent); }

.icon { flex: none; vertical-align: -.15em; }

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


/* ==========================================================================
   2 · GERUEST
   ========================================================================== */

.shell {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---- Kopfzeile ---------------------------------------------------------- */

.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--topbar-h);
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: calc(var(--rail-w) - 1rem);
    flex: none;
}

.brand-mark {
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--accent);
    font: 600 .66rem/1 var(--mono);
    letter-spacing: .04em;
}

.brand-name { font-weight: 600; font-size: .95rem; letter-spacing: -.01em; }
.brand-sub  { font-size: .66rem; color: var(--faint); letter-spacing: .08em; text-transform: uppercase; }

.topbar-stats {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    margin-left: auto;
}

.topstat { text-align: right; line-height: 1.25; }
.topstat-label { display: block; font-size: .625rem; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }
.topstat-value { font-family: var(--mono); font-size: .875rem; font-variant-numeric: tabular-nums; }

.market-state {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted);
    padding: .25rem .55rem;
    border: 1px solid var(--line);
    border-radius: 100px;
}
.market-state::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: var(--up); box-shadow: 0 0 0 3px var(--up-wash);
}
.market-state.closed { color: var(--down); }
.market-state.closed::before { background: var(--down); box-shadow: 0 0 0 3px var(--down-wash); }

/* ---- Sprachumschalter ---------------------------------------------------- */

.langswitch {
    display: inline-flex;
    gap: 1px;
    padding: 1px;
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    flex: none;
}
.langswitch > * {
    padding: .22rem .4rem;
    border-radius: 2px;
    font: 600 .66rem/1.3 var(--mono);
    letter-spacing: .04em;
    color: var(--muted);
}
.langswitch a:hover { background: var(--panel); color: var(--text); }
.langswitch .on { background: var(--panel-active); color: var(--accent); }

.auth-lang { display: flex; justify-content: center; margin-top: 1.6rem; }

/* ---- Laufband ----------------------------------------------------------- */

.tape {
    position: fixed;
    top: var(--topbar-h); left: 0; right: 0;
    height: var(--tape-h);
    z-index: 35;
    display: flex; align-items: center;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

.tape-track {
    display: flex;
    gap: 1.75rem;
    padding-left: 1rem;
    white-space: nowrap;
    animation: tape-scroll 90s linear infinite;
}
.tape:hover .tape-track { animation-play-state: paused; }

@keyframes tape-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.tape-item {
    display: inline-flex; align-items: baseline; gap: .4rem;
    font-family: var(--mono); font-size: .73rem;
}
.tape-item b { font-weight: 600; color: var(--text-dim); letter-spacing: .02em; }

@media (prefers-reduced-motion: reduce) {
    .tape-track { animation: none; overflow-x: auto; }
}

/* ---- Seitennavigation ---------------------------------------------------- */

.rail {
    position: fixed;
    top: calc(var(--topbar-h) + var(--tape-h));
    bottom: 0; left: 0;
    width: var(--rail-w);
    z-index: 30;
    display: flex; flex-direction: column;
    padding: .9rem .6rem 1rem;
    background: var(--bg-sunken);
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.rail-group { margin-bottom: 1.15rem; }
.rail-group > .eyebrow { padding: 0 .55rem; margin-bottom: .4rem; font-size: .625rem; }

.rail-link {
    display: flex; align-items: center; gap: .6rem;
    padding: .44rem .55rem;
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: .845rem;
    position: relative;
}
.rail-link:hover { background: var(--panel); color: var(--text); }
.rail-link.active { background: var(--panel-active); color: var(--text); }
.rail-link.active::before {
    content: ""; position: absolute; left: -.6rem; top: 50%;
    width: 2px; height: 15px; margin-top: -7.5px;
    background: var(--accent); border-radius: 0 2px 2px 0;
}
.rail-link .icon { color: var(--muted); }
.rail-link.active .icon { color: var(--accent); }

.rail-badge {
    margin-left: auto;
    min-width: 17px; height: 17px; padding: 0 4px;
    display: grid; place-items: center;
    background: var(--accent); color: #14120c;
    border-radius: 9px;
    font: 600 .625rem/1 var(--mono);
}

.rail-foot { margin-top: auto; padding: .7rem .55rem 0; border-top: 1px solid var(--line-soft); }

/* ---- Oeffentliche Seiten (ohne Seitennavigation) --------------------------- */

.public-main {
    max-width: 70rem;
    margin: 0 auto;
    padding: calc(var(--topbar-h) + var(--tape-h) + 1.6rem) 1.35rem 3rem;
}

.public-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: 2.5rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line-soft);
    font-size: .78rem;
    color: var(--muted);
}
.public-foot a:hover { color: var(--text); }
.public-foot .faint { color: var(--faint); }

/* ---- Inhalt --------------------------------------------------------------- */

.main {
    grid-column: 2;
    padding: calc(var(--topbar-h) + var(--tape-h) + 1.15rem) 1.35rem 4rem;
    min-width: 0;
}

.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.15rem;
}
.page-head h1 { font-size: 1.22rem; }
.page-head .lead { color: var(--muted); font-size: .845rem; margin: .2rem 0 0; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.grid-trade { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }

.stack { display: grid; gap: 1rem; }
.row   { display: flex; align-items: center; gap: .6rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.wrap  { flex-wrap: wrap; }
.grow  { flex: 1 1 auto; min-width: 0; }


/* ==========================================================================
   3 · BAUSTEINE
   ========================================================================== */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .8rem;
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(0deg, transparent, rgba(255,255,255,.012));
}
.panel-head h2, .panel-head h3 { font-size: .8rem; font-weight: 600; }
.panel-body { padding: .85rem; }
.panel-body.tight { padding: .6rem; }
.panel-body.flush { padding: 0; }
.panel-foot {
    padding: .55rem .85rem;
    border-top: 1px solid var(--line-soft);
    font-size: .78rem; color: var(--muted);
}

/* ---- Kennzahlen ----------------------------------------------------------- */

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat {
    padding: .8rem .95rem;
    border-right: 1px solid var(--line-soft);
}
.stat:last-child { border-right: 0; }
.stat-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }
.stat-value {
    font-family: var(--mono); font-size: 1.22rem; font-variant-numeric: tabular-nums;
    letter-spacing: -.02em; margin-top: .15rem; line-height: 1.15;
}
.stat-value.sm { font-size: 1rem; }
.stat-note { font-size: .73rem; color: var(--muted); margin-top: .1rem; }

/* ---- Tabellen -------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: .845rem;
}

table.data th {
    text-align: left;
    font-size: .655rem;
    text-transform: uppercase;
    letter-spacing: .085em;
    color: var(--faint);
    font-weight: 600;
    padding: .5rem .7rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    background: var(--panel);
    position: sticky; top: 0; z-index: 1;
}
table.data th a { color: inherit; display: inline-flex; align-items: center; gap: .25rem; }
table.data th a:hover { color: var(--text-dim); }
table.data th.sorted { color: var(--accent); }

table.data td {
    padding: .48rem .7rem;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--panel-hi); }
table.data tr.clickable { cursor: pointer; }

.t-right  { text-align: right; }
.t-center { text-align: center; }
.t-num    { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.t-wide   { white-space: normal; min-width: 12rem; }

/* Kuerzel + Name in einer Zelle */
.sym {
    display: inline-flex; align-items: center; gap: .55rem;
    min-width: 0;
}
.sym-tag {
    width: 3px; height: 22px; border-radius: 2px; flex: none;
    background: var(--line-strong);
}
.sym-code { font-family: var(--mono); font-weight: 600; font-size: .82rem; letter-spacing: .02em; }
.sym-name { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

/* Kursaenderung mit Pfeil */
.chg { display: inline-flex; align-items: baseline; gap: .3rem; font-family: var(--mono); }
.chg .arrow { font-size: .62em; }

/* Kurzes Aufblitzen bei Kursaenderung */
@keyframes flash-up   { from { background: var(--up-wash); }   to { background: transparent; } }
@keyframes flash-down { from { background: var(--down-wash); } to { background: transparent; } }
.flash-up   { animation: flash-up .7s ease-out; }
.flash-down { animation: flash-down .7s ease-out; }

/* ---- Abzeichen ------------------------------------------------------------- */

.badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .12rem .42rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-size: .66rem; letter-spacing: .045em; text-transform: uppercase;
    color: var(--text-dim); white-space: nowrap;
    font-weight: 500;
}
.badge.up      { border-color: rgba(79,178,134,.35);  background: var(--up-wash);   color: var(--up); }
.badge.down    { border-color: rgba(224,103,76,.35);  background: var(--down-wash); color: var(--down); }
.badge.accent  { border-color: rgba(232,179,57,.35);  background: var(--accent-wash); color: var(--accent); }
.badge.info    { border-color: rgba(91,155,213,.35);  background: var(--info-wash); color: var(--info); }
.badge.plain   { background: var(--panel-hi); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* ---- Verlaufslinie (Sparkline) ---------------------------------------------- */

.spark { display: block; width: 68px; height: 20px; }
.spark path { fill: none; stroke-width: 1.25; vector-effect: non-scaling-stroke; }

/* ---- Fortschritt ------------------------------------------------------------ */

.meter { height: 4px; background: var(--panel-active); border-radius: 2px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

/* ---- Leerer Zustand ---------------------------------------------------------- */

.empty {
    padding: 2.2rem 1rem;
    text-align: center;
    color: var(--muted);
    font-size: .855rem;
}
.empty .icon { color: var(--faint); margin-bottom: .5rem; }
.empty strong { display: block; color: var(--text-dim); font-weight: 500; margin-bottom: .2rem; }


/* ==========================================================================
   4 · FORMULARE UND SCHALTFLAECHEN
   ========================================================================== */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .46rem .85rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel-hi);
    color: var(--text);
    font: 500 .83rem/1.3 var(--sans);
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--panel-active); border-color: #383e46; }
.btn:active { transform: translateY(.5px); }
.btn[disabled], .btn.is-busy { opacity: .5; pointer-events: none; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #16130a; font-weight: 600; }
.btn-primary:hover { background: #f0be47; border-color: #f0be47; }

.btn-buy   { background: var(--up);   border-color: var(--up);   color: #06150e; font-weight: 600; }
.btn-buy:hover { filter: brightness(1.08); }
.btn-sell  { background: var(--down); border-color: var(--down); color: #1a0803; font-weight: 600; }
.btn-sell:hover { filter: brightness(1.08); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--panel-hi); color: var(--text); }

.btn-danger { border-color: rgba(224,103,76,.4); color: var(--down); background: transparent; }
.btn-danger:hover { background: var(--down-wash); }

.btn-sm { padding: .26rem .55rem; font-size: .75rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .34rem; }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---- Eingabefelder ------------------------------------------------------------ */

.field { display: block; margin-bottom: .8rem; }
.field > .label,
label.label {
    display: block;
    font-size: .7rem; text-transform: uppercase; letter-spacing: .075em;
    color: var(--muted); font-weight: 600;
    margin-bottom: .3rem;
}
.field-hint { font-size: .745rem; color: var(--faint); margin-top: .28rem; line-height: 1.45; }
.field-error { font-size: .78rem; color: var(--down); margin-top: .28rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="url"], input[type="date"], select, textarea {
    width: 100%;
    padding: .46rem .6rem;
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font: 400 .87rem/1.4 var(--sans);
}
input[type="number"], input.num, .field-num input { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-wash);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 5rem; line-height: 1.6; }
select {
    appearance: none;
    padding-right: 1.8rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23737d87' stroke-width='1.4'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .6rem center;
}
input[type="range"] { width: 100%; accent-color: var(--accent); }

.input-suffix { position: relative; }
.input-suffix input { padding-right: 2.4rem; }
.input-suffix > span {
    position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
    font-size: .78rem; color: var(--faint); pointer-events: none;
    font-family: var(--mono);
}

.check {
    display: flex; align-items: flex-start; gap: .5rem;
    font-size: .83rem; color: var(--text-dim);
    cursor: pointer;
    margin-bottom: .55rem;
}
.check input { width: auto; margin: .18rem 0 0; accent-color: var(--accent); flex: none; }

.field-inline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .7rem; }

/* Umschalter (Kauf/Verkauf, Order-Art, Zeitraster) */
.switch {
    display: inline-flex;
    padding: 2px;
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    gap: 2px;
}
.switch > * {
    padding: .3rem .62rem;
    border: 0; border-radius: 2px;
    background: transparent; color: var(--muted);
    font: 500 .765rem/1.3 var(--sans);
    cursor: pointer;
}
.switch > *:hover { color: var(--text); }
.switch > .on { background: var(--panel-active); color: var(--text); }
.switch > .on.buy  { background: var(--up);   color: #06150e; }
.switch > .on.sell { background: var(--down); color: #1a0803; }
.switch.full { display: flex; }
.switch.full > * { flex: 1; text-align: center; }

/* Passwortstaerke */
.strength { display: flex; gap: 3px; margin-top: .35rem; }
.strength i { flex: 1; height: 2px; background: var(--panel-active); border-radius: 1px; }
.strength i.on-1 { background: var(--down); }
.strength i.on-2 { background: #d19a3a; }
.strength i.on-3 { background: var(--accent); }
.strength i.on-4 { background: var(--up); }


/* ==========================================================================
   5 · HANDEL
   ========================================================================== */

/* ---- Kurskopf --------------------------------------------------------------- */

.quote-head {
    display: flex; align-items: flex-end; gap: 1.6rem; flex-wrap: wrap;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--line-soft);
}
.quote-price {
    font-family: var(--mono);
    font-size: 2rem; font-weight: 500;
    letter-spacing: -.035em; line-height: 1;
    font-variant-numeric: tabular-nums;
}
.quote-change { font-family: var(--mono); font-size: .95rem; margin-top: .25rem; }
.quote-meta { display: flex; gap: 1.4rem; margin-left: auto; }
.quote-meta div { text-align: right; }
.quote-meta .k { display: block; font-size: .62rem; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }
.quote-meta .v { font-family: var(--mono); font-size: .83rem; }

/* ---- Chart --------------------------------------------------------------------- */

.chart-shell { position: relative; }
.chart-canvas { display: block; width: 100%; height: 340px; }
.chart-canvas.sm { height: 190px; }
.chart-canvas.xs { height: 120px; }

.chart-tools {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    padding: .5rem .85rem;
    border-bottom: 1px solid var(--line-soft);
}

.chart-tip {
    position: absolute;
    pointer-events: none;
    background: var(--panel-active);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: .45rem .6rem;
    font: .73rem/1.5 var(--mono);
    white-space: nowrap;
    opacity: 0;
    transition: opacity .1s;
    z-index: 5;
}
.chart-tip.on { opacity: 1; }
.chart-tip b { color: var(--text); font-weight: 600; }
.chart-tip span { color: var(--muted); }

/* ---- Orderbuch ------------------------------------------------------------------- */

.book { font-family: var(--mono); font-size: .78rem; }
.book-side { display: grid; }
.book-row {
    position: relative;
    display: grid; grid-template-columns: 1fr auto auto;
    gap: .6rem;
    padding: .16rem .7rem;
    align-items: center;
}
/* Der Balken zeigt die Tiefe der jeweiligen Preisstufe */
.book-row::before {
    content: "";
    position: absolute; top: 0; bottom: 0; right: 0;
    width: var(--depth, 0%);
    background: var(--depth-color, transparent);
    z-index: 0;
}
.book-row > * { position: relative; z-index: 1; }
.book-row.bid { --depth-color: var(--up-wash); }
.book-row.ask { --depth-color: var(--down-wash); }
.book-row .p { font-weight: 600; }
.book-row.bid .p { color: var(--up); }
.book-row.ask .p { color: var(--down); }
.book-row .q { color: var(--text-dim); }
.book-row .n { color: var(--faint); font-size: .92em; }
.book-row.mine { box-shadow: inset 2px 0 0 var(--accent); }

.book-mid {
    display: flex; align-items: center; justify-content: space-between;
    padding: .38rem .7rem;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    background: var(--bg-sunken);
    font-family: var(--mono); font-size: .78rem;
}
.book-mid .spread { color: var(--muted); font-size: .72rem; }

/* ---- Zeitverlauf der Geschaefte ------------------------------------------------------ */

.tape-list { font-family: var(--mono); font-size: .765rem; max-height: 260px; overflow-y: auto; }
.tape-line {
    display: grid; grid-template-columns: auto 1fr auto;
    gap: .7rem; padding: .18rem .7rem;
    border-bottom: 1px solid var(--line-soft);
}
.tape-line:last-child { border-bottom: 0; }
.tape-line .t { color: var(--faint); }
.tape-line .q { text-align: right; color: var(--text-dim); }

/* ---- Orderticket ---------------------------------------------------------------------- */

.ticket { position: sticky; top: calc(var(--topbar-h) + var(--tape-h) + 1rem); }
.ticket .panel-body { padding: .75rem; }

.ticket-summary {
    display: grid; gap: .3rem;
    padding: .6rem .7rem;
    background: var(--bg-sunken);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    margin: .7rem 0;
    font-size: .79rem;
}
.ticket-summary .line { display: flex; justify-content: space-between; gap: 1rem; }
.ticket-summary .line span:first-child { color: var(--muted); }
.ticket-summary .line span:last-child {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
    /* Zahlen sollen nicht mitten im Betrag umbrechen. */
    white-space: nowrap;
}
/* Werte, die Text und keine Zahl sind — dort ist Monospace fehl am Platz. */
.ticket-summary .line span.text {
    font-family: var(--sans);
    white-space: normal;
}
.ticket-summary .total { border-top: 1px solid var(--line-soft); margin-top: .2rem; padding-top: .3rem; }
.ticket-summary .total span:last-child { font-weight: 600; font-size: .9rem; }

.qty-quick { display: flex; gap: .3rem; margin-top: .35rem; }
.qty-quick button {
    flex: 1;
    padding: .2rem 0;
    background: var(--bg-sunken); border: 1px solid var(--line);
    border-radius: 2px; color: var(--muted);
    font: 500 .7rem/1.4 var(--mono); cursor: pointer;
}
.qty-quick button:hover { color: var(--text); border-color: var(--line-strong); }

.ticket-warn {
    font-size: .765rem; color: var(--accent);
    background: var(--accent-wash);
    border: 1px solid rgba(232,179,57,.25);
    border-radius: var(--radius);
    padding: .4rem .55rem;
    margin-top: .55rem;
    line-height: 1.5;
}


/* ==========================================================================
   6 · MELDUNGEN, TIPPS, TUTORIAL
   ========================================================================== */

/* ---- Einblendungen ------------------------------------------------------------ */

.toasts {
    position: fixed;
    right: 1rem; bottom: 1rem;
    z-index: 90;
    display: flex; flex-direction: column-reverse; gap: .5rem;
    width: min(23rem, calc(100vw - 2rem));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex; gap: .6rem;
    padding: .65rem .75rem;
    background: var(--panel-active);
    border: 1px solid var(--line-strong);
    border-left: 2px solid var(--muted);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    animation: toast-in .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(6px) scale(.99); }
    to   { opacity: 1; transform: none; }
}
.toast.leaving { opacity: 0; transform: translateX(8px); transition: .18s ease-in; }

.toast.success { border-left-color: var(--up); }
.toast.warning { border-left-color: var(--accent); }
.toast.danger  { border-left-color: var(--down); }
.toast.market  { border-left-color: var(--info); }

.toast .icon { margin-top: .12rem; color: var(--muted); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: .83rem; font-weight: 600; }
.toast-text  { font-size: .78rem; color: var(--text-dim); margin-top: .1rem; line-height: 1.45; }
.toast-close { background: 0; border: 0; color: var(--faint); cursor: pointer; padding: 0 .1rem; align-self: flex-start; }
.toast-close:hover { color: var(--text); }

/* ---- Glocke ---------------------------------------------------------------------- */

.bell { position: relative; }
.bell-count {
    position: absolute; top: -3px; right: -4px;
    min-width: 15px; height: 15px; padding: 0 3px;
    display: grid; place-items: center;
    background: var(--accent); color: #14120c;
    border-radius: 8px; font: 600 .6rem/1 var(--mono);
}

.notif-panel {
    position: absolute; top: calc(100% + .55rem); right: 0;
    width: min(24rem, calc(100vw - 2rem));
    max-height: 26rem; overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 36px rgba(0,0,0,.5);
    z-index: 60;
}
.notif-item {
    display: flex; gap: .6rem;
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--line-soft);
}
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: rgba(232,179,57,.045); }
.notif-item .icon { color: var(--muted); margin-top: .15rem; }
.notif-item.success .icon { color: var(--up); }
.notif-item.danger  .icon { color: var(--down); }
.notif-item.warning .icon { color: var(--accent); }
.notif-item.market  .icon { color: var(--info); }
.notif-title { font-size: .82rem; font-weight: 500; }
.notif-text  { font-size: .765rem; color: var(--text-dim); margin-top: .1rem; line-height: 1.45; }
.notif-time  { font-size: .68rem; color: var(--faint); margin-top: .18rem; }

/* ---- Hinweiskarte ------------------------------------------------------------------- */

.tip {
    display: flex; gap: .7rem;
    padding: .7rem .8rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius);
}
.tip .icon { color: var(--accent); flex: none; margin-top: .1rem; }
.tip-title { font-size: .8rem; font-weight: 600; margin-bottom: .12rem; }
.tip-body  { font-size: .795rem; color: var(--text-dim); line-height: 1.55; }
.tip-close { background: 0; border: 0; color: var(--faint); cursor: pointer; align-self: flex-start; padding: 0; }
.tip-close:hover { color: var(--text-dim); }

/* ---- Tutorial ---------------------------------------------------------------------- */

.coach-backdrop {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(6, 7, 9, .72);
    backdrop-filter: blur(1px);
}

.coach {
    position: fixed; z-index: 81;
    width: min(25rem, calc(100vw - 2rem));
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 50px rgba(0,0,0,.6);
    overflow: hidden;
}
.coach-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--line-soft);
}
.coach-step { font: 600 .65rem/1 var(--mono); letter-spacing: .1em; color: var(--accent); text-transform: uppercase; }
.coach-body { padding: .9rem .85rem; }
.coach-body h3 { font-size: 1rem; margin-bottom: .4rem; }
.coach-body p { font-size: .85rem; color: var(--text-dim); line-height: 1.62; }
.coach-foot {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    padding: .6rem .85rem;
    border-top: 1px solid var(--line-soft);
    background: var(--bg-sunken);
}
.coach-dots { display: flex; gap: 4px; }
.coach-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.coach-dots i.on { background: var(--accent); }

/* Hervorgehobenes Element waehrend des Tutorials */
.coach-target {
    position: relative; z-index: 82;
    box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px rgba(6,7,9,.72);
    border-radius: var(--radius);
}

/* ---- Flash-Meldungen ------------------------------------------------------------------ */

.flash {
    display: flex; align-items: flex-start; gap: .55rem;
    padding: .6rem .8rem;
    border: 1px solid var(--line-strong);
    border-left: 2px solid var(--muted);
    border-radius: var(--radius);
    font-size: .845rem;
    margin-bottom: .8rem;
    background: var(--panel);
}
.flash.success { border-left-color: var(--up); }
.flash.warning { border-left-color: var(--accent); }
.flash.danger  { border-left-color: var(--down); }
.flash .icon { margin-top: .15rem; }
.flash.success .icon { color: var(--up); }
.flash.warning .icon { color: var(--accent); }
.flash.danger  .icon { color: var(--down); }


/* ==========================================================================
   7 · ANMELDESEITEN
   ========================================================================== */

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}

.auth-side {
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 2.4rem 2.6rem;
    background: var(--bg-sunken);
    border-right: 1px solid var(--line);
}
.auth-side h1 { font-size: 1.85rem; line-height: 1.2; letter-spacing: -.022em; max-width: 15em; }
.auth-side .lead { color: var(--muted); font-size: .93rem; margin-top: .8rem; max-width: 34em; line-height: 1.65; }

.auth-points { display: grid; gap: .75rem; margin-top: 2rem; }
.auth-point { display: flex; gap: .6rem; font-size: .855rem; color: var(--text-dim); }
.auth-point .icon { color: var(--accent); flex: none; margin-top: .2rem; }
.auth-point b { color: var(--text); font-weight: 500; }

.auth-ticker {
    display: grid; gap: .35rem;
    font-family: var(--mono); font-size: .78rem;
    padding-top: 1.6rem; margin-top: 1.6rem;
    border-top: 1px solid var(--line-soft);
}
.auth-ticker .r { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: .8rem; }

.auth-main {
    display: flex; align-items: center; justify-content: center;
    padding: 2.4rem 1.5rem;
}
.auth-card { width: min(24rem, 100%); }
.auth-card h2 { font-size: 1.28rem; margin-bottom: .3rem; }
.auth-card .sub { color: var(--muted); font-size: .86rem; margin-bottom: 1.5rem; }

.auth-sep {
    display: flex; align-items: center; gap: .7rem;
    margin: 1.15rem 0;
    color: var(--faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
}
.auth-sep::before, .auth-sep::after {
    content: ""; flex: 1; height: 1px; background: var(--line);
}

.auth-foot { margin-top: 1.4rem; font-size: .84rem; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--accent); }
.auth-foot a:hover { text-decoration: underline; }

/* Codeeingabe fuer 2FA */
.code-input {
    font-family: var(--mono) !important;
    font-size: 1.5rem !important;
    letter-spacing: .5em;
    text-align: center;
    padding: .6rem .4rem !important;
    text-indent: .5em;
}

.recovery-codes {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem;
    font-family: var(--mono); font-size: .85rem;
    padding: .8rem;
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: .8rem 0;
}
.recovery-codes span { padding: .12rem .3rem; }

.qr-frame {
    display: inline-block;
    padding: .55rem;
    background: #fff;
    border-radius: var(--radius);
    line-height: 0;
}
.qr-frame svg { display: block; }


/* ==========================================================================
   8 · VERWALTUNG
   ========================================================================== */

.admin-bar {
    display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
    padding: .5rem .8rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 1.1rem;
    font-size: .78rem;
}
.admin-bar .k { color: var(--faint); text-transform: uppercase; letter-spacing: .08em; font-size: .65rem; }
.admin-bar .v { font-family: var(--mono); color: var(--text-dim); }
.admin-bar .sep { width: 1px; height: 16px; background: var(--line); }

.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; overflow-x: auto; }
.tab {
    padding: .5rem .75rem;
    color: var(--muted); font-size: .845rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.tab:hover { color: var(--text-dim); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* Maskierte E-Mail mit Augensymbol */
.masked {
    display: inline-flex; align-items: center; gap: .35rem;
    font-family: var(--mono); font-size: .8rem;
}
.masked .value { color: var(--text-dim); letter-spacing: .01em; }
.masked .value.revealed { color: var(--text); }
.masked button {
    background: 0; border: 0; padding: .1rem; cursor: pointer;
    color: var(--faint); line-height: 0;
}
.masked button:hover { color: var(--accent); }

/* Sicherheitscheck */
.check-item {
    display: flex; gap: .7rem;
    padding: .75rem .85rem;
    border-bottom: 1px solid var(--line-soft);
}
.check-item:last-child { border-bottom: 0; }
.check-mark {
    width: 20px; height: 20px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--radius); font-size: .7rem; font-weight: 700;
    margin-top: .1rem;
}
.check-item.gut     .check-mark { color: var(--up);     border: 1px solid rgba(79,178,134,.35); }
.check-item.warnung .check-mark { color: var(--accent); border: 1px solid rgba(232,179,57,.35); }
.check-item.schlecht .check-mark { color: var(--down);  border: 1px solid rgba(224,103,76,.4); background: var(--down-wash); }
.check-item.unklar  .check-mark { color: var(--muted);  border: 1px solid var(--line-strong); }
.check-label { font-size: .87rem; font-weight: 500; }
.check-detail { font-size: .795rem; color: var(--text-dim); margin-top: .15rem; line-height: 1.55; }
.check-fix {
    font-size: .78rem; color: var(--accent);
    margin-top: .35rem; padding: .35rem .5rem;
    background: var(--accent-wash); border-radius: var(--radius);
    line-height: 1.5;
}

/* Regler mit Zahlenanzeige (Boost-Staerke) */
.slider-row { display: grid; grid-template-columns: 1fr 2.6rem; gap: .7rem; align-items: center; }
.slider-row output { font-family: var(--mono); font-size: .85rem; text-align: right; color: var(--accent); }

.danger-zone { border-color: rgba(224,103,76,.3); }
.danger-zone .panel-head { background: var(--down-wash); }

.code-line {
    display: block;
    font-family: var(--mono); font-size: .76rem;
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .45rem .6rem;
    color: var(--accent);
    word-break: break-all;
}

/* Seitenblaettern */
.pager { display: flex; align-items: center; gap: .35rem; justify-content: center; padding: .85rem 0; }
.pager a, .pager span {
    min-width: 1.9rem; padding: .25rem .45rem;
    text-align: center; border: 1px solid var(--line);
    border-radius: var(--radius); font-size: .8rem;
    font-family: var(--mono); color: var(--text-dim);
}
.pager a:hover { border-color: var(--line-strong); color: var(--text); }
.pager .on { background: var(--panel-active); color: var(--accent); border-color: var(--line-strong); }
.pager .gap { border: 0; color: var(--faint); }


/* ==========================================================================
   9 · KLEINERE BILDSCHIRME
   ========================================================================== */

@media (max-width: 1180px) {
    .grid-main, .grid-trade { grid-template-columns: minmax(0, 1fr); }
    .ticket { position: static; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    :root { --rail-w: 0px; }

    .shell { grid-template-columns: minmax(0, 1fr); }
    .main  { grid-column: 1; padding: calc(var(--topbar-h) + var(--tape-h) + .9rem) .8rem 5rem; }

    .brand { width: auto; }
    .brand-sub { display: none; }
    .topbar-stats { gap: .9rem; }
    .topstat.hide-sm { display: none; }

    /* Navigation wandert nach unten — dort, wo der Daumen ist */
    .rail {
        top: auto; bottom: 0; left: 0; right: 0;
        width: auto; height: auto;
        flex-direction: row;
        padding: .3rem .4rem calc(.3rem + env(safe-area-inset-bottom));
        border-right: 0;
        border-top: 1px solid var(--line);
        overflow-x: auto;
        gap: .15rem;
    }
    .rail-group { display: flex; gap: .15rem; margin: 0; }
    .rail-group > .eyebrow, .rail-foot { display: none; }
    .rail-link {
        flex-direction: column; gap: .18rem;
        padding: .4rem .6rem; font-size: .66rem;
        min-width: 4rem; text-align: center;
    }
    .rail-link.active::before { left: 50%; top: -.3rem; width: 16px; height: 2px; margin: 0 0 0 -8px; border-radius: 0 0 2px 2px; }
    .rail-badge { position: absolute; top: .15rem; right: .7rem; }

    .auth-shell { grid-template-columns: minmax(0, 1fr); }
    .auth-side { display: none; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat { border-right: 0; border-bottom: 1px solid var(--line-soft); }

    .quote-price { font-size: 1.65rem; }
    .quote-meta { margin-left: 0; width: 100%; justify-content: space-between; gap: .8rem; }

    .toasts { right: .6rem; left: .6rem; bottom: 4.6rem; width: auto; }
}

@media (max-width: 560px) {
    .field-inline { grid-template-columns: minmax(0, 1fr); }
    .stat-row { grid-template-columns: minmax(0, 1fr); }
    .hide-xs { display: none !important; }
}

/* Druckausgabe: Depotuebersicht soll auf Papier lesbar sein */
@media print {
    .topbar, .tape, .rail, .toasts, .ticket, .btn { display: none !important; }
    body { background: #fff; color: #000; }
    .main { padding: 0; }
    .panel { border-color: #ccc; break-inside: avoid; }
}
