:root {
  --bg: #07111f;
  --panel: #0d1b2d;
  --panel-2: #10233a;
  --line: #223a55;
  --text: #edf6ff;
  --muted: #8ea5bd;
  --accent: #2dd4bf;
  --accent-dark: #0f766e;
  --blue: #4f8cff;
  --positive: #42d392;
  --negative: #ff6b7a;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 100%; min-height: 100%; background: var(--bg); }
body { width: 100%; margin: 0; color: var(--text); background: radial-gradient(circle at 20% 0%, #122b48 0, var(--bg) 34rem); min-height: 100vh; }
body.chart-fullscreen-open { overflow: hidden; }
button, input, select { font: inherit; }
.topbar { max-width: 1440px; margin: 0 auto; padding: 34px 28px 18px; display: flex; justify-content: space-between; align-items: center; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; letter-spacing: -0.03em; }
.eyebrow { margin-bottom: 7px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.container { max-width: 1440px; margin: 0 auto; padding: 16px 28px 70px; }
.card { background: linear-gradient(145deg, rgba(16,35,58,.97), rgba(11,25,43,.97)); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.toolbar { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.status-label { color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.status-text { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; margin-bottom: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.primary, .secondary, .ghost { border: 0; border-radius: 10px; padding: 11px 17px; cursor: pointer; text-decoration: none; font-weight: 750; transition: .18s ease; }
.primary { color: #03231f; background: var(--accent); }
.primary:hover { transform: translateY(-1px); background: #5eead4; }
.secondary { color: white; background: #235fb9; }
.ghost { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.disabled, button:disabled { opacity: .46; pointer-events: none; }
.section-block { margin-top: 30px; }
.section-heading { display: flex; align-items: baseline; gap: 12px; margin: 0 4px 12px; }
.section-heading span { color: var(--accent); font-weight: 850; font-size: 12px; }
.section-heading h2 { margin-bottom: 0; font-size: 20px; }
.section-heading p { margin: 0 0 0 auto; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
.summary-table table { min-width: 1120px; }
.compact-table table { min-width: 620px; }
th { padding: 13px 15px; text-align: right; color: #9fb5cc; font-size: 11px; letter-spacing: .03em; background: rgba(255,255,255,.025); border-bottom: 1px solid var(--line); }
td { padding: 13px 15px; text-align: right; border-bottom: 1px solid rgba(34,58,85,.64); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(79,140,255,.055); }
.summary-total-row td { border-top: 2px solid rgba(45,212,191,.5); border-bottom: 0; background: rgba(45,212,191,.075); font-weight: 850; }
.summary-total-row td:first-child { color: var(--accent); }
.summary-total-row .summary-total-empty { color: #587089; }
.account { font-weight: 750; color: #cfe5ff; }
.positive { color: var(--positive); font-weight: 750; }
.negative { color: var(--negative); font-weight: 750; }
.empty { text-align: center !important; color: var(--muted); }
.divider { margin: 34px 0 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line), var(--accent-dark), var(--line), transparent); }
.empty-state { margin-top: 30px; padding: 70px 24px; text-align: center; }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); border: 1px solid var(--line); font-size: 28px; }
.alert { padding: 10px 12px; border-radius: 9px; margin: 13px 0; font-size: 13px; }
.error { color: #ffc2c8; background: rgba(255,107,122,.11); border: 1px solid rgba(255,107,122,.28); }
.success { color: #b9ffe0; background: rgba(66,211,146,.1); border: 1px solid rgba(66,211,146,.3); }

.investment-upload { margin-bottom: 12px; padding: 16px 18px; display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: center; gap: 14px 24px; }
.investment-upload-copy { min-width: 0; }
.investment-upload-title { margin-bottom: 5px; color: #dcecff; font-size: 15px; font-weight: 800; }
.investment-upload-copy .small + .small { margin-top: 6px; }
.investment-upload-form { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.investment-download-button { white-space: nowrap; }
.investment-file-field { min-width: min(280px, 100%); display: grid; gap: 6px; color: #a9bdd0; font-size: 11px; font-weight: 750; }
.investment-file-field input { max-width: 320px; min-height: 42px; padding: 7px 9px; color: var(--text); color-scheme: dark; background: #071625; border: 1px solid var(--line); border-radius: 10px; }
.investment-file-field input::file-selector-button { margin-right: 10px; padding: 7px 10px; color: #dcecff; background: rgba(79,140,255,.16); border: 1px solid rgba(79,140,255,.35); border-radius: 7px; cursor: pointer; }
.investment-upload-message { grid-column: 1 / -1; margin: 0; }
.investment-detail-link { display: inline-block; color: inherit; text-decoration: none; font-weight: inherit; font-variant-numeric: tabular-nums; }
th .investment-detail-link { color: #b9fff4; font-weight: 850; }
a.investment-detail-link:hover { color: #5eead4; text-decoration: underline; text-underline-offset: 4px; }
.investment-detail-hero { padding: 25px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.investment-detail-hero h2 { margin-bottom: 9px; }
.investment-detail-hero .muted { margin-bottom: 0; line-height: 1.65; }
.investment-detail-price { margin-bottom: 7px; color: #dcecff; font-size: 14px; }
.investment-detail-price strong { color: #b9fff4; font-size: 18px; font-variant-numeric: tabular-nums; }
.investment-detail-section { margin-top: 30px; }
.investment-detail-table { overflow: auto; }
.investment-detail-table table { min-width: 900px; }
.investment-detail-table th { position: sticky; top: 0; z-index: 2; background: #10233a; white-space: nowrap; }
.investment-detail-table td { font-size: 14px; white-space: nowrap; }

.output-summary-copy { margin-bottom: 12px; padding: 15px 18px; }
.output-summary-copy p { margin-bottom: 5px; color: #dcecff; font-size: 13px; line-height: 1.65; }
.output-summary-copy p:last-child { margin-bottom: 0; color: var(--muted); }
.output-summary-copy strong { color: #b9fff4; }
.output-summary-table table { min-width: 760px; }
.output-summary-table th:not(:first-child), .output-summary-table td:not(:first-child) { width: 16.5%; }
.output-period-link, .output-value-link { display: inline-block; color: inherit; text-decoration: none; }
.output-period-link { padding: 4px 2px; color: #b9fff4; font-size: 13px; font-weight: 850; }
.output-value-link { padding: 3px 2px; color: #edf6ff; font-weight: 750; font-variant-numeric: tabular-nums; }
a.output-period-link:hover, a.output-value-link:hover { color: #5eead4; text-decoration: underline; text-underline-offset: 4px; }
.output-value-link.unavailable { color: var(--muted); font-size: 12px; font-weight: 650; }
.output-value-link.no-link, .output-period-link.no-link { cursor: default; }
.output-history-hero { padding: 25px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.output-history-hero h2 { margin-bottom: 7px; }
.output-history-hero .muted { max-width: 900px; margin-bottom: 0; line-height: 1.65; }
.output-history-section { margin-top: 30px; }
.output-history-table { overflow: auto; }
.output-history-table table { min-width: 1420px; }
.output-history-table th { position: sticky; top: 0; z-index: 2; background: #10233a; white-space: nowrap; }
.output-history-table th:first-child, .output-history-table td:first-child { position: sticky; left: 0; z-index: 3; min-width: 172px; text-align: left; background: #0d2035; white-space: nowrap; }
.output-history-table thead th:first-child { z-index: 4; background: #10233a; }
.output-history-table td { white-space: nowrap; }
.output-delete-form { margin-top: 12px; }
.output-delete-toolbar { margin-bottom: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 14px; }
.output-delete-toolbar label { flex: 0 0 auto; color: #dcecff; font-size: 13px; font-weight: 800; cursor: pointer; }
.output-delete-toolbar p { flex: 1 1 auto; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.output-delete-toolbar input, .hour-row-checkbox { width: 17px; height: 17px; accent-color: var(--accent); vertical-align: middle; cursor: pointer; }
.output-delete-toolbar .danger-button { flex: 0 0 auto; min-width: 128px; }
.output-delete-toolbar .danger-button:disabled { opacity: .4; cursor: not-allowed; }
.selectable-hour-row { cursor: pointer; transition: background .15s ease; }
.selectable-hour-row:hover td { background: rgba(45,212,191,.055); }
.selectable-hour-row.selected td { background: rgba(45,212,191,.105); }
.selectable-hour-row.selected td:first-child { background: #12324a; }
.hour-row-selector { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.history-time-heading { display: inline-block; padding-left: 27px; }
.output-history-meta { margin: 12px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.output-pagination { margin-top: 16px; padding: 13px 16px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.output-pagination a, .output-pagination span { min-width: 92px; padding: 9px 13px; text-align: center; border-radius: 9px; font-weight: 750; text-decoration: none; }
.output-pagination a { color: #dcecff; background: rgba(79,140,255,.14); border: 1px solid rgba(79,140,255,.32); }
.output-pagination a:hover { color: white; border-color: var(--accent); }
.output-pagination .page-position { min-width: auto; color: var(--muted); background: transparent; }
.output-pagination .disabled { color: #5f748a; background: rgba(255,255,255,.025); border: 1px solid rgba(34,58,85,.5); }

.view-tabs { margin-bottom: 22px; padding: 7px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.view-tab { min-height: 46px; padding: 10px 16px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 800; }
.view-tab-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.view-tab:hover { color: white; background: rgba(255,255,255,.035); }
.view-tab.active { color: #03231f; background: var(--accent); box-shadow: 0 8px 24px rgba(45,212,191,.16); }
.view-tab:disabled { opacity: .4; cursor: not-allowed; }
.page-view[hidden] { display: none !important; }

.history-panel { margin-top: 22px; padding: 24px; }
.history-copy { padding: 4px 2px; }
.history-copy h2 { margin-bottom: 10px; }
.history-copy > .muted { max-width: 520px; line-height: 1.7; }
.snapshot-badge { display: inline-flex; margin: 16px 0 0; padding: 8px 11px; border-radius: 999px; color: #b9ecdf; background: rgba(45,212,191,.09); border: 1px solid rgba(45,212,191,.22); font-size: 12px; }
.history-picker { margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.history-picker label, .field-group label { color: #a9bdd0; font-size: 12px; font-weight: 750; }
.history-picker select, .history-picker input, .field-group select { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--text); color-scheme: dark; background: #071625; border: 1px solid var(--line); border-radius: 11px; outline: none; }
.history-picker option { padding: 9px 10px; color: var(--text); background: #071625; border-radius: 7px; }
.history-picker option:checked { color: #03231f; background: linear-gradient(var(--accent), var(--accent)); }

.compare-hero { padding: 27px 25px; }
.compare-hero h2 { margin-bottom: 9px; }
.compare-hero > .muted { margin-bottom: 0; line-height: 1.65; }
.compare-section { margin-top: 18px; padding-bottom: 20px; }
.compare-toolbar { padding: 18px 20px; display: grid; grid-template-columns: minmax(180px, 280px) auto 1fr; align-items: end; gap: 18px; }
.field-group { display: grid; gap: 7px; }
.field-group select { padding: 11px 13px; }
.range-group { display: flex; gap: 6px; flex-wrap: wrap; }
.range-button { min-width: 48px; padding: 10px 13px; color: var(--muted); background: #0a192a; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-weight: 750; }
.range-button:hover { color: white; border-color: #3d5d7e; }
.range-button.active { color: #03231f; background: var(--accent); border-color: var(--accent); }
#chartStatus { justify-self: end; align-self: center; text-align: right; }
.chart-groups { min-height: 150px; }
.chart-groups[aria-busy="true"] { opacity: .55; }
.chart-group { margin-top: 26px; }
.chart-category-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.chart-category-grid.summary-only { grid-template-columns: minmax(0, 1fr); }
.chart-category { min-width: 0; }
.chart-group-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 4px 10px; }
.chart-group-title h3 { margin: 0; font-size: 19px; }
.chart-group-title span { color: var(--muted); font-size: 13px; }
.metric-picker { width: 100%; min-height: 46px; margin-bottom: 10px; padding: 10px 12px; color: var(--text); color-scheme: dark; background: #071625; border: 1px solid var(--line); border-radius: 10px; outline: none; font-size: 16px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart-card { position: relative; min-width: 0; padding: 18px 18px 12px; overflow: hidden; cursor: zoom-in; }
.chart-header { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.chart-header-actions { display: flex; align-items: flex-start; gap: 10px; }
.chart-expand-button { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; color: #c7d9ea; background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 21px; line-height: 1; }
.chart-expand-button:hover { color: white; border-color: var(--accent); background: rgba(45,212,191,.1); }
.chart-header h3 { margin: 0 0 5px; color: #dcecff; font-size: 18px; }
.chart-unit { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.chart-series-legend { display: flex; align-items: center; gap: 13px; margin-top: 7px; color: #afc1d3; font-size: 12px; font-weight: 700; }
.chart-series-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend-swatch { width: 18px; height: 3px; display: inline-block; border-radius: 999px; }
.chart-legend-swatch.primary { background: var(--accent); }
.chart-legend-swatch.comparison { background: #f5b942; }
.chart-latest { color: #f5fbff; font-size: 24px; font-weight: 850; font-variant-numeric: tabular-nums; }
.chart-latest[data-trend="up"] { color: var(--positive); }
.chart-latest[data-trend="down"] { color: var(--negative); }
.line-chart { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.chart-grid-line { stroke: rgba(142,165,189,.16); stroke-width: 1; }
.chart-area-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 4px 5px rgba(45,212,191,.2)); }
.chart-point { fill: #b9fff4; stroke: #0d1b2d; stroke-width: 2; }
.chart-comparison-line { fill: none; stroke: #f5b942; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 3px 4px rgba(245,185,66,.18)); }
.chart-comparison-point { fill: #ffe39a; stroke: #172033; stroke-width: 2; }
.chart-y-label, .chart-x-label { fill: #8da5bd; font-size: 12px; font-weight: 650; font-family: inherit; }
.chart-y-label { text-anchor: end; }
.chart-y-label-right { fill: #e3b85b; text-anchor: start; }
.chart-x-label.end { text-anchor: end; }
.chart-hover-layer { fill: transparent; pointer-events: all; cursor: crosshair; }
.chart-hover-line { stroke: rgba(185,255,244,.6); stroke-width: 1.5; stroke-dasharray: 4 4; pointer-events: none; }
.chart-hover-point { fill: var(--accent); stroke: white; stroke-width: 2.5; pointer-events: none; filter: drop-shadow(0 0 5px rgba(45,212,191,.75)); }
.chart-hover-point-comparison { fill: #f5b942; filter: drop-shadow(0 0 5px rgba(245,185,66,.75)); }
.chart-hover-line[hidden], .chart-hover-point[hidden], .chart-hover-point-comparison[hidden] { display: none; }
.chart-tooltip { position: absolute; z-index: 8; min-width: 150px; padding: 10px 12px; color: var(--text); background: rgba(3,13,24,.96); border: 1px solid rgba(45,212,191,.48); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.38); pointer-events: none; font-variant-numeric: tabular-nums; }
.chart-tooltip[hidden] { display: none; }
.chart-tooltip-time { display: block; margin-bottom: 5px; color: #a9bdd0; font-size: 13px; white-space: nowrap; }
.chart-tooltip strong { display: block; color: white; font-size: 17px; }
.chart-tooltip .chart-tooltip-comparison { margin-top: 4px; color: #f5c967; }
.chart-card.chart-fullscreen { position: fixed; inset: 18px; z-index: 1000; width: auto; height: auto; display: flex; flex-direction: column; padding: 26px; overflow: visible; cursor: default; background: linear-gradient(145deg, #10233a, #081625); border-color: rgba(45,212,191,.55); box-shadow: 0 0 0 100vmax rgba(0,0,0,.86), 0 30px 90px rgba(0,0,0,.7); }
.chart-card.chart-fullscreen .chart-header h3 { font-size: 25px; }
.chart-card.chart-fullscreen .chart-unit { font-size: 14px; }
.chart-card.chart-fullscreen .chart-latest { font-size: 34px; }
.chart-card.chart-fullscreen .chart-expand-button { width: 44px; height: 44px; font-size: 30px; }
.chart-card.chart-fullscreen .line-chart { flex: 1; width: 100%; height: calc(100vh - 125px); min-height: 0; margin-top: 14px; }
.chart-card.chart-fullscreen .chart-tooltip { z-index: 1002; min-width: 190px; padding: 13px 15px; }
.chart-card.chart-fullscreen .chart-tooltip-time { font-size: 15px; }
.chart-card.chart-fullscreen .chart-tooltip strong { font-size: 21px; }
.chart-empty { min-height: 180px; display: grid; place-items: center; margin: 0; color: var(--muted); }
.mini-empty { padding: 42px 20px; color: var(--muted); }

.login-page { display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 38px; border-radius: 22px; background: rgba(10,24,41,.95); border: 1px solid var(--line); box-shadow: 0 30px 90px rgba(0,0,0,.42); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 28px; border-radius: 14px; background: var(--accent); color: #03231f; font-size: 24px; font-weight: 900; }
.login-form { display: grid; gap: 9px; margin-top: 26px; }
.login-form label { color: #b7c9db; font-size: 12px; font-weight: 700; margin-top: 5px; }
.login-form input { width: 100%; color: white; background: #071625; border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; outline: none; }
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,212,191,.12); }
.full { width: 100%; margin-top: 13px; }

.monitor-hero { padding: 26px; }
.monitor-hero h2 { margin-bottom: 8px; }
.monitor-hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.monitor-hero-head .muted { max-width: 760px; margin-bottom: 0; line-height: 1.65; }
.monitor-toggle-block { display: grid; justify-items: end; gap: 7px; flex: 0 0 auto; }
.monitor-toggle-block span { color: var(--muted); font-size: 11px; }
.monitor-toggle { min-width: 126px; padding: 11px 16px; color: #b9ffe0; background: rgba(66,211,146,.12); border: 1px solid rgba(66,211,146,.38); border-radius: 999px; cursor: pointer; font-weight: 850; }
.monitor-toggle:hover { color: white; background: rgba(66,211,146,.2); }
.monitor-toggle.enabled { color: #ffc2c8; background: rgba(255,107,122,.1); border-color: rgba(255,107,122,.34); }
.monitor-toggle.enabled:hover { color: white; background: rgba(255,107,122,.2); }
.monitor-state-block { margin-top: 22px; display: flex; align-items: center; gap: 10px; font-size: 18px; }
.state-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--negative); box-shadow: 0 0 0 5px rgba(255,107,122,.1); }
.state-dot.online { background: var(--positive); box-shadow: 0 0 0 5px rgba(66,211,146,.11), 0 0 18px rgba(66,211,146,.45); }
.monitor-stats { margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.monitor-stats > div, .price-strip > div { min-width: 0; padding: 13px 14px; border-radius: 11px; background: rgba(4,16,30,.45); border: 1px solid rgba(34,58,85,.72); }
.monitor-stats span, .price-strip span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.monitor-stats strong, .price-strip strong { display: block; overflow: hidden; color: #f2f8ff; font-size: 14px; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.price-strip { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.price-strip strong { font-size: 18px; color: #b9fff4; }
.monitor-toggle-note { margin: 14px 0 0; padding: 10px 12px; color: #b6c7d9; background: rgba(79,140,255,.065); border: 1px solid rgba(79,140,255,.18); border-radius: 9px; font-size: 12px; line-height: 1.6; }
.health-status-card.alerting { border-color: rgba(255,107,122,.5); background: rgba(255,107,122,.08); }
.health-alert { font-weight: 700; line-height: 1.6; }
.notification-section { margin-top: 30px; }
.rule-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rule-form { min-width: 0; padding: 22px; }
.rule-form h3 { margin: 4px 0 7px; font-size: 19px; }
.rule-form > .muted { min-height: 40px; margin-bottom: 18px; font-size: 13px; line-height: 1.5; }
.rule-number { margin-bottom: 0; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .16em; }
.rule-form label { display: grid; gap: 7px; margin-top: 12px; color: #a9bdd0; font-size: 12px; font-weight: 750; }
.rule-form input, .rule-form select { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--text); color-scheme: dark; background: #071625; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.rule-form input:focus, .rule-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,212,191,.1); }
.notification-table table { min-width: 1080px; }
.notification-table td { font-size: 13px; }
.notification-table th:last-child, .notification-table td:last-child { text-align: center; }
.danger-button { padding: 7px 11px; color: #ffc2c8; background: rgba(255,107,122,.1); border: 1px solid rgba(255,107,122,.3); border-radius: 8px; cursor: pointer; font-weight: 750; }
.danger-button:hover { color: white; background: rgba(255,107,122,.24); }
.event-table table { min-width: 1160px; }
.event-message { min-width: 360px; max-width: 620px; text-align: left !important; white-space: pre-line; line-height: 1.55; }

.funding-hero { padding: 26px; }
.funding-hero h2 { margin-bottom: 9px; }
.funding-hero > div:first-child > .muted { max-width: 900px; margin-bottom: 0; line-height: 1.7; }
.funding-status-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.funding-status-grid > div { min-width: 0; padding: 14px 15px; border-radius: 11px; background: rgba(4,16,30,.45); border: 1px solid rgba(34,58,85,.72); }
.funding-status-grid span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.funding-status-grid strong { display: block; overflow: hidden; color: #f2f8ff; font-size: 14px; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.funding-section { margin-top: 30px; }
.funding-table table { min-width: 1120px; }
.funding-table th:first-child, .funding-table td:first-child { text-align: left; }
.funding-table th:nth-child(2), .funding-table td:nth-child(2), .funding-table th:nth-child(3), .funding-table td:nth-child(3), .funding-table th:nth-child(4), .funding-table td:nth-child(4) { text-align: left; }
.account-type { color: #b9fff4; font-weight: 850; }
.funding-data-link { display: block; color: inherit; text-decoration: none; }
.funding-data-link:hover { color: #5eead4; text-decoration: underline; text-underline-offset: 3px; }
.funding-rate-value { font-size: 15px; font-variant-numeric: tabular-nums; }
.funding-unavailable { color: var(--muted); font-size: 12px; }
.funding-note { margin: 13px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.funding-detail-hero { padding: 25px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.funding-detail-hero h2 { margin-bottom: 7px; }
.funding-detail-hero .muted { margin-bottom: 0; }
.funding-detail-table { max-height: calc(100vh - 300px); overflow: auto; }
.funding-detail-table table { min-width: 620px; }
.funding-detail-table th { position: sticky; top: 0; z-index: 2; background: #10233a; }
.funding-detail-table th:first-child, .funding-detail-table td:first-child { text-align: left; }
.funding-detail-table td { font-size: 14px; }

@media (max-width: 720px) {
  .topbar, .toolbar { align-items: flex-start; }
  .topbar, .toolbar { flex-direction: column; }
  .container, .topbar { padding-left: 16px; padding-right: 16px; }
  .actions { width: 100%; }
  .actions > * { flex: 1; text-align: center; }
  .investment-upload { grid-template-columns: 1fr; }
  .investment-upload-form { display: grid; justify-content: stretch; }
  .investment-file-field, .investment-file-field input { width: 100%; max-width: none; }
  .investment-detail-hero { align-items: flex-start; flex-direction: column; }
  .investment-detail-hero .secondary { width: 100%; text-align: center; }
  .output-summary-table, .output-history-table { width: calc(100vw - 32px); }
  .output-delete-toolbar { align-items: stretch; flex-direction: column; }
  .output-delete-toolbar .danger-button { width: 100%; }
  .output-history-hero { align-items: flex-start; flex-direction: column; }
  .output-history-hero .secondary { width: 100%; text-align: center; }
  .output-pagination { justify-content: space-between; gap: 6px; }
  .output-pagination a, .output-pagination span { min-width: 0; padding: 8px 10px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .section-heading p { width: 100%; margin-left: 24px; }
  .history-picker { grid-template-columns: 1fr; }
  .compare-toolbar { grid-template-columns: 1fr; align-items: stretch; }
  #chartStatus { justify-self: start; text-align: left; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-category-grid { grid-template-columns: 1fr; }
  .chart-card { padding-left: 12px; padding-right: 12px; }
  .chart-card.chart-fullscreen { inset: 7px; padding: 15px 11px; }
  .chart-card.chart-fullscreen .chart-header h3 { font-size: 20px; }
  .chart-card.chart-fullscreen .chart-latest { font-size: 25px; }
  .chart-card.chart-fullscreen .line-chart { height: calc(100vh - 105px); }
  .view-tabs { grid-template-columns: 1fr; }
  .funding-status-grid { grid-template-columns: 1fr; }
  .funding-detail-hero { align-items: flex-start; flex-direction: column; }
  .funding-detail-hero .secondary { width: 100%; text-align: center; }
  .monitor-hero-head { flex-direction: column; }
  .monitor-toggle-block { width: 100%; justify-items: stretch; }
  .monitor-toggle-block span { text-align: center; }
  .monitor-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-strip, .rule-form-grid { grid-template-columns: 1fr; }
}

@media (min-width: 721px) and (max-width: 1050px) {
  .compare-toolbar { grid-template-columns: minmax(180px, 1fr) auto; }
  #chartStatus { grid-column: 1 / -1; justify-self: start; text-align: left; }
  .chart-category-grid { grid-template-columns: 1fr; }
  .monitor-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rule-form-grid { grid-template-columns: 1fr; }
  .funding-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
