:root {
  --bg: #07100f;
  --surface: rgba(15, 28, 25, 0.82);
  --surface-strong: #10211e;
  --surface-soft: rgba(25, 42, 38, 0.74);
  --border: rgba(205, 229, 218, 0.12);
  --border-strong: rgba(205, 229, 218, 0.2);
  --text: #edf5f1;
  --muted: #8fa59b;
  --faint: #5e746a;
  --mint: #63e6b2;
  --mint-deep: #1eb980;
  --amber: #f0bc72;
  --red: #ff7b77;
  --blue: #85aefb;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(28, 126, 94, 0.13), transparent 28%),
    radial-gradient(circle at 85% 5%, rgba(96, 123, 204, 0.1), transparent 24%),
    linear-gradient(150deg, #06100e 0%, #091411 55%, #07100f 100%);
}

button { font: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 380px;
  height: 380px;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.14;
  pointer-events: none;
}

.ambient-one { top: 15%; left: -180px; background: var(--mint-deep); }
.ambient-two { right: -180px; bottom: 8%; background: #4169ad; }

.shell {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 44px 0 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 34px;
}

.eyebrow, .section-kicker {
  color: var(--mint);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.19em;
}

h1 {
  margin: 10px 0 6px;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 55px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.dashboard-title-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 16px; }
.dashboard-features { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 12px; }
.dashboard-features span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(99, 230, 178, 0.18);
  border-radius: 999px;
  background: rgba(99, 230, 178, 0.055);
  color: #a6c7b8;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.07em;
}

.lede { margin: 0; color: var(--muted); font-size: 15px; }

.topbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
.strategy-controls { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 12px; }

.strategy-author {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  overflow: hidden;
  border: 1px solid rgba(240, 188, 114, 0.32);
  border-radius: 999px;
  background: linear-gradient(115deg, rgba(240, 188, 114, 0.1), rgba(17, 31, 27, 0.76));
  box-shadow: inset 0 0 0 1px rgba(255, 225, 169, 0.025), 0 0 22px rgba(240, 188, 114, 0.055);
  white-space: nowrap;
}

.strategy-author::after {
  position: absolute;
  z-index: -1;
  inset: -2px;
  background: linear-gradient(105deg, transparent 34%, rgba(255, 235, 196, 0.18) 50%, transparent 66%);
  content: "";
  opacity: 0;
  transform: translateX(-105%);
  animation: strategy-author-glint 3.6s ease-in-out infinite;
}

.strategy-author span {
  color: #a9bdb4;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.strategy-author strong {
  color: #ffe0a6;
  font-size: 12px;
  letter-spacing: 0.035em;
  text-shadow: 0 0 14px rgba(240, 188, 114, 0.32);
}

@keyframes strategy-author-glint {
  0%, 66% { opacity: 0; transform: translateX(-105%); }
  74% { opacity: 0.8; }
  88%, 100% { opacity: 0; transform: translateX(105%); }
}

.environment-pill, .connection-pill, .refresh-button, .release-button, .logic-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(17, 31, 27, 0.7);
  color: var(--muted);
  backdrop-filter: blur(16px);
}

.environment-pill {
  color: var(--blue);
  border-color: rgba(133, 174, 251, 0.28);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.environment-pill.production {
  color: #ffaaa6;
  border-color: rgba(255, 123, 119, 0.42);
  background: rgba(92, 33, 31, 0.34);
}

.environment-pill.offline,
.environment-pill.unknown {
  color: var(--amber);
  border-color: rgba(240, 188, 114, 0.3);
}

.environment-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.connection-pill { font-size: 13px; }
.connection-pill.disconnected { color: var(--red); border-color: rgba(255, 123, 119, 0.3); }
.connection-pill.stale { color: var(--amber); border-color: rgba(240, 188, 114, 0.3); }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(99, 230, 178, 0.42);
  animation: pulse 2s infinite;
}

.disconnected .pulse-dot { background: var(--red); animation: none; }
.stale .pulse-dot { background: var(--amber); animation: none; }

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(99, 230, 178, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 230, 178, 0); }
}

.refresh-button, .release-button, .logic-button {
  cursor: pointer;
  color: var(--text);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.refresh-button:hover, .release-button:hover, .logic-button:hover { transform: translateY(-1px); border-color: var(--border-strong); background: var(--surface-soft); }
.release-button { color: var(--blue); }
.logic-button { color: var(--mint); }
.logic-button-shell { position: relative; display: inline-flex; }
.logic-access-notice {
  position: absolute;
  z-index: 12;
  top: calc(100% + 10px);
  left: 50%;
  width: max-content;
  max-width: min(220px, 80vw);
  padding: 8px 11px;
  visibility: hidden;
  border: 1px solid rgba(240, 188, 114, 0.28);
  border-radius: 9px;
  background: #182018;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.36);
  color: #e9c999;
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -5px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}
.logic-access-notice::before {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-top: 1px solid rgba(240, 188, 114, 0.28);
  border-left: 1px solid rgba(240, 188, 114, 0.28);
  background: #182018;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}
.logic-access-notice.visible { visibility: visible; opacity: 1; transform: translate(-50%, 0); }
.refresh-button:disabled { cursor: wait; opacity: 0.6; }
.refresh-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.refresh-button.loading svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-banner, .warning-panel {
  margin-bottom: 22px;
  padding: 15px 18px;
  border: 1px solid rgba(255, 123, 119, 0.25);
  border-radius: 14px;
  background: rgba(92, 33, 31, 0.34);
  color: #ffc0bd;
  font-size: 14px;
}

.hidden { display: none !important; }

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card {
  position: relative;
  min-height: 132px;
  padding: 21px 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(20, 38, 33, 0.9), rgba(10, 24, 20, 0.82));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.14);
}

.metric-card::after {
  position: absolute;
  right: -34px;
  bottom: -52px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(99, 230, 178, 0.1);
  border-radius: 999px;
  content: "";
}

.metric-label { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }
.metric-value { margin-top: 16px; font-size: clamp(24px, 2.4vw, 34px); font-weight: 620; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.metric-note { margin-top: 7px; color: var(--faint); font-size: 12px; }
.positive { color: var(--mint) !important; }
.negative { color: var(--red) !important; }
.warning { color: var(--amber) !important; }

.equity-panel {
  position: relative;
  margin: 0 0 14px;
  padding: 24px 26px 18px;
  overflow: hidden;
  border: 1px solid rgba(126, 222, 185, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 78% -30%, rgba(103, 157, 255, 0.16), transparent 38%),
    linear-gradient(145deg, rgba(15, 35, 29, 0.94), rgba(7, 20, 17, 0.9));
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.18);
}

.equity-panel::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(99, 230, 178, 0.035) 48%, transparent 73%);
  content: "";
  pointer-events: none;
  transform: translateX(-80%);
  animation: equity-sheen 9s ease-in-out infinite;
}

@keyframes equity-sheen {
  0%, 58% { transform: translateX(-85%); }
  82%, 100% { transform: translateX(85%); }
}

.equity-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.equity-header h2 { margin: 7px 0 5px; font-size: 22px; letter-spacing: -0.02em; }
.equity-header p { margin: 0; color: var(--muted); font-size: 11px; }

.equity-period-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(4, 15, 12, 0.56);
}

.equity-period-tabs button {
  min-width: 55px;
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.equity-period-tabs button:hover { color: var(--text); transform: translateY(-1px); }
.equity-period-tabs button[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(76, 210, 157, 0.22), rgba(87, 140, 230, 0.18));
  color: var(--mint);
  box-shadow: inset 0 0 0 1px rgba(99, 230, 178, 0.16), 0 6px 22px rgba(19, 113, 78, 0.12);
}

.equity-summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 4px;
}

.equity-summary-item {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(205, 229, 218, 0.08);
  border-radius: 13px;
  background: rgba(5, 17, 14, 0.38);
}

.equity-summary-item span { display: block; color: var(--faint); font-size: 9px; letter-spacing: 0.07em; }
.equity-summary-item strong { display: block; margin-top: 6px; overflow: hidden; color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }

.equity-chart-shell { position: relative; z-index: 1; min-height: 280px; }
.equity-chart { min-height: 280px; }
.equity-svg { display: block; width: 100%; min-width: 620px; height: auto; overflow: visible; }
.equity-grid-line line { stroke: rgba(197, 222, 211, 0.07); stroke-width: 1; stroke-dasharray: 4 8; }
.equity-grid-line text, .equity-axis-label { fill: var(--faint); font-family: inherit; font-size: 10px; font-variant-numeric: tabular-nums; }
.equity-area { fill: url(#equity-area-gradient); }
.equity-line-glow { fill: none; stroke: rgba(99, 230, 178, 0.28); stroke-width: 9; filter: url(#equity-glow); opacity: 0.55; }
.equity-line { fill: none; stroke: url(#equity-line-gradient); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.equity-point { cursor: crosshair; outline: none; }
.equity-point-halo { fill: rgba(99, 230, 178, 0.08); stroke: rgba(99, 230, 178, 0.28); stroke-width: 1; transition: r 180ms ease, fill 180ms ease; }
.equity-point-core { fill: #83efc5; stroke: #0c211a; stroke-width: 2.5; transition: r 180ms ease; }
.equity-point:hover .equity-point-halo, .equity-point:focus .equity-point-halo { r: 15; fill: rgba(99, 230, 178, 0.18); }
.equity-point:hover .equity-point-core, .equity-point:focus .equity-point-core { r: 5.5; }
.equity-point-tooltip {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.equity-point-tooltip rect {
  fill: rgba(5, 18, 15, 0.96);
  stroke: rgba(99, 230, 178, 0.34);
  stroke-width: 1;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.34));
}
.equity-point-tooltip text {
  fill: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.equity-point:hover .equity-point-tooltip,
.equity-point:focus .equity-point-tooltip {
  visibility: visible;
  opacity: 1;
}
.equity-point.current .equity-point-halo { transform-box: fill-box; transform-origin: center; animation: equity-point-pulse 2.2s ease-out infinite; }

@keyframes equity-point-pulse {
  0% { opacity: 0.85; transform: scale(0.7); }
  70%, 100% { opacity: 0; transform: scale(1.85); }
}

.equity-svg.animate-in .equity-line,
.equity-svg.animate-in .equity-line-glow {
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation: equity-line-draw 900ms cubic-bezier(0.22, 0.78, 0.2, 1) forwards;
}

.equity-svg.animate-in .equity-area { opacity: 0; animation: equity-area-rise 650ms 420ms ease forwards; }
.equity-svg.animate-in .equity-point { opacity: 0; animation: equity-dot-rise 280ms calc(500ms + var(--point-delay)) ease forwards; }
@keyframes equity-line-draw { to { stroke-dashoffset: 0; } }
@keyframes equity-area-rise { to { opacity: 1; } }
@keyframes equity-dot-rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.equity-loading, .equity-empty {
  display: grid;
  min-height: 280px;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.equity-loading span, .equity-empty-orbit {
  width: 30px;
  height: 30px;
  margin-bottom: 13px;
  border: 1px solid rgba(99, 230, 178, 0.18);
  border-top-color: var(--mint);
  border-radius: 99px;
  animation: spin 1.1s linear infinite;
}

.equity-loading strong, .equity-empty strong { color: #bdd0c7; font-size: 12px; }
.equity-empty p { max-width: 420px; margin: 7px 0 0; color: var(--faint); font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.health-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 30px;
}

.position-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: -8px 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(12, 27, 23, 0.62);
}

.position-filter { display: grid; flex: 1 1 320px; max-width: 480px; gap: 7px; }
.position-filter span { color: var(--faint); font-size: 10px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.position-filter input {
  width: 100%;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: rgba(5, 15, 12, 0.7);
  color: var(--text);
  font: inherit;
}
.position-filter input:focus { border-color: rgba(99, 230, 178, 0.48); box-shadow: 0 0 0 3px rgba(99, 230, 178, 0.08); }
.position-filter input::placeholder { color: var(--faint); }
.filter-clear, .table-pagination button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(20, 39, 33, 0.72);
  color: var(--muted);
  cursor: pointer;
}
.filter-clear:hover, .table-pagination button:not(:disabled):hover { border-color: var(--border-strong); color: var(--text); }
.position-filter-status { margin-left: auto; padding-bottom: 11px; color: var(--muted); font-size: 12px; white-space: nowrap; }

.health-chip, .badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(14, 29, 25, 0.58);
}

.health-chip { padding: 7px 11px; font-size: 12px; }
.health-chip::before { width: 5px; height: 5px; border-radius: 99px; background: var(--mint); content: ""; }
.health-chip.warn::before { background: var(--amber); }
.health-chip.bad::before { background: var(--red); }

.strategy-list { display: grid; gap: 22px; }

.strategy-panel, .history-panel, .warning-panel {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(17, 33, 29, 0.91), rgba(8, 21, 18, 0.88));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.strategy-panel { padding: 0; }

.strategy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--border);
}

.strategy-title-row { display: flex; align-items: center; gap: 12px; }
.strategy-icon { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid rgba(99, 230, 178, 0.18); border-radius: 12px; background: rgba(99, 230, 178, 0.08); color: var(--mint); font-size: 16px; }
.strategy-header h2, .warning-panel h2 { margin: 0; font-size: 18px; font-weight: 620; letter-spacing: -0.02em; }
.strategy-subtitle { margin: 6px 0 0 51px; color: var(--muted); font-size: 12px; }
.strategy-summary { display: flex; align-items: center; gap: 24px; text-align: right; }
.strategy-summary-item span { display: block; color: var(--faint); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.strategy-summary-item strong { display: block; margin-top: 4px; font-size: 15px; font-variant-numeric: tabular-nums; }

.badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-transform: uppercase;
}
.badge.holding, .badge.long, .badge.protected { color: var(--mint); border-color: rgba(99, 230, 178, 0.22); background: rgba(99, 230, 178, 0.07); }
.badge.short { color: var(--red); border-color: rgba(255, 123, 119, 0.22); background: rgba(255, 123, 119, 0.07); }
.badge.waiting { color: var(--muted); }
.badge.pending { color: var(--amber); border-color: rgba(240, 188, 114, 0.24); }
.badge.unprotected { color: var(--red); border-color: rgba(255, 123, 119, 0.3); }
.badge.reduced { color: var(--blue); border-color: rgba(133, 174, 251, 0.25); }

.positions-table { width: 100%; min-width: 1080px; border-collapse: collapse; table-layout: fixed; }
.position-col-contract { width: 17%; }
.position-col-holding { width: 17%; }
.position-col-price { width: 13%; }
.position-col-exposure { width: 16%; }
.position-col-pnl { width: 10%; }
.position-col-protection { width: 17%; }
.position-col-time { width: 10%; }
.positions-table th { padding: 13px 15px; color: var(--faint); font-size: 10px; font-weight: 650; letter-spacing: 0.09em; text-align: left; text-transform: uppercase; }
.positions-table td { padding: 17px 15px; border-top: 1px solid rgba(205, 229, 218, 0.075); font-size: 13px; text-align: left; vertical-align: middle; font-variant-numeric: tabular-nums; }
.positions-table tr { transition: background 150ms ease; }
.positions-table tbody tr:hover { background: rgba(113, 165, 144, 0.045); }
.position-symbol-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.symbol-name { display: block; font-size: 14px; font-weight: 700; letter-spacing: 0.01em; }
.symbol-meta { display: block; margin-top: 5px; color: var(--faint); font-size: 10px; }
.position-pattern { display: block; margin-top: 7px; color: var(--mint); font-size: 11px; font-weight: 650; }
.manual-close-button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid rgba(255, 123, 119, 0.3);
  border-radius: 8px;
  background: rgba(92, 33, 31, 0.22);
  color: #ffaaa6;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition: 150ms ease;
}
.manual-close-button:hover { border-color: rgba(255, 123, 119, 0.56); background: rgba(92, 33, 31, 0.42); }
.manual-close-button:disabled { cursor: not-allowed; opacity: 0.36; }
.position-badges { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 5px; }
.position-cell-note { display: block; margin-top: 4px; color: var(--faint); font-size: 10px; line-height: 1.4; }
.position-metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 2px; }
.position-metric-grid-single { grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
.position-metric { display: block; min-width: 0; }
.position-metric small { display: block; color: var(--faint); font-size: 10px; white-space: nowrap; }
.position-metric strong { display: block; margin-top: 5px; color: var(--text); font-size: 12px; font-weight: 620; line-height: 1.35; white-space: nowrap; }
.position-config { display: inline-flex; align-items: center; justify-content: flex-start; gap: 7px; margin-top: 11px; white-space: nowrap; }
.position-config-inline { margin-top: 0; }
.position-config strong { color: var(--text); font-size: 12px; font-weight: 650; }
.pnl-cell strong { display: block; font-size: 14px; white-space: nowrap; }
.pnl-cell small { display: block; margin-top: 4px; color: var(--muted); }
.position-opened-at { display: block; color: var(--text); font-size: 11px; line-height: 1.5; white-space: normal; }
.stop-cell strong, .stop-cell span { display: block; }
.stop-cell span { margin-top: 4px; color: var(--faint); font-size: 10px; }
.order-stack { min-width: 0; }
.order-line { display: block; padding: 5px 0; }
.order-line + .order-line { border-top: 1px solid rgba(205, 229, 218, 0.07); }
.order-line b { color: var(--text); font-size: 10px; font-weight: 650; }
.order-line em { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-style: normal; line-height: 1.4; }
.order-line.local b { color: var(--blue); }
.order-line.missing b { color: var(--red); }
.order-line.disabled b { color: var(--faint); }
.manual-close-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  visibility: hidden;
  background: rgba(2, 9, 7, 0.7);
  opacity: 0;
  backdrop-filter: blur(8px);
  transition: 160ms ease;
}
.manual-close-backdrop.open { visibility: visible; opacity: 1; }
.manual-close-modal {
  position: fixed;
  z-index: 81;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  visibility: hidden;
  overflow: hidden;
  border: 1px solid rgba(255, 123, 119, 0.26);
  border-radius: 22px;
  background: linear-gradient(155deg, #13231f, #091511);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translate(-50%, calc(-50% + 14px)) scale(0.98);
  transition: 160ms ease;
}
.manual-close-modal.open { visibility: visible; opacity: 1; transform: translate(-50%, -50%) scale(1); }
.manual-close-modal > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 25px 20px; border-bottom: 1px solid var(--border); }
.manual-close-modal h2 { margin: 8px 0 0; font-size: 22px; }
.manual-close-modal header p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.manual-close-modal header > button { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--border); border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; font-size: 22px; }
.manual-close-body { padding: 23px 25px; }
.manual-close-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.manual-close-quick button { min-height: 42px; border: 1px solid var(--border); border-radius: 10px; background: rgba(10, 27, 22, 0.7); color: var(--muted); cursor: pointer; }
.manual-close-quick button.active { border-color: rgba(255, 123, 119, 0.56); background: rgba(92, 33, 31, 0.38); color: #ffc0bd; font-weight: 750; }
.manual-close-slider { display: block; margin-top: 23px; }
.manual-close-slider > span { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.manual-close-slider strong { color: var(--text); font-size: 18px; }
.manual-close-slider input { width: 100%; margin-top: 15px; accent-color: var(--red); cursor: grab; }
.manual-close-slider input:active { cursor: grabbing; }
.manual-close-warning { margin: 20px 0 0; padding: 12px 14px; border: 1px solid rgba(240, 188, 114, 0.16); border-radius: 10px; background: rgba(69, 48, 19, 0.2); color: #d4b889; font-size: 11px; line-height: 1.6; }
.manual-close-status { min-height: 18px; margin: 13px 0 0; color: var(--muted); font-size: 11px; }
.manual-close-status.pending { color: var(--amber); }
.manual-close-status.success { color: var(--mint); }
.manual-close-status.error { color: var(--red); }
.manual-close-modal > footer { display: flex; justify-content: flex-end; gap: 10px; margin: 0; padding: 18px 25px 22px; border-top: 1px solid var(--border); color: inherit; font-size: inherit; }
.manual-close-modal footer button { min-height: 42px; padding: 0 18px; border-radius: 10px; cursor: pointer; }
.manual-close-secondary { border: 1px solid var(--border); background: transparent; color: var(--muted); }
.manual-close-confirm { border: 1px solid rgba(255, 123, 119, 0.44); background: #9d403f; color: white; font-weight: 750; }
.manual-close-modal footer button:disabled { cursor: wait; opacity: 0.5; }
.table-wrap { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.table-list-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-top: 1px solid var(--border); color: var(--faint); font-size: 11px; }
.table-pagination { display: flex; align-items: center; gap: 10px; }
.table-pagination button { min-height: 32px; font-size: 11px; }
.table-pagination button:disabled { cursor: not-allowed; opacity: 0.38; }
.table-pagination strong { min-width: 82px; color: var(--muted); font-weight: 550; text-align: center; }
.empty-state { display: grid; min-height: 142px; place-items: center; padding: 24px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; color: var(--text); font-size: 15px; font-weight: 560; }
.empty-state span { display: block; margin-top: 6px; font-size: 12px; }

.history-panel { margin-top: 22px; overflow: hidden; }
.history-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 24px 26px; border-bottom: 1px solid var(--border); }
.history-header h2 { margin: 7px 0 0; font-size: 18px; }
.history-header p { max-width: 560px; margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.history-view-tabs { display: inline-flex; gap: 4px; margin-top: 16px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: rgba(4, 14, 11, 0.58); }
.history-view-tabs button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 11px; font-weight: 650; }
.history-view-tabs button[aria-pressed="true"] { background: rgba(99, 230, 178, 0.12); color: var(--mint); box-shadow: inset 0 0 0 1px rgba(99, 230, 178, 0.18); }
.history-header-aside { display: grid; justify-items: end; gap: 16px; }
.history-refresh-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(99, 230, 178, 0.16);
  border-radius: 999px;
  background: rgba(99, 230, 178, 0.055);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.history-refresh-status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px rgba(99, 230, 178, 0.55);
  content: "";
}
.history-sort { display: grid; gap: 7px; min-width: 180px; }
.history-sort span { color: var(--faint); font-size: 10px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.history-sort select {
  min-height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: rgba(5, 15, 12, 0.7);
  color: var(--text);
  font: inherit;
}
.history-sort select:focus { border-color: rgba(99, 230, 178, 0.48); box-shadow: 0 0 0 3px rgba(99, 230, 178, 0.08); }
.history-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 22px; text-align: right; }
.history-summary span { display: block; color: var(--faint); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; }
.history-summary strong { display: block; margin-top: 4px; font-size: 14px; font-variant-numeric: tabular-nums; }
.history-table { width: 100%; min-width: 1420px; border-collapse: collapse; }
.history-table th { padding: 13px 14px; color: var(--faint); font-size: 10px; font-weight: 650; letter-spacing: 0.08em; text-align: right; text-transform: uppercase; }
.history-table th:first-child, .history-table th:nth-child(2), .history-table th:nth-child(3), .history-table th:nth-child(4), .history-table th:nth-child(7) { text-align: left; }
.history-table td { padding: 15px 14px; border-top: 1px solid rgba(205, 229, 218, 0.075); font-size: 12px; text-align: right; vertical-align: middle; font-variant-numeric: tabular-nums; }
.history-table td:first-child, .history-table td:nth-child(2), .history-table td:nth-child(3), .history-table td:nth-child(4), .history-table td:nth-child(7) { text-align: left; }
.history-table td > strong { display: block; }
.history-table td > small { display: block; margin-top: 4px; color: var(--faint); }
.history-table td:last-child .badge { margin-top: 5px; }
.execution-table th:nth-child(5), .execution-table td:nth-child(5) { text-align: left; }
.execution-table td:nth-child(3) .badge { display: inline-flex; margin-top: 5px; }
.reason-label { color: var(--muted); }
.exit-leg-details { min-width: 330px; margin-top: 8px; color: var(--muted); }
.exit-leg-details summary { cursor: pointer; color: var(--blue); font-size: 10px; font-weight: 700; }
.exit-leg-details ol { display: grid; gap: 8px; margin: 9px 0 0; padding: 0; list-style: none; }
.exit-leg-details li { padding: 8px 9px; border: 1px solid rgba(133, 174, 251, 0.14); border-radius: 9px; background: rgba(11, 25, 30, 0.72); }
.exit-leg-details li div { display: flex; justify-content: space-between; gap: 12px; }
.exit-leg-details li strong { color: var(--text); font-size: 10px; }
.exit-leg-details li time { color: var(--faint); font-size: 9px; white-space: nowrap; }
.exit-leg-details li span { display: block; margin-top: 4px; font-size: 9px; line-height: 1.45; }
.exit-leg-details > small { display: block; margin-top: 8px; color: var(--faint); font-size: 9px; line-height: 1.45; }

.warning-panel { margin-top: 22px; padding: 22px; border-color: rgba(240, 188, 114, 0.2); background: rgba(51, 38, 20, 0.34); color: var(--text); }
.section-heading { margin-bottom: 14px; }
.warning-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(240, 188, 114, 0.12); color: #e9c999; font-size: 13px; }
.warning-item.critical { color: #ffaaa6; }
.warning-mark { display: grid; flex: 0 0 23px; height: 23px; place-items: center; border: 1px solid currentColor; border-radius: 99px; font-size: 11px; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 4px 0; color: var(--faint); font-size: 11px; }

.release-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  visibility: hidden;
  background: rgba(2, 8, 7, 0.68);
  opacity: 0;
  transition: opacity 180ms ease, visibility 180ms ease;
}
.release-backdrop.open { visibility: visible; opacity: 1; }
.release-drawer {
  position: fixed;
  z-index: 21;
  top: 0;
  right: 0;
  width: min(520px, 94vw);
  height: 100vh;
  padding: 28px;
  overflow-y: auto;
  border-left: 1px solid var(--border-strong);
  background: #0b1714;
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.38);
  transform: translateX(102%);
  transition: transform 200ms ease;
}
.release-drawer.open { transform: translateX(0); }
.release-drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.release-drawer-header h2 { margin: 7px 0 0; font-size: 24px; }
.release-close {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.release-intro { margin: 14px 0 24px; color: var(--muted); font-size: 12px; }
.release-content { display: grid; gap: 14px; }
.release-card { padding: 19px; border: 1px solid var(--border); border-radius: 16px; background: rgba(16, 33, 29, 0.76); }
.release-card.current { border-color: rgba(99, 230, 178, 0.28); background: linear-gradient(145deg, rgba(22, 50, 41, 0.9), rgba(12, 29, 24, 0.88)); }
.release-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.release-card time { color: var(--faint); font-size: 10px; letter-spacing: 0.08em; }
.release-card h3 { margin: 5px 0 0; font-size: 16px; }
.release-version { flex: 0 0 auto; padding: 5px 8px; border: 1px solid rgba(133, 174, 251, 0.22); border-radius: 999px; color: var(--blue); font-size: 10px; font-weight: 700; }
.release-card > p { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.release-card ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.release-card li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding-top: 8px; border-top: 1px solid rgba(205, 229, 218, 0.08); }
.release-card li span { color: var(--faint); font-size: 10px; }
.release-card li strong { color: var(--text); font-size: 11px; font-weight: 560; line-height: 1.5; }
.candidate-block { margin-top: 16px; padding: 13px; border: 1px solid rgba(240, 188, 114, 0.16); border-radius: 12px; background: rgba(54, 40, 20, 0.22); }
.candidate-block h4 { margin: 0 0 9px; color: var(--amber); font-size: 11px; }
.candidate-item + .candidate-item { margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(240, 188, 114, 0.1); }
.candidate-item strong, .candidate-item span { display: block; font-size: 10px; line-height: 1.5; }
.candidate-item strong { color: #efd4a9; }
.candidate-item span { margin-top: 3px; color: var(--muted); }
.release-error { padding: 16px; border: 1px solid rgba(255, 123, 119, 0.25); border-radius: 12px; color: #ffc0bd; font-size: 12px; }

body.logic-open { overflow: hidden; }
.logic-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  visibility: hidden;
  background: rgba(1, 7, 6, 0.82);
  opacity: 0;
  backdrop-filter: blur(8px);
  transition: opacity 180ms ease, visibility 180ms ease;
}
.logic-backdrop.open { visibility: visible; opacity: 1; }
.logic-page {
  position: fixed;
  z-index: 31;
  inset: 18px;
  padding: 0 32px 38px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  background:
    radial-gradient(circle at 86% 0%, rgba(62, 113, 156, 0.14), transparent 26%),
    radial-gradient(circle at 6% 10%, rgba(32, 148, 108, 0.12), transparent 24%),
    #091512;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.99);
  transition: opacity 180ms ease, transform 180ms ease;
}
.logic-page.open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.logic-page-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 -32px;
  padding: 27px 32px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 21, 18, 0.94);
  backdrop-filter: blur(18px);
}
.logic-page-header h2 { margin: 6px 0 0; font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.035em; }
.logic-page-header p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.logic-close {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 26px;
}
.logic-tabs { display: flex; gap: 8px; margin: 24px 0; }
.logic-tabs button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(16, 33, 29, 0.72);
  color: var(--muted);
  cursor: pointer;
  transition: 150ms ease;
}
.logic-tabs button:hover { color: var(--text); border-color: var(--border-strong); }
.logic-tabs button.active { color: #06110d; border-color: var(--mint); background: var(--mint); font-weight: 720; }
.logic-strategy { display: grid; gap: 20px; }
.logic-strategy-header {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 24px;
  padding: 26px;
  border: 1px solid rgba(99, 230, 178, 0.18);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(23, 52, 42, 0.82), rgba(12, 29, 24, 0.74));
}
.logic-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.logic-title-row h3 { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.035em; }
.logic-title-row > span { padding: 5px 9px; border: 1px solid rgba(133, 174, 251, 0.24); border-radius: 999px; color: var(--blue); font-size: 10px; font-weight: 700; }
.logic-strategy-header > div > p { max-width: 760px; margin: 10px 0 0; color: var(--muted); line-height: 1.65; }
.logic-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.logic-chips span { padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: rgba(4, 14, 11, 0.36); font-size: 10px; }
.logic-status { align-self: stretch; padding: 17px 19px; border: 1px solid rgba(240, 188, 114, 0.16); border-radius: 15px; background: rgba(53, 39, 19, 0.24); }
.logic-status strong { color: var(--amber); font-size: 13px; }
.logic-status p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.logic-runtime-proof { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; padding-bottom: 12px; border-bottom: 1px solid rgba(240, 188, 114, 0.12); }
.logic-runtime-proof span { color: var(--faint); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.logic-runtime-proof strong { color: var(--mint); font-size: 11px; }
.logic-runtime-proof code { padding: 3px 6px; border-radius: 5px; background: rgba(5, 15, 12, 0.48); color: var(--muted); font-size: 9px; }
.logic-section { padding: 25px; overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: rgba(12, 27, 23, 0.68); }
.logic-section-heading { margin-bottom: 19px; }
.logic-section-heading span { color: var(--mint); font-size: 9px; font-weight: 750; letter-spacing: 0.16em; }
.logic-section-heading h3 { margin: 6px 0 0; font-size: 18px; }
.logic-section-heading p { max-width: 760px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.logic-flow { display: grid; grid-template-columns: repeat(6, minmax(178px, 1fr)); gap: 13px; min-width: 1130px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: thin; }
.logic-flow-step { position: relative; min-height: 160px; padding: 17px; border: 1px solid var(--border); border-radius: 15px; background: rgba(7, 20, 16, 0.72); }
.logic-flow-step:not(:last-child)::after { position: absolute; z-index: 2; top: 50%; right: -14px; width: 14px; color: var(--mint); content: "→"; font-size: 14px; text-align: center; transform: translateY(-50%); }
.logic-flow-step > span { color: var(--mint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; }
.logic-flow-step h4 { margin: 23px 0 8px; font-size: 14px; }
.logic-flow-step p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.logic-pattern-section { background: linear-gradient(145deg, rgba(11, 32, 26, 0.88), rgba(10, 23, 21, 0.76)); }
.logic-pattern-grid { display: grid; grid-template-columns: repeat(4, minmax(225px, 1fr)); gap: 12px; }
.logic-pattern-card { min-width: 0; padding: 17px; overflow: hidden; border: 1px solid rgba(99, 230, 178, 0.14); border-radius: 16px; background: rgba(5, 17, 14, 0.7); }
.logic-pattern-card header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.logic-pattern-card header span { padding: 4px 7px; border: 1px solid rgba(99, 230, 178, 0.2); border-radius: 6px; color: var(--mint); font-size: 8px; font-weight: 800; letter-spacing: 0.1em; }
.logic-pattern-card h4 { margin: 0; font-size: 14px; }
.logic-candle-chart { display: block; width: 100%; max-height: 126px; margin: 15px 0 10px; overflow: visible; border-radius: 10px; background: linear-gradient(180deg, rgba(15, 37, 31, 0.42), rgba(5, 16, 13, 0.18)); }
.logic-chart-grid { stroke: rgba(197, 222, 211, 0.07); stroke-width: 1; stroke-dasharray: 3 5; }
.logic-candle line { stroke-width: 2; }
.logic-candle rect { stroke-width: 1; }
.logic-candle.up line, .logic-candle.up rect { stroke: #62e4b0; }
.logic-candle.up rect { fill: rgba(98, 228, 176, 0.42); }
.logic-candle.down line, .logic-candle.down rect { stroke: #ff7f86; }
.logic-candle.down rect { fill: rgba(255, 127, 134, 0.38); }
.logic-pattern-card > p { min-height: 37px; margin: 0; color: #c3d4cc; font-size: 10px; line-height: 1.6; }
.logic-pattern-evidence { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; line-height: 1.55; }
.logic-branch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 12px; }
.logic-branch-card { padding: 18px; border: 1px solid var(--border); border-radius: 15px; background: rgba(7, 19, 16, 0.66); }
.logic-branch-card header { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.logic-branch-card header span { padding: 4px 7px; border: 1px solid rgba(133, 174, 251, 0.2); border-radius: 6px; color: var(--blue); font-size: 8px; font-weight: 800; letter-spacing: 0.1em; }
.logic-branch-card h4 { margin: 0; font-size: 14px; }
.logic-branch-card > p { min-height: 39px; margin: 11px 0 13px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.logic-branch-card ul, .logic-policy-card ul, .logic-disabled ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.logic-branch-card li, .logic-policy-card li, .logic-disabled li { position: relative; padding-left: 14px; color: #b1c2ba; font-size: 10px; line-height: 1.55; }
.logic-branch-card li::before, .logic-policy-card li::before, .logic-disabled li::before { position: absolute; top: 0.56em; left: 0; width: 4px; height: 4px; border-radius: 99px; background: var(--mint); content: ""; }
.logic-policy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 12px; }
.logic-policy-card { min-height: 170px; padding: 19px; border: 1px solid var(--border); border-top: 2px solid var(--blue); border-radius: 15px; background: rgba(8, 20, 18, 0.7); }
.logic-policy-card.risk { border-top-color: var(--amber); }
.logic-policy-card.stop { border-top-color: var(--red); }
.logic-policy-card.profit, .logic-policy-card.exit { border-top-color: var(--mint); }
.logic-policy-card h4 { margin: 0 0 15px; font-size: 14px; }
.logic-disabled { padding: 21px 24px; border: 1px dashed rgba(205, 229, 218, 0.14); border-radius: 18px; background: rgba(7, 18, 15, 0.42); }
.logic-disabled h3 { margin: 0 0 13px; color: var(--muted); font-size: 13px; }
.logic-disabled ul { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.logic-disabled li { color: var(--faint); }
.logic-disabled li::before { background: var(--faint); }

.skeleton-card, .skeleton-panel { position: relative; overflow: hidden; }
.skeleton-panel { min-height: 230px; }
.skeleton-card::before, .skeleton-panel::before {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.035), transparent);
  content: "";
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

@media (max-width: 1080px) {
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equity-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equity-chart-shell { overflow-x: auto; scrollbar-width: thin; }
  .positions-table { min-width: 1080px; }
  .logic-strategy-header { grid-template-columns: 1fr; }
  .logic-pattern-grid { grid-template-columns: repeat(2, minmax(225px, 1fr)); }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 28px, 1480px); padding-top: 26px; }
  .topbar { display: block; }
  .dashboard-title-row { display: block; }
  .dashboard-features { padding: 3px 0 2px; }
  .topbar-actions { justify-content: flex-start; margin-top: 20px; }
  .release-drawer { padding: 22px 18px; }
  .logic-page { inset: 0; padding: 0 16px 30px; border: 0; border-radius: 0; }
  .logic-page-header { margin: 0 -16px; padding: 20px 16px 17px; }
  .logic-tabs { overflow-x: auto; }
  .logic-tabs button { flex: 0 0 auto; }
  .logic-strategy-header, .logic-section { padding: 19px; }
  .logic-flow { grid-template-columns: 1fr; min-width: 0; overflow: visible; }
  .logic-flow-step { min-height: 0; }
  .logic-flow-step:not(:last-child)::after { top: auto; right: 50%; bottom: -14px; content: "↓"; transform: translateX(50%); }
  .logic-pattern-grid { grid-template-columns: 1fr; }
  .release-card li { grid-template-columns: 1fr; gap: 4px; }
  .account-grid { grid-template-columns: 1fr; }
  .equity-panel { padding: 20px 16px 12px; }
  .equity-header { align-items: stretch; flex-direction: column; gap: 16px; }
  .equity-period-tabs { align-self: flex-start; }
  .equity-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equity-summary-item strong { font-size: 14px; }
  .position-toolbar { align-items: stretch; flex-wrap: wrap; }
  .position-filter { flex-basis: 100%; max-width: none; }
  .position-filter-status { margin-left: 0; padding: 9px 0; }
  .table-list-footer { align-items: flex-start; flex-direction: column; }
  .strategy-header { display: block; padding: 20px; }
  .strategy-summary { justify-content: space-between; margin-top: 20px; text-align: left; }
  .strategy-subtitle { margin-left: 0; }
  .history-header { display: block; padding: 20px; }
  .history-header-aside { justify-items: start; margin-top: 20px; }
  .history-sort { width: 100%; }
  .history-summary { justify-content: flex-start; margin-top: 20px; text-align: left; }
  .positions-table, .history-table { min-width: 0; table-layout: auto; }
  .positions-table colgroup { display: none; }
  .positions-table thead, .history-table thead { display: none; }
  .positions-table tbody, .positions-table tr, .positions-table td,
  .history-table tbody, .history-table tr, .history-table td {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
  }
  .positions-table tr, .history-table tr { padding: 10px 18px; border-top: 1px solid rgba(205, 229, 218, 0.1); }
  .positions-table td, .history-table td {
    display: grid;
    grid-template-columns: minmax(78px, 28%) minmax(0, 1fr);
    align-items: flex-start;
    column-gap: 14px;
    row-gap: 5px;
    padding: 8px 0;
    border: 0;
    text-align: right !important;
  }
  .positions-table td::before, .history-table td::before {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    color: var(--faint);
    content: attr(data-label);
    font-size: 10px;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
  }
  .positions-table td > *, .history-table td > * {
    grid-column: 2;
    justify-self: stretch;
    min-width: 0;
    max-width: 100%;
  }
  .positions-table td:first-child, .history-table td:first-child { padding-top: 12px; }
  .positions-table td:last-child, .history-table td:last-child { padding-bottom: 12px; }
  .position-symbol-row { justify-content: flex-end; }
  .position-pattern, .symbol-meta, .position-opened-at, .position-cell-note { text-align: right; }
  .manual-close-button { justify-self: end !important; }
  .position-badges { justify-content: flex-end; }
  .position-badges { flex-wrap: wrap; }
  .position-config { justify-content: flex-end; }
  .stop-cell { align-items: flex-start; min-width: 0; }
  .order-stack { width: 100%; min-width: 0; }
  .stop-cell .order-line { min-width: 0; text-align: right; }
  .history-table td > small { text-align: right; }
  .history-table td > .badge {
    width: max-content;
    justify-self: end;
  }
  .history-table .reason-label { overflow-wrap: anywhere; }
  .exit-leg-details { width: min(100%, 390px); min-width: 0; margin-left: auto; text-align: left; }
  footer { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  .strategy-author::after,
  .equity-panel::before,
  .equity-point.current .equity-point-halo,
  .equity-svg.animate-in .equity-line,
  .equity-svg.animate-in .equity-line-glow,
  .equity-svg.animate-in .equity-area,
  .equity-svg.animate-in .equity-point {
    animation: none;
    opacity: 1;
    stroke-dashoffset: 0;
  }
}
