@charset "UTF-8";

:root {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-soft: #0e1727;
  --surface: #111c2e;
  --surface-raised: #152238;
  --surface-muted: #0d1727;
  --border: #24334a;
  --border-soft: rgba(120, 145, 178, .15);
  --text: #e6edf6;
  --text-secondary: #a3b0c3;
  --text-muted: #71819a;
  --mint: #57d6ad;
  --mint-soft: rgba(87, 214, 173, .12);
  --coral: #ff827c;
  --coral-soft: rgba(255, 130, 124, .13);
  --blue: #68a9ff;
  --blue-soft: rgba(83, 153, 255, .11);
  --amber: #f0c46b;
  --shadow: 0 24px 60px rgba(0, 0, 0, .18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(45, 76, 121, .14), transparent 50%),
    linear-gradient(rgba(112, 142, 184, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 142, 184, .025) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 44px 44px, 44px 44px, auto;
  font-size: 14px;
  line-height: 1.5;
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

button:focus-visible, a:focus-visible, input:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 clamp(22px, 4.4vw, 76px);
  border-bottom: 1px solid rgba(136, 160, 193, .13);
  background: rgba(11, 18, 32, .9);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid rgba(87, 214, 173, .32); border-radius: 9px;
  color: var(--mint); background: rgba(87, 214, 173, .07);
  font-size: 10px; font-weight: 800; letter-spacing: -.04em;
}
.brand-wordmark { display: flex; align-items: baseline; gap: 4px; letter-spacing: .11em; font-size: 12px; }
.brand-wordmark strong { color: var(--text); font-weight: 800; }
.brand-wordmark > span { color: var(--mint); font-weight: 700; font-size: 10px; }
.brand-divider { height: 20px; width: 1px; margin: 0 3px; background: var(--border); }
.brand-product { color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.topbar-tools { display: flex; align-items: center; justify-content: flex-end; gap: 18px; min-width: 0; }
.connection-state { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.state-light { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #61718a; }
.connection-state.is-online { color: #9cdbc4; }
.connection-state.is-online .state-light { background: var(--mint); box-shadow: 0 0 0 4px rgba(87, 214, 173, .09); }
.connection-state.is-offline { color: #eba09b; }
.connection-state.is-offline .state-light { background: var(--coral); box-shadow: 0 0 0 4px rgba(255, 130, 124, .08); }
.connection-state.is-checking .state-light { background: var(--amber); box-shadow: 0 0 0 4px rgba(240, 196, 107, .09); }
.updated-at { color: var(--text-muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.icon-button, .text-button, .back-button, .pager-button, .filter-tab { border: 0; cursor: pointer; }
.icon-button {
  width: 34px; height: 34px; display: grid; place-items: center; padding: 8px;
  color: #a9b7ca; border: 1px solid var(--border); border-radius: 9px; background: #101a2a;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.icon-button:hover { color: var(--mint); border-color: rgba(87, 214, 173, .35); background: #142235; }
.icon-button svg, .back-button svg, .pager-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.text-button { padding: 7px 0 7px 10px; color: var(--text-secondary); background: transparent; font-size: 12px; }
.text-button:hover { color: var(--text); }

main { width: min(100%, 1600px); margin: 0 auto; padding: 34px clamp(22px, 4.4vw, 76px) 46px; flex: 1; }
.screen { animation: arrive .24s ease-out both; }
.dashboard-screen { max-width: 1370px; }
@keyframes arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin: 7px 0 35px; }
.eyebrow { margin: 0 0 7px; color: #8195b1; font-size: 9px; font-weight: 750; letter-spacing: .16em; line-height: 1.4; text-transform: uppercase; }
.eyebrow > span { margin: 0 3px; color: #52647e; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; color: var(--text); font-size: clamp(25px, 3vw, 33px); font-weight: 650; letter-spacing: -.035em; line-height: 1.2; }
.page-description, .login-description { max-width: 590px; margin: 0; color: var(--text-secondary); font-size: 13px; }
.overview-stats { display: flex; align-items: stretch; gap: 8px; }
.overview-stat { min-width: 112px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 15px; border: 1px solid var(--border-soft); border-radius: 10px; background: rgba(17, 28, 46, .7); }
.overview-label { color: var(--text-muted); font-size: 10px; }
.overview-stat strong { color: var(--text); font-size: 18px; font-weight: 620; font-variant-numeric: tabular-nums; }
.notice { margin: 0 0 20px; padding: 12px 15px; border: 1px solid; border-radius: 9px; font-size: 12px; }
.notice-error { color: #f0b5b0; border-color: rgba(255, 130, 124, .25); background: rgba(77, 31, 40, .34); }
.experiment-group { margin-top: 31px; }
.section-heading { display: flex; align-items: center; gap: 11px; margin: 0 0 14px; }
.section-heading > div { display: flex; align-items: center; gap: 10px; }
.section-heading h2 { margin: 0; color: #d8e1ed; font-size: 14px; font-weight: 620; letter-spacing: -.01em; }
.section-indicator { width: 6px; height: 6px; border-radius: 50%; }
.indicator-live { background: var(--mint); box-shadow: 0 0 9px rgba(87, 214, 173, .34); }
.indicator-done { background: #71819a; }
.section-count { display: inline-grid; place-items: center; min-width: 22px; height: 19px; padding: 0 6px; color: #9aabc0; border: 1px solid var(--border); border-radius: 6px; background: rgba(15, 25, 41, .8); font-size: 10px; font-variant-numeric: tabular-nums; }
.experiment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.experiment-card {
  min-height: 340px;
  aspect-ratio: 1 / .94;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 15px;
  overflow: hidden;
  color: inherit;
  border: 1px solid #26364e;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(19, 31, 50, .97), rgba(16, 27, 44, .96));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.experiment-card:hover { transform: translateY(-2px); border-color: #3b526e; box-shadow: var(--shadow); }
.experiment-card:focus-visible { border-color: var(--blue); }
.experiment-card.is-archived { min-height: 312px; aspect-ratio: 1 / .86; background: linear-gradient(145deg, rgba(18, 28, 44, .92), rgba(15, 24, 38, .92)); border-color: rgba(107, 126, 151, .25); }
.card-top { min-height: 43px; display: flex; align-items: center; gap: 10px; }
.card-marker { width: 33px; height: 33px; display: grid; flex: 0 0 auto; place-items: center; color: #9ec7fa; border: 1px solid rgba(104, 169, 255, .23); border-radius: 9px; background: rgba(104, 169, 255, .09); font-size: 13px; font-weight: 650; }
.card-identity { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 1px; }
.card-title { max-width: 100%; overflow: hidden; color: #e3ebf5; font-size: 14px; font-weight: 650; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.card-id { overflow: hidden; color: #7588a2; font-size: 10px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 4px 8px; border: 1px solid rgba(125, 143, 168, .23); border-radius: 999px; color: #abb9cb; background: rgba(111, 129, 153, .075); font-size: 10px; font-weight: 560; white-space: nowrap; }
.status-dot { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.status-running { color: #7ce0ba; border-color: rgba(87, 214, 173, .2); background: rgba(87, 214, 173, .07); }
.status-scheduled, .status-waiting { color: #e7c577; border-color: rgba(240, 196, 107, .22); background: rgba(240, 196, 107, .07); }
.status-paused { color: #ffaaa1; border-color: rgba(255, 130, 124, .24); background: rgba(255, 130, 124, .08); }
.status-completed { color: #a1afc2; border-color: rgba(140, 157, 181, .21); background: rgba(140, 157, 181, .07); }
.status-unavailable { color: #efa9a3; border-color: rgba(255, 130, 124, .23); background: rgba(255, 130, 124, .07); }
.card-detail-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 15px; padding: 0 1px 10px; border-bottom: 1px solid rgba(125, 147, 176, .12); color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.card-t0 { white-space: nowrap; }
.card-timeframes { color: #8a9cb4; text-align: right; }
.card-metrics { display: flex; flex: 1; flex-direction: column; padding-top: 12px; }
.card-capacity { padding: 0 1px 13px; }
.card-capacity-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-metric-label { color: #91a1b7; font-size: 10px; }
.card-capacity-value { color: #dfe8f4; font-size: 11px; font-weight: 630; font-variant-numeric: tabular-nums; }
.capacity-meter { display: block; width: 100%; height: 5px; margin: 8px 0 5px; overflow: visible; }
.capacity-meter-track { fill: #26364c; }
.capacity-meter-value { fill: var(--blue); }
.card-capacity-detail { color: #788aa2; font-size: 10px; font-variant-numeric: tabular-nums; }
.card-profit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding: 11px 0 4px; border-top: 1px solid rgba(125, 147, 176, .12); }
.card-profit-item { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card-profit-item .card-metric-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-profit-value { font-size: clamp(17px, 1.5vw, 21px); font-weight: 590; letter-spacing: -.035em; line-height: 1.3; font-variant-numeric: tabular-nums; }
.is-profit { color: var(--mint) !important; }
.is-loss { color: var(--coral) !important; }
.is-neutral { color: #b8c5d6 !important; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 35px; margin-top: 11px; padding-top: 7px; border-top: 1px solid rgba(125, 147, 176, .1); }
.card-foot-notes { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 2px; overflow: hidden; }
.card-health, .card-mark-source { min-width: 0; overflow: hidden; color: #c79d80; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.card-mark-source { color: #758aa4; }
.card-arrow { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; color: #91a5bf; font-size: 10px; transition: color .15s ease; }
.card-arrow svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.experiment-card:hover .card-arrow { color: var(--mint); }
.empty-section { margin: 0; padding: 25px 18px; border: 1px dashed rgba(123, 145, 174, .24); border-radius: 11px; color: var(--text-muted); font-size: 12px; text-align: center; }
.archived-group { margin-top: 42px; }
.archived-group .experiment-card { opacity: .8; }
.archived-group .experiment-card:hover { opacity: 1; }

/* Login */
.login-screen { min-height: calc(100vh - 173px); display: grid; place-items: center; padding: 38px 0 50px; }
.login-panel { width: min(100%, 410px); padding: 35px 36px 32px; border: 1px solid #26364d; border-radius: 15px; background: linear-gradient(155deg, rgba(20, 33, 53, .98), rgba(15, 25, 41, .98)); box-shadow: 0 28px 70px rgba(0, 0, 0, .28); }
.login-symbol { position: relative; width: 44px; height: 44px; display: grid; place-items: center; margin: 0 0 23px; color: var(--mint); border: 1px solid rgba(87, 214, 173, .3); border-radius: 12px; background: rgba(87, 214, 173, .075); font-size: 13px; font-weight: 780; letter-spacing: -.04em; }
.login-symbol i { position: absolute; width: 5px; height: 5px; right: 6px; bottom: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px rgba(87, 214, 173, .65); }
.login-panel .eyebrow { margin-bottom: 9px; }
.login-panel h1 { margin-bottom: 9px; font-size: 27px; }
.login-description { margin-bottom: 28px; font-size: 12px; line-height: 1.7; }
.login-form > label { display: block; margin-bottom: 8px; color: #b5c1d1; font-size: 11px; font-weight: 560; }
.token-field { height: 45px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid #34465f; border-radius: 9px; background: #0d1727; transition: border-color .16s ease, box-shadow .16s ease; }
.token-field:focus-within { border-color: #5d9bdc; box-shadow: 0 0 0 3px rgba(104, 169, 255, .09); }
.token-field svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: #8295af; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.token-field input { width: 100%; min-width: 0; padding: 0; color: var(--text); border: 0; outline: 0; background: transparent; font-size: 12px; }
.token-field input::placeholder { color: #61718a; }
.login-error { margin: 9px 0 0; color: #ffaaa3; font-size: 11px; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 43px; border: 1px solid rgba(87, 214, 173, .37); border-radius: 9px; color: #071b18; background: #69d9b4; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .16s ease, transform .16s ease; }
.primary-button:hover { background: #7be3c0; transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .76; }
.primary-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-button.is-loading span::after { content: "…"; }
.privacy-note { display: flex; align-items: center; gap: 7px; margin: 13px 0 0; color: #73839a; font-size: 9px; }
.privacy-dot { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: #64768f; }
.login-submit { margin-top: 16px; }
.login-footer { align-self: end; color: #64748a; font-size: 10px; text-align: center; }
.login-footer span { margin: 0 7px; color: #3e5068; }

/* Experiment detail */
.detail-screen { padding-top: 2px; }
.detail-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.back-button { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; color: #a3b3c8; background: transparent; font-size: 11px; transition: color .15s ease; }
.back-button:hover { color: var(--mint); }
.detail-id { overflow: hidden; color: #71839d; font-size: 10px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.detail-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.detail-title-wrap { min-width: 0; }
.title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.title-line h1 { overflow-wrap: anywhere; margin: 0; }
.detail-subtitle { margin: 7px 0 0; color: #95a5bc; font-size: 11px; }
.detail-timing { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; padding-bottom: 2px; color: #8091a9; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.metric-card { min-height: 106px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px 16px 12px; border: 1px solid var(--border-soft); border-radius: 10px; background: rgba(17, 28, 46, .8); }
.metric-label { color: #91a1b7; font-size: 10px; }
.metric-label small { margin-left: 3px; color: #64758c; font-size: 9px; }
.metric-value { display: block; color: #dfe8f4; font-size: 23px; font-weight: 620; letter-spacing: -.04em; line-height: 1.22; font-variant-numeric: tabular-nums; }
.metric-value.metric-plain { color: #dfe8f4; }
.metric-foot { color: #74859c; font-size: 9px; }
.detail-panels { display: grid; grid-template-columns: minmax(280px, .79fr) minmax(0, 1.55fr); gap: 14px; margin-bottom: 15px; }
.detail-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -8px 0 16px; padding: 12px 15px; border: 1px solid rgba(120, 143, 174, .14); border-radius: 11px; background: rgba(17, 28, 44, .7); }
.telegram-control-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.telegram-control-copy strong { color: #dce7f4; font-size: 11px; font-weight: 620; }
.telegram-control-copy span { color: #7e90a8; font-size: 9px; }
.telegram-control-action { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; color: #8b9db4; font-size: 10px; }
.notification-switch { position: relative; display: inline-flex; align-items: center; width: 39px; height: 23px; padding: 3px; border: 1px solid rgba(127, 146, 170, .25); border-radius: 99px; background: #26364c; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.notification-switch[aria-checked="true"] { border-color: rgba(57, 214, 163, .45); background: rgba(57, 214, 163, .38); }
.notification-switch:disabled { opacity: .58; cursor: wait; }
.notification-switch-knob { width: 15px; height: 15px; border-radius: 50%; background: #c5d1e0; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: transform .18s ease, background .18s ease; }
.notification-switch[aria-checked="true"] .notification-switch-knob { transform: translateX(16px); background: #e8fff6; }
.panel { border: 1px solid var(--border-soft); border-radius: 11px; background: rgba(17, 28, 46, .87); }
.utilization-panel, .curve-panel { min-height: 278px; padding: 17px 19px 15px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.panel-heading .eyebrow, .trades-heading-row .eyebrow { margin-bottom: 4px; }
.panel-heading h2, .trades-heading-row h2 { margin: 0; color: #dce6f2; font-size: 14px; font-weight: 620; letter-spacing: -.015em; }
.panel-meta { padding-top: 10px; color: #8192aa; font-size: 10px; white-space: nowrap; }
.panel-meta > span { margin: 0 3px; color: #485d78; }
.donut-layout { display: flex; align-items: center; gap: 15px; margin-top: 14px; }
.donut-wrap { position: relative; width: clamp(125px, 15vw, 162px); height: clamp(125px, 15vw, 162px); flex: 0 0 auto; }
.donut-chart { display: block; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.donut-chart circle { fill: none; stroke-width: 12; }
.donut-track { stroke: #26374f; }
.donut-long, .donut-short { fill: none; stroke-linecap: butt; transition: stroke-dasharray .35s ease, stroke-dashoffset .35s ease; }
.donut-long { stroke: var(--mint); }
.donut-short { stroke: var(--coral); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center strong { color: var(--text); font-size: 19px; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.donut-center span { margin-top: 1px; color: #788ba4; font-size: 9px; }
.utilization-copy { min-width: 0; }
.utilization-fraction { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; margin: 0 0 8px; color: #8799b2; font-size: 10px; }
.utilization-fraction strong { color: #dce7f3; font-size: 17px; font-weight: 640; font-variant-numeric: tabular-nums; }
.utilization-copy > p:not(.utilization-fraction) { margin: 0; color: #798ba3; font-size: 10px; line-height: 1.65; }
.utilization-direction-legend { display: grid; gap: 5px; margin: 8px 0 9px; }
.utilization-direction-legend p { display: flex; align-items: center; gap: 6px; margin: 0; color: #8799b2; font-size: 9px; }
.utilization-direction-legend strong { margin-left: auto; color: #dce7f3; font-size: 9px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.direction-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.direction-dot-long { background: var(--mint); }
.direction-dot-short { background: var(--coral); }
.utilization-copy .utilization-overflow { margin-top: 7px !important; color: var(--coral) !important; }
.chart-legend { display: flex; align-items: center; gap: 7px; margin: 13px 0 0; color: #91a2b8; font-size: 9px; }
.legend-line { width: 16px; height: 2px; border-radius: 2px; background: var(--mint); }
.zero-legend { margin-left: auto; color: #687c95; }
.curve-chart-wrap { width: 100%; height: 171px; margin-top: 3px; overflow: hidden; }
.curve-chart { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: rgba(129, 151, 180, .11); stroke-width: 1; }
.chart-zero { stroke: rgba(159, 177, 202, .38); stroke-dasharray: 4 4; }
.chart-axis { stroke: rgba(129, 151, 180, .2); stroke-width: 1; }
.chart-axis-label { fill: #71839b; font-family: inherit; font-size: 9px; }
.curve-line { fill: none; stroke: var(--mint); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.curve-line.is-profit { stroke: var(--mint); }
.curve-line.is-loss { stroke: var(--coral); }
.curve-line.is-neutral { stroke: #8798af; }
.curve-endpoint { fill: #0e1a29; stroke: var(--mint); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.curve-endpoint.is-profit { stroke: var(--mint); }
.curve-endpoint.is-loss { stroke: var(--coral); }
.curve-endpoint.is-neutral { stroke: #8798af; }
.chart-flat { stroke: #7488a2; stroke-width: 1.7; stroke-dasharray: 5 5; }
.curve-empty { margin: -2px 0 0; color: #778aa3; font-size: 9px; }

.trades-panel { padding: 18px 0 0; overflow: hidden; }
.trades-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 0 19px 14px; }
.filter-tabs { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid rgba(120, 143, 174, .16); border-radius: 8px; background: #0e1828; }
.filter-tab { min-height: 28px; padding: 5px 10px; border-radius: 5px; color: #8b9bb1; background: transparent; font-size: 10px; transition: color .15s ease, background .15s ease; }
.filter-tab:hover { color: #d8e3ef; }
.filter-tab.is-selected { color: #d8e6f7; background: #233750; box-shadow: inset 0 0 0 1px rgba(124, 166, 214, .15); }
.trade-context { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 19px; border-top: 1px solid rgba(120, 143, 174, .1); border-bottom: 1px solid rgba(120, 143, 174, .1); color: #72849c; background: rgba(10, 18, 30, .45); font-size: 9px; }
.trade-mark-source { display: inline-flex; align-items: center; gap: 7px; }
.source-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.table-scroll { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: #344a65 #111c2e; scrollbar-width: thin; }
.trades-table { width: 100%; min-width: 890px; border-collapse: collapse; font-size: 11px; }
.trades-table thead { color: #778aa3; background: rgba(14, 24, 40, .56); }
.trades-table th { height: 37px; padding: 0 12px; font-size: 9px; font-weight: 570; text-align: left; white-space: nowrap; }
.sort-button { display: inline-flex; align-items: center; gap: 4px; padding: 0; color: inherit; border: 0; background: transparent; font: inherit; text-align: inherit; cursor: pointer; }
.sort-button:hover, .sort-button.is-active { color: #b9d7ff; }
.sort-button:focus-visible { outline: 2px solid #68a9ff; outline-offset: 3px; border-radius: 2px; }
.sort-indicator { width: 8px; color: #68a9ff; font-size: 10px; line-height: 1; text-align: center; }
.align-right .sort-button { justify-content: flex-end; width: 100%; }
.trades-table th:first-child, .trades-table td:first-child { padding-left: 19px; }
.trades-table th:last-child, .trades-table td:last-child { padding-right: 19px; }
.trades-table tbody tr { border-top: 1px solid rgba(120, 143, 174, .1); transition: background .12s ease; }
.trades-table tbody tr:hover { background: rgba(26, 43, 66, .42); }
.trades-table tbody tr.trade-open { background: var(--blue-soft); box-shadow: inset 2px 0 0 rgba(104, 169, 255, .75); }
.trades-table tbody tr.trade-open:hover { background: rgba(83, 153, 255, .16); }
.trades-table td { padding: 9px 12px; color: #a7b5c8; vertical-align: middle; white-space: nowrap; }
.align-right { text-align: right !important; }
.symbol-cell, .date-cell { display: table-cell; }
.symbol-cell strong, .symbol-cell span, .date-cell strong, .date-cell span { display: block; }
.symbol-name, .price-value { color: #d8e2ee; font-size: 11px; font-weight: 610; font-variant-numeric: tabular-nums; }
.symbol-timeframe, .date-value { margin-top: 2px; color: #7587a0; font-size: 9px; }
.horizon-cell { color: #b0bfd2 !important; font-variant-numeric: tabular-nums; }
.trade-state { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 5px; font-size: 9px; }
.trade-state-open { color: #8dbaff; background: rgba(83, 153, 255, .12); }
.trade-state-closed { color: #96a6bb; background: rgba(123, 143, 171, .1); }
.trade-direction { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 650; }
.trade-direction-arrow { font-size: 15px; line-height: 1; }
.trade-direction-long { color: #39d6a3; }
.trade-direction-short { color: #ff6575; }
.trade-direction-unknown { color: #8191a7; }
.stale-label, .missing-mark { color: var(--amber) !important; }
.missing-mark { font-size: 10px; font-weight: 600; }
.table-profit { font-size: 11px; font-weight: 610; font-variant-numeric: tabular-nums; }
.table-empty { padding: 28px 18px; color: #7d8da4; font-size: 11px; text-align: center; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 49px; padding: 7px 19px; border-top: 1px solid rgba(120, 143, 174, .1); }
.pagination-count { color: #7e8fa6; font-size: 9px; font-variant-numeric: tabular-nums; }
.pagination-actions { display: flex; align-items: center; gap: 9px; }
.pager-button { width: 28px; height: 27px; display: grid; place-items: center; padding: 3px; color: #9aabc0; border: 1px solid #2a3a51; border-radius: 6px; background: #132035; }
.pager-button:hover:not(:disabled) { color: var(--blue); border-color: #466a94; }
.pager-button:disabled { color: #4e5f76; cursor: not-allowed; opacity: .6; }
.pager-button svg { width: 15px; height: 15px; }
.page-number { min-width: 46px; color: #9aabc0; font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; }
.detail-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 12px; color: #657790; font-size: 9px; }
.detail-footer span:last-child { text-align: right; }

.app-footer { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 47px; padding: 8px 20px; border-top: 1px solid rgba(136, 160, 193, .1); color: #5e7088; font-size: 9px; }
.app-footer > span:first-child { color: #8294aa; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.footer-separator { color: #3d4e65; }

@media (max-width: 1050px) {
  main { padding-right: 28px; padding-left: 28px; }
  .topbar { padding-right: 28px; padding-left: 28px; }
  .experiment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .experiment-card { min-height: 325px; aspect-ratio: 1 / .88; }
  .experiment-card.is-archived { min-height: 300px; }
  .detail-panels { grid-template-columns: minmax(250px, .8fr) minmax(0, 1.45fr); }
  .donut-layout { gap: 9px; }
  .donut-wrap { width: 124px; height: 124px; }
}

@media (max-width: 760px) {
  .topbar { min-height: 62px; padding: 0 18px; }
  .brand { gap: 8px; }
  .brand-product, .brand-divider { display: none; }
  .topbar-tools { gap: 11px; }
  .connection-state { font-size: 0; gap: 0; }
  .connection-state .state-light { width: 8px; height: 8px; }
  .updated-at { max-width: 148px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; }
  .logout-button { font-size: 10px; }
  main { padding: 26px 18px 36px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 18px; margin: 2px 0 29px; }
  .overview-stats { width: 100%; }
  .overview-stat { min-width: 0; flex: 1; padding: 8px 10px; }
  .overview-stat strong { font-size: 16px; }
  .experiment-group { margin-top: 26px; }
  .experiment-grid { gap: 11px; }
  .experiment-card { min-height: 307px; padding: 14px 14px 12px; aspect-ratio: auto; }
  .experiment-card.is-archived { min-height: 290px; aspect-ratio: auto; }
  .card-top { gap: 8px; }
  .card-marker { width: 30px; height: 30px; }
  .card-title { font-size: 12px; }
  .card-id { font-size: 9px; }
  .card-top > .status-badge { padding: 4px 6px; font-size: 9px; }
  .card-detail-line { margin-top: 12px; }
  .card-profit-value { font-size: 17px; }
  .detail-topline { margin-bottom: 20px; }
  .detail-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .detail-controls { margin-top: -4px; }
  .detail-timing { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 6px 13px; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric-card { min-height: 96px; padding: 11px 12px 10px; }
  .metric-value { font-size: 21px; }
  .detail-panels { grid-template-columns: 1fr; gap: 10px; }
  .utilization-panel { min-height: 226px; }
  .donut-layout { justify-content: flex-start; gap: 25px; }
  .donut-wrap { width: 145px; height: 145px; }
  .curve-panel { min-height: 260px; }
  .trades-heading-row { align-items: flex-start; flex-direction: column; gap: 12px; padding: 0 14px 12px; }
  .trade-controls { width: 100%; }
  .filter-tabs { width: 100%; }
  .filter-tab { flex: 1; padding-right: 4px; padding-left: 4px; }
  .trade-context { align-items: flex-start; flex-direction: column; gap: 4px; padding: 9px 14px; }
  .trades-table th:first-child, .trades-table td:first-child { padding-left: 14px; }
  .trades-table th:last-child, .trades-table td:last-child { padding-right: 14px; }
  .pagination { padding-right: 14px; padding-left: 14px; }
  .detail-footer { flex-direction: column; gap: 5px; }
  .detail-footer span:last-child { text-align: left; }
}

@media (max-width: 520px) {
  .detail-controls { padding: 11px 12px; }
  .telegram-control-copy span { max-width: 195px; }
  .brand-mark { width: 29px; height: 29px; }
  .brand-wordmark { font-size: 11px; }
  .topbar-tools { gap: 8px; }
  .updated-at { max-width: 120px; }
  .icon-button { width: 31px; height: 31px; padding: 7px; }
  main { padding-right: 14px; padding-left: 14px; }
  .page-heading h1 { font-size: 27px; }
  .page-description { font-size: 11px; }
  .experiment-grid { grid-template-columns: 1fr; gap: 10px; }
  .experiment-card, .experiment-card.is-archived { min-height: 300px; aspect-ratio: 1 / .82; padding: 15px 16px 13px; }
  .card-top > .status-badge { padding: 4px 8px; font-size: 10px; }
  .card-title { font-size: 13px; }
  .card-profit-value { font-size: 19px; }
  .overview-stat { padding: 8px; }
  .overview-label { font-size: 9px; }
  .overview-stat strong { font-size: 15px; }
  .detail-id { max-width: 46%; font-size: 9px; }
  .detail-subtitle { line-height: 1.7; }
  .title-line { gap: 8px; }
  .title-line h1 { font-size: 24px; }
  .metric-label { font-size: 9px; }
  .metric-label small { display: block; margin-left: 0; }
  .metric-value { font-size: 19px; }
  .metric-foot { font-size: 8px; }
  .panel-heading h2, .trades-heading-row h2 { font-size: 13px; }
  .utilization-panel, .curve-panel { padding-right: 13px; padding-left: 13px; }
  .donut-layout { gap: 13px; }
  .donut-wrap { width: 125px; height: 125px; }
  .donut-center strong { font-size: 17px; }
  .panel-meta { font-size: 9px; }
  .curve-chart-wrap { height: 155px; }
  .app-footer { gap: 6px; font-size: 8px; }
  .login-panel { padding: 29px 24px 25px; }
  .login-screen { min-height: calc(100vh - 150px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
