:root {
  color-scheme: dark;
  --bg: #080d13;
  --sidebar: #0a1017;
  --panel: #0e1720;
  --panel-soft: #101c26;
  --line: #1d2a35;
  --line-soft: #17232d;
  --text: #e8eef2;
  --muted: #84949f;
  --dim: #60717d;
  --teal: #48d6b2;
  --teal-soft: rgba(72, 214, 178, .12);
  --blue: #71aaff;
  --orange: #e7ae6d;
  --red: #f17f83;
  --lime: #b1d778;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 13px; }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { min-height: 100vh; padding: 27px 19px 18px; background: var(--sidebar); border-right: 1px solid #19242d; display: flex; flex-direction: column; }
.brand-row { display: flex; align-items: center; gap: 12px; padding: 0 7px 2px; }
.brand-mark { height: 32px; width: 32px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 7px; border: 1px solid #2a554f; border-radius: 9px; background: #0d2526; }
.brand-mark span { display: block; width: 3px; border-radius: 4px; background: var(--teal); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .65; }.brand-mark span:nth-child(2) { height: 15px; }.brand-mark span:nth-child(3) { height: 12px; opacity: .82; }
.brand-name { letter-spacing: .16em; font: 500 14px var(--mono); }.brand-subtitle { margin-top: 3px; color: var(--dim); font: 9px var(--mono); letter-spacing: .08em; }
.side-divider { height: 1px; background: var(--line-soft); margin: 24px 0 19px; }
.section-kicker { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px 2px; color: #72828d; font: 10px var(--mono); letter-spacing: .1em; }
.utc-tag { border: 1px solid #273843; border-radius: 4px; padding: 3px 5px; color: #7d929d; font-size: 8px; letter-spacing: .03em; }
.field-label { display: block; color: #9caab2; margin: 0 0 6px 2px; font-size: 11px; }
.field { width: 100%; height: 38px; margin-bottom: 14px; padding: 0 10px; border: 1px solid #273640; border-radius: 6px; outline: none; background: #101922; color: #d8e0e4; font-size: 11px; }
.field:focus, .login-controls input:focus { border-color: #367d72; box-shadow: 0 0 0 2px rgba(72, 214, 178, .09); }
.field::-webkit-calendar-picker-indicator { opacity: .7; filter: invert(.8); cursor: pointer; }
.quick-ranges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: -3px 0 2px; }
.quick-ranges button { border: 1px solid transparent; background: transparent; border-radius: 5px; color: #768894; padding: 7px 2px; font: 10px var(--mono); cursor: pointer; }
.quick-ranges button:hover { color: #c4d0d5; border-color: #25343e; }.quick-ranges button.active { background: #122521; color: var(--teal); border-color: #28594e; }
.quick-ranges .calendar-range { grid-column: span 2; border-color: #25343e; color: #a9b7bd; }
.quick-ranges button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.section-gap { margin-top: 18px; }
.primary-button { width: 100%; height: 40px; margin-top: 2px; border: 1px solid #3a8879; border-radius: 6px; background: #12342f; color: #80e4ca; font-weight: 600; cursor: pointer; transition: background .18s, border .18s; }
.primary-button:hover { background: #17453c; border-color: #55ae9b; }.primary-button:disabled { opacity: .55; cursor: wait; }
.refresh-icon { margin-right: 5px; font-size: 16px; vertical-align: -1px; }
.side-note { display: flex; gap: 8px; margin: 14px 2px 0; color: #71818b; line-height: 1.5; font-size: 10px; }
.note-dot { width: 5px; height: 5px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: #5b8792; }
.sidebar-spacer { flex: 1; min-height: 35px; }
.connection-card { padding: 12px 12px 10px; border: 1px solid #1e3037; border-radius: 7px; background: #0d171e; }
.connection-heading { display: flex; align-items: center; gap: 7px; color: #b9c4c9; font: 9px var(--mono); letter-spacing: .05em; }
.status-light { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #687781; box-shadow: 0 0 0 3px rgba(104, 119, 129, .12); }
.status-light.online { background: var(--teal); box-shadow: 0 0 0 3px rgba(72, 214, 178, .12), 0 0 9px rgba(72, 214, 178, .35); }.status-light.muted { background: #687781; }
.connection-detail { color: #70818c; font-size: 10px; line-height: 1.5; padding: 7px 0 3px; }
.text-button { padding: 3px 0; border: 0; background: none; color: #81cdbc; font-size: 10px; cursor: pointer; }.text-button:hover { color: #b2f1e3; }
.sidebar-footer { color: #52626d; font: 8px var(--mono); letter-spacing: .08em; text-align: center; margin-top: 14px; }.sidebar-footer span { color: #34444e; padding: 0 4px; }
.main-content { max-width: 1700px; width: 100%; margin: 0 auto; padding: 0 34px 28px; }
.topbar { min-height: 59px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #17232c; }
.breadcrumb { display: flex; align-items: center; gap: 11px; font: 9px var(--mono); letter-spacing: .09em; color: #62727d; }.breadcrumb i { font-style: normal; color: #36444d; }.breadcrumb strong { color: #a4b1b8; font-weight: 400; }
.topbar-right { display: flex; gap: 13px; align-items: center; }.update-label { color: #667782; font-size: 10px; }.topbar-separator { width: 1px; height: 17px; background: #26343c; }
.icon-button { border: 0; background: transparent; color: #93aaa9; cursor: pointer; font: 12px var(--mono); }.icon-button span { font: 10px var(--sans); margin-left: 3px; }.icon-button:hover:not(:disabled) { color: var(--teal); }.icon-button:disabled { color: #4d5a62; cursor: default; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 27px 0 23px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #7b8e98; font: 9px var(--mono); letter-spacing: .12em; }.eyebrow-line { width: 17px; height: 1px; background: var(--teal); }
h1 { margin: 8px 0 6px; font-size: clamp(25px, 3vw, 33px); font-weight: 500; letter-spacing: -.045em; }.page-heading h1 span { color: #82929a; font-weight: 400; }
.subtitle { margin: 0; color: #86959e; font-size: 12px; }
.account-pill { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #213039; border-radius: 20px; color: #82939c; font: 9px var(--mono); white-space: nowrap; }
.account-pill.connected { border-color: #285349; background: #0d201e; color: #89d6c2; }.account-pill .status-light { width: 6px; height: 6px; }
.account-info { display: grid; gap: 4px; }.account-server { color: #a9c7bf; font: 9px var(--mono); }.account-values { color: #70867f; font: 8px var(--mono); }
.login-panel { position: relative; display: grid; grid-template-columns: 36px minmax(200px, 1fr) minmax(300px, 440px); gap: 13px; align-items: center; margin: 0 0 16px; padding: 14px 16px; border: 1px solid #273b42; border-radius: 8px; background: linear-gradient(100deg, rgba(18, 43, 41, .82), rgba(14, 23, 32, .97)); }
.login-symbol { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: #193a34; color: var(--teal); font: 21px var(--mono); }
.login-copy { display: grid; gap: 3px; }.login-copy strong { color: #d7e1e2; font-size: 12px; font-weight: 600; }.login-copy span { color: #87969d; font-size: 10px; line-height: 1.45; }
.login-controls { display: flex; gap: 7px; }.login-controls input { min-width: 0; width: 100%; height: 36px; padding: 0 10px; border: 1px solid #30434a; border-radius: 5px; background: #0b141a; outline: none; color: var(--text); font-size: 11px; }.login-controls input::placeholder { color: #657780; }
.primary-button.compact { width: auto; min-width: 87px; height: 36px; margin: 0; padding: 0 12px; font-size: 11px; }
.login-error { position: absolute; right: 16px; bottom: -19px; z-index: 1; color: var(--red); font-size: 10px; }.hidden { display: none !important; }
.error-banner { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #6b373e; border-radius: 6px; background: #241316; color: #f2a1a2; font-size: 11px; line-height: 1.5; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; }
.metric-card { min-height: 117px; position: relative; overflow: hidden; padding: 16px 16px 13px; border: 1px solid var(--line); border-radius: 7px; background: linear-gradient(145deg, #101a23, #0c141c); }
.metric-label { color: #85949d; font: 9px var(--mono); letter-spacing: .08em; }.metric-value { margin-top: 13px; color: #e1e9eb; font: 500 clamp(20px, 2vw, 25px) var(--mono); letter-spacing: -.07em; white-space: nowrap; }.metric-value.positive { color: var(--teal); }.metric-value.negative { color: var(--red); }
.metric-caption { color: #657680; margin-top: 5px; font-size: 9px; }.metric-accent { position: absolute; right: 14px; top: 14px; width: 5px; height: 5px; border-radius: 50%; }.metric-accent.teal { background: var(--teal); box-shadow: 0 0 11px #48d6b2; }.metric-accent.blue { background: var(--blue); box-shadow: 0 0 10px #71aaff; }.metric-accent.lime { background: var(--lime); }.metric-accent.orange { background: var(--orange); }.metric-accent.red { background: var(--red); }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 12px; }
.panel { border: 1px solid var(--line); border-radius: 7px; background: #0d151d; overflow: hidden; }
.chart-panel { min-width: 0; }.panel-header { min-height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 13px 16px 10px; border-bottom: 1px solid #192630; }
.panel-title { margin: 0; color: #d3dcdf; font-size: 12px; font-weight: 600; }.panel-subtitle { margin-top: 4px; color: #74848d; font-size: 9px; }.panel-mark { color: #52646f; font: 9px var(--mono); }
.chart-wrap { position: relative; height: 239px; padding: 10px 13px 7px; }.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }.empty-chart { height: 100%; display: grid; place-items: center; color: #566670; font-size: 10px; }
.chart-grid-line { stroke: #1b2932; stroke-width: 1; }.axis-text { fill: #647681; font: 9px var(--mono); }.chart-line { fill: none; stroke: var(--teal); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }.chart-area { fill: var(--teal); fill-opacity: .12; }.zero-line { stroke: #8298a4; stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }.positive-bar { fill: #44c7a5; }.negative-bar { fill: #d96f76; }.bar-track { fill: #15212a; }
.magic-panel, .positions-panel, .trades-panel { margin-top: 12px; }.table-scroll { width: 100%; overflow-x: auto; }
.strategy-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; gap: 10px; padding: 12px; }
.strategy-charts > .empty-chart { grid-column: 1 / -1; min-height: 60px; }
.strategy-card { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: #101922; }
.strategy-card-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 11px 12px 0; }
.strategy-card-header h3 { margin: 0; color: #d3dcdf; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.strategy-card-header .panel-subtitle { display: block; }
.strategy-card-header .pnl { flex: 0 0 auto; color: #d3dcdf; font-size: 12px; }
.chart-wrap.strategy-chart { height: 155px; padding: 8px 9px; }
.strategy-card-empty .strategy-chart { height: 46px; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { height: 34px; padding: 0 15px; color: #687a84; background: #0a1218; border-bottom: 1px solid #1b2932; font: 8px var(--mono); letter-spacing: .06em; font-weight: 400; }
td { height: 39px; padding: 0 15px; color: #b8c3c8; border-bottom: 1px solid #17232c; font-size: 10px; }
tbody tr:last-child td { border-bottom: 0; } tbody tr:hover td { background: rgba(35, 56, 65, .18); }
td.mono { color: #c9d4d8; font-family: var(--mono); font-size: 10px; }.magic-id { color: #8be0ca !important; font-family: var(--mono); }.pnl { font-family: var(--mono); }.pnl.positive { color: var(--teal); }.pnl.negative { color: var(--red); }.table-empty { height: 66px; color: #5c6d77; text-align: center; }
.muted-arrow { color: #596b75; padding: 0 3px; }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr); gap: 11px; margin-top: 12px; }.short-chart { height: 236px; }.symbol-bars { display: flex; flex-direction: column; justify-content: center; gap: 8px; height: 100%; padding: 10px 8px; }.symbol-row { display: grid; grid-template-columns: 58px minmax(30px, 1fr) 76px; align-items: center; gap: 9px; }.symbol-name { overflow: hidden; color: #a9b7bd; text-overflow: ellipsis; font: 9px var(--mono); }.symbol-track { height: 10px; position: relative; border-radius: 3px; background: #17232b; }.symbol-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; }.symbol-fill.pos { left: 50%; background: linear-gradient(90deg, #328f7d, #4dd2af); }.symbol-fill.neg { right: 50%; background: linear-gradient(90deg, #9e5158, #dc777e); }.symbol-value { text-align: right; font: 9px var(--mono); }
.zero-label { fill: #a8bac3; }
.symbol-zero-label { grid-column: 2; justify-self: center; color: #a8bac3; font: 10px var(--mono); }
.symbol-track::after { content: ""; position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: #8298a4; }
.quality-list { display: grid; grid-template-columns: 1fr 1fr; padding: 6px 16px 12px; column-gap: 20px; }.quality-list div { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #192630; }.quality-list div:nth-last-child(-n+2) { border-bottom: 0; }.quality-list span { color: #82919a; font-size: 10px; }.quality-list strong { color: #d6dfe1; text-align: right; font: 10px var(--mono); }.quality-list strong.positive { color: var(--teal); }.quality-list strong.negative { color: var(--red); }
.live-tag { display: flex; align-items: center; gap: 6px; border: 1px solid #245346; border-radius: 20px; padding: 4px 8px; color: #76cbb5; font: 8px var(--mono); }.live-tag span { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 7px var(--teal); }
.page-footer { display: flex; justify-content: space-between; padding: 18px 2px 4px; color: #4f606a; font: 8px var(--mono); letter-spacing: .035em; }.page-footer span:first-child { color: #687984; }
.strategy-cell { display: grid; gap: 3px; min-width: 120px; }.strategy-cell strong { color: #d2e0dc; font-size: 10px; font-weight: 600; }.strategy-cell small { color: #73858d; font: 8px var(--mono); }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; }.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 7, 11, .78); backdrop-filter: blur(5px); }.map-dialog { position: relative; width: min(740px, 100%); max-height: min(84vh, 850px); overflow: hidden; display: flex; flex-direction: column; border: 1px solid #2a3c44; border-radius: 10px; background: #0d161e; box-shadow: 0 24px 90px rgba(0, 0, 0, .48); }
.map-header { display: flex; justify-content: space-between; gap: 18px; padding: 22px 24px 17px; border-bottom: 1px solid #1b2a32; }.map-header h2 { margin: 8px 0 5px; color: #e0e8e9; font-size: 20px; font-weight: 500; letter-spacing: -.03em; }.map-header p { margin: 0; max-width: 540px; color: #86969e; font-size: 10px; line-height: 1.55; }.modal-close { width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid #263740; border-radius: 6px; background: #111d25; color: #9aabb2; font-size: 21px; line-height: 1; cursor: pointer; }.modal-close:hover { color: white; border-color: #48616b; }
.map-columns { display: grid; grid-template-columns: minmax(140px, .8fr) minmax(220px, 1.2fr) 34px; gap: 9px; padding: 12px 24px 7px; color: #6c7f89; font: 8px var(--mono); letter-spacing: .07em; }.map-rows { overflow-y: auto; padding: 0 24px; }.map-editor-row { display: grid; grid-template-columns: minmax(140px, .8fr) minmax(220px, 1.2fr) 34px; gap: 9px; align-items: center; padding: 7px 0; border-bottom: 1px solid #18252d; }.map-editor-row input { height: 36px; min-width: 0; padding: 0 10px; border: 1px solid #2b3b44; border-radius: 5px; outline: none; background: #091118; color: #dce5e6; font-size: 11px; }.map-editor-row input:focus { border-color: #438779; box-shadow: 0 0 0 2px rgba(72, 214, 178, .08); }.map-editor-row input::placeholder { color: #586a74; }.remove-map-row { width: 31px; height: 31px; border: 1px solid #3d2c32; border-radius: 5px; background: #1d1519; color: #d78a8e; font-size: 18px; cursor: pointer; }.remove-map-row:hover { background: #321b21; }.map-empty { padding: 18px 2px; color: #75868f; font-size: 10px; }.add-map-row { align-self: flex-start; margin: 12px 24px; padding: 7px 10px; border: 1px dashed #34534e; border-radius: 5px; background: #10201e; color: #87d8c3; font-size: 10px; cursor: pointer; }.add-map-row:hover { background: #16302b; }.map-error { margin: 11px 24px 0; padding: 9px 11px; border: 1px solid #6b373e; border-radius: 5px; background: #241316; color: #f2a1a2; font-size: 10px; }.map-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding: 13px 24px; border-top: 1px solid #1b2a32; background: #0b131a; }.map-footer > span { color: #6f8088; font-size: 9px; }.map-footer > div { display: flex; gap: 8px; }.secondary-button { min-width: 76px; height: 36px; border: 1px solid #2b3b44; border-radius: 5px; background: #101a21; color: #aab7bc; font-size: 10px; cursor: pointer; }.secondary-button:hover { border-color: #47606a; }.primary-button.save-map-button { width: auto; height: 36px; margin: 0; padding: 0 13px; font-size: 10px; }.primary-button.save-map-button:disabled { opacity: .65; }.modal-open { overflow: hidden; }

@media (max-width: 1180px) { .main-content { padding: 0 22px 24px; }.metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.metric-card:nth-child(n+4) { min-height: 105px; } }
@media (max-width: 820px) { .app-shell { grid-template-columns: minmax(0, 1fr); }.sidebar { min-height: 0; padding: 16px; border-right: 0; border-bottom: 1px solid #19242d; display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }.brand-row, .side-divider, .section-kicker, .sidebar-spacer, .connection-card, .sidebar-footer, .side-note, .primary-button { grid-column: 1 / -1; }.side-divider { margin: 14px 0; }.section-kicker { margin-bottom: 5px; }.field-label { margin-top: 5px; }.quick-ranges { grid-column: 1 / -1; }.section-gap { margin-top: 5px; }.primary-button { margin-top: 4px; }.sidebar-spacer, .sidebar-footer { display: none; }.connection-card { margin-top: 10px; }.main-content { padding: 0 16px 22px; }.login-panel { grid-template-columns: 34px minmax(0, 1fr); }.login-controls { grid-column: 1 / -1; }.topbar { min-height: 53px; }.chart-grid { grid-template-columns: 1fr; }.lower-grid { grid-template-columns: 1fr; }.account-pill { align-self: start; margin-top: 4px; } }
@media (max-width: 560px) { .main-content { padding: 0 11px 18px; }.topbar-right { gap: 8px; }.update-label { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.breadcrumb { gap: 6px; font-size: 8px; }.page-heading { align-items: start; flex-direction: column; padding: 21px 0 16px; }.account-pill { align-self: start; }.metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }.metric-card { min-height: 105px; padding: 13px; }.metric-card:last-child { grid-column: span 2; }.metric-value { font-size: 20px; }.chart-grid, .lower-grid { gap: 8px; margin-top: 9px; }.chart-wrap { height: 205px; padding: 8px; }.short-chart { height: 210px; }.panel-header { min-height: 56px; padding: 11px 12px 8px; }.quality-list { padding: 4px 12px 8px; column-gap: 12px; }.quality-list span { font-size: 9px; }.quality-list strong { font-size: 9px; }.magic-panel, .positions-panel, .trades-panel { margin-top: 9px; } th { padding: 0 10px; } td { padding: 0 10px; }.page-footer { gap: 12px; flex-direction: column; }.login-panel { padding: 12px; gap: 9px; }.login-copy span { font-size: 9px; } }
@media (max-width: 560px) { .map-dialog { max-height: 92vh; }.map-header { padding: 17px 15px 13px; }.map-columns { grid-template-columns: 1fr 1.2fr 30px; gap: 6px; padding: 10px 14px 6px; font-size: 7px; }.map-rows { padding: 0 14px; }.map-editor-row { grid-template-columns: 1fr 1.2fr 30px; gap: 6px; }.map-editor-row input { padding: 0 7px; font-size: 9px; }.remove-map-row { width: 29px; height: 29px; }.add-map-row { margin-left: 14px; }.map-footer { align-items: flex-start; flex-direction: column; padding: 11px 14px; }.map-error { margin-left: 14px; margin-right: 14px; } }

.compare-check { display: flex; align-items: center; gap: 7px; margin: 9px 0 0; color: #aebdc4; font-size: 11px; cursor: pointer; }
.compare-check input { margin: 0; accent-color: var(--teal); }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 11px; margin-top: 12px; }
.analytics-grid th, .analytics-grid td { padding-inline: 10px; }
tbody th[scope="row"] { color: #c9d4d8; font: 500 11px var(--sans); border-bottom: 1px solid var(--line-soft); }
.analytics-total th, .analytics-total td { background: #111f27; font-weight: 600; }
.analytics-empty { display: grid; place-items: center; min-height: 66px; }
.period-table thead span { display: block; margin-top: 3px; color: #a0b0b8; font: 10px var(--sans); letter-spacing: 0; }
.period-table th[colspan], .exposure-table th[colspan] { text-align: center; }
.period-table thead tr:first-child th { height: 45px; }
.period-table tbody td:nth-child(6), .period-table thead tr:first-child th:last-child, .period-table thead tr:last-child th:nth-child(5),
.exposure-table tbody td:nth-child(5), .exposure-table thead tr:first-child th:last-child, .exposure-table thead tr:last-child th:nth-child(4) { border-left: 1px solid var(--line); }

.strategy-card[data-bot-profile] { cursor: pointer; }
.strategy-card[data-bot-profile]:hover { border-color: #3a605e; }
.strategy-link { justify-self: start; padding: 0; border: 0; background: none; color: #9ed9cb; text-align: left; font: inherit; cursor: pointer; }
.strategy-link:hover, .strategy-link:focus-visible { color: var(--teal); text-decoration: underline; }
.strategy-link span { margin-left: 3px; color: #82999f; font-size: 11px; }
.panel-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 11px; color: #a0b0b8; font-size: 11px; }
.panel-controls label { display: flex; align-items: center; gap: 6px; }
.panel-controls select, .panel-controls input { max-width: 100%; min-height: 33px; padding: 4px 8px; border: 1px solid #30424d; border-radius: 5px; background: #101c25; color: var(--text); }
.panel-controls input { width: 190px; }
.heatmap-header { gap: 10px; flex-wrap: wrap; }
.heatmap-table { min-width: 910px; border-collapse: separate; border-spacing: 3px; padding: 6px 10px 11px; }
.heatmap-table th, .heatmap-table td { min-width: 32px; height: 27px; padding: 0 4px; text-align: center; border: 0; border-radius: 3px; font: 9px var(--mono); }
.heatmap-table th:first-child { min-width: 40px; text-align: left; }
.heatmap-table td { --heat-tone: #6d828d; color: #f0f5f6; background: #14202a; background: color-mix(in srgb, var(--heat-tone) var(--heat-strength, 0%), #14202a); }
.heatmap-table td.heat-empty { color: #84949f; }
.heatmap-table td.heat-positive { --heat-tone: #167e69; }
.heatmap-table td.heat-negative { --heat-tone: #a54758; }
.heatmap-table td.heat-count { --heat-tone: #336fbd; }

body:has(.profile-dialog[open]) { overflow: hidden; }
.profile-dialog { width: min(930px, calc(100% - 30px)); max-height: min(880px, 90dvh); padding: 0; overflow: hidden; border: 1px solid #2a3c44; border-radius: 10px; color: var(--text); background: #0d161e; box-shadow: 0 24px 90px rgba(0, 0, 0, .48); }
.profile-dialog[open] { display: flex; flex-direction: column; }
.profile-dialog::backdrop { background: rgba(2, 7, 11, .78); backdrop-filter: blur(5px); }
.profile-header { display: flex; flex: 0 0 auto; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.profile-header h2 { margin: 0 0 5px; font-size: 21px; font-weight: 600; overflow-wrap: anywhere; }
.profile-header p { margin: 0; color: #a0b0b8; font-size: 11px; }
.profile-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px; }
.profile-content > .panel + .panel { margin-top: 10px; }
.profile-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 7px; margin: 0 0 10px; }
.profile-metrics > div { padding: 9px 10px; min-width: 0; border: 1px solid var(--line); border-radius: 5px; background: #101c25; }
.profile-metrics dt { color: #a0b0b8; font-size: 10px; }
.profile-metrics dd { margin: 4px 0 0; color: #e4ecef; font: 11px var(--mono); overflow-wrap: anywhere; }
.profile-trade-detail { padding: 10px 16px 13px; border-top: 1px solid var(--line); color: #a0b0b8; font-size: 11px; }
.profile-trade-detail:empty { display: none; }
.profile-trade-detail strong { color: #e4ecef; }
.profile-trade-detail p { overflow-wrap: anywhere; }
.trade-detail-grid { margin: 9px 0 0; }
.profile-drawdown .chart-line { stroke: var(--red); }
.profile-drawdown .chart-area { fill: var(--red); }
.trade-point { fill: var(--teal); stroke: #0b1419; stroke-width: 1.5; cursor: pointer; }
.trade-point:hover, .trade-point:focus, .trade-point[aria-pressed="true"] { fill: #e8eef2; stroke: var(--teal); stroke-width: 2; outline: none; }
.profile-history-header { flex-wrap: wrap; gap: 8px; }
.profile-more { margin: 10px 14px; }

@media (max-width: 820px) {
  .compare-check { grid-column: 1 / -1; }
  .analytics-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .profile-dialog { width: calc(100% - 16px); max-height: 94dvh; }
  .profile-header { padding: 13px 12px; }
  .profile-content { padding: 8px; }
  .profile-trade-detail { padding-inline: 12px; }
}
