:root {
  color-scheme: dark;
  --bg: #05080d;
  --shell: #070d14;
  --panel: #0a141e;
  --panel-2: #0d1a25;
  --panel-3: #101d27;
  --line: #20364a;
  --line-soft: rgba(75, 113, 145, 0.34);
  --text: #eef6ff;
  --muted: #91a7ba;
  --soft: #bfd2e2;
  --blue: #2f99ff;
  --cyan: #58e6f1;
  --green: #22d67f;
  --amber: #f7b733;
  --red: #ff4d5c;
  --violet: #9c7dff;
  --shadow: rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(47, 153, 255, 0.16), transparent 25%),
    radial-gradient(circle at 82% 10%, rgba(34, 214, 127, 0.1), transparent 28%),
    linear-gradient(180deg, #05080d 0%, #02050a 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
pre:focus-visible {
  outline: 2px solid rgba(88, 230, 241, 0.8);
  outline-offset: 2px;
}

.studio-shell {
  width: 100%;
  min-height: 100vh;
  padding-bottom: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 78px;
  display: grid;
  grid-template-columns: auto auto minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 10, 17, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 228px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 6px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 0 26px rgba(47, 153, 255, 0.16);
}

.brand-lockup strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.brand-lockup span {
  display: block;
  margin-top: 5px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.product-pill,
.workspace-meta,
.tab,
.icon-button,
.primary-action,
.ghost-action,
.segmented-control,
.segmented-control button {
  border-radius: 6px;
}

.product-pill {
  min-width: 150px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--blue);
  background: linear-gradient(180deg, #0e1b29, #08121d);
  font-size: 15px;
  font-weight: 950;
}

.top-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.tab {
  height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.tab:hover,
.tab.is-active {
  border-color: var(--line);
  color: var(--text);
  background: #0b1622;
}

.workspace-meta {
  min-width: 184px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #0b1722;
}

.workspace-meta span {
  min-width: 0;
  overflow: hidden;
  color: var(--soft);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-meta strong {
  color: var(--green);
  font-size: 13px;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link,
.session-badge {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.nav-link {
  padding: 0 12px;
  color: var(--soft);
  background: #0b1722;
  text-decoration: none;
}

.nav-link:hover {
  border-color: rgba(88, 230, 241, 0.62);
  color: var(--text);
}

.nav-link.is-active {
  border-color: rgba(34, 214, 127, 0.58);
  color: #04150e;
  background: var(--green);
}

.session-badge {
  max-width: 150px;
  overflow: hidden;
  padding: 0 10px;
  color: var(--green);
  background: rgba(34, 214, 127, 0.08);
  text-overflow: ellipsis;
}

.icon-button,
.primary-action,
.ghost-action {
  height: 38px;
  border: 1px solid var(--line);
  color: var(--text);
  background: linear-gradient(180deg, #0e1b29, #08121d);
  font-weight: 900;
}

.icon-button {
  width: 40px;
  display: grid;
  place-items: center;
  padding: 0;
}

.icon-button span {
  color: var(--cyan);
  font-size: 14px;
  font-weight: 950;
}

.icon-button.compact {
  width: 34px;
  height: 34px;
}

.primary-action {
  min-width: 104px;
  padding: 0 16px;
  border-color: rgba(34, 214, 127, 0.58);
  color: #04150e;
  background: linear-gradient(180deg, #5ff1a8, #22c76f);
}

.ghost-action {
  min-width: 66px;
  padding: 0 12px;
  color: var(--soft);
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px 0;
}

.market-strip article,
.metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(12, 25, 38, 0.98), rgba(6, 14, 22, 0.98));
}

.market-strip article {
  min-height: 86px;
  padding: 12px;
}

.market-strip span,
.metric-card span,
.panel-kicker,
.field-grid span {
  display: block;
  color: #a9c9e6;
  font-size: 11px;
  font-weight: 900;
}

.market-strip strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-strip small,
.metric-card small {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--soft);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 340px;
  gap: 10px;
  padding: 10px 12px 0;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(10, 22, 34, 0.98), rgba(5, 12, 20, 0.98));
  box-shadow: 0 18px 38px var(--shadow);
}

.panel-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid rgba(55, 91, 121, 0.42);
}

.panel-head h2 {
  margin: 4px 0 0;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-panel,
.right-stack,
.center-stack {
  min-width: 0;
}

.library-panel {
  align-self: start;
  overflow: hidden;
}

.module-group {
  padding: 12px;
  border-top: 1px solid rgba(55, 91, 121, 0.28);
}

.module-group:first-of-type {
  border-top: 0;
}

.module-group h3 {
  margin: 0 0 8px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 950;
}

.module-row {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(42, 69, 94, 0.86);
  border-radius: 6px;
  color: var(--text);
  text-align: left;
  background: #081421;
}

.module-row:hover {
  border-color: rgba(88, 230, 241, 0.62);
}

.module-row.is-selected {
  border-color: rgba(34, 214, 127, 0.68);
  background: linear-gradient(180deg, rgba(12, 44, 36, 0.95), rgba(7, 22, 24, 0.95));
}

.module-row span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.center-stack,
.right-stack {
  display: grid;
  gap: 10px;
  align-content: start;
}

.command-panel {
  padding: 10px;
}

.prompt-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.prompt-bar label {
  color: var(--violet);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.prompt-bar input,
.field-grid select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(55, 91, 121, 0.72);
  border-radius: 6px;
  color: var(--text);
  background: #07111d;
}

.prompt-bar input {
  height: 42px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 650;
}

.canvas-panel {
  overflow: hidden;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  background: #06111c;
}

.segmented-control button {
  height: 30px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.segmented-control button.is-active {
  color: #03140d;
  background: var(--green);
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(360px, 1.18fr);
  gap: 10px;
  padding: 12px;
}

.strategy-tree {
  min-height: 338px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.tree-node {
  position: relative;
  min-height: 58px;
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(48, 81, 109, 0.92);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  background: #071320;
}

.tree-node[data-family="volatility"] {
  border-left-color: var(--amber);
}

.tree-node[data-family="momentum"] {
  border-left-color: var(--violet);
}

.tree-node[data-family="risk"],
.tree-node[data-family="exit"] {
  border-left-color: var(--green);
}

.tree-node strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-node span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logic-chip {
  justify-self: start;
  min-width: 50px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid rgba(88, 230, 241, 0.38);
  border-radius: 6px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 950;
}

.chart-preview {
  min-height: 338px;
  overflow: hidden;
  border: 1px solid rgba(48, 81, 109, 0.92);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(8, 18, 30, 0.95), rgba(3, 8, 14, 0.95)),
    #07111d;
}

.chart-topline {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(48, 81, 109, 0.64);
}

.chart-topline span,
.chart-topline strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-topline strong {
  color: var(--green);
}

.chart-preview svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-grid path {
  stroke: rgba(73, 113, 146, 0.22);
  stroke-width: 1;
}

.candle .wick {
  stroke-width: 2;
}

.candle .body {
  rx: 1.5;
}

.candle.is-up .wick,
.candle.is-up .body {
  stroke: #21d1a0;
  fill: #21d1a0;
}

.candle.is-down .wick,
.candle.is-down .body {
  stroke: #ff4d5c;
  fill: #ff4d5c;
}

.preview-area {
  fill: url("#equityFill");
}

.preview-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trade-links line {
  stroke: rgba(191, 210, 226, 0.46);
  stroke-dasharray: 4 4;
  stroke-width: 1.2;
}

.signal-markers text {
  font-size: 10px;
  font-weight: 950;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.signal-marker path,
.signal-marker circle {
  stroke-width: 1.5;
}

.signal-marker.is-long path {
  fill: var(--green);
  stroke: rgba(4, 21, 14, 0.86);
}

.signal-marker.is-short path {
  fill: var(--red);
  stroke: rgba(29, 7, 10, 0.86);
}

.signal-marker.is-exit circle {
  fill: #07111d;
  stroke: var(--cyan);
}

.signal-marker.is-long text,
.signal-marker.is-short text {
  fill: #03140d;
}

.signal-marker.is-exit text {
  fill: var(--cyan);
}

.chart-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid rgba(48, 81, 109, 0.64);
  background: rgba(48, 81, 109, 0.64);
}

.chart-status-grid article {
  min-width: 0;
  padding: 10px 12px;
  background: rgba(5, 12, 20, 0.96);
}

.chart-status-grid span,
.artifact-summary span {
  display: block;
  color: #a9c9e6;
  font-size: 11px;
  font-weight: 900;
}

.chart-status-grid strong,
.artifact-summary strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--soft);
  font-size: 12px;
  font-weight: 880;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-trade-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid rgba(48, 81, 109, 0.64);
  background: rgba(48, 81, 109, 0.64);
}

.chart-trade-strip article {
  min-width: 0;
  padding: 9px 12px;
  background: rgba(5, 12, 20, 0.96);
}

.chart-trade-strip span,
.chart-trade-strip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-trade-strip span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
}

.chart-trade-strip strong {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 92px;
  padding: 14px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.trades-panel,
.report-panel {
  overflow: hidden;
}

.trade-table-wrap {
  overflow-x: auto;
  padding: 0 12px 12px;
}

.trade-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.trade-table th,
.trade-table td {
  padding: 10px 9px;
  border-bottom: 1px solid rgba(55, 91, 121, 0.38);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
}

.trade-table th {
  color: #a9c9e6;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.trade-table td:first-child,
.trade-table .trade-side {
  color: var(--text);
  font-weight: 950;
}

.trade-pnl-positive {
  color: var(--green) !important;
  font-weight: 950;
}

.trade-pnl-negative {
  color: var(--red) !important;
  font-weight: 950;
}

.pipeline-panel {
  overflow: hidden;
}

.pipeline-state {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(34, 214, 127, 0.42);
  border-radius: 999px;
  color: var(--green);
  background: rgba(34, 214, 127, 0.08);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.pipeline-grid article {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(48, 81, 109, 0.92);
  border-radius: 6px;
  background: #071320;
}

.pipeline-grid span {
  width: 34px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(88, 230, 241, 0.34);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 950;
}

.pipeline-grid strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.22;
}

.pipeline-grid small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
}

.status-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(34, 214, 127, 0.64);
}

.run-plan {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 12px 4px 34px;
}

.run-plan li {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.run-plan li.is-done {
  color: var(--green);
}

.run-plan li.is-running {
  color: var(--amber);
}

.warning-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.warning-list div {
  padding: 10px;
  border: 1px solid rgba(247, 183, 51, 0.28);
  border-radius: 6px;
  background: rgba(247, 183, 51, 0.06);
}

.warning-list strong,
.warning-list span {
  display: block;
}

.warning-list strong {
  color: var(--amber);
  font-size: 12px;
  font-weight: 950;
}

.warning-list span {
  margin-top: 4px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
}

.inspector-panel {
  overflow: hidden;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.field-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-grid select {
  height: 38px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.dsl-panel {
  overflow: hidden;
}

.dsl-panel pre {
  height: 296px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  color: #d5e9fb;
  background: #050b12;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.delivery-panel {
  overflow: hidden;
}

.delivery-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid rgba(55, 91, 121, 0.42);
}

.delivery-tabs button {
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(48, 81, 109, 0.92);
  border-radius: 6px;
  color: var(--muted);
  background: #071320;
  font-size: 12px;
  font-weight: 900;
}

.delivery-tabs button.is-active {
  border-color: rgba(34, 214, 127, 0.72);
  color: #04150e;
  background: var(--green);
}

.delivery-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.delivery-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 950;
}

.delivery-card p {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 680;
}

.delivery-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.delivery-card li {
  min-height: 30px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(48, 81, 109, 0.74);
  border-radius: 6px;
  color: var(--soft);
  background: rgba(7, 19, 32, 0.78);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 720;
}

.delivery-card li::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(34, 214, 127, 0.5);
}

.artifact-id {
  overflow: hidden;
  padding: 9px 10px;
  border: 1px solid rgba(88, 230, 241, 0.32);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(88, 230, 241, 0.06);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(10, 22, 34, 0.98), rgba(5, 12, 20, 0.98));
  box-shadow: 0 24px 60px var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand strong {
  display: block;
  font-size: 25px;
  line-height: 1.05;
  font-weight: 950;
}

.auth-brand span {
  display: block;
  margin-top: 6px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 850;
}

.auth-form,
.route-form,
.admin-create-form {
  display: grid;
  gap: 12px;
}

.auth-form label,
.route-form label,
.admin-create-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.auth-form span,
.route-form span,
.admin-create-form span {
  color: #a9c9e6;
  font-size: 11px;
  font-weight: 900;
}

.auth-form input,
.route-form input,
.admin-create-form input,
.admin-create-form select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(55, 91, 121, 0.72);
  border-radius: 6px;
  color: var(--text);
  background: #07111d;
  font-size: 14px;
  font-weight: 700;
}

.wide-action {
  width: 100%;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  font-weight: 780;
}

.form-message.is-error {
  color: var(--red);
}

.form-message.is-ok {
  color: var(--green);
}

.route-page {
  padding: 10px 12px 0;
}

.section-page {
  padding: 10px 12px 0;
}

.section-page .report-panel {
  max-width: 1420px;
  margin: 0 auto;
}

.report-metrics {
  padding: 12px;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.58fr);
  gap: 10px;
  padding: 0 12px 12px;
}

.report-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(48, 81, 109, 0.92);
  border-radius: 6px;
  background: #071320;
}

.report-card h3 {
  margin: 6px 0 8px;
  font-size: 17px;
  font-weight: 950;
}

.report-card p {
  margin: 0 0 12px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.48;
  font-weight: 700;
}

.report-card > strong {
  display: block;
  overflow: hidden;
  padding: 9px 10px;
  border: 1px solid rgba(88, 230, 241, 0.28);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(88, 230, 241, 0.06);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mini-head strong {
  font-size: 14px;
  font-weight: 950;
}

.mini-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#reportEquityChart {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid rgba(48, 81, 109, 0.74);
  border-radius: 6px;
  background: #050b12;
}

#reportEquityChart .grid {
  stroke: rgba(73, 113, 146, 0.22);
  stroke-width: 1;
}

#reportEquityChart .area {
  fill: rgba(34, 214, 127, 0.12);
}

#reportEquityChart .line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assumption-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assumption-list li {
  padding: 9px 10px;
  border: 1px solid rgba(48, 81, 109, 0.74);
  border-radius: 6px;
  color: var(--soft);
  background: rgba(5, 12, 20, 0.68);
  font-size: 12px;
  line-height: 1.42;
  font-weight: 720;
}

.panel-subsection {
  padding-top: 2px;
}

.panel-subsection .mini-head {
  margin: 0;
  padding: 0 12px 10px;
}

.robust-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}

.ai-review-card {
  grid-column: 1 / -1;
}

.robust-list {
  display: grid;
  gap: 10px;
}

.robust-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
}

.robust-row span,
.regime-grid span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 850;
}

.robust-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(48, 81, 109, 0.74);
}

.robust-bar i {
  display: block;
  width: var(--score);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.robust-row strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  text-align: right;
}

.regime-grid {
  display: grid;
  gap: 10px;
}

.regime-item {
  display: grid;
  gap: 6px;
}

.regime-item strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}

.regime-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(48, 81, 109, 0.74);
}

.regime-track i {
  display: block;
  width: var(--share);
  height: 100%;
  background: var(--blue);
}

.ai-review-card p {
  color: var(--soft);
  font-size: 14px;
  line-height: 1.56;
}

.deploy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.artifact-summary {
  margin: 0 12px 12px;
  padding: 12px;
  border: 1px solid rgba(88, 230, 241, 0.28);
  border-radius: 6px;
  background: rgba(88, 230, 241, 0.06);
}

.route-card {
  max-width: 1040px;
  margin: 0 auto;
  overflow: hidden;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.account-grid article {
  min-width: 0;
  min-height: 96px;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(48, 81, 109, 0.92);
  border-radius: 6px;
  background: #071320;
}

.account-grid span {
  color: #a9c9e6;
  font-size: 11px;
  font-weight: 900;
}

.account-grid strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 950;
  text-overflow: ellipsis;
}

.route-form {
  max-width: 520px;
  padding: 0 12px 14px;
}

.admin-create-form {
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.8fr) 150px auto;
  align-items: end;
  padding: 12px;
  border-bottom: 1px solid rgba(55, 91, 121, 0.42);
}

.admin-create-form .primary-action {
  min-width: 90px;
}

.admin-table-wrap {
  overflow-x: auto;
  padding: 0 12px 12px;
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(55, 91, 121, 0.38);
  color: var(--soft);
  font-size: 13px;
  text-align: left;
}

.admin-table th {
  color: #a9c9e6;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-table td:first-child {
  color: var(--text);
  font-weight: 900;
}

.status-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(34, 214, 127, 0.38);
  border-radius: 999px;
  color: var(--green);
  background: rgba(34, 214, 127, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.is-disabled {
  border-color: rgba(255, 77, 92, 0.38);
  color: var(--red);
  background: rgba(255, 77, 92, 0.08);
}

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

  .workspace-meta {
    display: none;
  }

  .workspace-grid {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .right-stack {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .delivery-panel {
    grid-column: span 3;
  }

  .report-grid,
  .deploy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .session-badge {
    display: none;
  }

  .dsl-panel pre {
    height: 240px;
  }
}

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

  .workspace-meta,
  .session-badge {
    display: none;
  }
}

@media (max-width: 980px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr auto;
  }

  .product-pill,
  .top-tabs {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .top-tabs {
    justify-content: start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .market-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pipeline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-grid,
  .builder-layout,
  .right-stack,
  .robust-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-grid,
  .admin-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-panel {
    order: 2;
  }

  .chart-status-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-trade-strip {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .topbar {
    gap: 10px;
    padding: 10px;
  }

  .brand-lockup {
    min-width: 0;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-width: 5px;
  }

  .brand-lockup strong {
    font-size: 21px;
  }

  .top-actions {
    justify-self: end;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .market-strip,
  .results-grid,
  .field-grid,
  .pipeline-grid,
  .account-grid,
  .admin-create-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .delivery-tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
  }

  .tab {
    width: 100%;
  }

  .workspace-grid,
  .market-strip {
    padding-right: 8px;
    padding-left: 8px;
  }

  .prompt-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .prompt-bar label {
    white-space: normal;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented-control {
    width: 100%;
  }

  .chart-topline {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px 12px;
  }

  .dsl-panel pre {
    height: 260px;
  }

  .nav-link,
  .ghost-action,
  .primary-action {
    min-width: 76px;
  }

  .trade-table {
    min-width: 680px;
  }

  .mini-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
