:root {
  --gekko-green: #00ff41;
  --gekko-green-dim: #00cc33;
  --gekko-green-glow: rgba(0, 255, 65, 0.15);
  --gekko-green-border: rgba(0, 255, 65, 0.25);
  --gekko-bg: #1e1e24;
  --gekko-surface: #2a2a32;
  --gekko-surface-hover: #33333d;
  --gekko-border: rgba(255, 255, 255, 0.08);
  --gekko-border-strong: rgba(255, 255, 255, 0.15);
  --foreground: #ffffff;
  --muted: #ffffff;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --radius: 0.5rem;
  --font-ui: "Nunito", system-ui, sans-serif;
  --font-mono: "Nunito", system-ui, sans-serif;
  --cta-bg: rgba(0, 255, 65, 0.12);
  --cta-bg-hover: rgba(0, 255, 65, 0.2);
  --cta-bg-strong: rgba(0, 255, 65, 0.22);
  /* Run-board columns — JS sets these in px from the content pane width.
     Fallbacks keep first paint sane before alignBoardColumns runs. */
  --results-col-label: clamp(5.75rem, 18vw, 12.5rem);
  --results-col-data: clamp(5.25rem, 14vw, 10rem);
  --results-col-gap: 0px;
  --results-col-pad: 0.65rem;
  /* Faded green vertical column rails on the Run board */
  --results-col-rule: color-mix(in srgb, var(--gekko-green, #00ff41) 38%, transparent);
  /* Main content gutter (half of prior ×2.5 upsizing). */
  --content-pad-x: clamp(0.5rem, 2vw, 1.875rem);
  /* Global type floor: labels/chrome ≥14px; body uses 1rem = 16px. */
  --type-min: 0.875rem;
}

@media (max-width: 640px) {
  :root {
    --content-pad-x: 0.425rem;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html {
  /* 1rem = 16px: body text floor. Microcopy uses --type-min (14px). */
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-ui);
  font-size: 1rem; /* 16px body floor */
  color: var(--foreground);
  background: var(--gekko-bg);
  line-height: 1.5;
  overflow-x: clip;
  text-transform: none;
}

/* Title Case on all headings + heading-like labels (not badge/tag chips). */
h1,
h2,
h3,
h4,
h5,
h6,
.page-title,
.section-subtitle,
.run-report-subhead,
.run-control-group-label,
.compare-card-stage,
.run-board-recs-step,
.run-board-section > th,
.panel-heading .strategies-total-label {
  text-transform: capitalize;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

.app-content-scroll,
.app-content-shell,
.page-intro,
main,
.panel {
  min-width: 0;
}

.panel,
.table-wrap,
.compare-table-wrap,
.run-board-wrap,
.results-unified-scroll {
  max-width: 100%;
}

/* Sitewide: Nunito only — never inherit a second face for mono/data. */
.mono,
code,
kbd,
pre,
td,
th,
input,
select,
textarea,
button,
.btn,
.btn-primary,
.btn-ghost {
  font-family: var(--font-ui);
}

/* Hide scrollbar gutters; mouse-wheel / trackpad / touch still scroll. */
.app-content-scroll,
.app-sidebar-primary,
.app-sidebar-utility,
.app-breadcrumb-region,
.results-unified-scroll,
.table-wrap,
.trades-scroll,
.compare-table-wrap,
.run-board-wrap {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.app-content-scroll::-webkit-scrollbar,
.app-sidebar-primary::-webkit-scrollbar,
.app-sidebar-utility::-webkit-scrollbar,
.app-breadcrumb-region::-webkit-scrollbar,
.results-unified-scroll::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.trades-scroll::-webkit-scrollbar,
.compare-table-wrap::-webkit-scrollbar,
.run-board-wrap::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
  background: transparent;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 15% -5%, var(--gekko-green-glow), transparent 55%),
    radial-gradient(ellipse 50% 35% at 95% 10%, rgba(0, 204, 51, 0.08), transparent 50%),
    linear-gradient(180deg, #1a1a20 0%, var(--gekko-bg) 40%, #18181d 100%);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(0, 255, 65, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 65, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 65%);
}

/* —— Shell: full-width workspace, top book nav, auth top-right —— */
body.app-shell {
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.7rem clamp(1rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--gekko-border);
  background: rgba(30, 30, 36, 0.88);
  backdrop-filter: blur(12px);
  animation: rise 0.45s ease-out both;
}

.top-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem 1rem;
  min-width: 0;
  justify-self: start;
}

.top-center {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 0.85rem;
  justify-self: center;
  min-width: 0;
}

/* Primary context: Overview | Live | Demo | Backtest (next to brand). */
.context-nav,
.product-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem;
  border-radius: 999px;
  border: 1px solid var(--gekko-border-strong);
  background: rgba(18, 18, 22, 0.9);
  flex-shrink: 0;
}

/* Secondary on desks: V1 | V2. */
.product-nav[hidden] { display: none !important; }

/* Legacy wrapper from earlier nav layouts — keep harmless if present. */
.desk-context {
  display: contents;
}

.context-link,
.product-link {
  text-decoration: none;
  color: var(--muted);
  font-size: var(--type-min);
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}
.context-link:hover,
.product-link:hover { color: var(--foreground); background: var(--gekko-surface-hover); }
.context-link.active,
.product-link.active {
  color: #0a0a0c;
  background: var(--gekko-green);
}

.book-nav[hidden],
.overview-nav[hidden] { display: none !important; }

.overview-nav {
  display: flex;
}

.overview-pane[hidden] {
  display: none !important;
}

/* Stack dashboard / strategies / roadmaps sections with a clear gutter. */
.overview-pane.is-active {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.page-overview .overview-pane.is-active > .compare-grid,
.page-overview .overview-pane.is-active > .compare-grid-summaries,
.page-overview .overview-pane.is-active > .strategy-overview {
  margin-bottom: 0;
}

.roadmap-pair .roadmap-col {
  min-width: 0;
}

.roadmap-pair .phase-grid {
  grid-template-columns: 1fr;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0;
}

/* V1/V2 pairs per row: Live · Demo · Backtest */
.compare-grid-fleet {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Overview summaries: Live alone, then Demo pair, then Backtest pair.
   Tile band is 0.6 of the content width; Live matches one half of a pair. */
.compare-grid-summaries {
  --overview-tile-band: 0.6;
  --overview-tile-gap: 0.85rem;
  display: grid;
  gap: 0.85rem;
  align-items: stretch;
  width: 100%;
  margin: 0 0 1.25rem;
}
.overview-summary-row {
  display: grid;
  gap: var(--overview-tile-gap);
  align-items: stretch;
  width: 100%;
  min-width: 0;
}
.overview-summary-row-solo {
  /* Same tile width as one half of the 0.6 band → equal metric boxes. */
  grid-template-columns: minmax(0, 1fr);
  max-width: calc(
    (100% * var(--overview-tile-band) - var(--overview-tile-gap)) / 2
  );
}
.overview-summary-row-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: calc(100% * var(--overview-tile-band));
}
.compare-grid-summaries .compare-card {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.95rem 1rem 1.05rem;
}
.compare-grid-summaries .home-live-summary {
  width: 100%;
  max-width: none;
  margin: 0;
}
.compare-grid-summaries .compare-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
  max-width: none;
  margin: 0.7rem 0;
}
.compare-grid-summaries .compare-metrics .metric {
  width: 100%;
  min-width: 0;
  max-width: none;
  flex: none;
  box-sizing: border-box;
  padding: 0.55rem 0.5rem 0.6rem;
}
.compare-grid-summaries .compare-metrics .metric-label {
  font-size: var(--type-min);
}
.compare-grid-summaries .compare-metrics .metric-value {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compare-grid-summaries .setup-links {
  margin-top: auto;
}
.compare-card-stage {
  margin: 0 0 0.35rem;
  font-size: var(--type-min);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gekko-green);
}
.summary-chain-steps {
  margin: 0.35rem 0 0.85rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
}
.summary-chain-steps li.is-current {
  color: inherit;
  font-weight: 600;
}
.summary-chain-grid {
  margin-top: 0.25rem;
}

/* Overview Value chain — flow diagram with step titles + descriptions. */
.overview-value-chain {
  margin-top: 0.35rem;
}
.overview-value-chain > h2 {
  margin-bottom: 0.35rem;
}
.value-chain-lead {
  margin: 0 0 0.95rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.value-chain-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1.35rem;
  counter-reset: value-chain;
}
.value-chain-step {
  position: relative;
  counter-increment: value-chain;
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--gekko-green, #00ff41) 28%, var(--gekko-border));
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(0, 255, 65, 0.05), rgba(0, 0, 0, 0.22));
}
.value-chain-step-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--foreground);
  line-height: 1.25;
}
.value-chain-step-title::before {
  content: counter(value-chain);
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gekko-green, #00ff41) 55%, transparent);
  background: rgba(0, 255, 65, 0.08);
  color: var(--gekko-green, #00ff41);
  font-size: var(--type-min);
  font-weight: 800;
  flex: 0 0 auto;
}
.value-chain-step-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}
.value-chain-note {
  margin: 0.95rem 0 0;
  font-size: var(--type-min);
  color: var(--muted);
  max-width: 52rem;
}
@media (min-width: 900px) {
  .value-chain-step:not(:last-child)::after {
    content: "→";
    position: absolute;
    top: 50%;
    right: -1.05rem;
    transform: translate(50%, -50%);
    color: color-mix(in srgb, var(--gekko-green, #00ff41) 78%, var(--muted));
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
  }
}

@media (max-width: 720px) {
  .compare-grid-fleet {
    grid-template-columns: 1fr;
  }
  .overview-summary-row-solo,
  .overview-summary-row-pair {
    max-width: none;
  }
  .overview-summary-row-pair {
    grid-template-columns: 1fr;
  }
  .compare-grid-summaries .compare-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .value-chain-flow {
    grid-template-columns: 1fr;
  }
  .value-chain-step:not(:last-child)::after {
    content: "↓";
    position: static;
    transform: none;
    justify-self: center;
    margin-top: 0.15rem;
  }
}

.compare-card h2 { margin: 0 0 0.25rem; }
.compare-card.is-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.compare-card.is-clickable:hover {
  border-color: var(--gekko-green-border);
  background: rgba(0, 255, 65, 0.04);
}
.compare-card.is-clickable:focus-visible {
  outline: 2px solid var(--shell-focus, var(--gekko-green));
  outline-offset: 2px;
}
.compare-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.55rem 0.65rem;
  margin: 0.75rem 0;
  width: max-content;
  max-width: 100%;
}
.compare-metrics .metric {
  width: max-content;
  max-width: 100%;
  flex: 0 1 auto;
  padding: 0.55rem 0.7rem 0.6rem;
}
.compare-metrics .metric-value {
  font-size: 1.1rem;
  white-space: nowrap;
}
@media (max-width: 860px) {
  .compare-grid { grid-template-columns: 1fr; }
}

.topbar-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.top-auth {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Soft-auth: never show a topbar Login control (avatar only when signed in). */
#authGuest,
#btnLogin,
.auth-guest {
  display: none !important;
}

.auth-guest .btn-ghost {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-ghost,
.btn-primary {
  border-radius: calc(var(--radius) - 1px);
  font: inherit;
  font-size: var(--type-min);
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-ghost {
  background: var(--cta-bg);
  color: var(--foreground);
  border-color: var(--gekko-green-border);
}
.btn-ghost:hover { background: var(--cta-bg-hover); }
.btn-primary {
  background: var(--cta-bg-strong);
  color: var(--foreground);
  border-color: var(--gekko-green-border);
}
.btn-primary:hover { background: var(--cta-bg-hover); }
.btn-block { width: 100%; margin-top: 0.35rem; }

.auth-user {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 1px solid var(--gekko-border-strong);
  background: var(--gekko-surface);
  color: var(--gekko-green);
  font: inherit;
  font-size: var(--type-min);
  font-weight: 800;
  cursor: pointer;
}
.auth-avatar:hover { border-color: var(--gekko-green); }

/* Login / register page */
.page-login .login-workspace {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.login-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem 1.25rem 3rem;
  text-align: center;
}
.login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}
.login-logo {
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.login-brand {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.login-brand span { color: var(--gekko-green); }
.login-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}
.login-panel {
  width: min(100%, 26rem);
  text-align: left;
  padding: 1.25rem 1.25rem 1.4rem;
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--gekko-surface) 88%, transparent);
  backdrop-filter: blur(10px);
}
.login-copy {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.login-form .auth-label {
  display: block;
  margin-bottom: 0.35rem;
}
.login-form input[type="email"],
.login-form input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 0.7rem 0.85rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--gekko-border-strong);
  background: var(--background);
  color: var(--foreground);
  margin-bottom: 0.75rem;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0 0.85rem;
  color: var(--muted);
  font-size: var(--type-min);
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gekko-border-strong);
}
.login-divider span {
  white-space: nowrap;
}
.login-google-btn {
  width: 100%;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--gekko-border-strong);
  background: color-mix(in srgb, var(--gekko-bg) 70%, #fff 6%);
  color: var(--foreground);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 140ms ease;
}
.login-google-btn:hover {
  background: var(--gekko-surface-hover);
  border-color: color-mix(in srgb, var(--gekko-green) 35%, var(--gekko-border-strong));
}
.login-google-btn:active {
  transform: scale(0.985);
}
.login-note {
  margin: 0.85rem 0 0;
  font-size: var(--type-min);
  color: var(--muted);
  line-height: 1.4;
}
.login-note-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gekko-green);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.login-note-link:hover {
  filter: brightness(1.08);
}

.auth-meta {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  max-width: 10rem;
}
.auth-meta strong {
  font-size: var(--type-min);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-meta span {
  font-size: var(--type-min);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-menu-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0.2rem;
}

.auth-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  left: auto;
  bottom: auto;
  width: auto;
  min-width: 11rem;
  padding: 0.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--gekko-border-strong);
  background: #16161b;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 50;
}
.auth-menu button {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: var(--type-min);
  font-weight: 600;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}
.auth-menu a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: var(--type-min);
  font-weight: 600;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-radius: calc(var(--radius) - 2px);
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.auth-menu a:hover,
.auth-menu button:hover { background: var(--gekko-surface-hover); }
.auth-menu button.danger { color: var(--danger); }

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.admin-actions .btn-primary,
.admin-actions .btn-ghost {
  padding: 0.35rem 0.65rem;
  font-size: var(--type-min);
}
.page-admin-users .panel { margin-bottom: 1.25rem; }
.admin-users-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
}
.admin-users-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.admin-view-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0.2rem;
  border: 1px solid var(--gekko-border-strong);
  border-radius: calc(var(--radius) - 1px);
  background: color-mix(in srgb, var(--gekko-bg) 70%, transparent);
}
.admin-view-tab {
  font: inherit;
  font-size: var(--type-min);
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border: 0;
  border-radius: calc(var(--radius) - 3px);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.admin-view-tab.active {
  color: #0a0a0c;
  background: var(--gekko-green);
}
.admin-role-select {
  font: inherit;
  font-size: var(--type-min);
  font-weight: 600;
  min-width: 9.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--gekko-border-strong);
  background: color-mix(in srgb, var(--gekko-bg) 80%, transparent);
  color: var(--foreground);
}
.admin-role-select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.page-admin-users .muted {
  color: var(--muted);
  font-size: var(--type-min);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.auth-modal[hidden] { display: none !important; }
.confirm-checked-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.confirm-checked-card {
  width: min(24rem, 100%);
  padding: 1.25rem 1.2rem 1.1rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--gekko-border-strong);
  background: #16161b;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.confirm-checked-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 800;
}
.confirm-checked-msg {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}
.confirm-checked-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0 0 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.confirm-checked-check input {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--gekko-green);
}
.confirm-checked-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.auth-modal-card {
  position: relative;
  width: min(24rem, 100%);
  padding: 1.35rem 1.25rem 1.15rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--gekko-border-strong);
  background: #16161b;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.auth-modal-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 800;
}
.auth-modal-sub {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.auth-modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.auth-form { display: flex; flex-direction: column; gap: 0.35rem; }
.auth-label {
  font-size: var(--type-min);
  font-weight: 700;
  color: var(--muted);
}
.auth-form input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--gekko-border-strong);
  background: var(--gekko-bg);
  color: var(--foreground);
  font: inherit;
}
.auth-modal-status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: var(--type-min);
  color: var(--muted);
}
.auth-modal-status.ok { color: var(--success); }
.auth-modal-status.error { color: var(--danger); }
.auth-modal-note {
  margin: 0.75rem 0 0;
  font-size: var(--type-min);
  color: var(--muted);
}

.operator-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 28rem;
  margin-top: 0.75rem;
}
.operator-row input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--gekko-border-strong);
  background: var(--gekko-bg);
  color: var(--foreground);
  font: inherit;
}
.operator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.operator-status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: var(--type-min);
  color: var(--muted);
}
.operator-status.ok { color: var(--success); }
.operator-status.error { color: var(--danger); }
.operator-secret-hint {
  margin: 0.45rem 0 0;
  font-size: var(--type-min);
  line-height: 1.35;
  max-width: 42rem;
}
.operator-secret-hint[hidden] {
  display: none !important;
}

.write-unlock-panel {
  margin: 0 0 1rem;
}
.write-unlock-panel.is-needed {
  border-color: color-mix(in srgb, var(--warning) 45%, var(--gekko-border-strong));
}
.write-unlock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.write-unlock-form[hidden] {
  display: none !important;
}
.write-unlock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.35rem;
}
.write-unlock-row input {
  flex: 1 1 14rem;
  min-width: 12rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--gekko-border-strong);
  background: var(--gekko-bg);
  color: var(--foreground);
  font: inherit;
}

/* Clickable Operator page links inside status / error copy */
.operator-status a,
.section-copy.error a,
.section-copy.danger-text a,
.danger-text a,
#resultsBoardStatus a,
#resultsSettingsStatus a,
#settingsOpsStatus a,
#settingsPromoteStatus a,
[data-run-control-status] a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.operator-status a:hover,
.section-copy.error a:hover,
.section-copy.danger-text a:hover,
.danger-text a:hover,
#resultsBoardStatus a:hover,
#resultsSettingsStatus a:hover,
#settingsOpsStatus a:hover,
#settingsPromoteStatus a:hover,
[data-run-control-status] a:hover {
  color: var(--foreground);
}

.top-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  min-width: 0;
  justify-self: start;
}
.top-brand-logo {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0;
  flex-shrink: 0;
  object-fit: contain;
  background: transparent;
}
.top-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}
.top-brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--foreground);
}
.top-brand-name span { color: var(--gekko-green); }
.top-brand-sub {
  font-size: var(--type-min);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--gekko-green-dim);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  justify-self: center;
}

.top-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: #a5b4fc;
  font-size: var(--type-min);
  font-weight: 700;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.top-link:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--gekko-border);
}
.top-link.active {
  color: var(--gekko-green);
  background: rgba(0, 255, 65, 0.06);
  border-color: var(--gekko-green-border);
}
.top-ico {
  font-size: var(--type-min);
  opacity: 0.85;
  line-height: 1;
}
.top-link .tab-note {
  margin-left: 0.1rem;
  font-size: var(--type-min);
  font-weight: 700;
  color: var(--warning);
  letter-spacing: 0.04em;
  text-transform: none;
}

.topbar .status-pills {
  justify-self: end;
  justify-content: flex-end;
}

.page-intro {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 1.35rem var(--content-pad-x) 0.35rem;
  animation: rise 0.55s 0.04s ease-out both;
  box-sizing: border-box;
}
.page-intro-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}
.page-intro-copy {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.results-page-intro {
  align-items: center;
  margin-bottom: 0.2rem;
}
.results-ops-status {
  flex: 1 1 10rem;
  min-width: 0;
  margin: 0;
  font-size: var(--type-min);
  line-height: 1.25;
}
.results-ops-status[hidden] {
  display: none !important;
}
.results-ops-status.ok {
  color: var(--success);
}
.results-ops-status.error {
  color: var(--danger);
}
.page-intro-actions {
  margin: 0.35rem 0 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.page-intro-actions #deskRunStatus {
  flex: 1 1 100%;
  margin: 0;
  min-height: 1.1em;
}
.page-intro-actions #deskRunStatus.ok {
  color: var(--success);
}
.page-intro-actions #deskRunStatus.error {
  color: var(--danger);
}
.results-page-intro .page-intro-actions {
  margin: 0;
}
.page-intro-actions .btn {
  white-space: nowrap;
}
@media (max-width: 640px) {
  .page-intro-row {
    flex-direction: column;
    align-items: stretch;
  }
  .page-intro-actions {
    margin-top: 0.15rem;
  }
}

.page-title {
  font-family: var(--font-ui);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0.25rem 0 0.4rem;
  color: var(--foreground);
}

.eyebrow {
  margin: 0;
  text-transform: none;
  letter-spacing: 0.16em;
  font-size: var(--type-min);
  font-weight: 700;
  color: var(--gekko-green-dim);
}

.tagline {
  margin: 0;
  color: var(--foreground);
  font-size: 1.05rem;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.tagline strong {
  color: var(--gekko-green);
  font-weight: 700;
}
.ok-text {
  color: var(--gekko-green);
  font-weight: 700;
  font-size: var(--type-min);
}

.status-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Legacy header (kept for any stray markup) */
.top {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 2.25rem var(--content-pad-x) 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-end;
  animation: rise 0.55s ease-out both;
}

.brand {
  font-family: var(--font-ui);
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0.2rem 0 0.45rem;
  color: var(--foreground);
}
.brand span { color: var(--gekko-green); }

.pill {
  border: 1px solid var(--gekko-border-strong);
  background: var(--gekko-surface);
  padding: 0.4rem 0.75rem;
  font-size: var(--type-min);
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
}
.pill.ok {
  border-color: var(--gekko-green-border);
  color: var(--gekko-green);
  background: rgba(0, 255, 65, 0.06);
}
.pill.warn {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--warning);
}
.pill.bad {
  border-color: rgba(239, 68, 68, 0.45);
  color: var(--danger);
}

.desk-power-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 0.35rem 0 0.75rem;
}
.desk-power-bar .metric-label {
  margin-right: 0.15rem;
}

/* Operator fleet: vertical env rows — status tile | Start/Stop CTA tile */
.fleet-power-panel {
  width: min(100%, 40rem);
  max-width: 100%;
}
.fleet-tile-grid {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(9rem, 1.15fr);
  gap: 0.65rem 0.75rem;
  margin-top: 0.85rem;
  width: 100%;
  max-width: 100%;
}
.fleet-env-row {
  display: contents;
}
.fleet-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.25rem;
  min-height: 4.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--gekko-border-strong);
  background: var(--gekko-surface);
  color: var(--foreground);
  box-sizing: border-box;
}
.fleet-status-tile {
  min-width: 0;
}
.fleet-cta-tile {
  min-width: 0;
}
.fleet-tile-name {
  font-size: 0.95rem;
  font-weight: 800;
}
.fleet-tile-status {
  font-size: 0.88rem;
  font-weight: 700;
}
.fleet-env-row.tone-ok .fleet-tile-status { color: var(--gekko-green); }
.fleet-env-row.tone-warn .fleet-tile-status { color: #fbbf24; }
.fleet-env-row.tone-bad .fleet-tile-status { color: #fca5a5; }
.fleet-env-row.tone-off .fleet-tile-status { color: var(--shell-nav-text-secondary); }
.fleet-cta-btns {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  width: 100%;
}
.fleet-cta-btn {
  width: 100%;
  justify-content: center;
  min-height: 2.15rem;
  font-size: var(--type-min);
  font-weight: 700;
}
.fleet-cta-btn.kind-primary:not(.ghost):not(.danger) {
  border-color: var(--gekko-green-border, rgba(0, 255, 65, 0.45));
}
.fleet-cta-btn.kind-danger,
.fleet-cta-btn.danger {
  border-color: rgba(252, 165, 165, 0.45);
  color: #fca5a5;
}
@media (max-width: 520px) {
  .fleet-tile-grid {
    grid-template-columns: 1fr;
  }
  .fleet-cta-tile {
    margin-bottom: 0.35rem;
  }
}
.panel-compact {
  width: max-content;
  max-width: 100%;
}
.panel-compact .operator-row input {
  max-width: 22rem;
}

main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 var(--content-pad-x) 3rem;
  display: grid;
  gap: 2rem;
  box-sizing: border-box;
}

/* Let book panels participate in main's grid gap (wrapper otherwise collapses spacing). */
#tradingView {
  display: contents;
}
#tradingView[hidden] {
  display: none;
}

/* Legacy book-nav alone (old markup without .top-nav) stays hidden.
   Product desk uses .top-nav.book-nav — visible unless [hidden] (Compare). */
.book-nav:not(.top-nav) { display: none; }
.top-nav.book-nav { display: flex; }
.book-tab {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
  background: var(--gekko-surface);
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  padding: 0.65rem 0.95rem;
}
.coming-soon {
  animation: rise 0.6s ease-out both;
}
.muted-line { opacity: 1; color: var(--foreground); }
.symbols-line {
  font-family: var(--font-mono);
  font-size: var(--type-min);
  word-break: break-word;
  margin-bottom: 0 !important;
}

/* Desk scoreboard: equal tile width (Day/Week match Opening / Open Positions). */
:root {
  --desk-metric-tile-width: 11.5rem;
}

.period-metrics,
.account-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--desk-metric-tile-width));
  justify-content: start;
  align-items: stretch;
  gap: 0.65rem 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  animation: rise 0.6s 0.05s ease-out both;
}
.period-metrics .metric,
.account-metrics .metric {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}
.account-metrics {
  animation-delay: 0.08s;
}

.metric {
  padding: 0.75rem 0.85rem 0.8rem;
  background: var(--gekko-surface);
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(0, 255, 65, 0.02);
  min-width: 0;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
}
.metric-label {
  display: block;
  font-size: var(--type-min);
  letter-spacing: 0.02em;
  text-transform: capitalize;
  color: var(--muted);
  margin-bottom: 0.4rem;
  font-weight: 700;
}
.metric-value {
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight: 500;
  color: var(--foreground);
  display: block;
  white-space: nowrap;
  line-height: 1.25;
}
.period-metrics .metric-value {
  font-size: clamp(1rem, 2vw, 1.35rem);
}
.metric-value-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  white-space: normal;
}
.metric-value-stack .metric-amount {
  display: block;
  white-space: nowrap;
  line-height: 1.2;
}
.metric-value-stack .metric-pct {
  display: block;
  font-size: max(var(--type-min), 0.78em);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0.92;
}
.metric-sub {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: var(--type-min);
  font-weight: 500;
  color: var(--muted);
}
.metric-sub[hidden] {
  display: none;
}
.latency-line {
  font-size: 0.88rem;
}
.latency-line strong {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--foreground);
}


h2 {
  font-family: var(--font-ui);
  font-size: 1.35rem;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.panel-heading-copy {
  min-width: 0;
  flex: 1;
}
.panel-heading .section-copy {
  margin-bottom: 0.85rem;
}
.strategies-total {
  margin: 0;
  flex-shrink: 0;
  text-align: right;
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 0.35rem;
  font-family: var(--font-ui);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.positions-cap {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 1.25rem;
  flex-shrink: 0;
}
.positions-cap .strategies-total {
  margin: 0;
}
.positions-cap-line .strategies-total-value {
  font-variant-numeric: tabular-nums;
}
.positions-cap.is-at-cap .strategies-total-value {
  color: var(--warning);
}
.strategies-total-label {
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: none;
  color: inherit;
  font-weight: inherit;
  white-space: nowrap;
}
.strategies-total-value {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: var(--gekko-green);
  line-height: inherit;
  white-space: nowrap;
}
.section-copy {
  margin: 0 0 1rem;
  color: var(--muted);
  font-weight: 500;
}

/* Compact info icons — hover/focus/tap reveals explanation (replaces long blurbs). */
.heading-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  margin: 0;
  border: 1px solid var(--gekko-border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  cursor: help;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1;
}
.info-tip:hover,
.info-tip:focus-visible,
.info-tip.is-open {
  border-color: var(--gekko-green-border);
  color: var(--gekko-green);
  outline: none;
}
.info-tip-icon {
  font-size: var(--type-min);
  font-weight: 800;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  pointer-events: none;
}
.info-tip-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%);
  width: min(18.5rem, 72vw);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--gekko-border-strong);
  border-radius: var(--radius);
  background: #25252d;
  color: #f3f3f5;
  font-family: var(--font-ui);
  font-size: var(--type-min);
  font-weight: 600;
  font-style: normal;
  line-height: 1.35;
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 60;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}
.info-tip-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #25252d;
}
.info-tip:hover .info-tip-bubble,
.info-tip:focus-visible .info-tip-bubble,
.info-tip.is-open .info-tip-bubble {
  opacity: 1;
  visibility: visible;
}
@media (max-width: 640px) {
  .info-tip-bubble {
    left: auto;
    right: -0.25rem;
    transform: none;
    width: min(16.5rem, 78vw);
  }
  .info-tip-bubble::after {
    left: auto;
    right: 0.55rem;
    transform: none;
  }
}

.controls { animation: rise 0.65s 0.08s ease-out both; }
.autopilot { animation: rise 0.65s 0.08s ease-out both; }
.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--gekko-green-border);
  background: var(--cta-bg);
  color: var(--foreground);
  padding: 0.7rem 1.05rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  background: var(--cta-bg-hover);
  border-color: var(--gekko-green-border);
}
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--cta-bg-strong);
  color: var(--foreground);
  border-color: var(--gekko-green-border);
  box-shadow: none;
}
.btn.primary:hover {
  background: var(--cta-bg-hover);
  border-color: var(--gekko-green-border);
}
.btn.danger {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
}
.btn.danger:hover { background: rgba(239, 68, 68, 0.2); }
.btn.ghost {
  border-color: var(--gekko-green-border);
  color: var(--foreground);
  background: var(--cta-bg);
}
.btn.ghost:hover {
  background: var(--cta-bg-hover);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.feedback {
  min-height: 1.4em;
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: var(--gekko-green);
  font-weight: 600;
}

.grid-two {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

.panel {
  background: var(--gekko-surface);
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.25rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin: 0 -0.15rem;
  padding-bottom: 0.15rem;
  min-width: 0;
  max-width: 100%;
}
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 65, 0.25);
  border-radius: 999px;
}
.trades-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 0.85rem;
}
.trades-range {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem;
  border-radius: 999px;
  border: 1px solid var(--gekko-border-strong);
  background: rgba(18, 18, 22, 0.9);
  flex: 0 0 auto;
}
.trades-range-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--type-min);
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}
.trades-range-btn:hover {
  color: var(--foreground);
  background: var(--gekko-surface-hover);
}
.trades-range-btn.active {
  color: #0a0a0c;
  background: var(--gekko-green);
}
.trades-dates {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.trades-date {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}
.trades-date-label {
  font-family: var(--font-mono);
  font-size: var(--type-min);
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
}
.trades-date input[type="date"] {
  font: inherit;
  font-size: var(--type-min);
  font-weight: 700;
  color: var(--foreground);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
  outline: none;
  color-scheme: dark;
}
.trades-date input[type="date"]:focus {
  border-color: var(--gekko-green-border);
  box-shadow: 0 0 0 2px rgba(0, 255, 65, 0.12);
}
.trades-dates.is-active .trades-date input[type="date"] {
  border-color: var(--gekko-green-border);
}
.trades-search {
  flex: 1 1 16rem;
  min-width: 0;
}
.trades-scroll {
  max-height: min(48rem, 75vh);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  scroll-behavior: auto;
}
.trades-scroll .table-trades {
  margin: 0;
}
.trades-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(18, 18, 22, 0.96);
  backdrop-filter: blur(6px);
}
.table-trades th[data-sort],
.table-positions th[data-sort] {
  padding: 0;
}
.table-trades .th-sort,
.table-positions .th-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.55rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  text-align: inherit;
  cursor: pointer;
}
.table-trades .th-sort::after,
.table-positions .th-sort::after {
  content: "";
  width: 0.45rem;
  opacity: 0.35;
  font-size: max(var(--type-min), 0.7em);
}
.table-trades th.is-sorted-asc .th-sort::after,
.table-positions th.is-sorted-asc .th-sort::after {
  content: "▲";
  opacity: 0.9;
}
.table-trades th.is-sorted-desc .th-sort::after,
.table-positions th.is-sorted-desc .th-sort::after {
  content: "▼";
  opacity: 0.9;
}
.table-trades th.is-sorted .th-sort,
.table-positions th.is-sorted .th-sort {
  color: var(--gekko-accent, #7dffa8);
}
.trades-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.trades-pager[hidden] {
  display: none !important;
}
.trades-pager .trades-meta {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}
.trades-pager .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.trades-pager #tradesLoadMore[hidden] {
  display: none !important;
}
.trades-search input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.92rem;
  color: var(--foreground);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  outline: none;
}
.trades-search input[type="search"]::placeholder {
  color: var(--muted);
}
.trades-search input[type="search"]:focus {
  border-color: var(--gekko-green-border);
  box-shadow: 0 0 0 2px rgba(0, 255, 65, 0.12);
}
.trades-meta {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: var(--type-min);
  color: var(--muted);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 0;
}
.table-trades { min-width: 860px; }
.table-positions { min-width: 680px; }
.table-trades .col-cost,
.table-trades .col-eq,
.table-trades .col-value,
.table-positions .col-cost,
.table-positions .col-eq,
.table-positions .col-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table-trades .col-eq,
.table-positions .col-eq {
  text-align: right;
}
th, td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--gekko-border);
  white-space: nowrap;
}
th {
  font-size: var(--type-min);
  letter-spacing: 0.1em;
  text-transform: none;
  color: var(--muted);
  font-weight: 700;
}
td { font-family: var(--font-mono); font-size: var(--type-min); }
td.meta, th.meta { font-variant-numeric: tabular-nums; }
.empty {
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-ui);
  white-space: normal;
}
.side-long { color: var(--gekko-green); font-weight: 700; }
.side-short { color: #f87171; font-weight: 700; }
.pnl-pos { color: var(--gekko-green); }
.pnl-neg { color: #f87171; }

.variant-list,
.strategy-rank {
  list-style: none;
  margin: 0;
  padding: 0;
}
.strategy-rank li,
.variant-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gekko-border);
  font-size: 0.9rem;
}
.strategy-rank li:last-child,
.variant-list li:last-child { border-bottom: 0; }
.strategy-rank li.strategy-rank-table-wrap {
  display: block;
  padding: 0;
  border-bottom: 0;
}
.strategy-rank .meta,
.variant-list .meta {
  color: var(--muted);
  font-size: var(--type-min);
  font-family: var(--font-mono);
  margin-top: 0.15rem;
}
.table-strategies {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: var(--type-min);
}
.table-strategies th,
.table-strategies td {
  padding: 0.55rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid var(--gekko-border);
  vertical-align: middle;
}
.table-strategies th {
  color: var(--muted);
  font-size: var(--type-min);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  white-space: nowrap;
}
.table-strategies .col-rank,
.table-strategies .col-tier,
.table-strategies .col-rr,
.table-strategies .col-adx,
.table-strategies .col-pulls,
.table-strategies .col-exp,
.table-strategies .col-act,
.table-strategies .col-pnl {
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}
.table-strategies th.col-rank,
.table-strategies th.col-tier,
.table-strategies th.col-rr,
.table-strategies th.col-adx,
.table-strategies th.col-pulls,
.table-strategies th.col-exp,
.table-strategies th.col-act,
.table-strategies th.col-pnl {
  text-align: right;
}
.table-strategies .col-rank {
  color: var(--gekko-green);
  font-weight: 700;
  width: 2.2rem;
  text-align: left;
}
.table-strategies th.col-rank { text-align: left; }
.table-strategies .col-tier {
  font-family: var(--font-mono);
  font-size: max(var(--type-min), 0.78em);
  text-transform: lowercase;
  color: var(--muted, #ffffff);
  width: 5.5rem;
}
.table-strategies .col-strategy {
  font-weight: 700;
  min-width: 7rem;
}
.table-strategies .col-exp,
.table-strategies .col-act {
  font-weight: 700;
  min-width: 3.5rem;
}
.rank-main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}
.rank-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gekko-green);
  min-width: 1.6rem;
  padding-top: 0.1rem;
}
.variant-scores {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}
.variant-scores .score {
  font-family: var(--font-mono);
  font-size: var(--type-min);
  font-weight: 600;
}
.variant-scores .score.expected { color: var(--gekko-green); }
.variant-scores .score.actual { color: var(--muted); }

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.checklist li {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--gekko-border);
  border-left: 3px solid var(--gekko-border-strong);
  background: var(--gekko-surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  font-weight: 600;
}
.checklist li.done {
  border-left-color: var(--gekko-green);
  color: var(--gekko-green);
  background: rgba(0, 255, 65, 0.05);
}
.checklist li.done::before { content: "✓ "; font-weight: 800; }

.setup-links a {
  color: var(--gekko-green);
  font-weight: 700;
  text-decoration: none;
}
.setup-links a:hover { text-decoration: underline; }

/* Home — section tiles + Live summary */
.home-nav-grid {
  margin-bottom: 1.25rem;
}
.home-nav-tile {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.home-nav-tile .section-copy:last-child {
  margin-top: auto;
}
.home-nav-tile-utility {
  opacity: 0.96;
}
.home-live-summary {
  width: 100%;
  margin: 0 0 1.25rem;
}

footer {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem var(--content-pad-x) 2.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: var(--type-min);
  border-top: 1px solid var(--gekko-border);
  box-sizing: border-box;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "left right"
      "center center";
    padding: 0.65rem 1rem;
    gap: 0.55rem;
  }
  .top-left {
    grid-area: left;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
  }
  .topbar-right { grid-area: right; }
  .top-center {
    grid-area: center;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }
  .context-nav,
  .product-nav { width: 100%; justify-content: stretch; }
  .context-link,
  .product-link { flex: 1; text-align: center; padding: 0.35rem 0.4rem; font-size: var(--type-min); }
  .top-nav {
    width: 100%;
    justify-content: stretch;
    gap: 0.3rem;
  }
  .auth-meta { display: none; }
  /* Keep Power + Activity visible; hide only tertiary/hidden aliases. */
  .status-pills .pill[hidden] { display: none !important; }
  .top-link {
    flex: 1;
    justify-content: center;
    padding: 0.55rem 0.35rem;
    font-size: var(--type-min);
  }
  .top-link .tab-note { display: none; }
  .topbar .status-pills { grid-area: pills; }
  .page-intro { padding: 1rem var(--content-pad-x) 0.25rem; }
}

@media (max-width: 860px) {
  :root {
    --content-pad-x: clamp(0.425rem, 1.75vw, 0.75rem);
  }
  .top {
    flex-direction: column;
    align-items: stretch;
    padding: 1.35rem var(--content-pad-x) 0.85rem;
    gap: 0.85rem;
  }
  .brand-block { min-width: 0; }
  .status-pills {
    justify-content: flex-start;
    gap: 0.4rem;
  }
  .pill {
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
  }
  .brand { font-size: clamp(2rem, 9vw, 2.75rem); }
  .tagline { font-size: 0.95rem; }
  .eyebrow {
    letter-spacing: 0.08em;
    font-size: var(--type-min);
    line-height: 1.35;
  }
  main {
    padding: 0 var(--content-pad-x) 2.25rem;
    gap: 1.15rem;
  }
  .period-metrics,
  .account-metrics {
    gap: 0.5rem 0.55rem;
  }
  .metric {
    padding: 0.65rem 0.7rem 0.7rem;
  }
  .metric-label {
    font-size: var(--type-min);
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
  }
  .metric-value {
    font-size: clamp(1.05rem, 4.2vw, 1.35rem);
    line-height: 1.2;
  }
  .panel { padding: 0.9rem 0.85rem 1rem; }
  .section-copy {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    overflow-wrap: anywhere;
  }
  .symbols-line {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: var(--type-min);
    line-height: 1.4;
  }
  .grid-two { grid-template-columns: 1fr; }
  footer {
    padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (max-width: 640px) {
  .col-optional { display: none !important; }
  .table-wrap {
    margin: 0 -0.85rem;
    padding: 0 0.85rem 0.2rem;
  }
  .table-trades,
  .table-positions {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }
  .table-trades th:nth-child(1),
  .table-trades td:nth-child(1),
  .table-positions th:nth-child(1),
  .table-positions td:nth-child(1) {
    width: 12%;
  }
  .table-trades th:nth-child(2),
  .table-trades td:nth-child(2),
  .table-positions th:nth-child(2),
  .table-positions td:nth-child(2) {
    width: 22%;
  }
  th, td {
    padding: 0.55rem 0.3rem;
    white-space: normal;
  }
  td {
    font-size: var(--type-min);
    line-height: 1.3;
    overflow-wrap: anywhere;
  }
  th {
    font-size: var(--type-min);
    letter-spacing: 0.06em;
  }
  .strategy-rank li,
  .variant-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .variant-scores { align-items: flex-start; }
  .setup-links { word-break: break-word; }
}

@media (max-width: 520px) {
  .panel-heading,
  .results-board-part-heading {
    flex-wrap: wrap;
    align-items: center;
  }
  .strategies-total {
    text-align: left;
  }
  .positions-cap {
    justify-content: flex-start;
  }
  :root {
    --content-pad-x: clamp(0.375rem, 1.5vw, 0.55rem);
  }
  .top { padding: 1.1rem var(--content-pad-x) 0.7rem; }
  .top-ico { display: none; }
  .page-intro { padding: 0.85rem var(--content-pad-x) 0.15rem; }
  main {
    padding: 0 var(--content-pad-x) calc(1.75rem + env(safe-area-inset-bottom, 0px));
    gap: 1rem;
  }
  .tagline-rest { display: none; }
  .period-metrics,
  .account-metrics {
    gap: 0.45rem 0.5rem;
  }
  .pill {
    padding: 0.35rem 0.55rem;
    font-size: var(--type-min);
  }
  h2 { font-size: 1.15rem; }
  .section-copy { font-size: 0.88rem; margin-bottom: 0.7rem; }
  .checklist li { padding: 0.6rem 0.7rem; font-size: 0.88rem; }
  .autopilot .section-copy + .section-copy { margin-top: -0.35rem; }
}

@media (max-width: 380px) {
  .period-metrics,
  .account-metrics {
    grid-template-columns: 1fr;
  }
  .period-metrics .metric,
  .account-metrics .metric,
  .compare-metrics .metric {
    width: 100%;
  }
  .book-tab { font-size: var(--type-min); padding: 0.65rem 0.25rem; }
}

/* Project status page */
.status-main { gap: 1.25rem; }
.status-hero .section-copy { max-width: 52rem; }
.status-engine {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.status-engine .metric-value { font-size: clamp(0.95rem, 2vw, 1.25rem); }
.metric-cycle {
  font-size: var(--type-min) !important;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.next-actions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.next-actions li {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--gekko-green-border);
  background: rgba(0, 255, 65, 0.05);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--foreground);
}
.phase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
.phase-card h2 { font-size: 1.15rem; }
.phase-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.phase-head h2 { margin: 0; }
.phase-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin: 0 0 0.85rem;
  font-family: var(--font-mono);
  font-size: var(--type-min);
  color: var(--muted);
}

@media (max-width: 900px) {
  .phase-grid { grid-template-columns: 1fr; }
  .status-engine { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .status-engine { grid-template-columns: 1fr; }
}

/* Strategy summaries on Overview */
.strategy-overview {
  margin: 0 0 1.25rem;
}
.strategy-overview-intro {
  padding-inline: 0;
  margin-bottom: 0.85rem;
}
.strategy-overview-title {
  font-size: 1.35rem;
}
.strategy-pair {
  margin-bottom: 0;
}
.strategy-summary h2 {
  margin: 0.15rem 0 0.65rem;
  font-size: 1.25rem;
}
.strategy-lead {
  margin: 0 0 0.75rem;
  max-width: 40rem;
}
.strategy-subhead {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.95rem;
}
.strategy-decide {
  margin: 0 0 0.25rem;
}
.strategy-bandit {
  margin-top: 1rem;
}
.strategy-bandit .strategy-lead {
  max-width: 62rem;
}
.strategy-bandit-terms {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  max-width: 48rem;
}
.strategy-bandit-term {
  margin: 0;
}
.strategy-bandit-term dt {
  font-family: var(--font-mono);
  font-size: var(--type-min);
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
  margin: 0 0 0.2rem;
}
.strategy-bandit-term dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--foreground);
  padding-left: 0.65rem;
  border-left: 2px solid var(--gekko-green-border);
}

/* Backtest run history + report — denser vertical rhythm on full-width layout. */
.page-backtest-report main {
  gap: 1.25rem;
  min-width: 0;
}
.page-backtest-report .panel {
  max-width: 100%;
  min-width: 0;
  width: 100%;
}
.report-hero-meta,
.report-metrics-grid {
  display: grid;
  /* Nested archive panel is narrower than the viewport — wrap before clipping. */
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 0.25rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.report-metric {
  background: var(--gekko-surface);
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
.report-metric-label {
  font-family: var(--font-mono);
  font-size: var(--type-min);
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--muted);
}
.report-metric-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--foreground);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.25;
  min-width: 0;
}
.report-metric-hint {
  font-size: var(--type-min);
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}
.mono {
  font-family: var(--font-mono);
}
.runs-table {
  min-width: 860px;
}
.runs-table a {
  color: var(--gekko-green);
  font-weight: 700;
  text-decoration: none;
}
.runs-table a:hover {
  text-decoration: underline;
}
#runsRoot,
.run-list {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  max-width: 100%;
}
#runsRoot {
  display: block;
}
#runsRoot .run-list {
  display: grid;
}
.compare-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.1);
}
.compare-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.compare-slot {
  margin-bottom: 1rem;
}
.compare-board {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--gekko-border-strong);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.14);
  min-width: 0;
}
.compare-board-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
.compare-board-heading h3 {
  margin: 0;
  font-size: 1.05rem;
}
.compare-table-wrap {
  overflow-x: auto;
}
.compare-table th[scope="col"] {
  min-width: 8.5rem;
  vertical-align: top;
}
.run-board-table.compare-table th[scope="col"] {
  min-width: 0;
}
.compare-table th[scope="row"] {
  text-align: left;
  white-space: nowrap;
}
.compare-table tr.compare-changed th {
  background: rgba(0, 255, 65, 0.03);
}
/* Cell-level: value differs from the next-older column (to the right). */
.run-board-table td.is-changed-from-prev {
  background: rgba(0, 255, 65, 0.14);
  font-weight: 600;
}
.run-board-table td.is-changed-from-prev.is-current {
  background: rgba(0, 255, 65, 0.2);
}
.run-board-legend-changed {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  border-radius: 0.25rem;
  background: rgba(0, 255, 65, 0.16);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 65, 0.45);
  color: inherit;
  font-weight: 600;
}
.run-board-select {
  width: 100%;
  min-width: 7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  border-radius: 0.35rem;
  padding: 0.4rem 0.45rem;
  font: inherit;
}
.run-board-select:focus {
  outline: none;
  border-color: rgba(0, 255, 65, 0.45);
}
.run-board-readonly-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: var(--type-min);
  font-weight: 500;
  white-space: normal;
  max-width: 11rem;
  line-height: 1.25;
}
.compare-delta {
  margin-top: 0.2rem;
  font-size: var(--type-min);
  color: var(--muted);
}
.run-item-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
}
.run-compare-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.65rem;
  border-right: 1px solid var(--gekko-border);
  background: rgba(0, 0, 0, 0.08);
  cursor: pointer;
}
.run-compare-pick input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--gekko-green);
}
.run-item-row .run-item-toggle {
  flex: 1;
  min-width: 0;
}
.run-item {
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}
.run-item.is-open {
  border-color: var(--gekko-border-strong);
}
.run-item-toggle {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.85rem 1rem;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.run-item-toggle:hover {
  background: rgba(255, 255, 255, 0.03);
}
.run-item-main,
.run-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}
.run-item-id {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--foreground);
}
.run-item-meta {
  color: var(--muted);
  font-size: 0.9rem;
}
.run-item-chevron::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--gekko-green);
}
.run-item.is-open .run-item-chevron::before {
  transform: rotate(90deg);
}
.run-item.is-hidden-run {
  opacity: 0.85;
}
.reports-manage-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.reports-manage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}
.reports-manage-select {
  min-width: 12rem;
  max-width: 22rem;
  padding: 0.28rem 0.4rem;
  font-size: var(--type-min);
  border: 1px solid var(--gekko-border);
  border-radius: 0.35rem;
  background: rgba(12, 14, 18, 0.9);
  color: var(--foreground);
}
.reports-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.reports-manage-status {
  margin: 0;
  font-size: var(--type-min);
}
.reports-manage-status.ok {
  color: var(--success);
}
.reports-manage-status.error {
  color: var(--danger);
}
.results-action-strip .run-control-from-run,
.results-action-strip .run-control-promote-demo {
  align-items: center;
}
/* Save/Revert moved into Current Actions cell on the board. */
.results-action-strip .results-inline-save-bar {
  display: none !important;
}
.results-action-strip .run-control-select {
  min-width: 10rem;
  max-width: 16rem;
  padding: 0.28rem 0.4rem;
  font-size: var(--type-min);
  border: 1px solid var(--gekko-border);
  border-radius: 0.35rem;
  background: rgba(12, 14, 18, 0.9);
  color: var(--foreground);
}
.run-item-panel {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--gekko-border);
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}
.run-report-body {
  display: grid;
  gap: 1rem;
  padding-top: 0.85rem;
  min-width: 0;
  max-width: 100%;
}
.run-report-heading {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}
.run-report-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--foreground);
  overflow-wrap: anywhere;
}
.run-report-sub {
  margin: 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.run-report-section {
  min-width: 0;
  max-width: 100%;
}
.tz-tag {
  font-family: var(--font-mono);
  font-size: var(--type-min);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gekko-green-dim);
  margin-left: 0.25rem;
}
.run-report-section h3 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}
.report-metric-perf {
  gap: 0.2rem;
}
.pnl-pct {
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  margin-left: 0.15rem;
}
.report-metric-value .pnl-pct {
  font-size: max(var(--type-min), 0.88em);
}
.report-metric-value:has(.pnl-pct) {
  font-size: 1rem;
}
.report-metric-prev {
  font-size: var(--type-min);
  overflow-wrap: anywhere;
  min-width: 0;
}
.report-metric-prev .pnl-pct,
.report-metric-delta .pnl-pct {
  font-size: max(var(--type-min), 0.92em);
}
.report-metric-delta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem;
  font-size: var(--type-min);
  font-weight: 700;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.delta-arrow {
  font-size: var(--type-min);
  line-height: 1;
}
.delta-arrow.delta-flat {
  color: var(--muted);
}
button.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gekko-green);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.pill.status-succeeded,
.pill.status-upload_failed {
  border-color: var(--gekko-green-border);
  color: var(--gekko-green);
}
.pill.status-failed,
.pill.status-oom,
.pill.status-cancelled {
  border-color: rgba(239, 68, 68, 0.45);
  color: var(--danger);
}
.pill.status-queued,
.pill.status-claimed,
.pill.status-running {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--warning);
}
.delta-up { color: var(--gekko-green); font-weight: 700; }
.delta-down { color: #f87171; font-weight: 700; }
.danger-text { color: var(--danger); }
.results-page-layout {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}
.results-page-layout > .panel {
  min-width: 0;
}
/* One board: Results + Settings parts share a scroll plane so columns line up. */
.results-board-panel {
  padding-bottom: 1.15rem;
}
.results-unified-scroll {
  /* Run board only — Series sits below as its own full-width block. */
  overflow-x: visible;
  overflow-y: visible;
  min-width: 0;
}
.results-board-part + .results-board-part,
.results-unified-scroll + .results-board-part {
  margin-top: 1.15rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--gekko-border);
}
/* Series tip opens downward so it does not cover the Run board above. */
.results-board-part[data-part="series"] .info-tip-bubble {
  bottom: auto;
  top: calc(100% + 0.45rem);
}
.results-board-part[data-part="series"] .info-tip-bubble::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #25252d;
}
.results-board-part-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}
.results-board-part-heading > .panel-heading-copy {
  flex: 0 1 auto;
  min-width: 0;
}
.results-board-part-heading > .section-copy {
  margin: 0;
  flex: 0 0 auto;
  text-align: right;
  font-size: var(--type-min);
}
.settings-save-bar[hidden],
.results-inline-save-bar[hidden] {
  display: none !important;
}
body.page-demo-results.settings-is-dirty .app-content-scroll,
body.page-backtest-results.settings-is-dirty .app-content-scroll {
  padding-bottom: 0;
}
@media (max-width: 720px) {
  .results-board-part-heading > .section-copy {
    text-align: left;
  }
}
.results-board-part h2 {
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}
/* Desk-style scrollport: Run + Actions stick; rows scroll underneath. */
.results-board-panel .run-board-wrap {
  max-height: min(62rem, 86vh);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* Outer frame of the board grid (same rule as inner cell lines). */
  border: 1px solid var(--results-col-rule);
  border-radius: var(--radius);
}
.results-board-panel {
  /* Host for runtime --results-col-* set by alignBoardColumns. */
  --results-col-label: 5.5rem;
  --results-col-data: clamp(7.875rem, 21vw, 15rem);
  --results-col-gap: 0px;
  /* Equal horizontal inset inside every column (left == right). */
  --results-col-pad: 0.65rem;
}
.run-board-table {
  table-layout: fixed;
  width: max-content;
  min-width: 0;
  max-width: none;
  border-collapse: separate;
  /* No border-spacing — that sat only between columns and made right gutters look wider. */
  border-spacing: 0;
}
.run-board-table > thead > tr > th,
.run-board-table > tbody > tr > th,
.run-board-table > tbody > tr > td {
  box-sizing: border-box;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  line-height: 1.35;
  /* Equal left/right inset inside every column. */
  padding: 0.7rem var(--results-col-pad);
  /* One consistent lattice: right + bottom only (wrap supplies outer frame). */
  border: 0;
  border-right: 1px solid var(--results-col-rule);
  border-bottom: 1px solid var(--results-col-rule);
  box-shadow: none;
  background-clip: padding-box;
}
.run-board-table > thead > tr > *:last-child,
.run-board-table > tbody > tr > *:last-child {
  border-right: 0;
}
.run-board-table > thead > tr > th:first-child,
.run-board-table > tbody > tr > th[scope="row"] {
  width: var(--results-col-label);
  min-width: var(--results-col-label);
  max-width: var(--results-col-label);
}
.run-board-table > thead > tr > th:not(:first-child),
.run-board-table > tbody > tr > td {
  width: var(--results-col-data);
  min-width: var(--results-col-data);
  max-width: var(--results-col-data);
}
.run-board-table.compare-table th[scope="col"],
.run-board-table.compare-table th[scope="row"] {
  min-width: 0;
  max-width: none;
  white-space: normal;
}
.results-compare-board {
  margin-bottom: 1rem;
}
.results-run-picker {
  margin-top: 0.35rem;
}
.results-series-wrap {
  margin-top: 0.35rem;
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  overflow-x: auto;
  max-width: 100%;
}
.results-series-table {
  width: 100%;
  min-width: 40rem;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0;
}
.results-series-table > thead > tr > th,
.results-series-table > tbody > tr > td {
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
  line-height: 1.35;
  padding: 0.7rem var(--results-col-pad, 0.65rem);
}
.results-series-table > thead > tr > th:first-child,
.results-series-table > tbody > tr > td:first-child {
  width: 22%;
  box-shadow: inset -1px 0 0 var(--results-col-rule);
}
.results-series-table > thead > tr > th:not(:first-child),
.results-series-table > tbody > tr > td:not(:first-child) {
  border-left: 1px solid var(--results-col-rule);
  box-shadow: inset 1px 0 0 var(--results-col-rule);
  background-clip: padding-box;
}
.results-series-table > thead > tr > th:nth-child(2),
.results-series-table > tbody > tr > td:nth-child(2),
.results-series-table > thead > tr > th:nth-child(5),
.results-series-table > tbody > tr > td:nth-child(5) {
  width: 12%;
}
.results-series-table > thead > tr > th:nth-child(3),
.results-series-table > tbody > tr > td:nth-child(3),
.results-series-table > thead > tr > th:nth-child(4),
.results-series-table > tbody > tr > td:nth-child(4) {
  width: 14%;
}
.results-series-table > thead > tr > th:nth-child(6),
.results-series-table > tbody > tr > td:nth-child(6) {
  width: 16%;
}
.results-settings-grid {
  margin-bottom: 0.75rem;
}
.results-top-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
}
.results-top-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}
.results-version-item .run-item-row {
  padding: 0.75rem 0.15rem;
}
.suggest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.suggest-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border-left: 3px solid var(--gekko-border-strong);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.suggest-item strong {
  font-size: 0.95rem;
}
.suggest-item span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.suggest-high { border-left-color: var(--danger); }
.suggest-medium { border-left-color: var(--warning); }
.suggest-low { border-left-color: var(--gekko-green); }
.run-report-subhead {
  margin: 1rem 0 0.45rem;
  font-size: var(--type-min);
  font-weight: 700;
  color: var(--muted);
}
.settings-compare-table tr.settings-changed td {
  background: rgba(245, 158, 11, 0.08);
}
.settings-changed-tag {
  display: inline-block;
  font-size: var(--type-min);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--warning);
}
.report-profile-meta {
  margin: 0.65rem 0 0.85rem;
}
.lineage-table {
  width: 100%;
  table-layout: fixed;
}
.lineage-table th,
.lineage-table td {
  /* Override global th/td nowrap so Strategies + Bar interval wrap in-panel. */
  white-space: normal;
}
.lineage-table th:nth-child(1),
.lineage-table td:nth-child(1) {
  width: 26%;
}
.lineage-table th:nth-child(2),
.lineage-table td:nth-child(2) {
  width: 42%;
}
.lineage-table th:nth-child(3),
.lineage-table td:nth-child(3) {
  width: 32%;
}
.lineage-table td {
  vertical-align: top;
  font-size: var(--type-min);
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.lineage-table td.lineage-strategies,
.lineage-table td.lineage-bars {
  font-family: var(--font-ui);
  font-size: var(--type-min);
  color: var(--foreground);
}
.lineage-table tr.lineage-current td {
  background: rgba(34, 197, 94, 0.08);
}
.lineage-table tr.lineage-previous td {
  background: rgba(148, 163, 184, 0.08);
}
.settings-compare-table {
  width: 100%;
  table-layout: fixed;
}
.settings-compare-table th,
.settings-compare-table td {
  white-space: normal;
}
.settings-compare-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}
.report-profile-meta .report-metric-value {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 520px) {
  .report-hero-meta,
  .report-metrics-grid {
    grid-template-columns: 1fr;
  }
  .run-item-panel {
    padding: 0 0.75rem 0.85rem;
  }
}

/* —— Left navigation shell (2026-07-17) —— */
:root {
  --shell-topbar-height: 44px;
  --shell-rail-expanded: 260px;
  --shell-rail-collapsed: 56px;
  --shell-current-rail-width: var(--shell-rail-expanded);
  --shell-nav-item-height: 44px;
  --shell-nav-text: #ffffff;
  --shell-nav-text-secondary: #ffffff;
  --shell-accent-v1: var(--gekko-green);
  --shell-accent-v2: #31c7ff;
  --shell-accent-admin: #a78bfa;
  /* L1 section colors (GekkoFlow-style bright hub text). */
  --l1-overview: #c084fc;
  --l1-live: #00ff41;
  --l1-demo: #ffb300;
  --l1-backtest: #00bfff;
  --l1-admin: #f472b6;
  --shell-focus: #ffffff;
  --shell-motion-fast: 160ms;
  --shell-motion-panel: 220ms;
  --shell-z-content: 1;
  --shell-z-rail: 40;
  --shell-z-topbar: 50;
  --shell-z-backdrop: 60;
  --shell-z-drawer: 70;
}

body[data-shell-page="workspace"],
body[data-shell="workspace"],
body.app-shell:has(.app-sidebar) {
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.app-shell[data-shell="workspace"] {
  display: grid;
  grid-template-columns: var(--shell-current-rail-width) minmax(0, 1fr);
  grid-template-rows: var(--shell-topbar-height) minmax(0, 1fr);
  grid-template-areas:
    "topbar topbar"
    "sidebar content";
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

.app-topbar {
  grid-area: topbar;
  position: sticky;
  top: 0;
  z-index: var(--shell-z-topbar);
  display: grid;
  grid-template-columns: var(--shell-current-rail-width) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 0.75rem;
  height: var(--shell-topbar-height);
  padding: 0 0.75rem 0 0;
  border-bottom: 1px solid var(--gekko-border);
  background: rgba(30, 30, 36, 0.92);
  backdrop-filter: blur(12px);
  box-sizing: border-box;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 100%;
  padding: 0 0.85rem;
  width: var(--shell-current-rail-width);
  text-decoration: none;
  color: var(--shell-nav-text);
  box-sizing: border-box;
  min-width: 0;
}
.app-brand img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.app-brand-copy {
  min-width: 0;
  overflow: hidden;
}
.app-brand-copy strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.app-brand-copy strong::after {
  content: "";
}

.app-menu-trigger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gekko-border-strong);
  border-radius: var(--radius);
  background: rgba(18, 18, 22, 0.9);
  color: var(--shell-nav-text);
  cursor: pointer;
}
.app-menu-trigger::before {
  content: "";
  width: 18px;
  height: 14px;
  background:
    linear-gradient(currentColor, currentColor) 0 0/100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 6px/100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 12px/100% 2px no-repeat;
}

.app-breadcrumb-region {
  flex: 0 0 auto;
  min-width: 0;
  overflow-x: auto;
  padding: 0.55rem var(--content-pad-x) 0.15rem;
  border-bottom: 0;
  background: transparent;
}

/* Desk sticky chrome: breadcrumbs + run CTAs share one fixed row above scroll. */
.app-desk-chrome {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  flex-wrap: wrap;
  padding: 0.2rem var(--content-pad-x);
  border-bottom: 1px solid var(--gekko-border);
  background: rgba(30, 30, 36, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-desk-chrome .app-breadcrumb-region {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.15rem 0;
}
.app-desk-chrome .breadcrumbs {
  margin: 0;
}
.app-desk-chrome .desk-chrome-actions {
  margin: 0;
  flex: 0 1 auto;
  justify-content: flex-end;
  gap: 0.35rem;
}
.app-desk-chrome .desk-chrome-actions .btn {
  padding: 0.4rem 0.7rem;
  min-height: 0;
  line-height: 1.2;
  font-size: var(--type-min);
}
.app-desk-chrome .desk-chrome-actions #deskRunStatus {
  flex: 0 1 auto;
  flex-basis: auto;
  min-height: 0;
  font-size: var(--type-min);
}
@media (max-width: 720px) {
  .app-desk-chrome {
    align-items: stretch;
  }
  .app-desk-chrome .desk-chrome-actions {
    justify-content: flex-start;
  }
}

/* Keys: Overview row layout (Live solo, Demo pair) with prior content-sized tiles. */
.admin-keys-grid {
  margin-top: 0.85rem;
  margin-bottom: 0;
}
.admin-keys-grid .overview-summary-row-solo,
.admin-keys-grid .overview-summary-row-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.85rem;
  width: max-content;
  max-width: 100%;
}
.admin-keys-card {
  width: max-content;
  max-width: 100%;
  flex: 0 1 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.admin-keys-card .panel-heading {
  gap: 0.75rem 1rem;
}
.admin-keys-card h3 {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
}
.admin-keys-card .operator-row {
  max-width: 22rem;
  margin-top: 0;
}
.admin-keys-card .operator-row input {
  min-width: 16rem;
  max-width: 22rem;
}
.admin-keys-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
  width: max-content;
  max-width: 100%;
}
/* Keep heading on page ground — nested surface tiles on a grey panel look muddy. */
.page-admin-keys main > .panel:has(#keysTargetsRoot) {
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  padding: 0;
}
.page-admin-keys .admin-keys-card .panel-heading-copy {
  flex: 0 1 auto;
}

.app-top-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-self: end;
  padding-right: 0.5rem;
}

.desk-net {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: min(46vw, 16rem);
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--gekko-border);
  background: rgba(18, 18, 24, 0.72);
  color: var(--muted, #ffffff);
  font-family: var(--font-mono);
  font-size: var(--type-min);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desk-net-ip {
  color: var(--foreground, #f4f4f5);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desk-net-sep {
  opacity: 0.45;
}

.desk-net-ping {
  color: var(--gekko-green, #00ff41);
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .desk-net {
    max-width: 42vw;
    padding: 0.22rem 0.4rem;
    font-size: var(--type-min);
    gap: 0.25rem;
  }
}

.app-sidebar {
  grid-area: sidebar;
  position: sticky;
  top: var(--shell-topbar-height);
  z-index: var(--shell-z-rail);
  height: calc(100vh - var(--shell-topbar-height));
  height: calc(100dvh - var(--shell-topbar-height));
  width: var(--shell-current-rail-width);
  border-right: 1px solid var(--gekko-border);
  background: rgba(22, 22, 28, 0.96);
  overflow: hidden;
  transition: width var(--shell-motion-panel) ease;
}

.app-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.app-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  min-height: 40px;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--gekko-border);
}
.app-sidebar-head > .app-rail-toggle {
  flex-shrink: 0;
  margin-right: auto;
}
.app-sidebar-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  margin-left: auto;
}
.app-rail-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--shell-nav-text-secondary);
  cursor: pointer;
  transition: color var(--shell-motion-fast) ease, background var(--shell-motion-fast) ease;
}
.app-rail-tool .shell-icon {
  width: 15px;
  height: 15px;
}
.app-rail-tool:hover,
.app-rail-tool.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--shell-nav-text);
}
.app-rail-tool.is-rail-open {
  color: var(--gekko-green);
}
.app-rail-tool.is-rail-open:hover {
  background: rgba(0, 255, 65, 0.1);
}
.app-sidebar-search {
  padding: 0.35rem 0.55rem 0.55rem;
  border-bottom: 1px solid var(--gekko-border);
}
.app-sidebar-search[hidden] {
  display: none !important;
}
.app-sidebar-search-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  padding: 0.4rem 0.65rem;
  border-radius: 0.4rem;
  border: 1px solid var(--gekko-border-strong);
  background: rgba(18, 18, 22, 0.95);
  color: var(--shell-nav-text);
  font: inherit;
  font-size: var(--type-min);
}
.app-sidebar-search-input::placeholder {
  color: var(--muted);
}
.app-sidebar-search-input:focus {
  outline: 2px solid var(--shell-focus);
  outline-offset: 1px;
}
.shell-nav-search-empty {
  margin: 0.75rem 0.55rem;
  color: var(--muted);
  font-size: var(--type-min);
  font-weight: 600;
}

.app-sidebar-primary,
.app-sidebar-utility {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.35rem 0.55rem;
  min-height: 0;
  overflow-y: auto;
}

/* Primary absorbs leftover height and scrolls; utility + account stay fully visible. */
.app-sidebar-primary {
  flex: 1 1 auto;
}

.app-sidebar-utility {
  flex: 0 0 auto;
  margin-top: auto;
  border-top: 1px solid var(--gekko-border);
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.app-sidebar-footer {
  position: relative;
  flex: 0 0 auto;
  border-top: 1px solid var(--gekko-border);
  padding: 0.55rem;
}

.app-sidebar-backdrop {
  display: none;
}

.shell-nav-group { display: flex; flex-direction: column; gap: 0.1rem; }
.shell-nav-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: stretch;
  border-radius: 0.45rem;
}

.shell-nav-link,
.shell-nav-chevron,
.app-rail-toggle,
.shell-account-trigger {
  min-height: var(--shell-nav-item-height);
  border: 0;
  background: transparent;
  color: var(--shell-nav-text);
  font: inherit;
  cursor: pointer;
}

.shell-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0 0.7rem;
  border-radius: 0.45rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  position: relative;
}
.shell-nav-link:hover,
.shell-nav-chevron:hover,
.app-rail-toggle:hover,
.shell-account-trigger:hover {
  background: rgba(255, 255, 255, 0.05);
}

/*
 * L1 → L2 → L3 inherit the section hue.
 * Each top-level .shell-nav-group sets --nav-l1 / --nav-l1-soft for descendants.
 */
.app-sidebar-primary > .shell-nav-group[data-nav-id="overview"],
.app-sidebar-primary > .shell-nav-group[data-nav-id="overview"] .shell-nav-group {
  --nav-l1: var(--l1-overview);
  --nav-l1-soft: rgba(192, 132, 252, 0.14);
}
.app-sidebar-primary > .shell-nav-group[data-nav-id="live"],
.app-sidebar-primary > .shell-nav-group[data-nav-id="live"] .shell-nav-group {
  --nav-l1: var(--l1-live);
  --nav-l1-soft: rgba(0, 255, 65, 0.12);
}
.app-sidebar-primary > .shell-nav-group[data-nav-id="demo-v1"],
.app-sidebar-primary > .shell-nav-group[data-nav-id="demo-v1"] .shell-nav-group,
.app-sidebar-primary > .shell-nav-group[data-nav-id="demo-v2"],
.app-sidebar-primary > .shell-nav-group[data-nav-id="demo-v2"] .shell-nav-group {
  --nav-l1: var(--l1-demo);
  --nav-l1-soft: rgba(255, 179, 0, 0.14);
}
.app-sidebar-primary > .shell-nav-group[data-nav-id="backtest-v1"],
.app-sidebar-primary > .shell-nav-group[data-nav-id="backtest-v1"] .shell-nav-group,
.app-sidebar-primary > .shell-nav-group[data-nav-id="backtest-v2"],
.app-sidebar-primary > .shell-nav-group[data-nav-id="backtest-v2"] .shell-nav-group {
  --nav-l1: var(--l1-backtest);
  --nav-l1-soft: rgba(0, 191, 255, 0.14);
}
.app-sidebar-utility > .shell-nav-group[data-nav-id="admin"],
.app-sidebar-utility > .shell-nav-group[data-nav-id="admin"] .shell-nav-group {
  --nav-l1: var(--l1-admin);
  --nav-l1-soft: rgba(244, 114, 182, 0.14);
}

/* L1 + L2 + L3 text/icons/chevrons use the section color. */
.app-sidebar-primary > .shell-nav-group > .shell-nav-row > .shell-nav-link,
.app-sidebar-primary > .shell-nav-group > .shell-nav-row > .shell-nav-chevron,
.app-sidebar-primary > .shell-nav-group .shell-nav-children .shell-nav-link,
.app-sidebar-primary > .shell-nav-group .shell-nav-children .shell-nav-chevron,
.app-sidebar-utility > .shell-nav-group > .shell-nav-row > .shell-nav-link,
.app-sidebar-utility > .shell-nav-group > .shell-nav-row > .shell-nav-chevron,
.app-sidebar-utility > .shell-nav-group .shell-nav-children .shell-nav-link,
.app-sidebar-utility > .shell-nav-group .shell-nav-children .shell-nav-chevron {
  color: var(--nav-l1);
}

/* L1 selected row tint. */
.app-sidebar-primary > .shell-nav-group > .shell-nav-row.is-active-parent,
.app-sidebar-utility > .shell-nav-group > .shell-nav-row.is-active-parent,
.app-sidebar-utility > .shell-nav-group > a.shell-nav-link.is-active {
  background: var(--nav-l1-soft);
}
.app-sidebar-primary > .shell-nav-group > .shell-nav-row.is-active-parent > .shell-nav-link,
.app-sidebar-primary > .shell-nav-group > .shell-nav-row.is-active-parent > .shell-nav-chevron,
.app-sidebar-utility > .shell-nav-group > .shell-nav-row.is-active-parent > .shell-nav-link,
.app-sidebar-utility > .shell-nav-group > .shell-nav-row.is-active-parent > .shell-nav-chevron,
.app-sidebar-utility > .shell-nav-group > a.shell-nav-link.is-active {
  font-weight: 700;
}

/* L2 selected (product / leaf under L1). */
.app-sidebar-primary > .shell-nav-group > .shell-nav-children > .shell-nav-group > .shell-nav-row.is-active-parent > .shell-nav-link,
.app-sidebar-primary > .shell-nav-group > .shell-nav-children > .shell-nav-group > .shell-nav-row.is-active-parent > .shell-nav-chevron,
.app-sidebar-utility > .shell-nav-group > .shell-nav-children > .shell-nav-group > .shell-nav-row.is-active-parent > .shell-nav-link,
.app-sidebar-utility > .shell-nav-group > .shell-nav-children > .shell-nav-group > .shell-nav-row.is-active-parent > .shell-nav-chevron,
.app-sidebar-primary > .shell-nav-group > .shell-nav-children > a.shell-nav-link.is-active,
.app-sidebar-utility > .shell-nav-group > .shell-nav-children > a.shell-nav-link.is-active {
  color: var(--nav-l1);
  font-weight: 700;
}
.app-sidebar-primary > .shell-nav-group > .shell-nav-children > a.shell-nav-link.is-active,
.app-sidebar-utility > .shell-nav-group > .shell-nav-children > a.shell-nav-link.is-active {
  background: transparent;
}

/* L3 selected: soft chip + accent bar in the L1 hue. */
.shell-nav-children .shell-nav-children a.shell-nav-link.is-active {
  background: var(--nav-l1-soft);
  color: var(--nav-l1);
  font-weight: 700;
}
.shell-nav-children .shell-nav-children a.shell-nav-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--nav-l1);
}

.shell-nav-product { border-radius: 0.45rem 0 0 0.45rem; }
.shell-nav-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  border-radius: 0 0.45rem 0.45rem 0;
  color: var(--shell-nav-text-secondary);
}
.shell-nav-chevron[aria-expanded="true"] .shell-icon {
  transform: rotate(90deg);
}

.shell-nav-children {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.15rem 0 0.35rem 0.55rem;
}
.shell-nav-children[hidden] {
  display: none !important;
}
.shell-nav-children .shell-nav-link {
  font-size: 0.875rem;
  min-height: 40px;
}
.shell-nav-children .shell-nav-subgroup {
  gap: 0.05rem;
}
.shell-nav-children .shell-nav-children {
  padding-left: 0.55rem;
}
.shell-nav-children .shell-nav-children .shell-nav-link {
  font-size: var(--type-min);
  min-height: 36px;
  font-weight: 500;
}

.shell-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--shell-motion-fast) ease;
}
.shell-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-account-trigger {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  text-align: left;
}
.shell-account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 255, 65, 0.14);
  border: 1px solid var(--gekko-green-border);
  color: var(--gekko-green);
  font-size: var(--type-min);
  font-weight: 800;
  flex-shrink: 0;
}
.shell-account-meta {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}
.shell-account-meta strong {
  font-size: var(--type-min);
  color: var(--shell-nav-text);
}
.shell-account-meta span {
  font-size: var(--type-min);
  color: var(--shell-nav-text-secondary);
}
.shell-account-menu {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: calc(100% + 0.35rem);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--gekko-border-strong);
  background: #1a1a20;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 5;
}
.shell-account-menu[hidden] { display: none !important; }
.shell-account-email {
  font-size: var(--type-min);
  color: var(--shell-nav-text-secondary);
  word-break: break-all;
}
.shell-account-menu .danger,
#authSignOut {
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: transparent;
  color: #fca5a5;
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.shell-account-pending,
.shell-account-unavailable {
  color: var(--shell-nav-text-secondary);
  font-size: var(--type-min);
  padding: 0.5rem 0.35rem;
}
.shell-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.app-content-shell {
  grid-area: content;
  min-width: 0;
  min-height: 0;
  z-index: var(--shell-z-content);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--shell-topbar-height));
  height: calc(100dvh - var(--shell-topbar-height));
  overflow: hidden;
}

.app-content-scroll {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.app-content-scroll > .page-intro,
.app-content-scroll > main,
.app-content-scroll > footer {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0;
  min-width: 0;
  width: max-content;
  max-width: none;
}
.breadcrumbs li {
  display: inline-flex;
  align-items: center;
}
.breadcrumb-link,
.breadcrumb-current {
  font-size: var(--type-min);
  font-weight: 600;
  color: var(--shell-nav-text-secondary);
  text-decoration: none;
  padding: 0.35rem 0.4rem;
  border-radius: 0.35rem;
  white-space: nowrap;
}
.breadcrumb-link:hover { color: var(--shell-nav-text); background: rgba(255,255,255,0.04); }
.breadcrumb-current {
  color: var(--shell-nav-text);
  font-weight: 700;
}
.breadcrumb-separator {
  color: var(--muted);
  opacity: 0.8;
}
.breadcrumb-separator .shell-icon {
  width: 14px;
  height: 14px;
}

/* Collapsed desktop rail */
[data-shell-state="desktop-collapsed"] .shell-label,
[data-shell-state="tablet-collapsed"] .shell-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
[data-shell-state="desktop-collapsed"] .shell-nav-children,
[data-shell-state="tablet-collapsed"] .shell-nav-children,
[data-shell-state="desktop-collapsed"] .shell-nav-chevron,
[data-shell-state="tablet-collapsed"] .shell-nav-chevron,
[data-shell-state="desktop-collapsed"] .shell-account-meta,
[data-shell-state="tablet-collapsed"] .shell-account-meta {
  display: none !important;
}
[data-shell-state="desktop-collapsed"] .shell-nav-row,
[data-shell-state="tablet-collapsed"] .shell-nav-row {
  grid-template-columns: 1fr;
}
[data-shell-state="desktop-collapsed"] .app-brand-copy,
[data-shell-state="tablet-collapsed"] .app-brand-copy {
  display: none;
}
[data-shell-state="desktop-collapsed"] .shell-nav-link,
[data-shell-state="tablet-collapsed"] .shell-nav-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
[data-shell-state="desktop-collapsed"] .app-sidebar-head,
[data-shell-state="tablet-collapsed"] .app-sidebar-head {
  justify-content: flex-start;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
[data-shell-state="desktop-collapsed"] .app-sidebar-head > .app-rail-toggle,
[data-shell-state="tablet-collapsed"] .app-sidebar-head > .app-rail-toggle {
  margin-right: 0;
}
[data-shell-state="desktop-collapsed"] .app-sidebar-tools,
[data-shell-state="tablet-collapsed"] .app-sidebar-tools {
  display: none;
}
[data-shell-state="desktop-collapsed"] .app-sidebar-search,
[data-shell-state="tablet-collapsed"] .app-sidebar-search {
  display: none !important;
}
[data-shell-state="desktop-hover"] .app-sidebar-search:not([hidden]) {
  display: block !important;
}

/* Tooltips for icon rail */
[data-shell-state="desktop-collapsed"] .shell-nav-link,
[data-shell-state="tablet-collapsed"] .shell-nav-link,
[data-shell-state="desktop-collapsed"] .app-rail-toggle,
[data-shell-state="tablet-collapsed"] .app-rail-toggle,
[data-shell-state="desktop-collapsed"] .shell-account-trigger,
[data-shell-state="tablet-collapsed"] .shell-account-trigger {
  position: relative;
}
/* Native title tooltips cover collapsed icon labels; keep focus rings visible. */

/* Collapsed rail hover flyout: expand labels over content without shifting layout */
[data-shell-state="desktop-hover"] .app-sidebar {
  position: fixed;
  left: 0;
  top: var(--shell-topbar-height);
  width: var(--shell-rail-expanded);
  z-index: var(--shell-z-drawer);
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.35);
  overflow-x: hidden;
  overflow-y: auto;
}
[data-shell-state="desktop-hover"] .shell-label,
[data-shell-state="desktop-hover"] .shell-nav-chevron,
[data-shell-state="desktop-hover"] .shell-account-meta {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
  overflow: visible;
}
[data-shell-state="desktop-hover"] .shell-nav-children:not([hidden]) {
  display: flex !important;
}
[data-shell-state="desktop-hover"] .shell-nav-chevron {
  display: inline-flex !important;
}
[data-shell-state="desktop-hover"] .shell-account-meta {
  display: flex !important;
}
[data-shell-state="desktop-hover"] .shell-nav-row {
  grid-template-columns: minmax(0, 1fr) 40px;
}
[data-shell-state="desktop-hover"] .shell-nav-link {
  justify-content: flex-start;
  padding-left: 0.65rem;
  padding-right: 0.55rem;
}
[data-shell-state="desktop-hover"] .app-sidebar-head {
  justify-content: space-between;
}
[data-shell-state="desktop-hover"] .app-sidebar-tools {
  display: inline-flex;
}

.app-shell[data-shell="workspace"] .shell-nav-link:focus-visible,
.app-shell[data-shell="workspace"] .shell-nav-chevron:focus-visible,
.app-shell[data-shell="workspace"] .app-rail-toggle:focus-visible,
.app-shell[data-shell="workspace"] .app-menu-trigger:focus-visible,
.app-shell[data-shell="workspace"] .shell-account-trigger:focus-visible,
.app-shell[data-shell="workspace"] .breadcrumb-link:focus-visible {
  outline: 2px solid var(--shell-focus);
  outline-offset: 2px;
}

/* Overview section tabs (page content, not shell product/book nav) */
.overview-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
}
.overview-section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--shell-nav-text-secondary);
  font-size: var(--type-min);
  font-weight: 700;
  border: 1px solid transparent;
}
.overview-section-link:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--gekko-border);
}
.overview-section-link.active {
  color: var(--gekko-green);
  background: rgba(0, 255, 65, 0.06);
  border-color: var(--gekko-green-border);
}

/* Tablet overlay + mobile drawer */
@media (max-width: 1199px) {
  .app-shell[data-shell="workspace"] {
    grid-template-columns: var(--shell-rail-collapsed) minmax(0, 1fr);
  }
  .app-topbar {
    grid-template-columns: var(--shell-rail-collapsed) auto minmax(0, 1fr) auto;
  }
  [data-shell-state="tablet-overlay"] .app-sidebar {
    position: fixed;
    left: 0;
    top: var(--shell-topbar-height);
    width: var(--shell-rail-expanded);
    z-index: var(--shell-z-drawer);
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.35);
  }
  [data-shell-state="tablet-overlay"] .shell-label,
  [data-shell-state="tablet-overlay"] .shell-nav-chevron,
  [data-shell-state="tablet-overlay"] .shell-account-meta {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    overflow: visible;
  }
  [data-shell-state="tablet-overlay"] .shell-nav-children:not([hidden]) { display: flex !important; }
  [data-shell-state="tablet-overlay"] .shell-nav-chevron { display: inline-flex !important; }
  [data-shell-state="tablet-overlay"] .shell-account-meta { display: flex !important; }
  [data-shell-state="tablet-overlay"] .shell-nav-row { grid-template-columns: minmax(0, 1fr) 40px; }
  [data-shell-state="tablet-overlay"] .app-sidebar-backdrop,
  [data-shell-state="mobile-open"] .app-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: var(--shell-topbar-height) 0 0 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: var(--shell-z-backdrop);
    border: 0;
  }
}

@media (max-width: 767px) {
  .app-shell[data-shell="workspace"] {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "content";
  }
  .app-topbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    padding-left: 0.5rem;
  }
  .app-brand {
    width: auto;
    padding-left: 0.35rem;
    padding-right: 0.25rem;
  }
  .app-brand-copy { display: none; }
  .app-menu-trigger { display: inline-flex; }
  .app-sidebar {
    position: fixed;
    left: 0;
    top: var(--shell-topbar-height);
    width: var(--shell-rail-expanded);
    transform: translateX(-105%);
    transition: transform var(--shell-motion-panel) ease;
    z-index: var(--shell-z-drawer);
  }
  [data-shell-state="mobile-open"] .app-sidebar {
    transform: translateX(0);
  }
  body.shell-no-scroll {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar,
  .shell-icon,
  .app-sidebar-backdrop {
    transition: none !important;
  }
}

/* Hide legacy top product/book chrome if any remnant markup remains */
.workspace > .topbar .context-nav,
.workspace > .topbar .product-nav,
.workspace > .topbar .book-nav {
  display: none !important;
}

/* —— Top L1 site nav (Overview · Live · Demo · Backtest) —— */
.app-topnav-region {
  min-width: 0;
}

.app-topnav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.app-topnav-item {
  position: relative;
}

.app-topnav-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.75rem;
  border-radius: 0.4rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--shell-nav-text-secondary);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--shell-motion-fast) ease, background-color var(--shell-motion-fast) ease;
}

/* Bright per-item L1 text (reference: GekkoFlow hub nav). */
.app-topnav-top[data-nav-id="overview"] { color: var(--l1-overview); }
.app-topnav-top[data-nav-id="live"] { color: var(--l1-live); }
.app-topnav-top[data-nav-id="demo-v1"],
.app-topnav-top[data-nav-id="demo-v2"] { color: var(--l1-demo); }
.app-topnav-top[data-nav-id="backtest-v1"],
.app-topnav-top[data-nav-id="backtest-v2"] { color: var(--l1-backtest); }

.app-topnav-top[data-nav-id="overview"]:hover {
  color: var(--l1-overview);
  background: rgba(192, 132, 252, 0.12);
}
.app-topnav-top[data-nav-id="live"]:hover {
  color: var(--l1-live);
  background: rgba(0, 255, 65, 0.1);
}
.app-topnav-top[data-nav-id="demo-v1"]:hover,
.app-topnav-top[data-nav-id="demo-v2"]:hover {
  color: var(--l1-demo);
  background: rgba(255, 179, 0, 0.12);
}
.app-topnav-top[data-nav-id="backtest-v1"]:hover,
.app-topnav-top[data-nav-id="backtest-v2"]:hover {
  color: var(--l1-backtest);
  background: rgba(0, 191, 255, 0.12);
}

.app-topnav-item.is-active > .app-topnav-top[data-nav-id="overview"],
.app-topnav-top[data-nav-id="overview"].is-active {
  color: var(--l1-overview);
  background: rgba(192, 132, 252, 0.16);
}
.app-topnav-item.is-active > .app-topnav-top[data-nav-id="live"],
.app-topnav-top[data-nav-id="live"].is-active {
  color: var(--l1-live);
  background: rgba(0, 255, 65, 0.12);
}
.app-topnav-item.is-active > .app-topnav-top[data-nav-id="demo-v1"],
.app-topnav-item.is-active > .app-topnav-top[data-nav-id="demo-v2"],
.app-topnav-top[data-nav-id="demo-v1"].is-active,
.app-topnav-top[data-nav-id="demo-v2"].is-active {
  color: var(--l1-demo);
  background: rgba(255, 179, 0, 0.16);
}
.app-topnav-item.is-active > .app-topnav-top[data-nav-id="backtest-v1"],
.app-topnav-item.is-active > .app-topnav-top[data-nav-id="backtest-v2"],
.app-topnav-top[data-nav-id="backtest-v1"].is-active,
.app-topnav-top[data-nav-id="backtest-v2"].is-active {
  color: var(--l1-backtest);
  background: rgba(0, 191, 255, 0.16);
}

.app-topnav-top:focus-visible {
  outline: 2px solid var(--shell-focus);
  outline-offset: 2px;
}

/* L1 hover → L2 dropdown (desktop top nav only). */
.app-topnav-menu {
  position: absolute;
  top: calc(100% - 0.1rem);
  left: 0;
  z-index: calc(var(--shell-z-topbar) + 1);
  min-width: max-content;
  width: max-content;
  max-width: min(18rem, 70vw);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.35rem 0.35rem;
  border-radius: 0.45rem;
  border: 1px solid var(--gekko-border-strong);
  background: rgba(22, 22, 28, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}
.app-topnav-menu[hidden] {
  display: none !important;
}
.app-topnav-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.45rem;
  height: 0.45rem;
}
.app-topnav-child {
  display: block;
  min-height: 34px;
  padding: 0.4rem 0.7rem;
  border-radius: 0.35rem;
  color: var(--shell-nav-text);
  font: inherit;
  font-size: var(--type-min);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--shell-motion-fast) ease, color var(--shell-motion-fast) ease;
}
.app-topnav-child:hover,
.app-topnav-child:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--foreground);
}
.app-topnav-item[data-nav-id="overview"] .app-topnav-child:hover,
.app-topnav-item[data-nav-id="overview"] .app-topnav-child:focus-visible,
.app-topnav-item[data-nav-id="overview"] .app-topnav-child.is-active {
  color: var(--l1-overview);
  background: rgba(192, 132, 252, 0.12);
}
.app-topnav-item[data-nav-id="live"] .app-topnav-child:hover,
.app-topnav-item[data-nav-id="live"] .app-topnav-child:focus-visible,
.app-topnav-item[data-nav-id="live"] .app-topnav-child.is-active {
  color: var(--l1-live);
  background: rgba(0, 255, 65, 0.1);
}
.app-topnav-item[data-nav-id="demo-v1"] .app-topnav-child:hover,
.app-topnav-item[data-nav-id="demo-v1"] .app-topnav-child:focus-visible,
.app-topnav-item[data-nav-id="demo-v1"] .app-topnav-child.is-active,
.app-topnav-item[data-nav-id="demo-v2"] .app-topnav-child:hover,
.app-topnav-item[data-nav-id="demo-v2"] .app-topnav-child:focus-visible,
.app-topnav-item[data-nav-id="demo-v2"] .app-topnav-child.is-active {
  color: var(--l1-demo);
  background: rgba(255, 179, 0, 0.12);
}
.app-topnav-item[data-nav-id="backtest-v1"] .app-topnav-child:hover,
.app-topnav-item[data-nav-id="backtest-v1"] .app-topnav-child:focus-visible,
.app-topnav-item[data-nav-id="backtest-v1"] .app-topnav-child.is-active,
.app-topnav-item[data-nav-id="backtest-v2"] .app-topnav-child:hover,
.app-topnav-item[data-nav-id="backtest-v2"] .app-topnav-child:focus-visible,
.app-topnav-item[data-nav-id="backtest-v2"] .app-topnav-child.is-active {
  color: var(--l1-backtest);
  background: rgba(0, 191, 255, 0.12);
}
.app-topnav-item.is-open > .app-topnav-top {
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 1199px) {
  .app-topbar {
    grid-template-columns: var(--shell-rail-collapsed) auto minmax(0, 1fr) auto;
  }
  .app-topnav-region {
    display: none;
  }
}

@media (max-width: 767px) {
  .app-topbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }
}


/* Demo summary + settings */
.summary-top-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.55rem;
}
.summary-top-list li {
  line-height: 1.45;
}
.settings-product-switch {
  display: inline-flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.settings-product-switch .btn {
  min-width: 3rem;
  padding: 0.35rem 0.7rem;
}
.settings-product-switch .btn.active {
  border-color: rgba(0, 255, 65, 0.4);
  color: var(--gekko-green);
  background: rgba(0, 255, 65, 0.08);
}
.settings-arms-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.settings-arms-modal .settings-arms-modal-card {
  width: min(36rem, 100%);
  max-height: min(85vh, 44rem);
  overflow: auto;
}
.settings-arms-picker.is-readonly .settings-arms-list-readonly {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}
.btn-arms-open {
  min-width: 0;
}
.arms-cell-summary {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
  min-width: 0;
}
.arms-count {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--foreground);
}
.enabled-arms-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}
.enabled-arms-summary li {
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.results-board-part[data-part="series"] {
  margin-top: 0.25rem;
}
.settings-arms-picker {
  margin: 0.5rem 0 0.25rem;
}
.settings-arms-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
}
.settings-arms-toolbar .section-copy {
  margin: 0;
}
.settings-arms-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.settings-arms-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 0.45rem 0.75rem;
}
.settings-arm {
  margin: 0;
}
.settings-arm label {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.55rem;
  row-gap: 0.1rem;
  align-items: start;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.settings-arm label:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.28);
}
.settings-arm.is-concentrate label {
  border-color: rgba(0, 255, 65, 0.28);
  background: rgba(0, 255, 65, 0.06);
}
.settings-concentrate-list .settings-arm {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  align-items: stretch;
}
.settings-concentrate-move {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  align-self: center;
}
.settings-concentrate-move .btn-compact {
  min-width: 1.75rem;
  padding: 0.15rem 0.35rem;
  text-align: center;
}
.concentrate-rank-summary {
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}
.concentrate-rank-summary li {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.concentrate-rank-badge {
  flex: 0 0 auto;
  font-size: var(--type-min);
  font-weight: 700;
  color: var(--gekko-green, #00ff41);
  border: 1px solid rgba(0, 255, 65, 0.35);
  border-radius: 0.25rem;
  padding: 0.02rem 0.3rem;
}
.btn-concentrate-open {
  margin-top: 0;
}
.settings-arm input[type="checkbox"] {
  grid-row: 1 / span 2;
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--gekko-green, #00ff41);
}
.settings-arm-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}
.settings-arm-badge {
  grid-column: 2;
  justify-self: start;
  font-size: var(--type-min);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gekko-green, #00ff41);
  border: 1px solid rgba(0, 255, 65, 0.35);
  border-radius: 0.25rem;
  padding: 0.05rem 0.35rem;
  margin-top: 0.1rem;
}
.settings-arm-key {
  grid-column: 2;
  font-size: var(--type-min);
  color: var(--muted);
  word-break: break-all;
  line-height: 1.25;
}
.settings-arm:has(input:not(:checked)) label {
  opacity: 0.62;
}
.settings-save-bar {
  position: sticky;
  bottom: 0.75rem;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0.85rem 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(0, 255, 65, 0.28);
  border-radius: 0.65rem;
  background:
    linear-gradient(180deg, rgba(30, 40, 32, 0.96), rgba(22, 24, 28, 0.96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  animation: settings-save-bar-in 0.22s ease-out;
}
/* Keep the action bar visible while scrolling long settings pages.
   Scroll lives on .app-content-scroll (body is overflow:hidden). */
body.settings-is-dirty .app-content-scroll {
  padding-bottom: 5.5rem;
}
body.settings-is-dirty .settings-save-bar {
  position: fixed;
  left: max(1rem, var(--content-pad-x, 1.5rem));
  right: max(1rem, var(--content-pad-x, 1.5rem));
  bottom: 0.85rem;
  margin: 0;
}
/* Results inline bar must win over the Live Settings bottom dock. */
body.settings-is-dirty .settings-save-bar.results-inline-save-bar {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  width: max-content;
  max-width: 100%;
}
@keyframes settings-save-bar-in {
  from { opacity: 0; transform: translateY(0.4rem); }
  to { opacity: 1; transform: translateY(0); }
}
.settings-save-bar-copy {
  margin: 0;
  font-size: 0.9rem;
  color: var(--foreground);
}
.settings-save-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.settings-save-bar .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
body.settings-is-dirty .settings-board-panel {
  border-color: rgba(0, 255, 65, 0.22);
}
#settingsOpsStatus.ok {
  color: var(--success);
}
#settingsOpsStatus.error {
  color: var(--danger);
}
@media (max-width: 720px) {
  .settings-save-bar {
    bottom: 0.4rem;
    flex-direction: column;
    align-items: stretch;
  }
  .settings-save-bar-actions {
    width: 100%;
  }
  .settings-save-bar-actions .btn {
    flex: 1;
  }
}
.section-subtitle {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
}

/* —— Current + previous run board (Results / Settings) —— */
.run-board-effect .run-board-col-sub,
.run-board-settings .run-board-col-sub {
  max-width: 100%;
}
.results-page-layout .panel + .panel {
  margin-top: 0.15rem;
}
/* Top CTA/nav row — no panel chrome; desk book + handoff + Desk. */
.results-action-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0 0 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.results-action-strip-control {
  flex: 1 1 auto;
  min-width: 0;
}
.results-action-strip .run-control,
.results-action-strip .run-control-compact {
  gap: 0;
}
.results-action-strip .run-control-grid,
.results-action-strip .run-control-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 1rem;
  width: 100%;
}
.results-action-strip .run-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.results-action-strip .run-control-group-label,
.run-control-group-label {
  font-size: var(--type-min);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: capitalize;
  color: color-mix(in srgb, var(--gekko-green, #00ff41) 55%, #9ca3af);
  line-height: 1.2;
}
.results-action-strip .run-control-group-nav {
  margin-left: auto;
}
.results-action-strip .run-control-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.35rem;
}
/* Page CTAs match shell topbar height (not grid CTAs). */
.results-action-strip .run-control-actions .btn,
.results-action-strip .results-inline-save-bar .btn {
  box-sizing: border-box;
  min-height: var(--shell-topbar-height);
  height: var(--shell-topbar-height);
  padding: 0 0.85rem;
  font-size: var(--type-min);
  line-height: 1.2;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.results-action-strip .run-control-select {
  box-sizing: border-box;
  min-height: var(--shell-topbar-height);
  height: var(--shell-topbar-height);
  padding: 0 0.65rem;
  font-size: var(--type-min);
}
.results-action-strip .results-inline-save-bar,
body.settings-is-dirty .results-action-strip .results-inline-save-bar {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0;
  padding: 0.2rem 0.35rem;
  gap: 0.3rem 0.45rem;
  width: max-content;
  max-width: 100%;
  box-shadow: none;
  animation: none;
  border-radius: 0.35rem;
}
.results-action-strip .results-inline-save-bar .settings-save-bar-copy {
  font-size: var(--type-min);
}
@media (max-width: 720px) {
  .results-action-strip .run-control-group-nav {
    margin-left: 0;
    width: 100%;
  }
  .results-action-strip .results-inline-save-bar {
    width: 100%;
  }
}
.results-board-panel .run-board-col-sub {
  max-width: 100%;
}
.run-board-wrap {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.run-board-table th.is-current,
.run-board-table td.is-current {
  background: rgba(0, 255, 65, 0.06);
}
.run-board-col-head {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.run-board-col-title-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}
.run-board-col-title {
  display: block;
  font-size: var(--type-min);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--foreground);
  overflow-wrap: anywhere;
  min-width: 0;
}
.run-board-col-pnl {
  margin-left: auto;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  text-align: right;
  flex: 0 0 auto;
}
.run-board-col-sub {
  font-size: var(--type-min);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  max-width: 100%;
  color: var(--foreground);
  overflow-wrap: anywhere;
}
.run-board-actions-row td,
.run-board-actions-row th {
  vertical-align: top;
  background: rgba(22, 22, 28, 0.98);
}

/* Sticky Run + Actions — pin inside .run-board-wrap (same pattern as desk trades). */
.results-board-panel .run-board-wrap .run-board-table thead .run-board-head-row > th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: rgba(30, 30, 36, 0.98);
  backdrop-filter: blur(6px);
}
.results-board-panel .run-board-wrap .run-board-table thead .run-board-actions-row > th,
.results-board-panel .run-board-wrap .run-board-table thead .run-board-actions-row > td {
  position: sticky;
  top: var(--run-board-sticky-actions-top, 3.4rem);
  z-index: 5;
  background: rgba(22, 22, 28, 0.98);
  backdrop-filter: blur(6px);
}
.results-board-panel .run-board-wrap .run-board-table thead .run-board-head-row > th:first-child,
.results-board-panel .run-board-wrap .run-board-table thead .run-board-actions-row > th:first-child {
  z-index: 7;
}
.run-board-action-btns {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.run-board-action-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  min-width: 0;
}
.run-board-action-pair:has(> :only-child) {
  grid-template-columns: 1fr;
}
.btn-compact {
  padding: 0.35rem 0.45rem;
  font-size: var(--type-min);
  white-space: normal;
  line-height: 1.25;
  text-align: left;
  max-width: 100%;
  overflow-wrap: anywhere;
}
/* Grid CTAs: shared height; full cell or half-cell like Actions. */
.run-board-table .run-board-cell-cta,
.run-board-table .btn-arms-open,
.run-board-table .btn-concentrate-open,
.run-board-action-btns > .btn-compact,
.run-board-action-pair .btn-compact {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.35rem;
  height: 2.35rem;
  padding: 0 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--type-min);
  line-height: 1.2;
}
.has-arms-open,
.has-concentrate-open {
  vertical-align: top;
}
.run-board-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  border-radius: 0.35rem;
  padding: 0.4rem 0.45rem;
  font: inherit;
}
.run-board-input:focus {
  outline: none;
  border-color: rgba(0, 255, 65, 0.45);
}
/* Section labels — same 1px grid as every other row; identity via type + tint only. */
.run-board-section > th,
.run-board-section > td {
  padding: 0.85rem var(--results-col-pad) 0.45rem;
  background: rgba(0, 255, 65, 0.03);
}
.run-board-section > th {
  color: color-mix(in srgb, var(--gekko-green, #00ff41) 72%, #9ca3af);
  letter-spacing: 0.08em;
  text-transform: none;
  font-size: var(--type-min);
  font-weight: 800;
}
.analyze-tips-modal .analyze-tips-modal-card {
  width: min(40rem, 100%);
  max-height: min(88vh, 48rem);
  overflow: auto;
  padding-top: 1.5rem;
}
.analyze-tips-body {
  margin-top: 0.25rem;
}
.analyze-tips-actions {
  margin-top: 0.85rem;
}
.analyze-tips-list .suggest-item {
  margin: 0;
}
.rec-tip-select {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem 0.65rem;
  align-items: start;
  width: 100%;
  cursor: pointer;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.18);
}
.rec-tip-select:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.28);
}
.rec-tip-select input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--gekko-green, #00ff41);
}
.rec-tip-select-copy {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}
.rec-tip-detail {
  display: block;
  font-size: var(--type-min);
  line-height: 1.4;
  color: var(--foreground);
  white-space: normal;
}
.suggest-item:has(.rec-tip-select input:not(:checked)) .rec-tip-select {
  opacity: 0.62;
}
.run-board-recs {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem 1rem;
  border: 1px solid var(--gekko-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--gekko-surface) 92%, transparent);
}
.run-board-recs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.35rem;
}
.run-board-recs-step {
  margin: 0 0 0.2rem;
  font-size: var(--type-min);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  color: color-mix(in srgb, var(--gekko-green, #00ff41) 62%, #9ca3af);
}
.run-board-recs-copy .run-report-subhead {
  margin: 0 0 0.2rem;
}
.run-board-recs-lead,
.run-board-recs-count {
  margin: 0;
  font-size: var(--type-min);
}
.run-board-recs-actions {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gekko-border);
}
.run-board-recs-actions .muted-line {
  margin: 0 0 0.55rem;
  font-size: var(--type-min);
}
.run-board-recs-cta {
  margin: 0;
  flex-wrap: wrap;
}
.run-board-recs-cta .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.run-board-recs-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.rec-kind {
  font-size: var(--type-min);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.run-board-table td.has-cell-copy {
  position: relative;
  /* Keep L/R padding identical — do not shrink the right inset for Copy. */
  padding-left: var(--results-col-pad);
  padding-right: var(--results-col-pad);
}
.run-board-cell-value {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.btn-cell-copy {
  display: inline-block;
  margin-top: 0.3rem;
  border: 1px solid var(--gekko-green-border);
  background: var(--cta-bg);
  color: var(--foreground);
  font: inherit;
  font-size: var(--type-min);
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  cursor: pointer;
  opacity: 1;
  max-width: 100%;
}
.btn-cell-copy:hover,
.btn-cell-copy:focus-visible {
  opacity: 1;
  background: var(--cta-bg-hover);
  border-color: var(--gekko-green-border);
  outline: none;
}
.rec-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.rec-apply-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--type-min);
  opacity: 0.9;
}
.rec-patch {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: var(--type-min);
  opacity: 0.75;
  word-break: break-all;
}
.run-control {
  display: grid;
  gap: 0.85rem;
}
.run-control-head h2 {
  margin: 0 0 0.25rem;
}
.run-control-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-end;
}
.run-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.ghost-pill {
  opacity: 1;
  border-color: var(--gekko-border-strong);
  color: var(--foreground);
}
#resultsBoardStatus.ok,
#resultsSettingsStatus.ok,
#settingsOpsStatus.ok {
  color: var(--success);
}
#resultsBoardStatus.error,
#resultsSettingsStatus.error {
  color: var(--danger);
}
