/* CryptoSignals - Clean White Theme */
:root {
    --bg: #fafbfc;          /* v146: brighter overall gray background */
    --card: #ffffff;
    --border: transparent;   /* v146: borders removed in favor of soft shadow */
    --text: #1a202c;
    --muted: #718096;
    --green: #10b981;
    --red: #ef4444;
    --blue: #2563eb;          /* v147: deeper modern blue */
    --blue-light: #4f8bf2;    /* v147: lighter accent */
    --blue-fade: #60a5fa;     /* hover */
    --blue-gradient: linear-gradient(180deg, #4f8bf2 0%, #2563eb 100%);  /* v147: title-border gradient */
    --yellow: #f59e0b;
    --purple: #8b5cf6;
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.025), 0 1px 1px rgba(15, 23, 42, 0.02);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

#app { min-height: 100vh; }

/* Login - Pure White Minimal */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #ffffff;
}

.login-box {
    width: 100%;
    max-width: 280px;
    text-align: center;
}

.login-title {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: -0.5px;
    margin-bottom: 40px;
    color: #1a202c;
}

.login-input {
    width: 100%;
    padding: 14px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    font-size: 15px;
    color: #1a202c;
    margin-bottom: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-bottom-color: #1a202c;
}

.login-input::placeholder {
    color: #a0aec0;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: #1a202c;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 24px;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #2d3748;
}

.login-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.login-err {
    color: #ef4444;
    font-size: 13px;
    margin-top: 16px;
    min-height: 20px;
}
    outline: none;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-bottom-color: #1a202c;
}

.login-input::placeholder {
    color: #a0aec0;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: #1a202c;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 32px;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #2d3748;
}

.login-err {
    margin-top: 16px;
    color: #ef4444;
    font-size: 13px;
}

/* Legacy input group (keep for backwards compat) */
.input-group { margin-bottom: 20px; }
.input-label { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 8px; display: block; }
.input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

.btn {
    width: 100%;
    padding: 12px 18px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s ease;
}
.btn:hover { background: var(--blue-fade); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 7px 14px; font-size: 12px; width: auto; }
/* v146: all colored btn variants collapsed to the core blue + fade scheme */
.btn-red, .btn-green, .btn-blue { background: var(--blue); }
.btn-red:hover, .btn-green:hover, .btn-blue:hover { background: var(--blue-fade); }
/* Sell button is the one exception — destructive action stays red */
.sell-btn { background: var(--red) !important; }
.sell-btn:hover { background: #dc2626 !important; }

.error-msg { color: var(--red); font-size: 13px; text-align: center; margin-top: 16px; }

/* Header */
.header {
    background: var(--card);
    border: none;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-card);
}
.logo { font-weight: 700; font-size: 20px; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.sync-btn {
    background: var(--blue);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.sync-btn:disabled { opacity: 0.5; }
.last-sync { font-size: 12px; color: var(--muted); }

/* Tabs */
.tabs {
    display: flex;
    justify-content: stretch;            /* v164: flex:1 children fill the bar */
    background: var(--card);
    overflow-x: auto;
    box-shadow: var(--shadow-card);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 1;
    min-width: 0;                          /* v164: allow shrink so all 6 tabs fit */
    padding: 11px 2px;                     /* v164: tighter horizontal padding */
    text-align: center;
    font-size: 11px;                     /* v147: smaller */
    font-weight: 600;
    color: #1a202c;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tab:hover { color: #000; }
.tab.active { color: var(--blue); font-weight: 700; }   /* v147: active = blue */

/* Content */
.content { padding: 20px; max-width: 1200px; margin: 0 auto; }

/* v146: positions wrap — no white tile, only individual coin tiles get shadow */
.positions-wrap   { background: transparent; padding: 0; margin-bottom: 12px }
.positions-title  {
    font-size: 11px; font-weight: 700; color: var(--blue);
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 0 4px 8px 10px; position: relative; line-height: 1.2;
}
.positions-title::before {
    content: ''; position: absolute; left: 0; top: 1px; height: 13px;
    width: 3px; border-radius: 2px; background: var(--blue-gradient);
}

/* v147: signals tab sync widget at bottom (mirrors positions sync) */
.signals-sync-widget {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-top: 14px; padding: 10px 14px; background: var(--card); border-radius: 8px;
    box-shadow: var(--shadow-card);
}
.signals-sync-info { font-size: 11px; color: var(--muted) }
.signals-sync-info b { color: var(--text); font-weight: 600 }

/* v146: Intelligence tab — no white card tiles, just title-prefixed sections */
.intel-tab .card  { background: transparent; box-shadow: none; padding: 0 4px; margin-bottom: 20px }

/* v148: P&L breakdown card on home — v151: smaller, aligned with module sizes
   v154: TWR + money-weighted % beside total, Gewinne/Verluste as own rows
   v155: Cash In/Out at top, overall sum at bottom, Checksum in collapser */
.pnl-breakdown .pnl-bd-total-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px }
.pnl-breakdown .pnl-bd-total { font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums }
.pnl-bd-pcts { display: flex; flex-direction: column; gap: 2px; text-align: right }
.pnl-bd-pct { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums }
.pnl-bd-pct-lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600 }
.pnl-bd-pct-val { font-size: 12px; font-weight: 700 }
.pnl-bd-rows { display: flex; flex-direction: column; gap: 4px }
.pnl-bd-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px }
.pnl-bd-lbl { color: var(--text); font-weight: 500 }
.pnl-bd-val { font-weight: 600; font-variant-numeric: tabular-nums }
.pnl-bd-sub-row { padding-left: 14px }
.pnl-bd-sub-lbl { color: var(--muted); font-weight: 400; font-size: 11px }
.pnl-bd-sub-val { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 11px }
.pnl-bd-sub-pct { color: var(--muted); font-weight: 500; font-size: 10px; margin-left: 2px }
.pnl-bd-divider { height: 1px; background: #e5e9f0; margin: 6px 0 }

/* v155: Checksum collapser */
.pnl-bd-checksum { margin-top: 12px; border-top: 1px dashed #e5e9f0; padding-top: 8px }
.pnl-bd-checksum summary {
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; user-select: none; list-style: none;
    font-size: 11px; font-weight: 600; color: var(--muted);
    padding: 2px 0;
}
.pnl-bd-checksum summary::-webkit-details-marker { display: none }
.pnl-bd-checksum summary::after { content: '\25be'; font-size: 10px; color: var(--muted); margin-left: 6px }
.pnl-bd-checksum[open] summary::after { content: '\25b4' }
.pnl-bd-checksum .pnl-bd-check { margin-top: 6px; padding-top: 0; border-top: none }
.pnl-bd-check { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e5e9f0 }
.pnl-bd-check-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 1px 0; font-variant-numeric: tabular-nums }
.pnl-bd-check-row.total { font-weight: 600; color: var(--text); border-top: 1px solid #eef1f5; margin-top: 3px; padding-top: 4px }
.pnl-bd-check-status { margin-top: 6px; font-size: 10px; font-weight: 600; text-align: right }
.pnl-bd-check-status.ok { color: var(--green) }
.pnl-bd-check-status.warn { color: #f97316 }

/* v148: tier group header — styled as a headline (blue gradient bar, like card-title) */
.tier-group-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; margin-bottom: 4px; padding-left: 10px;
    position: relative;
}
.tier-group-header::before {
    content: ''; position: absolute; left: 0; top: 1px; bottom: 1px;
    width: 3px; border-radius: 2px; background: var(--blue-gradient);
}
.tier-group-name  { font-weight: 700; font-size: 11px; color: var(--blue); text-transform: uppercase; letter-spacing: 0.4px }
.tier-group-count { color: var(--blue-light); font-weight: 600 }
.tier-group-val   { font-size: 11px; color: var(--text); font-weight: 500 }

/* v148: coin icons before coin names */
.coin-icon { width:16px; height:16px; border-radius:50%; vertical-align:-3px; margin-right:5px; display:inline-block; object-fit:contain }

/* Cards */
.card {
    background: var(--card);
    border: none;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
/* v147: section titles — uppercase, blue, with subtle gradient bar on left */
.card-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-left: 10px;
    position: relative;
    line-height: 1.2;
}
.card-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1px;
    bottom: 1px;
    width: 3px;
    border-radius: 2px;
    background: var(--blue-gradient);
}
.card-value { font-size: 32px; font-weight: 700; }
.card-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-card { background: var(--card); border: none; border-radius: 8px; padding: 16px; box-shadow: var(--shadow-card); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 700; }

/* Positions */
.position { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.position:last-child { border-bottom: none; }
.pos-left { display: flex; align-items: center; gap: 14px; }
.pos-icon { width: 44px; height: 44px; background: linear-gradient(135deg, var(--blue), var(--purple)); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; }

.pos-amount { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pos-right { text-align: right; }
.pos-value { font-weight: 600; font-size: 16px; }
.pos-pnl { font-size: 14px; font-weight: 500; margin-top: 2px; }
.pos-targets { display: flex; gap: 12px; margin-top: 4px; font-size: 11px; }
.pos-tp { color: var(--green); }
.pos-sl { color: var(--red); }

/* Colors */
.green { color: var(--green); }
.red { color: var(--red); }
.blue { color: var(--blue); }

/* Signals */
.signal-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 12px; }
.signal-card.buy { border-left: 4px solid var(--green); }
.signal-header { display: flex; justify-content: space-between; align-items: flex-start; }
.signal-coin { font-weight: 700; font-size: 20px; }
.signal-price { font-size: 14px; color: var(--muted); margin-top: 4px; }
.signal-score { padding: 6px 14px; border-radius: 20px; font-size: 14px; font-weight: 600; }
.score-high { background: rgba(16,185,129,0.15); color: var(--green); }
.score-med { background: rgba(245,158,11,0.15); color: var(--yellow); }
.score-low { background: rgba(113,128,150,0.15); color: var(--muted); }

.signal-details { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.signal-indicators { display: flex; flex-wrap: wrap; gap: 8px; }
.indicator { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--bg); border-radius: 6px; font-size: 12px; font-weight: 500; }
.indicator.pass { background: rgba(16,185,129,0.1); color: var(--green); }
.indicator.fail { background: var(--bg); color: var(--muted); }
.signal-strategy { margin-top: 12px; font-size: 12px; color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 12px 16px; background: var(--bg); font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
tr:hover { background: var(--bg); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.badge-green { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-blue { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-yellow { background: rgba(234,179,8,0.18); color: #b45309; }
.badge-gray { background: var(--bg); color: var(--muted); }

/* Settings */
.setting-section { margin-bottom: 24px; }
.setting-section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: none; }
.setting-label { font-weight: 500; }
.setting-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }

.toggle { width: 52px; height: 28px; background: var(--border); border-radius: 14px; position: relative; cursor: pointer; }
.toggle.on { background: var(--green); }
.toggle::after { content: ''; position: absolute; width: 22px; height: 22px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: transform 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.toggle.on::after { transform: translateX(24px); }

.input-sm { width: 80px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: 14px; text-align: right; }
.input-sm:focus { outline: none; border-color: var(--blue); }

.strategy-list { display: grid; gap: 10px; margin-top: 12px; }
.strategy-item { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg); border-radius: 10px; cursor: pointer; }
.strategy-item:hover { background: #e2e8f0; }
.strategy-cb { width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.strategy-item.on .strategy-cb { background: var(--blue); border-color: var(--blue); }
.strategy-item.on .strategy-cb::after { content: '✓'; color: #fff; font-size: 14px; font-weight: 700; }
.strategy-name { font-weight: 500; flex: 1; }
.strategy-desc { font-size: 12px; color: var(--muted); }

/* Logs */
.log-viewer { background: #1e293b; border-radius: 10px; padding: 16px; font-family: monospace; font-size: 12px; color: #94a3b8; max-height: 400px; overflow-y: auto; line-height: 1.6; white-space: pre-wrap; }

/* Loading & Empty */
.loading { text-align: center; padding: 60px 20px; color: var(--muted); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }

@media (max-width: 640px) {
    .content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .tab { padding: 14px 6px; font-size: 12px; }
}

/* Strategy colors */
.strat-green { background: rgba(16,185,129,0.15); color: #10b981; }
.strat-orange { background: rgba(245,158,11,0.15); color: #f59e0b; }
.strat-red { background: rgba(239,68,68,0.15); color: #ef4444; }
.strat-gray { background: #f1f5f9; color: #94a3b8; }

.strat-details { margin-top: 12px; font-size: 11px; }
.strat-row { margin-bottom: 6px; padding: 8px; background: #fff; border-radius: 6px; }
.strat-name { font-weight: 600; color: #475569; }
.check { display: inline-block; padding: 2px 6px; border-radius: 4px; margin: 2px; }
.check-pass { background: #d1fae5; color: #065f46; }
.check-fail { background: #fee2e2; color: #991b1b; }

/* Chart */
.chart-container { background: #ffffff; border-radius: 8px; padding: 6px 4px; }
.chart-container canvas { width: 100%; height: 240px; }

/* Watchlist */
.watchlist { display: flex; flex-wrap: wrap; gap: 8px; }
.watch-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: #e0f2fe; color: #0369a1; border-radius: 20px; font-size: 13px; font-weight: 500; cursor: pointer; }
.watch-tag.disabled { background: #f1f5f9; color: #94a3b8; }
.watch-tag:hover { background: #bae6fd; }
.watch-x { font-size: 16px; line-height: 1; }

/* Table wrap */
.table-wrap { overflow-x: auto; }

/* Position Grid - New Format */
.position-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:12px; margin-top:12px }
.pos-card { background:#f8fafc; border-radius:10px; padding:14px; border:1px solid #e2e8f0 }

.pos-row { display:flex; justify-content:space-between; padding:4px 0; font-size:13px }
.pos-label { color:#64748b; font-weight:500; min-width:30px }
.pos-data { color:#334155; font-weight:500; text-align:right }

/* Health Status */
.health-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; margin:12px 0 }
.health-item { display:flex; justify-content:space-between; padding:10px 14px; background:#f8fafc; border-radius:8px; border:1px solid #e2e8f0 }
.health-item.ok { border-color:#10b981; background:#ecfdf5 }
.health-item.err { border-color:#ef4444; background:#fef2f2 }
.cron-status { font-size:13px; color:#64748b; margin-top:12px; padding:10px; background:#f8fafc; border-radius:8px; line-height:1.6 }

/* Test Trade */
.test-trade, .test-tpsl { display:flex; gap:8px; align-items:center; flex-wrap:wrap }

/* HELD Badge */
.held-badge { background:#3b82f6; color:#fff; font-size:10px; padding:2px 6px; border-radius:4px; vertical-align:middle; margin-left:6px }
.signal-card.held { border-left:3px solid #3b82f6 }

/* Delete button */
.btn-x { background:#ef4444; color:#fff; border:none; border-radius:4px; width:24px; height:24px; cursor:pointer; font-size:14px; line-height:24px }
.btn-x:hover { background:#dc2626 }

/* Strategy list sortable */
.drag-handle { cursor:grab; color:#94a3b8; font-size:16px; padding:0 4px }

/* Tier Badge */
.tier-badge { display:inline-block; background:#8b5cf6; color:#fff; font-size:10px; font-weight:600; padding:2px 6px; border-radius:4px; vertical-align:middle; margin-right:4px }
.tier-info { display:flex; flex-wrap:wrap; gap:8px; font-size:11px; color:#64748b; margin:8px 0; padding:8px; background:#f8fafc; border-radius:6px }
.tier-info span { padding:2px 6px; background:#fff; border-radius:4px; border:1px solid #e2e8f0 }
.volume-warning { font-size:11px; color:#f59e0b; background:#fffbeb; padding:6px 10px; border-radius:6px; margin-top:8px; border:1px solid #fcd34d }

/* Score min indicator */
.score-min { font-size:10px; color:#94a3b8; display:block; text-align:center }

/* Tier Legend */
.tier-legend { font-size:12px; color:#64748b; margin-bottom:12px; padding:10px; background:#f8fafc; border-radius:8px; line-height:2 }

/* Tier List */
.tier-list { display:flex; flex-direction:column; gap:6px; margin-top:12px }
.tier-row { display:flex; align-items:center; gap:8px; padding:8px 10px; background:#f8fafc; border-radius:8px; border:1px solid #e2e8f0; font-size:13px; cursor:default }
.tier-row:hover { background:#f1f5f9 }
.tier-coin { font-weight:600; min-width:50px }
.tier-detail { color:#64748b; font-size:12px; padding:2px 6px; background:#fff; border-radius:4px; border:1px solid #e2e8f0 }
.tier-edit { background:#3b82f6; margin-left:auto; font-size:12px }
.tier-edit:hover { background:#2563eb }

/* Tier Add Form */
.tier-add { display:flex; flex-wrap:wrap; gap:6px; align-items:center }
.tier-add .input { padding:6px 8px; font-size:12px }

/* Performance Analytics */
.perf-section { margin-top:8px }
.perf-section strong { font-size:13px; color:#334155 }
.perf-list { display:flex; flex-direction:column; gap:4px; margin-top:8px }
.perf-row { display:flex; align-items:center; gap:10px; padding:8px 10px; background:#f8fafc; border-radius:6px; font-size:12px }
.perf-coin, .perf-strat { font-weight:600; min-width:80px; color:#334155 }
.perf-trades { color:#64748b; min-width:70px }
.perf-winrate { color:#3b82f6; min-width:60px }
.perf-pnl { font-weight:600; margin-left:auto }

/* Signals Header with BTC Phase */
.signals-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; flex-wrap:wrap; gap:8px }
.btc-phase { display:inline-block; padding:4px 10px; border-radius:6px; color:#fff; font-size:11px; font-weight:600 }

/* Signals Sections */
.signals-section { margin-bottom:20px }
.section-title { font-size:13px; font-weight:600; color:#64748b; margin-bottom:10px; padding-bottom:6px; border-bottom:1px solid #e2e8f0 }

/* Simplified Score Display */
.signal-score-simple { font-size:16px; font-weight:700; padding:4px 10px; border-radius:6px }
.signal-score-simple.score-pass { background:#dcfce7; color:#166534 }
.signal-score-simple.score-fail { background:#f1f5f9; color:#64748b }

/* Compact Strategy Pills */
.strat-compact { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px }
.strat-pill { font-size:11px; padding:3px 8px; border-radius:4px; font-weight:500 }
.strat-pill.strat-yes { background:#dcfce7; color:#166534 }
.strat-pill.strat-partial { background:#fef3c7; color:#92400e }
.strat-pill.strat-no { background:#f1f5f9; color:#94a3b8 }

/* Tier Targets */
.tier-targets { display:flex; gap:10px; margin-top:8px; font-size:12px; font-weight:600 }
.target-tp { color:#10b981 }
.target-sl { color:#ef4444 }

/* Held Card Styling */
.signal-card.held { border-left:3px solid #8b5cf6; background:#faf5ff }

/* Quality Filters Row */
.quality-filters { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 }
.qf-item { font-size:11px; padding:2px 6px; border-radius:4px; background:#f1f5f9; color:#64748b }
.qf-pass { background:#dcfce7; color:#166534 }
.qf-fail { background:#fee2e2; color:#991b1b }
.qf-neutral { background:#f1f5f9; color:#64748b }
.qf-blocked { background:#dc2626; color:#fff; font-weight:600 }

/* Risk Status in Admin */
.risk-status { display:flex; flex-wrap:wrap; gap:10px; margin:12px 0; padding:12px; background:#f8fafc; border-radius:8px; border:1px solid #e2e8f0 }
.risk-item { display:flex; flex-direction:column; gap:2px }
.risk-label { font-size:11px; color:#64748b; text-transform:uppercase }
.risk-value { font-size:14px; font-weight:600; color:#334155 }
.risk-value.ok { color:#10b981 }
.risk-value.warn { color:#f59e0b }
.risk-value.danger { color:#ef4444 }

/* Cooldown Banner */
.cooldown-banner { background:#fef3c7; border:1px solid #fcd34d; color:#92400e; padding:10px 14px; border-radius:8px; margin-bottom:12px; font-size:13px; display:flex; align-items:center; gap:8px }
.cooldown-banner strong { color:#78350f }

/* Sync Section */
.sync-info { font-size:12px; color:#64748b; margin-bottom:12px }
.sync-buttons { display:flex; flex-wrap:wrap; gap:8px }
.sync-status { margin-top:12px; font-size:12px; color:#334155; padding:8px; background:#f8fafc; border-radius:6px; min-height:20px }
.btn-blue { background:#3b82f6; color:#fff }
.btn-blue:hover { background:#2563eb }
.btn-orange { background:#f59e0b; color:#fff }
.btn-orange:hover { background:#d97706 }

/* Benchmark Section */
.benchmark-summary { display:flex; flex-wrap:wrap; gap:12px; margin:12px 0; padding:12px; background:#f8fafc; border-radius:8px }
.bench-item { display:flex; flex-direction:column; gap:2px; min-width:100px }
.bench-label { font-size:11px; color:#64748b; text-transform:uppercase }
.bench-value { font-size:16px; font-weight:600 }
.bench-value.green { color:#10b981 }
.bench-value.red { color:#ef4444 }

/* Market Phase Indicator */
.market-phase { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:10px; background:#f0fdf4; border-radius:8px; border:1px solid #bbf7d0; margin-top:12px }
.market-phase.bearish { background:#fef2f2; border-color:#fecaca }
.phase-label { font-size:12px; color:#64748b }
.phase-value { font-size:13px; font-weight:600 }
.phase-value.bullish { color:#059669 }
.phase-value.bearish { color:#dc2626 }
.phase-detail { font-size:11px; color:#64748b; margin-left:auto }

/* Daily Trend Badge */
.daily-badge { display:inline-block; padding:2px 6px; border-radius:4px; font-size:10px; font-weight:600; color:#fff; margin-left:4px }

/* Signals Header Badges */
.signals-badges { display:flex; gap:8px; align-items:center }
.mtf-badge { display:inline-block; padding:4px 8px; background:#8b5cf6; color:#fff; border-radius:6px; font-size:11px; font-weight:600 }

/* MTF Blocked indicator */
.qf-blocked { background:#dc2626; color:#fff; font-weight:600 }

/* Benchmark Management */
.bench-list { display:flex; flex-direction:column; gap:10px; margin:12px 0 }
.bench-row { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:12px; background:#f8fafc; border-radius:8px; border:1px solid #e2e8f0 }
.bench-name { flex:1; min-width:150px }
.bench-name strong { display:block; font-size:14px; color:#1a202c }
.bench-meta { font-size:11px; color:#64748b }
.bench-stats { display:flex; flex-wrap:wrap; gap:12px; font-size:13px }
.bench-stats span { padding:4px 8px; background:#fff; border-radius:4px; border:1px solid #e2e8f0 }
.bench-actions { display:flex; gap:6px }

.bench-add-form { padding:16px; background:#f8fafc; border-radius:8px }
.card-subtitle { font-size:13px; font-weight:600; color:#334155; margin-bottom:12px }
.form-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center }

.manual-snap-form { padding:12px; background:#f8fafc; border-radius:8px }

/* Chart Legend */
.chart-legend { display:flex; gap:16px; margin-bottom:12px; font-size:12px }
.legend-item { display:flex; align-items:center; gap:6px }
.legend-dot { width:12px; height:3px; border-radius:2px }
.legend-dot.green { background:#10b981 }
.legend-dot.blue { background:#3b82f6 }
.legend-dot.red { background:#ef4444 }

/* Health Grid */
.health-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; margin-bottom:12px }
.health-item { display:flex; flex-direction:column; padding:10px; background:#f8fafc; border-radius:6px; text-align:center }
.health-item span:first-child { font-size:11px; color:#64748b; margin-bottom:4px }
.health-item span:last-child { font-size:13px; font-weight:600 }
.health-item.ok { background:#dcfce7 } .health-item.ok span:last-child { color:#166534 }
.health-item.err { background:#fee2e2 } .health-item.err span:last-child { color:#dc2626 }
.health-item.warn { background:#fef3c7 } .health-item.warn span:last-child { color:#92400e }

/* Cron Grid */
.cron-status { margin-top:12px }
.cron-status strong { font-size:12px; color:#334155 }
.cron-grid { display:grid; grid-template-columns:repeat(2, 1fr); gap:6px; margin-top:8px }
.cron-item { display:flex; justify-content:space-between; font-size:12px; padding:6px 8px; background:#f8fafc; border-radius:4px }
.cron-item span:first-child { color:#64748b }
.cron-time { font-family:'JetBrains Mono', monospace; font-size:11px; color:#334155 }

/* Test Trade Section */
.test-section { padding:12px 0; border-bottom:1px solid #e2e8f0 }
.test-section:last-child { border-bottom:none }
.test-label { font-size:12px; font-weight:600; color:#64748b; margin-bottom:8px }
.test-trade { display:flex; flex-wrap:wrap; align-items:center; gap:8px }
.test-result { margin-top:8px; min-height:20px }
.test-success { font-size:12px; color:#166534; background:#dcfce7; padding:8px 12px; border-radius:6px }
.test-error { font-size:12px; color:#dc2626; background:#fee2e2; padding:8px 12px; border-radius:6px }

/* Valid Signal Card */
.signal-card.valid-signal { border-left:4px solid #10b981; background:#f0fdf4 }
.signal-badge { display:inline-block; padding:2px 6px; background:#10b981; color:#fff; font-size:10px; font-weight:700; border-radius:4px; margin-left:6px }

/* Position Card P&L Header */
.pos-pl { font-size:14px; font-weight:700 }
.pos-value-row { font-size:16px; font-weight:600; color:#334155; margin:4px 0 8px }
.pos-pct { font-size:12px; font-weight:500 }

/* ============================================================
   v33 NEW COMPONENTS
   ============================================================ */

/* 3-tile portfolio row */
/* v178: tiles — full-width, compact height */
.tiles-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-bottom:8px; width:100%; box-sizing:border-box }
.tiles-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin-bottom:8px }
.tile { background:#fff; border:none; border-radius:8px; padding:8px 8px 7px; box-shadow:var(--shadow-card); min-width:0; box-sizing:border-box; overflow:hidden }
.tile-label { font-size:11px; color:var(--blue); font-weight:700; text-transform:uppercase; letter-spacing:.4px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.tile-value { font-size:10px; font-weight:400; color:var(--text); line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.tile-sub { font-size:9px; color:var(--muted); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }

/* Collapsible positions */

.pos-summary { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 12px; cursor:pointer; user-select:none; font-variant-numeric:tabular-nums; min-height:28px }
.pos-coin-name { font-weight:700; font-size:11px; color:#1a202c; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }

.pos-tp-col { } .pos-sl-col { }
.pos-badge { display:inline-block; font-size:10px; padding:2px 5px; border-radius:4px; font-weight:600; white-space:nowrap }
.pos-badge.tp { background:#dcfce7; color:#166534 }
.pos-badge.sl { background:#fee2e2; color:#991b1b }
.pos-chevron { color:#94a3b8; font-size:16px; transition:transform .2s; text-align:center }
.pos-compact.open .pos-chevron { transform:rotate(90deg) }

.pos-compact.open 

.pos-detail-row span:first-child { color:#94a3b8 }
.pos-more { font-size:12px; color:#94a3b8; text-align:center; padding:8px 0 }

/* v33 signal cards */
.signal-card-v2 { background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:10px 12px; margin-bottom:8px; cursor:pointer }
.signal-card-v2.valid-signal { border-left:3px solid #10b981; background:#f0fdf4 }
.signal-card-v2.held { border-left:3px solid #3b82f6 }
.sig-main { display:flex; align-items:center; gap:6px; flex-wrap:wrap }
.sig-name { font-weight:700; font-size:14px; color:#1a202c }
.tier-badge-sm { font-size:10px; padding:2px 5px; border-radius:4px; color:#fff; font-weight:700 }
.sig-dtbadge { font-size:10px; color:#64748b; background:#f1f5f9; padding:1px 5px; border-radius:4px }
.sig-score { font-size:11px; color:#94a3b8; margin-left:auto }
.sig-blocked { font-size:10px; color:#ef4444; background:#fee2e2; padding:1px 5px; border-radius:4px }
.sig-details { display:none; margin-top:10px; padding-top:10px; border-top:1px solid #f1f5f9 }
.sig-details.open { display:block }
.sig-price-row { display:flex; gap:8px; font-size:12px; color:#475569; margin-bottom:8px; flex-wrap:wrap }
.strat-details { display:flex; flex-direction:column; gap:6px }
/* v152: strat-row harmonized with rest of UI — same white tile + soft shadow as cards,
   subtle color-coded left border only (no background tint). */
.strat-row { padding:10px 12px; border-radius:8px; font-size:12px; background:#fff; border:none; box-shadow:var(--shadow-card); margin-bottom:6px }
.strat-row.strat-yes     { background:#fff; border-left:3px solid #16a34a }
.strat-row.strat-partial { background:#fff; border-left:3px solid #d97706 }
.strat-row.strat-no      { background:#fff; border-left:3px solid #cbd5e1 }
.strat-name { font-weight:600; color:#334155 }
.strat-score { float:right; font-weight:700 }
.strat-checks { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px }
/* Check item colors — v218 final */
.check-item {
    font-size: 10px; padding: 2px 6px; border-radius: 3px;
    border: 1px solid transparent;
}
.check-item.pass      { background:#dcfce7; color:#166534; border-color:#bbf7d0 }   /* any pass → green */
.check-item.fail      { background:#fef9c3; color:#713f12; border-color:#fde047 }   /* scored fail → yellow */
.check-item.gate-fail { background:#fee2e2; color:#dc2626; border-color:#fca5a5 }   /* gate fail → red */
.check-item.na        { background:#f1f5f9; color:#94a3b8; border-color:#e2e8f0 }   /* no data → gray */
.sig-reason { font-size:11px; color:#ef4444; margin-top:6px }

/* Market picklist */
.market-picklist { position:absolute; top:100%; left:0; right:0; background:#fff; border:1px solid #e2e8f0; border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,.1); z-index:1000; max-height:200px; overflow-y:auto }
.pick-item { display:flex; justify-content:space-between; align-items:center; padding:8px 12px; font-size:13px; cursor:pointer; color:#334155 }
.pick-item:hover { background:#f8fafc }
.pick-vol { font-size:11px; color:#94a3b8 }

/* P&L new components */
.pnl-stats-row { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:10px 0 12px }
.pnl-stat { text-align:center; padding:8px }
.pnl-stat-label { font-size:11px; color:#94a3b8; text-transform:uppercase; letter-spacing:.3px }
.pnl-stat-value { font-size:15px; font-weight:700; margin-top:2px }
.chart-header { display:flex; justify-content:space-between; align-items:center }
.chart-legend-inline { font-size:11px; color:#64748b; display:flex; gap:8px; align-items:center }
.legend-dot-inline { display:inline-block; width:10px; height:3px; border-radius:2px }
.legend-dot-inline.green { background:#10b981 }
.legend-dot-inline.blue { background:#3b82f6 }
.snap-list { display:flex; flex-direction:column; gap:2px; margin-top:8px }
.snap-row { display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:6px; font-size:12px; background:#f8fafc }
.snap-date { color:#64748b; min-width:80px; font-family:'JetBrains Mono',monospace }
.snap-r,.snap-u { color:#475569; flex:1 }
.snap-t { font-weight:600; flex:1 }
.snap-del { background:none; border:none; color:#94a3b8; cursor:pointer; font-size:14px; padding:0 4px }
.snap-del:hover { color:#ef4444 }
.snap-more { font-size:11px; color:#94a3b8; text-align:center; padding:4px }
.bench-add-toggle { font-size:12px; color:#6366f1; cursor:pointer; padding:4px 0 }

/* Color-coded log viewer */
.log-viewer-v2 { background:#0f172a; border-radius:10px; padding:12px; max-height:360px; overflow-y:auto; font-family:'JetBrains Mono',monospace; font-size:11px; line-height:1.7 }
.log-line { padding:1px 0 }
.log-info { color:#94a3b8 }
.log-error { color:#f87171; font-weight:600 }
.log-debug { color:#60a5fa }

/* BTC phase badge - no icon */
.btc-phase { display:inline-block; padding:3px 8px; border-radius:6px; color:#fff; font-size:11px; font-weight:700 }
.mtf-badge { display:inline-block; padding:3px 8px; border-radius:6px; background:#6366f1; color:#fff; font-size:11px; font-weight:600 }

/* Tier input in admin - market picklist support */
.tier-coin-wrap { position:relative; display:inline-block }

/* Tier field help */
.tier-field-labels { display:flex; gap:6px; flex-wrap:wrap; margin-top:12px; font-size:10px; color:#94a3b8; font-weight:600; text-transform:uppercase; letter-spacing:.3px }
.tier-field-labels span { position:relative; width:80px; }
.tier-field-labels span:nth-child(2) { width:55px }
.tier-field-labels span:nth-child(4),.tier-field-labels span:nth-child(5),.tier-field-labels span:nth-child(6) { width:60px }
.tier-hint { display:block; font-size:9px; color:#cbd5e1; font-weight:400; text-transform:none; letter-spacing:0; white-space:normal; margin-top:1px }
.tier-help { font-size:11px; color:#94a3b8; margin-top:10px; line-height:1.5; padding:8px; background:#f8fafc; border-radius:6px }

/* ── Benchmark redesign ──────────────────────────────────────── */
.bench-row { padding:10px 0; border-bottom:1px solid #f1f5f9; display:flex; flex-wrap:wrap; align-items:center; gap:8px }
.bench-row:last-child { border-bottom:none }
.bench-name { flex:0 0 100%; font-size:13px }
.bench-name strong { color:#1a202c }
.bench-meta { font-size:11px; color:#94a3b8; margin-left:6px }
.bench-stats { flex:1; display:flex; flex-wrap:wrap; gap:8px; font-size:12px }
.bench-stat { padding:2px 0; color:#475569 }
.bench-actions { display:flex; gap:6px; flex-shrink:0 }

/* ── Payments (cashflows) ────────────────────────────────────── */
.pay-list { display:flex; flex-direction:column; gap:10px; margin-top:4px }
.pay-bench-section { padding:8px 0; border-bottom:1px solid #f1f5f9 }
.pay-bench-section:last-child { border-bottom:none }
.pay-bench-name { font-size:12px; font-weight:600; color:#334155; margin-bottom:6px }
.pay-add-row { display:flex; flex-wrap:wrap; gap:6px; align-items:center }

/* ── Chart container ─────────────────────────────────────────── */
.chart-container { overflow:hidden; border-radius:6px }

/* Bench add form grid */
.bench-add-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:8px; align-items:end }
.form-label { display:flex; flex-direction:column; gap:4px; font-size:11px; color:#64748b; font-weight:500 }

/* Payment rows */
.pay-bench-section { margin-bottom:14px; padding-bottom:14px; border-bottom:1px solid #f1f5f9 }
.pay-bench-section:last-child { border-bottom:none; margin-bottom:0 }
.pay-bench-name { font-size:13px; font-weight:600; color:#334155; margin-bottom:8px }
.pay-add-row { display:flex; flex-wrap:wrap; gap:6px; align-items:center }
.pay-existing-row { display:flex; align-items:center; gap:8px; padding:5px 0; font-size:12px; border-top:1px solid #f8fafc; margin-top:6px }
.pay-date-label { color:#94a3b8; font-family:'JetBrains Mono',monospace; font-size:11px; min-width:80px }
.pay-type-label { color:#64748b; flex:1 }
.pay-del { background:none; border:none; color:#94a3b8; cursor:pointer; font-size:14px; padding:0 4px }
.pay-del:hover { color:#ef4444 }

/* Bench-add-toggle */
.bench-add-toggle { font-size:12px; color:#6366f1; cursor:pointer; padding:6px 0; list-style:none }

/* Chart container */
.chart-container { margin-top:8px; overflow:hidden; border-radius:6px }

/* ── Signal card v3 ───────────────────────────────────────── */
.sig-main { display:flex; align-items:center; gap:8px; flex-wrap:nowrap }
.tier-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0 }
.sig-name { font-weight:700; font-size:14px; color:#1a202c; flex-shrink:0 }
/* sig-status defined in grid section */
.sig-strat-count { font-size:11px; color:#94a3b8; margin-left:auto; flex-shrink:0; font-family:'JetBrains Mono',monospace }
.sig-chev { color:#cbd5e1; font-size:16px; flex-shrink:0; transition:transform .2s }
.signal-card-v2.open .sig-chev { transform:rotate(90deg) }
.sig-details.open { display:block !important }

/* Add coin grid in signals */
.add-coin-grid { display:flex; gap:8px; align-items:center; flex-wrap:wrap }
.add-coin-hint { font-size:11px; color:#94a3b8; margin-top:7px }

/* ── TP/SL per-tier grid ──────────────────────────────────── */
.tpsl-tier-grid { display:flex; flex-direction:column; gap:6px; margin-bottom:4px }
.tpsl-tier-header { display:grid; grid-template-columns:1fr 80px 80px; gap:8px; font-size:11px; color:#94a3b8; font-weight:600; padding:0 2px; text-transform:uppercase; letter-spacing:.3px }
.tpsl-tier-row { display:grid; grid-template-columns:1fr 80px 80px; gap:8px; align-items:center; padding:6px 8px; background:#f8fafc; border-radius:6px }
.tpsl-tier-label { display:flex; align-items:center; gap:6px; font-size:13px; font-weight:500; color:#334155 }

/* Signal tier change row */
.sig-tier-change { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:10px; padding-top:10px; border-top:1px solid #f1f5f9 }
.sig-tier-label { font-size:11px; color:#94a3b8; font-weight:500; text-transform:uppercase }
.tier-pick-btn { font-size:11px; padding:3px 8px; border-radius:5px; border:1.5px solid; background:#fff; cursor:pointer; font-weight:600; transition:all .15s }
.tier-pick-btn:hover { opacity:.85 }
.tier-pick-btn.active { color:#fff }
.tier-remove-btn { margin-left:auto; font-size:11px; padding:3px 8px; background:none; border:1px solid #fee2e2; border-radius:5px; color:#ef4444; cursor:pointer }
.tier-remove-btn:hover { background:#fee2e2 }

/* Strategy score in detail — simplified */
.strat-score { font-size:11px; font-weight:600; color:#94a3b8 }
.strat-score.buy { color:#10b981 }

/* Signal count badge */
.sig-strat-count { font-size:11px; font-weight:600; color:#64748b; background:#f1f5f9; padding:2px 6px; border-radius:4px; margin-left:2px }


.tile-value.green { color: #10b981; font-weight:400 }
.tile-value.red   { color: #ef4444; font-weight:400 }
.tile-sub.green   { color: #10b981 }
.tile-sub.red     { color: #ef4444 }
.muted            { color: #94a3b8 }

/* ── Position badges: active vs inactive ── */
.pos-badge.tp-active  { background:#dcfce7; color:#166534 }
.pos-badge.sl-active  { background:#fee2e2; color:#991b1b }
.pos-badge.tp-inactive { background:#f1f5f9; color:#94a3b8; opacity:.6 }
.pos-badge.sl-inactive { background:#f1f5f9; color:#94a3b8; opacity:.6 }

/* ── Signal main row — fixed grid so all cards align ── */
.sig-main {
    /* v147: coin column tightened to remove big gap between name and first data */
    display: grid;
    grid-template-columns: 82px 50px 28px 1fr 14px;
    align-items: center;
    gap: 6px;
    padding: 0;
}
.sig-name        { font-weight:700; font-size:14px; color:#1a202c; white-space:nowrap; text-align:left; overflow:hidden; text-overflow:ellipsis }
.sig-name-price  { font-weight:500; font-size:11px; color:#64748b; font-family:'JetBrains Mono',monospace; margin-left:4px }
.sig-status      { font-size:10px; font-weight:700; padding:2px 6px; border-radius:4px; text-align:center; white-space:nowrap; justify-self:start }
.sig-status.buy     { background:#dcfce7; color:#166534 }
.sig-status.neutral { background:#f1f5f9; color:#64748b }
.sig-strat-count { font-size:12px; font-weight:600; color:#475569; text-align:center; font-family:'JetBrains Mono',monospace; justify-self:start }
.sig-reasons     { display:flex; gap:4px; flex-wrap:wrap; min-width:0; justify-content:flex-start }
.sig-tp-label    { font-size:10px; color:#10b981; font-weight:600; white-space:nowrap; text-align:left; overflow:hidden; text-overflow:ellipsis }
.sig-sl-label    { font-size:10px; color:#ef4444; font-weight:600; white-space:nowrap; text-align:left; overflow:hidden; text-overflow:ellipsis }
.sig-chev        { color:#94a3b8; font-size:16px; text-align:center; transition:transform .2s; justify-self:end }
.signal-card-v2.open .sig-chev { transform:rotate(90deg) }

/* ── Tier group headers ── */
.signals-tier-group  { margin-bottom: 12px }
.signals-tier-header { display:flex; align-items:center; gap:8px; padding:5px 10px; margin-bottom:6px; background:#f8fafc; border-radius:6px }
.stg-name       { font-size:12px; font-weight:700; color:#334155 }
.stg-buy-count  { font-size:11px; background:#dcfce7; color:#166534; padding:2px 7px; border-radius:4px; font-weight:600 }

/* ── Strategy check count ── */
.strat-chk-count { font-size:10px; color:#94a3b8; background:#f1f5f9; padding:1px 5px; border-radius:3px; margin-left:auto; margin-right:4px }

/* ── Snapshot bench value ── */
.snap-bench { font-size:11px; font-weight:600; padding:1px 5px; background:#f1f5f9; border-radius:3px }
.snap-bench.green { color:#10b981; background:#dcfce7 }
.snap-bench.red   { color:#ef4444; background:#fee2e2 }

/* ── Cron table in health ── */
.cron-table { margin-top:8px; display:flex; flex-direction:column; gap:2px }

.cron-row   { display:grid; grid-template-columns:1fr 2fr 3.5rem 5rem 5.5rem; gap:6px; padding:6px 6px; border-radius:6px; background:#f8fafc; align-items:center }
.cron-name  { font-size:12px; font-weight:600; color:#334155 }
.cron-file  { font-size:10px; color:#94a3b8; font-family:'JetBrains Mono',monospace; overflow:hidden; text-overflow:ellipsis }
.cron-interval { font-size:11px; color:#64748b }
.cron-time  { font-size:11px; color:#64748b; font-family:'JetBrains Mono',monospace }
.cron-status-badge { font-size:11px; font-weight:600; padding:2px 6px; border-radius:4px; text-align:center }
.cron-ok      { background:#dcfce7; color:#166534 }
.cron-delayed { background:#fef3c7; color:#92400e }
.cron-never   { background:#f1f5f9; color:#94a3b8 }

/* ── Telegram notification categories ── */
.notify-cats { margin-top:14px; border-top:1px solid #f1f5f9; padding-top:12px }
.notify-cats-title { font-size:12px; font-weight:600; color:#334155; margin-bottom:8px }
.notify-row { display:flex; align-items:center; gap:10px; padding:7px 0; border-bottom:1px solid #f8fafc }
.notify-row:last-of-type { border-bottom:none }
.notify-info { flex:1 }
.notify-label { font-size:13px; font-weight:500; color:#1a202c }
.notify-desc { font-size:11px; color:#94a3b8; margin-top:1px }
.notify-hint { font-size:11px; color:#94a3b8; margin-top:10px; padding:8px; background:#f8fafc; border-radius:6px }

/* ── Cron table (4 columns, no filename) ── */

.cron-row  { grid-template-columns: 1fr 3.5rem 5rem 5.5rem !important }

/* ── Cron setup hint ── */
.cron-setup-hint { margin-top:10px }
.cron-setup-hint > summary { font-size:12px; color:#f59e0b; cursor:pointer; padding:4px 0; list-style:none; display:flex; align-items:center; gap:4px }
.cron-setup-block { margin-top:8px; background:#0f172a; border-radius:8px; padding:12px; }
.cron-setup-title { font-size:11px; color:#94a3b8; text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px }
.cron-setup-code { font-family:'JetBrains Mono',monospace; font-size:11px; color:#e2e8f0; white-space:pre; overflow-x:auto; margin:0; line-height:1.6 }
.cron-setup-note { font-size:11px; color:#f59e0b; margin-top:8px }

/* Telegram notification categories */
.tg-cats-title { font-size:11px; font-weight:600; color:#64748b; text-transform:uppercase; letter-spacing:.4px; margin:12px 0 6px }
.tg-cats { display:flex; flex-direction:column; gap:4px }
.tg-cat-row { padding:5px 0 }
.tg-cat-label { display:flex; align-items:center; gap:8px; font-size:13px; color:#334155; cursor:pointer }
.tg-cat-label input[type=checkbox] { width:15px; height:15px; cursor:pointer; accent-color:#6366f1 }

/* Cron URL info */
.cron-url-info { font-size:11px; color:#64748b; margin-bottom:8px; display:flex; flex-wrap:wrap; gap:8px; align-items:center }
.cron-url-info code { background:#f1f5f9; padding:2px 6px; border-radius:4px; font-size:10px; color:#334155; word-break:break-all }
.cron-secret-status { font-size:11px; font-weight:600; padding:2px 7px; border-radius:4px; white-space:nowrap }
.cron-hint { font-size:11px; color:#94a3b8; margin-top:8px; line-height:1.5 }
.cron-hint code { background:#f1f5f9; padding:1px 5px; border-radius:3px; font-size:10px }
/* Fix cron table to 4 columns (no file column) */


/* Benchmark page */
.bench-stats-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(80px,1fr)); gap:8px; margin:10px 0 }
.bench-stat-block { text-align:center; padding:6px 4px; background:#f8fafc; border-radius:6px }
.bench-stat-label { font-size:10px; color:#94a3b8; text-transform:uppercase; letter-spacing:.3px }
.bench-stat-val   { font-size:14px; font-weight:700; color:#1a202c; margin-top:2px }
.bench-mini-chart { margin:8px 0 4px; overflow:hidden; border-radius:6px; background:#f8fafc }
.bench-snap-group { margin-bottom:12px }
.bench-snap-group-title { font-size:12px; font-weight:600; color:#334155; margin-bottom:6px; padding-bottom:4px; border-bottom:1px solid #f1f5f9 }

/* Manual SL position list */
.sl-positions { margin-bottom:10px; display:flex; flex-direction:column; gap:4px }
.sl-pos-row { display:grid; grid-template-columns:3rem 1fr 1fr 1fr 1fr; gap:6px; padding:6px 8px; background:#f8fafc; border-radius:6px; font-size:12px; align-items:center }
.sl-coin { font-weight:700; color:#334155 }
.sl-amount,.sl-avgbuy,.sl-kurs,.sl-val { color:#64748b }

/* Log tabs */
.log-tabs { display:flex; gap:6px; margin:8px 0; border-bottom:1px solid #f1f5f9; padding-bottom:8px }
.log-tab { background:none; border:none; padding:4px 12px; font-size:12px; font-weight:600; color:#94a3b8; cursor:pointer; border-radius:6px }
.log-tab.active { background:#f1f5f9; color:#334155 }

/* Per-strategy dry-run toggle */

.strat-dry-toggle { margin-left:auto; font-size:10px; font-weight:700; padding:2px 8px; border-radius:4px; cursor:pointer; border:none; transition:all .15s }
.strat-dry-toggle.dry  { background:#fef3c7; color:#92400e }
.strat-dry-toggle.live { background:#dcfce7; color:#166534 }

/* Benchmark page redesign */
.bench-page { display:flex; flex-direction:column; gap:0 }
.bench-intro { background:#f8fafc }
.bench-intro-text { font-size:13px; color:#64748b; margin-top:6px; line-height:1.5 }
.bench-card-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:10px }
.bench-card-name { font-size:15px; font-weight:700; color:#1a202c }
.bench-card-meta { font-size:11px; color:#94a3b8; margin-top:2px }

.bench-snap-form { margin-top:12px; padding-top:12px; border-top:1px solid #f1f5f9 }
.bench-snap-form-title { font-size:11px; font-weight:600; color:#64748b; text-transform:uppercase; letter-spacing:.4px; margin-bottom:8px }
.bench-snap-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center }
.bench-snap-hint { font-size:11px; color:#94a3b8; margin-top:6px; line-height:1.5 }

.bench-payments-details, .bench-hist-details { margin-top:12px }
.bench-payments-details summary, .bench-hist-details summary { font-size:12px; color:#6366f1; cursor:pointer; padding:4px 0; list-style:none }
.bench-payments-body { margin-top:8px }

/* Tier dropdown in signals */
.sig-tier-change select { font-size:12px }

/* Remove bench-auto-snap (no longer used) */
.bench-auto-snap { display:none }

/* ── Monthly P&L ─────────────────────────────────────────── */
.ytd-bar { display:flex; align-items:center; gap:10px; padding:10px 0 12px; border-bottom:1px solid #f1f5f9; margin-bottom:8px }
.ytd-label { font-size:12px; font-weight:700; color:#334155; min-width:70px }
.ytd-pl    { font-size:16px; font-weight:700; flex:1 }
.ytd-pct   { font-size:13px; font-weight:600 }

.year-folder { margin-bottom:4px }
.year-folder-summary { font-size:13px; font-weight:700; color:#334155; cursor:pointer; padding:8px 4px; list-style:none; display:flex; align-items:center; gap:6px; user-select:none }
.year-folder-summary::before { content:'▶'; font-size:9px; color:#94a3b8; transition:transform .15s }
.year-folder[open] > summary::before { transform:rotate(90deg) }
.year-folder-summary::-webkit-details-marker { display:none }

.month-list { padding-left:12px; display:flex; flex-direction:column; gap:2px; margin-top:4px }
.month-row  { display:grid; grid-template-columns:3rem 1fr 1fr 3.5rem; align-items:center; gap:8px; padding:6px 8px; border-radius:6px; background:#f8fafc }
.month-name { font-size:12px; font-weight:600; color:#334155 }
.month-abs  { font-size:12px; font-weight:700; text-align:right }
.month-delta{ font-size:11px; font-weight:600; text-align:right }
.month-pct  { font-size:11px; color:#64748b; text-align:right; font-family:'JetBrains Mono',monospace }

/* ── P&L Monthly Hierarchy ── */
.ytd-row { display:flex; align-items:center; gap:10px; padding:10px 0 12px; border-bottom:2px solid #f1f5f9; margin-bottom:8px }
.ytd-label { font-size:13px; font-weight:700; color:#334155; flex:1 }
.ytd-abs   { font-size:16px; font-weight:700 }
.ytd-pct   { font-size:12px; font-weight:600; background:#f1f5f9; padding:2px 7px; border-radius:4px }

.year-folder { margin-bottom:4px }
.year-folder > summary { list-style:none }
.year-folder > summary::-webkit-details-marker { display:none }
.year-summary {
    display:flex; align-items:center; gap:10px;
    padding:8px 4px; cursor:pointer;
    font-size:14px; font-weight:700; color:#1a202c;
    border-bottom:1px solid #e2e8f0; user-select:none;
}
.year-summary:hover { color:#6366f1 }
.year-label { flex:1 }
.year-total { font-size:13px; font-weight:600 }

/* Open/close chevron on year */
.year-folder > summary::before { content:'▶'; font-size:10px; color:#94a3b8; margin-right:4px; transition:transform .2s; display:inline-block }
.year-folder[open] > summary::before { transform:rotate(90deg) }

.month-folder { margin:2px 0 }
.month-folder > summary { list-style:none }
.month-folder > summary::-webkit-details-marker { display:none }
.month-summary {
    display:flex; align-items:center; gap:8px;
    padding:7px 12px; cursor:pointer;
    font-size:12px; background:#f8fafc; border-radius:6px;
    user-select:none;
}
.month-summary:hover { background:#f1f5f9 }
.month-folder > summary::before { content:'▸'; font-size:10px; color:#94a3b8; margin-right:2px; transition:transform .15s; display:inline-block }
.month-folder[open] > summary::before { transform:rotate(90deg) }

.month-label    { font-weight:600; color:#334155; width:32px }
.month-pl-abs   { font-weight:700; font-size:13px }
.month-vs-prev  { font-size:11px; background:#f1f5f9; padding:1px 6px; border-radius:3px; font-weight:500 }
.month-total    { margin-left:auto; font-size:11px }

/* Days inside month */
.month-folder .snap-list { padding:4px 12px 4px 16px }
.month-folder .snap-row  { padding:3px 0; font-size:12px }

/* Benchmark simplified */
.bench-type-chip { font-size:10px; color:#64748b; background:#f1f5f9; padding:1px 6px; border-radius:4px; margin-left:6px; font-weight:500 }
.bench-stat-sub  { font-size:10px; color:#94a3b8; margin-top:1px }
.bench-history-toggle { font-size:12px; color:#6366f1; cursor:pointer; list-style:none; padding:4px 0 }
.bench-history-toggle::-webkit-details-marker { display:none }
.bench-snap-result { font-size:12px; margin-top:6px }
.bench-snap-ok  { color:#10b981; padding:4px 0 }
.bench-snap-err { color:#ef4444; padding:4px 0 }
.bench-source   { color:#94a3b8; font-size:11px }

/* Sim/Live explanation */
.strat-dry-explain { font-size:12px; color:#64748b; background:#f8fafc; border-radius:6px; padding:8px 10px; margin-bottom:10px; line-height:1.6 }

/* Update button */
.sync-btn { background:#6366f1; color:#fff; border:none; padding:6px 14px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer }
.sync-btn:hover { background:#4f46e5 }
.sync-btn:disabled { opacity:.6; cursor:default }

/* Cron run buttons */
/* cron grid defined above */
.cron-run-btn {
    font-size: 11px; padding: 3px 8px; background: #f1f5f9;
    border: 1px solid #e2e8f0; border-radius: 5px; cursor: pointer;
    color: #475569; font-weight: 600; white-space: nowrap;
}
.cron-run-btn:hover    { background: #6366f1; color: #fff; border-color: #6366f1 }
.cron-run-btn:disabled { opacity: .5; cursor: default }
.cron-block            { margin-bottom: 3px }
.cron-run-result       { padding: 0 6px }
.cron-run-output       { font-size: 11px; padding: 4px 8px; border-radius: 4px; margin: 3px 0; font-family: 'JetBrains Mono', monospace }
.cron-run-ok           { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0 }
.cron-run-err          { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca }

/* Cron table clean grid — 5 columns: name | interval | last run | status | run button */
.cron-table { margin-top:6px; display:flex; flex-direction:column; gap:2px }

.cron-row   { display:grid; grid-template-columns:1fr 3rem 5.5rem 5.5rem 4.5rem; gap:6px; padding:7px 8px; border-radius:6px; background:#f8fafc; align-items:center }
.cron-block { margin-bottom:2px }

/* ── Cron table (clean single definition) ── */
.cron-table   { margin-top:8px; display:flex; flex-direction:column; gap:3px }
.cron-head    { display:grid; grid-template-columns:1fr 3.5rem 5.5rem 5.5rem 4.5rem; gap:6px; font-size:10px; color:#94a3b8; text-transform:uppercase; padding:4px 6px }
.cron-row     { display:grid; grid-template-columns:1fr 3.5rem 5.5rem 5.5rem 4.5rem; gap:6px; padding:7px 6px; border-radius:6px; background:#f8fafc; align-items:center }

/* Cache notice */
.cache-notice { font-size:11px; color:#94a3b8; background:#f8fafc; padding:4px 10px; border-radius:5px; margin-bottom:8px; text-align:center }

/* Operator ID warning */
.op-id-warn { font-size:12px; color:#92400e; background:#fef3c7; border:1px solid #fde68a; padding:8px 10px; border-radius:6px; margin-top:8px; line-height:1.6 }
.op-id-warn code { background:#fff; padding:1px 4px; border-radius:3px; font-size:11px }

/* Telegram masked credentials */
.tg-masked { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #64748b; background: #f1f5f9; padding: 4px 8px; border-radius: 4px; letter-spacing: 0.05em }

/* Trading status banner */
.trade-status { padding: 7px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; margin: 8px 0 4px; text-align: center }
.trade-status.live { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0 }
.trade-status.sim  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a }

/* ── Micro Arbitrage ───────────────────────────────────────────────────────── */
.badge-micro-arb   { display:inline-block; background:#7c3aed; color:#fff; font-size:9px; font-weight:700; padding:2px 6px; border-radius:4px; letter-spacing:.04em; vertical-align:middle; margin-left:4px }
.sig-micro-arb-detail { font-size:11px; color:#5b21b6; background:#f5f3ff; border:1px solid #ddd6fe; border-radius:5px; padding:5px 8px; margin:6px 0 4px }
.sig-micro-arb-detail b.green { color:#16a34a }
.sig-micro-arb-detail b.red   { color:#dc2626 }
.tier-block        { background:#f8fafc; border:1px solid #e2e8f0; border-radius:7px; padding:8px 10px; margin:8px 0 }
.tier-label        { font-size:11px; font-weight:700; color:#475569; text-transform:uppercase; letter-spacing:.05em; margin-bottom:6px }
.micro-arb-info    { font-size:10px; color:#94a3b8; margin-top:8px; line-height:1.5 }

/* Loading spinner */
.spinner-wrap  { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px 20px; gap:12px }
.spinner       { width:32px; height:32px; border:3px solid #e2e8f0; border-top-color:#6366f1; border-radius:50%; animation:spin .7s linear infinite }
.spinner-msg   { font-size:12px; color:#94a3b8 }
@keyframes spin { to { transform: rotate(360deg) } }

/* Technical indicator badges on signal cards */
.sig-tech-indicators { display:flex; gap:5px; flex-wrap:wrap; margin:5px 0 3px }
.tech-badge          { display:inline-block; font-size:10px; font-family:'JetBrains Mono',monospace; padding:2px 6px; border-radius:4px; background:#f1f5f9; color:#475569; border:1px solid #e2e8f0 }
.tech-badge.green    { background:#dcfce7; color:#15803d; border-color:#bbf7d0 }
.tech-badge.red      { background:#fee2e2; color:#dc2626; border-color:#fecaca }

/* ── Strategy Ranking Table ──────────────────────────────────────────────────── */
/* v53: wider name column, tighter number columns — strategy name on one line, rest aligned */
.rank-table   { display:flex; flex-direction:column; gap:3px; margin-bottom:8px }
.rank-head    { display:grid; grid-template-columns:minmax(96px,1.6fr) 52px 48px 64px 44px; gap:6px; font-size:9px; color:#94a3b8; text-transform:uppercase; padding:3px 8px; font-weight:600 }
.rank-row     { display:grid; grid-template-columns:minmax(96px,1.6fr) 52px 48px 64px 44px; gap:6px; padding:8px; border-radius:6px; background:#fff; align-items:center; border:none; box-shadow:var(--shadow-card); margin-bottom:4px }
.rank-row:hover { background:#f8fafc }
.rank-name    { font-size:12px; font-weight:600; color:#1e293b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.rank-head span:not(:first-child), .rank-row > span:not(.rank-name) { text-align:right; font-variant-numeric:tabular-nums }
.rank-score   { font-size:12px; font-family:'JetBrains Mono',monospace; font-weight:700 }
.rank-score.green  { color:#16a34a }
.rank-score.yellow { color:#d97706 }
.rank-score.red    { color:#dc2626 }
.rank-winrate { font-size:11px; color:#475569 }
.rank-pnl     { font-size:11px; font-family:'JetBrains Mono',monospace }
.rank-pnl.green { color:#16a34a }
.rank-pnl.red   { color:#dc2626 }
.rank-trades  { font-size:11px; color:#64748b }
.rank-conf    { display:flex; align-items:center; gap:4px }
.conf-bar     { width:40px; height:4px; background:#e2e8f0; border-radius:2px; overflow:hidden }
.conf-fill    { height:100%; background:#6366f1; border-radius:2px; transition:width .3s }
.rank-rec     { font-size:10px; font-weight:600; padding:2px 6px; border-radius:10px; text-align:center }
.rec-green    { background:#dcfce7; color:#15803d }
.rec-yellow   { background:#fef3c7; color:#92400e }
.rec-red      { background:#fee2e2; color:#dc2626 }
.rec-gray     { background:#f1f5f9; color:#64748b }

/* ── Logo ──────────────────────────────────────────────────────────────────── */
.logo { font-size:12px; font-weight:700; letter-spacing:-.2px; color:#1e293b }

/* tiles-3 consolidated below */

/* ── Held badge in signals ──────────────────────────────────────────────────── */
.held-badge { display:inline-block; background:#e0f2fe; color:#0369a1; font-size:8px; font-weight:700; padding:1px 4px; border-radius:3px; vertical-align:middle; margin-left:3px; text-transform:uppercase }

/* ── Sim signal status ──────────────────────────────────────────────────────── */
.sig-status.sim-signal { background:#fef3c7; color:#92400e }

/* ── Sell button in position ────────────────────────────────────────────────── */
.pos-sell-row { padding:6px 12px 10px; border-top:1px solid #f1f5f9; margin-top:4px }
.pos-sell-btn { width:100%; font-size:11px }

/* ── Strategy descriptions ──────────────────────────────────────────────────── */
.strat-desc-card .strat-desc-body { display:none; padding:0 4px 8px }
.strat-desc-card.open .strat-desc-body { display:block }
.strat-desc-header { display:flex; justify-content:space-between; align-items:center; cursor:pointer; padding:12px 16px }
.strat-desc-item { padding:8px 0; border-bottom:1px solid #f1f5f9 }
.strat-desc-item:last-child { border-bottom:none }
.strat-desc-name { font-size:12px; font-weight:700; color:#334155; margin-bottom:2px }
.strat-desc-text { font-size:11px; color:#64748b; line-height:1.5 }

/* ── Benchmark comparison table ─────────────────────────────────────────────── */
.comp-table  { display:flex; flex-direction:column; gap:2px }
.comp-head   { display:grid; grid-template-columns:2fr 1fr 1fr 1fr 1fr 24px; gap:6px; font-size:10px; color:#94a3b8; text-transform:uppercase; padding:4px 8px; font-weight:600 }
.comp-row    { display:grid; grid-template-columns:2fr 1fr 1fr 1fr 1fr 24px; gap:6px; padding:8px; border-radius:6px 6px 0 0; background:#f8fafc; align-items:center; font-size:12px }
.comp-row.comp-cs { background:#eff6ff; border:1px solid #bfdbfe; border-bottom:none }
.comp-name   { font-weight:600; color:#334155 }
.comp-pct    { font-weight:700; font-size:13px }
.comp-badge  { background:#dcfce7; color:#15803d; font-size:9px; padding:1px 4px; border-radius:3px; font-weight:700 }
.comp-sub    { font-size:10px; color:#94a3b8; padding:2px 8px 6px; background:#f8fafc; border-radius:0 0 6px 6px; margin-bottom:2px }
.comp-row.comp-cs + .comp-sub { background:#eff6ff; border:1px solid #bfdbfe; border-top:none }
.comp-row .asset-snap-clear { background:none; border:none; color:#cbd5e1; font-size:16px; cursor:pointer; padding:0; line-height:1 }
.comp-row .asset-snap-clear:hover { color:#ef4444 }
.bench-detail-wrap { margin-top:8px }
.bench-detail-sum  { font-size:12px; color:#64748b; cursor:pointer; padding:6px 0; list-style:none }
.bench-detail-sum::-webkit-details-marker { display:none }
@media (max-width:480px) {
  .comp-head, .comp-row { grid-template-columns:1.6fr 1fr 1fr 22px }
  /* hide Investiert (2) and P&L (4) on mobile; keep Anlage, Aktuell, Rendite, delete */
  .comp-head span:nth-child(2), .comp-row span:nth-child(2),
  .comp-head span:nth-child(4), .comp-row span:nth-child(4) { display:none }
}

/* ── Trades tab ────────────────────────────────────────────────────────────── */
.trade-log-table { display:flex; flex-direction:column; gap:2px; margin-top:6px }
.tl-head         { display:grid; grid-template-columns:1fr 0.6fr 0.8fr 1fr 1.5fr 1.5fr; gap:6px; font-size:10px; color:#94a3b8; text-transform:uppercase; padding:4px 8px; font-weight:600 }
.tl-row          { display:grid; grid-template-columns:1fr 0.6fr 0.8fr 1fr 1.5fr 1.5fr; gap:6px; padding:6px 8px; border-radius:5px; background:#f8fafc; font-size:11px; align-items:center }

/* ── Hours in position counter ─────────────────────────────────────────────── */
.pos-detail-row .orange { color:#f59e0b }

/* ── Signal held marking ────────────────────────────────────────────────────── */
.sig-name.sig-held { color:#0369a1 }
.held-badge        { background:#dbeafe; color:#1d4ed8; border:1px solid #bfdbfe }

/* ── v67: Logo on its own row, lowercase, left-aligned with Portfolio tab text ─ */
/* v144: image logo replaces text. v146: centered, +3px bottom spacing */
.header         { display:block; padding:0; box-shadow: var(--shadow-card); background: var(--card); border:none }
.logo           {
    font-size:12px;
    font-weight:700;
    text-transform:lowercase;
    letter-spacing:-.2px;
    padding:12px 8px 11px 8px;
    color:#1e293b;
    text-align:center;
}
.logo-img       {
    display:block;
    height:76px;
    width:auto;
    margin: 0 auto;
    padding:4px 0 2px 0;               /* v175: tighter top/bottom — was 8px/4px */
    user-select:none;
    pointer-events:none;
}
.tabs           { display:flex; overflow-x:auto; gap:0; padding-left:0 }
.tab            { flex-shrink:0 }

/* ── Strategy desc readable ─────────────────────────────────────────────────── */
.strat-desc-card  { margin-top:12px }
.strat-desc-header, .strat-desc-toggle { display:flex; justify-content:space-between; align-items:center; cursor:pointer; padding:10px 16px; user-select:none }
.strat-desc-body  { padding:0 12px 12px; display:none }
.strat-desc-card.open .strat-desc-body { display:block }
.strat-desc-item  { padding:8px 0; border-bottom:1px solid #f1f5f9 }
.strat-desc-item:last-child { border-bottom:none }
.strat-desc-name  { font-size:12px; font-weight:700; color:#1e293b; margin-bottom:3px }
.strat-desc-text  { font-size:11px; color:#475569; line-height:1.6 }
.version-badge { font-size:10px; color:#94a3b8; }

/* Micro Arb klapper */
.ma-details { margin: 6px 0 }
.ma-summary { font-size:11px; color:#64748b; cursor:pointer; padding:4px 0; list-style:none }
.ma-summary::-webkit-details-marker { display:none }


/* tiles-3 consolidated below */

/* ── Position age badge ─────────────────────────────────────────────────────── */




/* Benchmark management rows */
.bench-row { display:flex; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid #f1f5f9; flex-wrap:wrap }
.bench-row-name { font-weight:600; font-size:12px; min-width:100px }

/* ══════════════════════════════════════════════════════════════
   PORTFOLIO — compact, left-aligned, small fonts, no wrapping
══════════════════════════════════════════════════════════════ */
.pos-card               { background:#fff; border:1px solid #e2e8f0; border-radius:8px; margin-bottom:5px }
.pos-header             { display:grid; grid-template-columns:44px 1fr auto 28px 30px; align-items:center;
                           gap:4px; padding:7px 8px; cursor:pointer; user-select:none }
.pos-coin               { font-size:11px; font-weight:700; color:#1e293b }
.pos-name               { font-size:9px; color:#94a3b8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.pos-price-block        { font-size:10px; color:#475569; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.pos-pl-block           { font-size:10px; font-weight:600; text-align:right; white-space:nowrap }
.pos-pl-block.green     { color:#16a34a }
.pos-pl-block.red       { color:#dc2626 }
.pos-age                { font-size:9px; font-family:'JetBrains Mono',monospace; text-align:right;
                           white-space:nowrap; color:#94a3b8 }
.pos-age.orange         { color:#d97706 }
.pos-age.red            { color:#dc2626 }
.pos-details            { display:none; padding:6px 8px 8px; border-top:1px solid #f1f5f9 }
.pos-card.open .pos-details { display:block }
.pos-detail-grid        { display:grid; grid-template-columns:80px 1fr; gap:2px 6px; font-size:10px }
.pos-detail-label       { color:#94a3b8 }
.pos-detail-val         { color:#374151; font-weight:500 }
.pos-detail-val.green   { color:#16a34a }
.pos-detail-val.red     { color:#dc2626 }
.pos-detail-val.muted   { color:#94a3b8 }

/* ══ Portfolio position cards ════════════════════════════════════════════════ */
.pos-card          { background:#fff; border:none; border-radius:8px; margin-bottom:4px; overflow:hidden; box-shadow: var(--shadow-card) }
/* v132: ultra-compact — 3px vertical padding, slightly wider age column for 3-digit hours */
.pos-summary       { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 12px; cursor:pointer; user-select:none; font-size:11px; font-variant-numeric:tabular-nums; min-height:28px }
.pos-coin-lbl      { font-size:11px; font-weight:700; color:#1e293b }
.pos-pl-lbl        { font-size:11px; font-weight:600; white-space:nowrap; text-align:right; font-family:'JetBrains Mono',monospace }
.pos-pl-lbl.green  { color:#16a34a }
.pos-pl-lbl.red    { color:#dc2626 }
/* v132: min-width so 3-digit hours (e.g. 168h) fit without crowding */
/* v142: margin-right so the badge has breathing room from the chevron/card edge */
/* v143: left-aligned text with extra right padding so duration text doesn't touch the badge border */
.pos-age           { font-size:10px; font-family:'JetBrains Mono',monospace; color:#94a3b8; white-space:nowrap; padding:1px 10px 1px 8px; background:#f1f5f9; border-radius:3px; text-align:left; min-width:72px; display:inline-block; margin-right:8px }
.pos-age.orange    { background:#fef3c7; color:#92400e }
.pos-age.red       { background:#fee2e2; color:#dc2626 }

/* v67: detail grid — numbers right-aligned, tabular for scan-ability */
.pos-dg            { display:grid; grid-template-columns:4rem 1fr; gap:4px 10px; padding:8px 12px }
.pdl               { font-size:11px; color:#94a3b8; align-self:center }
.pdv               { font-size:11px; color:#334155; font-weight:500; text-align:right; font-family:'JetBrains Mono',monospace; font-variant-numeric:tabular-nums }
.pdv.green         { color:#16a34a }
.pdv.red           { color:#dc2626 }
.pdv.muted         { color:#94a3b8 }
.pdv.clickable-detail { cursor:pointer; text-decoration:underline dotted; text-underline-offset:2px }
.pdv.clickable-detail:hover { color:#3b82f6 }
/* v67: trailing-TP indicator (small arrow in summary) */
.tpsl-badge.trailing-tp-active { background:#dcfce7; color:#16a34a; font-weight:600; cursor:help }
.pos-details       { display:none; padding:6px 9px 8px; border-top:1px solid #f1f5f9 }
.pos-card.open .pos-details { display:block }

/* ══ v67: Net P&L & Fees card ═════════════════════════════════════════════ */
.fees-grid       { display:grid; grid-template-columns:1fr auto; gap:5px 12px; padding:8px 4px 10px; font-variant-numeric:tabular-nums }
.fees-lbl        { font-size:12px; color:#64748b }
.fees-val        { font-size:13px; font-weight:600; text-align:right; font-family:'JetBrains Mono',monospace }
.fees-val.green  { color:#16a34a }
.fees-val.red    { color:#dc2626 }
.fees-sub-title  { font-size:11px; color:#94a3b8; text-transform:uppercase; letter-spacing:.4px; margin:6px 0 4px; border-top:1px solid #f1f5f9; padding-top:8px }
.fees-tf-grid    { display:grid; grid-template-columns:repeat(5,1fr); gap:6px }
.fees-tf-cell    { background:#f8fafc; border-radius:6px; padding:7px 4px; text-align:center }
.fees-tf-lbl     { font-size:10px; color:#94a3b8 }
.fees-tf-val     { font-size:12px; font-weight:700; color:#dc2626; font-family:'JetBrains Mono',monospace; margin:2px 0 }
.fees-tf-cnt     { font-size:9px; color:#cbd5e1 }
@media (max-width:480px){ .fees-tf-grid { grid-template-columns:repeat(3,1fr) } }

/* ══ v68: Fear & Greed regime layer ═══════════════════════════════════════ */
.fg-tile { position:relative }
.fg-regime-banner { display:flex; align-items:center; gap:10px; background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:10px 12px; margin:8px 0 }
.fg-rb-score { font-size:22px; font-weight:800; font-family:'JetBrains Mono',monospace; min-width:34px; text-align:center }
.fg-rb-txt { font-size:12px; color:#475569; flex:1 }
.fg-rb-off { font-size:10px; font-weight:700; color:#92400e; background:#fef3c7; padding:2px 7px; border-radius:4px }
.strat-clusters { display:flex; flex-direction:column; gap:8px; margin-top:6px }
.regime-cluster { border:1px solid #e2e8f0; border-radius:8px; overflow:hidden }
.regime-cluster-hd { font-size:11px; font-weight:700; padding:6px 9px; background:#f8fafc; color:#475569; display:flex; align-items:center; gap:6px }
.regime-active { border-color:#86efac; box-shadow:0 0 0 1px #86efac }
.regime-active .regime-cluster-hd { background:#f0fdf4; color:#15803d }
.regime-dim { opacity:.58 }
.regime-dim .regime-cluster-hd { background:#f1f5f9 }
.regime-badge-on  { margin-left:auto; font-size:9px; font-weight:800; color:#fff; background:#16a34a; padding:1px 6px; border-radius:3px }
.regime-badge-off { margin-left:auto; font-size:9px; font-weight:700; color:#94a3b8; background:#e2e8f0; padding:1px 6px; border-radius:3px }
.strat-row.strat-regime-off .strat-score.buy { background:#fde68a; color:#92400e }
.regime-cluster-note { font-size:9px; color:#94a3b8; padding:4px 2px 0; font-style:italic }

/* ══ Admin Health ══════════════════════════════════════════════════════════ */
.health-loading    { color:#94a3b8; font-size:12px; padding:8px 0 }
.health-err        { color:#dc2626; font-size:12px; padding:8px 0 }
.health-rows       { display:flex; flex-direction:column; gap:4px; margin:8px 0 }
.health-row        { display:flex; align-items:center; gap:8px; font-size:12px; padding:4px 6px; border-radius:5px; background:#f8fafc }
.health-row.ok     { background:#f0fdf4 }
.health-row.err    { background:#fef2f2 }
.health-row.warn   { background:#fffbeb }
.health-icon       { font-size:13px; width:16px; text-align:center }
.health-row.ok  .health-icon  { color:#16a34a }
.health-row.err .health-icon  { color:#dc2626 }
.health-row.warn .health-icon { color:#d97706 }
.health-label      { font-weight:600; min-width:80px; color:#374151 }
.health-note       { color:#6b7280; font-size:11px; margin-left:auto }
.cron-rows         { margin-top:8px; border-top:1px solid #f1f5f9; padding-top:6px }
.cron-row          { display:flex; justify-content:space-between; font-size:10px; padding:2px 0; color:#64748b }
.cron-row.ok  span:last-child { color:#16a34a }
.cron-row.err span:last-child { color:#dc2626 }
.cron-row.warn span:last-child { color:#d97706 }
/* Trading banner */
.trade-status-banner { margin-top:8px; padding:6px 10px; border-radius:5px; font-size:11px; font-weight:600; text-align:center }
.status-live { background:#f0fdf4; color:#15803d; border:1px solid #bbf7d0 }
.status-sim  { background:#fffbeb; color:#92400e; border:1px solid #fde68a }
.status-off  { background:#f1f5f9; color:#64748b; border:1px solid #e2e8f0 }
/* Tier SL rows */
.tier-sl-row     { display:flex; align-items:center; gap:6px; margin-bottom:6px; font-size:11px }
.tier-sl-label   { min-width:56px; font-weight:600; color:#374151 }
.tier-sl-sub     { color:#94a3b8; font-size:10px }
.input-xs        { width:56px; padding:4px 6px; font-size:11px; border:1px solid #e2e8f0; border-radius:4px }
.setting-sub-title { font-size:10px; font-weight:600; color:#64748b; text-transform:uppercase; letter-spacing:.5px; margin:8px 0 4px }

/* ── Strategy categories (v43) ─────────────────────────────────────────────── */
.strat-category         { margin-top: 10px; }
.strat-category-label   { font-size: 10px; font-weight: 700; color: #64748b;
                          text-transform: uppercase; letter-spacing: 0.6px;
                          padding: 4px 8px; margin-bottom: 4px;
                          background: #f1f5f9; border-radius: 4px;
                          border-left: 3px solid #4f46e5; }
.strat-category:first-of-type { margin-top: 0; }

/* ── v44 Signals tab refinements ─────────────────────────────────────────── */
/* Held position dot (replaces "Bestand" text label) */
.held-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
}
.sig-name.sig-held {
    color: #15803d;
    font-weight: 700;
    /* subtle background tint and left border */
    background: linear-gradient(90deg, rgba(22,163,74,0.06) 0%, transparent 80%);
    border-left: 3px solid #16a34a;
    padding-left: 8px;
    border-radius: 0 4px 4px 0;
}

/* Strategy row partial score (yellow = evaluated but not fulfilled) */
.strat-row.strat-partial    { border-left: 3px solid #d97706; background: #fff; }
.strat-row.strat-no         { border-left: 3px solid #94a3b8; background: #fff; }
.strat-score.partial        { color: #d97706; font-weight: 600; font-size: 10px; }

/* check-item: N/A state for unevaluated checks */
/* Signal source indicator */
.signal-source-info {
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 6px;
    padding: 4px 8px;
    background: #f8fafc;
    border-radius: 4px;
}
.signal-source-info.fresh { background: #f0fdf4; color: #15803d; }
.signal-source-info.stale { background: #fffbeb; color: #92400e; }
.signal-source-info.live  { background: #eff6ff; color: #1e40af; }

/* ── v45 Portfolio: TP/SL active badges ──────────────────────────────────── */
.pos-tpsl-badges        { display: inline-flex; gap: 3px; margin-left: 4px; }
.tpsl-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.4px;
    line-height: 1.4;
    border: 1px solid transparent;
}
.tpsl-badge.tp-active   { background: #dcfce7; color: #15803d; border-color: #86efac; }
.tpsl-badge.tp-inactive { background: #f1f5f9; color: #cbd5e1; border-color: #e2e8f0; }
.tpsl-badge.sl-active   { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.tpsl-badge.sl-inactive { background: #f1f5f9; color: #cbd5e1; border-color: #e2e8f0; }

/* ── v45 P&L: period filter + cash flow ──────────────────────────────────── */
.period-filter {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px;
    margin-bottom: 10px;
    gap: 2px;
}
.period-btn {
    border: none;
    background: transparent;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}
.period-btn:hover           { color: #1e293b; background: rgba(255,255,255,0.5); }
.period-btn.active          { background: #ffffff; color: #16a34a; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

/* Cash Flow */
.cf-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #334155;
}
.cf-summary b { font-weight: 600; color: #1e293b; }
.cf-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.cf-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}
.cf-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 11px;
}
.cf-row .cf-date   { color: #64748b; min-width: 80px; font-family: 'JetBrains Mono', monospace; }
.cf-row .cf-amount { font-weight: 700; min-width: 70px; }
.cf-row .cf-note   { flex: 1; color: #475569; }
/* v157: auto-import badge */
.cf-row.cf-auto    { background: rgba(37, 99, 235, 0.04); border-left: 2px solid var(--blue); padding-left: 6px }
.cf-src-badge      { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: var(--blue); color: #fff; letter-spacing: 0.4px }
.cf-src-badge.cf-src-manual { background: #94a3b8 }

/* Card summary (klapper title row inside <details>) */
.card-summary {
    display: flex;
    align-items: center;
    width: 100%;
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 0;
}
.card-summary::-webkit-details-marker { display: none; }
.card-summary::before {
    content: '▸';
    font-size: 10px;
    color: #94a3b8;
    margin-right: 6px;
    transition: transform 0.15s;
}
details[open] > .card-summary::before { transform: rotate(90deg); }

/* CryptoSignals row gets a green accent in the comparison table */
.comp-row.comp-cs {
    background: linear-gradient(90deg, rgba(16,185,129,0.08) 0%, transparent 60%);
    border-left: 3px solid #16a34a;
    font-weight: 600;
}
.comp-row.comp-cs .comp-badge {
    background: #dcfce7;
    color: #15803d;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    margin-left: 4px;
}

/* ── v46 Signals: block reason badge + manual buy button ─────────────────── */
.sig-block-reason {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    margin-left: 4px;
    vertical-align: middle;
    letter-spacing: 0.2px;
}
.sig-reason-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px 0 2px;
    margin-top: 4px;
}
.sig-reason-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    background: #fef3c7;
    color: #92400e;
    border: none;
}
.sig-reason-chip.held    { background:#fef3c7; color:#92400e; }
.sig-reason-chip.blocked { background:#fef3c7; color:#92400e; }
.sig-reason-chip.traded  { background:#dcfce7; color:#15803d; }
.sig-block-reason.sig-traded {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}
.sig-manual-buy {
    transition: background 0.15s, transform 0.1s;
}
.sig-manual-buy:hover    { transform: translateY(-1px); }
.sig-manual-buy:disabled { opacity: 0.6; cursor: wait; }
.sig-manual-buy.btn-success { background: #16a34a; color: #fff; }

/* ── v51: disabled strategy row (still visible but muted) ────────────────── */
.strat-row.strat-disabled {
    opacity: 0.82;
    background: #fafafa;
    border-left-color: #cbd5e1 !important;
}
.strat-row.strat-disabled .strat-name::after {
    content: ' (aus)';
    font-size: 9px;
    color: #94a3b8;
    font-weight: 400;
    margin-left: 4px;
}
/* v57: keep check results fully legible even on disabled strategy rows */
.strat-row.strat-disabled .strat-checks,
.strat-row.strat-disabled .check-item { opacity: 1; }

/* ── v51: Intelligence tab — full width ──────────────────────────────────── */
.rank-table { width: 100%; }


/* ── v51: clickable TP/SL badges in position summary ─────────────────────── */
.tpsl-badge.clickable {
    cursor: pointer;
    transition: all 0.12s;
}
.tpsl-badge.clickable:hover {
    transform: scale(1.08);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.tpsl-badge.tp-inactive.clickable:hover { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.tpsl-badge.sl-inactive.clickable:hover { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }


/* ── v52: Trailing SL badge ──────────────────────────────────────────────── */
.tpsl-badge.trailing-active {
    background: #ede9fe;
    color: #6d28d9;
    border-color: #c4b5fd;
    cursor: help;
    font-size: 11px;
    padding: 1px 5px;
}

/* ── v52: Toggle small variant for trailing per-coin rows ─────────────────── */
.toggle-sm {
    width: 30px;
    height: 16px;
    background: #e2e8f0;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
}
.toggle-sm::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.15s;
}
.toggle-sm.on { background: #10b981; }
.toggle-sm.on::after { left: 16px; }

/* v151: position summary right-side group (P&L | 24h%) */
.pos-summary .pos-right { display:inline-flex; align-items:center; gap:8px; font-variant-numeric:tabular-nums; white-space:nowrap }
.pos-sep   { color:#cbd5e1; font-weight:400 }
.pos-24h   { font-size:11px; font-weight:600; font-family:'JetBrains Mono',monospace }
.pos-24h.green { color:#16a34a }
.pos-24h.red   { color:#dc2626 }
.pos-24h.muted { color:#94a3b8 }


/* v165: Strategy → Regime admin UI */
.regime-row { background:#fff; border-radius:8px; box-shadow:var(--shadow-card); padding:10px 12px; margin-bottom:6px }
.regime-row-head { display:flex; align-items:center; gap:8px; margin-bottom:6px }
.regime-row-name { font-weight:600; font-size:12px; color:var(--text); flex:1 }
.regime-row-cat  { font-size:10px; color:var(--muted); font-weight:500 }
.regime-row-flag { font-size:9px; font-weight:700; padding:1px 6px; border-radius:3px; letter-spacing:0.4px; text-transform:uppercase }
.regime-chips    { display:flex; gap:6px }
.regime-chip {
    flex:1; padding:6px 4px; border:1px solid #e2e8f0; border-radius:6px;
    font-size:11px; font-weight:600; cursor:pointer;
    background:transparent; color:#64748b;
    transition:all 0.15s ease;
}
.regime-chip:hover { border-color:#94a3b8 }
.regime-chip.on { color:#fff; font-weight:700 }

/* v166: Win-rate table per strategy × regime */
.wr-table { display:flex; flex-direction:column; gap:4px }
.wr-row { display:grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap:6px; align-items:center; background:#fff; box-shadow:var(--shadow-card); border-radius:6px; padding:6px 8px }
.wr-row.wr-head { background:transparent; box-shadow:none; padding:2px 8px 4px }
.wr-row.wr-head > div { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:0.4px; color:var(--muted); text-align:right }
.wr-row.wr-head .wr-strat { text-align:left; color:var(--muted) }
.wr-row.wr-head .wr-fear    { color:#dc2626 }
.wr-row.wr-head .wr-neutral { color:#64748b }
.wr-row.wr-head .wr-greed   { color:#16a34a }
.wr-strat { font-size:12px; font-weight:600; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.wr-cell { display:flex; flex-direction:column; align-items:flex-end; gap:2px; min-width:0 }
.wr-bar-wrap { width:100%; height:4px; background:#f1f5f9; border-radius:2px; overflow:hidden }
.wr-bar { height:100%; transition:width 0.3s ease, opacity 0.3s ease }
.wr-text { display:flex; align-items:baseline; gap:4px; font-size:10px; font-variant-numeric:tabular-nums }
.wr-text b { font-weight:700; font-size:11px; color:var(--text) }
.wr-meta { color:var(--muted); font-size:9px }
.wr-empty { color:var(--muted); font-size:11px; font-weight:400 }

/* v167: PWA safe-area insets — when running in standalone mode on notched
   phones (iPhone, modern Android), respect the top status bar and bottom
   gesture area so content isn't hidden under the cutout. */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top:    env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* v170: Krypto News widget on home tab. v172: 2-line. v175: read-mark */
.krypto-news-card { padding: 12px 14px }
.kn-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 7px 0;
    border-bottom: 1px solid #f1f5f9;
}
.kn-row:last-child { border-bottom: none }
.kn-link {
    flex: 1;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.kn-link:hover .kn-title { color: var(--blue) }
.kn-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    color: var(--text);
    word-break: break-word;
    line-height: 1.4;
}
.kn-sep {
    flex-shrink: 0;
    color: #e2e8f0;
    font-size: 14px;
    margin: 0 6px;
    user-select: none;
}
.kn-read {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 2px;
    line-height: 1;
    transition: color 0.15s;
}
.kn-read:hover { color: #22c55e }

/* v170: News feed admin rows */
.news-feed-row { background:#fff; border-radius:8px; box-shadow:var(--shadow-card); padding:8px 10px; margin-bottom:6px }
.news-feed-head { display:flex; align-items:center; gap:10px }
.news-feed-toggle { display:inline-flex; align-items:center; cursor:pointer; flex-shrink:0 }
.news-feed-toggle input { margin:0; width:14px; height:14px; cursor:pointer }
.news-feed-info { flex:1; min-width:0 }
.news-feed-name { font-size:12px; font-weight:600; color:var(--text) }
.news-feed-url  { font-size:10px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.news-feed-meta { font-size:10px; color:var(--muted); margin-top:2px }

/* v171: News widget empty/error state */
.kn-status {
    font-size: 11px;
    color: var(--muted);
    padding: 8px 0 2px;
    text-align: center;
}

/* v174: G&V Klapper */
.pnl-breakdown-details { margin-top: 12px }
.pnl-breakdown-details .pnl-breakdown { margin-top: 0 }
.pnl-breakdown-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-card);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.pnl-breakdown-summary::-webkit-details-marker { display: none }
.pnl-breakdown-summary::after {
    content: '›';
    font-size: 16px;
    color: var(--muted);
    transition: transform 0.2s;
    display: inline-block;
}
.pnl-breakdown-details[open] > .pnl-breakdown-summary::after {
    transform: rotate(90deg);
}
.pnl-breakdown-details[open] > .pnl-breakdown-summary {
    border-radius: 10px 10px 0 0;
    box-shadow: var(--shadow-card);
    margin-bottom: 0;
}
.pnl-breakdown-details[open] .pnl-breakdown {
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow-card);
    margin-top: 0;
}

/* v175: Sparkline in 24h tile */
.tile-spark { display:flex; justify-content:center; margin: 2px 0 1px; opacity:0.9 }
.tile-spark svg { display:block }

/* v175: 2-tile row (FNG + 24h) */
.tiles-2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:12px 12px 0 }

/* v175: Inner tiles in G&V klapper (Wallet + P&L) */
.pnl-inner-tiles { padding: 12px 12px 0; margin-bottom:4px }

/* v178: 24h tile inline row (€ | %) */
.tile-24h-row { display:flex; align-items:baseline; gap:3px; flex-wrap:nowrap; overflow:hidden }
.tile-24h-row span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; flex-shrink:1 }
.tile-24h-row span:first-child { flex-shrink:0 }  /* € amount never shrinks */
.tile-pipe { flex-shrink:0 !important; color:#e2e8f0; font-size:11px; line-height:1 }

/* v182: KI Signal Validation */
.ki-badge {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700; padding: 2px 6px;
    border-radius: 4px; letter-spacing: 0px;
    margin-left: 4px; vertical-align: middle;
    white-space: nowrap; flex-shrink: 0;
    line-height: 1.4;
}
.ki-badge.ki-pending  { background:#f1f5f9; color:#94a3b8 }
.ki-badge.ki-green    { background:#dcfce7; color:#16a34a }
.ki-badge.ki-orange   { background:#fff7ed; color:#f97316 }
.ki-badge.ki-red      { background:#fee2e2; color:#dc2626 }
.ki-badge.ki-skip     { display:none }

.ki-signal-wrap { margin-top: 8px }

.ki-analysis-box {
    background: #fafbfc;
    border-radius: 0 6px 6px 0;
    padding: 8px 10px;
    margin-top: 6px;
}
.ki-analysis-header { display:flex; align-items:center; gap:8px; margin-bottom:4px }
.ki-verdict-label   { font-size:11px; font-weight:700 }
.ki-confidence      { font-size:10px }
.ki-summary         { font-size:11px; font-weight:600; color:var(--text); margin-bottom:3px }
.ki-detail          { font-size:11px; color:#475569; line-height:1.5; margin-bottom:3px }
.ki-risk            { font-size:10px; color:#f97316; font-weight:600 }  /* kept for cached */
.ki-improvement     { font-size:10px; color:#2563eb; font-weight:600 }  /* improvement suggestion */

/* Admin KI rows */
.ki-row { padding: 4px 0 }
.ki-label { font-size:11px; font-weight:600; color:var(--text); margin-bottom:2px }
.ki-value { font-size:11px; color:#64748b }

/* v184: KI timestamp in analysis header */
.ki-timestamp { font-size:9px; color:#94a3b8; margin-left:auto }

/* v186: KI error + loading states */
.ki-err     { font-size:10px; color:#dc2626; padding:4px 0 }
.ki-loading { font-size:10px; color:#94a3b8; padding:4px 0; font-style:italic }

/* v188: Signal filter reason chips */
.sig-reason-chip.filter {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}
