:root {
    --bg: #0e1116;
    --panel: #161b22;
    --border: #283040;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #3fb950;
    --accent-dim: #1f6feb;
    --err: #f85149;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.brand .logo { color: var(--accent); }

.nav-wrap {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.nav-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    max-width: min(280px, 100%);
}

.nav-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-menu-icon {
    color: var(--accent);
    font-size: 15px;
    line-height: 1;
}

.nav-menu-current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: 6px;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 220px;
    max-width: min(320px, 92vw);
    max-height: min(70vh, 480px);
    overflow-y: auto;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    z-index: 30;
}

.nav-wrap.is-open .nav-dropdown {
    display: flex;
}

.nav-dropdown .nav-btn {
    width: 100%;
    text-align: left;
}

.nav-btn {
    background: transparent;
    color: var(--muted);
    border: 1px solid transparent;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.nav-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-btn.active {
    color: var(--text);
    background: rgba(31,111,235,0.18);
    border-color: var(--accent-dim);
}

.status { display: flex; align-items: center; gap: 14px; }
.logout-form { margin: 0; display: inline-flex; }

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-ok  { background: rgba(63,185,80,0.15);  color: var(--accent); }
.badge-warn { background: rgba(210,153,34,0.18); color: #d29922; }
.badge-err { background: rgba(248,81,73,0.15);  color: var(--err); }

.clock { color: var(--muted); font-variant-numeric: tabular-nums; }

.main { padding: 20px; }

.view { display: none; }
.view.active { display: block; }

.layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

@media (max-width: 860px) {
    .layout { grid-template-columns: 1fr; }
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
}

.panel h2 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
}

.muted { color: var(--muted); font-weight: 400; font-size: 12px; }

.grid {
    width: 100%;
    border-collapse: collapse;
}

.grid th, .grid td {
    text-align: left;
    padding: 8px 6px;
    border-bottom: 1px solid var(--border);
}

.grid th {
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.grid td.num, .grid th.num { text-align: right; font-variant-numeric: tabular-nums; }

.grid tbody tr:hover { background: rgba(31,111,235,0.08); }

.tag {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.bullish { background: rgba(63,185,80,0.15);  color: var(--accent); }
.bearish { background: rgba(248,81,73,0.15);  color: var(--err); }
.neutral { background: rgba(139,148,158,0.15); color: var(--muted); }

.panel-wide { grid-column: 1 / -1; }

/* --- Graph / Zusammenhänge --- */
.graph-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
}
.graph-toolbar label { display: flex; align-items: center; gap: 8px; }
.graph-toolbar input[type=range] { accent-color: var(--accent-dim); }
.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 22px; height: 3px; border-radius: 2px; }
.legend-line.pos { background: var(--accent); }
.legend-line.neg { background: var(--err); }
.graph-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.graph-container svg {
    width: 50%;
    max-width: 400px;
    height: auto;
    display: block;
}
@media (max-width: 700px) {
    .graph-container svg { width: 85%; max-width: 320px; }
}
.graph-node circle { fill: var(--accent-dim); stroke: #0e1116; stroke-width: 2; }
.graph-node text { fill: var(--text); font-size: 11px; font-weight: 600; }
.graph-edge { stroke-linecap: round; }

.account { margin-bottom: 12px; line-height: 1.8; }

/* --- Markt-Auswahl --- */
.market-hint { margin: 0 0 14px; line-height: 1.5; }
.market-hint code { color: var(--accent-dim); font-size: 12px; }
.market-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
}
.market-select-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.market-select {
    min-width: 220px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}
.market-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: rgba(255,255,255,0.06); }
.btn-primary {
    background: rgba(31,111,235,0.25);
    border-color: var(--accent-dim);
    color: var(--text);
}
.market-symbols { display: flex; flex-direction: column; gap: 14px; }
.sector-block h3 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.symbol-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.symbol-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    font-size: 13px;
    user-select: none;
}
.symbol-chip:has(input:checked) {
    border-color: var(--accent-dim);
    background: rgba(31,111,235,0.15);
}
.symbol-chip input { accent-color: var(--accent-dim); }
.market-status { margin-top: 12px; font-size: 13px; }
.market-status.ok { color: var(--accent); }
.market-status.err { color: var(--err); }

/* --- Paarungen / Abhängigkeits-Übersicht --- */
.pairings-hint { margin: 0 0 14px; line-height: 1.55; max-width: 900px; }
.pairings-toolbar {
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--muted);
}
.pairings-toolbar label { display: flex; align-items: center; gap: 10px; }
.pairings-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.pairing-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}
.pairing-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 10px;
}
.pairing-symbols {
    font-size: 16px;
    font-weight: 700;
}
.pairing-symbols .sep { color: var(--muted); font-weight: 400; margin: 0 6px; }
.strength-bar-wrap {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}
.strength-bar-wrap span { font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; }
.strength-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.strength-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent-dim);
}
.strength-bar-fill.strong { background: var(--accent); }
.strength-bar-fill.inverse { background: var(--err); }
.pairing-body { font-size: 13px; line-height: 1.55; color: var(--text); }
.pairing-body p { margin: 0 0 8px; }
.pairing-body .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.35px; }
/* --- Einstellungen --- */
.settings-hint { margin: 0 0 16px; line-height: 1.55; max-width: 720px; }
.settings-hint code { color: var(--accent-dim); }
.settings-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.status-pill {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg);
}
.status-pill.ok { border-color: var(--accent); color: var(--accent); }
.status-pill.warn { border-color: #d29922; color: #d29922; }
.settings-form { display: flex; flex-direction: column; gap: 22px; }
.settings-group h3 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
}
.field input, .field select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}
.field .field-hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}
.field .configured-badge {
    font-size: 11px;
    color: var(--accent);
    margin-top: 4px;
}
.settings-actions { margin-top: 18px; }
.settings-message { margin-top: 12px; font-size: 13px; }
.settings-message.ok { color: var(--accent); }
.settings-message.err { color: var(--err); }
.daemon-log {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 11px;
    line-height: 1.45;
    max-height: 180px;
    overflow: auto;
    white-space: pre-wrap;
}

.warn-box {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(248,81,73,0.1);
    border: 1px solid var(--err);
    font-size: 13px;
    color: var(--err);
}

.pairing-signal {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(31,111,235,0.1);
    border-left: 3px solid var(--accent-dim);
    font-size: 13px;
}

.footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
}
.footer a { color: var(--accent-dim); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* --- Konto: Tagesübersicht --- */
.account-day {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.account-day-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
    color: var(--muted);
}
.account-day-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.account-day-cell {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}
.account-day-cell.highlight {
    border-color: rgba(31, 111, 235, 0.35);
    background: rgba(31, 111, 235, 0.06);
}
.account-day-cell.span-2 { grid-column: 1 / -1; }
.account-day-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.account-day-cell strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.account-day-cell .muted { font-size: 11px; }
.account-totals { font-size: 13px; line-height: 1.6; }

/* --- Handel: Konto + Live-Diagramm nebeneinander --- */
.trading-split-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.55fr);
    gap: 18px;
    align-items: stretch;
}
@media (max-width: 960px) {
    .trading-split-row { grid-template-columns: 1fr; }
}
.live-chart-panel { min-height: 360px; }
.live-chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.live-chart-meta { font-size: 11px; white-space: nowrap; }
.live-chart-range-btn.active {
    border-color: var(--accent-dim);
    background: rgba(31, 111, 235, 0.15);
}
.live-trade-chart-wrap {
    width: 100%;
    min-height: 280px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 6px 6px 4px;
    box-sizing: border-box;
}
.live-trade-chart-wrap svg {
    width: 100%;
    min-width: 280px;
    height: auto;
    display: block;
}
.live-chart-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--muted);
}
.live-grid-line { stroke: rgba(139, 148, 158, 0.12); stroke-width: 1; }
.live-lane-sep { stroke: rgba(139, 148, 158, 0.18); stroke-width: 1; }
.live-entry-line { stroke-dasharray: 5 4; stroke-width: 1.2; opacity: 0.75; }
.live-lane-label { fill: var(--text); font-size: 11px; font-weight: 700; }
.live-lane-meta { fill: var(--muted); font-size: 10px; font-weight: 600; }
.live-lane-meta.bullish { fill: var(--accent); }
.live-lane-meta.bearish { fill: var(--err); }
.live-axis-label { fill: var(--muted); font-size: 10px; }
.live-empty-lane { fill: var(--muted); font-size: 10px; }
.live-trade-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
    font-size: 12px;
}
.live-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}
.live-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}
.live-legend-entry {
    width: 14px;
    height: 0;
    border-top: 2px dashed var(--muted);
}

/* --- Handel: Investitions-"Datenschreiber" --- */
.trade-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.trade-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trade-range-btn.active { border-color: var(--accent-dim); background: rgba(31,111,235,0.15); }
.trade-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trade-session-select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    min-width: 220px;
}

.trade-writer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.inv-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
}
.inv-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.inv-sym { font-size: 15px; font-weight: 800; letter-spacing: 0.3px; }
.inv-now { font-variant-numeric: tabular-nums; font-size: 13px; }
.inv-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.inv-meta strong { color: var(--text); font-weight: 700; }
.inv-chart { width: 100%; height: 72px; display: block; }
.inv-chart.empty { opacity: 0.9; }
.inv-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text);
}
.inv-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.inv-btn:hover { background: rgba(255,255,255,0.06); }
.inv-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: none;
}
.inv-card.open .inv-details { display: block; }
.inv-details-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}
.inv-details-list {
    margin: 0;
    padding-left: 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}
.skeleton-line {
    height: 10px;
    border-radius: 6px;
    background: rgba(139,148,158,0.12);
    border: 1px solid rgba(139,148,158,0.10);
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w80 { width: 80%; }
.inv-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}
.line-blue { stroke: #58a6ff; }
.line-orange { stroke: #d29922; }
.line-base { stroke: rgba(139,148,158,0.45); }
.marker-buy { fill: #58a6ff; }
.marker-sell { fill: #d29922; }

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
}

.activity-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.stat-pill {
    background: rgba(63, 185, 80, 0.08);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
}

.activity-feed {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 10px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.activity-icon {
    font-size: 16px;
    line-height: 1.4;
}

.activity-title {
    font-weight: 600;
}

.activity-time {
    font-size: 11px;
    white-space: nowrap;
}

.activity-job .activity-title { color: #8b949e; }
.activity-signal .activity-title { color: var(--accent); }
.activity-order .activity-title { color: var(--accent-dim); }
.activity-pattern .activity-title { color: #d29922; }

/* System-Aktivität: Bedeutung über Hintergrundfarbe */
.activity-tone-action {
    background: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.22);
}
.activity-tone-action .activity-title { color: #ff8b87; }

.activity-tone-important {
    background: rgba(210, 153, 34, 0.1);
    border-color: rgba(210, 153, 34, 0.22);
}
.activity-tone-important .activity-title { color: #e3b341; }

/* --- Sicherheitsabschaltung --- */
.safety-alarm {
    background: transparent;
    border: 2px solid var(--err);
    color: var(--err);
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: box-shadow 0.2s;
}
.safety-alarm.hidden { display: none; }
.safety-alarm.ringing {
    animation: safety-ring 0.8s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(248, 81, 73, 0.6);
}
.safety-alarm.acknowledged {
    border-color: #e3b341;
    color: #e3b341;
    animation: none;
    opacity: 0.85;
}
@keyframes safety-ring {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
    75% { transform: rotate(4deg); }
}
body.safety-active .topbar {
    border-bottom-color: var(--err);
    box-shadow: 0 2px 0 rgba(248, 81, 73, 0.35);
}
body.safety-acknowledged .topbar {
    border-bottom-color: #e3b341;
    box-shadow: 0 2px 0 rgba(227, 179, 65, 0.35);
}
.safety-banner {
    grid-column: 1 / -1;
    background: linear-gradient(90deg, rgba(248, 81, 73, 0.22), rgba(248, 81, 73, 0.08));
    border: 1px solid var(--err);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 4px;
}
.safety-banner.safety-banner-acknowledged {
    background: linear-gradient(90deg, rgba(227, 179, 65, 0.2), rgba(227, 179, 65, 0.06));
    border-color: #e3b341;
}
.safety-banner.safety-banner-acknowledged .safety-banner-text strong {
    color: #e3b341;
}
.safety-banner.hidden { display: none; }
.safety-banner-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.safety-banner-icon { font-size: 28px; }
.safety-banner-text { flex: 1; min-width: 200px; }
.safety-banner-text p { margin: 4px 0 0; }
.safety-banner-actions { display: flex; gap: 8px; }

.drift-banner {
    grid-column: 1 / -1;
    background: linear-gradient(90deg, rgba(227, 179, 65, 0.18), rgba(227, 179, 65, 0.06));
    border: 1px solid #e3b341;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 4px;
}
.drift-banner.hidden { display: none; }
.drift-banner-inner { display: flex; align-items: center; gap: 14px; }
.drift-banner-icon { font-size: 24px; }
.drift-banner p { margin: 4px 0 0; }

.backup-hint {
    margin: 0 0 12px;
    line-height: 1.55;
    max-width: 900px;
}
.auth-enroll-box {
    margin-top: 12px;
    padding: 14px;
    border: 1px dashed var(--accent-dim);
    border-radius: 8px;
}
.auth-enroll-box.hidden { display: none; }
.auth-code {
    font-size: 28px;
    letter-spacing: 0.2em;
    color: var(--accent);
}
.auth-usb-panel {
    border-color: rgba(63, 185, 80, 0.35);
}
.auth-usb-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.auth-usb-label {
    flex: 1;
    min-width: 200px;
    font-size: 13px;
    color: var(--muted);
}
.auth-usb-label input {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}
.grid-compact td, .grid-compact th { font-size: 12px; padding: 6px 8px; }

.backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.activity-tone-ok {
    background: rgba(63, 185, 80, 0.1);
    border-color: rgba(63, 185, 80, 0.22);
}
.activity-tone-ok .activity-title { color: #56d364; }

.activity-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 11px;
}
.activity-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
}
.activity-legend-item.action {
    background: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.22);
}
.activity-legend-item.important {
    background: rgba(210, 153, 34, 0.1);
    border-color: rgba(210, 153, 34, 0.22);
}
.activity-legend-item.ok {
    background: rgba(63, 185, 80, 0.1);
    border-color: rgba(63, 185, 80, 0.22);
}

.card-meta, .card .card-meta {
    font-size: 11px;
    margin-bottom: 6px;
}

.price-up, tr.price-up td.num {
    animation: priceFlashUp 1.2s ease;
}

.price-down, tr.price-down td.num {
    animation: priceFlashDown 1.2s ease;
}

@keyframes priceFlashUp {
    0% { background: rgba(63, 185, 80, 0.35); }
    100% { background: transparent; }
}

@keyframes priceFlashDown {
    0% { background: rgba(248, 81, 73, 0.35); }
    100% { background: transparent; }
}

.learning-panel {
    border-color: rgba(63, 185, 80, 0.35);
}

.learning-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.learning-link-hint {
    margin-top: 10px;
    font-size: 12px;
}

.module-hint {
    margin: 0 0 12px;
    font-size: 13px;
}

.module-sw {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(31, 111, 235, 0.12);
    border: 1px solid rgba(31, 111, 235, 0.25);
    color: #79b8ff;
}

.module-change {
    font-size: 12px;
    max-width: 280px;
}

.module-row-rollback {
    background: rgba(248, 81, 73, 0.06);
}

.module-row-dev {
    background: rgba(210, 153, 34, 0.06);
}

.module-row-specialist td:first-child {
    border-left: 3px solid rgba(63, 185, 80, 0.45);
}

.module-row-competitor td:first-child {
    border-left: 3px solid rgba(31, 111, 235, 0.35);
}

.team-bus-feed {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.team-bus-item {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-bus-meta {
    font-size: 11px;
}

.team-bus-text {
    line-height: 1.4;
}

.nav-learning {
    position: relative;
}

.nav-badge {
    font-size: 10px;
    color: var(--muted);
    margin-left: 4px;
}

.nav-badge.active {
    color: var(--accent);
    animation: pulseBadge 1.5s ease infinite;
}

@keyframes pulseBadge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.compact-grid th,
.compact-grid td {
    padding: 6px 8px;
    font-size: 12px;
}

/* --- Einklappbare Panels --- */
.collapsible-panel .collapsible-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0 0 0;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
}
.collapsible-panel .collapsible-title {
    font-size: 15px;
    font-weight: 600;
}
.collapsible-panel .collapsible-chevron {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--muted);
    transition: transform 0.2s ease;
}
.collapsible-panel.open .collapsible-chevron {
    transform: rotate(180deg);
}
.collapsible-panel .collapsible-body {
    display: none;
    margin-top: 14px;
}
.collapsible-panel.open .collapsible-body {
    display: block;
}
.collapsible-panel.open > .collapsible-head {
    margin-bottom: 0;
}

.trading-settings-hint {
    margin: 0 0 14px;
    line-height: 1.5;
    max-width: 720px;
}

.trading-settings-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px 20px;
    max-width: 1100px;
}

.trading-rules-heading {
    grid-column: 1 / -1;
    margin: 12px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.time-pair {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.trading-settings-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.trading-settings-form input[type="number"],
.trading-settings-form input[type="time"],
.trading-settings-form input[type="password"] {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
}

.field-hint {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.4;
}

.fee-cell {
    color: #d29922;
    font-variant-numeric: tabular-nums;
}

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    grid-column: 1 / -1;
}

.trading-settings-meta {
    grid-column: 1 / -1;
    font-size: 12px;
}

.simulation-control-panel {
    border-color: rgba(31, 111, 235, 0.35);
}


.simulation-control-panel.is-trading-active {
    border-color: rgba(63, 185, 80, 0.55);
    box-shadow: 0 0 0 1px rgba(63, 185, 80, 0.12), 0 0 24px rgba(63, 185, 80, 0.08);
}

.simulation-control-panel.is-learning-active {
    border-color: rgba(210, 153, 34, 0.55);
    box-shadow: 0 0 0 1px rgba(210, 153, 34, 0.12), 0 0 20px rgba(210, 153, 34, 0.06);
}

.simulation-runtime {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin-bottom: 10px;
}

.simulation-runtime-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.simulation-runtime-meta strong {
    font-size: 14px;
}

.simulation-runtime-meta span {
    font-size: 12px;
}

.simulation-runtime-elapsed {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #e6edf3;
}

.simulation-pulse {
    position: relative;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
}

.simulation-pulse-core,
.simulation-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.simulation-pulse-core {
    background: #3fb950;
    box-shadow: 0 0 10px rgba(63, 185, 80, 0.65);
}

.simulation-pulse-ring {
    border: 2px solid rgba(63, 185, 80, 0.75);
    animation: sim-pulse-ring 1.8s ease-out infinite;
}

.simulation-runtime--learning .simulation-pulse-core {
    background: #d29922;
    box-shadow: 0 0 10px rgba(210, 153, 34, 0.55);
}

.simulation-runtime--learning .simulation-pulse-ring {
    border-color: rgba(210, 153, 34, 0.75);
}

.simulation-runtime--halt .simulation-pulse-core {
    background: #f85149;
    box-shadow: none;
    animation: none;
}

.simulation-runtime--halt .simulation-pulse-ring {
    display: none;
}

@keyframes sim-pulse-ring {
    0% { transform: scale(0.75); opacity: 0.9; }
    70% { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}

.simulation-status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.simulation-status {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.simulation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.simulation-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    max-width: 820px;
}

.btn-danger {
    border-color: rgba(248, 81, 73, 0.55);
    color: #ffb4ae;
}

.btn-danger:hover {
    background: rgba(248, 81, 73, 0.15);
}
