:root {
  color-scheme: dark;
  --bg: #07080b;
  --panel: #10141d;
  --panel-2: #151b27;
  --line: #252d3f;
  --text: #e8edf7;
  --muted: #8c96a8;
  --accent: #00c896;
  --warn: #ffb84d;
  --danger: #ff4d55;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: #0b0e14;
}
h1, h2, p { margin: 0; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; margin-bottom: 14px; }
.topbar p, .muted { color: var(--muted); }
.brand {
  display: grid;
  gap: 4px;
}
.brand a {
  display: block;
  width: max-content;
}
.brand-logo {
  display: block;
  width: 220px;
  height: 48px;
}
.page-brand {
  grid-template-columns: 36px auto;
  align-items: center;
  column-gap: 10px;
}
.page-brand p { grid-column: 2; }
.brand-mark {
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
}

main { padding: 24px 28px 40px; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.button, button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}
.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.nav-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.button.primary { background: var(--accent); color: #03110d; border-color: var(--accent); font-weight: 700; }
.button.selected {
  border-color: rgba(0, 200, 150, 0.72);
  background: rgba(0, 200, 150, 0.12);
  color: #92f2d4;
}
.button.danger-link {
  border-color: rgba(255, 77, 85, 0.45);
  background: rgba(255, 77, 85, 0.10);
  color: #ff9aa0;
}
.button.danger-link:hover {
  border-color: rgba(255, 77, 85, 0.72);
  background: rgba(255, 77, 85, 0.16);
  color: #ffc2c5;
}
.button.disabled, button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
button.danger {
  background: rgba(255, 77, 85, 0.12);
  border-color: rgba(255, 77, 85, 0.45);
  color: #ff9aa0;
}
.symbol-form { display: flex; gap: 8px; }
input {
  min-width: 120px;
  border: 1px solid var(--line);
  background: #080b10;
  color: var(--text);
  border-radius: 6px;
  padding: 9px 10px;
}
.table-search { min-width: 220px; }
.table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.table-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.table-filter input {
  width: auto;
  min-width: 0;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-color: rgba(0, 200, 150, 0.28);
  background: rgba(21, 27, 39, 0.78);
  color: #b8c4d8;
  font-size: 13px;
  white-space: nowrap;
}
.filter-chip.selected,
.filter-chip[aria-pressed="true"] {
  border-color: rgba(0, 200, 150, 0.72);
  background: rgba(0, 200, 150, 0.12);
  color: #92f2d4;
}
.filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #465164;
  box-shadow: 0 0 0 3px rgba(70, 81, 100, 0.16);
}
.filter-chip.selected .filter-dot,
.filter-chip[aria-pressed="true"] .filter-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.16);
}
.metric-period-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(21, 27, 39, 0.72);
}
.metric-period-switch button {
  min-width: 46px;
  padding: 5px 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.metric-period-switch button.selected,
.metric-period-switch a.selected {
  background: rgba(0, 200, 150, 0.13);
  color: #91efd5;
  box-shadow: inset 0 0 0 1px rgba(0, 200, 150, 0.4);
}
.slim-panel { padding: 14px 18px; }
.strategy-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.strategy-panel-label {
  display: grid;
  gap: 4px;
}
.strategy-panel-label span {
  color: var(--muted);
  font-size: 12px;
}
.strategy-panel-label strong {
  font-size: 16px;
}
.strategy-panel-actions {
  display: flex;
  align-items: center;
}
.strategy-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 11, 16, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.strategy-switch a {
  min-width: 108px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.strategy-switch a.selected {
  background: rgba(0, 200, 150, 0.14);
  color: #9af2d9;
  box-shadow: inset 0 0 0 1px rgba(0, 200, 150, 0.48), 0 4px 14px rgba(0, 200, 150, 0.08);
}
.toggle-form {
  display: inline-flex;
  margin: 0;
}
.trade-switch {
  width: 34px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(21, 27, 39, 0.9);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.trade-switch span {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  border-radius: 50%;
  background: #ff6b73;
  box-shadow: 0 0 0 3px rgba(255, 107, 115, 0.13);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.trade-switch.enabled {
  border-color: rgba(0, 200, 150, 0.58);
  background: rgba(0, 200, 150, 0.12);
}
.trade-switch.enabled span {
  transform: translateX(12px);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.16);
}
.trade-switch.disabled {
  border-color: rgba(255, 107, 115, 0.48);
  background: rgba(255, 107, 115, 0.08);
}
.chart-range-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metrics.split strong { font-size: 16px; }
.metrics div, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.metrics div { padding: 14px; }
.metrics span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.metrics strong { font-size: 18px; }

.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: 1fr 1fr 1fr; }
.panel { padding: 18px; margin-bottom: 18px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}
.panel-head h2 { margin-bottom: 0; }
.heading-with-count {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(0, 200, 150, 0.62);
  border-radius: 999px;
  background: rgba(0, 200, 150, 0.13);
  color: #92f2d4;
  font-size: 13px;
  font-weight: 800;
}
.panel.active-job-panel { border-color: rgba(0, 200, 150, 0.45); }
.warn-panel { border-color: rgba(255, 184, 77, 0.48); }
.progress { height: 8px; background: #07080b; border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #00b88c 0%, #19e0ad 55%, #80ffe0 100%);
}
.job-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}
.job-grid div {
  border: 1px solid var(--line);
  background: #0b0f17;
  border-radius: 6px;
  padding: 10px;
}
.job-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.log-tail {
  margin: 14px 0 0;
  padding: 12px;
  max-height: 180px;
  overflow: auto;
  color: #b7c0d2;
  background: #07080b;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: pre-wrap;
}
.status-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap { overflow-x: auto; }
.scroll-rows-10 {
  max-height: 370px;
  overflow: auto;
}
.scroll-rows-10 thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
}
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
table.sortable th { cursor: pointer; user-select: none; }
table.sortable th[data-direction="asc"]::after { content: " ↑"; color: var(--accent); }
table.sortable th[data-direction="desc"]::after { content: " ↓"; color: var(--accent); }
.compact td, .compact th { padding: 7px 8px; }
.group-row td {
  padding: 8px 10px;
  background: rgba(21, 27, 39, 0.72);
}
.group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.group-toggle .chevron {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: transform 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.group-row.expanded .chevron {
  transform: rotate(90deg);
  color: #92f2d4;
  border-color: rgba(0, 200, 150, 0.52);
}
.group-child td:first-child {
  border-left: 2px solid rgba(0, 200, 150, 0.22);
}
.kv td:first-child { color: var(--muted); width: 190px; }
.link { color: var(--accent); text-decoration: none; font-weight: 600; }
.pos { color: #33e58f; }
.neg { color: #ff6b73; }
.warn-text { color: #ffbd66; }
.help {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
  margin-left: 3px;
  padding: 0;
  border: 1px solid rgba(68, 136, 255, 0.8);
  border-radius: 50%;
  background: rgba(68, 136, 255, 0.18);
  color: #80adff;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-3px);
  vertical-align: middle;
}
.help-popover {
  position: fixed;
  z-index: 2000;
  max-width: 280px;
  padding: 9px 10px;
  border: 1px solid rgba(68, 136, 255, 0.45);
  border-radius: 6px;
  background: rgba(10, 14, 22, 0.98);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  line-height: 1.45;
}
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 12px;
}
.pagination button {
  min-width: 30px;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 12px;
}
.pagination button.selected {
  border-color: var(--accent);
  background: rgba(0, 200, 150, 0.14);
  color: var(--accent);
}

.run-list { display: grid; gap: 8px; max-height: 300px; overflow: auto; }
.run-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.run-list a.selected { border-color: var(--accent); }
.run-list span { color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips span { padding: 5px 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; }
.chips.small span, .pill {
  display: inline-block;
  padding: 3px 7px;
  margin: 1px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #cbd4e3;
  font-size: 12px;
}
.pill-ok {
  border-color: rgba(0, 200, 150, 0.5);
  color: #92f2d4;
}
.pill-live {
  border-color: rgba(0, 200, 150, 0.58);
  background: rgba(0, 200, 150, 0.12);
  color: #73f2ca;
}
.pill-warn {
  border-color: rgba(255, 184, 77, 0.5);
  color: #ffcf80;
}
.pill-retiring {
  border-color: rgba(255, 184, 77, 0.72);
  background: rgba(255, 184, 77, 0.12);
  color: #ffd08a;
}

.dashboard-compact .topbar {
  padding: 14px 22px;
}
.dashboard-compact .brand-logo {
  width: 172px;
  height: 38px;
}
.dashboard-compact main {
  padding: 14px 18px 28px;
}
.ops-header {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(620px, 1.6fr);
  gap: 10px;
  margin-bottom: 10px;
}
.ops-selector,
.ops-summary-wrap,
.active-job-strip,
.dense-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.ops-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}
.ops-selector .strategy-panel-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.ops-selector .strategy-switch a {
  min-width: 92px;
  padding: 7px 9px;
  font-size: 12px;
}
.ops-summary-wrap {
  overflow-x: auto;
}
.ops-summary-table {
  min-width: 760px;
  font-size: 12px;
}
.ops-summary-table th,
.ops-summary-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(37, 45, 63, 0.72);
}
.ops-summary-table th {
  width: 1%;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.ops-summary-table td {
  font-variant-numeric: tabular-nums;
}
.active-job-strip {
  padding: 10px 12px;
  margin-bottom: 10px;
  border-color: rgba(0, 200, 150, 0.42);
}
.active-job-strip .panel-head {
  margin-bottom: 8px;
}
.active-job-strip .job-grid {
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 6px;
}
.active-job-strip .job-grid div {
  padding: 7px 8px;
}
.active-job-strip .progress {
  height: 6px;
  margin-top: 8px;
}
.dense-panel {
  padding: 10px 12px;
  margin-bottom: 10px;
}
.primary-table-panel {
  border-color: rgba(0, 200, 150, 0.34);
}
.dense-panel .panel-head {
  margin-bottom: 8px;
}
.dense-panel h2 {
  font-size: 14px;
}
.dense-table-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid rgba(37, 45, 63, 0.55);
  border-radius: 6px;
}
.dense-table {
  font-size: 12px;
}
.dense-table th,
.dense-table td {
  padding: 5px 7px;
  font-variant-numeric: tabular-nums;
}
.dense-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #10141d;
  box-shadow: inset 0 -1px 0 var(--line);
}
.dense-table td:nth-child(n+5),
.dense-table th:nth-child(n+5) {
  text-align: right;
}
.dense-table td:last-child,
.dense-table th:last-child,
.dense-table td:nth-last-child(2),
.dense-table th:nth-last-child(2) {
  text-align: left;
}
.dense-table .pill {
  padding: 2px 5px;
  font-size: 11px;
}
.sticky-identity th:first-child,
.sticky-identity td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #10141d;
}
.sticky-rank-symbol {
  --sticky-rank-width: 58px;
}
.sticky-rank-symbol th:first-child,
.sticky-rank-symbol td:first-child {
  width: var(--sticky-rank-width);
  min-width: var(--sticky-rank-width);
  max-width: var(--sticky-rank-width);
}
.sticky-identity thead th:first-child {
  z-index: 4;
}
.sticky-rank-symbol th:nth-child(2),
.sticky-rank-symbol td:nth-child(2) {
  position: sticky;
  left: var(--sticky-rank-width);
  z-index: 2;
  background: #10141d;
  box-shadow: 1px 0 0 var(--line);
}
.sticky-rank-symbol thead th:nth-child(2) {
  z-index: 4;
}
.dashboard-compact .grid {
  gap: 10px;
  margin-bottom: 10px;
}
.dashboard-compact .grid .panel {
  padding: 12px;
  margin-bottom: 0;
}
.dashboard-compact .run-list {
  gap: 5px;
  max-height: 220px;
}
.dashboard-compact .run-list a {
  padding: 7px 8px;
  font-size: 12px;
}

.chart-main { padding-top: 18px; }
.chart-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #07080b;
  margin-bottom: 18px;
}
.chart-view-switch {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #0b0f17;
  border-bottom: 1px solid var(--line);
}
.chart-view-switch button {
  padding: 6px 12px;
  font-size: 12px;
}
.chart-view-switch button.selected {
  border-color: rgba(0, 200, 150, 0.65);
  background: rgba(0, 200, 150, 0.12);
  color: #8ff5df;
}
.drawing-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: #0b0f17;
  border-bottom: 1px solid var(--line);
}
.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
}
.tool-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tool-button[data-tool="none"] svg path:first-child {
  fill: currentColor;
  stroke-width: 0;
}
.tool-button.selected {
  border-color: rgba(79, 140, 255, 0.75);
  background: rgba(79, 140, 255, 0.14);
  color: #9cc2ff;
}
#chart-wrap {
  position: relative;
}
.chart-pane {
  min-height: 520px;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
.chart-pane:not(.active) {
  position: absolute;
  inset: 0;
}
.chart-pane.active {
  visibility: visible;
  pointer-events: auto;
}
.stats-pane {
  padding: 16px;
  overflow: auto;
  background: #07080b;
}
.trades-pane {
  padding: 16px;
  overflow: hidden;
  background: #07080b;
}
.trade-filter {
  min-width: 240px;
  height: 34px;
  padding: 0 10px;
}
.trade-table-wrap {
  max-height: calc(100vh - 360px);
  min-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0f17;
}
.trade-table {
  min-width: 1680px;
}
.trade-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0b0f17;
}
.trade-table th[data-sort] {
  cursor: pointer;
  user-select: none;
}
.trade-table th[data-sort]::after {
  content: "↕";
  display: inline-block;
  margin-left: 5px;
  color: var(--muted);
  font-size: 10px;
}
.empty-state {
  display: grid;
  place-content: center;
  min-height: 360px;
  text-align: center;
}
.fib-hover {
  position: absolute;
  z-index: 6;
  display: none;
  min-width: 96px;
  max-width: 172px;
  padding: 4px 7px;
  border: 1px solid rgba(154, 164, 178, 0.8);
  border-radius: 5px;
  background: rgba(7, 8, 11, 0.82);
  color: #d8dde7;
  font-size: 11px;
  line-height: 1.25;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(6px);
}
.fib-hover.visible { display: block; }
#drawing-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  touch-action: none;
}
.chart-shell.equity-mode #drawing-layer {
  display: none;
}
.loading-panel { margin-bottom: 12px; }
.chart-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.chart-summary div {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0f17;
  padding: 12px;
}
.chart-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}
.chart-summary strong { font-size: 18px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
}
.stat-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0f17;
  padding: 12px;
}
.stat-section h2 { margin-bottom: 8px; }
.stat-section table { white-space: normal; }
.stat-section .kv td:first-child { width: 150px; }

.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-shell { width: 100%; max-width: 420px; padding: 24px; }
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
}
.login-panel h1 { margin-bottom: 4px; }
.login-logo {
  display: block;
  width: 220px;
  height: 48px;
  margin-bottom: 6px;
}
.login-panel p { color: var(--muted); margin-bottom: 22px; }
.login-form { display: grid; gap: 14px; }
.login-form label { display: grid; gap: 7px; color: var(--muted); }
.login-form input { width: 100%; }
.login-error {
  color: #ff8a8f;
  border: 1px solid rgba(255, 77, 85, 0.35);
  background: rgba(255, 77, 85, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
}

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .chart-summary { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr; }
  .grid.two, .grid.three, .job-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .ops-header { grid-template-columns: 1fr; }
  .ops-selector { align-items: flex-start; flex-direction: column; }
  .active-job-strip .job-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}

@media (max-width: 640px) {
  main { padding: 16px; }
  .chart-summary { grid-template-columns: 1fr; }
  .drawing-toolbar { gap: 6px; }
  .tool-button { padding: 6px 8px; }
  .dashboard-compact main { padding: 10px; }
  .ops-selector .strategy-switch a { min-width: 84px; }
  .active-job-strip .job-grid { grid-template-columns: 1fr; }
}
