:root {
    --surface-main: #070a0d;
    --divider-subtle: #172029;
    --bg: #070a0d;
    --bg-soft: #0b1015;
    --panel: #0b1015;
    --panel-2: #0e141a;
    --line: #202a33;
    --line-soft: #172029;
    --text: #f1f5f9;
    --muted: #a8b2be;
    --orange: #ff9700;
    --orange-2: #ff6b00;
    --green: #21d783;
    --blue: #319dff;
    --purple: #a460ff;
    --danger: #ff5d6c;
    --radius: 12px;
    --background: var(--surface-main);
    --surface: var(--panel);
    --surface-secondary: var(--panel-2);
    --border: var(--line);
    --border-subtle: var(--line-soft);
    --text-primary: var(--text);
    --text-secondary: var(--muted);
    --text-muted: #687482;
    --surface-hover: #131a21;
    --shadow-subtle: 0 1px 2px rgba(0, 0, 0, .35);
}

* { scrollbar-width: thin; scrollbar-color: #254158 transparent; }
html, body { min-height: 100%; }
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}

a { color: inherit; text-decoration: none; }
button, input, select { letter-spacing: inherit; }
.muted, .metric-sub, .panel-label, .form-hint { color: var(--muted); }
.positive { color: var(--green) !important; }
.negative { color: var(--danger) !important; }
.neutral { color: var(--muted) !important; }
.eyebrow { color: var(--orange); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-left: 5px; background: var(--green); border-radius: 50%; box-shadow: 0 0 10px rgba(33, 215, 131, .5); }

.brand-mark { width: 33px; height: 33px; position: relative; flex: 0 0 33px; display: grid; place-items: center; overflow: hidden; background: transparent; border-radius: 10px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 62px; display: flex; align-items: center; gap: 16px; padding: 9px 22px; border-bottom: 1px solid var(--line); background: rgba(2, 10, 18, .74); backdrop-filter: blur(18px); }
.topbar h1 { margin: 0; font-size: 17px; font-weight: 650; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; color: #b1c0cd; background: #07141f; border: 1px solid var(--line); border-radius: 20px; font-size: 11px; }
.live-pill i { width: 7px; height: 7px; background: var(--green); border-radius: 50%; animation: pulse 2.2s infinite; }
.user-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #dbe4eb; background: #07141f; border: 1px solid var(--line); border-radius: 9px; }
.user-button { min-height: 39px; padding: 0 12px; }
.user-button i { font-size: 18px; }
.icon-button { width: 36px; height: 36px; }
.icon-button:hover, .user-button:hover { color: var(--orange); border-color: #365068; }
.dropdown-menu { --bs-dropdown-bg: #081722; --bs-dropdown-border-color: var(--line); --bs-dropdown-link-color: #d7e0e7; --bs-dropdown-link-hover-bg: #102534; --bs-dropdown-link-hover-color: #fff; box-shadow: 0 18px 40px rgba(0,0,0,.35); }

.app-main { width: 100%; max-width: none; margin: 0; padding: 9px 10px 18px; flex: 1; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 34px rgba(0,0,0,.12); }
.panel-label { display: block; margin-bottom: 6px; font-size: 11px; letter-spacing: .025em; text-transform: uppercase; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-heading h2 { margin: 0; font-size: 16px; font-weight: 650; }

.signals-metrics { position: relative; margin-bottom: 14px; padding: 13px 76px 13px 16px; overflow: hidden; }
.signals-metrics-scroll { display: flex; align-items: stretch; gap: 14px; min-width: 0; }
.signals-metric { display: flex; min-width: 0; flex-direction: column; justify-content: center; }
.signals-btc { flex: 1 1 31%; min-width: 235px; }
.signals-btc-head { display: flex; align-items: baseline; gap: 9px; height: 24px; }
.signals-btc-head > span { color: #c5d0d9; font-size: 10px; font-weight: 650; white-space: nowrap; }
.signals-btc-head > span i { margin-right: 4px; color: var(--orange); }
.signals-btc-head strong { color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.signals-btc-head small { margin-left: auto; font-size: 10px; font-weight: 650; }
.signals-btc-spark { width: 100%; height: 58px; }
.signals-separator { width: 1px; min-height: 72px; flex: 0 0 1px; align-self: center; background: rgba(255,255,255,.08); }
.signals-event { flex: 1 1 33.333%; }
.signals-event, .signals-bank, .signals-profit { display: grid; grid-template-rows: 21px 16px 6px 16px; align-content: center; justify-content: stretch; gap: 5px; }
.signals-event-top, .signals-bank-top, .signals-event-bottom, .signals-bank-bottom { display: flex; min-width: 0; min-height: 16px; align-items: center; justify-content: space-between; gap: 10px; }
.signals-event-top > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.signals-event-top i { color: #d8e2e9; opacity: .88; }
.signals-kicker { color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .06em; }
.signals-event > strong { overflow: hidden; color: #fff; font-size: 14px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.impact-badge { padding: 2px 7px; color: #a9b8c3; background: rgba(255,255,255,.06); border-radius: 999px; font-size: 8px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.impact-badge.impact-high { color: #ff9ba5; background: rgba(255,93,108,.1); }.impact-badge.impact-medium { color: #ffd474; background: rgba(255,193,7,.1); }.impact-badge.impact-low { color: #75e9b0; background: rgba(33,215,131,.1); }
.signals-progress { position: relative; width: 100%; height: 6px; overflow: hidden; background: rgba(255,255,255,.08); border-radius: 999px; }
.signals-progress > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #22c55e 0%, #f59e0b 55%, #ef4444 100%); border-radius: inherit; transition: width .38s cubic-bezier(.2,.1,.2,1); }
.event-progress > span { position: absolute; inset: 0; width: 100% !important; background: linear-gradient(90deg, #22c55e 0%, #22c55e 45%, #9fc54b 58%, #f2c744 70%, #f59e0b 85%, #ef4444 100%); clip-path: inset(0 calc(100% - var(--event-progress, 0%)) 0 0); transition: clip-path .5s cubic-bezier(.2,.1,.2,1); }
.signals-event-bottom { color: rgba(255,255,255,.68); font-size: 9px; }
.signals-event-bottom b { color: #dce6ed; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.signals-bank { flex: 1 1 33.333%; min-width: 255px; }
.signals-bank-heading { min-height: 16px; display: flex; align-items: center; gap: 7px; }.signals-bank-heading i { color: #d8e2e9; opacity: .88; }
.signals-bank-top > span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.signals-bank-top > span i { opacity: .85; }.signals-bank-top > span b { color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }
.signals-bank-top > strong { font-size: 10px; white-space: nowrap; }.signals-bank-top > strong small { color: var(--muted); font-size: 8px; }
.bankroll-progress > span { position: absolute; inset: 0; width: 100% !important; min-width: 2px; background: linear-gradient(90deg, #22c55e 0%, #22c55e 45%, #9fc54b 58%, #f2c744 70%, #f59e0b 85%, #ef4444 100%); clip-path: inset(0 calc(100% - var(--bankroll-progress, 0%)) 0 0); transition: clip-path .38s cubic-bezier(.2,.1,.2,1); }
.signals-bank-bottom { color: rgba(255,255,255,.72); font-size: 9px; }
.signals-bank-bottom > span { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; }.signals-bank-bottom i { color: var(--orange); }.signals-bank-bottom b { color: #f2f6f8; font-variant-numeric: tabular-nums; }.signals-bank-bottom small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.signals-profit { min-width: 315px; flex: 1 1 33.333%; grid-template-rows: 21px 16px 6px 16px; gap: 5px; }
.signals-profit-head { min-width: 0; min-height: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.signals-profit-title { display: flex; align-items: center; gap: 7px; color: var(--muted); white-space: nowrap; }
.signals-profit-title i { color: var(--green); font-size: 14px; }
.signals-profit-title small { overflow: hidden; font-size: 8px; font-weight: 650; letter-spacing: .055em; text-overflow: ellipsis; }
.signals-profit-value { overflow: hidden; font-size: 16px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.signals-profit-value small { color: var(--muted); font-size: 9px; font-weight: 500; }
.signals-profit-results { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-left: auto; white-space: nowrap; }
.signals-profit-positions { display: inline-flex; align-items: center; gap: 5px; color: #dce6ed; font-size: 10px; font-variant-numeric: tabular-nums; }
.signals-profit-positions > i { color: var(--orange); font-size: 12px; }
.signals-profit-positions strong { display: inline-flex; align-items: baseline; gap: 4px; font-weight: 650; }
.signals-profit-positions strong > span:not(.odometer-number), .signals-profit-positions .odometer-suffix { color: var(--muted); font-size: 8px; font-weight: 550; }
[data-take-profit-slot], .signals-profit-target { display: contents; }
.signals-profit-target-head { min-height: 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(142px, auto); align-items: center; gap: 12px; color: #dce6ed; font-size: 9px; font-variant-numeric: tabular-nums; }
.signals-profit-target-head .signals-profit-positions { justify-self: end; }
.signals-profit-target-head > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.signals-profit-target-head small { color: #8295a4; font-size: 8px; font-weight: 500; }.signals-profit-target-head b { color: #f2f6f8; font-size: 9px; font-weight: 650; white-space: nowrap; }
.signals-profit-pnl, .signals-profit-pnl > b { display: flex; align-items: center; gap: 5px; }.signals-profit-pnl { justify-self: end; }.signals-profit-pnl i { font-style: normal; }.signals-profit-pnl > b i + i { padding-left: 5px; border-left: 1px solid rgba(143,161,179,.25); }
.signals-profit-target-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.take-profit-progress > span { position: absolute; inset: 0; width: 100% !important; background: var(--take-profit-color, #66727c); clip-path: inset(0 calc(100% - var(--take-profit-progress, 0%)) 0 0); transition: clip-path .5s cubic-bezier(.2,.1,.2,1), background-color .25s ease; }
.take-profit-progress.progress-step-0 { --take-profit-color: #66727c; }.take-profit-progress.progress-step-1 { --take-profit-color: #63786f; }.take-profit-progress.progress-step-2 { --take-profit-color: #5e826c; }.take-profit-progress.progress-step-3 { --take-profit-color: #598d69; }.take-profit-progress.progress-step-4 { --take-profit-color: #529966; }.take-profit-progress.progress-step-5 { --take-profit-color: #4aa563; }.take-profit-progress.progress-step-6 { --take-profit-color: #42b160; }.take-profit-progress.progress-step-7 { --take-profit-color: #39bd5d; }.take-profit-progress.progress-step-8 { --take-profit-color: #31c95a; }.take-profit-progress.progress-step-9 { --take-profit-color: #29d357; }.take-profit-progress.progress-step-10 { --take-profit-color: #21d783; }
.signals-profit-target-meta { color: #8295a4; font-size: 8px; white-space: nowrap; }.signals-profit-target-meta b { color: #dce6ed; font-weight: 650; }
.signals-profit-target-meta i { font-style: normal; }
.signals-profit-target-empty { min-height: 31px; display: flex; grid-row: 2 / 5; align-items: center; justify-content: space-between; gap: 10px; color: #718494; border-top: 1px solid rgba(143,161,179,.2); font-size: 8px; }
.signals-quick-actions { position: absolute; top: 50%; right: 14px; width: 148px; height: 42px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr; gap: 4px; padding: 4px; background: rgba(4,15,24,.72); border: 1px solid var(--line-soft); border-radius: 10px; transform: translateY(-50%); }
.signals-quick-actions a, .signals-quick-actions button { display: grid; place-items: center; color: #aebdca; background: transparent; border: 1px solid transparent; border-radius: 7px; font-size: 16px; transition: .16s ease; }
.signals-quick-actions a:hover, .signals-quick-actions a:focus-visible, .signals-quick-actions button:hover, .signals-quick-actions button:focus-visible { color: var(--orange); background: rgba(255,151,0,.07); border-color: rgba(255,151,0,.18); outline: 0; }

.metrics-grid { display: grid; grid-template-columns: 1fr 1.72fr 1.18fr; gap: 14px; margin-bottom: 14px; }
.metric-card { min-height: 112px; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; }
.metric-value { display: block; margin: 2px 0 2px; font-size: clamp(23px, 2vw, 29px); font-weight: 500; letter-spacing: -.02em; }
.metric-value small { font-size: 14px; font-weight: 400; }
.metric-sub { display: block; font-size: 12px; }
.metric-icon { width: 54px; height: 54px; display: grid; place-items: center; flex: 0 0 54px; border-radius: 16px; font-size: 25px; }
.metric-icon.green { color: var(--green); background: rgba(33, 215, 131, .08); border: 1px solid rgba(33, 215, 131, .18); }
.metric-icon.purple { color: var(--purple); background: rgba(164, 96, 255, .08); border: 1px solid rgba(164, 96, 255, .18); }
.metric-icon.blue { color: var(--blue); background: rgba(49, 157, 255, .08); border: 1px solid rgba(49, 157, 255, .18); }
.metric-icon.orange { color: var(--orange); background: rgba(255, 151, 0, .08); border: 1px solid rgba(255, 151, 0, .18); }
.event-card { min-height: 112px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; column-gap: 16px; padding: 16px 19px; }
.event-flag { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.event-card strong { display: block; margin-top: 8px; font-size: 17px; }
.event-card span { color: var(--muted); font-size: 12px; }
.event-countdown { align-self: end; min-width: 190px; padding: 11px 16px; text-align: center; background: rgba(2, 11, 18, .7); border: 1px solid var(--line); border-radius: 9px; font-size: 19px; }
.sparkline { width: 120px; height: 52px; display: flex; align-items: flex-end; gap: 4px; }
.sparkline i { width: 16px; background: linear-gradient(to top, rgba(33, 215, 131, .1), var(--green)); clip-path: polygon(0 80%, 100% 0, 100% 100%, 0 100%); }
.sparkline i:nth-child(1) { height: 25px; }.sparkline i:nth-child(2) { height: 34px; }.sparkline i:nth-child(3) { height: 30px; }.sparkline i:nth-child(4) { height: 43px; }.sparkline i:nth-child(5) { height: 38px; }.sparkline i:nth-child(6) { height: 50px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 325px; gap: 14px; }
.dashboard-primary { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.chart-panel { position: relative; min-height: 605px; padding: 7px 8px; overflow: hidden; }
.chart-overlay-top { position: absolute; z-index: 6; top: 8px; right: 8px; left: 8px; min-height: 76px; padding: 3px 0 8px 48px; background: linear-gradient(180deg, rgba(4,15,24,.94), rgba(4,15,24,.65) 68%, transparent); pointer-events: none; }
.chart-brand { position: absolute; top: 0; left: 2px; width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border-radius: 9px; pointer-events: auto; }
.chart-brand img { width: 100%; height: 100%; object-fit: contain; transform: scale(3.15); transition: filter .16s ease, transform .16s ease; }.chart-brand:hover img { filter: brightness(1.2); transform: scale(3.3); }
.chart-toolbar { display: grid; grid-template-columns: minmax(145px, .7fr) minmax(390px, 2fr) auto; align-items: center; gap: 12px; padding: 0; }
.chart-toolbar h2 { margin: 0 0 4px; display: flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 550; }
.chart-toolbar h2 span { color: var(--muted); font-size: 13px; }
.chart-toolbar h2 #chartSymbol { color: #e7eef3; font-size: 18px; }
.price-line { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.price-line strong { display: inline-flex; align-items: baseline; gap: 4px; flex: 0 0 auto; padding: 1px 3px; color: var(--green); border-radius: 4px; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-line strong small { color: #8fa1b3; font-size: 9px; font-weight: 600; }.chart-usd-price { flex: 0 0 auto; padding-left: 8px; color: #d7e1e7; border-left: 1px solid var(--line-soft); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }.chart-usd-price.is-unavailable { color: #667b8b; }
.chart-market-stats { display: grid; grid-template-columns: .65fr .85fr .85fr 1.55fr; gap: 8px; min-width: 0; padding: 0 10px; border-inline: 1px solid var(--line-soft); }
.chart-market-stats > div { min-width: 0; }
.chart-market-stats > div > span { display: block; margin-bottom: 2px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.chart-market-stats strong { display: block; overflow: hidden; color: #dfe7ed; font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.chart-market-stats strong small { color: var(--muted); font-size: 8px; font-weight: 500; }
.chart-controls { display: flex; align-items: center; gap: 6px; justify-self: end; pointer-events: auto; }
.chart-tool { height: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 0 7px; color: #aab9c5; background: #07141f; border: 1px solid var(--line); border-radius: 8px; font-size: 9px; transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.chart-tool i { font-size: 13px; }.chart-tool:hover, .chart-tool.active { color: var(--orange); border-color: #40586b; background: #0b1d2a; box-shadow: inset 0 0 0 1px rgba(255,151,0,.035); }.chart-tool:active { transform: translateY(1px); }.chart-tool.measure-active { color: var(--blue); border-color: rgba(49,157,255,.45); box-shadow: 0 0 0 2px rgba(49,157,255,.065); }
.chart-subbar { min-height: 25px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 3px 0 0; }
.chart-legend { display: flex; align-items: center; gap: 18px; padding-top: 3px; color: #aab7c4; font-size: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-floating-legend { position: absolute; z-index: 5; left: 18px; bottom: 34px; padding: 4px 8px; color: rgba(200,212,221,.76); background: rgba(18,18,18,.64); border-radius: 5px; backdrop-filter: blur(4px); pointer-events: none; }
.legend-line { width: 13px; height: 0; display: inline-block; border-top: 2px solid; }
.legend-line.buy { border-color: var(--blue); }.legend-line.sell { border-color: var(--orange); }.legend-line.future { border-color: #8fa1b3; border-top-style: dashed; }
.chart-live-status { position: relative; display: inline-flex !important; align-items: center; gap: 4px; margin-left: 7px; color: var(--green) !important; font-size: 8px !important; font-weight: 700; letter-spacing: .06em; cursor: help; pointer-events: auto; outline: 0; }
.chart-live-status i { width: 6px; height: 6px; display: inline-block; background: currentColor; border-radius: 50%; box-shadow: 0 0 7px rgba(33,215,131,.55); }
.chart-live-status b { color: currentColor; font-size: inherit; font-weight: inherit; }
.chart-live-status.pending { color: #718697 !important; }
.chart-live-status.pending i { box-shadow: none; }
.chart-live-status.offline { color: var(--danger) !important; }
.chart-live-status.offline i { box-shadow: 0 0 6px rgba(255,93,108,.35); }
.chart-live-status.degraded { color: #f1b94d !important; }.chart-live-status.degraded > i { box-shadow: 0 0 6px rgba(241,185,77,.35); }
.service-status-tooltip { position: absolute; top: calc(100% + 10px); left: -12px; z-index: 20; width: 230px; display: grid !important; gap: 8px; padding: 11px 12px; visibility: hidden; opacity: 0; color: #dce7ee !important; background: rgba(20,20,20,.98); border: 1px solid rgba(255,255,255,.13); border-radius: 8px; box-shadow: 0 16px 38px rgba(0,0,0,.42); letter-spacing: 0; transform: translateY(4px); transition: opacity .15s ease, visibility .15s ease, transform .15s ease; pointer-events: none; }
.chart-live-status:hover .service-status-tooltip, .chart-live-status:focus .service-status-tooltip, .chart-live-status:focus-within .service-status-tooltip { visibility: visible; opacity: 1; transform: translateY(0); }
.service-status-tooltip > strong { color: #f1f6f8; font-size: 10px; font-weight: 650; }.service-status-row { display: grid !important; grid-template-columns: 7px minmax(0,1fr); align-items: center; gap: 8px; }.service-status-row > i { width: 7px; height: 7px; background: #748696; border-radius: 50%; box-shadow: none; }.service-status-row > span { min-width: 0; display: block !important; }.service-status-row b, .service-status-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.service-status-row b { color: #dce7ee; font-size: 9px; font-weight: 600; }.service-status-row small { margin-top: 2px; color: #a2b1bc; font-size: 8px; font-weight: 450; }.service-status-row.online > i { background: var(--green); box-shadow: 0 0 7px rgba(33,215,131,.48); }.service-status-row.degraded > i { background: #f1b94d; box-shadow: 0 0 7px rgba(241,185,77,.4); }.service-status-row.offline > i { background: var(--danger); box-shadow: 0 0 7px rgba(255,93,108,.42); }
.chart-stage { position: relative; }
.chart-exchange-mark { position: absolute; right: 9px; bottom: 2px; z-index: 2; color: rgba(143,161,179,.58); font-size: 8px; letter-spacing: .025em; pointer-events: none; }
.chart-order-tooltip { position: absolute; z-index: 7; width: 245px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); padding: 11px 12px; overflow-y: auto; color: #dce7ee; background: rgba(5,19,29,.97); border: 1px solid #294354; border-radius: 8px; box-shadow: 0 14px 34px rgba(0,0,0,.38); pointer-events: none; font-size: 9px; }
.chart-order-tooltip:not([hidden]) { animation: tooltipIn .15s ease-out both; }
.chart-order-tooltip-summary { display: block; margin-bottom: 8px; color: #dce7ee; font-size: 10px; font-weight: 600; }
.chart-order-tooltip .backtest-tooltip-operation:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.btc-chart { width: 100%; height: 505px; }
.btc-chart .empty-state { height: 100%; }
.trade-pulse-layer { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.trade-execution-pulse { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; color: var(--blue); border: 1px solid currentColor; border-radius: 50%; box-shadow: 0 0 10px currentColor; animation: executionPulse .38s ease-out both; }
.trade-execution-pulse.sell { color: var(--orange); }
.chart-measure-layer { position: absolute; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; }
.measure-dot { position: absolute; width: 9px; height: 9px; background: var(--blue); border: 2px solid #d9efff; border-radius: 50%; box-shadow: 0 0 0 4px rgba(49,157,255,.15); transform: translate(-50%, -50%); }
.measure-line { position: absolute; height: 1px; background: var(--blue); box-shadow: 0 0 5px rgba(49,157,255,.7); transform-origin: 0 50%; }
.chart-measure-result { position: absolute; z-index: 5; right: 12px; top: 12px; padding: 8px 11px; color: #dcecf8; background: rgba(5,19,29,.94); border: 1px solid rgba(49,157,255,.42); border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.25); font-size: 10px; font-variant-numeric: tabular-nums; pointer-events: none; }

.instances-strip { padding: 14px; }
.text-link { color: #b9c7d2; font-size: 11px; }.text-link:hover { color: var(--orange); }
.instance-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.instance-mini { padding: 12px; background: rgba(3, 13, 21, .5); border: 1px solid var(--line); border-radius: 10px; transition: .2s ease; }
.instance-mini:hover { transform: translateY(-2px); border-color: #31506a; }
.instance-title { display: flex; align-items: center; gap: 8px; }
.instance-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.instance-avatar { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; color: #fff; border-radius: 50%; }
.color-1 { background: linear-gradient(135deg, #b26bff, #7128c8); }.color-2 { background: linear-gradient(135deg, #53db98, #148658); }.color-3 { background: linear-gradient(135deg, #ffc227, #e47e00); }.color-4 { background: linear-gradient(135deg, #48a8ff, #2361d0); }
.state { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.instance-title .state { margin-left: 0; }
.state i { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.state.active { color: var(--green); }.state.active i { animation: activeStatusPulse 3.2s ease-in-out infinite; }.state.inactive { color: #91a2b2; }.state.error { color: var(--danger); }
.instance-stats { display: grid; grid-template-columns: .75fr 1fr 1.25fr; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.instance-stats span { min-width: 0; padding: 0 7px; border-right: 1px solid var(--line-soft); }.instance-stats span:first-child { padding-left: 0; }.instance-stats span:last-child { padding-right: 0; border: 0; }
.instance-stats small { display: block; color: var(--muted); font-size: 8px; }.instance-stats strong { display: block; margin-top: 3px; overflow: hidden; font-size: 10px; font-weight: 500; text-overflow: ellipsis; }

.instances-strip.compact-instances { height: 136px; max-height: 136px; padding: 8px; overflow: hidden; }
.instance-strip-row { height: 100%; display: flex; align-items: stretch; gap: 8px; }
.compact-instances .instance-mini-grid { height: 100%; display: flex; flex-wrap: nowrap; gap: 8px; margin: 0; padding: 0 0 3px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #294255 transparent; }
.compact-instances .instance-mini-grid { min-width: 0; flex: 1 1 auto; }
.compact-instances .instance-mini-grid::-webkit-scrollbar { height: 4px; }
.compact-instances .instance-mini-grid::-webkit-scrollbar-thumb { background: #294255; border-radius: 999px; }
.compact-instances .instance-mini { min-width: 430px; min-height: 108px; display: flex; flex: 1 0 430px; flex-direction: column; justify-content: space-between; padding: 8px 10px; cursor: default; }
.compact-instances .instance-mini:hover { transform: none; }
.compact-instances .instance-title { min-width: 0; gap: 7px; }
.compact-instances .instance-title strong { font-size: 11px; }
.compact-instances .instance-avatar { width: 25px; height: 25px; flex-basis: 25px; font-size: 11px; }
.compact-instances .state { flex: 0 0 auto; font-size: 9px; white-space: nowrap; }
.compact-instances .state.disabled, .compact-instances .state.paused { color: #d3a54f; }
.instance-edit-trigger { min-width: 0; display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 5px 7px; padding: 0; overflow: hidden; color: inherit; background: transparent; border: 0; font: inherit; text-align: left; }
.instance-edit-trigger:hover strong { color: var(--orange); }
.instance-identity { min-width: 80px; display: flex; flex: 1 1 auto; align-items: center; gap: 7px; overflow: hidden; }
.instance-identity > strong { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.instance-config-metrics { width: 100%; display: grid; flex: 0 0 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.instance-config-metric { min-width: 0; display: grid; gap: 1px; padding: 3px 6px; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.075); border-radius: 5px; }
.instance-config-metric small { overflow: hidden; color: #aebbc5; font-size: 8px; font-weight: 600; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.instance-config-metric b { overflow: hidden; color: #edf3f6; font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.instance-config-metric em { color: #aab8c2; font-size: 8px; font-style: normal; font-weight: 600; }
.instance-edit-trigger:hover .instance-config-metric { border-color: rgba(255,151,0,.22); }
.instance-mode { flex: 0 0 auto; padding: 2px 6px; color: #d9a8ff; background: rgba(164,96,255,.13); border: 1px solid rgba(164,96,255,.24); border-radius: 999px; font-size: 8px; font-weight: 650; line-height: 1.2; }
.instance-status-controls { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; margin-left: auto; align-self: flex-start; }
.instance-toggle-form { flex: 0 0 auto; margin: 0; }
.instance-toggle, .instance-add-button { display: grid; place-items: center; color: #9aabba; background: #07141f; border: 1px solid var(--line); border-radius: 7px; transition: .16s ease; }
.instance-toggle { width: 25px; height: 25px; padding: 0; font-size: 12px; }
.instance-toggle:hover { color: var(--orange); border-color: #40586b; background: #0b1d2a; }
.instance-kpis { height: 42px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(150px, 1.55fr); align-items: center; margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line-soft); }
.instance-kpi { min-width: 0; padding: 0 8px; border-right: 1px solid var(--line-soft); }
.instance-kpi:first-child { padding-left: 0; }
.instance-kpi:last-child { padding-right: 0; border-right: 0; }
.instance-kpi small { display: block; overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.instance-kpi strong { display: block; margin-top: 3px; overflow: hidden; font-size: 10px; font-weight: 600; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.instance-kpi strong span { color: inherit; font-size: 8px; font-weight: 500; }
.instance-efficiency-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 1px; }
.instance-efficiency-values > span { min-width: 0; display: grid; justify-items: center; gap: 0; text-align: center; }
.instance-efficiency-values em { display: block; color: var(--muted); font-size: 7px; font-style: normal; line-height: 1.1; white-space: nowrap; }
.instance-efficiency-values strong { min-width: 0; margin-top: 1px; font-size: 9px; line-height: 1.05; }
.instance-kpi-efficiency > small { text-align: center; }
.instance-add-button { width: 32px; height: 32px; flex: 0 0 32px; align-self: center; color: var(--orange); font-size: 15px; }
.instance-add-button:hover { color: #ffd18a; border-color: rgba(255,151,0,.55); background: rgba(255,151,0,.1); }
.instance-archive-button { position: relative; color: #91a3b1; }.instance-archive-button > span { position: absolute; top: -6px; right: -6px; min-width: 15px; height: 15px; display: grid; place-items: center; padding: 0 3px; color: #07141f; background: var(--orange); border-radius: 999px; font-size: 8px; font-weight: 700; }

.history-panel { min-height: 700px; display: flex; flex-direction: column; padding: 17px; }
.history-panel > .section-heading > i, .audit-panel > .section-heading > i { color: #7f93a5; font-size: 20px; }
.history-modal-dialog { width: min(96vw, 1780px); max-width: none; height: 92vh; margin: auto; }.history-modal .modal-content { max-height: 92vh; }.history-modal .modal-header { justify-content: space-between; }.history-modal .modal-body { padding: 14px; }.history-modal-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }.history-modal-loading { min-height: 320px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 11px; }.execution-history-panel { min-height: 100%; padding: 16px; }.execution-history-heading { gap: 12px; }.history-logs-button { margin-left: auto; }.execution-history-filters { margin-left: 0; }.execution-history-table-wrap { max-height: calc(92vh - 190px); margin-top: 14px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 9px; }.execution-history-table { min-width: 820px; margin: 0; }.execution-history-table thead th { position: sticky; top: 0; z-index: 1; background: #091824; }.execution-side { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 700; }.execution-side.buy { color: var(--blue); }.execution-side.sell { color: var(--orange); }
.archived-instance-list { display: grid; gap: 8px; }.archived-instance-row { min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 10px; background: #06131d; border: 1px solid var(--line-soft); border-radius: 9px; }.archived-instance-row > div { min-width: 0; flex: 1; }.archived-instance-row strong, .archived-instance-row small { display: block; }.archived-instance-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }.archived-instance-row form { margin: 0; }
.timeline { position: relative; margin: 20px 0; padding-left: 33px; }.history-panel .timeline { min-height: 0; flex: 1 1 auto; overflow-y: auto; padding-right: 4px; }
.timeline::before { content: ""; position: absolute; top: 7px; bottom: 8px; left: 10px; width: 1px; background: #22445b; }
.timeline-item { position: relative; min-height: 84px; padding-bottom: 12px; }
.timeline-item.is-new { animation: historyItemIn .26s ease-out both; }
.timeline-icon { position: absolute; left: -33px; top: -1px; z-index: 1; width: 22px; height: 22px; display: grid; place-items: center; color: white; background: var(--orange-2); border-radius: 50%; font-size: 11px; box-shadow: 0 0 0 4px #071621; }
.timeline-item.buy .timeline-icon { background: var(--blue); }.timeline-item.buy .timeline-heading > strong { color: var(--blue); }.timeline-item.sell .timeline-heading > strong { color: var(--orange); }
.timeline-heading, .timeline-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }.timeline-heading > strong { min-width: 0; font-size: 11px; white-space: nowrap; }.timeline-item time { margin: 0; color: var(--muted); font-size: 9px; white-space: nowrap; }
.instance-chip { display: inline-block; padding: 2px 7px; color: #d69aff; background: rgba(120, 48, 171, .2); border-radius: 5px; font-size: 9px; }
.timeline-meta { margin-top: 5px; }.timeline-item p { margin: 0; color: #b6c2cc; font-size: 9px; white-space: nowrap; }.timeline-item p small { color: var(--muted); }
.timeline-detail { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; color: #8295a4; font-size: 8px; font-variant-numeric: tabular-nums; }.timeline-detail > span, .timeline-detail > b { white-space: nowrap; }.timeline-detail > b { color: #c5d1d9; font-weight: 600; }
.timeline-detail > b.positive { color: var(--green); }.timeline-detail > b.negative { color: var(--danger); }.timeline-detail > b.muted { color: var(--muted); }

.btn { --bs-btn-border-radius: 8px; font-size: 12px; }
.btn-accent { --bs-btn-color: #12100c; --bs-btn-bg: var(--orange); --bs-btn-border-color: var(--orange); --bs-btn-hover-color: #0b0b0b; --bs-btn-hover-bg: #ffad31; --bs-btn-hover-border-color: #ffad31; font-weight: 650; box-shadow: 0 8px 22px rgba(255, 151, 0, .14); }
.btn-outline-soft { --bs-btn-color: #c1cdd7; --bs-btn-border-color: #284052; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #122636; --bs-btn-hover-border-color: #3b5d75; }
.form-control, .form-select { min-height: 42px; color: #e8eef3; background-color: #06131d; border-color: #263c4e; border-radius: 8px; font-size: 12px; }
.form-control:focus, .form-select:focus { color: #fff; background-color: #081722; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 151, 0, .1); }
.form-label { margin-bottom: 6px; color: #b8c5cf; font-size: 11px; }
.form-hint { display: block; margin-top: 6px; font-size: 10px; }
.form-check-input { width: 2.5em !important; height: 1.25em; background-color: #142635; border-color: #385267; }.form-check-input:checked { background-color: var(--green); border-color: var(--green); }.form-check-input:focus { box-shadow: 0 0 0 3px rgba(33, 215, 131, .1); }
.alert { border-color: currentColor; border-radius: 9px; font-size: 12px; }
.alert-success { color: #63e8aa; background: rgba(33, 215, 131, .09); }.alert-danger { color: #ff8d98; background: rgba(255, 93, 108, .1); }.alert-warning { color: #ffd05d; background: rgba(255, 193, 7, .09); }
.archived-fleet-panel { margin-top: 14px; padding: 16px; }.archived-fleet-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }.archived-fleet-heading h2 { margin: 3px 0 0; font-size: 15px; }.archived-fleet-heading > small { color: var(--muted); font-size: 10px; }

.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 15px; }.page-actions h2 { margin: 3px 0 0; font-size: 19px; }
.fleet-header { min-height: 54px; margin-bottom: 10px; padding: 0 1px; }
.fleet-header h2 { color: #a9b7c2; font-size: 13px; font-weight: 550; }
.fleet-header .btn { min-height: 38px; padding-inline: 15px; }
.fleet-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.fleet-stat { min-width: 0; min-height: 83px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.fleet-stat > i { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 39px; color: var(--blue); background: rgba(49,157,255,.06); border: 1px solid rgba(49,157,255,.22); border-radius: 9px; font-size: 18px; }
.fleet-stat.active > i { color: var(--green); border-color: rgba(33,215,131,.25); }.fleet-stat.orders > i { color: #47a9ff; }.fleet-stat.profit > i { color: var(--green); border-color: rgba(33,215,131,.25); }.fleet-stat.executions > i { color: var(--purple); border-color: rgba(164,96,255,.25); }
.fleet-stat > div { min-width: 0; }
.fleet-stat > div > strong { display: block; overflow: hidden; color: #f2f6f8; font-size: 19px; line-height: 1.1; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.fleet-stat > div > strong small { color: inherit; font-size: 9px; font-weight: 550; }
.fleet-stat > div > span { display: block; margin-top: 3px; color: #c4d0d8; font-size: 9px; font-weight: 650; letter-spacing: .035em; text-transform: uppercase; }
.fleet-stat > div > small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.fleet-list { display: flex; flex-direction: column; gap: 8px; }
.fleet-instance { position: relative; overflow: hidden; }
.fleet-instance-disabled, .fleet-instance-paused { background: linear-gradient(145deg, rgba(7,19,29,.82), rgba(4,14,22,.82)); }
.fleet-instance.fleet-instance-error { border-color: rgba(255,93,108,.36); }
.fleet-instance-main { min-height: 66px; display: grid; grid-template-columns: minmax(190px, 1.55fr) minmax(90px, .8fr) minmax(95px, .85fr) minmax(100px, .9fr) minmax(115px, 1fr) minmax(75px, .65fr) 18px; align-items: center; gap: 13px; padding: 10px 14px; }
.fleet-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.fleet-identity .instance-avatar { width: 36px; height: 36px; flex: 0 0 36px; font-size: 14px; }
.fleet-identity > span:last-child { min-width: 0; }
.fleet-identity strong, .fleet-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-identity strong { font-size: 12px; }.fleet-identity small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.fleet-identity:hover strong, .fleet-chevron:hover { color: var(--orange); }
.fleet-datum { min-width: 0; padding-left: 12px; border-left: 1px solid var(--line-soft); }
.fleet-datum span, .fleet-datum strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-datum span { margin-bottom: 3px; color: var(--muted); font-size: 8px; }
.fleet-datum strong { color: #e4ebf0; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fleet-last-activity strong { display: flex; align-items: center; gap: 5px; color: #b7c4ce; }
.fleet-last-activity strong > i { width: 7px; height: 7px; flex: 0 0 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 7px rgba(33,215,131,.35); }
.fleet-instance-state { justify-self: end; font-size: 10px; font-weight: 650; white-space: nowrap; }
.state.disabled { color: #748696; }.state.paused, .state.unknown { color: #d3a54f; }
.fleet-chevron { color: #8698a7; font-size: 15px; }
.fleet-instance-footer { min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 14px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.fleet-config-summary { display: flex; align-items: center; gap: 16px; min-width: 0; }
.fleet-config-summary > div { min-width: 0; padding-right: 16px; border-right: 1px solid var(--line-soft); }.fleet-config-summary > div:last-child { padding-right: 0; border-right: 0; }
.fleet-config-summary span, .fleet-config-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.fleet-config-summary span { margin-bottom: 3px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }.fleet-config-summary strong { color: #dce7ed; font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
.fleet-error-message { overflow: hidden; color: var(--danger); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.fleet-instance-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.fleet-instance-actions form { margin: 0; }
.fleet-instance-actions .btn { min-width: 122px; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 12px; border-radius: 8px; font-size: 10px; font-weight: 650; line-height: 1; box-shadow: 0 5px 14px rgba(0,0,0,.12); transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease; }.fleet-instance-actions .btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,.2); }.fleet-instance-actions .btn-outline-soft { background: rgba(12,31,45,.62); }.fleet-instance-actions .btn-outline-success { color: #72e8ad; border-color: rgba(33,215,131,.35); background: rgba(33,215,131,.07); }.fleet-instance-actions .btn-outline-success:hover { color: #b5f8d1; border-color: rgba(33,215,131,.62); background: rgba(33,215,131,.13); }.fleet-instance-actions .btn-outline-danger { color: #ff9aa3; border-color: rgba(255,93,108,.32); background: rgba(255,93,108,.06); }.fleet-instance-actions .btn-outline-danger:hover { color: #ffc3c8; border-color: rgba(255,93,108,.58); background: rgba(255,93,108,.12); }
.fleet-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; min-height: 68px; margin-bottom: 14px; padding: 7px 0; background: linear-gradient(145deg, rgba(8,25,37,.96), rgba(5,17,27,.96)); border-color: var(--line); }
.fleet-stat { min-height: 54px; padding: 7px 18px; border-right: 1px solid var(--line-soft); }.fleet-stat:last-child { border-right: 0; }.fleet-stat > i { width: 29px; height: 29px; flex-basis: 29px; border-radius: 8px; font-size: 14px; }.fleet-stat > div > strong { font-size: 16px; }.fleet-stat > div > span { margin-top: 3px; font-size: 8px; }.fleet-stat > div > small { display: none; }
.fleet-instance { padding: 0 20px; border-radius: var(--radius); }.fleet-instance-header { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0 13px; }.fleet-instance-header .fleet-identity { flex: 1 1 auto; }.fleet-instance-header .fleet-instance-state { flex: 0 0 auto; }.fleet-instance-divider { height: 1px; background: var(--line-soft); }.fleet-metrics { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; padding: 16px 0; }.fleet-metric { min-width: 0; padding: 0 14px; border-right: 1px solid var(--line-soft); }.fleet-metric:first-child { padding-left: 0; }.fleet-metric:last-child { padding-right: 0; border-right: 0; }.fleet-metric > span, .fleet-metric > strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.fleet-metric > span { margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }.fleet-metric > strong { color: #e5edf1; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }.fleet-metric > strong small { color: #9cafbd; font-size: 9px; font-weight: 550; }.fleet-metric > strong.has-activity { display: flex; align-items: center; gap: 5px; color: #b7c4ce; }.fleet-metric > strong.has-activity > i { width: 6px; height: 6px; flex: 0 0 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 7px rgba(33,215,131,.3); }.fleet-instance > .fleet-error-message { min-height: 48px; display: flex; align-items: center; padding: 0; }.fleet-instance-actions { justify-content: flex-end; min-height: 62px; margin-left: 0; padding: 13px 0 15px; }.fleet-instance-actions .btn { min-width: 116px; }
.settings-layout.account-settings-layout { grid-template-columns: minmax(0, 560px); justify-content: center; margin-top: 42px; }.account-settings-layout .settings-card { width: 100%; padding: 24px; }
.fleet-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.config-panel { margin-top: 16px; padding: 20px; scroll-margin-top: 15px; }
.settings-form { margin-top: 18px; }.settings-form.compact { display: flex; flex-direction: column; gap: 14px; }
.settings-section { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line-soft); }.settings-section:first-child { margin-top: 0; }.settings-section h3 { margin: 0 0 14px; font-size: 13px; }.settings-section h3 i { margin-right: 8px; color: var(--orange); }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }.form-grid.tight { grid-template-columns: repeat(2, 1fr); }
.switch-row { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 13px; background: #06141e; border: 1px solid var(--line); border-radius: 9px; }.switch-row span { padding-right: 12px; }.switch-row strong, .switch-row small { display: block; }.switch-row strong { font-size: 12px; }.switch-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }.switch-row.danger-zone { border-color: rgba(255, 93, 108, .22); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.modal-content.panel { background: #071722; }.modal-header, .modal-footer { border-color: var(--line); }.modal-header h2 { margin: 0; font-size: 16px; }
.modal-backdrop.show { opacity: .68; }
.confirm-modal { z-index: 1070; }
.modal-backdrop.confirm-backdrop { z-index: 1060; }
.confirm-modal .modal-dialog { max-width: 440px; }
.confirm-modal .modal-content { overflow: hidden; border-color: #315068; box-shadow: 0 28px 80px rgba(0,0,0,.58); }
.confirm-modal .modal-body { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 18px; }
.confirm-modal-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px; color: var(--orange); background: rgba(255,151,0,.1); border: 1px solid rgba(255,151,0,.22); border-radius: 12px; font-size: 19px; }
.confirm-modal .modal-body h2 { margin: 4px 0 7px; color: #f1f5f7; font-size: 17px; }
.confirm-modal .modal-body p { margin: 0; color: #9cadb9; font-size: 11px; line-height: 1.55; }
.confirm-modal .modal-footer { padding: 12px 22px; background: rgba(4,15,24,.94); }
.confirm-modal .modal-footer .btn { min-width: 110px; }
.config-modal .modal-dialog { max-width: 1000px; max-height: calc(100vh - 32px); }
.config-modal .modal-content { max-height: calc(100vh - 32px); overflow: hidden; border-color: #294357; box-shadow: 0 28px 80px rgba(0,0,0,.52); }
.config-modal-form { height: 100%; min-height: 0; display: flex; flex-direction: column; margin: 0; }
.config-modal .modal-header { flex: 0 0 auto; padding: 16px 20px 13px; }
.config-modal .modal-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.config-modal .modal-body { min-height: 0; padding: 16px 20px 18px; overflow-y: auto; }
.config-modal .modal-footer { flex: 0 0 auto; padding: 12px 20px; background: rgba(4,15,24,.94); }
.config-modal .modal-footer .btn { min-width: 105px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
.config-modal .modal-footer .btn-accent { padding-inline: 18px; box-shadow: 0 7px 18px rgba(255,151,0,.12); }.config-modal .modal-footer .btn-accent:hover { box-shadow: 0 9px 22px rgba(255,151,0,.18); transform: translateY(-1px); }
.config-general-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.config-general-grid > .switch-row { height: 106px; min-height: 106px; }
.config-toggle-card { align-items: center; }
.config-exchange-card { align-items: stretch; flex-direction: column; justify-content: space-between; gap: 10px; }
.config-exchange-card .form-select { margin-top: auto; }
.config-modal .settings-section { margin-top: 14px; padding-top: 14px; }.config-modal .settings-section h3 { margin-bottom: 10px; color: #dce6ec; font-size: 11px; letter-spacing: .08em; }
.config-modal .switch-row { padding: 11px 12px; border-radius: 9px; }.config-modal .switch-row > span:first-child { padding-right: 10px; }.config-modal .switch-row strong { font-size: 11px; }.config-modal .switch-row small { margin-top: 4px; font-size: 9px; line-height: 1.35; }
.config-modal .config-toggle-card.danger-zone { border-color: rgba(255,93,108,.2); }
.ios-switch { position: relative; width: 42px; height: 24px; flex: 0 0 42px; padding: 0 !important; }
.ios-switch-input { position: absolute; inset: 0; z-index: 2; width: 100% !important; height: 100% !important; margin: 0 !important; cursor: pointer; opacity: 0; }
.ios-switch-track { position: absolute; inset: 0; display: block; padding: 0 !important; background: #172a3a; border: 1px solid #30485b; border-radius: 999px; box-shadow: inset 0 1px 2px rgba(0,0,0,.22); pointer-events: none; transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.ios-switch-track::after { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; content: ''; background: #edf4f7; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.ios-switch-input:checked + .ios-switch-track { background: var(--green); border-color: var(--green); box-shadow: 0 0 9px rgba(33,215,131,.16), inset 0 1px 2px rgba(0,0,0,.12); }
.ios-switch-input:checked + .ios-switch-track::after { transform: translateX(18px); }
.ios-switch-input:focus-visible + .ios-switch-track { outline: 2px solid rgba(49,157,255,.68); outline-offset: 2px; }
.config-modal .form-control:focus, .config-modal .form-select:focus { border-color: rgba(255,151,0,.75); box-shadow: 0 0 0 2px rgba(255,151,0,.08); }
.config-strategy-grid { align-items: start; }
.config-field { min-width: 0; }
.config-field .form-label { margin-bottom: 7px; color: #cbd8e1; font-size: 11px; }
.config-input-unit { position: relative; }
.config-input-unit .form-control { padding-right: 52px; }
.config-input-unit > span { position: absolute; top: 50%; right: 13px; color: var(--muted); font-size: 11px; pointer-events: none; transform: translateY(-50%); }
.profit-btc-range-field { grid-column: 1 / -1; margin-top: 2px; padding: 13px 15px 11px; background: #06141e; border: 1px solid var(--line); border-radius: 9px; }
.profit-btc-range-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profit-btc-range-heading .form-label { margin: 0; }
.profit-btc-range-value { min-width: 48px; color: var(--orange); font-size: 12px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.profit-btc-range-control { padding: 5px 7px 0; }
.profit-btc-range-input { --range-progress: 0%; position: relative; z-index: 2; width: 100%; height: 24px; margin: 0; cursor: pointer; appearance: none; background: transparent; }
.profit-btc-range-input::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, var(--orange) 0 var(--range-progress), #2a4152 var(--range-progress) 100%); border-radius: 999px; }
.profit-btc-range-input::-moz-range-track { height: 4px; background: linear-gradient(to right, var(--orange) 0 var(--range-progress), #2a4152 var(--range-progress) 100%); border: 0; border-radius: 999px; }
.profit-btc-range-input::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6px; appearance: none; background: var(--orange); border: 3px solid #fff0d8; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,151,0,.16), 0 2px 7px rgba(0,0,0,.42); }
.profit-btc-range-input::-moz-range-thumb { width: 11px; height: 11px; background: var(--orange); border: 3px solid #fff0d8; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,151,0,.16), 0 2px 7px rgba(0,0,0,.42); }
.profit-btc-range-input:focus-visible { outline: none; }
.profit-btc-range-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(49,157,255,.32), 0 2px 7px rgba(0,0,0,.42); }
.profit-btc-range-marks { position: relative; z-index: 1; height: 29px; margin-top: -15px; pointer-events: none; }
.profit-btc-range-marks span { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 11px; color: #8194a3; font-size: 8px; font-weight: 600; transform: translateX(-50%); }
.profit-btc-range-marks span:nth-child(1) { left: 0; }.profit-btc-range-marks span:nth-child(2) { left: 25%; }.profit-btc-range-marks span:nth-child(3) { left: 50%; }.profit-btc-range-marks span:nth-child(4) { left: 75%; }.profit-btc-range-marks span:nth-child(5) { left: 100%; }
.profit-btc-range-marks span:first-child { align-items: flex-start; transform: none; }.profit-btc-range-marks span:last-child { align-items: flex-end; transform: translateX(-100%); }
.profit-btc-range-marks i { width: 7px; height: 7px; background: #2a4152; border: 2px solid #071722; border-radius: 50%; box-shadow: 0 0 0 1px #3a5366; }
.profit-btc-range-marks b { font: inherit; white-space: nowrap; }
.profit-btc-range-field > .form-hint { display: block; margin-top: 5px; }
@keyframes config-field-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.settings-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.settings-card { padding: 20px; }.readonly-field { min-height: 42px; display: flex; align-items: center; padding: 0 13px; color: var(--muted); background: #06131d; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.account-page { width: min(100%, 1180px); margin: 0 auto; padding: 30px 0 22px; }.account-hero { display: flex; align-items: center; gap: 17px; padding: 24px; background: linear-gradient(135deg, rgba(49,157,255,.11), rgba(8,23,35,.96) 55%, rgba(255,151,0,.06)); }.account-hero h1 { margin: 3px 0 5px; font-size: 25px; font-weight: 650; }.account-hero p { margin: 0; color: var(--muted); font-size: 11px; }.account-hero p strong { color: #e6eef3; }.account-avatar { width: 58px; height: 58px; display: grid; flex: 0 0 58px; place-items: center; color: var(--blue); background: rgba(49,157,255,.1); border: 1px solid rgba(49,157,255,.28); border-radius: 16px; font-size: 27px; }.account-content-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 270px; gap: 14px; margin-top: 14px; }.account-password-card, .account-api-card, .account-session-card { min-width: 0; padding: 22px; }.account-session-card { display: flex; flex-direction: column; }.account-session-copy { margin: 20px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }.account-session-copy strong { color: #e6eef3; }.account-logout-form { margin-top: auto; }.account-logout-form .btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }.credentials-state { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid; border-radius: 999px; font-size: 9px; white-space: nowrap; }.credentials-state.is-ready { color: var(--green); background: rgba(33,215,131,.08); border-color: rgba(33,215,131,.25); }.credentials-state.is-missing { color: var(--orange); background: rgba(255,151,0,.08); border-color: rgba(255,151,0,.25); }.api-credentials-help { margin: 0; line-height: 1.5; }
.account-modal .modal-content { max-height: 90vh; overflow: hidden; }
.account-modal .modal-body { padding: 18px; }
.account-modal .modal-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.account-modal-grid { margin-top: 0; }
.account-modal-grid > .panel { background: var(--surface-secondary); }
.system-panel { margin-top: 14px; padding: 20px; }.system-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 17px; }.system-grid > div { min-width: 0; padding: 14px; background: #06131d; border: 1px solid var(--line-soft); border-radius: 9px; }.system-grid i { display: block; margin-bottom: 9px; color: var(--orange); font-size: 18px; }.system-grid span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }.system-grid strong, .system-grid code { display: block; overflow: hidden; color: #dbe5ec; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.info-banner { display: flex; gap: 10px; margin-top: 15px; padding: 13px; color: #a8bac8; background: rgba(49, 157, 255, .06); border: 1px solid rgba(49, 157, 255, .16); border-radius: 9px; font-size: 10px; }.info-banner i { color: var(--blue); font-size: 15px; }.info-banner code { color: #8fc9ff; }

.backtest-layout { display: grid; grid-template-columns: 440px 1fr; gap: 14px; }.backtest-form-panel, .backtest-results { min-height: 515px; padding: 20px; }.loading-label { display: none; }.is-loading .normal-label { display: none; }.is-loading .loading-label { display: inline-flex; align-items: center; gap: 8px; }
.result-hero { margin: 22px 0 15px; padding: 24px; background: linear-gradient(135deg, rgba(33, 215, 131, .12), rgba(33, 215, 131, .025)); border: 1px solid rgba(33, 215, 131, .2); border-radius: 12px; }.result-hero span, .result-hero small { display: block; color: var(--muted); }.result-hero span { font-size: 11px; text-transform: uppercase; }.result-hero strong { display: block; margin: 7px 0; color: var(--green); font-size: 42px; font-weight: 500; }.negative-result { background: rgba(255, 93, 108, .07); border-color: rgba(255, 93, 108, .2); }.negative-result strong { color: var(--danger); }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }.result-grid div { padding: 13px; background: #06131d; border: 1px solid var(--line-soft); border-radius: 9px; }.result-grid span { display: block; color: var(--muted); font-size: 9px; }.result-grid strong { display: block; margin-top: 4px; font-size: 14px; }.period-line { display: flex; align-items: center; gap: 9px; margin-top: 15px; color: var(--muted); font-size: 10px; }.runs-panel, .logs-panel, .audit-panel { margin-top: 14px; padding: 18px; }
.backtest-risk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 9px; }.backtest-risk-grid > div { min-width: 0; padding: 12px; background: #06131d; border: 1px solid var(--line-soft); border-radius: 9px; }.backtest-risk-grid span, .backtest-risk-grid small { display: block; color: var(--muted); font-size: 9px; }.backtest-risk-grid strong { display: block; margin: 4px 0; font-size: 14px; }.backtest-risk-grid small { font-size: 8px; }
.backtest-report-panel { margin-top: 14px; padding: 18px; }.backtest-report-details { margin-top: 10px; border: 1px solid var(--line-soft); border-radius: 9px; }.backtest-report-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; color: #dbe5ec; cursor: pointer; list-style: none; font-size: 11px; }.backtest-report-details > summary::-webkit-details-marker { display: none; }.backtest-report-details > summary::after { color: var(--muted); content: '+'; font-size: 16px; }.backtest-report-details[open] > summary::after { content: '−'; }.backtest-report-details > summary small { color: var(--muted); font-size: 9px; }.report-table-wrap { max-height: 540px; overflow: auto; border-top: 1px solid var(--line-soft); }.report-table-wrap .data-table { min-width: 900px; margin-top: 0; }.report-table-wrap thead th { position: sticky; top: 0; z-index: 1; background: #091824; }.report-side { font-size: 9px; font-weight: 700; }.report-buy { color: var(--green); }.report-sell { color: var(--orange); }.report-empty { margin: 0; padding: 15px; color: var(--muted); font-size: 10px; }

.data-table { --bs-table-color: #cdd7df; --bs-table-bg: transparent; --bs-table-border-color: var(--line-soft); margin: 12px 0 0; font-size: 10px; }.data-table thead th { padding: 9px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }.data-table tbody td { padding: 10px 9px; }.data-table tbody tr:hover { --bs-table-accent-bg: rgba(255,255,255,.018); }.data-table code { color: #9fc2da; font-size: 9px; }
.database-browser { padding: 18px; }.database-toolbar { display: flex; align-items: end; gap: 10px; }.database-toolbar label { min-width: 220px; }.database-toolbar label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; }.database-toolbar small { margin: 0 0 10px auto; color: var(--muted); font-size: 9px; }.database-edit-hint { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--muted); font-size: 9px; }.database-edit-hint > i { color: var(--blue); font-size: 13px; }.database-edit-hint kbd { padding: 2px 5px; color: #c9d7e0; background: #020b12; border: 1px solid var(--line); border-radius: 4px; box-shadow: none; font-size: 8px; }.database-table-wrap { max-height: calc(100dvh - 290px); margin-top: 10px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 9px; }.database-table { min-width: max-content; margin: 0; }.database-table thead th { position: sticky; top: 0; z-index: 1; background: #091824; }.database-table td { max-width: 360px; white-space: nowrap; }.database-table td em { color: #647888; }.database-editable-cell { position: relative; cursor: text; transition: background-color .15s ease, box-shadow .15s ease; }.database-editable-cell:hover { background: rgba(49,157,255,.08); box-shadow: inset 0 0 0 1px rgba(49,157,255,.22); }.database-editable-cell.is-editing { min-width: 180px; padding: 4px !important; background: rgba(49,157,255,.09); box-shadow: inset 0 0 0 1px var(--blue); }.database-editable-cell.is-saving { opacity: .65; }.database-editable-cell.is-saved { animation: database-cell-saved .9s ease; }.database-cell-input { width: 100%; min-width: 170px; height: 31px; padding: 5px 7px; color: #eef5fa; background: #020b12; border: 0; border-radius: 5px; outline: 0; font: inherit; }.database-key-icon { margin-left: 6px; color: #81672e; font-size: 9px; }.database-save-notice { position: fixed; right: 18px; bottom: 18px; z-index: 1090; padding: 10px 13px; color: #aaf0cf; background: #09251a; border: 1px solid rgba(33,215,131,.35); border-radius: 8px; box-shadow: 0 10px 35px rgba(0,0,0,.35); font-size: 10px; }.database-save-notice.is-danger { color: #ffc0c6; background: #2b0c11; border-color: rgba(255,93,108,.4); }.database-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }.database-pagination span { color: var(--muted); font-size: 10px; }@keyframes database-cell-saved { 0%, 100% { background: transparent; } 35% { background: rgba(33,215,131,.2); } }
.filter-bar { display: flex; gap: 7px; }.filter-bar .form-select { width: auto; min-height: 36px; }.logs-table details { min-width: 70px; }.logs-table summary { color: var(--blue); cursor: pointer; }.logs-table pre { max-width: 360px; max-height: 200px; margin: 8px 0 0; padding: 10px; overflow: auto; color: #a9bac7; background: #020b12; border-radius: 7px; font-size: 9px; }
.severity { display: inline-block; min-width: 46px; padding: 3px 6px; text-align: center; border-radius: 5px; font-size: 8px; font-weight: 700; }.severity-info { color: #7bc1ff; background: rgba(49, 157, 255, .12); }.severity-warn { color: #ffd26b; background: rgba(255, 193, 7, .12); }.severity-error { color: #ff919b; background: rgba(255, 93, 108, .12); }
.audit-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px 18px; margin-top: 12px; }.audit-list > div { display: grid; grid-template-columns: 25px auto 1fr auto; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 10px; }.audit-icon { width: 23px; height: 23px; display: grid; place-items: center; color: var(--green); background: rgba(33, 215, 131, .09); border-radius: 50%; }.audit-list > div > span:not(.audit-icon), .audit-list small { color: var(--muted); }.audit-list small { text-align: right; font-size: 9px; }

.help-hero { display: flex; align-items: center; justify-content: space-between; padding: 28px; background: radial-gradient(circle at 90% 30%, rgba(255, 151, 0, .11), transparent 35%), linear-gradient(145deg, #091a27, #06121c); }.help-hero h2 { margin: 5px 0; font-size: 26px; }.help-hero p { margin: 0; color: var(--muted); }.help-hero > i { margin-right: 5%; color: var(--orange); font-size: 68px; opacity: .8; }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }.help-card { padding: 20px; }.help-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 12px; font-size: 19px; }.help-icon.orange { color: var(--orange); background: rgba(255,151,0,.1); }.help-icon.blue { color: var(--blue); background: rgba(49,157,255,.1); }.help-icon.green { color: var(--green); background: rgba(33,215,131,.1); }.help-card h3 { font-size: 14px; }.help-card p { min-height: 58px; color: var(--muted); font-size: 11px; line-height: 1.6; }.help-card a { color: var(--orange); font-size: 10px; }
.faq-panel, .command-panel { margin-top: 14px; padding: 20px; }.accordion { margin-top: 13px; --bs-accordion-bg: transparent; --bs-accordion-color: #cad5dd; --bs-accordion-border-color: var(--line-soft); --bs-accordion-btn-color: #e4ebf0; --bs-accordion-btn-bg: transparent; --bs-accordion-active-color: var(--orange); --bs-accordion-active-bg: rgba(255,151,0,.04); --bs-accordion-btn-focus-box-shadow: none; }.accordion-button { font-size: 12px; }.accordion-body { color: var(--muted); font-size: 11px; line-height: 1.6; }
.command-panel { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }.command-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.command-list code { padding: 10px; color: #8fc9ff; background: #020b12; border: 1px solid var(--line-soft); border-radius: 7px; font-size: 9px; }

.empty-state { grid-column: 1 / -1; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); text-align: center; }.empty-state > i { color: #446178; font-size: 28px; }.empty-state strong { color: #cbd6de; }.empty-state span { max-width: 320px; font-size: 10px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 56px; overflow: hidden; background: #000; }.login-page::before { display: none; }.login-glow { display: none; }
.login-card { position: relative; z-index: 1; width: min(100%, 430px); padding: 29px; background: rgba(5, 17, 27, .93); border: 1px solid #243949; border-radius: 16px; box-shadow: 0 34px 90px rgba(0,0,0,.48); backdrop-filter: blur(20px); }.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }.login-brand div { display: flex; flex-direction: column; }.login-brand strong { font-size: 17px; }.login-brand small { color: var(--muted); font-size: 10px; }.login-copy h1 { margin: 4px 0 5px; font-size: 28px; }.login-copy p { margin-bottom: 24px; color: var(--muted); font-size: 12px; }.input-icon { position: relative; }.input-icon i { position: absolute; top: 50%; left: 13px; z-index: 2; color: #6e8495; transform: translateY(-50%); }.input-icon .form-control { padding-left: 38px; }.setup-notice { display: flex; gap: 11px; margin-bottom: 18px; padding: 13px; color: #ffc868; background: rgba(255,151,0,.08); border: 1px solid rgba(255,151,0,.18); border-radius: 9px; }.setup-notice i { font-size: 19px; }.setup-notice strong, .setup-notice span { display: block; }.setup-notice strong { font-size: 11px; }.setup-notice span { margin-top: 3px; color: #c4af8d; font-size: 9px; }.setup-notice code { color: #ffd38b; }.login-foot { margin-top: 21px; color: #687c8c; text-align: center; font-size: 9px; }.login-foot i { margin-right: 5px; color: var(--green); }

@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(33,215,131,.35); } 50% { box-shadow: 0 0 0 6px rgba(33,215,131,0); } }
@keyframes tooltipIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes historyItemIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes executionPulse { 0% { opacity: .95; transform: scale(.45); } 100% { opacity: 0; transform: scale(1.8); } }
@keyframes activeStatusPulse { 0%, 100% { opacity: .72; box-shadow: 0 0 0 0 rgba(33,215,131,.1); } 50% { opacity: 1; box-shadow: 0 0 0 3px rgba(33,215,131,.08); } }

@media (min-width: 1200px) {
    .dashboard-page .app-main { min-height: 100dvh; display: flex; flex-direction: column; }
    .dashboard-page .signals-metrics { flex: 0 0 auto; }
    .dashboard-page .dashboard-grid { min-height: 620px; flex: 1 1 auto; grid-template-rows: minmax(0, 1fr); }
    .dashboard-page .dashboard-primary { min-height: 0; }
    .dashboard-page .chart-panel { min-height: 0; display: flex; flex: 1 1 auto; flex-direction: column; }
    .dashboard-page .chart-stage { min-height: 360px; flex: 1 1 auto; }
    .dashboard-page .btc-chart { height: 100%; }
    .dashboard-page .history-panel { min-height: 0; height: 100%; }
}
@media (max-width: 1199px) {
    .signals-metrics-scroll { flex-wrap: wrap; }.signals-event, .signals-bank { flex-basis: 46%; }.signals-profit { flex-basis: 100%; }.signals-separator:last-of-type { display: none; }
    .chart-toolbar { grid-template-columns: 180px 1fr; }.chart-controls { grid-column: 1 / -1; justify-self: start; }.chart-market-stats { border-right: 0; }
    .metrics-grid { grid-template-columns: 1fr 1fr; }.metrics-grid .event-card { grid-column: 1 / -1; }
    .dashboard-grid { grid-template-columns: 1fr; }.history-panel { min-height: auto; }.timeline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding-left: 0; }.timeline::before { display: none; }.timeline-item { padding: 12px 12px 12px 42px; background: #06131d; border: 1px solid var(--line-soft); border-radius: 9px; }.timeline-icon { left: 11px; top: 12px; }
    .fleet-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
    .fleet-metric:nth-child(4) { border-right: 0; }.fleet-metric:nth-child(5) { padding-left: 0; }.fleet-metric:nth-child(7) { padding-right: 0; border-right: 0; }
    .backtest-layout { grid-template-columns: 380px 1fr; }.backtest-risk-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
    .instance-mini-grid, .help-grid { grid-template-columns: 1fr 1fr; }.instance-mini-grid .instance-mini:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .fleet-instance { padding-inline: 16px; }.fleet-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .config-modal .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .backtest-layout { grid-template-columns: 1fr; }.backtest-form-panel, .backtest-results { min-height: 0; }.system-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .app-main { padding: 9px; }
    .signals-metrics { padding: 13px; overflow: visible; }.signals-metrics-scroll { display: block; }.signals-metric { width: 100%; min-width: 0; }.signals-separator { display: block !important; width: 100%; height: 1px; min-height: 1px; margin: 13px 0; }.signals-btc-spark { height: 64px; }.signals-event, .signals-bank { padding: 0; }.signals-quick-actions { position: static; width: 100%; height: 44px; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr; margin-top: 13px; transform: none; }
    .fleet-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }.fleet-stat { padding-inline: 13px; }.fleet-stat:nth-child(odd) { border-right: 1px solid var(--line-soft); }.fleet-stat:nth-child(even) { border-right: 0; }.fleet-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; }.fleet-metric { padding-inline: 12px; }.fleet-metric:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--line-soft); }.fleet-metric:nth-child(even) { padding-right: 0; border-right: 0; }.fleet-instance-actions { width: 100%; }.fleet-instance-actions .btn { min-width: 0; flex: 1; }.fleet-instance-actions > a, .fleet-instance-actions > form { display: flex; flex: 0 1 150px; }.fleet-instance-actions form .btn { width: 100%; }
    .config-modal .modal-dialog { max-height: calc(100vh - 16px); margin: 8px; }.config-modal .modal-content { max-height: calc(100vh - 16px); }.config-modal .form-grid { grid-template-columns: 1fr; }.config-general-grid > .switch-row { height: auto; min-height: 82px; }.config-modal .modal-header, .config-modal .modal-body, .config-modal .modal-footer { padding-inline: 14px; }
    .metrics-grid, .settings-layout, .account-content-grid { grid-template-columns: 1fr; }.metrics-grid .event-card { grid-column: auto; }.event-card { grid-template-columns: 1fr; }.event-countdown { margin-top: 10px; min-width: 0; }.sparkline { display: none; }.account-page { padding-top: 12px; }.account-hero { align-items: flex-start; padding: 18px; }.account-hero h1 { font-size: 21px; }.account-avatar { width: 48px; height: 48px; flex-basis: 48px; font-size: 22px; }.account-password-card, .account-api-card, .account-session-card { padding: 18px; }
    .chart-overlay-top { position: relative; inset: auto; min-height: 0; padding: 4px 0 8px 46px; background: transparent; }.chart-toolbar { display: flex; flex-direction: column; align-items: stretch; }.chart-market-stats { grid-template-columns: 1fr 1fr; padding: 10px 0; border: 0; border-block: 1px solid var(--line-soft); }.chart-controls { justify-content: flex-start; flex-wrap: wrap; }.chart-legend { flex-wrap: wrap; padding-top: 0; }.btc-chart { height: 410px; }.chart-panel { min-height: 545px; }.chart-subbar { align-items: flex-start; }
    .instance-mini-grid, .timeline, .help-grid, .form-grid, .form-grid.tight, .result-grid, .backtest-risk-grid, .audit-list, .system-grid { grid-template-columns: 1fr; }.instance-mini-grid .instance-mini:last-child:nth-child(odd) { grid-column: auto; }
    .filter-bar { width: 100%; flex-wrap: wrap; }.filter-bar .form-select { width: calc(50% - 4px); }.logs-panel .section-heading { flex-direction: column; }.database-toolbar { align-items: stretch; flex-direction: column; }.database-toolbar label { min-width: 0; }.database-toolbar small { margin: 0; }.database-table-wrap { max-height: 65vh; }
    .help-hero > i { display: none; }.command-panel { grid-template-columns: 1fr; }.command-list { grid-template-columns: 1fr; }.audit-list > div { grid-template-columns: 25px auto 1fr; }.audit-list small { grid-column: 2 / -1; text-align: left; }
}

.backtest-kpi-strip-extended { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.backtest-series-swatch.capital { width: 14px; height: 7px; background: rgba(49,157,255,.45); border: 1px solid #319dff; }
.backtest-portfolio-latest { display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap; text-align: right; }
.backtest-portfolio-latest > div { min-width: 105px; }
.backtest-portfolio-latest strong { display: block; font-size: 16px; font-weight: 600; white-space: nowrap; }
.backtest-portfolio-latest .capital-value { color: var(--blue); }
.backtest-portfolio-latest small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.backtest-portfolio-chart-stage { position: relative; min-height: 245px; }
.backtest-portfolio-note { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 8px; }
.backtest-portfolio-note i { color: var(--blue); }
.backtest-portfolio-tooltip { position: absolute; z-index: 8; width: 245px; padding: 11px 12px; color: #dce7ee; background: rgba(5,19,29,.97); border: 1px solid #294354; border-radius: 8px; box-shadow: 0 14px 34px rgba(0,0,0,.35); pointer-events: none; font-size: 9px; }
.backtest-portfolio-tooltip strong { display: block; color: #fff; font-size: 10px; font-weight: 600; margin-bottom: 8px; }
.backtest-portfolio-tooltip > div { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; }
.backtest-portfolio-tooltip > div span { color: var(--muted); }
.backtest-portfolio-tooltip > div b { text-align: right; font-weight: 500; }
.backtest-portfolio-tooltip .capital-value { color: var(--blue); }
@media (max-width: 767px) {
    .backtest-portfolio-latest { width: 100%; justify-content: space-between; gap: 12px; margin-top: 8px; text-align: left; }
    .backtest-portfolio-latest > div { min-width: 0; }
    .backtest-portfolio-chart-stage { min-height: 220px; }
    .backtest-portfolio-chart { height: 220px; }
}
@media (max-width: 430px) {
    .metric-card { min-height: 100px; padding: 15px; }.metric-icon { width: 43px; height: 43px; flex-basis: 43px; font-size: 20px; }.metric-value { font-size: 22px; }
    .fleet-header { align-items: stretch; flex-direction: column; }.fleet-header .btn { width: 100%; }
    .fleet-stat { min-height: 58px; padding: 8px 10px; gap: 8px; }.fleet-stat > i { width: 27px; height: 27px; flex-basis: 27px; font-size: 13px; }.fleet-stat > div > strong { font-size: 14px; }.fleet-stat > div > span { font-size: 7px; }.fleet-instance { padding-inline: 13px; }.fleet-instance-header { min-height: 62px; gap: 8px; }.fleet-identity .instance-avatar { width: 32px; height: 32px; flex-basis: 32px; }.fleet-instance-state { font-size: 9px; }.fleet-metrics { gap: 12px 0; }.fleet-metric > span { font-size: 7px; }.fleet-metric > strong { font-size: 10px; }.fleet-instance-actions { min-height: 58px; padding-block: 11px 12px; }.fleet-instance-actions > a, .fleet-instance-actions > form { flex-basis: 0; }
    .page-actions { align-items: flex-start; }.page-actions h2 { font-size: 16px; }
}

/* Backtest laboratory */
.backtest-page-content { max-width: 1500px; margin: 0 auto; padding-bottom: 26px; }
.backtest-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }.backtest-page-header h1 { margin: 4px 0 3px; font-size: 27px; letter-spacing: -.03em; }.backtest-page-header p { margin: 0; color: var(--muted); font-size: 12px; }.backtest-history-button { display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; color: #dce6ed; background: rgba(7,20,31,.7); border: 1px solid var(--line); border-radius: 8px; font-size: 11px; transition: .16s ease; }.backtest-history-button:hover { color: var(--orange); border-color: #3b5569; background: #0a1d2b; }
.backtest-lab-layout { display: grid; grid-template-columns: 322px minmax(0, 1fr); gap: 14px; align-items: start; }.backtest-parameters-panel { min-height: 455px; padding: 21px 20px; }.backtest-panel-kicker { display: block; color: #c8d4dd; font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }.backtest-parameters-panel h2 { margin: 8px 0 20px; font-size: 14px; font-weight: 500; }.backtest-market-pill { display: flex; align-items: center; gap: 10px; margin-bottom: 21px; padding: 10px; color: var(--blue); background: rgba(49,157,255,.055); border: 1px solid rgba(49,157,255,.16); border-radius: 9px; }.backtest-market-pill > i { font-size: 16px; }.backtest-market-pill span { min-width: 0; flex: 1; }.backtest-market-pill small, .backtest-market-pill strong { display: block; }.backtest-market-pill small { color: var(--muted); font-size: 8px; }.backtest-market-pill strong { margin-top: 2px; color: #dfeaf2; font-size: 12px; }.backtest-market-pill b { padding: 3px 6px; color: var(--muted); background: rgba(255,255,255,.04); border-radius: 5px; font-size: 8px; font-weight: 500; }
.backtest-form { display: flex; flex-direction: column; gap: 18px; }.backtest-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.backtest-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }.backtest-field > span { color: #cbd7df; font-size: 10px; }.backtest-input-unit { position: relative; }.backtest-input-unit input { width: 100%; padding-right: 35px; }.backtest-input-unit b { position: absolute; top: 50%; right: 12px; color: var(--muted); font-size: 11px; font-weight: 500; transform: translateY(-50%); }.backtest-submit { min-height: 43px; width: 100%; margin-top: 1px; }.backtest-loading-note { display: flex; align-items: flex-start; gap: 7px; color: #708697; font-size: 9px; line-height: 1.45; }.backtest-loading-note i { color: var(--orange); }.backtest-form.is-loading .backtest-loading-note { color: #b69a6d; }.backtest-advanced { border-top: 1px solid var(--line-soft); }.backtest-advanced summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 17px; color: #d6e0e7; cursor: pointer; list-style: none; }.backtest-advanced summary::-webkit-details-marker { display: none; }.backtest-advanced summary > span { display: block; }.backtest-advanced summary strong, .backtest-advanced summary small { display: block; }.backtest-advanced summary strong { font-size: 10px; font-weight: 500; }.backtest-advanced summary small { margin-top: 4px; color: var(--muted); font-size: 9px; }.backtest-advanced summary > i { color: var(--muted); transition: transform .16s ease; }.backtest-advanced[open] summary > i { transform: rotate(180deg); }.backtest-advanced-body { display: grid; gap: 12px; padding-top: 15px; }.backtest-advanced-body .form-control { min-height: 38px; font-size: 11px; }.backtest-advanced-info { display: flex; gap: 7px; color: var(--muted); font-size: 9px; line-height: 1.45; }.backtest-advanced-info i { color: var(--blue); }
.backtest-result-column { min-width: 0; }.backtest-kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); min-height: 101px; margin-bottom: 14px; overflow: hidden; background: rgba(7,20,31,.82); border: 1px solid var(--line); border-radius: var(--radius); }.backtest-kpi { min-width: 0; padding: 16px 20px; border-right: 1px solid var(--line-soft); }.backtest-kpi:last-child { border-right: 0; }.backtest-kpi span, .backtest-kpi small { display: block; color: var(--muted); font-size: 9px; }.backtest-kpi strong { display: block; margin: 6px 0 3px; font-size: 22px; font-weight: 550; letter-spacing: -.02em; }.backtest-kpi small { font-size: 8px; }.kpi-positive { color: var(--green); }.kpi-negative { color: var(--danger); }.kpi-blue { color: var(--blue); }.backtest-result-empty { min-height: 101px; display: flex; align-items: center; gap: 13px; margin-bottom: 14px; padding: 20px; color: var(--muted); background: rgba(7,20,31,.82); border: 1px dashed #294252; border-radius: var(--radius); }.backtest-result-empty > i { color: var(--blue); font-size: 25px; }.backtest-result-empty strong, .backtest-result-empty span { display: block; }.backtest-result-empty strong { color: #dce6ec; font-size: 12px; font-weight: 500; }.backtest-result-empty span { margin-top: 4px; font-size: 10px; }
.backtest-price-panel { min-height: 500px; padding: 14px 14px 9px; overflow: hidden; }.backtest-chart-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 5px 11px; }.backtest-chart-header h2 { margin: 0 0 3px; font-size: 15px; font-weight: 600; }.backtest-chart-header small { color: var(--muted); font-size: 9px; }.backtest-range-controls { display: flex; align-items: center; gap: 3px; }.backtest-range, .backtest-chart-tool { min-width: 31px; height: 28px; padding: 0 7px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 6px; font-size: 9px; }.backtest-range:hover, .backtest-range.active { color: var(--orange); background: rgba(255,151,0,.09); border-color: rgba(255,151,0,.15); }.backtest-range:disabled, .backtest-chart-tool:disabled { opacity: .4; cursor: not-allowed; }.backtest-chart-tool { margin-left: 5px; border-color: var(--line); font-size: 12px; }.backtest-chart-subbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 29px; padding: 0 5px 7px; border-top: 1px solid var(--line-soft); }.backtest-legend { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 8px; color: #aab7c4; font-size: 9px; }.backtest-legend span { display: inline-flex; align-items: center; gap: 6px; }.backtest-buy-dot { background: var(--blue); }.backtest-sell-dot { background: var(--orange); }.backtest-grid-line { width: 15px; border-top: 1px dashed var(--blue); }.backtest-chart-status { padding-top: 8px; color: #6f8495; font-size: 8px; }.backtest-chart-status i { margin-right: 4px; color: var(--green); font-size: 6px; }.backtest-chart-stage { position: relative; }.backtest-main-chart { width: 100%; height: 390px; }.backtest-chart-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; }.backtest-chart-empty i { color: #446178; font-size: 28px; }.backtest-chart-empty span { font-size: 10px; }.backtest-trade-tooltip { position: absolute; z-index: 5; width: 190px; padding: 11px 12px; color: #dce7ee; background: rgba(5,19,29,.96); border: 1px solid #294354; border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.3); pointer-events: none; font-size: 10px; }.backtest-trade-tooltip .tooltip-date, .backtest-trade-tooltip .tooltip-side { display: block; }.backtest-trade-tooltip .tooltip-date { color: #dce7ee; font-weight: 500; }.backtest-trade-tooltip .tooltip-side { margin: 8px 0 7px; font-size: 11px; font-weight: 600; }.backtest-trade-tooltip .tooltip-side.buy { color: var(--blue); }.backtest-trade-tooltip .tooltip-side.sell { color: var(--orange); }.backtest-trade-tooltip > div { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }.backtest-trade-tooltip > div span { color: var(--muted); }.backtest-trade-tooltip > div strong { font-weight: 500; text-align: right; }
.backtest-analysis-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(380px, .82fr); gap: 14px; margin-top: 14px; }.backtest-portfolio-panel, .backtest-details-panel { min-width: 0; padding: 18px; }.backtest-section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }.backtest-section-header h2 { margin: 6px 0 0; font-size: 14px; font-weight: 550; }.backtest-section-result { font-size: 18px; font-weight: 550; }.backtest-series-legend { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 13px; color: #b7c4ce; font-size: 9px; }.backtest-series-legend span { display: inline-flex; align-items: center; gap: 6px; }.backtest-series-swatch { width: 14px; height: 3px; display: inline-block; border-radius: 4px; }.backtest-series-swatch.strategy { background: var(--orange); }.backtest-series-swatch.benchmark { background: #72879a; }.backtest-portfolio-chart { width: 100%; height: 245px; margin-top: 10px; }.backtest-collapse-button { width: 28px; height: 28px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; }.backtest-collapse-button:hover { color: var(--orange); border-color: #3b5569; }.backtest-details-body { margin-top: 17px; }.backtest-detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); }.backtest-detail-grid > div { min-width: 0; min-height: 65px; padding: 11px 10px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }.backtest-detail-grid span, .backtest-detail-grid small { display: block; color: var(--muted); font-size: 8px; }.backtest-detail-grid strong { display: block; margin-top: 6px; color: #e2ebf0; font-size: 12px; font-weight: 500; }.backtest-detail-grid small { margin-top: 3px; font-size: 8px; }.backtest-executed-line { display: flex; align-items: flex-start; gap: 8px; margin-top: 13px; color: var(--muted); font-size: 9px; line-height: 1.4; }.backtest-executed-line i { color: var(--blue); }.backtest-benchmark-note { display: flex; align-items: baseline; gap: 8px; margin-top: 13px; padding-top: 11px; color: var(--muted); border-top: 1px solid var(--line-soft); font-size: 9px; }.backtest-benchmark-note strong { font-size: 12px; font-weight: 500; }.backtest-benchmark-note small { margin-left: auto; }.backtest-error-panel { display: flex; align-items: center; gap: 11px; margin-top: 14px; padding: 14px 18px; color: var(--danger); }.backtest-error-panel strong, .backtest-error-panel span { display: block; }.backtest-error-panel strong { font-size: 11px; }.backtest-error-panel span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.backtest-report-panel, .backtest-history-panel { margin-top: 14px; padding: 18px; }.backtest-report-count, .backtest-history-count { color: var(--muted); font-size: 9px; }.backtest-report-details { margin-top: 10px; border: 1px solid var(--line-soft); border-radius: 8px; }.backtest-report-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; color: #dbe5ec; cursor: pointer; list-style: none; font-size: 10px; }.backtest-report-details > summary::-webkit-details-marker { display: none; }.backtest-report-details > summary::after { color: var(--muted); content: '+'; font-size: 15px; }.backtest-report-details[open] > summary::after { content: '−'; }.backtest-report-details > summary small { color: var(--muted); font-size: 8px; }.report-table-wrap { max-height: 500px; overflow: auto; border-top: 1px solid var(--line-soft); }.report-table-wrap .data-table { min-width: 900px; margin-top: 0; }.report-table-wrap thead th { position: sticky; top: 0; z-index: 1; background: #091824; }.report-side { font-size: 8px; font-weight: 700; }.report-buy { color: var(--green); }.report-sell { color: var(--orange); }.report-empty { margin: 0; padding: 14px; color: var(--muted); font-size: 9px; }.backtest-history-table { margin-top: 14px; }.backtest-history-table tbody tr { cursor: pointer; }.backtest-history-table tbody tr:hover { background: rgba(255,255,255,.025); }.backtest-history-table td { white-space: nowrap; }.backtest-history-table td:nth-child(2) { white-space: normal; }.backtest-history-table td strong, .backtest-history-table td small { display: block; }.backtest-history-table td small { margin-top: 3px; color: var(--muted); font-size: 8px; }.backtest-status { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; }.backtest-status i { width: 6px; height: 6px; display: inline-block; border-radius: 50%; }.backtest-status.completed { color: var(--green); }.backtest-status.completed i { background: var(--green); }.backtest-status.failed { color: var(--danger); }.backtest-status.failed i { background: var(--danger); }.backtest-status.running { color: var(--orange); }.backtest-status.running i { background: var(--orange); }.backtest-open-button { width: 28px; height: 28px; display: inline-grid; place-items: center; color: #dce7ee; background: #07141f; border: 1px solid var(--line); border-radius: 7px; }.backtest-open-button:hover { color: var(--orange); border-color: #3b5569; }.backtest-history-empty { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 30px; color: var(--muted); text-align: center; }.backtest-history-empty i { color: #446178; font-size: 24px; }
@media (max-width: 1199px) { .backtest-lab-layout { grid-template-columns: 280px minmax(0, 1fr); }.backtest-kpi { padding-inline: 14px; }.backtest-kpi strong { font-size: 19px; }.backtest-analysis-grid { grid-template-columns: 1fr; }.backtest-details-panel { order: -1; } }
@media (max-width: 991px) { .backtest-lab-layout { grid-template-columns: 1fr; }.backtest-parameters-panel { min-height: 0; }.backtest-form { max-width: 520px; }.backtest-analysis-grid { grid-template-columns: 1fr; }.backtest-details-panel { order: 0; } }
@media (max-width: 767px) { .backtest-page-header { align-items: stretch; flex-direction: column; }.backtest-history-button { justify-content: center; }.backtest-kpi-strip { grid-template-columns: 1fr 1fr; }.backtest-kpi:nth-child(2) { border-right: 0; }.backtest-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }.backtest-chart-header, .backtest-chart-subbar { align-items: flex-start; flex-direction: column; }.backtest-range-controls { width: 100%; overflow-x: auto; }.backtest-main-chart { height: 330px; }.backtest-price-panel { min-height: 435px; }.backtest-detail-grid { grid-template-columns: 1fr 1fr; }.backtest-benchmark-note { align-items: flex-start; flex-wrap: wrap; }.backtest-benchmark-note small { width: 100%; margin-left: 0; }.backtest-report-details > summary { align-items: flex-start; flex-direction: column; }.backtest-history-table { min-width: 920px; } }
@media (max-width: 430px) { .backtest-input-grid, .backtest-kpi-strip, .backtest-detail-grid { grid-template-columns: 1fr; }.backtest-kpi { border-right: 0; border-bottom: 1px solid var(--line-soft); }.backtest-kpi:last-child { border-bottom: 0; }.backtest-kpi:nth-child(2) { border-right: 0; }.backtest-detail-grid { border-right: 1px solid var(--line-soft); }.backtest-detail-grid > div { min-height: 60px; }.backtest-page-header h1 { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

/* Backtest data quality and multi-operation tooltip */
.backtest-data-gap-warning { display: flex; align-items: flex-start; gap: 7px; margin: 2px 5px 8px; padding: 8px 10px; color: #d8b476; background: rgba(255,151,0,.07); border: 1px solid rgba(255,151,0,.18); border-radius: 6px; font-size: 9px; line-height: 1.35; }.backtest-data-gap-warning i { color: var(--orange); }
.backtest-trade-tooltip { width: 245px; max-width: calc(100% - 24px); max-height: 310px; overflow-y: auto; background: rgba(5,19,29,.97); }.backtest-trade-tooltip .tooltip-summary { display: block; margin-bottom: 8px; color: #dce7ee; font-weight: 600; }.backtest-tooltip-operation { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }.backtest-tooltip-operation:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }.backtest-tooltip-operation .tooltip-operation-header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }.backtest-tooltip-operation .tooltip-date { color: var(--muted); font-size: 9px; }.backtest-tooltip-operation .tooltip-side { font-size: 11px; font-weight: 600; }.backtest-tooltip-operation .tooltip-side.buy { color: var(--blue); }.backtest-tooltip-operation .tooltip-side.sell { color: var(--orange); }.backtest-tooltip-operation > div:not(.tooltip-operation-header) { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }.backtest-tooltip-operation > div span { color: var(--muted); }.backtest-tooltip-operation > div strong { font-weight: 500; text-align: right; }

/* Backtest final wide laboratory layout */
.backtest-page-content { width: 100%; max-width: none; margin: 0; padding: 0 12px 26px; box-sizing: border-box; }.backtest-page-content .panel { box-shadow: none; }.backtest-page-header { margin-bottom: 12px; }.backtest-page-header h1 { font-size: 25px; }.backtest-page-header p { font-size: 11px; }
.backtest-config-bar { position: relative; z-index: 10; margin-bottom: 12px; padding: 0 16px; overflow: visible; }.backtest-config-bar .backtest-form { min-height: 88px; display: flex; align-items: center; gap: 0; }.backtest-config-market, .backtest-config-field, .backtest-advanced, .backtest-submit-wrap { min-width: 0; }.backtest-config-market { width: 250px; flex: 0 0 250px; padding-right: 26px; border-right: 1px solid var(--line-soft); }.backtest-config-label { display: block; margin-bottom: 7px; color: #bdcbd5; font-size: 9px; }.backtest-config-market small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }.backtest-market-select-wrap { position: relative; }.backtest-market-select { width: 100%; padding: 0 24px 0 0; color: #e9f1f5; background: transparent; border: 0; outline: 0; font-size: 14px; font-weight: 600; appearance: none; }.backtest-market-select-wrap > i { position: absolute; top: 50%; right: 3px; color: var(--muted); font-size: 11px; pointer-events: none; transform: translateY(-50%); }.backtest-config-field { width: 180px; flex: 0 0 180px; padding: 0 36px; }.backtest-config-field + .backtest-config-field { border-left: 1px solid var(--line-soft); }.backtest-config-field .backtest-input-unit input { height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: 13px; }.backtest-config-bar .backtest-advanced { position: relative; flex: 1 1 auto; margin: 0 10px; border: 0; }.backtest-config-bar .backtest-advanced summary { min-height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-left: 1px solid var(--line-soft); color: #d8e3e9; list-style: none; cursor: pointer; }.backtest-config-bar .backtest-advanced summary::-webkit-details-marker { display: none; }.backtest-config-bar .backtest-advanced summary strong, .backtest-config-bar .backtest-advanced summary small { display: block; }.backtest-config-bar .backtest-advanced summary strong { font-size: 10px; font-weight: 500; }.backtest-config-bar .backtest-advanced summary small { margin-top: 4px; color: var(--muted); font-size: 8px; }.backtest-config-bar .backtest-advanced summary > i { color: var(--muted); transition: transform .16s ease; }.backtest-config-bar .backtest-advanced[open] summary > i { transform: rotate(180deg); }.backtest-config-bar .backtest-advanced-body { position: absolute; top: calc(100% + 8px); right: 0; width: min(370px, calc(100vw - 40px)); display: grid; gap: 12px; padding: 16px; background: #071722; border: 1px solid #294354; border-radius: 9px; box-shadow: 0 18px 45px rgba(0,0,0,.35); }.backtest-config-bar .backtest-advanced-info { font-size: 9px; }.backtest-submit-wrap { width: 255px; flex: 0 0 255px; padding-left: 14px; }.backtest-submit { width: 100%; min-height: 41px; margin: 0; white-space: nowrap; }.backtest-submit-wrap .backtest-loading-note { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.25; }.backtest-submit-wrap .backtest-loading-note i { margin-right: 4px; color: var(--orange); }.backtest-form.is-loading .backtest-loading-note { color: #d8b476; }
.backtest-result-column { width: 100%; }.backtest-kpi-strip { min-height: 94px; margin-bottom: 12px; }.backtest-kpi { padding: 14px 20px; }.backtest-kpi strong { font-size: 21px; }.backtest-price-panel { min-height: 0; padding: 12px 12px 8px; }.backtest-chart-header { padding: 0 5px 9px; }.backtest-chart-header h2 { font-size: 15px; }.backtest-main-chart { height: clamp(380px, 40vw, 500px); min-height: 380px; max-height: 500px; }.backtest-chart-stage { min-height: 380px; }.backtest-analysis-grid { grid-template-columns: minmax(0, 1.18fr) minmax(430px, .82fr); gap: 12px; margin-top: 12px; }.backtest-portfolio-panel, .backtest-details-panel { padding: 16px; }.backtest-portfolio-chart { height: 245px; margin-top: 7px; }.backtest-report-panel, .backtest-history-panel { margin-top: 12px; padding: 16px; }
@media (min-width: 1200px) { .backtest-page-content { padding-inline: 16px; } }
@media (max-width: 1199px) { .backtest-config-market { width: 215px; flex-basis: 215px; padding-right: 20px; }.backtest-config-field { width: 160px; flex-basis: 160px; padding-inline: 24px; }.backtest-submit-wrap { width: 220px; flex-basis: 220px; }.backtest-analysis-grid { grid-template-columns: 1fr; }.backtest-details-panel { order: 0; } }
@media (max-width: 991px) { .backtest-config-bar { padding: 10px 14px; }.backtest-config-bar .backtest-form { min-height: 0; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, .8fr) minmax(150px, .8fr); row-gap: 10px; }.backtest-config-market { width: auto; flex: initial; padding-right: 18px; }.backtest-config-field { width: auto; flex: initial; padding-inline: 18px; }.backtest-config-bar .backtest-advanced { margin: 0; }.backtest-config-bar .backtest-advanced summary { min-height: 42px; padding-inline: 18px; }.backtest-submit-wrap { width: auto; flex: initial; grid-column: 1 / -1; padding: 0; display: flex; align-items: center; gap: 12px; }.backtest-submit-wrap .backtest-loading-note { margin-top: 0; }.backtest-submit-wrap .backtest-submit { width: 240px; } }
@media (max-width: 767px) { .backtest-page-content { padding-inline: 0; }.backtest-config-bar .backtest-form { display: flex; align-items: stretch; flex-direction: column; gap: 12px; padding: 14px 0; }.backtest-config-market, .backtest-config-field { width: 100%; flex: 0 0 auto; padding: 0; border: 0; }.backtest-config-field + .backtest-config-field { border: 0; }.backtest-config-bar .backtest-advanced { flex: 0 0 auto; margin: 0; border-top: 1px solid var(--line-soft); }.backtest-config-bar .backtest-advanced summary { min-height: 48px; padding: 0; border: 0; }.backtest-config-bar .backtest-advanced-body { position: static; width: auto; box-shadow: none; }.backtest-submit-wrap { display: block; }.backtest-submit-wrap .backtest-submit { width: 100%; }.backtest-submit-wrap .backtest-loading-note { margin-top: 6px; }.backtest-chart-header, .backtest-chart-subbar { align-items: flex-start; }.backtest-main-chart { height: 360px; min-height: 360px; }.backtest-chart-stage { min-height: 360px; }.backtest-detail-grid { grid-template-columns: repeat(2, 1fr); } }

/* Backtest fixes: keep desktop controls on one horizontal row and make multi-operation tooltips usable. */
.backtest-config-bar .backtest-form { flex-direction: row; }
.backtest-trade-tooltip { width: 285px; max-height: min(420px, calc(100% - 24px)); overflow-y: auto; overscroll-behavior: contain; pointer-events: auto; }
@media (max-width: 767px) { .backtest-config-bar .backtest-form { flex-direction: column; } }

/* The essential simulation inputs are always visible. */
.backtest-config-market { width: 190px; flex-basis: 190px; padding-right: 18px; }
.backtest-config-field { width: 152px; flex-basis: 152px; padding-inline: 18px; }
.backtest-config-field.backtest-config-money { width: 165px; flex-basis: 165px; }
.backtest-submit-wrap { width: 225px; flex-basis: 225px; }
@media (max-width: 991px) {
    .backtest-config-bar .backtest-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .backtest-config-market, .backtest-config-field { width: 100%; flex-basis: auto; padding: 0; border: 0; }
    .backtest-config-field + .backtest-config-field { border: 0; }
    .backtest-submit-wrap { width: auto; flex-basis: auto; }
}

/* Backtest performance analysis */
.backtest-kpi-strip-extended { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.backtest-kpi-strip-extended .backtest-kpi { padding: 13px 14px; }
.backtest-kpi-strip-extended .backtest-kpi span { min-height: 21px; line-height: 1.25; }
.backtest-kpi-strip-extended .backtest-kpi strong { font-size: 18px; white-space: nowrap; }
.backtest-kpi-strip-extended .backtest-kpi small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.backtest-performance-panel { position: relative; margin-top: 12px; padding: 16px; overflow: visible; }
.backtest-performance-source { color: var(--muted); font-size: 9px; }
.backtest-performance-tabs { display: flex; align-items: flex-end; gap: 24px; margin-top: 10px; border-bottom: 1px solid var(--line-soft); }
.backtest-performance-tab { position: relative; padding: 8px 2px 9px; color: var(--muted); background: transparent; border: 0; font: inherit; font-size: 10px; cursor: pointer; }
.backtest-performance-tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; content: ''; }
.backtest-performance-tab:hover, .backtest-performance-tab:focus-visible { color: #dce7ee; outline: none; }
.backtest-performance-tab.active { color: var(--orange); }.backtest-performance-tab.active::after { background: var(--orange); }
.backtest-performance-tab span { display: inline-grid; width: 13px; height: 13px; margin-left: 3px; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 50%; font-size: 8px; }
.backtest-performance-tab-panel[hidden] { display: none; }
.backtest-performance-grid { display: grid; grid-template-columns: minmax(280px, .95fr) minmax(560px, 1.7fr) minmax(300px, .85fr); gap: 12px; margin-top: 14px; }
.backtest-performance-summary, .backtest-performance-heatmap, .backtest-performance-annual { min-width: 0; }
.backtest-analysis-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); }
.backtest-analysis-kpi { min-height: 84px; padding: 11px 12px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.backtest-analysis-kpi span, .backtest-analysis-kpi small { display: block; color: var(--muted); font-size: 8px; line-height: 1.3; }
.backtest-analysis-kpi strong { display: block; margin-top: 7px; color: #e6eef3; font-size: 15px; font-weight: 550; line-height: 1.15; white-space: nowrap; }
.backtest-analysis-kpi.positive strong { color: var(--green); }.backtest-analysis-kpi.negative strong { color: var(--danger); }.backtest-analysis-kpi.neutral strong { color: #d8e2e8; }
.backtest-analysis-kpi small { margin-top: 5px; font-size: 8px; }
.backtest-analysis-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-height: 23px; color: #c8d5dd; font-size: 9px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.backtest-analysis-title small { color: var(--muted); font-size: 8px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.backtest-heatmap-scroll { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 7px; }
.backtest-heatmap-table { width: 100%; min-width: 660px; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.backtest-heatmap-table th { height: 27px; padding: 5px 3px; color: var(--muted); background: rgba(255,255,255,.018); font-size: 8px; font-weight: 500; text-align: center; white-space: nowrap; }
.backtest-heatmap-table th:first-child { width: 48px; text-align: left; }.backtest-heatmap-table th:last-child { width: 62px; }
.backtest-heatmap-table td { height: 31px; padding: 2px; border-top: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); background: #071722; color: #dce6eb; font-size: 9px; text-align: center; }
.backtest-heatmap-table td:last-child { border-right: 0; }.backtest-heatmap-table tbody th { border-top: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); color: #d8e3e9; font-weight: 550; }
.backtest-heatmap-table td.is-positive { background: rgba(33,215,131,var(--heat-strength)); color: #a9f0c9; }.backtest-heatmap-table td.is-negative { background: rgba(255,93,108,var(--heat-strength)); color: #ffb0b7; }.backtest-heatmap-table td.is-empty { color: #526777; }
.realized-heatmap-table td.is-zero { background: #071722; color: #8fa1b3; }
.backtest-heatmap-table td.backtest-heatmap-year { border-left: 1px solid var(--line); border-right: 0; font-weight: 650; }.backtest-heatmap-table td.backtest-heatmap-year.is-positive { color: var(--green); }.backtest-heatmap-table td.backtest-heatmap-year.is-negative { color: var(--danger); }
.backtest-heatmap-cell { width: 100%; height: 25px; padding: 0; color: inherit; background: transparent; border: 0; font: inherit; cursor: pointer; }.backtest-heatmap-cell:hover, .backtest-heatmap-cell:focus-visible { color: #fff; outline: 1px solid rgba(255,255,255,.5); outline-offset: -2px; }
.backtest-performance-footnote { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; }
.backtest-annual-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }.backtest-annual-table th, .backtest-annual-table td { padding: 8px 7px; border-bottom: 1px solid var(--line-soft); font-size: 9px; text-align: right; white-space: nowrap; }.backtest-annual-table th:first-child, .backtest-annual-table td:first-child { text-align: left; }.backtest-annual-table thead th { color: var(--muted); font-size: 8px; font-weight: 500; }.backtest-annual-table tbody tr[data-performance-year] { cursor: pointer; }.backtest-annual-table tbody tr[data-performance-year]:hover, .backtest-annual-table tbody tr[data-performance-year]:focus-visible { background: rgba(255,255,255,.035); outline: none; }.backtest-annual-total th, .backtest-annual-total td { border-top: 1px solid #315066; border-bottom: 0; font-weight: 650; }
.backtest-performance-tooltip { position: absolute; z-index: 30; width: 245px; padding: 11px 12px; color: #dce7ee; background: rgba(5,19,29,.98); border: 1px solid #294354; border-radius: 8px; box-shadow: 0 14px 34px rgba(0,0,0,.35); pointer-events: none; font-size: 9px; }.backtest-performance-tooltip strong, .backtest-performance-tooltip span { display: block; }.backtest-performance-tooltip strong { color: #fff; font-size: 11px; }.backtest-performance-tooltip .performance-tooltip-return { margin: 5px 0 8px; font-size: 13px; font-weight: 650; }.backtest-performance-tooltip .performance-tooltip-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }.backtest-performance-tooltip .performance-tooltip-row span { color: var(--muted); }.backtest-performance-tooltip .performance-tooltip-row b { font-weight: 500; text-align: right; }
.backtest-performance-empty { display: flex; align-items: center; gap: 9px; min-height: 90px; color: var(--muted); font-size: 10px; }.backtest-performance-empty i { color: var(--blue); font-size: 20px; }
.backtest-realized-note { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 8px; }.backtest-realized-note i { color: var(--blue); }
@media (max-width: 1399px) { .backtest-kpi-strip-extended { grid-template-columns: repeat(4, minmax(0, 1fr)); }.backtest-performance-grid { grid-template-columns: minmax(260px, .85fr) minmax(0, 1.55fr); }.backtest-performance-annual { grid-column: 1 / -1; } }
@media (max-width: 767px) { .backtest-kpi-strip-extended { grid-template-columns: 1fr 1fr; }.backtest-kpi-strip-extended .backtest-kpi { padding: 12px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }.backtest-kpi-strip-extended .backtest-kpi:nth-child(even) { border-right: 0; }.backtest-kpi-strip-extended .backtest-kpi:last-child { border-bottom: 0; }.backtest-kpi-strip-extended .backtest-kpi strong { font-size: 17px; }.backtest-performance-panel { padding: 13px; }.backtest-performance-tabs { gap: 14px; overflow-x: auto; }.backtest-performance-tab { flex: 0 0 auto; }.backtest-performance-grid { grid-template-columns: 1fr; }.backtest-performance-annual { grid-column: auto; }.backtest-analysis-title { align-items: flex-start; flex-direction: column; gap: 3px; }.backtest-annual-table { min-width: 330px; } }

.backtest-kpi > span[title], .backtest-usage-metric > span[title] { cursor: help; }
.backtest-kpi > span .bi-question-circle, .backtest-usage-metric > span .bi-question-circle { margin-left: 2px; color: var(--muted); font-size: 8px; }
.backtest-mark-note { display: flex; align-items: center; gap: 6px; margin: 11px 0 -2px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.backtest-mark-note i { color: var(--blue); }
.backtest-capital-usage-panel { margin-top: 12px; padding: 16px; }
.backtest-capital-usage-panel h2 { margin: 5px 0 0; color: #dbe5eb; font-size: 12px; font-weight: 500; }
.backtest-capital-usage-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 13px; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); }
.backtest-usage-metric { min-width: 0; min-height: 82px; padding: 12px 14px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.backtest-usage-metric > span, .backtest-usage-metric > small { display: block; color: var(--muted); font-size: 8px; line-height: 1.35; }
.backtest-usage-metric > strong { display: block; margin-top: 9px; color: #dce7ee; font-size: 15px; font-weight: 550; line-height: 1.1; white-space: nowrap; }
.backtest-usage-metric > small { margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1399px) { .backtest-capital-usage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .backtest-capital-usage-panel { padding: 13px; }.backtest-capital-usage-grid { grid-template-columns: 1fr 1fr; }.backtest-usage-metric { padding: 11px 10px; }.backtest-usage-metric > strong { font-size: 13px; } }
@media (max-width: 430px) { .backtest-capital-usage-grid { grid-template-columns: 1fr; } }

/* Multi-operation trade tooltips stay readable without covering the chart. */
.backtest-trade-tooltip.is-multi { width: min(560px, calc(100% - 24px)); }
.backtest-trade-tooltip.is-extra-wide { width: min(760px, calc(100% - 24px)); }
.backtest-trade-tooltip > .backtest-tooltip-operations { display: grid; grid-template-columns: 1fr; gap: 0 12px; margin-top: 0; }
.backtest-trade-tooltip.is-multi > .backtest-tooltip-operations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.backtest-trade-tooltip.is-extra-wide > .backtest-tooltip-operations { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.backtest-trade-tooltip.is-multi .backtest-tooltip-operation:nth-child(-n+2),
.backtest-trade-tooltip.is-extra-wide .backtest-tooltip-operation:nth-child(-n+3) { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 767px) {
    .backtest-trade-tooltip.is-multi,
    .backtest-trade-tooltip.is-extra-wide { width: min(520px, calc(100% - 24px)); }
    .backtest-trade-tooltip.is-multi > .backtest-tooltip-operations,
    .backtest-trade-tooltip.is-extra-wide > .backtest-tooltip-operations { grid-template-columns: 1fr; }
    .backtest-trade-tooltip.is-multi .backtest-tooltip-operation:nth-child(n),
    .backtest-trade-tooltip.is-extra-wide .backtest-tooltip-operation:nth-child(n) { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
    .backtest-trade-tooltip .backtest-tooltip-operation:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
}

/* Six strategy-focused KPIs; collapse progressively on smaller screens. */
.backtest-kpi-strip-extended { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1399px) { .backtest-kpi-strip-extended { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767px) { .backtest-kpi-strip-extended { grid-template-columns: 1fr 1fr; } }

/* Dashboard — surface terminal unifiée */
body.dashboard-page,
.dashboard-page .app-shell,
.dashboard-page .app-main {
    background: var(--surface-main);
}
.dashboard-page .app-main { padding: 12px 18px 24px; }
.dashboard-page .signals-metrics,
.dashboard-page .chart-panel,
.dashboard-page .instances-strip,
.dashboard-page .history-panel,
.dashboard-page .instance-mini {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.dashboard-page .signals-metrics { margin-bottom: 18px; padding: 12px 162px 12px 8px; }
.dashboard-page .signals-metrics-scroll { gap: 20px; }
.dashboard-page .signals-separator { background: var(--divider-subtle); }
.dashboard-page .signals-kicker,
.dashboard-page .panel-label,
.dashboard-page .chart-market-stats > div > span,
.dashboard-page .instance-kpi small { color: rgba(238,244,248,.58); }
.dashboard-page .signals-quick-actions { right: 2px; background: transparent; border: 0; }
.dashboard-page .signals-quick-actions a,
.dashboard-page .signals-quick-actions button,
.dashboard-page .chart-tool,
.dashboard-page .instance-toggle,
.dashboard-page .instance-add-button {
    background: rgba(255,255,255,.02);
    border-color: rgba(255,255,255,.10);
}
.dashboard-page .signals-quick-actions a:hover,
.dashboard-page .signals-quick-actions a:focus-visible,
.dashboard-page .signals-quick-actions button:hover,
.dashboard-page .signals-quick-actions button:focus-visible,
.dashboard-page .chart-tool:hover,
.dashboard-page .instance-toggle:hover,
.dashboard-page .instance-add-button:hover {
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.18);
}
.dashboard-page .chart-tool.active { color: var(--orange); background: rgba(255,151,0,.055); border-color: rgba(255,151,0,.42); }
.dashboard-page .dashboard-grid { grid-template-columns: minmax(0, 1fr) 325px; gap: 24px; }
.dashboard-page .dashboard-primary { gap: 20px; }
.dashboard-page .chart-panel { padding: 0; overflow: hidden; }
.dashboard-page .chart-stage,
.dashboard-page .btc-chart { background: var(--surface-main); }
.dashboard-page .chart-overlay-top {
    top: 0;
    right: 0;
    left: 0;
    padding: 7px 0 10px 60px;
    background: linear-gradient(180deg, rgba(18,18,18,.98), rgba(18,18,18,.82) 70%, rgba(18,18,18,0));
}
.dashboard-page:not(.backtest-v2-page) .chart-identity { display: flex; min-height: 48px; align-items: center; transform: translateY(8px); }
.dashboard-page:not(.backtest-v2-page) .chart-identity-copy { display: flex; flex-direction: column; gap: 1px; }
.dashboard-page:not(.backtest-v2-page) .chart-identity h2 { margin-bottom: 0; line-height: 1.05; }
.dashboard-page:not(.backtest-v2-page) .chart-identity-copy > small { color: #71808b; font-size: 7px; letter-spacing: .015em; white-space: nowrap; }
.dashboard-page:not(.backtest-v2-page) .chart-brand { top: 50%; width: 50px; height: 50px; transform: translateY(-50%); }
.dashboard-page:not(.backtest-v2-page) .chart-brand img { transform: none; }
.dashboard-page:not(.backtest-v2-page) .chart-brand:hover img { filter: brightness(1.15); transform: scale(1.04); }
.dashboard-page .chart-market-stats { border-color: var(--divider-subtle); }
.dashboard-page .chart-price-focus { grid-template-columns: minmax(145px, 1.25fr) minmax(115px, 1fr) minmax(82px, .65fr); gap: 16px; align-items: center; padding-inline: 16px; }
.dashboard-page .chart-price-focus > div + div { padding-left: 16px; border-left: 1px solid var(--divider-subtle); }
.dashboard-page .chart-price-focus > div > span { margin-bottom: 1px; }
.dashboard-page .chart-price-focus strong { overflow: visible; color: #f1f6f8; font-size: 17px; letter-spacing: -.02em; text-overflow: clip; }
.dashboard-page .chart-price-focus-main strong { color: #f1f6f8; font-size: 19px; }
.dashboard-page .chart-price-focus strong small { font-size: 9px; letter-spacing: 0; }
.dashboard-page .chart-price-focus .chart-usd-price { padding-left: 0; border-left: 0; font-size: 19px; }
.dashboard-page .chart-price-focus-change strong { font-size: 13px; }
.dashboard-page .chart-order-tooltip { background: rgba(24,24,24,.98); border-color: rgba(255,255,255,.11); }
.chart-order-label-layer { --order-label-right: 82px; position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.chart-order-label { --order-label-rgb: 49,157,255; position: absolute; top: 0; right: var(--order-label-right); max-width: 90px; padding: 2px 7px; overflow: hidden; visibility: hidden; opacity: 0; color: rgba(255,255,255,.84); background: rgba(var(--order-label-rgb),.16); border: 1px solid rgba(var(--order-label-rgb),.28); border-radius: 4px; box-shadow: 0 0 7px rgba(var(--order-label-rgb),.08); backdrop-filter: blur(3px); font-size: 9px; font-weight: 700; line-height: 14px; text-overflow: ellipsis; white-space: nowrap; transition: opacity .16s ease, visibility .16s ease, color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease; will-change: transform, opacity; }
.chart-order-label.buy { --order-label-rgb: 49,157,255; }
.chart-order-label.sell { --order-label-rgb: 255,121,0; }
.chart-order-label.is-pointer-near { visibility: visible; opacity: 1; color: #fff; background: rgba(var(--order-label-rgb),.96); border-color: rgba(255,255,255,.34); box-shadow: 0 0 14px rgba(var(--order-label-rgb),.32); }
.dashboard-page:not(.backtest-v2-page) .chart-controls .chart-tool { width: 34px; justify-content: center; padding: 0; }
.dashboard-page:not(.backtest-v2-page) .chart-floating-controls { position: absolute; z-index: 7; left: 50%; bottom: 27px; display: flex; grid-column: auto; justify-self: auto; justify-content: center; gap: 5px; padding: 22px 18px 4px; opacity: .025; transform: translateX(-50%); transition: opacity .18s ease; }
.dashboard-page:not(.backtest-v2-page) .chart-floating-controls:hover,
.dashboard-page:not(.backtest-v2-page) .chart-floating-controls:focus-within { opacity: .72; }
.dashboard-page:not(.backtest-v2-page) .chart-floating-controls .chart-tool { height: 29px; color: rgba(220,230,236,.72); background: rgba(24,24,24,.80); border-color: rgba(255,255,255,.10); backdrop-filter: blur(6px); }
.dashboard-page:not(.backtest-v2-page) .chart-floating-controls .chart-tool:hover,
.dashboard-page:not(.backtest-v2-page) .chart-floating-controls .chart-tool:focus-visible { color: var(--orange); border-color: rgba(255,151,0,.34); outline: 0; }
@media (hover: none) { .dashboard-page:not(.backtest-v2-page) .chart-floating-controls { opacity: .48; } }

.odometer-number { display: inline-flex; align-items: baseline; line-height: 1; white-space: nowrap; }
.odometer-digit { display: inline-block; height: 1em; line-height: 1em; text-align: center; transform: translate3d(0,0,0); transform-origin: 50% 60%; backface-visibility: hidden; -webkit-font-smoothing: antialiased; will-change: transform, opacity; }
.odometer-digit.number { min-width: .62em; }
.odometer-digit.thin { min-width: .28em; }
.odometer-space { min-width: .35em; }
.odometer-suffix { margin-left: .32em; white-space: nowrap; }
.odometer-digit.roll-up { animation: odometerRollUp .32s ease-out both; }
.odometer-digit.roll-down { animation: odometerRollDown .32s ease-out both; }
@keyframes odometerRollUp { from { opacity: 0; transform: translateY(55%); } to { opacity: 1; transform: translateY(0); } }
@keyframes odometerRollDown { from { opacity: 0; transform: translateY(-55%); } to { opacity: 1; transform: translateY(0); } }
.dashboard-page .history-panel { padding: 17px 0 17px 22px; border-left: 1px solid var(--divider-subtle); }
.dashboard-page .timeline::before { background: rgba(255,255,255,.08); }
.dashboard-page .instances-strip.compact-instances { padding: 10px 0 0; border-top: 1px solid var(--divider-subtle); }
.dashboard-page .compact-instances .instance-mini { padding: 8px 22px 8px 14px; }
.dashboard-page .compact-instances .instance-mini + .instance-mini { padding-left: 28px; border-left: 1px solid var(--divider-subtle); }
.dashboard-page .compact-instances .instance-mini:hover { background: transparent; }
.dashboard-page .instance-kpis,
.dashboard-page .instance-kpi { border-color: var(--divider-subtle); }
.dashboard-page .instance-add-button { margin-left: 6px; }

@media (max-width: 1199px) {
    .dashboard-page .dashboard-grid { grid-template-columns: 1fr; gap: 24px; }
    .dashboard-page .history-panel { padding: 22px 0 0; border-top: 1px solid var(--divider-subtle); border-left: 0; }
    .dashboard-page .timeline-item { background: transparent; border: 0; border-radius: 0; }
}
@media (max-width: 767px) {
    .dashboard-page:not(.backtest-v2-page) .chart-identity { transform: none; }
    .dashboard-page:not(.backtest-v2-page) .chart-brand { top: 0; transform: none; }
}
@media (max-width: 767px) {
    .dashboard-page .app-main { padding: 10px 12px 20px; }
    .dashboard-page .signals-metrics { padding: 10px 0; }
    .dashboard-page .signals-quick-actions { margin-top: 16px; }
    .dashboard-page .chart-overlay-top { padding-left: 56px; }
    .dashboard-page .compact-instances .instance-mini { padding-inline: 12px 20px; }
    .dashboard-page .compact-instances .instance-mini + .instance-mini { padding-left: 24px; }
}

/* Repères d’exécution animés et mouvement ambiant très discret. */
.chart-execution-marker-layer { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.chart-execution-marker {
    --marker-rgb: 49,157,255;
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(var(--marker-rgb),.92);
    border: 1px solid rgba(255,255,255,.42);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(var(--marker-rgb),.10), 0 0 12px rgba(var(--marker-rgb),.24);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    cursor: crosshair;
    pointer-events: auto;
    will-change: transform, opacity, filter;
    animation: executionMarkerGlow 3.8s ease-in-out infinite;
}
.chart-execution-marker.sell { --marker-rgb: 255,121,0; }
.chart-execution-marker::after {
    content: "";
    position: absolute;
    inset: -5px;
    border: 1px solid rgba(var(--marker-rgb),.26);
    border-radius: inherit;
    animation: executionMarkerRing 3.8s ease-out infinite;
}
.chart-execution-marker.is-new { animation: executionMarkerArrival .55s ease-out both, executionMarkerGlow 3.8s .55s ease-in-out infinite; }
.chart-execution-marker.is-highlighted { z-index: 3; animation: executionMarkerFocus .62s ease-in-out infinite; }
.chart-execution-marker.is-highlighted::after { animation: executionMarkerFocusRing .62s ease-out infinite; }
.chart-execution-marker.is-dimmed { opacity: .18; filter: saturate(.35); animation-play-state: paused; }
.dashboard-page .timeline-item { border-radius: 6px; outline: 0; cursor: crosshair; transition: background-color .16s ease, opacity .16s ease, transform .16s ease; }
.dashboard-page .timeline-item:hover { background: rgba(255,255,255,.018); transform: translateX(2px); }
.dashboard-page .timeline-item:focus-visible { background: rgba(255,255,255,.018); transform: translateX(2px); }
.dashboard-page .timeline-item.is-history-dimmed { opacity: .16; }
.dashboard-page .history-panel.is-history-updated { --history-update-rgb: 49,157,255; }
.dashboard-page .history-panel.is-history-updated.is-sell-update { --history-update-rgb: 255,121,0; }
.dashboard-page .history-panel.is-history-updated .timeline { animation: historyCartPulse .55s ease both; }
.dashboard-page .history-panel.is-history-updated .section-heading > i { animation: historyBadgeBounce .55s ease; }
.dashboard-page .history-panel.is-history-updated .timeline-item.is-new { animation: historyItemRise .42s ease both; }
.dashboard-page .history-panel.is-history-updated .timeline-item.is-new .timeline-icon { animation: historyBadgeBounce .55s ease; }
.dashboard-page .signals-metrics { animation: dashboardSurfaceIn .28s ease-out both; }
.dashboard-page .chart-panel { animation: dashboardSurfaceIn .34s .05s ease-out both; }
.dashboard-page .history-panel { animation: dashboardSurfaceIn .34s .10s ease-out both; }
.dashboard-page .instances-strip { animation: dashboardSurfaceIn .34s .14s ease-out both; }
@keyframes executionMarkerGlow {
    0%, 100% { box-shadow: 0 0 0 3px rgba(var(--marker-rgb),.08), 0 0 9px rgba(var(--marker-rgb),.18); }
    50% { box-shadow: 0 0 0 4px rgba(var(--marker-rgb),.13), 0 0 15px rgba(var(--marker-rgb),.32); }
}
@keyframes executionMarkerRing {
    0%, 70% { opacity: .15; transform: scale(.86); }
    100% { opacity: 0; transform: scale(1.28); }
}
@keyframes executionMarkerArrival {
    0% { opacity: 0; filter: brightness(1.8); }
    55% { opacity: 1; filter: brightness(1.35); }
    100% { opacity: 1; filter: brightness(1); }
}
@keyframes executionMarkerFocus {
    0%, 100% { filter: brightness(1.05); box-shadow: 0 0 0 4px rgba(var(--marker-rgb),.20), 0 0 14px rgba(var(--marker-rgb),.40); }
    50% { filter: brightness(1.65); box-shadow: 0 0 0 7px rgba(var(--marker-rgb),.28), 0 0 25px rgba(var(--marker-rgb),.72); }
}
@keyframes executionMarkerFocusRing {
    from { opacity: .8; transform: scale(.85); }
    to { opacity: 0; transform: scale(1.65); }
}
@keyframes dashboardSurfaceIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes historyCartPulse {
    0% { transform: translateY(10px); filter: drop-shadow(0 0 0 rgba(var(--history-update-rgb),0)); }
    55% { transform: translateY(-4px); filter: drop-shadow(0 14px 18px rgba(var(--history-update-rgb),.18)); }
    100% { transform: translateY(0); filter: drop-shadow(0 0 0 rgba(var(--history-update-rgb),0)); }
}
@keyframes historyBadgeBounce {
    0% { transform: scale(.82); }
    55% { transform: scale(1.12); }
    100% { transform: scale(1); }
}
@keyframes historyItemRise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Backtest V2 — replay cinématique sur la surface du dashboard. */
.backtest-v2-page .app-main { padding-top: 12px; }
.backtest-v2-shell { width: 100%; }
.backtest-v2-page .signals-quick-actions { width: 148px; height: 42px; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr; }
.backtest-v2-page .signals-quick-actions button {
    display: grid;
    place-items: center;
    padding: 0;
    color: #aebdca;
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 7px;
    font-size: 16px;
}
.backtest-v2-page .signals-quick-actions button:hover,
.backtest-v2-page .signals-quick-actions button:focus-visible { color: var(--orange); background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.18); outline: 0; }
.replay-v2-period-metric { min-width: 280px; flex: 1 1 31%; }
.replay-v2-progress > span { background: linear-gradient(90deg, var(--blue), var(--orange)); }
.replay-v2-profit-metric { grid-template-rows: 24px 1fr; }
.replay-v2-profit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 7px; border-top: 1px solid var(--divider-subtle); }
.replay-v2-profit-grid span { min-width: 0; }
.replay-v2-profit-grid small, .replay-v2-profit-grid b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replay-v2-profit-grid small { color: var(--muted); font-size: 8px; }
.replay-v2-profit-grid b { margin-top: 2px; color: #e4ebef; font-size: 10px; font-variant-numeric: tabular-nums; }
.replay-v2-profit-grid b.positive { color: var(--green); }
.replay-v2-profit-grid b.negative { color: var(--danger); }
.replay-v2-dashboard-grid { align-items: stretch; }
.replay-v2-chart-panel { min-height: 650px; }
.replay-v2-chart-stage { min-height: 650px; overflow: hidden; }
.replay-v2-chart { height: 650px; min-height: 650px; }
.backtest-v2-page .chart-overlay-top { padding-bottom: 14px; }
.backtest-v2-page .chart-brand { width: 46px; height: 46px; }
.backtest-v2-page .chart-brand img { transform: none; }
.backtest-v2-page .chart-brand:hover img { transform: scale(1.04); }
.backtest-v2-page .chart-toolbar { grid-template-columns: minmax(150px,.62fr) minmax(360px,1.55fr) auto; }
.backtest-v2-page .chart-identity h2 > span:first-child { color: #e7eef3; font-size: 18px; }
.backtest-v2-page .chart-market-stats { grid-template-columns: repeat(4, minmax(75px,1fr)); }
.backtest-v2-page .chart-live-status.active { color: var(--orange); border-color: rgba(255,151,0,.28); background: rgba(255,151,0,.08); }
.backtest-v2-page .chart-live-status.active i { background: var(--orange); box-shadow: 0 0 8px rgba(255,151,0,.55); }
.replay-v2-chart-controls { gap: 4px; }
.replay-v2-chart-controls .chart-tool { min-width: 31px; padding-inline: 8px; }
.replay-v2-chart-controls .replay-v2-play { min-width: 66px; }
.replay-v2-chart-controls .replay-v2-play.active { color: var(--orange); background: rgba(255,151,0,.08); border-color: rgba(255,151,0,.35); }
.replay-v2-speed { height: 30px; display: flex; align-items: center; gap: 5px; padding: 0 7px; color: #aebdca; background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.10); border-radius: 7px; pointer-events: auto; }
.replay-v2-speed i { color: var(--orange); font-size: 12px; }
.replay-v2-speed select { width: 54px; padding: 0; color: #dce5eb; background: transparent; border: 0; outline: 0; font-size: 9px; font-weight: 700; }
.replay-v2-speed option { color: #e4ebef; background: #202020; }
.replay-v2-buffer { padding-top: 8px; color: #76838e; font-size: 8px; white-space: nowrap; }
.replay-v2-timeline-controls { position: relative; z-index: 7; display: grid; grid-template-columns: auto minmax(120px,1fr) auto; align-items: center; gap: 10px; margin: 7px 18px 10px; padding: 8px 12px; background: rgba(22,22,22,.88); border: 1px solid rgba(255,255,255,.10); border-radius: 9px; backdrop-filter: blur(9px); }
.replay-v2-timeline-controls time { color: #9da9b3; font-size: 8px; font-variant-numeric: tabular-nums; }
.replay-v2-timeline-controls input { width: 100%; height: 4px; accent-color: var(--orange); cursor: pointer; }
.replay-v2-loading { position: absolute; z-index: 8; right: 18px; bottom: 55px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; color: #cbd4da; background: rgba(22,22,22,.9); border: 1px solid rgba(255,255,255,.1); border-radius: 7px; font-size: 9px; }
.replay-v2-loading[hidden] { display: none; }
.replay-v2-config-strip { position: relative; z-index: 20; overflow: visible; padding-top: 12px !important; }
.replay-v2-form { width: 100%; display: grid; grid-template-columns: minmax(110px,1.1fr) minmax(205px,1.7fr) repeat(4,minmax(105px,1fr)) auto auto; align-items: end; gap: 10px; padding: 0 4px 2px; }
.replay-v2-form-field { min-width: 0; }
.replay-v2-form-field > label { display: block; margin-bottom: 5px; color: rgba(238,244,248,.58); font-size: 8px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.replay-v2-form-field > div { min-width: 0; height: 34px; display: flex; align-items: center; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.1); border-radius: 7px; }
.replay-v2-form-field input, .replay-v2-form-field select { width: 100%; min-width: 0; height: 34px; padding: 0 8px; color: #e8edf0; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.1); border-radius: 7px; outline: 0; font-size: 10px; font-variant-numeric: tabular-nums; }
.replay-v2-form-field > div input { height: 32px; background: transparent; border: 0; }
.replay-v2-form-field input:focus, .replay-v2-form-field select:focus { border-color: rgba(255,151,0,.45); box-shadow: 0 0 0 2px rgba(255,151,0,.06); }
.replay-v2-form-field b { padding-right: 8px; color: #73818b; font-size: 8px; font-weight: 600; }
.replay-v2-market-field small { display: none; }
.replay-v2-market-field select { color: var(--orange); font-weight: 700; }
.replay-v2-date-group { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.replay-v2-advanced { position: relative; }
.replay-v2-advanced summary { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 10px; color: #aebbc5; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.1); border-radius: 7px; cursor: pointer; font-size: 9px; list-style: none; }
.replay-v2-advanced summary::-webkit-details-marker { display: none; }
.replay-v2-advanced summary i { color: var(--orange); }
.replay-v2-advanced > div { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; width: 260px; display: grid; gap: 9px; padding: 12px; background: #111820; border: 1px solid rgba(255,151,0,.38); border-radius: 9px; box-shadow: 0 18px 42px rgba(0,0,0,.6); }
.replay-v2-advanced label { display: grid; grid-template-columns: 1fr 90px 18px; align-items: center; gap: 5px; color: #aebbc5; font-size: 9px; }
.replay-v2-advanced input { width: 90px; height: 30px; padding: 0 7px; color: #e8edf0; background: #161616; border: 1px solid rgba(255,255,255,.11); border-radius: 6px; }
.replay-v2-advanced b { color: #78858e; font-size: 8px; }
.replay-v2-submit { height: 34px; min-width: 88px; padding-inline: 14px; font-size: 9px; }
.replay-v2-history-panel { min-height: 700px; max-height: 700px; }
.replay-v2-open-orders { margin-top: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--divider-subtle); }
.replay-v2-side-title { display: flex; align-items: center; justify-content: space-between; color: #87949e; font-size: 8px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.replay-v2-side-title b { min-width: 19px; padding: 2px 5px; color: #dbe2e7; background: rgba(255,255,255,.06); border-radius: 99px; text-align: center; }
.replay-v2-history { margin-top: 14px; }
.replay-v2-history-panel .timeline-item { min-height: 79px; }
.backtest-v2-page .backtest-history-table { min-width: 900px; }
.replay-v2-results { display: grid; gap: 12px; margin-top: 12px; }
.replay-v2-summary { margin-bottom: 0; background: var(--surface); }
.replay-v2-analysis-grid { margin-top: 0; }
.replay-v2-detail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.replay-v2-performance-panel { margin-top: 0; }
.replay-v2-performance-grid { grid-template-columns: minmax(300px, .8fr) minmax(480px, 1.25fr) minmax(340px, .9fr); }
.replay-v2-period-table { min-width: 470px; }
.replay-v2-period-table tbody tr:hover { background: rgba(255,255,255,.025); }
.replay-v2-period-table tbody th { color: #cbd5dc; font-weight: 500; }

@media (max-width: 1399px) {
    .backtest-v2-page .chart-toolbar { grid-template-columns: minmax(140px,.65fr) minmax(310px,1.35fr) auto; gap: 8px; }
    .backtest-v2-page .chart-market-stats > div:nth-child(4) { display: none; }
    .backtest-v2-page .chart-market-stats { grid-template-columns: repeat(3,minmax(70px,1fr)); }
    .replay-v2-form { grid-template-columns: minmax(105px,1fr) minmax(190px,1.6fr) repeat(4,minmax(95px,1fr)) auto auto; }
    .replay-v2-advanced { display: block; }
    .replay-v2-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .replay-v2-performance-grid { grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr); }
    .replay-v2-performance-annual { grid-column: 1 / -1; }
}
@media (max-width: 1199px) {
    .replay-v2-history-panel { min-height: 0; max-height: none; }
    .replay-v2-history-panel .replay-v2-history { max-height: 420px; }
    .replay-v2-form { grid-template-columns: repeat(4,minmax(130px,1fr)); }
    .replay-v2-submit { width: 100%; }
    .replay-v2-analysis-grid, .replay-v2-performance-grid { grid-template-columns: 1fr; }
    .replay-v2-performance-annual { grid-column: auto; }
}
@media (max-width: 900px) {
    .backtest-v2-page .chart-toolbar { grid-template-columns: 1fr auto; }
    .backtest-v2-page .chart-market-stats { display: none; }
    .replay-v2-chart-controls .chart-tool:not(.replay-v2-play) { display: none; }
}
@media (max-width: 767px) {
    .replay-v2-metrics .signals-metrics-scroll { overflow-x: auto; }
    .replay-v2-metrics .signals-metric { min-width: 275px; }
    .replay-v2-chart-panel, .replay-v2-chart-stage, .replay-v2-chart { min-height: 540px; height: 540px; }
    .backtest-v2-page .chart-toolbar { grid-template-columns: minmax(130px,1fr) auto; }
    .replay-v2-chart-controls { align-items: flex-end; flex-direction: column; }
    .replay-v2-speed { height: 26px; }
    .replay-v2-buffer { display: none; }
    .replay-v2-timeline-controls { grid-template-columns: 1fr; gap: 5px; margin-inline: 8px; }
    .replay-v2-detail-grid { grid-template-columns: 1fr 1fr; }
    .replay-v2-timeline-controls time { display: none; }
    .replay-v2-form { grid-template-columns: 1fr 1fr; }
    .replay-v2-date-group { grid-column: 1 / -1; }
}
@media (max-width: 430px) {
    .replay-v2-form { grid-template-columns: 1fr; }
    .replay-v2-date-group { grid-column: auto; }
}

/* SQLite Studio --------------------------------------------------------- */
.database-page { overflow: hidden; background: #080a0f; }
.dashboard-page .signals-quick-actions { width: 148px; height: 42px; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr; }
.database-page .app-shell, .database-page .app-main { min-height: 100dvh; height: 100dvh; }
.database-page .app-main { padding: 0; overflow: hidden; }
.sqlite-studio {
    --studio-bg: #080a0f;
    --studio-panel: #0b0e14;
    --studio-panel-2: #0e1219;
    --studio-panel-3: #111620;
    --studio-border: #202631;
    --studio-border-soft: #171c25;
    --studio-text: #fff;
    --studio-muted: #d5d9e0;
    --studio-purple: var(--orange);
    --studio-purple-soft: rgba(255,151,0,.13);
    --sidebar-width: 270px;
    --inspector-width: 300px;
    width: 100%; height: 100dvh; display: grid; grid-template-rows: 64px minmax(0, 1fr) 28px;
    color: var(--studio-text); background: var(--studio-bg); font-size: 12px;
}
.studio-header { min-width: 0; display: grid; grid-template-columns: var(--sidebar-width) minmax(250px, 1fr) auto; align-items: stretch; border-bottom: 1px solid var(--studio-border); background: linear-gradient(180deg, #0b0e14, #090c11); }
.studio-brand { display: flex; align-items: center; gap: 11px; padding: 0 18px; border-right: 1px solid var(--studio-border); }
.studio-brand:hover { color: #fff; }
.studio-brand-icon { width: 27px; height: 31px; display: grid; place-items: center; color: #b786ff; background: linear-gradient(145deg, #9c5cff, #5320b8); border-radius: 7px; box-shadow: 0 7px 20px rgba(104,40,218,.22); font-size: 15px; }
.studio-brand > span:last-child { display: flex; align-items: baseline; gap: 8px; }
.studio-brand strong { color: #f0f2f7; font-size: 15px; font-weight: 680; }
.studio-brand small { padding: 2px 5px; color: #aeb5c2; background: #1a1f28; border: 1px solid #262d39; border-radius: 4px; font-size: 8px; }
.studio-database-identity { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.studio-database-identity > i { color: #d9dee8; font-size: 22px; }
.studio-database-identity > div { min-width: 0; }
.studio-database-identity strong, .studio-database-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-database-identity strong { color: #ecf0f5; font-size: 13px; font-weight: 650; }
.studio-database-identity small { margin-top: 3px; color: var(--studio-muted); font: 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.studio-readonly-badge { padding: 3px 6px; color: #ffd479; background: rgba(255,176,32,.09); border: 1px solid rgba(255,176,32,.22); border-radius: 4px; font-size: 8px; font-weight: 750; letter-spacing: .06em; }
.studio-header-actions { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-left: 1px solid var(--studio-border-soft); }
.studio-action, .studio-icon-button, .studio-tool-button, .studio-tool-icon { height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; color: #bac0cc; background: #0c1016; border: 1px solid #202733; border-radius: 6px; font-size: 10px; white-space: nowrap; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.studio-action:hover, .studio-icon-button:hover, .studio-tool-button:hover, .studio-tool-icon:hover { color: #fff; background: #121721; border-color: #343d4c; }
.studio-action-primary { color: #fff; background: linear-gradient(135deg, #8d3eff, #6d24db); border-color: #9b5aff; box-shadow: 0 6px 18px rgba(119,42,226,.18); }
.studio-action-primary:hover { background: linear-gradient(135deg, #9953ff, #7731e4); border-color: #b17aff; }
.studio-icon-button { width: 34px; padding: 0; }
.studio-panel-toggle { display: none; }
.studio-workspace { min-width: 0; min-height: 0; display: grid; grid-template-columns: var(--sidebar-width) 4px minmax(0, 1fr) 4px var(--inspector-width); overflow: hidden; }
.studio-sidebar, .studio-inspector { min-width: 0; min-height: 0; overflow: hidden; background: #090c11; }
.studio-sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--studio-border); }
.studio-database-section { flex: 0 0 auto; padding: 17px 14px 12px; border-bottom: 1px solid var(--studio-border-soft); }
.studio-section-label { display: block; margin: 0 6px 10px; color: #747c8b; font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.studio-database-list { display: grid; gap: 6px; }
.studio-database-card { width: 100%; min-width: 0; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 8px; padding: 9px 10px; color: #aeb5c2; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 7px; }
.studio-database-card:hover { background: #0e131a; }
.studio-database-card.active { color: #eef1f6; background: #10141c; border-color: #29313d; box-shadow: inset 2px 0 #8b3dff; }
.studio-database-card > i { font-size: 15px; }
.studio-database-card span { min-width: 0; }
.studio-database-card strong, .studio-database-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-database-card strong { font-size: 10px; font-weight: 650; }
.studio-database-card small { margin-top: 3px; color: #727b89; font-size: 8px; }
.studio-search { height: 38px; flex: 0 0 38px; display: flex; align-items: center; gap: 7px; margin: 11px 14px 7px; padding: 0 10px; color: #697280; background: #0b0e14; border: 1px solid #222934; border-radius: 6px; }
.studio-search:focus-within { color: #b28aff; border-color: rgba(139,61,255,.58); box-shadow: 0 0 0 2px rgba(139,61,255,.07); }
.studio-search input { min-width: 0; flex: 1; color: #d8dde7; background: transparent; border: 0; outline: 0; font-size: 9px; }
.studio-search input::placeholder { color: #626a77; }
.studio-search kbd { color: #646d7b; background: #11161e; border: 1px solid #242b36; box-shadow: none; font-size: 7px; }
.studio-object-tree { min-height: 0; flex: 1; padding: 2px 9px 14px; overflow: auto; }
.studio-object-tree section { margin-top: 8px; }
.studio-tree-heading { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; color: #858e9c; background: transparent; border: 0; font-size: 8px; font-weight: 720; letter-spacing: .06em; text-transform: uppercase; }
.studio-tree-heading b { margin-left: 3px; color: #5d6571; font: inherit; }
.studio-tree-heading i { font-size: 8px; transition: transform .15s ease; }
.studio-object-tree section.collapsed .studio-tree-heading i { transform: rotate(-90deg); }
.studio-object-tree section.collapsed .studio-tree-list { display: none; }
.studio-tree-list { display: grid; gap: 2px; }
.studio-tree-item { width: 100%; min-width: 0; height: 34px; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 5px; padding: 0 8px; color: #aab1be; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 5px; font-size: 9px; }
.studio-tree-item:hover { color: #dfe3ea; background: #10141b; }
.studio-tree-item.active { color: #fff; background: #171b24; border-color: #272e39; }
.studio-tree-item > i { color: #6d7785; font-size: 11px; }
.studio-tree-item.active > i { color: #a779ff; }
.studio-tree-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-tree-item small { color: #68717e; font-size: 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.studio-tree-list.compact .studio-tree-item { height: 29px; }
.studio-sidebar-resizer, .studio-inspector-resizer { position: relative; z-index: 5; cursor: col-resize; background: #090c11; }
.studio-sidebar-resizer::after, .studio-inspector-resizer::after { position: absolute; inset: 0 1px; background: transparent; content: ''; }
.studio-sidebar-resizer:hover::after, .studio-inspector-resizer:hover::after { background: #7131cd; }
.studio-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: 51px minmax(0, 1fr); background: #080b10; }
.studio-tabs { display: flex; align-items: stretch; gap: 8px; padding: 0 20px; border-bottom: 1px solid var(--studio-border); background: #0a0d13; }
.studio-tabs button { position: relative; min-width: 68px; padding: 0 9px; color: #939ba9; background: transparent; border: 0; font-size: 10px; }
.studio-tabs button:hover { color: #d9dee7; }
.studio-tabs button.active { color: #c6adff; }
.studio-tabs button.active::after { position: absolute; right: 5px; bottom: -1px; left: 5px; height: 2px; background: #8b3dff; border-radius: 2px 2px 0 0; box-shadow: 0 -2px 10px rgba(139,61,255,.45); content: ''; }
.studio-table-surface { min-width: 0; min-height: 0; overflow: hidden; }
.studio-tab-panel { width: 100%; height: 100%; min-width: 0; min-height: 0; display: none; overflow: auto; background: #090c11; }
.studio-tab-panel.active { display: block; }
.studio-tab-panel[data-tab-panel="data"].active { display: grid; grid-template-rows: 50px minmax(0, 1fr); }
.studio-data-toolbar { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--studio-border); background: #0b0e14; }
.studio-filter { height: 34px; min-width: 230px; max-width: 460px; display: flex; flex: 1 1 360px; align-items: center; color: #707987; background: #090c11; border: 1px solid #222a35; border-radius: 6px; overflow: hidden; }
.studio-filter > i { margin-left: 10px; font-size: 10px; }
.studio-filter input, .studio-filter select { height: 100%; min-width: 0; color: #b8bec9; background: transparent; border: 0; border-left: 1px solid #1d232c; outline: 0; font-size: 8px; }
.studio-filter select { width: 92px; padding: 0 5px; }.studio-filter select:first-of-type { width: 118px; }
.studio-filter input { flex: 1; padding: 0 8px; }
.studio-filter button { width: 30px; height: 100%; color: #747d8b; background: transparent; border: 0; border-left: 1px solid #1d232c; }
.studio-filter button:hover { color: #b78cff; background: var(--studio-purple-soft); }
.studio-tool-button { height: 34px; padding: 0 10px; font-size: 9px; }.studio-tool-icon { width: 34px; padding: 0; }
.studio-page-size { width: 55px; height: 34px; padding: 0 5px; color: #9da5b3; background: #0c1016; border: 1px solid #202733; border-radius: 6px; font-size: 9px; }
.studio-add-row { color: #c798ff; border-color: rgba(139,61,255,.35); }
.studio-selection-actions { display: inline-flex; gap: 4px; }
.studio-selection-actions button { height: 30px; padding: 0 8px; color: #aeb5c2; background: #10151d; border: 1px solid #252d38; border-radius: 5px; font-size: 8px; }
.studio-selection-actions button.danger { color: #ff929d; border-color: rgba(255,93,108,.25); }
.studio-pagination { display: flex; align-items: center; gap: 4px; margin-left: auto; white-space: nowrap; }
.studio-pagination span { margin-right: 5px; color: #7e8794; font-size: 8px; font-variant-numeric: tabular-nums; }
.studio-pagination button { width: 29px; height: 29px; color: #8a93a0; background: #10141b; border: 1px solid #222934; }
.studio-pagination button:first-of-type { border-radius: 5px 0 0 5px; }.studio-pagination button:last-of-type { margin-left: -5px; border-radius: 0 5px 5px 0; }
.studio-pagination button:hover:not(:disabled) { color: #d8dde6; background: #171c25; }.studio-pagination button:disabled { opacity: .35; }
.studio-grid-wrap { position: relative; min-width: 0; min-height: 0; overflow: auto; background: #090c11; }
.studio-grid { width: max-content; min-width: 100%; margin: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; color: #c4cad4; font: 10px/1.25 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.studio-grid th, .studio-grid td { width: 150px; min-width: 90px; max-width: 640px; height: 42px; padding: 0 13px; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid #1b212a; border-bottom: 1px solid #1b212a; }
.studio-grid thead th { position: sticky; top: 0; z-index: 3; height: 54px; padding: 0; color: #bec4cf; background: #0d1118; }
.studio-grid th > button { width: 100%; height: 100%; display: grid; grid-template: 17px 13px / minmax(0, 1fr) 16px; align-content: center; padding: 0 13px; color: inherit; text-align: left; background: transparent; border: 0; }
.studio-grid th > button span, .studio-grid th > button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-grid th > button span { font-size: 9px; font-weight: 650; }.studio-grid th > button small { color: #697280; font-size: 7px; font-weight: 520; }
.studio-grid th > button i { grid-area: 1 / 2 / 3; align-self: center; color: #9863ee; font-size: 10px; }
.studio-grid .studio-grid-select { width: 40px; min-width: 40px; max-width: 40px; padding: 0; text-align: center; }
.studio-grid input[type="checkbox"] { width: 12px; height: 12px; accent-color: #8b3dff; }
.studio-grid tbody tr { background: #090c11; }.studio-grid tbody tr:nth-child(even) { background: #0a0d12; }
.studio-grid tbody tr:hover, .studio-grid tbody tr.selected { background: #0e131b; }.studio-grid tbody tr.selected { box-shadow: inset 2px 0 #7f38eb; }
.studio-grid td em { color: #666f7d; font-style: italic; }.studio-grid td.is-empty-string::after { color: #515a67; content: '""'; font-style: italic; }
.studio-grid td.is-primary { color: #d0d5dd; }.studio-grid td.is-primary::after { margin-left: 6px; color: #9a78d5; content: '\f44e'; font-family: bootstrap-icons; font-size: 8px; }
.studio-editable-cell { cursor: text; }.studio-editable-cell:hover { background: rgba(139,61,255,.07); box-shadow: inset 0 0 0 1px rgba(139,61,255,.25); }
.studio-editable-cell.is-editing { min-width: 190px; padding: 3px 4px; background: #0d1017; box-shadow: inset 0 0 0 1px #8b3dff; }
.studio-editable-cell.is-saving { opacity: .65; }
.studio-cell-input { width: calc(100% - 44px); height: 34px; min-height: 34px; padding: 6px 8px; resize: none; color: #edf0f5; background: #080a0f; border: 0; outline: 0; font: inherit; vertical-align: middle; }
.studio-cell-null { width: 40px; height: 28px; padding: 0; color: #91839f; background: #15111b; border: 1px solid #352641; border-radius: 4px; font-size: 7px; }
.studio-blob-button { padding: 4px 7px; color: #9ba6b5; background: #111720; border: 1px solid #252e3a; border-radius: 4px; font: inherit; }
.studio-blob-button:hover { color: #c4a3ff; border-color: #503a70; }
.studio-value-chip { display: inline-block; padding: 3px 6px; border-radius: 4px; font-size: 8px; font-weight: 650; }
.studio-value-chip.success { color: #5ee1a1; background: rgba(33,215,131,.09); }.studio-value-chip.danger { color: #ff858f; background: rgba(255,93,108,.09); }.studio-value-chip.warning { color: #ffc15c; background: rgba(255,151,0,.1); }
.studio-column-resizer { position: absolute; top: 0; right: -3px; bottom: 0; z-index: 4; width: 7px; cursor: col-resize; }.studio-column-resizer:hover { background: rgba(139,61,255,.35); }
.studio-local-loader { position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; gap: 7px; color: #aeb5c1; background: rgba(8,10,15,.72); backdrop-filter: blur(2px); font-size: 9px; }
.studio-local-loader[hidden] { display: none; }
.studio-empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #697280; text-align: center; }.studio-empty[hidden] { display: none; }
.studio-empty i { color: #5a466f; font-size: 23px; }.studio-empty strong { color: #aeb5c0; font-size: 11px; }.studio-empty span { max-width: 280px; font-size: 8px; }
.studio-empty.compact { min-height: 150px; padding: 20px; border: 1px dashed #262d37; border-radius: 8px; }
.studio-panel-toolbar { height: 57px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--studio-border); }
.studio-panel-toolbar span, .studio-panel-toolbar strong { display: block; }.studio-panel-toolbar span { color: #77808e; font-size: 8px; text-transform: uppercase; }.studio-panel-toolbar strong { margin-top: 3px; color: #d9dee6; font-size: 11px; }
.studio-schema-table-wrap { max-height: calc(100% - 58px); overflow: auto; }
.studio-schema-table { width: 100%; border-collapse: collapse; color: #b8bfca; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.studio-schema-table th, .studio-schema-table td { height: 39px; padding: 0 14px; text-align: left; border-right: 1px solid #1c222b; border-bottom: 1px solid #1c222b; }
.studio-schema-table th { position: sticky; top: 0; color: #77808e; background: #0e1218; font-size: 8px; text-transform: uppercase; }.studio-table-empty { height: 120px !important; color: #6c7481; text-align: center !important; }
.studio-card-list { display: grid; gap: 8px; padding: 14px; }
.studio-object-card { min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; background: #0c1016; border: 1px solid #202731; border-radius: 7px; }
.studio-object-card > i { width: 32px; height: 32px; display: grid; place-items: center; color: #a77aff; background: rgba(139,61,255,.08); border-radius: 7px; }
.studio-object-card strong, .studio-object-card span, .studio-object-card code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-object-card strong { color: #dce1e8; font-size: 10px; }.studio-object-card span { margin-top: 3px; color: #737c8a; font-size: 8px; }.studio-object-card code { max-width: 800px; margin-top: 7px; color: #8992a0; font-size: 8px; }
.studio-object-card > button, .studio-object-actions button { width: 30px; height: 30px; color: #8e97a4; background: #121720; border: 1px solid #242c37; border-radius: 5px; }.studio-object-card > button:hover, .studio-object-actions button:hover { color: #ff8893; border-color: rgba(255,93,108,.32); }
.studio-object-actions { display: flex !important; gap: 5px; }.studio-object-actions button:first-child:hover { color: #b792ff; border-color: rgba(139,61,255,.35); }
.studio-sql-callout { align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: #7d8694; text-align: center; }.studio-sql-callout.active { display: flex; }
.studio-sql-callout > i { color: #9b69ef; font-size: 30px; }.studio-sql-callout strong { color: #d4d9e1; font-size: 12px; }.studio-sql-callout span { font-size: 9px; }.studio-sql-callout button { margin-top: 7px; padding: 7px 11px; color: #c9a8ff; background: rgba(139,61,255,.09); border: 1px solid rgba(139,61,255,.3); border-radius: 5px; font-size: 9px; }
.studio-inspector { overflow: auto; border-left: 1px solid var(--studio-border); }
.studio-inspector-heading { min-height: 82px; display: flex; flex-direction: column; justify-content: center; padding: 0 18px; border-bottom: 1px solid var(--studio-border); }
.studio-inspector-heading span { color: #767e8c; font-size: 8px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }.studio-inspector-heading strong { margin-top: 9px; color: #edf0f5; font-size: 15px; }
.studio-inspector section { padding: 16px 18px; border-bottom: 1px solid var(--studio-border); }.studio-inspector h2 { margin: 0 0 13px; color: #d9dee6; font-size: 10px; font-weight: 620; }
.studio-info-list { display: grid; gap: 10px; margin: 0; }.studio-info-list div { display: flex; justify-content: space-between; gap: 14px; }.studio-info-list dt, .studio-info-list dd { margin: 0; font-size: 9px; }.studio-info-list dt { color: #757e8c; font-weight: 450; }.studio-info-list dd { overflow: hidden; color: #aeb6c2; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.studio-inspector-columns { display: grid; gap: 10px; }.studio-inspector-columns > div { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 7px; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }.studio-inspector-columns span { overflow: hidden; color: #b8c0cb; text-overflow: ellipsis; white-space: nowrap; }.studio-inspector-columns code { color: #858e9b; font-size: 8px; }.studio-inspector-columns b, .studio-inspector-columns em { padding: 2px 4px; border-radius: 3px; font-size: 6px; font-style: normal; }.studio-inspector-columns b { color: #c6a5ff; background: rgba(139,61,255,.14); }.studio-inspector-columns em { color: #7a8391; }
.studio-definition { max-height: 180px; margin: 0; overflow: auto; color: #8892a0; white-space: pre-wrap; font: 8px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.studio-muted { color: #747d8a !important; font-size: 8px; }
.studio-sql-dock { position: relative; min-width: 0; min-height: 0; display: grid; grid-template-rows: 38px minmax(0, 1fr); border-top: 1px solid #29303b; background: #090c11; }
.studio-sql-resizer { position: absolute; top: -4px; right: 0; left: 0; z-index: 9; height: 8px; cursor: row-resize; }.studio-sql-resizer:hover { background: rgba(139,61,255,.28); }
.studio-query-header { min-width: 0; display: flex; align-items: end; gap: 3px; padding: 5px 11px 0; border-bottom: 1px solid #202631; background: #0b0e14; }
.studio-query-tabs { min-width: 0; display: flex; align-items: end; gap: 3px; overflow-x: auto; }.studio-query-tabs > button { min-width: 96px; height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 0 8px 0 11px; color: #89929f; background: transparent; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; font-size: 9px; }.studio-query-tabs > button.active { color: #c8a8ff; background: #11151d; border-color: #262d38; }.studio-query-tabs > button i { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 3px; }.studio-query-tabs > button i:hover { color: #ff919c; background: rgba(255,93,108,.08); }
.studio-query-header > button { height: 28px; margin-bottom: 4px; padding: 0 8px; color: #89929f; background: transparent; border: 0; border-radius: 4px; font-size: 8px; }.studio-query-header > button:last-child { margin-left: auto; }.studio-query-header > button:hover { color: #c7a8ff; background: rgba(139,61,255,.08); }
.studio-query-workspace { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(300px, 55%) minmax(260px, 45%); }
.studio-editor-pane, .studio-results-pane { min-width: 0; min-height: 0; display: grid; grid-template-rows: 38px minmax(0, 1fr); }
.studio-editor-pane { border-right: 1px solid #202631; }.studio-editor-toolbar { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 14px; border-bottom: 1px solid #1d232c; }.studio-editor-toolbar > span { color: #777f8d; font-size: 8px; text-transform: uppercase; }.studio-editor-toolbar button { height: 27px; padding: 0 8px; color: #989fad; background: #0e1218; border: 1px solid #232a35; border-radius: 5px; font-size: 8px; }.studio-editor-toolbar button:first-of-type { margin-left: auto; }.studio-editor-toolbar button.execute { color: #fff; background: linear-gradient(135deg, #8b3dff, #6d25d8); border-color: #9958ef; }.studio-editor-toolbar button.execute.is-running { opacity: .65; }.studio-editor-toolbar kbd { margin-left: 4px; padding: 1px 3px; color: #d9c7ff; background: rgba(0,0,0,.18); border: 0; box-shadow: none; font-size: 6px; }
.studio-editor-shell { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #090c11; font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.studio-line-numbers { position: absolute; inset: 0 auto 0 0; z-index: 3; width: 44px; padding: 12px 10px; overflow: hidden; color: #4f5865; text-align: right; white-space: pre; background: #0b0e14; border-right: 1px solid #191f27; pointer-events: none; user-select: none; }
.studio-sql-highlight, .studio-sql-editor { position: absolute; inset: 0 0 0 44px; width: calc(100% - 44px); height: 100%; margin: 0; padding: 12px 14px; overflow: auto; white-space: pre; tab-size: 4; font: inherit; letter-spacing: 0; word-spacing: 0; }
.studio-sql-highlight { z-index: 1; color: #c8cdd6; background: transparent; border: 0; pointer-events: none; scrollbar-width: none; }
.studio-sql-editor { z-index: 2; resize: none; color: transparent; background: transparent; border: 0; border-radius: 0; outline: 0; caret-color: #edf0f5; -webkit-text-fill-color: transparent; }
.studio-sql-editor::selection { background: rgba(116,72,181,.45); }.sql-token-keyword { color: #d27cff; }.sql-token-string { color: #66c9e8; }.sql-token-number { color: #e8ad6f; }.sql-token-comment { color: #5d6876; font-style: italic; }.sql-token-identifier { color: #b5d4ff; }
.studio-sql-autocomplete { position: absolute; z-index: 12; bottom: 9px; left: 55px; min-width: 180px; max-height: 170px; display: grid; overflow: auto; padding: 4px; background: #121720; border: 1px solid #363f4d; border-radius: 6px; box-shadow: 0 15px 35px rgba(0,0,0,.48); }.studio-sql-autocomplete[hidden] { display: none; }.studio-sql-autocomplete button { padding: 6px 8px; color: #bfc5cf; text-align: left; background: transparent; border: 0; border-radius: 4px; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }.studio-sql-autocomplete button:hover { color: #fff; background: rgba(139,61,255,.16); }
.studio-results-pane > header { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 13px; border-bottom: 1px solid #1d232c; }.studio-results-pane > header span, .studio-results-pane > header strong { display: block; }.studio-results-pane > header span { color: #7a8290; font-size: 7px; text-transform: uppercase; }.studio-results-pane > header strong { margin-top: 2px; color: #9ea6b3; font-size: 8px; font-weight: 520; }.studio-results-pane > header button { width: 27px; height: 27px; color: #858e9c; background: #0f131a; border: 1px solid #222a34; border-radius: 5px; }
.studio-query-result { min-width: 0; min-height: 0; overflow: auto; }.studio-query-placeholder { min-height: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; color: #656e7b; font-size: 8px; }.studio-query-placeholder i { color: #8d60ce; font-size: 15px; }
.studio-result-grid-wrap { min-width: 100%; width: max-content; }.studio-result-grid { min-width: 100%; border-collapse: collapse; color: #b9c0cb; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; }.studio-result-grid th, .studio-result-grid td { max-width: 260px; height: 31px; padding: 0 9px; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid #1c222a; border-bottom: 1px solid #1c222a; }.studio-result-grid th { position: sticky; top: 0; color: #838c99; background: #0e1218; }.studio-result-grid td em { color: #626b78; }
.studio-query-message { min-height: 100%; display: flex; align-items: center; justify-content: center; gap: 11px; padding: 18px; text-align: left; }.studio-query-message > i { font-size: 20px; }.studio-query-message strong, .studio-query-message span { display: block; }.studio-query-message strong { font-size: 10px; }.studio-query-message span { max-width: 520px; margin-top: 4px; color: #878f9d; font-size: 8px; line-height: 1.5; }.studio-query-message.success > i, .studio-query-message.success strong { color: #55d997; }.studio-query-message.danger > i, .studio-query-message.danger strong { color: #ff7481; }
.studio-statusbar { display: flex; align-items: center; gap: 14px; padding: 0 14px; color: #6f7784; background: #0a0d12; border-top: 1px solid #1d232c; font-size: 8px; }.studio-statusbar b { color: #8d95a2; font-weight: 560; }.studio-connected { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }.studio-connected i { width: 6px; height: 6px; background: #2dd68d; border-radius: 50%; box-shadow: 0 0 7px rgba(45,214,141,.35); }
.studio-context-menu { position: fixed; z-index: 1100; width: 215px; display: grid; gap: 2px; padding: 5px; background: #11161e; border: 1px solid #313a47; border-radius: 7px; box-shadow: 0 18px 50px rgba(0,0,0,.58); }.studio-context-menu[hidden] { display: none; }.studio-context-menu button { display: grid; grid-template-columns: 20px 1fr; align-items: center; padding: 7px 8px; color: #b7bec9; text-align: left; background: transparent; border: 0; border-radius: 4px; font-size: 8px; }.studio-context-menu button:hover { color: #fff; background: rgba(139,61,255,.12); }.studio-context-menu button.danger { color: #ff8a95; }.studio-context-menu button.danger:hover { background: rgba(255,93,108,.1); }
.studio-modal .modal-content { color: #cbd1da; background: #0d1118 !important; border-color: #303846; box-shadow: 0 28px 85px rgba(0,0,0,.66); }.studio-modal .modal-header, .studio-modal .modal-footer { padding: 13px 17px; background: #0b0f15; border-color: #252c36; }.studio-modal .modal-header h2 { margin: 2px 0 0; color: #edf0f5; font-size: 14px; }.studio-modal .modal-body { max-height: 68vh; padding: 17px; overflow: auto; }.studio-modal .btn-close { filter: invert(1) grayscale(1); opacity: .55; }
.studio-row-fields { display: grid; gap: 7px; }.studio-row-field { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(220px, 1.2fr); align-items: center; gap: 14px; padding: 9px 10px; background: #0a0e14; border: 1px solid #202731; border-radius: 6px; }.studio-row-field > div:first-child { min-width: 0; }.studio-row-field label { color: #d1d6df; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }.studio-row-field label input { margin-right: 4px; accent-color: #8b3dff; }.studio-row-field > div:first-child > span { display: block; margin-top: 3px; overflow: hidden; color: #707987; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }.studio-row-field > div:last-child { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 6px; }.studio-row-field .form-control, .studio-row-field .form-select { min-height: 32px; color: #cbd1da; background: #0c1016; border-color: #29313c; font-size: 8px; }
.studio-column-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }.studio-column-choices label { display: flex; align-items: center; gap: 9px; padding: 8px; background: #0a0e14; border: 1px solid #202731; border-radius: 6px; }.studio-column-choices input { accent-color: #8b3dff; }.studio-column-choices strong, .studio-column-choices small { display: block; }.studio-column-choices strong { color: #cfd5de; font-size: 9px; }.studio-column-choices small { margin-top: 2px; color: #717a88; font-size: 7px; }
.studio-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.studio-form-grid label, .studio-form-grid legend { color: #939caa; font-size: 8px; }.studio-form-grid .form-control, .studio-form-grid .form-select { margin-top: 5px; color: #d4d9e1; background: #0a0e14; border-color: #28313d; font-size: 9px; }.studio-form-grid .studio-check { display: flex; align-items: center; gap: 6px; }.studio-form-grid .studio-check input { accent-color: #8b3dff; }.studio-form-grid fieldset { grid-column: 1 / -1; padding: 10px; border: 1px solid #252d38; border-radius: 6px; }.studio-index-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 7px; }.studio-index-columns label { padding: 6px; color: #b6bdc7; background: #0b0f15; border-radius: 4px; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; }.studio-index-columns input { accent-color: #8b3dff; }
.studio-file-drop { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 20px; color: #818a98; text-align: center; background: #0a0e14; border: 1px dashed #37404d; border-radius: 8px; }.studio-file-drop > i { color: #a373f3; font-size: 30px; }.studio-file-drop strong { color: #cbd1db; font-size: 11px; }.studio-file-drop span { max-width: 320px; font-size: 8px; }.studio-file-drop input { max-width: 290px; margin-top: 10px; font-size: 8px; }
.studio-export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.studio-export-grid button { min-height: 78px; display: grid; grid-template-columns: 35px 1fr; align-items: center; gap: 10px; padding: 11px; color: #b8c0ca; text-align: left; background: #0a0e14; border: 1px solid #242c37; border-radius: 7px; }.studio-export-grid button:hover { color: #e7eaf0; background: #10151d; border-color: #4d386d; }.studio-export-grid button > i { color: #a87af4; font-size: 21px; }.studio-export-grid strong, .studio-export-grid small { display: block; }.studio-export-grid strong { font-size: 9px; }.studio-export-grid small { margin-top: 4px; color: #727b88; font-size: 7px; }
.studio-blob-info { display: grid; gap: 12px; margin: 0; }.studio-blob-info div { padding: 10px; background: #0a0e14; border: 1px solid #232a34; border-radius: 6px; }.studio-blob-info dt { color: #78818f; font-size: 8px; }.studio-blob-info dd { margin: 5px 0 0; color: #c7cdd6; font-size: 9px; }.studio-blob-info code { display: block; max-height: 100px; overflow: auto; color: #a985df; white-space: pre-wrap; word-break: break-all; font-size: 7px; }
.studio-query-history { display: grid; gap: 7px; }.studio-history-item { min-width: 0; display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: start; gap: 9px; padding: 10px; background: #0a0e14; border: 1px solid #222a34; border-radius: 6px; }.studio-history-item > i { margin-top: 2px; color: #4fd694; }.studio-history-item.danger > i { color: #ff7380; }.studio-history-item span, .studio-history-item code, .studio-history-item small { display: block; }.studio-history-item div > span { color: #717a88; font-size: 7px; }.studio-history-item code { max-height: 76px; margin-top: 5px; overflow: auto; color: #b7bec9; white-space: pre-wrap; font-size: 8px; }.studio-history-item small { margin-top: 5px; color: #ff8994; font-size: 7px; }.studio-history-item > span { display: flex; gap: 4px; }.studio-history-item button { width: 27px; height: 27px; color: #858e9b; background: #11161e; border: 1px solid #262e39; border-radius: 4px; }

/* Studio NuxGrid : orange du dashboard, contraste renforcé et SQL pleine page. */
.studio-brand-icon { color: #fff; background: linear-gradient(145deg, var(--orange), var(--orange-2)); box-shadow: 0 7px 20px rgba(255,151,0,.22); }
.studio-action-primary, .studio-editor-toolbar button.execute { color: #111; background: linear-gradient(135deg, var(--orange), var(--orange-2)); border-color: #ffad31; box-shadow: 0 6px 18px rgba(255,151,0,.18); }
.studio-action-primary:hover { color: #111; background: linear-gradient(135deg, #ffad31, var(--orange)); border-color: #ffc26c; }
.studio-database-card.active { box-shadow: inset 2px 0 var(--orange); }
.studio-search:focus-within { color: var(--orange); border-color: rgba(255,151,0,.58); box-shadow: 0 0 0 2px rgba(255,151,0,.08); }
.studio-tree-item.active > i, .studio-tabs button.active, .studio-grid th > button i, .studio-grid td.is-primary::after,
.studio-object-card > i, .studio-inspector-columns b, .studio-query-tabs > button.active, .studio-query-placeholder i,
.studio-file-drop > i, .studio-export-grid button > i, .studio-blob-info code { color: var(--orange); }
.studio-sidebar-resizer:hover::after, .studio-inspector-resizer:hover::after, .studio-tabs button.active::after { background: var(--orange); }
.studio-tabs button.active::after { box-shadow: 0 -2px 10px rgba(255,151,0,.45); }
.studio-filter button:hover, .studio-query-header > button:hover, .studio-context-menu button:hover, .studio-sql-autocomplete button:hover { color: #fff; background: var(--studio-purple-soft); }
.studio-add-row, .studio-object-actions button:first-child:hover, .studio-blob-button:hover { color: #ffd29a; border-color: rgba(255,151,0,.4); }
.studio-grid input[type="checkbox"], .studio-row-field label input, .studio-column-choices input, .studio-form-grid .studio-check input, .studio-index-columns input { accent-color: var(--orange); }
.studio-grid tbody tr.selected { box-shadow: inset 2px 0 var(--orange); }
.studio-editable-cell:hover { background: rgba(255,151,0,.07); box-shadow: inset 0 0 0 1px rgba(255,151,0,.25); }
.studio-editable-cell.is-editing { box-shadow: inset 0 0 0 1px var(--orange); }
.studio-column-resizer:hover { background: rgba(255,151,0,.35); }
.studio-cell-null { color: #ffd29a; background: rgba(255,151,0,.08); border-color: rgba(255,151,0,.28); }
.studio-empty i, .studio-editor-toolbar kbd { color: var(--orange); }
.studio-object-card > i { background: rgba(255,151,0,.09); }
.studio-inspector-columns b { background: rgba(255,151,0,.14); }
.studio-sql-editor::selection { background: rgba(255,151,0,.32); }
.sql-token-keyword { color: #ffad31; }

.studio-section-label, .studio-tree-heading, .studio-tree-heading b, .studio-database-card small, .studio-tree-item small,
.studio-search, .studio-search input::placeholder, .studio-tabs button, .studio-filter, .studio-pagination span,
.studio-grid th > button small, .studio-grid td em, .studio-empty, .studio-panel-toolbar span, .studio-schema-table th,
.studio-table-empty, .studio-object-card span, .studio-object-card code, .studio-inspector-heading span, .studio-info-list dt,
.studio-inspector-columns code, .studio-inspector-columns em, .studio-definition, .studio-muted, .studio-query-header > button,
.studio-query-tabs > button, .studio-editor-toolbar > span, .studio-line-numbers, .sql-token-comment,
.studio-results-pane > header span, .studio-query-placeholder, .studio-result-grid th, .studio-result-grid td em,
.studio-query-message span, .studio-statusbar, .studio-row-field > div:first-child > span, .studio-column-choices small,
.studio-form-grid label, .studio-form-grid legend, .studio-file-drop, .studio-export-grid small, .studio-blob-info dt,
.studio-history-item div > span, .studio-history-item button { color: #d5d9e0; }
.studio-database-card, .studio-tree-item, .studio-filter input, .studio-filter select, .studio-tool-button,
.studio-tool-icon, .studio-action, .studio-page-size, .studio-grid, .studio-schema-table, .studio-object-card code,
.studio-info-list dd, .studio-inspector-columns span, .studio-sql-highlight, .studio-sql-autocomplete button,
.studio-results-pane > header strong, .studio-result-grid, .studio-context-menu button, .studio-modal .modal-content,
.studio-row-field .form-control, .studio-row-field .form-select, .studio-column-choices strong,
.studio-index-columns label, .studio-export-grid button, .studio-history-item code { color: #f4f4f4; }

.studio-sql-page.active { display: grid; grid-template-rows: 38px minmax(0, 1fr); overflow: hidden; }
.studio-sql-page .studio-query-workspace { grid-template-columns: minmax(0, 1fr); }
.studio-sql-page .studio-editor-pane { border-right: 0; }
.studio-sql-page .studio-results-pane { display: none; }
.studio-sql-page.show-results .studio-editor-pane { display: none; }
.studio-sql-page.show-results .studio-results-pane { display: grid; }
.studio-results-pane > header > div:last-child { display: flex; align-items: center; gap: 6px; }
.studio-results-pane > header button { width: auto; padding: 0 9px; color: #fff; }
.studio-results-pane > header button:last-child { width: 30px; padding: 0; }
.studio-result-grid { font-size: 10px; }
.studio-result-grid th, .studio-result-grid td { height: 38px; padding-inline: 12px; }
.studio-export-grid button:hover { border-color: rgba(255,151,0,.45); }
.sqlite-studio.sidebar-collapsed { --sidebar-width: 0px; }.sqlite-studio.sidebar-collapsed .studio-sidebar, .sqlite-studio.sidebar-collapsed .studio-sidebar-resizer { display: none; }
.sqlite-studio.inspector-collapsed { --inspector-width: 0px; }.sqlite-studio.inspector-collapsed .studio-inspector, .sqlite-studio.inspector-collapsed .studio-inspector-resizer { display: none; }

@media (max-width: 1440px) {
    .sqlite-studio { --sidebar-width: 240px; --inspector-width: 260px; }
    .studio-header-actions { gap: 5px; padding-inline: 10px; }.studio-action { padding-inline: 9px; }.studio-data-toolbar { gap: 5px; }.studio-tool-button { padding-inline: 7px; }
}
@media (max-width: 1180px) {
    .studio-panel-toggle { display: inline-flex; }
    .studio-header { grid-template-columns: minmax(220px, 1fr) auto; }.studio-brand { display: none; }.studio-database-identity { border-right: 1px solid var(--studio-border); }
    .sqlite-studio:not(.inspector-open) { --inspector-width: 0px; }.sqlite-studio:not(.inspector-open) .studio-inspector, .sqlite-studio:not(.inspector-open) .studio-inspector-resizer { display: none; }
    .sqlite-studio.inspector-open { --inspector-width: 290px; }
    .sqlite-studio.inspector-open .studio-inspector { position: fixed; top: 64px; right: 0; bottom: 28px; z-index: 20; width: 290px; display: block; box-shadow: -18px 0 50px rgba(0,0,0,.55); }
    .sqlite-studio.inspector-open .studio-inspector-resizer { display: none; }
    .studio-action span { display: none; }.studio-action { width: 34px; padding: 0; }
}
@media (max-width: 900px) {
    .sqlite-studio { --sidebar-width: 0px; --inspector-width: 0px; }.studio-workspace { grid-template-columns: 0 0 minmax(0, 1fr) 0 0; }
    .studio-sidebar, .studio-sidebar-resizer { display: none; }.sqlite-studio.sidebar-open .studio-sidebar { position: fixed; top: 64px; bottom: 28px; left: 0; z-index: 22; width: 270px; display: flex; box-shadow: 18px 0 50px rgba(0,0,0,.6); }
    .studio-filter select { display: none; }.studio-filter { min-width: 130px; }.studio-query-workspace { grid-template-columns: minmax(330px, 1fr) minmax(280px, .8fr); }
}

/* Thème sombre — plusieurs niveaux de surfaces, isolés du thème clair. */
html {
    color-scheme: dark;
    --dark-bg: #070a0d;
    --dark-surface: #0b1015;
    --dark-surface-secondary: #0e141a;
    --dark-surface-elevated: #111820;
    --dark-chart: #05080a;
    --dark-border: #202a33;
    --dark-border-subtle: #172029;
    --dark-text-primary: #f1f5f9;
    --dark-text-secondary: #a8b2be;
    --dark-text-muted: #687482;
    --surface-main: var(--dark-bg);
    --bg: var(--dark-bg);
    --bg-soft: var(--dark-surface);
    --panel: var(--dark-surface);
    --panel-2: var(--dark-surface-secondary);
    --line: var(--dark-border);
    --line-soft: var(--dark-border-subtle);
    --text: var(--dark-text-primary);
    --muted: var(--dark-text-secondary);
    --background: var(--dark-bg);
    --surface: var(--dark-surface);
    --surface-secondary: var(--dark-surface-secondary);
    --surface-elevated: var(--dark-surface-elevated);
    --border: var(--dark-border);
    --border-subtle: var(--dark-border-subtle);
    --text-primary: var(--dark-text-primary);
    --text-secondary: var(--dark-text-secondary);
    --text-muted: var(--dark-text-muted);
    --surface-hover: #131a21;
    --shadow-subtle: 0 1px 2px rgba(0, 0, 0, .35);
}
html body,
html .app-shell,
html .app-main { color: var(--text-primary); background: var(--background); }
html .topbar,
html .panel,
html .fleet-stats,
html .fleet-instance,
html .modal-content.panel,
html .dropdown-menu,
html .live-pill,
html .user-button,
html .icon-button,
html .switch-row,
html .profit-btc-range-field,
html .backtest-config-bar,
html .backtest-chart-panel,
html .backtest-analysis-grid > *,
html .backtest-report-panel,
html .backtest-history-panel,
html .replay-v2-chart-panel,
html .replay-v2-history-panel,
html .replay-v2-form-panel,
html .archived-instance-row,
html .readonly-field,
html .system-grid > div,
html .result-grid div,
html .backtest-risk-grid > div,
html .backtest-open-button,
html .backtest-config-bar .backtest-advanced-body,
html .backtest-heatmap-table td,
html .realized-heatmap-table td.is-zero,
html .execution-history-table thead th,
html .report-table-wrap thead th,
html .database-table thead th {
    background-color: var(--surface);
    background-image: none;
    border-color: var(--border);
}
html .form-control,
html .form-select {
    color: var(--text-primary);
    background-color: var(--surface-secondary);
    border-color: #26323d;
}
html .form-control:hover,
html .form-select:hover { border-color: #36434e; }
html .form-control:focus,
html .form-select:focus {
    color: var(--text-primary);
    background-color: var(--surface-elevated);
    border-color: var(--orange);
}
html :is(button, a, input, select):focus-visible {
    outline: 2px solid rgba(80, 150, 220, .55);
    outline-offset: 2px;
}
html :is(button, input, select):disabled {
    cursor: not-allowed;
    opacity: .45;
}

html .dashboard-page .app-main { padding: 10px 12px 20px; }
html .dashboard-page .signals-metrics {
    margin-bottom: 10px;
    padding: 0 162px 0 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
}
html .dashboard-page .signals-metrics-scroll { gap: 10px; }
html .dashboard-page .signals-metric {
    min-height: 108px;
    padding: 13px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: var(--shadow-subtle);
}
html .dashboard-page .signals-separator { display: none; }
html .dashboard-page .signals-progress { background: #1a222b; }
html .dashboard-page .signals-event > strong,
html .dashboard-page .signals-bank-top > span b,
html .dashboard-page .signals-bank-bottom b,
html .dashboard-page .signals-profit-target-head,
html .dashboard-page .signals-profit-target-meta b { color: var(--text-primary); }
html .dashboard-page .signals-event-bottom,
html .dashboard-page .signals-bank-bottom,
html .dashboard-page .signals-profit-title { color: var(--text-secondary); }
html .dashboard-page .signals-quick-actions {
    right: 0;
    width: 150px;
    height: 42px;
    padding: 0;
    background: transparent;
    border: 0;
}
html .dashboard-page .signals-quick-actions a,
html .dashboard-page .signals-quick-actions button,
html .dashboard-page .chart-tool,
html .dashboard-page .instance-toggle,
html .dashboard-page .instance-add-button {
    color: #c3cbd3;
    background: var(--surface);
    border-color: #26313b;
    box-shadow: var(--shadow-subtle);
}
html .dashboard-page .signals-quick-actions a:hover,
html .dashboard-page .signals-quick-actions button:hover,
html .dashboard-page .chart-tool:hover,
html .dashboard-page .instance-toggle:hover,
html .dashboard-page .instance-add-button:hover {
    color: var(--orange);
    background: var(--surface-hover);
    border-color: #36434e;
}
html .dashboard-page .instance-add-button { color: #c98524; }

html .dashboard-page .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 10px;
}
html .dashboard-page .dashboard-primary { gap: 10px; }
html .dashboard-page .chart-panel {
    background: var(--dark-chart);
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: var(--shadow-subtle);
}
html .dashboard-page .chart-stage,
html .dashboard-page .btc-chart { background: var(--dark-chart); }
html .dashboard-page .chart-overlay-top {
    padding-right: 10px;
    background: linear-gradient(180deg, rgba(11,16,21,.99) 0%, rgba(11,16,21,.96) 68%, rgba(11,16,21,.78) 84%, rgba(5,8,10,0) 100%);
}
html .dashboard-page .chart-market-stats { border-color: var(--border-subtle); }
html .dashboard-page .chart-floating-legend,
html .dashboard-page:not(.backtest-v2-page) .chart-floating-controls .chart-tool {
    color: #c3cbd3;
    background-color: rgba(11,16,21,.9);
    border-color: var(--border);
}
html .dashboard-page .chart-order-tooltip {
    background: rgba(14,20,26,.98);
    border-color: var(--border);
}

html .dashboard-page .history-panel {
    padding: 16px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: var(--shadow-subtle);
}
html .dashboard-page .history-panel .section-heading { padding: 0 4px; }
html .dashboard-page .history-panel .timeline {
    display: block;
    margin: 14px 0 10px;
    padding: 0;
}
html .dashboard-page .history-panel .timeline::before { display: none; }
html .dashboard-page .history-panel .timeline-item {
    min-height: 78px;
    margin-bottom: 7px;
    padding: 10px 9px 10px 42px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-subtle);
    transition: background-color .16s ease, border-color .16s ease;
}
html .dashboard-page .history-panel .timeline-item:hover,
html .dashboard-page .history-panel .timeline-item:focus-visible {
    background: var(--surface-hover);
    border-color: #36434e;
}
html .dashboard-page .history-panel .timeline-icon {
    top: 11px;
    left: 10px;
    box-shadow: 0 0 0 3px var(--surface-secondary);
}
html .dashboard-page .timeline-item p,
html .dashboard-page .timeline-detail { color: #8d99a5; }
html .dashboard-page .timeline-detail > b:not(.positive):not(.negative) { color: #c3cbd3; }
html .dashboard-page .history-panel > .btn-outline-soft {
    --bs-btn-color: #d5dce3;
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: #30404d;
    --bs-btn-hover-color: #f1f5f9;
    --bs-btn-hover-bg: #121a21;
    --bs-btn-hover-border-color: #3d5364;
}

html .dashboard-page .instances-strip.compact-instances {
    height: 146px;
    max-height: 146px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
html .dashboard-page.backtest-v2-page .instances-strip.compact-instances.replay-v2-config-strip {
    height: auto;
    min-height: 66px;
    max-height: none;
    padding-top: 12px;
}
html .dashboard-page .compact-instances .instance-mini {
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: var(--shadow-subtle);
}
html .dashboard-page .compact-instances .instance-mini + .instance-mini {
    padding-left: 12px;
    border-left: 1px solid var(--border);
}
html .dashboard-page .compact-instances .instance-mini:hover { background: var(--surface-hover); }
html .dashboard-page .instance-config-metric {
    background: #0d1318;
    border-color: #232e38;
}
html .dashboard-page .instance-config-metric small,
html .dashboard-page .instance-config-metric em,
html .dashboard-page .instance-kpi small,
html .dashboard-page .instance-efficiency-values em { color: #8e99a5; }
html .dashboard-page .instance-config-metric b,
html .dashboard-page .instance-kpi strong { color: var(--text-primary); }

@media (max-width: 1199px) {
    html .dashboard-page .dashboard-grid { grid-template-columns: 1fr; }
    html .dashboard-page .history-panel { border: 1px solid var(--border); }
}
@media (max-width: 767px) {
    html .dashboard-page .signals-metrics { padding-right: 0; }
    html .dashboard-page .signals-metric { margin-bottom: 9px; }
    html .dashboard-page .signals-quick-actions { width: 100%; height: 44px; grid-template-columns: repeat(3, 1fr); margin-top: 9px; }
    html .dashboard-page .instances-strip.compact-instances { height: auto; max-height: none; }
}

/* Lisibilité : les informations secondaires restent discrètes, mais ne passent plus sous 9 px. */
html { --muted: var(--dark-text-secondary); }
body { line-height: 1.4; }
.signals-kicker,
.signals-event-bottom,
.signals-bank-bottom,
.signals-profit-target-head,
.chart-market-stats > div > span,
.instance-stats small,
.instance-kpi small,
.timeline-item time,
.timeline-detail,
.fleet-datum span,
.fleet-config-summary span,
.backtest-analysis-kpi span,
.backtest-analysis-kpi small,
.backtest-detail-grid span,
.backtest-detail-grid small,
.backtest-annual-table th,
.backtest-performance-source,
.backtest-data-gap-warning,
.replay-v2-timeline-controls time {
    font-size: 9px;
}

.signals-event-bottom,
.signals-bank-bottom,
.signals-profit-target-meta,
.timeline-item p,
.timeline-detail,
.backtest-executed-line,
.backtest-benchmark-note,
.backtest-realized-note,
.replay-v2-buffer {
    color: var(--muted);
}

.signals-profit-title small,
.chart-market-stats strong,
.instance-stats strong,
.instance-kpi strong,
.timeline-heading > strong,
.fleet-metric > strong {
    font-weight: 650;
}

.signals-profit-title small { font-size: 9px; }
.signals-bank-top > strong { font-size: 11px; }
.signals-bank-bottom small,
.signals-profit-target-head small,
.signals-profit-positions strong > span:not(.odometer-number),
.signals-profit-positions .odometer-suffix,
.chart-market-stats strong small,
.instance-kpi strong span,
.instance-efficiency-values em { font-size: 9px; }
.signals-profit-target-meta { font-size: 9px; }
.chart-market-stats > div > span { color: var(--muted); }
.chart-market-stats strong { font-size: 11px; }
.chart-market-stats strong small { font-weight: 600; }
.chart-tool { font-size: 10px; }
.chart-live-status { font-size: 9px !important; }
.chart-exchange-mark { font-size: 9px; color: #8495a2; }
.chart-order-tooltip,
.backtest-trade-tooltip,
.backtest-performance-tooltip { font-size: 10px; }
.state { font-size: 11px; }
.instance-mode { font-size: 9px; }
.instance-kpi small { color: var(--muted); }
.timeline-heading > strong { font-size: 12px; }
.timeline-item time { color: var(--muted); }
.timeline-item p { font-size: 10px; }
.timeline-detail { font-size: 9px; }
.dashboard-page .signals-kicker,
.dashboard-page .panel-label,
.dashboard-page .chart-market-stats > div > span,
.dashboard-page .instance-kpi small { color: var(--muted); }
.dashboard-page:not(.backtest-v2-page) .chart-identity-copy > small { color: #96a6b1; font-size: 8px; }
.signals-profit-positions > i { font-size: 9px; }

@media (max-width: 767px) {
    .compact-instances .instance-mini {
        min-width: min(430px, calc(100vw - 72px));
        flex-basis: min(430px, calc(100vw - 72px));
    }
    .instance-config-metric { padding-inline: 4px; }
    .instance-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(120px, 1.5fr); }
}

/* Mesure : le tracé doit rester visible au-dessus des bougies et de l'en-tête. */
.chart-measure-layer { z-index: 9; overflow: visible; }
.measure-dot {
    width: 13px;
    height: 13px;
    background: var(--orange);
    border: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(255,151,0,.24), 0 0 14px rgba(255,151,0,.8);
}
.measure-line {
    height: 3px;
    background: var(--orange);
    border-radius: 999px;
    box-shadow: 0 0 0 1px #000, 0 0 14px rgba(255,151,0,.85);
}
.chart-measure-result {
    z-index: 10;
    top: 94px;
    right: 14px;
    min-width: 210px;
    color: #fff;
    background: #000;
    border: 1px solid var(--orange);
    box-shadow: 0 0 0 2px rgba(255,151,0,.12), 0 10px 26px rgba(0,0,0,.8), 0 0 16px rgba(255,151,0,.22);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}
.bitkub-test-results {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(4, 10, 16, .45);
}
.bitkub-test-results > strong { display: block; margin-bottom: 6px; }
.bitkub-test-results > strong.is-ok { color: var(--green); }
.bitkub-test-results > strong.is-error { color: var(--danger); }
.bitkub-test-results > p { margin: 0 0 9px; color: var(--text); font-size: 12px; }
.bitkub-test-results ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.bitkub-test-results li { display: flex; align-items: flex-start; gap: 8px; }
.bitkub-test-results li > i { margin-top: 1px; }
.bitkub-test-results li > span { display: grid; line-height: 1.25; }
.bitkub-test-results li b { color: var(--text); font-size: 11px; }
.bitkub-test-results li small { color: var(--muted); font-size: 10px; }
.bitkub-test-results li.is-ok > i { color: var(--green); }
.bitkub-test-results li.is-error > i { color: var(--danger); }
.bitkub-test-results li.is-warning > i { color: var(--orange); }
.connector-dashboard-card { margin-top: 12px; }
.connector-dashboard-card .section-heading { margin-bottom: 8px; }
.connector-dashboard-copy { color: var(--muted); max-width: 760px; }
.connector-pair-code, .connector-status-card, .danger-zone { margin-bottom: 14px; }
.pair-code-value { margin: 18px 0; font-size: clamp(30px, 7vw, 52px); letter-spacing: .18em; text-align: center; }
.pair-code-value code { color: var(--green); }
.connector-pair-code pre { overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #06141e; }
.connector-rename-form { max-width: 520px; }
.danger-zone { border-color: rgba(255, 93, 108, .35); }
.login-shell { width: min(1360px, 100%); padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.login-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr); gap: clamp(64px, 8vw, 116px); align-items: center; }
.login-visual { position: relative; display: flex; min-height: 680px; flex-direction: column; align-items: center; justify-content: center; overflow: visible; padding: 18px 0; text-align: center; }
.login-visual img { position: relative; z-index: 1; width: min(550px, 92%); max-height: 410px; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .52)); }
.login-visual-glow { position: relative; z-index: 0; display: block; width: min(320px, 58%); height: 24px; margin: -7px auto 2px; border-radius: 999px; background: rgba(255, 120, 0, .18); filter: blur(24px); }
.login-visual .eyebrow { position: relative; z-index: 1; margin-top: 10px; color: var(--orange); font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.login-visual h1 { position: relative; z-index: 1; margin: 10px 0 10px; color: #f4f4f4; font-size: clamp(38px, 3.2vw, 48px); font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.login-visual p { position: relative; z-index: 1; max-width: 520px; margin: 0; color: #9ca3af; font-size: 15px; line-height: 1.6; }
.login-panel { width: min(100%, 540px); align-self: center; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.login-panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 52px; padding: 0; border-bottom: 0; }
.login-panel-head div { display: flex; flex-direction: column; }
.login-panel-head .brand-mark img { width: 40px; height: 40px; object-fit: contain; }
.login-panel-head strong { color: #f5f5f5; font-size: 27px; font-weight: 700; }
.login-panel-head small { color: #8b93a1; font-size: 14px; }
.login-panel-body { padding: 0; }
.login-copy h2 { margin: 0; color: #f5f5f5; font-size: 31px; font-weight: 700; letter-spacing: -.02em; }
.login-copy p { margin: 8px 0 36px; color: #8b93a1; font-size: 15px; }
.login-field { margin-bottom: 23px; }
.login-field .form-label { margin-bottom: 10px; color: #cbd0d8; font-size: 14px; font-weight: 600; }
.login-field .input-icon { position: relative; }
.login-field .input-icon > i { position: absolute; top: 50%; left: 13px; z-index: 2; color: #71869a; transform: translateY(-50%); pointer-events: none; }
.login-field .form-control { min-height: 62px; padding-left: 54px; padding-right: 52px; border: 1px solid #222933; border-radius: 10px; background: #07090c; color: #f4f4f4; font-size: 15px; }
.login-field .form-control:focus { border-color: rgba(255, 140, 0, .65); box-shadow: 0 0 0 3px rgba(255, 140, 0, .08); }
.login-password-toggle { position: absolute; top: 50%; right: 7px; width: 34px; height: 34px; transform: translateY(-50%); border: 0; border-radius: 8px; color: #8193a5; background: transparent; }
.login-password-toggle:hover { color: var(--orange); background: rgba(255, 151, 0, .08); }
.login-submit { width: 100%; min-height: 66px; margin-top: 7px; border: 0; border-radius: 10px; color: #080808; background: linear-gradient(90deg, #ff8a00 0%, #ff7800 100%); box-shadow: 0 14px 35px rgba(255, 115, 0, .18), 0 4px 12px rgba(255, 115, 0, .16); font-size: 17px; font-weight: 700; transition: 180ms ease; }
.login-submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.login-submit:active { transform: translateY(0); }
.login-foot { margin-top: 46px; padding: 0; color: #8b93a1; text-align: center; font-size: 13px; }
@media (max-width: 1100px) { .login-page { padding-inline: 32px; } .login-grid { gap: 48px; } .login-visual img { width: min(440px, 92%); max-height: 350px; } .login-visual h1 { font-size: 40px; } }
@media (max-width: 820px) { .login-page { padding: 24px; } .login-grid { grid-template-columns: 1fr; gap: 36px; } .login-visual { min-height: 360px; padding: 18px; } .login-visual img { width: min(400px, 80%); max-height: 280px; } .login-visual h1 { font-size: 36px; } .login-panel { width: min(100%, 540px); } .login-panel-head { margin-bottom: 38px; } }
@media (max-width: 767px) { .login-page { padding: 24px; } .login-shell { width: 100%; } .login-visual { display: none; } .login-grid { display: block; } .login-panel { width: 100%; max-width: 460px; margin: 0 auto; } .login-panel-head { margin-bottom: 42px; } .login-copy h2 { font-size: 29px; } }
@media (max-width: 767px) {
    .chart-measure-result { top: 150px; right: 10px; min-width: 0; max-width: calc(100% - 20px); }
}

/* Dashboard NuxGrid — finition terminal noire et proportions de référence. */
html body.dashboard-page {
    --dashboard-bg: #000;
    --dashboard-surface: #050709;
    --dashboard-surface-secondary: #080b0f;
    --dashboard-surface-hover: #0b0f14;
    --dashboard-border: #1c232b;
    --dashboard-border-soft: #141a20;
    --dashboard-text: #f4f4f5;
    --dashboard-secondary: #a0a7b2;
    --dashboard-muted: #69727f;
    --dashboard-orange: #ff8700;
    --dashboard-orange-hover: #ff9800;
    --dashboard-green: #20d98b;
    --dashboard-red: #ff4d4f;
    color: var(--dashboard-text);
    background: var(--dashboard-bg);
}

html body.dashboard-page,
html body.dashboard-page .app-shell,
html body.dashboard-page .app-main {
    background: var(--dashboard-bg);
}

html body.dashboard-page .app-main {
    padding: 16px 20px 20px;
}

html body.dashboard-page .panel,
html body.dashboard-page .signals-metric,
html body.dashboard-page .chart-panel,
html body.dashboard-page .history-panel,
html body.dashboard-page .connector-dashboard-card {
    background: var(--dashboard-surface);
    border: 1px solid var(--dashboard-border);
    border-radius: 10px;
    box-shadow: none;
}

/* Ligne des indicateurs. */
html body.dashboard-page .signals-metrics {
    min-height: 126px;
    margin-bottom: 16px;
    padding: 0 124px 0 0;
    overflow: visible;
    background: transparent;
    border: 0;
}

html body.dashboard-page .signals-metrics-scroll {
    display: grid;
    grid-template-columns: minmax(0, .87fr) minmax(0, 1.03fr) minmax(0, 1fr);
    gap: 12px;
    height: 126px;
}

html body.dashboard-page .signals-separator { display: none; }

html body.dashboard-page .signals-metric {
    width: auto;
    min-width: 0;
    min-height: 126px;
    height: 126px;
    padding: 16px 20px;
    border-color: var(--dashboard-border);
    border-radius: 10px;
    box-shadow: none;
}

html body.dashboard-page .signals-event,
html body.dashboard-page .signals-bank,
html body.dashboard-page .signals-profit {
    grid-template-rows: auto auto 5px auto;
    align-content: center;
    gap: 8px;
}

html body.dashboard-page .signals-kicker,
html body.dashboard-page .signals-profit-title small {
    color: var(--dashboard-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
}

html body.dashboard-page .signals-event-top i,
html body.dashboard-page .signals-bank-heading i {
    color: var(--dashboard-secondary);
    font-size: 16px;
}

html body.dashboard-page .signals-event > strong,
html body.dashboard-page .signals-bank-top > span b,
html body.dashboard-page .signals-profit-value {
    color: var(--dashboard-text);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.02em;
}

html body.dashboard-page .signals-bank-top > strong,
html body.dashboard-page .signals-bank-top > strong small,
html body.dashboard-page .signals-event-bottom,
html body.dashboard-page .signals-event-bottom b,
html body.dashboard-page .signals-bank-bottom,
html body.dashboard-page .signals-bank-bottom small,
html body.dashboard-page .signals-profit-target-empty,
html body.dashboard-page .signals-profit-target-meta {
    color: var(--dashboard-secondary);
    font-size: 11px;
}

html body.dashboard-page .signals-progress {
    height: 4px;
    background: #171d23;
}

html body.dashboard-page .signals-profit-title i,
html body.dashboard-page .signals-bank-bottom i { color: var(--dashboard-green); }
html body.dashboard-page .signals-bank-bottom i { color: var(--dashboard-orange); }
html body.dashboard-page .signals-profit-value small { color: var(--dashboard-secondary); font-size: 11px; }

html body.dashboard-page .signals-quick-actions {
    right: 0;
    width: 112px;
    height: 50px;
    display: flex;
    gap: 12px;
    padding: 0;
    background: transparent;
    border: 0;
}

html body.dashboard-page .signals-quick-actions a,
html body.dashboard-page .signals-quick-actions button {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    color: var(--dashboard-text);
    background: var(--dashboard-surface);
    border: 1px solid #252d36;
    border-radius: 8px;
    box-shadow: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

html body.dashboard-page .signals-quick-actions button {
    border-color: rgba(255, 135, 0, .55);
    background: rgba(255, 135, 0, .025);
}

html body.dashboard-page .signals-quick-actions a:hover,
html body.dashboard-page .signals-quick-actions a:focus-visible,
html body.dashboard-page .signals-quick-actions button:hover,
html body.dashboard-page .signals-quick-actions button:focus-visible {
    color: var(--dashboard-orange);
    background: var(--dashboard-surface-hover);
    border-color: var(--dashboard-orange);
}

/* Colonne graphique / historique. */
html body.dashboard-page .dashboard-grid {
    --dashboard-chart-height: clamp(500px, 65vh, 620px);
    --dashboard-connector-height: 150px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 22%);
    gap: 16px;
    align-items: stretch;
}

html body.dashboard-page .dashboard-primary { gap: 12px; }

html body.dashboard-page .chart-panel {
    min-height: 0;
    height: var(--dashboard-chart-height);
    padding: 0;
    overflow: hidden;
    border-color: var(--dashboard-border);
    background: #020405;
}

html body.dashboard-page .chart-stage,
html body.dashboard-page .btc-chart {
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #020405;
}

html body.dashboard-page .chart-overlay-top {
    top: 0;
    right: 0;
    left: 0;
    height: 88px;
    min-height: 88px;
    padding: 11px 18px 10px 72px;
    background: linear-gradient(180deg, rgba(5, 7, 9, .99) 0%, rgba(5, 7, 9, .94) 76%, rgba(5, 7, 9, 0) 100%);
    border-bottom: 1px solid var(--dashboard-border-soft);
}

html body.dashboard-page .chart-brand {
    top: 16px;
    left: 16px;
    width: 42px;
    height: 42px;
    border-radius: 0;
}

html body.dashboard-page .chart-brand img,
html body.dashboard-page .chart-brand:hover img {
    transform: none;
    filter: none;
}

html body.dashboard-page .chart-toolbar {
    grid-template-columns: minmax(210px, 1fr) minmax(430px, 1.8fr);
    gap: 16px;
    height: 100%;
}

html body.dashboard-page .chart-identity {
    min-height: 60px;
    align-items: center;
    transform: none;
}

html body.dashboard-page .chart-identity h2 {
    margin: 0;
    color: var(--dashboard-text);
    font-size: 22px;
    font-weight: 700;
}

html body.dashboard-page .chart-identity-copy > small {
    margin-top: 4px;
    color: #9299a4;
    font-size: 11px;
}

html body.dashboard-page .chart-live-status.degraded,
html body.dashboard-page .chart-live-status.pending { color: var(--dashboard-orange) !important; }

html body.dashboard-page .chart-market-stats {
    grid-template-columns: minmax(160px, 1.2fr) minmax(140px, 1fr) minmax(120px, .72fr);
    gap: 0;
    padding: 0;
    border: 0;
}

html body.dashboard-page .chart-price-focus > div {
    min-width: 0;
    padding: 0 18px;
    border-left: 1px solid var(--dashboard-border-soft);
}

html body.dashboard-page .chart-price-focus > div:first-child {
    padding-left: 16px;
    border-left: 0;
}

html body.dashboard-page .chart-price-focus > div > span {
    margin-bottom: 4px;
    color: #969da7;
    font-size: 11px;
}

html body.dashboard-page .chart-price-focus strong,
html body.dashboard-page .chart-price-focus-main strong,
html body.dashboard-page .chart-price-focus .chart-usd-price {
    color: var(--dashboard-text);
    font-size: 23px;
    font-weight: 700;
}

html body.dashboard-page .chart-price-focus strong small { color: var(--dashboard-secondary); font-size: 10px; }
html body.dashboard-page .chart-price-focus-change strong { color: var(--dashboard-green); font-size: 18px; }
html body.dashboard-page .chart-price-focus-change strong.negative { color: var(--dashboard-red); }

html body.dashboard-page .chart-floating-legend {
    left: 18px;
    bottom: 30px;
    padding: 4px 7px;
    color: #a0a7b2;
    background: rgba(5, 7, 9, .78);
    border: 1px solid var(--dashboard-border-soft);
    border-radius: 5px;
    backdrop-filter: none;
}

html body.dashboard-page .chart-floating-controls .chart-tool {
    color: var(--dashboard-secondary);
    background: rgba(5, 7, 9, .84);
    border-color: var(--dashboard-border);
    box-shadow: none;
}

/* Historique : même surface que le graphique, avec état vide réellement centré. */
html body.dashboard-page .history-panel {
    min-height: calc(var(--dashboard-chart-height) + 12px + var(--dashboard-connector-height));
    height: auto;
    padding: 18px 16px 16px;
    border-color: var(--dashboard-border);
    background: var(--dashboard-surface);
}

html body.dashboard-page .history-panel .section-heading { padding: 0; }
html body.dashboard-page .history-panel .panel-label { color: #8e96a1; }
html body.dashboard-page .history-panel .section-heading h2 { color: var(--dashboard-text); font-size: 19px; }
html body.dashboard-page .history-panel > .section-heading > i { color: #768390; font-size: 22px; }

html body.dashboard-page .history-panel .timeline {
    min-height: 0;
    margin: 16px 0;
    padding: 0;
}

html body.dashboard-page .history-panel .timeline:has(.empty-state) {
    display: flex;
    align-items: center;
    justify-content: center;
}

html body.dashboard-page .history-panel .empty-state {
    min-height: 0;
    gap: 8px;
    color: var(--dashboard-muted);
}

html body.dashboard-page .history-panel .empty-state > i {
    color: #426078;
    font-size: 40px;
}

html body.dashboard-page .history-panel .empty-state strong {
    color: #f0f0f0;
    font-size: 16px;
}

html body.dashboard-page .history-panel .empty-state span {
    color: #89919c;
    font-size: 12px;
}

html body.dashboard-page .history-panel > .btn-outline-soft {
    min-height: 42px;
    color: var(--dashboard-orange-hover);
    background: transparent;
    border: 1px solid rgba(255, 135, 0, .4);
    border-radius: 8px;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

html body.dashboard-page .history-panel > .btn-outline-soft:hover,
html body.dashboard-page .history-panel > .btn-outline-soft:focus-visible {
    color: var(--dashboard-orange-hover);
    background: rgba(255, 135, 0, .07);
    border-color: var(--dashboard-orange);
}

/* Connecteur directement sous le graphique, sans zone vide artificielle. */
html body.dashboard-page .connector-dashboard-card {
    position: relative;
    min-height: var(--dashboard-connector-height);
    height: auto;
    margin: 0;
    padding: 16px;
    overflow: hidden;
}

html body.dashboard-page .connector-dashboard-card .section-heading {
    margin: 0 0 5px;
}

html body.dashboard-page .connector-dashboard-card .panel-label {
    margin-bottom: 4px;
    color: #8e96a1;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
}

html body.dashboard-page .connector-dashboard-card h2 {
    color: var(--dashboard-text);
    font-size: 18px;
    font-weight: 700;
}

html body.dashboard-page .connector-dashboard-card .metric-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
    color: var(--dashboard-orange);
    background: rgba(255, 135, 0, .07);
    border: 1px solid rgba(255, 135, 0, .35);
    border-radius: 10px;
    font-size: 22px;
}

html body.dashboard-page .connector-dashboard-card.is-connected .metric-icon {
    color: var(--dashboard-green);
    background: rgba(32, 217, 139, .07);
    border-color: rgba(32, 217, 139, .3);
}

html body.dashboard-page .connector-dashboard-copy {
    max-width: min(78%, 780px);
    margin: 6px 0 10px;
    color: var(--dashboard-secondary);
    font-size: 13px;
    line-height: 1.45;
}

html body.dashboard-page .connector-dashboard-card .btn-accent {
    min-height: 40px;
    padding: 0 18px;
    color: #050505;
    background: var(--dashboard-orange);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(255, 125, 0, .14);
    font-size: 13px;
    font-weight: 700;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, color 160ms ease;
}

html body.dashboard-page .connector-dashboard-card .btn-accent:hover,
html body.dashboard-page .connector-dashboard-card .btn-accent:focus-visible {
    color: #050505;
    background: var(--dashboard-orange-hover);
    transform: translateY(-1px);
}

html body.dashboard-page :is(button, a, input, select):focus-visible {
    outline: 2px solid rgba(255, 135, 0, .7);
    outline-offset: 2px;
}

@media (max-width: 1199px) {
    html body.dashboard-page .dashboard-grid {
        grid-template-columns: 1fr;
    }

    html body.dashboard-page .history-panel {
        min-height: 430px;
    }
}

@media (max-width: 767px) {
    html body.dashboard-page .app-main { padding: 12px; }
    html body.dashboard-page .signals-metrics { padding: 0; }
    html body.dashboard-page .signals-metrics-scroll {
        display: grid;
        grid-template-columns: 1fr;
        height: auto;
    }
    html body.dashboard-page .signals-metric {
        height: auto;
        min-height: 112px;
    }
    html body.dashboard-page .signals-quick-actions {
        position: static;
        width: 100%;
        height: 50px;
        margin-top: 12px;
        justify-content: flex-end;
        transform: none;
    }
    html body.dashboard-page .dashboard-grid { gap: 12px; }
    html body.dashboard-page .chart-panel {
        height: 540px;
    }
    html body.dashboard-page .chart-overlay-top {
        height: 112px;
        min-height: 112px;
        padding-left: 62px;
    }
    html body.dashboard-page .chart-toolbar {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    html body.dashboard-page .chart-identity { min-height: 48px; }
    html body.dashboard-page .chart-market-stats {
        min-height: 44px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    html body.dashboard-page .chart-price-focus > div { padding-inline: 8px; }
    html body.dashboard-page .chart-price-focus strong,
    html body.dashboard-page .chart-price-focus-main strong,
    html body.dashboard-page .chart-price-focus .chart-usd-price { font-size: 17px; }
    html body.dashboard-page .connector-dashboard-card {
        height: auto;
        min-height: 165px;
    }
    html body.dashboard-page .connector-dashboard-copy { max-width: 100%; }
    html body.dashboard-page .history-panel { min-height: 420px; }
}

/* Connecteur — carte horizontale compacte. */
html body.dashboard-page .connector-dashboard-card {
    min-height: 150px;
    height: auto;
    padding: 16px 24px;
}

html body.dashboard-page .connector-dashboard-layout {
    min-height: 108px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
}

html body.dashboard-page .connector-dashboard-main {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
}

html body.dashboard-page .connector-dashboard-main .section-heading {
    margin: 0;
}

html body.dashboard-page .connector-dashboard-main .panel-label {
    margin-bottom: 3px;
    color: #929aa5;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
}

html body.dashboard-page .connector-dashboard-main h2 {
    color: #f4f4f5;
    font-size: 18px;
    font-weight: 700;
}

html body.dashboard-page .connector-dashboard-copy {
    max-width: min(820px, 100%);
    margin: 4px 0 8px;
    color: #a0a7b2;
    font-size: 13px;
    line-height: 1.45;
}

html body.dashboard-page .connector-dashboard-action {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 22px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    transition: filter 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease, color 160ms ease;
}

html body.dashboard-page .connector-dashboard-action .connector-dashboard-arrow {
    margin-left: 8px;
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
}

html body.dashboard-page .connector-dashboard-card.is-missing .connector-dashboard-action {
    color: #050505;
    background: linear-gradient(90deg, #ff8a00 0%, #ff9f1a 100%);
    border: 0;
    box-shadow: 0 10px 28px rgba(255, 130, 0, .16);
}

html body.dashboard-page .connector-dashboard-card.is-missing .connector-dashboard-action:hover,
html body.dashboard-page .connector-dashboard-card.is-missing .connector-dashboard-action:focus-visible {
    color: #050505;
    filter: brightness(1.05);
    transform: translateY(-1px);
}

html body.dashboard-page .connector-dashboard-card.is-connected .connector-dashboard-action {
    color: #cbd3da;
    background: transparent;
    border-color: #252d36;
}

html body.dashboard-page .connector-dashboard-card.is-connected .connector-dashboard-action:hover,
html body.dashboard-page .connector-dashboard-card.is-connected .connector-dashboard-action:focus-visible {
    color: var(--dashboard-orange-hover);
    background: var(--dashboard-surface-hover);
    border-color: var(--dashboard-orange);
    transform: translateY(-1px);
}

html body.dashboard-page .connector-dashboard-status {
    min-width: 285px;
    display: flex;
    align-items: center;
    gap: 22px;
    padding-left: 22px;
    border-left: 1px solid var(--dashboard-border);
}

html body.dashboard-page .connector-dashboard-status .metric-icon {
    position: static;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    color: var(--dashboard-orange);
    background: rgba(255, 135, 0, .07);
    border: 1px solid rgba(255, 135, 0, .45);
    border-radius: 10px;
    font-size: 24px;
}

html body.dashboard-page .connector-dashboard-card.is-connected .connector-dashboard-status .metric-icon {
    color: var(--dashboard-green);
    background: rgba(32, 217, 139, .07);
    border-color: rgba(32, 217, 139, .35);
}

html body.dashboard-page .connector-dashboard-status-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

html body.dashboard-page .connector-dashboard-status-copy strong {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #f4f4f5;
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
}

html body.dashboard-page .connector-dashboard-status-copy > span {
    color: #89919c;
    font-size: 13px;
    white-space: nowrap;
}

html body.dashboard-page .connector-dashboard-status-dot {
    width: 9px;
    height: 9px;
    display: inline-block;
    flex: 0 0 9px;
    background: var(--dashboard-orange);
    border-radius: 50%;
}

html body.dashboard-page .connector-dashboard-card.is-connected .connector-dashboard-status-dot {
    background: var(--dashboard-green);
}

@media (max-width: 767px) {
    html body.dashboard-page .connector-dashboard-card {
        min-height: 0;
        padding: 20px;
    }

    html body.dashboard-page .connector-dashboard-layout {
        min-height: 0;
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
    }

    html body.dashboard-page .connector-dashboard-status {
        min-width: 0;
        padding: 16px 0 0;
        border-top: 1px solid var(--dashboard-border);
        border-left: 0;
    }
}

/* Modal d’association du connecteur. */
html body.dashboard-page .modal-backdrop.show { opacity: .72; }

html body.dashboard-page .connector-pair-modal .modal-dialog {
    width: calc(100% - 24px);
    max-width: 520px;
    margin: 12px auto;
}

html body.dashboard-page .connector-pair-modal .modal-content {
    color: #f4f4f5;
    background: #050709;
    border: 1px solid #222933;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
}

html body.dashboard-page .connector-pair-content { padding: 28px; }

html body.dashboard-page .connector-pair-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 36px;
}

html body.dashboard-page .connector-pair-header .panel-label {
    margin: 4px 0 0;
    color: #ff9800;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
}

html body.dashboard-page .connector-pair-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    margin: -5px -6px 0 0;
    padding: 0;
    color: #a0a7b2;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 22px;
    transition: color 160ms ease, background-color 160ms ease;
}

html body.dashboard-page .connector-pair-close:hover,
html body.dashboard-page .connector-pair-close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .04);
}

html body.dashboard-page .connector-pair-form-state h2,
html body.dashboard-page .connector-pair-result-state h2 {
    margin: 7px 0 0;
    color: #f4f4f5;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.02em;
}

html body.dashboard-page .connector-pair-intro {
    max-width: 400px;
    margin: 12px 0 28px;
    color: #a0a7b2;
    font-size: 14px;
    line-height: 1.55;
}

html body.dashboard-page .connector-pair-field { margin-bottom: 18px; }

html body.dashboard-page .connector-pair-field .form-label {
    margin-bottom: 9px;
    color: #c7cbd1;
    font-size: 13px;
    font-weight: 500;
}

html body.dashboard-page .connector-pair-field .form-label i {
    margin-left: 4px;
    color: #8b939e;
}

html body.dashboard-page .connector-pair-input { position: relative; }

html body.dashboard-page .connector-pair-input > i {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 1;
    color: #ffad31;
    font-size: 18px;
    transform: translateY(-50%);
    pointer-events: none;
}

html body.dashboard-page .connector-pair-input .form-control {
    height: 52px;
    min-height: 52px;
    padding: 0 16px 0 48px;
    color: #f4f4f5;
    background: #07090c;
    border: 1px solid #2a333d;
    border-radius: 10px;
    font-size: 14px;
}

html body.dashboard-page .connector-pair-input .form-control:focus {
    color: #f4f4f5;
    background: #07090c;
    border-color: #ff8a00;
    box-shadow: 0 0 0 3px rgba(255, 138, 0, .08);
}

html body.dashboard-page .connector-pair-notice {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px 18px;
    background: #080b0f;
    border: 1px solid #1f2730;
    border-radius: 12px;
}

html body.dashboard-page .connector-pair-notice-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    flex: 0 0 56px;
    color: #ff9800;
    background: rgba(255, 138, 0, .07);
    border: 1px solid rgba(255, 138, 0, .25);
    border-radius: 12px;
    font-size: 26px;
}

html body.dashboard-page .connector-pair-notice strong {
    color: #f4f4f5;
    font-size: 15px;
    font-weight: 700;
}

html body.dashboard-page .connector-pair-notice p {
    margin: 5px 0 0;
    color: #a0a7b2;
    font-size: 13px;
    line-height: 1.45;
}

html body.dashboard-page .connector-pair-error {
    margin: -7px 0 14px;
    color: #ff5c5c;
    font-size: 13px;
    line-height: 1.45;
}

html body.dashboard-page .connector-pair-submit {
    width: 100%;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #050505;
    background: linear-gradient(90deg, #ff8a00 0%, #ff9f1a 100%);
    border: 0;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(255, 128, 0, .16);
    font-size: 15px;
    font-weight: 700;
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

html body.dashboard-page .connector-pair-submit:hover,
html body.dashboard-page .connector-pair-submit:focus-visible {
    color: #050505;
    filter: brightness(1.05);
    transform: translateY(-1px);
}

html body.dashboard-page .connector-pair-submit:active { transform: translateY(0); }
html body.dashboard-page .connector-pair-submit:disabled { cursor: wait; opacity: .72; }

html body.dashboard-page .connector-pair-arrow {
    margin-left: 3px;
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
}

html body.dashboard-page .connector-pair-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: #8b939e;
    font-size: 12px;
}

html body.dashboard-page .connector-pair-security i { color: #c18a39; }

html body.dashboard-page .connector-pair-code-value {
    margin-top: 24px;
    padding: 18px;
    text-align: center;
    background: #080b0f;
    border: 1px solid #2a333d;
    border-radius: 10px;
}

html body.dashboard-page .connector-pair-code-value code {
    color: #f4f4f5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .12em;
}

html body.dashboard-page .connector-pair-install-command {
    display: grid;
    gap: 10px;
    margin-top: 20px;
    padding: 14px;
    background: #07090c;
    border: 1px solid #1f2730;
    border-radius: 10px;
}

html body.dashboard-page .connector-pair-install-command code {
    display: block;
    overflow: auto;
    color: #c7cbd1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

html body.dashboard-page .connector-pair-command-copy,
html body.dashboard-page .connector-pair-regenerate {
    min-height: 38px;
    color: #c7cbd1;
    background: transparent;
    border: 1px solid #2a333d;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

html body.dashboard-page .connector-pair-command-copy:hover,
html body.dashboard-page .connector-pair-command-copy:focus-visible,
html body.dashboard-page .connector-pair-regenerate:hover,
html body.dashboard-page .connector-pair-regenerate:focus-visible {
    color: #ff9800;
    background: rgba(255, 135, 0, .06);
    border-color: rgba(255, 135, 0, .45);
}

html body.dashboard-page .connector-pair-command-copy:disabled,
html body.dashboard-page .connector-pair-regenerate:disabled {
    cursor: wait;
    opacity: .72;
}

html body.dashboard-page .connector-pair-code-label {
    margin-top: 22px;
    color: #a0a7b2;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

html body.dashboard-page .connector-pair-regenerate {
    width: 100%;
    margin-top: 12px;
}

html body.dashboard-page .connector-pair-copy,
html body.dashboard-page .connector-pair-done {
    width: 100%;
    min-height: 42px;
    margin-top: 14px;
    color: #f4f4f5;
    background: transparent;
    border: 1px solid #2a333d;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

html body.dashboard-page .connector-pair-copy:hover,
html body.dashboard-page .connector-pair-copy:focus-visible,
html body.dashboard-page .connector-pair-done:hover,
html body.dashboard-page .connector-pair-done:focus-visible {
    color: #ff9800;
    background: rgba(255, 135, 0, .06);
    border-color: rgba(255, 135, 0, .45);
}

html body.dashboard-page .connector-pair-expiry {
    margin: 12px 0 0;
    color: #8b939e;
    font-size: 12px;
    text-align: center;
}

html body.dashboard-page .connector-pair-install {
    margin-top: 18px;
    border-top: 1px solid #141a20;
}

html body.dashboard-page .connector-pair-install summary {
    padding-top: 13px;
    color: #a0a7b2;
    cursor: pointer;
    font-size: 12px;
}

html body.dashboard-page .connector-pair-install pre {
    margin: 10px 0 0;
    padding: 12px;
    overflow: auto;
    color: #c7cbd1;
    background: #07090c;
    border: 1px solid #1f2730;
    border-radius: 8px;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 767px) {
    html body.dashboard-page .connector-pair-content { padding: 20px; }
    html body.dashboard-page .connector-pair-notice { align-items: flex-start; padding: 14px; }
    html body.dashboard-page .connector-pair-notice p { max-width: none; }
}

/* Etat généré du modal connecteur : commande puis code mis en avant. */
html body.dashboard-page .connector-pair-result-state .connector-pair-intro {
    max-width: 440px;
    margin-bottom: 24px;
}

html body.dashboard-page .connector-pair-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    color: #cbd0d6;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

html body.dashboard-page .connector-pair-step span {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    flex: 0 0 20px;
    color: #ff9800;
    border: 1px solid #ff8a00;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
}

html body.dashboard-page .connector-pair-step-final span {
    color: #050505;
    background: #ff9800;
}

html body.dashboard-page .connector-pair-result-state .connector-pair-install-command {
    gap: 12px;
    margin-top: 0;
    padding: 16px;
    background: #080b0f;
    border-color: #252e38;
}

html body.dashboard-page .connector-pair-result-state .connector-pair-command-copy {
    justify-self: end;
    height: 36px;
    min-height: 36px;
    padding: 0 14px;
    background: #090c10;
    border-color: #343d47;
    border-radius: 7px;
}

html body.dashboard-page .connector-pair-divider {
    margin: 22px 0;
    border-top: 1px solid #171d23;
}

html body.dashboard-page .connector-pair-result-state .connector-pair-code-label {
    margin: 0 0 12px;
}

html body.dashboard-page .connector-pair-result-state .connector-pair-code-value {
    display: flex;
    min-height: 145px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 0;
    padding: 28px 20px 20px;
    background: #080b0f;
    border: 1px solid rgba(255, 138, 0, .75);
    box-shadow: inset 0 0 30px rgba(255, 138, 0, .025), 0 0 20px rgba(255, 138, 0, .025);
}

html body.dashboard-page .connector-pair-result-state .connector-pair-code-value code {
    color: #ff9800;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: .16em;
    line-height: 1.1;
}

html body.dashboard-page .connector-pair-result-state .connector-pair-expiry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: #9ca3ad;
    font-size: 12px;
}

html body.dashboard-page .connector-pair-result-state .connector-pair-copy {
    position: relative;
    width: 100%;
    height: 54px;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    padding: 0 50px;
    color: #050505;
    background: linear-gradient(90deg, #ff8a00 0%, #ff9f1a 100%);
    border: 0;
    border-radius: 9px;
    box-shadow: 0 12px 28px rgba(255, 128, 0, .16);
    font-size: 15px;
    font-weight: 700;
}

html body.dashboard-page .connector-pair-result-state .connector-pair-copy:hover,
html body.dashboard-page .connector-pair-result-state .connector-pair-copy:focus-visible {
    color: #050505;
    background: linear-gradient(90deg, #ff8a00 0%, #ff9f1a 100%);
    border-color: transparent;
    filter: brightness(1.05);
    transform: translateY(-1px);
}

html body.dashboard-page .connector-pair-result-state .connector-pair-copy:active { transform: translateY(0); }

html body.dashboard-page .connector-pair-result-state .connector-pair-copy .connector-pair-arrow {
    position: absolute;
    right: 20px;
    margin: 0;
}

html body.dashboard-page .connector-pair-connection-step {
    margin-top: 24px;
}

html body.dashboard-page .connector-pair-connection-status {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 150px;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #080b0f;
    border: 1px solid #1f2730;
    border-radius: 10px;
    transition: border-color 200ms ease, background-color 200ms ease;
}

html body.dashboard-page .connector-pair-connection-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #69727f;
    background: #0a0d11;
    border: 1px solid #343d47;
    border-radius: 8px;
    font-size: 20px;
    transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease;
}

html body.dashboard-page .connector-pair-connection-copy { min-width: 0; }
html body.dashboard-page .connector-pair-connection-copy strong { display: block; color: #c2c7ce; font-size: 14px; font-weight: 700; line-height: 1.3; transition: color 200ms ease; }
html body.dashboard-page .connector-pair-connection-copy p { margin: 4px 0 0; color: #8b939e; font-size: 12px; line-height: 1.45; transition: color 200ms ease; }
html body.dashboard-page .connector-pair-connection-wave { width: 150px; height: 40px; overflow: visible; }
html body.dashboard-page .connector-pair-connection-wave path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
html body.dashboard-page .connector-pair-connection-wave-pending { stroke: #69727f; }
html body.dashboard-page .connector-pair-connection-wave-active { display: none; stroke: #20d98b; stroke-dasharray: 88 18; animation: connector-pair-wave-flow 1.8s linear infinite; }
html body.dashboard-page .connector-pair-connection-wave-dot { fill: #69727f; transition: fill 200ms ease; }

html body.dashboard-page .connector-pair-connection-status.is-active {
    background: rgba(32, 217, 139, .025);
    border-color: rgba(32, 217, 139, .28);
}

html body.dashboard-page .connector-pair-connection-status.is-active .connector-pair-connection-icon {
    color: #20d98b;
    background: rgba(32, 217, 139, .06);
    border-color: rgba(32, 217, 139, .35);
}

html body.dashboard-page .connector-pair-connection-status.is-active .connector-pair-connection-copy strong { color: #20d98b; }
html body.dashboard-page .connector-pair-connection-status.is-active .connector-pair-connection-copy p { color: #a0a7b2; }
html body.dashboard-page .connector-pair-connection-status.is-active .connector-pair-connection-wave-pending { display: none; }
html body.dashboard-page .connector-pair-connection-status.is-active .connector-pair-connection-wave-active { display: block; }
html body.dashboard-page .connector-pair-connection-status.is-active .connector-pair-connection-wave-dot { fill: #20d98b; }

@keyframes connector-pair-wave-flow {
    from { stroke-dashoffset: 106; }
    to { stroke-dashoffset: 0; }
}

html body.dashboard-page .connector-pair-result-state .connector-pair-regenerate {
    width: auto;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 18px auto 0;
    padding: 0;
    color: #a0a7b2;
    background: transparent;
    border: 0;
    font-size: 13px;
    font-weight: 500;
}

html body.dashboard-page .connector-pair-result-state .connector-pair-regenerate:hover,
html body.dashboard-page .connector-pair-result-state .connector-pair-regenerate:focus-visible {
    color: #ff9800;
    background: transparent;
    border-color: transparent;
}

html body.dashboard-page .connector-pair-result-state .connector-pair-error {
    margin: 12px 0 0;
}

html body.dashboard-page .connector-pair-success-state {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 18px 0 4px;
    text-align: center;
}

html body.dashboard-page .connector-pair-success-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 4px 0 18px;
    color: #050505;
    background: #42e6a4;
    border-radius: 50%;
    box-shadow: 0 10px 28px rgba(66, 230, 164, .18);
    font-size: 28px;
}

html body.dashboard-page .connector-pair-success-state h2 {
    margin-bottom: 10px;
}

html body.dashboard-page .connector-pair-success-state .connector-pair-intro {
    max-width: 390px;
    margin-bottom: 22px;
}

html body.dashboard-page .connector-pair-success-close {
    min-height: 44px;
    padding-inline: 24px;
    color: #050505;
    background: #42e6a4;
    border-color: #42e6a4;
    font-weight: 700;
}

html body.dashboard-page .connector-pair-success-close:hover,
html body.dashboard-page .connector-pair-success-close:focus-visible {
    color: #050505;
    background: #63efb5;
    border-color: #63efb5;
}

@media (max-width: 767px) {
    html body.dashboard-page .connector-pair-result-state .connector-pair-code-value code { font-size: 25px; }
    html body.dashboard-page .connector-pair-connection-status { grid-template-columns: 42px minmax(0, 1fr) 100px; padding-inline: 12px; }
    html body.dashboard-page .connector-pair-connection-wave { width: 100px; }
}

/* Raccourcis du dashboard : le compte reste neutre, les outils admin sont conditionnels. */
html body.dashboard-page .signals-quick-actions:not(.is-admin-tools) { width: 50px; }
html body.dashboard-page .signals-quick-actions.is-admin-tools { width: 174px; }
html body.dashboard-page .signals-quick-actions button {
    border-color: #252d36;
    background: var(--dashboard-surface);
}

@media (max-width: 767px) {
    html body.dashboard-page .signals-quick-actions,
    html body.dashboard-page .signals-quick-actions.is-admin-tools,
    html body.dashboard-page .signals-quick-actions:not(.is-admin-tools) { width: 100%; }
}

/* Raccourcis : deux colonnes compactes pour éviter le débordement dans les métriques. */
html body.dashboard-page .signals-quick-actions {
    width: 50px;
    height: 50px;
    display: grid;
    grid-template-columns: 50px;
    grid-template-rows: 50px;
    gap: 12px;
    align-content: center;
    justify-content: end;
}
html body.dashboard-page .signals-quick-actions.is-admin-tools {
    width: 112px;
    height: 112px;
    grid-template-columns: repeat(2, 50px);
    grid-template-rows: repeat(2, 50px);
}
html body.dashboard-page .signals-quick-actions.has-connector:not(.is-admin-tools) {
    width: 112px;
    grid-template-columns: repeat(2, 50px);
}
html body.dashboard-page .signals-quick-actions .quick-action-account { grid-column: 1; grid-row: 1; }
html body.dashboard-page .signals-quick-actions .quick-action-database { grid-column: 1; grid-row: 2; }
html body.dashboard-page .signals-quick-actions .quick-action-backtest { grid-column: 2; grid-row: 1; }
html body.dashboard-page .signals-quick-actions .quick-action-connector { grid-column: 2; grid-row: 2; }
html body.dashboard-page .signals-quick-actions.has-connector:not(.is-admin-tools) .quick-action-connector { grid-row: 1; }
html body.dashboard-page .signals-quick-actions .quick-action-connector.is-online { color: var(--dashboard-green); }
html body.dashboard-page .signals-quick-actions .quick-action-connector.is-offline { color: var(--dashboard-orange); }
html body.dashboard-page .signals-quick-actions .quick-action-connector.is-missing { color: var(--dashboard-orange); }
html body.dashboard-page .signals-quick-actions .quick-action-connector,
html body.dashboard-page .signals-quick-actions .quick-action-connector.is-online,
html body.dashboard-page .signals-quick-actions .quick-action-connector.is-offline,
html body.dashboard-page .signals-quick-actions .quick-action-connector.is-missing {
    color: var(--dashboard-text);
    background: var(--dashboard-surface);
    border-color: #252d36;
}
html body.dashboard-page .signals-quick-actions .quick-action-connector:hover,
html body.dashboard-page .signals-quick-actions .quick-action-connector:focus-visible {
    color: var(--dashboard-orange);
    border-color: var(--dashboard-orange);
}

html body.dashboard-page .chart-price-focus strong small { color: inherit; font-size: inherit; font-weight: inherit; }
html body.dashboard-page .history-panel > .history-panel-action {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 22px;
    color: #050505;
    background: linear-gradient(90deg, #ff8a00 0%, #ff9f1a 100%);
    border: 0;
    border-radius: 9px;
    box-shadow: 0 10px 28px rgba(255, 130, 0, .16);
    font-size: 14px;
    font-weight: 700;
    transition: filter 160ms ease, transform 160ms ease;
}
html body.dashboard-page .history-panel > .history-panel-action:hover,
html body.dashboard-page .history-panel > .history-panel-action:focus-visible {
    color: #050505;
    filter: brightness(1.05);
    transform: translateY(-1px);
}
html body.dashboard-page .history-panel > .history-panel-action:active { transform: translateY(0); }
html body.dashboard-page .history-panel-action .history-panel-arrow { margin-left: auto; font-size: 22px; font-weight: 500; line-height: 1; }

html body.dashboard-page .connector-info-modal .modal-dialog { max-width: 520px; }
html body.dashboard-page .connector-info-body { padding: 20px 24px 24px; }
html body.dashboard-page .connector-info-status { display: flex; align-items: center; gap: 14px; padding: 14px; background: rgba(9, 20, 30, .72); border: 1px solid var(--dashboard-border-soft); border-radius: 10px; }
html body.dashboard-page .connector-info-status .metric-icon { width: 44px; height: 44px; flex: 0 0 44px; }
html body.dashboard-page .connector-info-status strong,
html body.dashboard-page .connector-info-status span { display: block; }
html body.dashboard-page .connector-info-status strong { color: var(--dashboard-text); font-size: 16px; }
html body.dashboard-page .connector-info-status > div > span { margin-top: 3px; color: var(--dashboard-secondary); font-size: 11px; }
html body.dashboard-page .connector-info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 16px 0 20px; overflow: hidden; background: var(--dashboard-border-soft); border: 1px solid var(--dashboard-border-soft); border-radius: 9px; }
html body.dashboard-page .connector-info-list > div { min-width: 0; padding: 11px 13px; background: var(--dashboard-surface); }
html body.dashboard-page .connector-info-list dt { color: var(--dashboard-secondary); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
html body.dashboard-page .connector-info-list dd { margin: 4px 0 0; overflow: hidden; color: var(--dashboard-text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
html body.dashboard-page .connector-info-actions { display: flex; flex-wrap: wrap; gap: 9px; }
html body.dashboard-page .connector-info-actions form { margin: 0; }
html body.dashboard-page .connector-info-actions .btn { min-height: 40px; }
html body.dashboard-page .connector-info-note { display: flex; gap: 7px; margin: 14px 0 0; color: var(--dashboard-secondary); font-size: 10px; line-height: 1.45; }
html body.dashboard-page .connector-info-note i { color: var(--dashboard-orange); }

html body.dashboard-page .connector-info-credentials {
    margin: 0 0 20px;
    padding: 15px;
    background: rgba(8, 11, 15, .72);
    border: 1px solid var(--dashboard-border-soft);
    border-radius: 10px;
}
html body.dashboard-page .connector-info-credentials-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
html body.dashboard-page .connector-info-credentials-heading .panel-label { margin-bottom: 3px; }
html body.dashboard-page .connector-info-credentials-heading h3 { margin: 0; color: var(--dashboard-text); font-size: 14px; }
html body.dashboard-page .connector-info-credentials-help { margin: 8px 0 14px; color: var(--dashboard-secondary); font-size: 11px; line-height: 1.45; }
html body.dashboard-page .connector-info-credentials-form { gap: 12px; }
html body.dashboard-page .connector-info-credentials-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
html body.dashboard-page .connector-info-credentials-form .form-control { min-height: 38px; }
html body.dashboard-page .connector-info-password { grid-column: 1 / -1; }
html body.dashboard-page .connector-info-credentials-form > .btn { min-height: 40px; justify-self: flex-start; }

html body.dashboard-page .backtest-info-modal .modal-dialog { max-width: 390px; }
html body.dashboard-page .backtest-info-body { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 24px 26px; text-align: center; }
html body.dashboard-page .backtest-info-icon { width: 58px; height: 58px; display: grid; place-items: center; color: var(--dashboard-orange); background: rgba(255, 135, 0, .08); border: 1px solid rgba(255, 135, 0, .38); border-radius: 12px; font-size: 25px; }
html body.dashboard-page .backtest-info-body p { margin: 0; color: var(--dashboard-text); font-size: 13px; line-height: 1.5; }
html body.dashboard-page .backtest-info-note { color: var(--dashboard-secondary); font-size: 11px; line-height: 1.45; }

@media (max-width: 767px) {
    html body.dashboard-page .signals-quick-actions,
    html body.dashboard-page .signals-quick-actions.is-admin-tools,
    html body.dashboard-page .signals-quick-actions.has-connector:not(.is-admin-tools) {
        width: 100%;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
    }
    html body.dashboard-page .signals-quick-actions .quick-action-account,
    html body.dashboard-page .signals-quick-actions .quick-action-database,
    html body.dashboard-page .signals-quick-actions .quick-action-backtest,
    html body.dashboard-page .signals-quick-actions .quick-action-connector { grid-column: auto; grid-row: auto; }
    html body.dashboard-page .connector-info-body { padding: 18px; }
    html body.dashboard-page .connector-info-list { grid-template-columns: 1fr; }
    html body.dashboard-page .connector-info-credentials-grid { grid-template-columns: 1fr; }
    html body.dashboard-page .connector-info-password { grid-column: auto; }
}
