*,
*::before,
*::after { box-sizing: border-box; }

:root {
  color-scheme: dark;
  --bg: #0d0e11;
  --label: rgba(255, 255, 255, 0.93);
  --label-2: rgba(235, 235, 245, 0.64);
  --label-3: rgba(235, 235, 245, 0.40);
  --label-4: rgba(235, 235, 245, 0.20);
  --sep: rgba(255, 255, 255, 0.07);
  --sep-2: rgba(255, 255, 255, 0.12);
  --fill: rgba(120, 120, 128, 0.22);
  --fill-2: rgba(120, 120, 128, 0.15);
  --fill-3: rgba(118, 118, 128, 0.10);
  --blue: #0A84FF;
  --green: #30D158;
  --red: #FF453A;
  --orange: #FF9F0A;
  --yellow: #FFD60A;
  --purple: #BF5AF2;
  --teal: #64D2FF;
  --pink: #FF375F;
  --indigo: #5E5CE6;
  --mint: #66D4CF;
  --gray: #8E8E93;
  --green-t: #4CE07F;
  --red-t: #FF6B61;
  --blue-t: #5AB0FF;
  --r-xl: 20px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.3, .7, .2, 1);
}

html, body { height: 100%; margin: 0; }

body {
  font: 13px/1.38 var(--font);
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  letter-spacing: -0.003em;
  font-feature-settings: "cv11", "ss01";
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 680px at 6% -12%, rgba(94, 92, 230, 0.15), transparent 62%),
    radial-gradient(900px 620px at 104% -6%, rgba(10, 132, 255, 0.10), transparent 58%),
    radial-gradient(900px 700px at 62% 122%, rgba(100, 210, 255, 0.06), transparent 62%),
    linear-gradient(180deg, #15161a 0%, #0e0f12 55%, #0b0c0e 100%);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue-t); text-decoration: none; }

::selection { background: rgba(10, 132, 255, 0.45); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.13); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.22); }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }

.ic { flex: none; display: inline-block; vertical-align: middle; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.pos { color: var(--green-t); }
.neg { color: var(--red-t); }
.muted { color: var(--label-2); }
.faint { color: var(--label-3); }
.hidden { display: none !important; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }

/* ---------- glass ---------- */

.glass {
  position: relative;
  background: linear-gradient(180deg, rgba(50, 51, 58, 0.50), rgba(32, 33, 38, 0.46));
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  border-radius: var(--r-lg);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.glass::before,
.popover::before,
.sheet::before,
.topbar-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.05) 28%, rgba(255, 255, 255, 0.025) 64%, rgba(255, 255, 255, 0.10));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card { padding: 14px 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 24px; }
.card-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.card-sub { color: var(--label-3); font-size: 12px; }

/* ---------- topbar ---------- */

.app { height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  position: relative;
  z-index: 20;
  background: linear-gradient(180deg, rgba(34, 35, 40, 0.70), rgba(22, 23, 27, 0.55));
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(145deg, #454852, #1c1d22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.45), 0 6px 16px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  flex: none;
}

.brand-text b { display: block; font-weight: 600; font-size: 14px; letter-spacing: -0.015em; }
.brand-text span { display: block; font-size: 11px; color: var(--label-3); margin-top: 1px; }

.top-right { justify-self: end; display: flex; align-items: center; gap: 10px; }

.market-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--label-2);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.07);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.account-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px 0 6px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 0.5px rgba(255, 255, 255, 0.07), 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: background .15s;
  white-space: nowrap;
}
.account-pill:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.065)); }
.account-pill .ex-ava { width: 26px; height: 26px; }
.acc-txt { text-align: left; line-height: 1.15; }
.acc-txt b { display: block; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.acc-txt small { display: block; font-size: 10.5px; color: var(--label-3); }

.ex-ava {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #111;
  flex: none;
  position: relative;
}
.ex-ava .st { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #1f2025; background: var(--green); }
.ex-ava .st.off { background: var(--gray); }
.ex-ava.finam { background: linear-gradient(145deg, #FFC94D, #FF9F0A); }
.ex-ava.hyperliquid { background: linear-gradient(145deg, #9AF5E4, #3CC8B4); }

/* ---------- segmented ---------- */

.seg {
  position: relative;
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: rgba(118, 118, 128, 0.20);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.05);
  flex: none;
}
.seg .thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.21), rgba(255, 255, 255, 0.12));
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28), inset 0 0.5px 0 rgba(255, 255, 255, 0.30);
  transition: left .3s var(--ease), width .3s var(--ease), opacity .2s;
  pointer-events: none;
}
.seg button {
  position: relative;
  z-index: 1;
  border: 0;
  background: none;
  color: var(--label-2);
  font-weight: 500;
  font-size: 12.5px;
  height: 24px;
  padding: 0 11px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color .2s;
  white-space: nowrap;
}
.seg button:hover { color: var(--label); }
.seg button.on { color: var(--label); }
.seg button:disabled { opacity: .35; cursor: default; }
.seg.icons button { padding: 0 7px; }
.seg-lg { padding: 3px; border-radius: 12px; background: rgba(118, 118, 128, 0.17); }
.seg-lg .thumb { top: 3px; bottom: 3px; border-radius: 9px; }
.seg-lg button { height: 32px; padding: 0 18px; font-size: 13.5px; border-radius: 9px; gap: 7px; }
.seg-sm button { height: 21px; padding: 0 8px; font-size: 11.5px; }

/* ---------- buttons & controls ---------- */

.btn {
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  border: 0;
  font-weight: 500;
  font-size: 13px;
  color: var(--label);
  background: var(--fill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .15s, transform .1s, opacity .15s, box-shadow .15s;
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.10);
  flex: none;
}
.btn:hover { background: rgba(120, 120, 128, 0.32); }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.plain { background: transparent; box-shadow: none; color: var(--label-2); }
.btn.plain:hover { background: rgba(255, 255, 255, 0.07); color: var(--label); }
.btn.plain.on { color: var(--blue-t); background: rgba(10, 132, 255, 0.14); }
.btn.primary {
  background: linear-gradient(180deg, #2b95ff, #0A84FF 60%, #0a78e8);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 18px rgba(10, 132, 255, 0.28);
}
.btn.primary:hover { background: linear-gradient(180deg, #3d9eff, #1a8cff 60%, #0d7ff0); }
.btn.danger { background: rgba(255, 69, 58, 0.15); color: var(--red-t); }
.btn.danger:hover { background: rgba(255, 69, 58, 0.24); }
.btn.danger-filled { background: linear-gradient(180deg, #ff5b51, #FF453A); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 18px rgba(255, 69, 58, .25); }
.btn.green { background: rgba(48, 209, 88, 0.16); color: var(--green-t); }
.btn.green:hover { background: rgba(48, 209, 88, 0.25); }
.btn.tinted { background: rgba(10, 132, 255, 0.16); color: var(--blue-t); }
.btn.tinted:hover { background: rgba(10, 132, 255, 0.25); }
.btn.icon { width: 28px; padding: 0; }
.btn.sm { height: 24px; font-size: 12px; padding: 0 9px; border-radius: 7px; }
.btn.sm.icon { width: 24px; padding: 0; }
.btn.lg { height: 36px; font-size: 14px; border-radius: 10px; padding: 0 16px; }
.btn.block { width: 100%; }
.btn .kbd { margin-left: 4px; }

.glass-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.045));
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 0.5px rgba(255, 255, 255, 0.07), 0 4px 14px rgba(0, 0, 0, 0.25);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
}
.glass-btn:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.07)); }
.glass-btn.on { background: rgba(10, 132, 255, .25); }

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 5px;
  font: 500 10.5px var(--font);
  color: var(--label-2);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .3), inset 0 0 0 .5px rgba(255, 255, 255, .08);
}

.input, .select, .textarea {
  height: 30px;
  width: 100%;
  border-radius: 8px;
  border: 0;
  background: rgba(118, 118, 128, 0.15);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08), inset 0 1px 2px rgba(0, 0, 0, 0.18);
  color: var(--label);
  padding: 0 10px;
  font-size: 13px;
  outline: none;
  transition: box-shadow .15s, background .15s;
  font-variant-numeric: tabular-nums;
}
.input:focus, .select:focus, .textarea:focus { box-shadow: 0 0 0 3.5px rgba(10, 132, 255, 0.42), inset 0 0 0 0.5px rgba(10, 132, 255, .9); background: rgba(118, 118, 128, 0.2); }
.input::placeholder, .textarea::placeholder { color: var(--label-4); }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aeaeb2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9.5l5-5 5 5M7 14.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.select option { background: #2a2b30; }
.textarea { height: auto; min-height: 110px; padding: 9px 10px; resize: vertical; line-height: 1.45; font-variant-numeric: normal; }
input[type="date"].input, input[type="time"].input { padding-right: 6px; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.8); opacity: .55; cursor: pointer; }
input[type="number"]::-webkit-inner-spin-button { opacity: .35; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field-label { font-size: 11.5px; color: var(--label-2); font-weight: 500; }
.field .hint { font-size: 11px; color: var(--label-3); line-height: 1.35; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fields-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 34px; }
.input-wrap .suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--label-3); font-size: 12px; pointer-events: none; }
.input-wrap .eye { position: absolute; right: 3px; top: 3px; }

.switch { position: relative; display: inline-block; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: rgba(120, 120, 128, 0.34); border-radius: 999px; transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35); transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch.sm { width: 34px; height: 20px; }
.switch.sm span::after { width: 16px; height: 16px; }
.switch.sm input:checked + span::after { transform: translateX(14px); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 0;
  background: rgba(120, 120, 128, 0.15);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  color: var(--label-2);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.chip:hover { color: var(--label); background: rgba(120, 120, 128, 0.24); }
.chip.on { background: rgba(10, 132, 255, 0.20); color: #a9d3ff; box-shadow: inset 0 0 0 0.5px rgba(10, 132, 255, 0.55); }
.chip .sw { width: 8px; height: 8px; border-radius: 50%; }
.chip.static { cursor: default; }
.chip.xs { height: 20px; padding: 0 7px; font-size: 11px; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--blue) var(--p, 50%), rgba(120, 120, 128, .32) var(--p, 50%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 0 0 .5px rgba(0, 0, 0, .1); cursor: pointer; }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(120, 120, 128, .32); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--blue); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; }

.check-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 8px; color: var(--label-2); cursor: pointer; user-select: none; font-size: 12.5px; }
.check-chip:hover { background: rgba(255, 255, 255, .05); color: var(--label); }
.check-chip input { display: none; }
.check-chip .box { width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); display: grid; place-items: center; transition: background .15s; }
.check-chip .box svg { opacity: 0; }
.check-chip input:checked + .box { background: var(--blue); box-shadow: none; }
.check-chip input:checked + .box svg { opacity: 1; }

/* ---------- badges ---------- */

.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.badge.long { color: var(--green-t); background: rgba(48, 209, 88, 0.14); }
.badge.short { color: var(--red-t); background: rgba(255, 69, 58, 0.14); }
.badge.gray { color: var(--label-2); background: rgba(255, 255, 255, 0.08); }
.badge.blue { color: var(--blue-t); background: rgba(10, 132, 255, 0.16); }
.badge.orange { color: #ffb84d; background: rgba(255, 159, 10, 0.15); }
.badge.purple { color: #d79bff; background: rgba(191, 90, 242, 0.16); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; display: inline-block; }
.dot.pulse { animation: pulse 2s infinite; }
.dot.orange { background: var(--orange); }
.dot.red { background: var(--red); }
.dot.gray { background: var(--gray); }
.dot.blue { background: var(--blue); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, .55); }
  70% { box-shadow: 0 0 0 7px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

/* ---------- views ---------- */

.views { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; display: none; padding: 14px 16px 16px; flex-direction: column; min-height: 0; }
.view.active { display: flex; animation: viewIn .32s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.toolbar { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 15px; flex: none; min-width: 0; }
.tb-sep { width: 0.5px; height: 22px; background: rgba(255, 255, 255, 0.12); flex: none; }
.tb-group { display: flex; align-items: center; gap: 4px; flex: none; }

.inst-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 5px;
  height: 38px;
  border-radius: 11px;
  border: 0;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .06);
  text-align: left;
  transition: background .15s;
  flex: none;
}
.inst-btn:hover { background: rgba(255, 255, 255, 0.08); }
.inst-btn b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.inst-btn small { display: block; font-size: 11px; color: var(--label-3); margin-top: -1px; }
.inst-ava {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: -.02em;
  color: #fff;
  flex: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 6px rgba(0, 0, 0, .3);
}

.sess-nav { display: flex; align-items: center; gap: 3px; flex: none; }
.sess-date {
  min-width: 214px;
  height: 38px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.sess-date:hover { background: rgba(255, 255, 255, 0.06); }
.sess-date b { font-size: 13.5px; font-weight: 600; }
.sess-date small { font-size: 11px; color: var(--label-3); }

.quote-sum { display: flex; gap: 16px; font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; }
.qs { white-space: nowrap; }
.qs small { display: block; color: var(--label-3); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.qs b { font-weight: 600; font-size: 13px; }

/* ---------- day ---------- */

.day-body { flex: 1; min-height: 0; display: flex; margin-top: 12px; }

.tri {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.28fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.pane-d { grid-column: 1; grid-row: 1; }
.pane-h { grid-column: 1; grid-row: 2; }
.pane-m { grid-column: 2; grid-row: 1 / span 2; }
.tri.max-d .pane:not(.pane-d), .tri.max-h .pane:not(.pane-h), .tri.max-m .pane:not(.pane-m) { display: none; }
.tri.max-d .pane-d, .tri.max-h .pane-h, .tri.max-m .pane-m { grid-column: 1 / -1; grid-row: 1 / -1; }

.pane-head { height: 40px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; border-bottom: 0.5px solid rgba(255, 255, 255, 0.05); user-select: none; }
.pane-title { font-weight: 600; font-size: 13px; letter-spacing: -.01em; white-space: nowrap; }
.tf-badge { font-weight: 600; font-size: 10.5px; color: var(--label-2); background: rgba(255, 255, 255, 0.075); padding: 2px 6px; border-radius: 6px; letter-spacing: .03em; }
.pane-sub { color: var(--label-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pane-actions { margin-left: auto; display: flex; gap: 2px; align-items: center; flex: none; }
.pane-body { position: relative; flex: 1; min-height: 0; }

.tchart { position: absolute; inset: 0; overflow: hidden; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.tc-host { position: absolute; inset: 0; z-index: 1; }
.tc-bg, .tc-fg { position: absolute; left: 0; top: 0; pointer-events: none; }
.tc-bg { z-index: 0; }
.tc-fg { z-index: 2; }
.tchart.drawing .tc-host { cursor: crosshair; }

.legend {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 3;
  pointer-events: none;
  font-size: 11.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  max-width: calc(100% - 96px);
  font-variant-numeric: tabular-nums;
  color: var(--label-3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.legend b { color: var(--label); font-weight: 500; }
.legend .lg-row { display: flex; gap: 8px; white-space: nowrap; }
.legend .lg-ind { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend .lg-ind i { display: inline-block; width: 9px; height: 2px; border-radius: 1px; }

.inspector { width: 312px; flex: none; display: flex; flex-direction: column; overflow: hidden; margin-left: 12px; transition: width .32s var(--ease), margin .32s var(--ease), opacity .25s; }
.inspector.closed { width: 0; margin-left: 0; opacity: 0; pointer-events: none; }
.insp-scroll { overflow: auto; flex: 1; padding: 14px 14px 18px; width: 312px; }
.insp-sec + .insp-sec { margin-top: 20px; }
.sec-title { font-size: 11px; font-weight: 600; color: var(--label-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec-title .r { text-transform: none; letter-spacing: 0; font-weight: 500; }

.big-price { display: flex; align-items: baseline; gap: 10px; }
.big-price b { font-size: 26px; font-weight: 600; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.big-price span { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--sep); border-radius: 12px; overflow: hidden; margin-top: 12px; }
.stat-grid > div { background: rgba(32, 33, 38, 0.96); padding: 8px 11px; }
.stat-grid small { display: block; font-size: 10.5px; color: var(--label-3); }
.stat-grid b { display: block; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.range-bar { margin-top: 14px; }
.range-bar .track { position: relative; height: 6px; border-radius: 6px; background: linear-gradient(90deg, rgba(255, 69, 58, .45), rgba(255, 255, 255, .12) 50%, rgba(48, 209, 88, .45)); }
.range-bar .mk { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px #24252a; }
.range-bar .mk.o { background: #aeaeb2; width: 9px; height: 9px; }
.range-bar .mk.c { background: #fff; }
.range-bar .lbl { display: flex; justify-content: space-between; font-size: 11px; color: var(--label-3); margin-top: 7px; font-variant-numeric: tabular-nums; }

.stars { display: flex; gap: 2px; }
.stars button { border: 0; background: none; padding: 2px; color: rgba(255, 255, 255, .2); transition: color .15s, transform .15s; }
.stars button.on { color: var(--yellow); }
.stars button:hover { transform: scale(1.15); }

.note-status { font-size: 11px; color: var(--label-3); display: flex; align-items: center; gap: 5px; margin-top: 7px; }
.note-list { display: flex; flex-direction: column; gap: 6px; }
.note-item { padding: 9px 11px; border-radius: 11px; background: rgba(255, 255, 255, 0.04); cursor: pointer; transition: background .15s; border: 0; text-align: left; width: 100%; }
.note-item:hover { background: rgba(255, 255, 255, 0.075); }
.note-item.cur { box-shadow: inset 0 0 0 1px rgba(10, 132, 255, .5); }
.note-item .top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; }
.note-item .txt { font-size: 12px; color: var(--label-2); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty-note { font-size: 12px; color: var(--label-3); padding: 10px 0; }

/* ---------- popovers / menus ---------- */

.popover {
  position: fixed;
  z-index: 100;
  min-width: 200px;
  background: rgba(44, 45, 52, 0.76);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  border-radius: 14px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), 0 0 0 0.5px rgba(0, 0, 0, .6);
  padding: 6px;
  opacity: 0;
  transform: scale(.97) translateY(-4px);
  transform-origin: top center;
  transition: opacity .16s, transform .22s var(--ease);
}
.popover.in { opacity: 1; transform: none; }
.popover.out { opacity: 0; transform: scale(.98); }
.menu-head { padding: 10px 10px 12px; display: flex; gap: 10px; align-items: center; }
.menu-head b { display: block; font-size: 13px; }
.menu-head small { display: block; font-size: 11.5px; color: var(--label-3); }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--label); border: 0; background: none; width: 100%; text-align: left; font-size: 13px; }
.menu-item:hover { background: rgba(255, 255, 255, 0.09); }
.menu-item .r { margin-left: auto; color: var(--label-3); font-size: 12px; display: flex; gap: 3px; }
.menu-item.danger { color: var(--red-t); }
.menu-ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, .35); }
.menu-sep { height: 0.5px; background: var(--sep-2); margin: 5px 8px; }
.menu-label { padding: 6px 10px 4px; font-size: 11px; color: var(--label-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

.ind-list { width: 270px; padding: 4px; }
.ind-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; }
.ind-row:hover { background: rgba(255, 255, 255, .05); }
.ind-row .sw { width: 14px; height: 3px; border-radius: 2px; }
.ind-row .t { flex: 1; }
.ind-row .t small { display: block; color: var(--label-3); font-size: 11px; }

.inst-list { width: 330px; }
.inst-search { padding: 4px 4px 8px; }
.inst-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.inst-row:hover { background: rgba(255, 255, 255, 0.08); }
.inst-row.cur { background: rgba(10, 132, 255, 0.18); }
.inst-row .t { flex: 1; min-width: 0; }
.inst-row .t b { font-weight: 600; }
.inst-row .t small { display: block; color: var(--label-3); font-size: 11.5px; }
.inst-row .p { text-align: right; font-variant-numeric: tabular-nums; }
.inst-row .p small { display: block; font-size: 11px; }

.cal { width: 292px; padding: 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; }
.cal-head b { font-size: 13.5px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { font-size: 10.5px; color: var(--label-3); text-align: center; padding: 3px 0; font-weight: 600; }
.cal-d { height: 34px; border-radius: 9px; border: 0; background: none; font-size: 12.5px; font-variant-numeric: tabular-nums; position: relative; color: var(--label); }
.cal-d.na { color: var(--label-4); cursor: default; }
.cal-d.up { background: rgba(48, 209, 88, var(--a, .1)); }
.cal-d.dn { background: rgba(255, 69, 58, var(--a, .1)); }
.cal-d:not(.na):hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.cal-d.sel { background: var(--blue) !important; color: #fff; font-weight: 600; }
.cal-d .nd { position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--orange); transform: translateX(-50%); }
.cal-foot { display: flex; gap: 12px; justify-content: center; font-size: 11px; color: var(--label-3); padding: 8px 0 2px; }
.cal-foot i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* ---------- modal / alerts / toasts ---------- */

.backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.38); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.backdrop.in { opacity: 1; }
.sheet {
  position: relative;
  background: rgba(36, 37, 43, 0.84);
  -webkit-backdrop-filter: blur(50px) saturate(170%);
  backdrop-filter: blur(50px) saturate(170%);
  border-radius: 22px;
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.62), 0 0 0 0.5px rgba(0, 0, 0, .7);
  transform: scale(.955) translateY(8px);
  transition: transform .3s var(--ease);
  overflow: hidden;
}
.backdrop.in .sheet { transform: none; }

.alert { width: 300px; text-align: center; padding: 22px 18px 16px; border-radius: 18px; }
.alert .a-ico { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 13px; display: grid; place-items: center; }
.alert h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.alert p { margin: 0; color: var(--label-2); font-size: 12.5px; line-height: 1.45; }
.alert .a-extra { margin-top: 12px; text-align: left; }
.alert .a-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.alert .a-btns .btn { height: 32px; }

.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  background: rgba(48, 49, 56, 0.82);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(255, 255, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .08);
  font-weight: 500;
  animation: toastIn .35s var(--ease);
  white-space: nowrap;
}
.toast small { color: var(--label-2); font-weight: 400; margin-left: 4px; }
.toast .t-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ---------- settings ---------- */

.settings { width: min(940px, calc(100vw - 48px)); height: min(660px, calc(100vh - 60px)); display: flex; }
.set-side { width: 232px; flex: none; padding: 14px 10px; background: rgba(255, 255, 255, 0.025); border-right: 0.5px solid var(--sep); display: flex; flex-direction: column; gap: 2px; }
.set-side .acc { display: flex; gap: 10px; align-items: center; padding: 8px 10px 14px; }
.set-side .acc b { display: block; font-size: 13px; }
.set-side .acc small { display: block; font-size: 11.5px; color: var(--label-3); }
.set-nav { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; border: 0; background: none; text-align: left; color: var(--label); font-size: 13px; width: 100%; }
.set-nav:hover { background: rgba(255, 255, 255, 0.06); }
.set-nav.on { background: rgba(10, 132, 255, 0.85); }
.set-nav.on .menu-ico { box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .4); }
.set-side .foot { margin-top: auto; font-size: 11px; color: var(--label-3); padding: 8px 10px 0; line-height: 1.4; }
.set-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.set-head { height: 54px; flex: none; display: flex; align-items: center; padding: 0 14px 0 24px; border-bottom: 0.5px solid var(--sep); gap: 10px; }
.set-head h2 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -.015em; }
.set-body { flex: 1; overflow: auto; padding: 18px 24px 28px; }
.set-desc { color: var(--label-2); font-size: 12.5px; margin: 0 0 16px; line-height: 1.5; }

.group { background: rgba(255, 255, 255, 0.04); border-radius: 12px; box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, .06); overflow: hidden; }
.g-title { font-size: 12px; font-weight: 600; color: var(--label-2); margin: 20px 4px 7px; display: flex; align-items: center; justify-content: space-between; }
.g-title:first-child { margin-top: 0; }
.g-note { font-size: 11.5px; color: var(--label-3); margin: 7px 4px 0; line-height: 1.45; }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 14px; min-height: 46px; }
.row + .row { border-top: 0.5px solid var(--sep); }
.row .t { flex: 1; min-width: 0; }
.row .t b { font-weight: 500; display: block; }
.row .t small { display: block; color: var(--label-3); font-size: 11.5px; margin-top: 1px; }
.row .v { color: var(--label-2); font-variant-numeric: tabular-nums; }
.row .ctl { flex: none; display: flex; align-items: center; gap: 8px; }
.row .ctl > .input, .row .ctl > .select { width: 220px; }
.row .ctl .input-wrap .input { width: 100%; }
.row.col { flex-direction: column; align-items: stretch; }

.ex-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ex-card {
  position: relative;
  padding: 14px;
  border-radius: 14px;
  border: 0;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, .07);
  display: flex;
  gap: 12px;
  align-items: center;
  transition: box-shadow .2s, background .2s;
}
.ex-card:hover { background: rgba(255, 255, 255, 0.06); }
.ex-card.on { background: rgba(10, 132, 255, 0.10); box-shadow: inset 0 0 0 1.5px var(--blue); }
.ex-card .ex-ava { width: 38px; height: 38px; font-size: 14px; }
.ex-card b { display: block; font-size: 14px; }
.ex-card small { display: block; color: var(--label-3); font-size: 11.5px; }
.ex-card .radio { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .25); display: grid; place-items: center; }
.ex-card.on .radio { background: var(--blue); box-shadow: none; }
.ex-card.on .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }

.conn-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--label-2); }
.perm { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--label-2); }
.perm span { display: inline-flex; gap: 5px; align-items: center; }

.risk-big { display: flex; align-items: baseline; gap: 8px; }
.risk-big b { font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.acc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--sep); }
.acc-grid > div { background: rgba(40, 41, 47, .96); padding: 12px 14px; }
.acc-grid small { display: block; color: var(--label-3); font-size: 11px; }
.acc-grid b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }

.job { padding: 12px 14px; }
.job + .job { border-top: 0.5px solid var(--sep); }
.job-top { display: flex; align-items: center; gap: 12px; }
.job-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 159, 10, .16); color: var(--orange); flex: none; }
.job-top .t { flex: 1; min-width: 0; }
.job-top .t b { font-weight: 600; display: block; }
.job-top .t small { display: block; color: var(--label-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-meta { display: flex; gap: 18px; margin: 9px 0 0 46px; font-size: 11.5px; color: var(--label-2); flex-wrap: wrap; }
.job-meta span { display: inline-flex; align-items: center; gap: 5px; }
.job.off .job-ico { background: rgba(255, 255, 255, .06); color: var(--label-3); }
.job.off .t b { color: var(--label-2); }
.job-progress { margin: 10px 0 0 46px; }

.progress { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, #0A84FF, #64D2FF); transition: width .25s ease; }

.job-form { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.job-form .actions { display: flex; justify-content: flex-end; gap: 8px; }

.kb-grid { display: grid; grid-template-columns: 1fr auto; gap: 9px 18px; font-size: 13px; text-align: left; }
.kb-grid span:nth-child(even) { display: flex; gap: 4px; justify-content: flex-end; }

/* ---------- backtest ---------- */

.bt { flex: 1; min-height: 0; display: flex; gap: 12px; }
.bt-side { width: 330px; flex: none; display: flex; flex-direction: column; overflow: hidden; transition: width .32s var(--ease), margin .32s var(--ease), opacity .25s; }
.bt.side-closed .bt-side { width: 0; opacity: 0; margin-right: -12px; pointer-events: none; }
.side-head { height: 48px; flex: none; display: flex; align-items: center; padding: 0 8px 0 16px; border-bottom: 0.5px solid var(--sep); width: 330px; }
.side-title { font-size: 14px; font-weight: 600; flex: 1; }
.side-scroll { flex: 1; overflow: auto; padding: 14px 16px; width: 330px; }
.side-foot { padding: 12px 16px 14px; border-top: 0.5px solid var(--sep); width: 330px; }
.side-sec + .side-sec { margin-top: 20px; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.strat-desc { font-size: 11.5px; color: var(--label-3); line-height: 1.45; margin-top: 2px; }
.params-box { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .05); }

.run-list { display: flex; flex-direction: column; gap: 6px; }
.run-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 11px; background: rgba(255, 255, 255, 0.035); border: 0; text-align: left; width: 100%; transition: background .15s; }
.run-item:hover { background: rgba(255, 255, 255, 0.07); }
.run-item.cur { box-shadow: inset 0 0 0 1px rgba(10, 132, 255, .55); background: rgba(10, 132, 255, .08); }
.run-item .t { flex: 1; min-width: 0; }
.run-item .t b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-item .t small { display: block; font-size: 11px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-item .r { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 600; }
.run-item .r small { display: block; font-weight: 400; font-size: 11px; color: var(--label-3); }
.run-del { opacity: 0; }
.run-item:hover .run-del { opacity: 1; }

.bt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.bt-bar { height: 40px; flex: none; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13px; }
.crumbs button { border: 0; background: none; color: var(--label-2); padding: 4px 8px; border-radius: 7px; white-space: nowrap; font-weight: 500; }
.crumbs button:hover { background: rgba(255, 255, 255, 0.06); color: var(--label); }
.crumbs button.cur { color: var(--label); font-weight: 600; cursor: default; background: none; }
.crumbs .sep { color: var(--label-4); }
.bt-bar-actions { margin-left: auto; display: flex; gap: 8px; }
.bt-content { flex: 1; min-height: 0; overflow: auto; padding-right: 2px; position: relative; }
.bt-content.fill { overflow: hidden; display: flex; flex-direction: column; }

.page { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; padding: 2px 2px 4px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.025em; display: flex; align-items: center; gap: 10px; }
.page-head .sub { color: var(--label-2); font-size: 12.5px; margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head .act { margin-left: auto; display: flex; gap: 8px; }

.kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.kpis .kpi .v { font-size: 19px; }
@media (max-width: 1500px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis .kpi .v { font-size: 21px; } }
.kpi { padding: 13px 15px 12px; border-radius: 15px; }
.kpi small { color: var(--label-3); font-size: 11.5px; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.kpi .v { font-size: 21px; font-weight: 600; letter-spacing: -.025em; margin-top: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .s { font-size: 11.5px; color: var(--label-3); margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 340px; }
.legend-inline { display: flex; gap: 14px; margin-left: auto; font-size: 12px; color: var(--label-2); }
.legend-inline span { display: inline-flex; gap: 6px; align-items: center; }
.legend-inline i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 12.5px; }
.kv dt { color: var(--label-3); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv-sep { grid-column: 1 / -1; height: .5px; background: var(--sep); margin: 3px 0; }

.tbl-wrap { overflow: auto; border-radius: 10px; }
.tbl-wrap.scroll { max-height: 430px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tbl th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--label-3);
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--sep-2);
  background: rgba(36, 37, 42, 0.96);
  white-space: nowrap;
  user-select: none;
}
.tbl th.sort { cursor: pointer; }
.tbl th.sort:hover { color: var(--label); }
.tbl th.sorted { color: var(--label); }
.tbl th .arr { font-size: 9px; margin-left: 3px; }
.tbl td { padding: 8px 10px; border-bottom: 0.5px solid var(--sep); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: rgba(255, 255, 255, 0.035); }
.tbl tbody tr.cur td { background: rgba(10, 132, 255, 0.10); }
.tbl .sym { display: flex; align-items: center; gap: 9px; }
.tbl .sym .inst-ava { width: 24px; height: 24px; border-radius: 7px; font-size: 8.5px; }
.tbl .sym b { font-weight: 600; }
.tbl .sym small { display: block; color: var(--label-3); font-size: 11px; }
.tbl .go { color: var(--label-3); }
.tbl tbody tr.click:hover .go { color: var(--blue-t); }

.heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.heat th { color: var(--label-3); font-weight: 500; font-size: 10.5px; padding: 2px; text-align: center; }
.heat th:first-child { text-align: left; }
.heat td { height: 30px; border-radius: 7px; text-align: center; padding: 0 2px; }
.heat td.na { background: rgba(255, 255, 255, 0.025); color: var(--label-4); }
.heat td.y { text-align: left; color: var(--label-2); font-weight: 600; background: none; }

.hist { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 6px; }
.hist .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.hist .b i { display: block; width: 100%; border-radius: 4px 4px 2px 2px; min-height: 2px; }
.hist .b span { font-size: 10px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.hist-x { display: flex; gap: 4px; margin-top: 5px; }
.hist-x span { flex: 1; text-align: center; font-size: 10px; color: var(--label-3); }

.progress-wrap { position: absolute; inset: 0; display: grid; place-items: center; z-index: 5; }
.progress-card { width: 380px; padding: 26px 26px 22px; border-radius: 22px; text-align: center; }
.progress-card h3 { margin: 14px 0 4px; font-size: 16px; font-weight: 600; }
.progress-card p { margin: 0 0 16px; color: var(--label-2); font-size: 12.5px; min-height: 18px; }
.spinner { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .1); border-top-color: var(--blue); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { display: flex; justify-content: space-between; margin-top: 14px; font-size: 11px; color: var(--label-3); }
.steps span.done { color: var(--green-t); }
.steps span.cur { color: var(--label); }

.empty-state { display: grid; place-items: center; height: 100%; text-align: center; color: var(--label-2); }
.empty-state .ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 14px; background: rgba(255, 255, 255, .05); color: var(--label-3); }
.empty-state h3 { margin: 0 0 6px; color: var(--label); font-size: 16px; }

.trade-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tv-nav { display: flex; align-items: center; gap: 2px; }
.tv-nav span { padding: 0 8px; font-size: 12.5px; color: var(--label-2); white-space: nowrap; }
.tv-nav span b { color: var(--label); }
.tv-sum { font-size: 12.5px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tv-sum b { color: var(--label); font-weight: 600; }
.tv-body { flex: 1; min-height: 0; display: flex; margin-top: 12px; }

.trade-pnl { font-size: 26px; font-weight: 600; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.trade-pnl-sub { font-size: 12.5px; color: var(--label-2); font-variant-numeric: tabular-nums; margin-top: 2px; }

.checks { display: flex; flex-direction: column; gap: 1px; border-radius: 12px; overflow: hidden; background: var(--sep); }
.check { display: flex; gap: 10px; padding: 8px 10px; background: rgba(32, 33, 38, .96); align-items: flex-start; }
.check .ci { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; background: rgba(48, 209, 88, .18); color: var(--green-t); }
.check .ci.info { background: rgba(10, 132, 255, .18); color: var(--blue-t); }
.check .ct { flex: 1; min-width: 0; font-size: 12px; line-height: 1.35; }
.check .ct small { display: block; color: var(--label-3); font-size: 11.5px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.calc { font-size: 12px; color: var(--label-2); line-height: 1.6; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .035); font-variant-numeric: tabular-nums; }
.calc b { color: var(--label); font-weight: 500; }

.mini-trades { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; }
.mini-trade { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; border: 0; background: none; text-align: left; font-size: 12px; font-variant-numeric: tabular-nums; width: 100%; }
.mini-trade:hover { background: rgba(255, 255, 255, .06); }
.mini-trade.cur { background: rgba(10, 132, 255, .16); }
.mini-trade .n { color: var(--label-3); }

/* ---------- live ---------- */

.live { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: auto; padding-right: 2px; }
.live-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(250px, 1.35fr); gap: 12px; flex: none; }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; flex: 1; min-height: 560px; }
.live-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.live-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.pos-card { flex: none; }
.live-chart-card { flex: 1; min-height: 300px; display: flex; flex-direction: column; overflow: hidden; }
.live-chart-card .pane-body { flex: 1; }
.risk-ctl { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.stepper { display: inline-flex; border-radius: 8px; background: rgba(120, 120, 128, .2); overflow: hidden; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .06); }
.stepper button { width: 28px; height: 26px; border: 0; background: none; color: var(--label); display: grid; place-items: center; }
.stepper button:hover { background: rgba(255, 255, 255, .08); }
.stepper button + button { border-left: .5px solid rgba(255, 255, 255, .12); }

.flash-up td.px { animation: fu .9s ease; }
.flash-dn td.px { animation: fd .9s ease; }
@keyframes fu { from { background: rgba(48, 209, 88, .22); } to { background: transparent; } }
@keyframes fd { from { background: rgba(255, 69, 58, .22); } to { background: transparent; } }
.tbl tr.leaving td { opacity: 0; transition: opacity .35s; }

.strat-list { display: flex; flex-direction: column; gap: 8px; }
.strat { padding: 12px; border-radius: 13px; background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .05); }
.strat-top { display: flex; align-items: center; gap: 10px; }
.strat-top .t { flex: 1; min-width: 0; }
.strat-top .t b { display: block; font-weight: 600; }
.strat-top .t small { display: block; color: var(--label-3); font-size: 11.5px; }
.st-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; height: 22px; padding: 0 8px; border-radius: 999px; }
.st-pill.run { color: var(--green-t); background: rgba(48, 209, 88, .12); }
.st-pill.pause { color: #ffb84d; background: rgba(255, 159, 10, .13); }
.strat-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.strat-meta small { display: block; color: var(--label-3); font-size: 10.5px; }
.strat-meta b { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.strat-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.strat-foot .chips { flex: 1; }

.log { flex: 1; min-height: 200px; overflow: auto; display: flex; flex-direction: column; }
.log-item { display: grid; grid-template-columns: 44px 20px 1fr; gap: 8px; align-items: start; padding: 7px 4px; border-bottom: 0.5px solid var(--sep); font-size: 12px; animation: logIn .4s var(--ease); }
.log-item:last-child { border-bottom: 0; }
.log-item .tm { color: var(--label-3); font-variant-numeric: tabular-nums; padding-top: 1px; }
.log-item .li { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; }
.log-item .lt small { display: block; color: var(--label-3); font-size: 11.5px; }
@keyframes logIn { from { opacity: 0; transform: translateY(-4px); background: rgba(10, 132, 255, .08); } to { opacity: 1; transform: none; } }

.empty-row td { text-align: center; color: var(--label-3); padding: 26px 10px !important; }

@media (max-width: 1280px) {
  .live-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .quote-sum .qs.opt { display: none; }
}
@media (max-width: 1100px) {
  .live-grid { grid-template-columns: 1fr; flex: none; min-height: 0; }
  .market-chip { display: none; }
  .brand-text { display: none; }
}

.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; }

/* ---------- responsive · планшеты ≤1080 ---------- */

@media (min-width: 701px) and (max-width: 1100px) {
  .brand-text { display: block; }
}

@media (max-width: 1080px) {
  .app { height: 100dvh; }

  /* тулбары: прокрутка по горизонтали + залипание сверху */
  .toolbar { position: sticky; top: 0; z-index: 6; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; background: linear-gradient(180deg, rgba(44, 45, 52, .90), rgba(30, 31, 36, .86)); }
  .toolbar::-webkit-scrollbar { display: none; }
  .quote-sum { overflow: visible; flex: none; }

  /* день: графики сеткой 2×2, инспектор снизу */
  #view-day { overflow-y: auto; overflow-x: hidden; }
  .day-body { flex: none; flex-direction: column; }
  .tri { flex: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 300px 380px; }
  .pane-d { grid-column: 1; grid-row: 1; }
  .pane-h { grid-column: 2; grid-row: 1; }
  .pane-m { grid-column: 1 / -1; grid-row: 2; }
  .inspector { width: auto; margin: 12px 0 0; transition: margin .32s var(--ease), opacity .25s, height .32s var(--ease); }
  .inspector.closed { height: 0; margin: 0; }
  .insp-scroll { width: auto; overflow: visible; }

  /* бэктест: форма сверху, страница прокручивается целиком */
  #view-backtest { overflow-y: auto; overflow-x: hidden; }
  .bt { flex: none; flex-direction: column; }
  .bt-side { width: auto; }
  .bt.side-closed .bt-side { display: none; }
  .side-head, .side-scroll, .side-foot { width: auto; }
  .side-scroll { overflow: visible; }
  .bt-bar { position: sticky; top: 0; z-index: 6; height: auto; min-height: 40px; padding: 2px 8px; border-radius: 10px; background: linear-gradient(180deg, rgba(18, 19, 23, .94), rgba(18, 19, 23, .80)); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .bt-content { overflow: visible; }
  .bt-content.fill { display: block; overflow: visible; }
  .trade-view { flex: none; }
  .tv-body { flex: none; flex-direction: column; }
  .progress-wrap { position: static; min-height: 62vh; padding: 24px 0; }
  .empty-state { height: auto; min-height: 62vh; }
}

/* ---------- responsive · телефоны ≤700 ---------- */

@media (max-width: 700px) {
  /* шапка в две строки */
  .topbar { height: auto; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; row-gap: 9px; column-gap: 10px; padding: 8px 12px 10px; }
  .brand { grid-column: 1; grid-row: 1; }
  .brand-text { display: none; }
  .top-right { grid-column: 3; grid-row: 1; }
  #modeSeg { grid-column: 1 / -1; grid-row: 2; display: flex; }
  #modeSeg button { flex: 1; padding: 0 8px; }
  .account-pill { height: 34px; }

  .view { padding: 10px 10px 12px; }
  .toolbar { padding: 6px 8px; }
  .sess-date { min-width: 0; padding: 0 6px; }
  .sess-date small { display: none; }
  #dInd span { display: none; }
  .quote-sum { gap: 12px; }

  /* день: графики колонкой */
  .tri { display: flex; flex-direction: column; gap: 10px; }
  .pane { height: 280px; }
  .pane-m { height: 340px; }
  .tri.max-d, .tri.max-h, .tri.max-m { min-height: calc(100vh - 200px); min-height: calc(100dvh - 200px); }
  .tri.max-d .pane-d, .tri.max-h .pane-h, .tri.max-m .pane-m { height: auto; flex: 1; }
  .insp-scroll { padding: 12px 12px 16px; }

  /* бэктест */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis .kpi .v { font-size: 18px; }
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-head h1 { font-size: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .chart-box, .chart-box.tall { height: 240px; }
  .card { padding: 12px; }
  .card-head { flex-wrap: wrap; row-gap: 6px; }
  .legend-inline { margin-left: 0; }
  .heat { font-size: 10px; }
  .heat td { height: 26px; }
  .heat th { font-size: 9.5px; }
  .progress-card { width: min(380px, calc(100vw - 28px)); }
  .bt-bar { flex-wrap: wrap; row-gap: 4px; }
  .crumbs { flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
  .crumbs::-webkit-scrollbar { display: none; }

  /* live */
  .live { gap: 10px; }
  .live-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .live-kpis .kpi:nth-child(5), .live-kpis .kpi:nth-child(6) { grid-column: 1 / -1; }
  .live-grid { gap: 10px; }
  .live-chart-card { min-height: 260px; }

  /* настройки: секции — горизонтальные чипы */
  .settings { flex-direction: column; width: calc(100vw - 16px); height: calc(100vh - 32px); height: calc(100dvh - 32px); }
  .set-side { width: auto; flex-direction: row; align-items: center; gap: 6px; padding: 8px 10px; overflow-x: auto; border-right: 0; border-bottom: .5px solid var(--sep); scrollbar-width: none; }
  .set-side::-webkit-scrollbar { display: none; }
  .set-side .acc, .set-side .foot { display: none; }
  .set-nav { width: auto; flex: none; background: rgba(255, 255, 255, .05); padding: 6px 10px; }
  .set-nav span { white-space: nowrap; }
  .set-head { height: 48px; padding: 0 10px 0 14px; }
  .set-body { padding: 14px 14px 22px; }
  .row { flex-wrap: wrap; row-gap: 8px; }
  .row .ctl { flex: 1 1 100%; }
  .row .ctl > .input, .row .ctl > .select, .row .ctl .input-wrap { width: 100% !important; }
  .ex-cards { grid-template-columns: 1fr; }
  .acc-grid { grid-template-columns: 1fr 1fr; }
  .job-top { flex-wrap: wrap; row-gap: 6px; }
  .job-meta, .job-progress { margin-left: 0; }

  /* поповеры, тосты, модалки */
  .inst-list { width: min(330px, calc(100vw - 20px)); }
  .cal { width: min(292px, calc(100vw - 20px)); }
  .ind-list { width: min(270px, calc(100vw - 20px)); }
  .toast { white-space: normal; max-width: calc(100vw - 24px); border-radius: 18px; }
  .alert { width: min(300px, calc(100vw - 32px)); }
}

@media (max-width: 380px) {
  .acc-txt small { display: none; }
}
