:root {
  --bg: #f4f2ee;
  --panel: #ffffff;
  --ink: #14171f;
  --muted: #6f7480;
  --line: #dcd8cf;
  --red: #b34b4b;
  --green: #21845b;
  --blue: #2367a5;
  --gold: #b8862b;
  --charcoal: #22252d;
  --shadow: 0 18px 50px rgba(25, 28, 36, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}

#overviewSection,
#riskBudgetSection,
#speculativeStrategies,
#valueStrategies,
#hedgeFundStrategies,
#analyticsSection,
#robotsSection,
#holdingSection,
#accountsSection,
#cashflowSection,
#marketsSection,
#worldMarketsSection,
#worldEconomySection,
#cryptoFocusCard,
#xysSection,
#tradingDeskSection,
#liveMandateSection,
#committeeSection,
#technicalControlSection,
  #autonomyControlPlaneSection,
  #liveFlowSection,
  #notificationsSection,
  #technicalLogsSection,
  #productSection,
  #personalFinanceSection,
  #creditsSection,
  #creditMatchSection,
  #repairsSection,
  #gamesSection,
#journalSection {
  scroll-margin-top: 22px;
}

body.locked {
  overflow: hidden;
}

button {
  color: inherit;
  font: inherit;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
}

h1,
h2,
h3,
strong,
span,
p {
  overflow-wrap: anywhere;
}

main,
section,
article,
.content,
.panel,
.metric-card,
.table-panel,
.chart-card,
.form-field,
.embedded-platform-panel,
.platform-account-panel,
.market-section-title,
.panel-header,
.topbar,
.live-mandate-grid,
.live-mandate-lists,
.dashboard-grid,
.world-market-layout,
.world-chart-card,
.world-country-browser,
.world-instrument-detail,
.trading-desk-layout,
.committee-layout,
.technical-two-column {
  min-width: 0;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(120deg, rgba(31, 95, 82, 0.16), rgba(35, 103, 165, 0.12)),
    var(--bg);
}

.login-gate.hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.live-flow-panel {
  --flow-bg: #10151d;
  --flow-panel: #151c27;
  --flow-ink: #eef4f7;
  --flow-muted: #9eacb8;
}

.live-flow-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}

.live-flow-status-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.live-flow-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 16px;
  align-items: stretch;
}

.live-flow-map-card {
  min-height: 650px;
  border: 1px solid #232d3b;
  border-radius: 8px;
  background: var(--flow-bg);
  overflow: auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.live-flow-map {
  display: block;
  width: 100%;
  min-width: 1040px;
  height: 650px;
}

.flow-bg {
  fill: #10151d;
}

.flow-edge {
  fill: none;
  opacity: 0.76;
  stroke-linecap: round;
  stroke-dasharray: 8 10;
}

.flow-edge.animated {
  animation: live-flow-dash 1.8s linear infinite;
}

.flow-edge.ok { stroke: #2bc481; }
.flow-edge.warning { stroke: #f0a53a; }
.flow-edge.pending { stroke: #e1d25f; }
.flow-edge.critical { stroke: #ee5f5f; }
.flow-edge.stale { stroke: #b8a24f; opacity: 0.52; }
.flow-edge.recovering { stroke: #4da3ff; }
.flow-edge.recovered { stroke: #54c99a; }
.flow-edge.disabled,
.flow-edge.legacy { stroke: #748090; opacity: 0.42; }
.flow-edge.idle { stroke: #536171; opacity: 0.36; }

.flow-arrow {
  fill: #9eacb8;
}

.flow-edge-label {
  fill: #9eacb8;
  font-size: 11px;
  text-anchor: middle;
  pointer-events: none;
}

.flow-node {
  cursor: pointer;
  outline: none;
}

.flow-node rect {
  fill: #17202c;
  stroke: #536171;
  stroke-width: 1.5;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.2));
}

.flow-node.ok rect { stroke: #2bc481; }
.flow-node.warning rect { stroke: #f0a53a; }
.flow-node.pending rect { stroke: #e1d25f; }
.flow-node.critical rect { stroke: #ee5f5f; }
.flow-node.stale rect { stroke: #b8a24f; opacity: 0.86; }
.flow-node.recovering rect { stroke: #4da3ff; }
.flow-node.recovered rect { stroke: #54c99a; }
.flow-node.disabled rect,
.flow-node.legacy rect { stroke: #748090; opacity: 0.72; }
.flow-node.idle rect { stroke: #536171; opacity: 0.84; }
.flow-node.selected rect { stroke-width: 3; }
.flow-node.active-now rect { filter: drop-shadow(0 0 13px rgba(43,196,129,0.35)); }

.flow-node-label {
  fill: var(--flow-ink);
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
}

.flow-node-meta {
  fill: var(--flow-muted);
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
}

.live-flow-details {
  display: grid;
  gap: 14px;
  align-content: start;
}

.live-flow-detail-card,
.live-flow-timeline article {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.live-flow-detail-card span,
.live-flow-timeline span,
.live-flow-timeline small,
.live-flow-related small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.live-flow-related {
  display: grid;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.live-flow-timeline {
  display: grid;
  gap: 8px;
  max-height: 470px;
  overflow: auto;
}

.live-flow-timeline article.ok { border-left: 4px solid var(--green); }
.live-flow-timeline article.warning { border-left: 4px solid var(--gold); }
.live-flow-timeline article.pending { border-left: 4px solid #d4c54f; }
.live-flow-timeline article.critical { border-left: 4px solid var(--red); }
.live-flow-timeline article.stale { border-left: 4px solid #b8a24f; }
.live-flow-timeline article.recovering { border-left: 4px solid #4da3ff; }
.live-flow-timeline article.recovered { border-left: 4px solid #54c99a; }
.live-flow-timeline article.disabled,
.live-flow-timeline article.legacy,
.live-flow-timeline article.idle { border-left: 4px solid #748090; }

.live-flow-speed-table td,
.live-flow-speed-table th {
  white-space: nowrap;
}

@keyframes live-flow-dash {
  to {
    stroke-dashoffset: -36;
  }
}

@media (max-width: 1100px) {
  .live-flow-toolbar,
  .live-flow-layout {
    grid-template-columns: 1fr;
  }
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(460px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--ink);
}

.login-brand span {
  color: var(--muted);
}

.login-submit {
  width: 100%;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-weight: 700;
}

.login-card small {
  color: var(--muted);
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-width: 0;
  max-width: 100vw;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  padding: 20px;
  color: #f8f6f0;
  background: var(--charcoal);
  overflow-y: auto;
}

.brand,
.sidebar-footer,
.panel-header,
.topbar,
.topbar-actions,
.risk-board,
.account-row,
.watch-row,
.robot-row {
  display: flex;
  align-items: center;
}

.panel-header,
.topbar {
  align-items: flex-start;
  flex-wrap: wrap;
}

.panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel-collapse-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7faf8;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.panel-collapse-button:hover,
.panel-collapse-button:focus-visible {
  border-color: rgba(31, 95, 82, 0.35);
  color: var(--ink);
  background: #eef6f2;
}

.panel.is-collapsed {
  gap: 0;
}

.panel.is-collapsed > :not(.panel-header) {
  display: none !important;
}

.panel.is-collapsed .panel-header {
  margin-bottom: 0;
}

.text-link {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.text-link small {
  color: var(--muted);
}

.panel-header > *,
.topbar > * {
  min-width: 0;
}

.panel > *,
.metric-card > * {
  min-width: 0;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: #2f6256;
  font-weight: 800;
}

.brand strong,
.brand span,
.sidebar-footer strong,
.sidebar-footer span {
  display: block;
}

.brand span,
.sidebar-footer span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list::-webkit-scrollbar {
  display: none;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-item:focus-visible,
.strategy-tab:focus-visible,
.icon-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible {
  outline: 3px solid rgba(142, 214, 220, 0.45);
  outline-offset: 2px;
}

.sidebar-footer {
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4dd28a;
  box-shadow: 0 0 0 5px rgba(77, 210, 138, 0.12);
}

.workspace {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(460px, 42%);
  justify-content: stretch;
  align-items: center;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
}

.workspace-tabs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.workspace-tab {
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.workspace-tab.active {
  border-color: rgba(31, 95, 82, 0.22);
  background: #1f5f52;
  color: #fff;
}

.workspace-subtitle {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.workspace-section-hidden,
.nav-item-hidden {
  display: none !important;
}

.personal-finance-panel {
  display: grid;
  gap: 18px;
}

.personal-finance-summary,
.personal-finance-grid,
.personal-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.personal-finance-grid.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-card,
.finance-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.finance-card {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.finance-card span,
.finance-block small,
.finance-block td span {
  color: var(--muted);
}

.finance-card strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.08;
}

.finance-card small {
  color: var(--muted);
  line-height: 1.35;
}

.finance-block {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.finance-block.full-width {
  grid-column: 1 / -1;
}

.finance-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.finance-block-head strong {
  display: block;
  font-size: 17px;
}

.credit-budget-control {
  display: grid;
  gap: 5px;
  min-width: min(260px, 100%);
}

.credit-budget-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.credit-budget-control input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.finance-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.finance-table-wrap table {
  min-width: 720px;
}

.finance-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  min-height: 150px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 95, 82, 0.05), rgba(255, 255, 255, 0.75));
  overflow: hidden;
}

.finance-bar {
  flex: 1 1 0;
  min-width: 4px;
  border-radius: 4px 4px 0 0;
  background: #1f5f52;
  opacity: 0.86;
}

.finance-bar.negative {
  background: #b84a4a;
}

.finance-bar.debt {
  background: #466b8f;
}

.credit-match-section {
  gap: 14px;
}

.credit-match-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
}

.credit-match-chart-card,
.credit-match-calculator,
.credit-match-thesis {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.credit-match-chart {
  width: 100%;
  min-height: 260px;
  margin-top: 10px;
  overflow: hidden;
}

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

.credit-match-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.credit-match-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.credit-match-thesis {
  display: grid;
  gap: 6px;
}

.credit-match-thesis p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.credit-match-balance-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  padding: 14px;
}

.credit-match-balance-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  margin-top: 10px;
}

.credit-match-balance-chart {
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 12px;
}

.credit-match-flow-bars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 145px;
}

.credit-match-flow-bar {
  display: grid;
  align-items: end;
  min-width: 0;
  height: 145px;
  gap: 6px;
}

.credit-match-flow-bar span {
  display: block;
  width: 100%;
  min-height: 8px;
  border-radius: 6px 6px 2px 2px;
  background: var(--bar-color, #1f6d5a);
}

.credit-match-flow-bar strong,
.credit-match-flow-bar small {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-match-flow-bar strong {
  font-size: 11px;
}

.credit-match-flow-bar small {
  color: var(--muted);
  font-size: 11px;
}

.credit-match-balance-meter {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8faf8;
}

.credit-match-balance-meter.negative {
  border-color: rgba(184, 74, 74, 0.34);
  background: rgba(184, 74, 74, 0.08);
}

.credit-match-balance-meter.positive {
  border-color: rgba(31, 109, 90, 0.28);
  background: rgba(31, 109, 90, 0.08);
}

.credit-match-balance-meter b,
.credit-match-balance-meter strong,
.credit-match-balance-meter small {
  display: block;
}

.credit-match-balance-meter strong {
  margin: 4px 0;
  font-size: 22px;
}

.positive-cell {
  color: #177245;
  font-weight: 800;
}

.negative-cell {
  color: #b63b3b;
  font-weight: 800;
}

.topbar-copy {
  width: 100%;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-size: clamp(25px, 2.4vw, 36px);
  line-height: 1.06;
}

h2 {
  font-size: 20px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.train-oracle {
  --sun-x: 50%;
  --sun-y: 18%;
  --moon-x: 72%;
  --moon-y: 22%;
  --night-opacity: 0;
  --night-overlay: 0;
  --night-soft: 0;
  --twilight-opacity: 0;
  --sun-opacity: 1;
  --moon-opacity: 0;
  --cloud-opacity: 0.72;
  --mountain-opacity: 0.82;
  --sea-opacity: 0;
  --forest-opacity: 0;
  --field-opacity: 0;
  --city-opacity: 0;
  --tree-brightness: 1;
  --city-brightness: 1;
  --sky-life-opacity: 0.82;
  --weather-opacity: 0;
  --leaf-color: #2a8b5d;
  --leaf-dark: #14533a;
  --field-a: #9bca63;
  --field-b: #e5c85c;
  --field-c: #79b66e;
  --water-a: #5da8c8;
  --water-b: #78c3d4;
  --car-one-color: #d94f47;
  --car-two-color: #2367a5;
  --car-three-color: #e0b94d;
  --car-four-color: #1f8b63;
  --car-one-scale: 1;
  --car-two-scale: 0.9;
  --car-three-scale: 0.82;
  --car-four-scale: 0.96;
  --sky-top: #8fd0ff;
  --sky-mid: #d9f0ff;
  --sky-low: #f8f2d9;
  --mountain-image: url("assets/train-scenes/mountains.svg");
  --forest-image: url("assets/train-scenes/forest.svg");
  --field-image: url("assets/train-scenes/fields.svg");
  --sea-image: url("assets/train-scenes/sea.svg");
  --city-image: url("assets/train-scenes/city-europe.svg");
  --city-focus: center center;
  --train-scale: 0.94;
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 620px;
  min-width: 300px;
  height: 232px;
  justify-self: end;
  overflow: hidden;
  border: 1px solid rgba(35, 103, 165, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 204, 111, var(--twilight-opacity)), transparent 45%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 47%, var(--sky-low) 100%);
  box-shadow: 0 14px 34px rgba(25, 28, 36, 0.08);
}

.train-oracle::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8, 14, 36, var(--night-overlay)), rgba(13, 24, 52, var(--night-soft))),
    radial-gradient(circle at 25% 18%, rgba(255, 238, 181, var(--twilight-opacity)), transparent 32%);
  content: "";
  pointer-events: none;
}

.service-age-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 12;
  max-width: 154px;
  padding: 4px 8px;
  border: 1px solid rgba(20, 23, 31, 0.16);
  border-radius: 6px;
  color: #16222d;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 14px rgba(20, 23, 31, 0.1);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
  pointer-events: none;
}

.train-day-toast {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 13;
  display: grid;
  gap: 2px;
  max-width: min(260px, 62%);
  padding: 7px 9px;
  border: 1px solid rgba(31, 95, 82, 0.25);
  border-radius: 8px;
  color: #12231e;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(20, 23, 31, 0.16);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: none;
}

.train-day-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.train-day-toast strong {
  font-size: 11px;
}

.train-day-toast span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.train-oracle[data-phase="night"] .service-age-badge {
  color: #f6f0cf;
  background: rgba(21, 31, 54, 0.72);
  border-color: rgba(246, 240, 207, 0.22);
}

.train-oracle[data-season="spring"] {
  --leaf-color: #2f9868;
  --leaf-dark: #165f40;
  --field-a: #9bd36f;
  --field-b: #e7cd69;
  --field-c: #7bbd83;
  --water-a: #57a8c9;
  --water-b: #8ed6dc;
}

.train-oracle[data-season="summer"] {
  --leaf-color: #247d55;
  --leaf-dark: #0e4e34;
  --field-a: #86b84d;
  --field-b: #deb95b;
  --field-c: #579c62;
  --water-a: #3c9dc0;
  --water-b: #66c6d7;
  --sky-low: #fff0bd;
}

.train-oracle[data-season="autumn"] {
  --leaf-color: #9a6b28;
  --leaf-dark: #6a4720;
  --field-a: #c59645;
  --field-b: #dbb85a;
  --field-c: #b36c3b;
  --water-a: #4b8dab;
  --water-b: #74b7c4;
  --sky-low: #ffe1bc;
}

.train-oracle[data-season="winter"] {
  --leaf-color: #447b69;
  --leaf-dark: #24483f;
  --field-a: #edf3f5;
  --field-b: #dcebf0;
  --field-c: #c8dce5;
  --water-a: #7fb0c7;
  --water-b: #c8eef5;
  --sky-mid: #e2f1ff;
  --sky-low: #f4f7fa;
}

.train-oracle[data-city="moscow"] {
  --city-image: url("assets/train-scenes/city-moscow.svg");
  --city-focus: 50% 46%;
}

.train-oracle[data-city="amsterdam"] {
  --city-image: url("assets/train-scenes/city-europe.svg");
  --city-focus: 50% 46%;
}

.train-oracle[data-city="london"] {
  --city-image: url("assets/train-scenes/city-europe.svg");
  --city-focus: 50% 44%;
}

.train-oracle[data-city="paris"] {
  --city-image: url("assets/train-scenes/city-europe.svg");
  --city-focus: 50% 44%;
}

.train-oracle[data-city="zurich"] {
  --city-image: url("assets/train-scenes/city-europe.svg");
  --city-focus: 50% 45%;
}

.train-oracle[data-city="new-york"] {
  --city-image: url("assets/train-scenes/city-new-york.svg");
  --city-focus: 50% 43%;
}

.train-oracle[data-city="dubai"] {
  --city-image: url("assets/train-scenes/city-dubai.svg");
  --city-focus: 50% 45%;
}

.train-oracle[data-city="singapore"] {
  --city-image: url("assets/train-scenes/city-asia.svg");
  --city-focus: 50% 45%;
}

.train-oracle[data-city="hong-kong"] {
  --city-image: url("assets/train-scenes/city-asia.svg");
  --city-focus: 50% 45%;
}

.train-oracle[data-city="tokyo"] {
  --city-image: url("assets/train-scenes/city-tokyo.svg");
  --city-focus: 50% 45%;
}

.train-oracle[data-city="shanghai"] {
  --city-image: url("assets/train-scenes/city-asia.svg");
  --city-focus: 50% 45%;
}

.train-oracle[data-city="great-wall"] {
  --city-image: url("assets/train-scenes/wonder.svg");
  --city-focus: 50% 48%;
}

.train-oracle[data-city="petra"] {
  --city-image: url("assets/train-scenes/wonder.svg");
  --city-focus: 50% 50%;
}

.train-oracle[data-city="colosseum"] {
  --city-image: url("assets/train-scenes/wonder.svg");
  --city-focus: 50% 48%;
}

.train-oracle[data-city="chichen-itza"] {
  --city-image: url("assets/train-scenes/wonder.svg");
  --city-focus: 50% 50%;
}

.train-oracle[data-city="machu-picchu"] {
  --city-image: url("assets/train-scenes/wonder.svg");
  --city-focus: 50% 50%;
}

.train-oracle[data-city="taj-mahal"] {
  --city-image: url("assets/train-scenes/wonder.svg");
  --city-focus: 50% 48%;
}

.train-oracle[data-city="christ-redeemer"] {
  --city-image: url("assets/train-scenes/wonder.svg");
  --city-focus: 50% 48%;
}

.train-oracle[data-city="great-pyramid"] {
  --city-image: url("assets/train-scenes/wonder.svg");
  --city-focus: 50% 50%;
}

.train-sky,
.scenery,
.pine-track,
.train-weather-layer,
.train-live-layer,
.level-crossing,
.rail-track,
.train-set {
  position: absolute;
  left: 0;
  width: 100%;
}

.train-sky {
  inset: 0;
  z-index: 2;
}

.train-weather-layer {
  inset: 0 auto auto 0;
  z-index: 6;
  height: 100%;
  opacity: var(--weather-opacity);
  pointer-events: none;
}

.train-oracle[data-weather="rain"] .train-weather-layer {
  background:
    repeating-linear-gradient(105deg, rgba(78, 112, 137, 0.48) 0 2px, transparent 2px 13px);
  animation: rainSweep 1.55s linear infinite;
}

.train-oracle[data-weather="snow"] .train-weather-layer {
  background:
    radial-gradient(circle at 8% 18%, rgba(255, 255, 255, 0.9) 0 1.5px, transparent 2px),
    radial-gradient(circle at 22% 44%, rgba(255, 255, 255, 0.82) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 28%, rgba(255, 255, 255, 0.9) 0 1.5px, transparent 2px),
    radial-gradient(circle at 62% 52%, rgba(255, 255, 255, 0.82) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 24%, rgba(255, 255, 255, 0.9) 0 1.5px, transparent 2px);
  background-size: 120px 76px;
  animation: snowFloat 8.5s linear infinite;
}

.train-oracle[data-weather="fog"] .train-weather-layer {
  background:
    linear-gradient(180deg, transparent 0 26%, rgba(255, 255, 255, 0.42) 34% 62%, transparent 72%),
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(255, 255, 255, 0.16) 19px 31px, transparent 32px 58px);
}

.train-oracle[data-weather="storm"] .train-weather-layer {
  background:
    repeating-linear-gradient(105deg, rgba(45, 69, 96, 0.58) 0 2px, transparent 2px 12px),
    radial-gradient(circle at 22% 15%, rgba(255, 246, 170, 0.55), transparent 18%);
  animation: rainSweep 1.2s linear infinite;
}

.train-stars {
  position: absolute;
  inset: 0;
  opacity: var(--night-opacity);
  background:
    radial-gradient(circle at 12% 20%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 24% 34%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 41% 16%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 58% 28%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 78% 18%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 91% 35%, #fff 0 1px, transparent 2px);
  transition: opacity 0.8s ease;
}

.train-sun,
.train-moon {
  position: absolute;
  z-index: 3;
  left: var(--sun-x);
  top: var(--sun-y);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.8s ease, top 0.8s ease, opacity 0.8s ease;
}

.train-sun {
  opacity: var(--sun-opacity);
  background: #ffd66e;
  box-shadow:
    0 0 0 7px rgba(255, 214, 110, 0.18),
    0 0 28px rgba(255, 194, 71, 0.65);
}

.train-moon {
  left: var(--moon-x);
  top: var(--moon-y);
  opacity: var(--moon-opacity);
  background: #f6f0cf;
  box-shadow:
    inset -8px 0 0 #cfd7e8,
    0 0 24px rgba(231, 238, 255, 0.55);
}

.train-cloud {
  position: absolute;
  z-index: 3;
  width: 84px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    24px -12px 0 rgba(255, 255, 255, 0.7),
    48px -4px 0 rgba(255, 255, 255, 0.64),
    62px 4px 0 rgba(255, 255, 255, 0.5);
  opacity: var(--cloud-opacity);
  animation: cloudDrift 58s linear infinite;
  filter: blur(0.2px);
  will-change: transform;
}

.cloud-one {
  top: 24px;
  left: -28%;
}

.cloud-two {
  top: 58px;
  left: 44%;
  transform: scale(0.72);
  animation-duration: 76s;
}

.scenery {
  z-index: 3;
  pointer-events: none;
  will-change: background-position, opacity, transform;
  transition: opacity 4.5s ease, filter 4.5s ease;
}

.scenery-mountains {
  bottom: 28px;
  height: 184px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(96, 135, 158, 0.04) 44%, rgba(18, 38, 50, 0.24) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 22%, rgba(255, 255, 255, 0.08) 48%, transparent 78%),
    var(--mountain-image);
  background-position: 0 0, 0 0, center center;
  background-repeat: no-repeat, no-repeat, repeat-x;
  background-size: 100% 100%, 100% 100%, 150% 100%;
  opacity: var(--mountain-opacity);
  animation: sceneryPhotoPan 128s linear infinite;
  filter: saturate(1.08) contrast(1.04) brightness(0.98) drop-shadow(0 8px 5px rgba(39, 61, 78, 0.2));
}

.scenery-sea {
  bottom: 28px;
  height: 146px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(72, 168, 198, 0.04) 36%, rgba(5, 37, 59, 0.2) 100%),
    radial-gradient(ellipse at 32% 84%, rgba(255, 255, 255, 0.22), transparent 28%),
    var(--sea-image);
  background-position: 0 0, 0 0, 0 center;
  background-repeat: no-repeat, no-repeat, repeat-x;
  background-size: 100% 100%, 100% 100%, 145% 100%;
  opacity: var(--sea-opacity);
  animation: sceneryPhotoPan 96s linear infinite;
  filter: saturate(1.12) contrast(1.03);
}

.scenery-forest {
  bottom: 28px;
  height: 138px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 44%, rgba(13, 45, 31, 0.24) 100%),
    var(--forest-image);
  background-position: 0 0, 0 center;
  background-repeat: no-repeat, repeat-x;
  background-size: 100% 100%, 146% 100%;
  opacity: var(--forest-opacity);
  animation: sceneryPhotoPan 86s linear infinite;
  filter: saturate(1.08) contrast(1.02);
}

.scenery-fields {
  bottom: 28px;
  height: 132px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 42%, rgba(72, 76, 32, 0.2) 100%),
    var(--field-image);
  background-position: 0 0, 0 center;
  background-repeat: no-repeat, repeat-x;
  background-size: 100% 100%, 148% 100%;
  opacity: var(--field-opacity);
  animation: sceneryPhotoPan 102s linear infinite;
  filter: saturate(1.05) contrast(1.02);
}

.scenery-city {
  bottom: 28px;
  height: 184px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 42%, rgba(10, 18, 32, 0.34) 100%),
    var(--city-image),
    var(--city-skyline, linear-gradient(180deg, #5f7383 0 94px, transparent 95px) 10px 0 / 64px 154px repeat-x),
    repeating-linear-gradient(90deg, rgba(255, 231, 140, 0.82) 0 5px, transparent 6px 15px) 0 18px / 178px 104px repeat-x,
    radial-gradient(circle at 14% 42%, rgba(255, 238, 153, 0.58) 0 1px, transparent 2px) 0 0 / 30px 20px repeat;
  background-position: 0 0, var(--city-focus), 10px 18px, 46px 4px, 0 24px;
  background-repeat: no-repeat, repeat-x, repeat-x, repeat-x, repeat;
  background-size: 100% 100%, 148% 100%, auto, auto, auto;
  opacity: var(--city-opacity);
  animation: cityPhotoCruise 118s linear infinite;
  filter: brightness(var(--city-brightness)) saturate(1.06) contrast(1.02);
}

.scenery-city::before,
.scenery-city::after {
  position: absolute;
  bottom: 0;
  content: "";
  opacity: var(--city-opacity);
  transition: opacity 6s ease;
}

.scenery-city::before {
  left: 50%;
  bottom: -2px;
  width: 288px;
  height: 132px;
  transform: translateX(-50%) scale(1.56);
  transform-origin: bottom center;
  opacity: calc(var(--city-opacity) * 0.46);
}

.scenery-city::after {
  right: 12%;
  bottom: -2px;
  width: 218px;
  height: 118px;
  transform: scale(1.42);
  transform-origin: bottom center;
  opacity: calc(var(--city-opacity) * 0.34);
  background:
    repeating-linear-gradient(90deg, #435a6a 0 18px, #6e8392 19px 31px, #344a5d 32px 48px),
    repeating-linear-gradient(180deg, rgba(255, 231, 140, 0.78) 0 4px, transparent 5px 13px);
  clip-path: polygon(0 100%, 0 52%, 10% 52%, 10% 28%, 24% 28%, 24% 100%, 34% 100%, 34% 15%, 48% 15%, 48% 100%, 58% 100%, 58% 8%, 65% 8%, 65% 100%, 76% 100%, 76% 24%, 90% 24%, 90% 56%, 100% 56%, 100% 100%);
}

.train-oracle[data-phase="night"] .scenery-city {
  filter:
    brightness(1.12)
    saturate(1.08)
    drop-shadow(0 0 10px rgba(255, 221, 122, 0.28));
}

.train-oracle[data-city="moscow"] {
  --city-skyline:
    linear-gradient(180deg, #9b6b52 0 24px, transparent 25px) 8px 26px / 34px 58px repeat-x,
    linear-gradient(180deg, #6d7d8b 0 35px, transparent 36px) 52px 15px / 42px 58px repeat-x;
}

.train-oracle[data-city="moscow"] .scenery-city::before {
  background:
    radial-gradient(circle at 26% 18%, #3aa36a 0 8px, #d54f3e 9px 11px, transparent 12px),
    radial-gradient(circle at 50% 9%, #f0cc58 0 9px, #9b3f36 10px 13px, transparent 14px),
    radial-gradient(circle at 74% 20%, #4f9bd6 0 8px, #fff4bf 9px 11px, transparent 12px),
    linear-gradient(180deg, transparent 0 21px, #d7a148 22px 56px);
  clip-path: polygon(8% 100%, 8% 48%, 21% 48%, 21% 32%, 35% 32%, 35% 46%, 44% 46%, 44% 27%, 56% 27%, 56% 46%, 65% 46%, 65% 34%, 79% 34%, 79% 49%, 92% 49%, 92% 100%);
}

.train-oracle[data-city="amsterdam"] {
  --city-skyline:
    linear-gradient(180deg, #8c5f42 0 32px, transparent 33px) 6px 20px / 32px 58px repeat-x,
    linear-gradient(180deg, #5b6c7c 0 20px, transparent 21px) 42px 32px / 46px 58px repeat-x;
}

.train-oracle[data-city="amsterdam"] .scenery-city::before {
  background:
    linear-gradient(90deg, transparent 0 14%, #5e6f7a 15% 20%, transparent 21% 79%, #5e6f7a 80% 85%, transparent 86%),
    radial-gradient(ellipse at 50% 84%, transparent 0 18px, #4d8faa 19px 23px, transparent 24px),
    linear-gradient(180deg, transparent 0 44%, #a36a43 45% 100%);
  clip-path: polygon(0 100%, 0 36%, 12% 36%, 12% 22%, 30% 22%, 30% 36%, 44% 36%, 50% 14%, 56% 36%, 72% 36%, 72% 24%, 88% 24%, 88% 38%, 100% 38%, 100% 100%);
}

.train-oracle[data-city="london"] {
  --city-skyline:
    linear-gradient(180deg, #667789 0 38px, transparent 39px) 6px 14px / 36px 58px repeat-x,
    linear-gradient(180deg, #8897a6 0 26px, transparent 27px) 44px 26px / 44px 58px repeat-x;
}

.train-oracle[data-city="london"] .scenery-city::before {
  background:
    radial-gradient(circle at 25% 22%, #d8e3ed 0 9px, transparent 10px),
    linear-gradient(180deg, #596b78 0 54px);
  clip-path: polygon(8% 100%, 8% 45%, 21% 45%, 21% 13%, 31% 13%, 31% 45%, 40% 45%, 47% 30%, 54% 45%, 66% 45%, 66% 20%, 76% 20%, 76% 100%);
}

.train-oracle[data-city="paris"] {
  --city-skyline:
    linear-gradient(180deg, #8b7165 0 24px, transparent 25px) 8px 28px / 42px 58px repeat-x,
    linear-gradient(180deg, #6e7b88 0 18px, transparent 19px) 52px 34px / 54px 58px repeat-x;
}

.train-oracle[data-city="paris"] .scenery-city::before {
  background:
    linear-gradient(70deg, transparent 0 44%, #3f4d58 45% 48%, transparent 49%),
    linear-gradient(110deg, transparent 0 44%, #3f4d58 45% 48%, transparent 49%),
    linear-gradient(90deg, transparent 0 44%, #3f4d58 45% 55%, transparent 56%);
  clip-path: polygon(45% 100%, 50% 0, 55% 100%, 4% 100%, 4% 92%, 96% 92%, 96% 100%);
}

.train-oracle[data-city="zurich"] {
  --city-skyline:
    linear-gradient(180deg, #7f6d5a 0 24px, transparent 25px) 10px 28px / 40px 58px repeat-x,
    linear-gradient(180deg, #748595 0 30px, transparent 31px) 54px 22px / 44px 58px repeat-x;
}

.train-oracle[data-city="zurich"] .scenery-city::before {
  background:
    linear-gradient(180deg, transparent 0 10px, #f3f6f7 11px 18px, #7d95a8 19px 58px),
    linear-gradient(135deg, transparent 0 43%, #e9f5fb 44% 52%, #7f96aa 53% 60%, transparent 61%);
  clip-path: polygon(0 100%, 0 48%, 16% 48%, 28% 22%, 40% 48%, 54% 48%, 64% 12%, 75% 48%, 100% 48%, 100% 100%);
}

.train-oracle[data-city="new-york"] {
  --city-skyline:
    linear-gradient(180deg, #384d61 0 46px, transparent 47px) 4px 6px / 30px 58px repeat-x,
    linear-gradient(180deg, #64788b 0 32px, transparent 33px) 38px 20px / 38px 58px repeat-x,
    linear-gradient(180deg, #273a4d 0 54px, transparent 55px) 82px 0 / 24px 58px repeat-x;
}

.train-oracle[data-city="new-york"] .scenery-city::before {
  background:
    linear-gradient(180deg, #263849 0 58px),
    repeating-linear-gradient(180deg, transparent 0 7px, rgba(255, 231, 140, 0.8) 8px 10px, transparent 11px 15px);
  clip-path: polygon(0 100%, 0 48%, 9% 48%, 9% 22%, 22% 22%, 22% 100%, 29% 100%, 29% 10%, 44% 10%, 44% 100%, 51% 100%, 51% 0, 58% 0, 58% 100%, 66% 100%, 66% 18%, 80% 18%, 80% 100%, 88% 100%, 88% 40%, 100% 40%, 100% 100%);
}

.train-oracle[data-city="dubai"] {
  --city-skyline:
    linear-gradient(180deg, #5f788d 0 38px, transparent 39px) 12px 14px / 36px 58px repeat-x,
    linear-gradient(180deg, #8ba0af 0 24px, transparent 25px) 54px 28px / 48px 58px repeat-x;
}

.train-oracle[data-city="dubai"] .scenery-city::before {
  background: linear-gradient(180deg, #2c4b67 0 58px);
  clip-path: polygon(45% 100%, 48% 12%, 50% 0, 52% 12%, 55% 100%, 0 100%, 0 74%, 14% 74%, 14% 52%, 30% 52%, 30% 100%, 70% 100%, 70% 44%, 86% 44%, 86% 68%, 100% 68%, 100% 100%);
}

.train-oracle[data-city="singapore"] {
  --city-skyline:
    linear-gradient(180deg, #526c7e 0 36px, transparent 37px) 6px 16px / 30px 58px repeat-x,
    linear-gradient(180deg, #7891a4 0 46px, transparent 47px) 38px 6px / 44px 58px repeat-x;
}

.train-oracle[data-city="singapore"] .scenery-city::before {
  background:
    radial-gradient(ellipse at 50% 24%, transparent 0 20px, #eef2f5 21px 25px, transparent 26px),
    linear-gradient(180deg, transparent 0 42%, #5a7487 43% 100%);
  clip-path: polygon(0 100%, 0 76%, 22% 76%, 22% 28%, 30% 28%, 30% 76%, 45% 76%, 45% 20%, 54% 20%, 54% 76%, 70% 76%, 70% 31%, 79% 31%, 79% 76%, 100% 76%, 100% 100%);
}

.train-oracle[data-city="hong-kong"] {
  --city-skyline:
    linear-gradient(180deg, #40576a 0 44px, transparent 45px) 4px 8px / 28px 58px repeat-x,
    linear-gradient(180deg, #6f8798 0 36px, transparent 37px) 34px 16px / 40px 58px repeat-x;
}

.train-oracle[data-city="hong-kong"] .scenery-city::before {
  background:
    linear-gradient(135deg, transparent 0 43%, #91a9b7 44% 51%, transparent 52%),
    linear-gradient(45deg, transparent 0 43%, #738a9c 44% 51%, transparent 52%),
    linear-gradient(180deg, transparent 0 42%, #344b60 43% 100%);
  clip-path: polygon(0 100%, 0 58%, 12% 58%, 12% 28%, 25% 28%, 25% 100%, 35% 100%, 35% 16%, 48% 16%, 48% 100%, 58% 100%, 58% 26%, 72% 26%, 72% 100%, 83% 100%, 83% 48%, 100% 48%, 100% 100%);
}

.train-oracle[data-city="tokyo"] {
  --city-skyline:
    linear-gradient(180deg, #53697c 0 38px, transparent 39px) 8px 14px / 34px 58px repeat-x,
    linear-gradient(180deg, #8296a7 0 30px, transparent 31px) 46px 22px / 40px 58px repeat-x;
}

.train-oracle[data-city="tokyo"] .scenery-city::before {
  background:
    linear-gradient(180deg, #d45048 0 58px),
    linear-gradient(90deg, transparent 0 45%, #f6f0cf 46% 54%, transparent 55%);
  clip-path: polygon(47% 100%, 50% 0, 53% 100%, 9% 100%, 9% 90%, 91% 90%, 91% 100%, 20% 72%, 80% 72%, 68% 58%, 32% 58%, 41% 42%, 59% 42%);
}

.train-oracle[data-city="shanghai"] {
  --city-skyline:
    linear-gradient(180deg, #40586a 0 42px, transparent 43px) 8px 10px / 30px 58px repeat-x,
    linear-gradient(180deg, #718999 0 34px, transparent 35px) 42px 18px / 40px 58px repeat-x;
}

.train-oracle[data-city="shanghai"] .scenery-city::before {
  background:
    radial-gradient(circle at 54% 18%, #d45048 0 7px, #f4d56d 8px 10px, transparent 11px),
    radial-gradient(circle at 54% 45%, #d45048 0 11px, #f4d56d 12px 14px, transparent 15px),
    linear-gradient(180deg, #344c62 0 58px);
  clip-path: polygon(46% 100%, 50% 0, 54% 100%, 0 100%, 0 66%, 13% 66%, 13% 42%, 28% 42%, 28% 100%, 72% 100%, 72% 35%, 86% 35%, 86% 70%, 100% 70%, 100% 100%);
}

.train-oracle[data-city="great-wall"] {
  --city-skyline:
    linear-gradient(180deg, #6f7f69 0 28px, transparent 29px) 10px 46px / 96px 68px repeat-x,
    linear-gradient(180deg, #8f6d45 0 18px, transparent 19px) 0 72px / 62px 68px repeat-x;
}

.train-oracle[data-city="great-wall"] .scenery-city::before {
  background:
    repeating-linear-gradient(90deg, rgba(58, 45, 33, 0.28) 0 5px, transparent 6px 18px),
    linear-gradient(180deg, #a57c52 0 56px);
  clip-path: polygon(0 100%, 0 78%, 7% 78%, 7% 62%, 14% 62%, 14% 78%, 25% 78%, 25% 58%, 33% 58%, 33% 78%, 46% 78%, 46% 52%, 55% 52%, 55% 78%, 68% 78%, 68% 60%, 76% 60%, 76% 78%, 88% 78%, 88% 64%, 96% 64%, 96% 78%, 100% 78%, 100% 100%);
}

.train-oracle[data-city="petra"] {
  --city-skyline:
    linear-gradient(180deg, #b67955 0 84px, transparent 85px) 0 20px / 120px 154px repeat-x;
}

.train-oracle[data-city="petra"] .scenery-city::before {
  background:
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(74, 40, 29, 0.22) 20px 25px, transparent 26px 36px),
    radial-gradient(ellipse at 50% 58%, transparent 0 20px, rgba(80, 42, 32, 0.3) 21px 26px, transparent 27px),
    linear-gradient(180deg, #c98a62 0 100%);
  clip-path: polygon(0 100%, 0 55%, 9% 55%, 9% 42%, 20% 42%, 20% 28%, 32% 28%, 32% 42%, 43% 42%, 50% 14%, 57% 42%, 68% 42%, 68% 28%, 80% 28%, 80% 42%, 91% 42%, 91% 55%, 100% 55%, 100% 100%);
}

.train-oracle[data-city="colosseum"] .scenery-city::before {
  background:
    radial-gradient(ellipse at 18% 58%, transparent 0 8px, rgba(88, 68, 54, 0.48) 9px 12px, transparent 13px),
    radial-gradient(ellipse at 36% 58%, transparent 0 8px, rgba(88, 68, 54, 0.48) 9px 12px, transparent 13px),
    radial-gradient(ellipse at 54% 58%, transparent 0 8px, rgba(88, 68, 54, 0.48) 9px 12px, transparent 13px),
    radial-gradient(ellipse at 72% 58%, transparent 0 8px, rgba(88, 68, 54, 0.48) 9px 12px, transparent 13px),
    repeating-linear-gradient(90deg, rgba(94, 73, 57, 0.25) 0 2px, transparent 3px 19px),
    linear-gradient(180deg, #c7a17a 0 100%);
  clip-path: ellipse(48% 38% at 50% 70%);
}

.train-oracle[data-city="chichen-itza"] .scenery-city::before {
  background:
    repeating-linear-gradient(180deg, rgba(91, 94, 69, 0.24) 0 5px, transparent 6px 12px),
    linear-gradient(180deg, #b6aa76 0 100%);
  clip-path: polygon(50% 15%, 62% 32%, 62% 40%, 70% 40%, 70% 52%, 80% 52%, 80% 66%, 91% 66%, 91% 100%, 9% 100%, 9% 66%, 20% 66%, 20% 52%, 30% 52%, 30% 40%, 38% 40%, 38% 32%);
}

.train-oracle[data-city="machu-picchu"] {
  --city-skyline:
    linear-gradient(135deg, transparent 0 42%, #4b785b 43% 55%, transparent 56%) 0 4px / 120px 154px repeat-x;
}

.train-oracle[data-city="machu-picchu"] .scenery-city::before {
  background:
    repeating-linear-gradient(90deg, rgba(71, 68, 53, 0.18) 0 8px, transparent 9px 22px),
    linear-gradient(180deg, #8d916c 0 100%);
  clip-path: polygon(0 100%, 0 75%, 14% 75%, 14% 65%, 29% 65%, 29% 78%, 42% 78%, 42% 60%, 56% 60%, 56% 74%, 71% 74%, 71% 63%, 86% 63%, 86% 80%, 100% 80%, 100% 100%);
}

.train-oracle[data-city="taj-mahal"] .scenery-city::before {
  background:
    radial-gradient(circle at 50% 32%, #f2eee2 0 30px, transparent 31px),
    radial-gradient(circle at 22% 48%, #e8dfcf 0 16px, transparent 17px),
    radial-gradient(circle at 78% 48%, #e8dfcf 0 16px, transparent 17px),
    linear-gradient(180deg, transparent 0 38%, #f6f1e6 39% 100%);
  clip-path: polygon(5% 100%, 5% 52%, 14% 52%, 14% 30%, 19% 30%, 19% 52%, 30% 52%, 30% 42%, 39% 42%, 50% 12%, 61% 42%, 70% 42%, 70% 52%, 81% 52%, 81% 30%, 86% 30%, 86% 52%, 95% 52%, 95% 100%);
}

.train-oracle[data-city="christ-redeemer"] .scenery-city::before {
  background:
    linear-gradient(90deg, transparent 0 13%, #ece5d5 14% 86%, transparent 87%),
    linear-gradient(180deg, #ece5d5 0 100%);
  clip-path: polygon(47% 100%, 47% 33%, 33% 45%, 8% 42%, 8% 34%, 32% 34%, 47% 22%, 50% 0, 53% 22%, 68% 34%, 92% 34%, 92% 42%, 67% 45%, 53% 33%, 53% 100%);
}

.train-oracle[data-city="great-pyramid"] {
  --city-skyline:
    linear-gradient(180deg, #d7b76e 0 16px, transparent 17px) 0 94px / 88px 154px repeat-x;
}

.train-oracle[data-city="great-pyramid"] .scenery-city::before {
  background:
    linear-gradient(135deg, rgba(255, 238, 174, 0.48), transparent 42%),
    linear-gradient(180deg, #d6aa5f 0 100%);
  clip-path: polygon(50% 8%, 96% 100%, 4% 100%);
}

.train-city-name {
  position: absolute;
  right: 12px;
  bottom: 170px;
  z-index: 9;
  padding: 4px 8px;
  border: 1px solid rgba(20, 23, 31, 0.18);
  border-radius: 5px;
  color: #17202a;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 6px 12px rgba(20, 23, 31, 0.12);
  font-size: 10px;
  font-weight: 900;
  opacity: var(--city-opacity);
  transition: opacity 6s ease;
  pointer-events: none;
}

.train-scene-name {
  position: absolute;
  left: 12px;
  bottom: 148px;
  z-index: 9;
  min-width: 58px;
  padding: 4px 8px;
  border: 1px solid rgba(20, 23, 31, 0.18);
  border-radius: 5px;
  color: #17202a;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 6px 12px rgba(20, 23, 31, 0.12);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
}

.pine-track {
  bottom: 29px;
  z-index: 4;
  height: 44px;
  opacity: 0;
  animation: treeRush 14s linear infinite;
  transition: opacity 6s ease;
}

.train-oracle[data-landscape="mountains"] .pine-track,
.train-oracle[data-landscape="forest"] .pine-track {
  opacity: 1;
}

.train-oracle[data-landscape="fields"] .pine-track {
  opacity: 0.28;
}

.pine-track i {
  position: absolute;
  bottom: 0;
  width: 22px;
  height: 34px;
  background: linear-gradient(180deg, var(--leaf-color), var(--leaf-dark));
  clip-path: polygon(50% 0, 100% 82%, 62% 82%, 62% 100%, 38% 100%, 38% 82%, 0 82%);
  filter: brightness(var(--tree-brightness));
}

.pine-track i:nth-child(1) { left: 4%; transform: scale(0.8); }
.pine-track i:nth-child(2) { left: 18%; transform: scale(1.05); }
.pine-track i:nth-child(3) { left: 31%; transform: scale(0.72); }
.pine-track i:nth-child(4) { left: 48%; transform: scale(1.18); }
.pine-track i:nth-child(5) { left: 62%; transform: scale(0.9); }
.pine-track i:nth-child(6) { left: 74%; transform: scale(1.1); }
.pine-track i:nth-child(7) { left: 86%; transform: scale(0.76); }
.pine-track i:nth-child(8) { left: 96%; transform: scale(1); }

.train-live-layer {
  inset: 0 auto auto 0;
  z-index: 8;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.foreground-tree {
  position: absolute;
  bottom: var(--bottom, 7px);
  left: 105%;
  width: 24px;
  height: 40px;
  opacity: 0;
  transform: translateX(0) scale(var(--scale, 1));
  transform-origin: bottom center;
  animation: foregroundTreePass var(--duration, 9.6s) linear forwards;
  filter:
    brightness(var(--tree-brightness))
    drop-shadow(0 5px 4px rgba(20, 23, 31, 0.18));
}

.foreground-tree::before,
.foreground-tree::after {
  position: absolute;
  left: 50%;
  content: "";
  transform: translateX(-50%);
}

.foreground-tree::before {
  bottom: 0;
  width: 5px;
  height: 15px;
  border-radius: 2px;
  background: #6f5132;
}

.foreground-tree::after {
  bottom: 7px;
  width: 30px;
  height: 34px;
  background:
    linear-gradient(180deg, var(--leaf-color) 0%, var(--leaf-dark) 100%);
  clip-path: polygon(50% 0, 100% 52%, 76% 52%, 100% 76%, 68% 76%, 68% 100%, 32% 100%, 32% 76%, 0 76%, 24% 52%, 0 52%);
}

.foreground-tree.tree-oak::after {
  bottom: 12px;
  width: 34px;
  height: 28px;
  border-radius: 54% 46% 48% 52%;
  clip-path: none;
}

.foreground-tree.tree-birch::before {
  width: 6px;
  background:
    repeating-linear-gradient(180deg, transparent 0 6px, rgba(37, 42, 47, 0.8) 7px 9px, transparent 10px 15px),
    #f5f1df;
}

.foreground-tree.tree-birch::after {
  bottom: 18px;
  width: 26px;
  height: 25px;
  border-radius: 50%;
  clip-path: none;
  background: linear-gradient(180deg, #7fbf6a, var(--leaf-color));
}

.train-oracle[data-season="winter"] .foreground-tree::after,
.train-oracle[data-season="winter"] .pine-track i {
  box-shadow: inset 0 7px 0 rgba(255, 255, 255, 0.72);
}

.bird-flock {
  position: absolute;
  left: -18%;
  top: var(--top, 28px);
  width: 58px;
  height: 28px;
  opacity: 0;
  transform: scale(var(--scale, 1));
  animation: flockFly var(--duration, 16s) cubic-bezier(0.37, 0, 0.22, 1) forwards;
}

.bird-flock i {
  position: absolute;
  width: 12px;
  height: 7px;
  border-top: 2px solid rgba(28, 45, 61, 0.78);
  border-radius: 50%;
  animation: wingBeat 0.72s ease-in-out infinite;
}

.bird-flock i:nth-child(1) { left: 0; top: 12px; }
.bird-flock i:nth-child(2) { left: 18px; top: 2px; animation-delay: 0.18s; }
.bird-flock i:nth-child(3) { left: 36px; top: 14px; animation-delay: 0.32s; }

.sky-plane {
  position: absolute;
  left: -32%;
  top: var(--top, 24px);
  width: 76px;
  height: 28px;
  opacity: 0;
  transform: scale(var(--scale, 1));
  animation: planeFly var(--duration, 18s) linear forwards;
}

.city-sign {
  position: absolute;
  left: 105%;
  bottom: 76px;
  z-index: 9;
  min-width: 78px;
  padding: 4px 8px;
  border: 1px solid rgba(20, 23, 31, 0.22);
  border-radius: 5px;
  color: #1c2630;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 5px 12px rgba(20, 23, 31, 0.14);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  transform: translateX(0) scale(var(--scale, 1));
  animation: citySignPass var(--duration, 11s) linear forwards;
}

.sky-plane::before {
  position: absolute;
  left: 9px;
  top: 9px;
  width: 62px;
  height: 10px;
  border-radius: 7px 999px 999px 7px;
  background:
    radial-gradient(circle at 88% 49%, #ffffff 0 2px, transparent 3px),
    linear-gradient(90deg, #8fa3b4 0 13%, #d6e2ec 14% 31%, #f8fbff 32% 82%, #ffffff 83% 100%);
  clip-path: polygon(0 26%, 14% 14%, 75% 0, 100% 50%, 75% 100%, 14% 86%, 0 74%);
  content: "";
}

.sky-plane::after {
  position: absolute;
  left: -92px;
  top: 14px;
  width: 108px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.18));
  content: "";
}

.plane-wing {
  position: absolute;
  left: 29px;
  top: 3px;
  width: 30px;
  height: 23px;
  background: #d8e4ef;
  clip-path: polygon(72% 49%, 0 0, 24% 50%, 0 100%, 72% 58%);
}

.plane-wing::before {
  position: absolute;
  left: -21px;
  top: 4px;
  width: 15px;
  height: 13px;
  background: #8fa3b4;
  clip-path: polygon(100% 42%, 0 0, 32% 50%, 0 100%, 100% 62%);
  content: "";
}

.sky-ufo {
  position: absolute;
  left: -24%;
  top: var(--top, 34px);
  width: 48px;
  height: 18px;
  opacity: 0;
  transform: scale(var(--scale, 1));
  animation: ufoFly var(--duration, 18s) cubic-bezier(0.32, 0.02, 0.18, 1) forwards;
}

.sky-ufo::before {
  position: absolute;
  left: 7px;
  top: 0;
  width: 34px;
  height: 14px;
  border-radius: 50% 50% 42% 42%;
  background:
    radial-gradient(circle at 50% 22%, rgba(210, 255, 246, 0.95) 0 7px, transparent 8px),
    linear-gradient(180deg, #bde9f0, #5f8e98);
  content: "";
}

.sky-ufo::after {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 9px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 22% 50%, #fff3a0 0 2px, transparent 3px),
    radial-gradient(circle at 50% 52%, #9dffd4 0 2px, transparent 3px),
    radial-gradient(circle at 78% 50%, #fff3a0 0 2px, transparent 3px),
    linear-gradient(180deg, #d6dde5, #687987);
  box-shadow: 0 0 14px rgba(139, 255, 218, 0.4);
  content: "";
}

.track-spark {
  position: absolute;
  bottom: 18px;
  left: var(--left, 55%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffd66e;
  box-shadow: 0 0 12px rgba(255, 214, 110, 0.8);
  animation: sparkPop 0.9s ease-out forwards;
}

.level-crossing {
  right: 0;
  bottom: 10px;
  left: auto;
  z-index: 6;
  width: 31%;
  min-width: 152px;
  height: 112px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.train-oracle[data-train-state="stopped"] .level-crossing {
  opacity: 1;
}

.crossing-road {
  position: absolute;
  right: 20%;
  bottom: -12px;
  z-index: 1;
  width: 58px;
  height: 130px;
  border-radius: 20px 20px 4px 4px;
  background:
    linear-gradient(180deg, transparent 0 47%, rgba(255, 255, 255, 0.8) 48% 52%, transparent 53%),
    repeating-linear-gradient(180deg, transparent 0 12px, rgba(255, 255, 255, 0.7) 13px 21px, transparent 22px 34px),
    linear-gradient(90deg, #4d525b, #313743 52%, #555c66);
  box-shadow:
    inset 8px 0 0 rgba(255, 255, 255, 0.06),
    0 8px 16px rgba(20, 23, 31, 0.18);
  transform: skewX(-13deg);
}

.rail-signal {
  position: absolute;
  left: 1%;
  bottom: 24px;
  z-index: 5;
  width: 13px;
  height: 54px;
  border-radius: 5px 5px 2px 2px;
  background: #232a31;
  box-shadow: 0 4px 8px rgba(20, 23, 31, 0.25);
}

.rail-signal::after {
  position: absolute;
  left: 4px;
  bottom: -18px;
  width: 3px;
  height: 18px;
  background: #232a31;
  content: "";
}

.rail-signal i {
  position: absolute;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #2d343b;
}

.rail-signal i:first-child {
  top: 8px;
  background: #cf3f3f;
  box-shadow: 0 0 10px rgba(207, 63, 63, 0.95);
}

.rail-signal i:last-child {
  bottom: 8px;
  background: #284837;
}

.train-oracle[data-train-state="moving"] .rail-signal i:first-child {
  background: #4b3030;
  box-shadow: none;
}

.train-oracle[data-train-state="moving"] .rail-signal i:last-child {
  background: #53d678;
  box-shadow: 0 0 12px rgba(83, 214, 120, 0.9);
}

.train-oracle[data-train-state="stopped"] .rail-signal i:first-child {
  animation: signalRedStop 24s linear forwards;
}

.train-oracle[data-train-state="stopped"] .rail-signal i:last-child {
  animation: signalGreenRelease 24s linear forwards;
}

.crossing-post {
  position: absolute;
  bottom: 7px;
  z-index: 4;
  width: 5px;
  height: 58px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(180deg, #fff 0 7px, #c73535 8px 14px);
  box-shadow: 0 3px 8px rgba(20, 23, 31, 0.22);
}

.post-left {
  right: 64%;
}

.post-right {
  right: 17%;
}

.barrier-arm {
  position: absolute;
  bottom: 62px;
  z-index: 4;
  width: 74px;
  height: 7px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, #fff 0 12px, #c73535 13px 24px);
  box-shadow: 0 3px 8px rgba(20, 23, 31, 0.18);
  transform-origin: 4px 50%;
}

.barrier-left {
  right: 64%;
  transform: rotate(12deg);
}

.barrier-right {
  right: 17%;
  transform: rotate(168deg);
}

.train-oracle[data-train-state="stopped"] .barrier-left {
  animation: barrierLeftCycle 24s linear forwards;
}

.train-oracle[data-train-state="stopped"] .barrier-right {
  animation: barrierRightCycle 24s linear forwards;
}

.road-car {
  position: absolute;
  right: 27%;
  bottom: 124px;
  z-index: 3;
  width: 39px;
  height: 17px;
  border-radius: 8px 11px 5px 5px;
  background: var(--car-one-color);
  box-shadow:
    inset 11px -4px 0 rgba(255, 255, 255, 0.22),
    0 6px 10px rgba(20, 23, 31, 0.2);
  opacity: 0;
  transform: translateY(0) skewX(-8deg) scale(var(--car-one-scale));
}

.road-car::before,
.road-car::after {
  position: absolute;
  bottom: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #222831;
  content: "";
}

.road-car::before {
  left: 7px;
}

.road-car::after {
  right: 7px;
}

.road-car i {
  position: absolute;
  left: 11px;
  top: 3px;
  width: 16px;
  height: 6px;
  border-radius: 4px 6px 2px 2px;
  background: rgba(225, 242, 255, 0.9);
}

.car-two {
  right: 10%;
  background: var(--car-two-color);
  transform: translateY(0) skewX(-8deg) scale(var(--car-two-scale));
}

.car-three {
  right: 36%;
  background: var(--car-three-color);
  transform: translateY(0) skewX(-8deg) scale(var(--car-three-scale));
}

.car-four {
  right: 18%;
  background: var(--car-four-color);
  transform: translateY(0) skewX(-8deg) scale(var(--car-four-scale));
}

.train-oracle[data-train-state="stopped"] .car-one {
  animation: carCrossDown 24s linear forwards;
}

.train-oracle[data-train-state="stopped"] .car-two {
  animation: carCrossDownTwo 24s linear forwards;
}

.train-oracle[data-train-state="stopped"] .car-three {
  animation: carCrossDownThree 24s linear forwards;
}

.train-oracle[data-train-state="stopped"] .car-four {
  animation: carCrossDownFour 24s linear forwards;
}

.rail-track {
  bottom: 17px;
  z-index: 5;
  height: 21px;
  background:
    linear-gradient(#343a43 0 4px, transparent 5px 12px, #343a43 13px 17px, transparent 18px),
    repeating-linear-gradient(90deg, transparent 0 20px, rgba(125, 102, 81, 0.8) 21px 27px, transparent 28px 42px);
  filter: drop-shadow(0 2px 1px rgba(20, 23, 31, 0.16));
}

.train-set {
  right: 12px;
  bottom: 31px;
  left: auto;
  z-index: 7;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  width: 86%;
  padding: 0 4px 0 8px;
  transform-origin: right bottom;
  animation: trainPullRight 1.8s ease-in-out infinite;
}

.train-oracle[data-train-state="stopped"] .train-set {
  animation: trainStopped 2.4s ease-in-out infinite;
}

.train-oracle[data-train-state="stopped"] .train-wheel {
  animation-play-state: paused;
}

.train-engine,
.train-wagon {
  position: relative;
  flex: 0 0 auto;
  border: 1px solid rgba(20, 23, 31, 0.22);
  box-shadow: 0 6px 12px rgba(20, 23, 31, 0.16);
}

.train-engine {
  width: 96px;
  height: 54px;
  border-radius: 10px 20px 8px 8px;
  background:
    linear-gradient(90deg, #1b3651 0 34%, #264e6f 35%),
    #264e6f;
}

.engine-cab,
.engine-stack,
.engine-window {
  position: absolute;
  display: block;
}

.engine-cab {
  right: 7px;
  bottom: 27px;
  width: 30px;
  height: 29px;
  border-radius: 7px 11px 0 0;
  background: #1f5f52;
}

.engine-stack {
  left: 15px;
  bottom: 44px;
  width: 10px;
  height: 20px;
  border-radius: 3px 3px 0 0;
  background: #1d2430;
}

.engine-stack::before,
.engine-stack::after {
  position: absolute;
  left: 50%;
  bottom: 13px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 34%, rgba(255, 255, 255, 0.9) 0 32%, rgba(255, 255, 255, 0.46) 52%, transparent 72%);
  content: "";
  filter: blur(0.4px);
  opacity: 0;
  transform: translate(-50%, 0) scale(0.45);
  animation: steamRise 3.1s ease-out infinite;
}

.engine-stack::after {
  width: 21px;
  height: 21px;
  animation-delay: 1.45s;
}

.train-engine::before {
  position: absolute;
  left: 4px;
  bottom: 52px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 38%, rgba(255, 255, 255, 0.78) 0 38%, rgba(255, 255, 255, 0.32) 58%, transparent 74%);
  content: "";
  filter: blur(0.5px);
  opacity: 0;
  animation: steamRiseSmall 3.1s ease-out 0.72s infinite;
}

.engine-window {
  right: 14px;
  bottom: 36px;
  width: 13px;
  height: 12px;
  border-radius: 2px;
  background: #d8f0ff;
}

.engine-goal {
  position: absolute;
  left: 10px;
  right: 36px;
  bottom: 18px;
  z-index: 2;
  overflow: hidden;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.train-wagon {
  display: grid;
  flex: 1 1 0;
  align-content: center;
  gap: 1px;
  min-width: 0;
  height: 54px;
  padding: 7px 9px 13px;
  border-radius: 7px;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.train-wagon::after {
  position: absolute;
  top: 25px;
  right: -10px;
  width: 11px;
  height: 3px;
  border-radius: 999px;
  background: #30343d;
  content: "";
}

.wagon-quotes {
  background: linear-gradient(135deg, #2367a5, #183c68);
}

.wagon-news {
  background: linear-gradient(135deg, #9a5a27, #6b3f1f);
}

.wagon-balance {
  background: linear-gradient(135deg, #21845b, #14533a);
}

.train-oracle[data-holiday-theme="cipher"] .train-wagon {
  background:
    linear-gradient(135deg, rgba(28, 224, 168, 0.22), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 3px 12px),
    linear-gradient(135deg, #143b4b, #102932);
}

.train-oracle[data-holiday-theme="space"] .train-wagon {
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 62%, rgba(255, 255, 255, 0.65) 0 1px, transparent 2px),
    linear-gradient(135deg, #282d62, #111629);
}

.train-oracle[data-holiday-theme="new-year"] .train-wagon,
.train-oracle[data-holiday-theme="winter"] .train-wagon {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.88) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 58%, rgba(255, 255, 255, 0.76) 0 2px, transparent 3px),
    linear-gradient(135deg, #1c6f8c, #1f4e68);
}

.train-oracle[data-holiday-theme="victory"] .train-wagon {
  background:
    linear-gradient(135deg, rgba(245, 189, 73, 0.34), transparent 36%),
    repeating-linear-gradient(45deg, rgba(20, 23, 31, 0.28) 0 6px, rgba(231, 146, 46, 0.36) 7px 13px),
    linear-gradient(135deg, #7d2d2b, #422323);
}

.train-oracle[data-holiday-theme="spring"] .train-wagon,
.train-oracle[data-holiday-theme="knowledge"] .train-wagon,
.train-oracle[data-holiday-theme="unity"] .train-wagon,
.train-oracle[data-holiday-theme="russia"] .train-wagon,
.train-oracle[data-holiday-theme="defense"] .train-wagon {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 38%),
    linear-gradient(135deg, #2367a5, #1f5f52);
}

.train-wagon strong,
.train-wagon span {
  position: relative;
  z-index: 2;
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.train-wagon strong {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
}

.train-wagon span {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.train-wagon:hover,
.train-wagon:focus-visible {
  outline: none;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.train-wheel {
  position: absolute;
  bottom: -10px;
  width: 16px;
  height: 16px;
  border: 4px solid #1d2430;
  border-top-color: #dcd8cf;
  border-radius: 50%;
  background: #313845;
  animation: wheelSpin 0.7s linear infinite;
}

.wheel-a {
  left: 10px;
}

.wheel-b {
  right: 10px;
}

@keyframes trainPullRight {
  0%,
  100% {
    transform: translateX(0) translateY(0) scale(var(--train-scale));
  }
  50% {
    transform: translateX(2px) translateY(-1px) scale(var(--train-scale));
  }
}

@keyframes trainStopped {
  0%,
  100% {
    transform: translateX(0) translateY(0) scale(var(--train-scale));
  }
  50% {
    transform: translateX(0) translateY(-0.5px) scale(var(--train-scale));
  }
}

@keyframes barrierLeftCycle {
  0%,
  10% {
    transform: rotate(12deg);
  }
  24%,
  70% {
    transform: rotate(-72deg);
  }
  86%,
  100% {
    transform: rotate(12deg);
  }
}

@keyframes barrierRightCycle {
  0%,
  10% {
    transform: rotate(168deg);
  }
  24%,
  70% {
    transform: rotate(252deg);
  }
  86%,
  100% {
    transform: rotate(168deg);
  }
}

@keyframes carCrossDown {
  0%,
  24% {
    opacity: 0;
    transform: translateY(0) skewX(-8deg) scale(var(--car-one-scale));
  }
  30%,
  54% {
    opacity: 1;
  }
  67%,
  100% {
    opacity: 0;
    transform: translateY(150px) skewX(-8deg) scale(var(--car-one-scale));
  }
}

@keyframes carCrossDownTwo {
  0%,
  33% {
    opacity: 0;
    transform: translateY(0) skewX(-8deg) scale(var(--car-two-scale));
  }
  39%,
  62% {
    opacity: 1;
  }
  74%,
  100% {
    opacity: 0;
    transform: translateY(150px) skewX(-8deg) scale(var(--car-two-scale));
  }
}

@keyframes carCrossDownThree {
  0%,
  41% {
    opacity: 0;
    transform: translateY(0) skewX(-8deg) scale(var(--car-three-scale));
  }
  47%,
  68% {
    opacity: 1;
  }
  80%,
  100% {
    opacity: 0;
    transform: translateY(150px) skewX(-8deg) scale(var(--car-three-scale));
  }
}

@keyframes carCrossDownFour {
  0%,
  49% {
    opacity: 0;
    transform: translateY(0) skewX(-8deg) scale(var(--car-four-scale));
  }
  55%,
  72% {
    opacity: 1;
  }
  84%,
  100% {
    opacity: 0;
    transform: translateY(150px) skewX(-8deg) scale(var(--car-four-scale));
  }
}

@keyframes signalRedStop {
  0%,
  83% {
    background: #cf3f3f;
    box-shadow: 0 0 10px rgba(207, 63, 63, 0.95);
  }
  88%,
  100% {
    background: #4b3030;
    box-shadow: none;
  }
}

@keyframes signalGreenRelease {
  0%,
  83% {
    background: #284837;
    box-shadow: none;
  }
  88%,
  100% {
    background: #53d678;
    box-shadow: 0 0 12px rgba(83, 214, 120, 0.9);
  }
}

@keyframes wheelSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes steamRise {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.35);
  }
  16% {
    opacity: var(--sky-life-opacity);
  }
  58% {
    opacity: 0.48;
  }
  100% {
    opacity: 0;
    transform: translate(-26px, -42px) scale(1.35);
  }
}

@keyframes steamRiseSmall {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.38);
  }
  18% {
    opacity: var(--sky-life-opacity);
  }
  100% {
    opacity: 0;
    transform: translate(-22px, -36px) scale(1.1);
  }
}

@keyframes mountainCruise {
  0% {
    background-position: 0 4px, 88px 0, 178px 26px, 0 0;
  }
  to {
    background-position: -840px 4px, -780px 0, -500px 26px, 0 0;
  }
}

@keyframes sceneryPhotoPan {
  0% {
    background-position: 0 0, 0 0, 0 center;
  }
  100% {
    background-position: 0 0, 0 0, -360px center;
  }
}

@keyframes cityPhotoCruise {
  0% {
    background-position: 0 0, var(--city-focus), 10px 18px, 46px 4px, 0 24px;
  }
  100% {
    background-position: 0 0, -360px center, -494px 18px, -458px 4px, -260px 24px;
  }
}

@keyframes seaCruise {
  0% {
    background-position: 0 2px, 90px 0, 0 0, 0 0;
  }
  to {
    background-position: -420px 2px, -270px 0, -340px 0, -520px 0;
  }
}

@keyframes forestCruise {
  0% {
    background-position: 0 0, 0 0, 0 0;
  }
  to {
    background-position: -450px 0, -320px 0, 0 0;
  }
}

@keyframes fieldsCruise {
  0% {
    background-position: 0 0, 0 0, 0 0;
  }
  to {
    background-position: -168px 0, -320px 0, -432px 0;
  }
}

@keyframes cityCruise {
  0% {
    background-position: 10px 18px, 46px 4px, 92px 12px, 0 24px;
  }
  to {
    background-position: -494px 18px, -458px 4px, -412px 12px, -260px 24px;
  }
}

@keyframes treeRush {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-18%);
  }
}

@keyframes cloudDrift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(165%);
  }
}

@keyframes foregroundTreePass {
  0% {
    opacity: 0;
    transform: translateX(0) scale(var(--scale, 1));
  }
  8%,
  84% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    transform: translateX(-135vw) scale(var(--scale, 1));
  }
}

@keyframes citySignPass {
  0% {
    opacity: 0;
    transform: translateX(0) scale(var(--scale, 1));
  }
  8%,
  84% {
    opacity: var(--sky-life-opacity);
  }
  100% {
    opacity: 0;
    transform: translateX(-135vw) scale(var(--scale, 1));
  }
}

@keyframes flockFly {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) scale(var(--scale, 1));
  }
  10%,
  86% {
    opacity: var(--sky-life-opacity);
  }
  100% {
    opacity: 0;
    transform: translateX(138vw) translateY(var(--drift, -12px)) scale(var(--scale, 1));
  }
}

@keyframes wingBeat {
  0%,
  100% {
    transform: rotate(0deg) scaleX(1);
  }
  50% {
    transform: rotate(-8deg) scaleX(0.72);
  }
}

@keyframes planeFly {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) scale(var(--scale, 1));
  }
  12%,
  88% {
    opacity: var(--sky-life-opacity);
  }
  100% {
    opacity: 0;
    transform: translateX(145vw) translateY(var(--drift, 9px)) scale(var(--scale, 1));
  }
}

@keyframes ufoFly {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) scale(var(--scale, 1)) rotate(-2deg);
  }
  12%,
  82% {
    opacity: var(--sky-life-opacity);
  }
  42% {
    transform: translateX(56vw) translateY(calc(var(--drift, 0px) - 8px)) scale(var(--scale, 1)) rotate(2deg);
  }
  100% {
    opacity: 0;
    transform: translateX(142vw) translateY(var(--drift, 0px)) scale(var(--scale, 1)) rotate(-1deg);
  }
}

@keyframes sparkPop {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.6);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(1.7);
  }
}

@keyframes rainSweep {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -34px 78px;
  }
}

@keyframes snowFloat {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
  }
  to {
    background-position: 28px 76px, -18px 72px, 16px 78px, -24px 74px, 10px 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .train-cloud,
  .scenery-mountains,
  .scenery-sea,
  .scenery-forest,
  .scenery-fields,
  .scenery-city,
  .pine-track,
  .train-weather-layer,
  .train-live-layer,
  .level-crossing,
  .train-set,
  .engine-stack::before,
  .engine-stack::after,
  .train-engine::before,
  .train-wheel {
    animation: none;
  }

  .foreground-tree,
  .bird-flock,
  .sky-plane,
  .sky-ufo,
  .city-sign,
  .road-car,
  .track-spark {
    display: none;
  }
}

.icon-button,
.primary-button,
.secondary-button,
.segmented button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.icon-button {
  width: 40px;
  font-size: 18px;
}

.primary-button,
.secondary-button {
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  border-color: #1f5f52;
  color: #fff;
  background: #1f5f52;
}

.primary-button.hot-button {
  border-color: #8c2d2d;
  background: #8c2d2d;
}

.primary-button.button-working,
.secondary-button.button-working {
  position: relative;
  opacity: 0.82;
  box-shadow: 0 0 0 3px rgba(35, 103, 165, 0.14);
}

.primary-button.button-done,
.secondary-button.button-done {
  border-color: #1f7a5d;
  color: #fff;
  background: #1f7a5d;
}

.secondary-button.danger-button {
  border-color: rgba(140, 45, 45, 0.42);
  color: #8c2d2d;
  background: #fff6f4;
}

.secondary-button.danger-button:hover {
  border-color: #8c2d2d;
  background: #fde8e4;
}

.strategy-config-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: -4px 0 14px;
}

.strategy-config-pill {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.strategy-config-pill strong {
  color: var(--ink);
  font-size: 13px;
}

.strategy-config-pill.selected {
  border-color: #1f5f52;
  background: #edf7f3;
  box-shadow: 0 0 0 3px rgba(31, 95, 82, 0.12);
}

.strategy-config-tab.live {
  border-color: rgba(31, 95, 82, 0.62);
  box-shadow: inset 4px 0 0 #1f5f52;
}

.strategy-config-tab.active {
  border-color: rgba(193, 136, 34, 0.58);
  box-shadow: inset 4px 0 0 #c18822;
}

.strategy-config-tab.danger {
  border-color: rgba(176, 58, 58, 0.58);
  background: #fff7f5;
  box-shadow: inset 4px 0 0 #b03a3a;
}

.strategy-config-tab.stopped {
  opacity: 0.72;
}

.strategy-config-pill:focus-visible {
  outline: 2px solid #1f5f52;
  outline-offset: 2px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.metric-card,
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 6px;
  min-height: 106px;
  padding: 15px;
}

.metric-card span,
.metric-card small,
.risk-details span,
.account-row span,
.robot-meta,
td {
  color: var(--muted);
}

.metric-card strong {
  font-size: 24px;
}

.metric-card.accent {
  color: #fff;
  background: #245448;
}

.metric-card.accent span,
.metric-card.accent small {
  color: rgba(255, 255, 255, 0.72);
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 16px;
}

.left-column,
.right-column {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.hero-panel {
  background:
    linear-gradient(120deg, rgba(35, 103, 165, 0.08), rgba(33, 132, 91, 0.08)),
    #fff;
}

.live-mandate-panel {
  display: grid;
  gap: 16px;
}

.live-mandate-summary,
.live-mandate-grid,
.live-mandate-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.live-mandate-master {
  padding: 12px;
  border: 1px solid rgba(31, 95, 82, 0.22);
  border-radius: 8px;
  background: #edf4f0;
}

.live-master-toggle {
  border-color: rgba(31, 95, 82, 0.22);
  background: #fff;
}

.live-master-toggle small {
  color: #1f4f42;
  font-weight: 800;
  line-height: 1.35;
}

.live-mandate-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.live-mandate-checks .toggle-field {
  align-items: flex-start;
}

.live-mandate-checks .toggle-field > span:last-child {
  display: grid;
  gap: 4px;
}

.live-mandate-checks strong {
  font-size: 13px;
}

.live-mandate-checks small {
  line-height: 1.35;
}

.live-mandate-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.live-mandate-actions p {
  flex: 1 1 260px;
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.live-mandate-actions .launch-preview {
  flex: 1 1 100%;
  padding: 10px 12px;
  border: 1px solid #d8cdbb;
  border-radius: 8px;
  background: #fffaf0;
  color: #2d332f;
  font-weight: 700;
}

.live-mandate-actions .launch-preview small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.strategy-error-list {
  display: grid;
  flex: 1 1 100%;
  gap: 6px;
}

.strategy-error-list:empty {
  display: none;
}

.strategy-error-item,
.notification-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(179, 75, 75, 0.25);
  border-radius: 8px;
  background: #fff7f3;
  color: var(--ink);
}

.strategy-error-item strong,
.notification-card strong {
  color: var(--red);
}

.button-error {
  border-color: rgba(179, 75, 75, 0.5) !important;
  background: #b34b4b !important;
  color: #fff !important;
}

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

.notification-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.notification-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.notification-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.approval-meta,
.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.approval-meta span {
  padding: 5px 8px;
  border: 1px solid rgba(35, 103, 165, 0.14);
  border-radius: 999px;
  background: #f6faf8;
  color: var(--muted);
  font-size: 12px;
}

.approval-actions {
  justify-content: flex-start;
}

.platform-account-panel {
  display: grid;
  gap: 16px;
}

.embedded-platform-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.platform-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.platform-account-grid.compact .metric-card {
  min-height: 96px;
}

.platform-account-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.bybit-strategy-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6faf8;
}

.bybit-strategy-card h4 {
  margin: 2px 0 0;
  font-size: 18px;
}

.bybit-strategy-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}

.panel-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.green {
  color: #0b6b45;
  background: #dff4e9;
}

.badge.blue {
  color: #174f83;
  background: #e2edf8;
}

.badge.gold {
  color: #74500d;
  background: #f6ead2;
}

.badge.red {
  color: #8c2d2d;
  background: #f7dddd;
}

.risk-board {
  gap: 18px;
}

.risk-ring {
  display: grid;
  width: 156px;
  height: 156px;
  flex: 0 0 auto;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 56%, transparent 57%),
    conic-gradient(var(--green) 0 58%, #e7e2d8 58% 100%);
}

.risk-ring span {
  font-size: 34px;
  font-weight: 900;
}

.risk-ring small {
  color: var(--muted);
}

.risk-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.risk-details div {
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.risk-details strong {
  display: block;
  margin-top: 10px;
  font-size: 20px;
}

.dashboard-control-panel {
  display: grid;
  gap: 18px;
}

.dashboard-risk-summary {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.dashboard-ai-risk-card input {
  width: 100%;
  margin-top: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  background: #fffdf8;
}

.dashboard-asset-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.dashboard-asset-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(31, 109, 90, 0.14);
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: 0 10px 24px rgba(20, 23, 31, 0.04);
}

.dashboard-asset-card span,
.dashboard-asset-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-asset-card strong {
  color: var(--ink);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.08;
}

.dashboard-asset-class-card {
  grid-column: span 2;
}

.dashboard-allocation-limit-card {
  grid-column: 1 / -1;
}

.dashboard-allocation-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-allocation-controls strong {
  min-width: 150px;
  font-size: 13px;
  color: var(--muted);
}

.dashboard-allocation-controls label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.dashboard-allocation-controls input {
  width: 140px;
  min-height: 34px;
  border: 1px solid rgba(20, 23, 31, 0.18);
  border-radius: 7px;
  padding: 6px 8px;
  font-weight: 700;
}

.dashboard-allocation-controls .ghost-button.active {
  border-color: rgba(31, 109, 90, 0.45);
  background: #1f6d5a;
  color: #fff;
}

.dashboard-asset-class-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-asset-class-pill {
  display: inline-grid;
  grid-template-columns: auto auto auto auto;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(220, 216, 207, 0.95);
  border-radius: 999px;
  background: #f8f6f1;
  color: #2f343d;
  font-size: 12px;
}

.dashboard-asset-class-pill i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--asset-color, #6f7480);
}

.dashboard-asset-class-pill b {
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-asset-class-pill strong {
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-asset-class-pill small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.dashboard-allocation-limit-list {
  display: grid;
  gap: 10px;
}

.dashboard-allocation-limit-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(31, 109, 90, 0.13);
  border-radius: 8px;
  background: #fff;
}

.dashboard-allocation-limit-row.below_min {
  border-color: rgba(200, 145, 42, 0.35);
}

.dashboard-allocation-limit-row.above_max {
  border-color: rgba(184, 70, 70, 0.35);
}

.dashboard-allocation-limit-row.allocation-increase {
  background: linear-gradient(180deg, rgba(200, 145, 42, 0.08), #fff 44%);
}

.dashboard-allocation-limit-row.allocation-reduce,
.dashboard-allocation-limit-row.allocation-reduce_soft {
  background: linear-gradient(180deg, rgba(184, 70, 70, 0.07), #fff 44%);
}

.dashboard-allocation-limit-row.allocation-hold {
  background: linear-gradient(180deg, rgba(31, 109, 90, 0.05), #fff 44%);
}

.dashboard-allocation-limit-head,
.dashboard-allocation-limit-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-allocation-limit-head strong {
  font-size: 15px;
}

.dashboard-allocation-limit-values {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-allocation-limit-values label {
  display: inline-grid;
  gap: 3px;
}

.dashboard-allocation-limit-values input {
  width: 82px;
  min-height: 34px;
  border: 1px solid rgba(20, 23, 31, 0.18);
  border-radius: 7px;
  padding: 6px 8px;
  font-weight: 700;
}

.dashboard-allocation-limit-values button {
  align-self: end;
  min-height: 34px;
}

.dashboard-allocation-limit-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #ebe5d8;
  overflow: hidden;
}

.dashboard-allocation-limit-bar i,
.dashboard-allocation-limit-bar em,
.dashboard-allocation-limit-bar b {
  position: absolute;
  top: 0;
  bottom: 0;
}

.dashboard-allocation-limit-bar i {
  border-radius: 999px;
  background: rgba(31, 109, 90, 0.22);
}

.dashboard-allocation-limit-bar em {
  width: 2px;
  background: #c8912a;
}

.dashboard-allocation-limit-bar b {
  width: 3px;
  margin-left: -1px;
  background: #1f6d5a;
  box-shadow: 0 0 0 2px rgba(31, 109, 90, 0.18);
}

.dashboard-allocation-unowned {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(184, 70, 70, 0.18);
  border-radius: 7px;
  background: #fff7f3;
  color: #5f3f35;
  font-size: 12px;
  line-height: 1.3;
}

.dashboard-allocation-unowned span {
  display: block;
}

.dashboard-allocation-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-allocation-extra span {
  padding: 4px 7px;
  border: 1px solid rgba(31, 109, 90, 0.12);
  border-radius: 7px;
  background: rgba(31, 109, 90, 0.05);
}

.dashboard-allocation-extra b {
  color: var(--ink);
}

.dashboard-allocation-plan {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px dashed rgba(31, 109, 90, 0.22);
  border-radius: 8px;
  background: #f8f6f1;
  color: #2f343d;
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-allocation-plan ul {
  margin: 0;
  padding-left: 18px;
}

.dashboard-allocation-next-step {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(31, 109, 90, 0.08);
  color: #1f6d5a;
  font-weight: 800;
}

.dashboard-allocation-limit-row.allocation-increase .dashboard-allocation-next-step {
  background: rgba(200, 145, 42, 0.12);
  color: #8a641e;
}

.dashboard-allocation-limit-row.allocation-reduce .dashboard-allocation-next-step,
.dashboard-allocation-limit-row.allocation-reduce_soft .dashboard-allocation-next-step {
  background: rgba(184, 70, 70, 0.1);
  color: #8f3434;
}

.dashboard-allocation-plan-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-allocation-plan-columns > div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(220, 216, 207, 0.82);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-cash-queue-card,
.dashboard-capital-flow-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(31, 109, 90, 0.14);
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: 0 10px 24px rgba(20, 23, 31, 0.04);
}

.dashboard-capital-flow-card {
  border-color: rgba(31, 109, 90, 0.18);
  background: linear-gradient(180deg, #fffdfa 0%, #f7fbf8 100%);
}

.dashboard-cash-queue-table td,
.dashboard-capital-flow-table td {
  vertical-align: top;
}

.dashboard-cash-queue-table td strong,
.dashboard-cash-queue-table td small,
.dashboard-capital-flow-table td strong,
.dashboard-capital-flow-table td small {
  display: block;
}

.dashboard-cash-queue-table td small,
.dashboard-capital-flow-table td small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.dashboard-human-confirm-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(143, 91, 25, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdfa 0%, #fff8ec 100%);
  box-shadow: 0 10px 24px rgba(20, 23, 31, 0.04);
}

.human-confirm-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

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

.human-confirm-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(220, 216, 207, 0.9);
  border-left: 4px solid rgba(42, 113, 94, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.human-confirm-card.warning,
.human-confirm-card.error {
  border-left-color: #c7912f;
}

.human-confirm-card.critical {
  border-left-color: #b84646;
}

.human-confirm-card-head,
.human-confirm-meta,
.human-confirm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.human-confirm-card-head {
  justify-content: space-between;
}

.human-confirm-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

.human-confirm-meta,
.human-confirm-logic {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.human-confirm-logic span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
}

.human-confirm-logic small {
  display: block;
  margin-top: 4px;
}

.human-confirm-actions .compact {
  min-height: 34px;
}

.human-confirm-empty {
  padding: 14px;
  border: 1px dashed rgba(42, 113, 94, 0.24);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
}

.dashboard-budget-controls {
  align-items: end;
}

.dashboard-budget-controls .form-field {
  max-width: 280px;
}

.dashboard-live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.dashboard-capital-chart-card,
.dashboard-robots-card,
.dashboard-open-positions-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.dashboard-open-positions-card {
  margin-top: 14px;
}

.process-switch-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 109, 90, 0.18);
  border-radius: 8px;
  background: #f7fbf8;
}

.process-switch-strip > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.process-switch-strip strong {
  font-size: 13px;
  color: var(--ink);
}

.process-switch-strip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.process-switch-strip.paused {
  border-color: rgba(184, 70, 70, 0.24);
  background: #fff5f2;
}

.process-switch-button {
  min-width: 86px;
  white-space: nowrap;
}

.is-process-paused .world-live-grid,
.is-process-paused .platform-account-split,
.is-process-paused .dashboard-trade-chart-controls,
.is-process-paused .dashboard-trade-chart-legend,
.is-process-paused .arbitrage-pair-settings {
  opacity: 0.58;
}

.dashboard-open-positions-table {
  min-width: 980px;
}

.logic-police-badge {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef4f2;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.logic-police-badge.warning,
.logic-police-badge.error,
.logic-police-badge.critical {
  background: #ffe4dd;
  color: var(--red);
}

.logic-police-badge.unknown {
  background: #f1eee7;
  color: var(--muted);
}

.dashboard-trade-chart-block {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.compact-chart-header {
  align-items: start;
}

.compact-chart-header select,
.dashboard-trade-chart-controls select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.dashboard-trade-chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dashboard-trade-chart-controls label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid rgba(220, 216, 207, 0.9);
  border-radius: 8px;
  background: #f8f6f1;
  color: #3b404a;
  font-size: 12px;
  font-weight: 850;
}

.dashboard-trade-chart-controls label span {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-trade-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-trade-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-trade-chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dashboard-trade-chart-legend .marker-entry {
  background: #0f8b5f;
}

.dashboard-trade-chart-legend .marker-exit {
  background: #d64f4f;
}

.dashboard-trade-chart-legend .marker-order {
  border-radius: 2px;
  background: #2367a5;
}

.dashboard-trade-plan-box,
.dashboard-trade-ledger-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(31, 109, 90, 0.18);
  border-radius: 8px;
  background: #f8fbf9;
}

.dashboard-trade-plan-box > strong,
.dashboard-trade-ledger-box > strong,
.dashboard-trade-plan-head strong {
  font-size: 14px;
}

.dashboard-trade-plan-box p,
.dashboard-trade-ledger-box p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-trade-plan-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.dashboard-trade-logic-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #d7e5df;
  border-radius: 8px;
  background: #f4faf7;
}

.dashboard-trade-logic-summary.warning {
  border-color: #efd29c;
  background: #fff8ea;
}

.dashboard-trade-logic-summary.error,
.dashboard-trade-logic-summary.critical {
  border-color: #efc1c1;
  background: #fff1f1;
}

.dashboard-trade-logic-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dashboard-trade-plan-head span,
.dashboard-trade-plan-item span,
.dashboard-trade-plan-item small {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-trade-plan-item {
  display: grid;
  gap: 5px;
  padding: 9px;
  border-left: 3px solid #2367a5;
  border-radius: 8px;
  background: #fff;
}

.dashboard-trade-plan-item.ok {
  border-left-color: var(--green);
}

.dashboard-trade-plan-item.warning,
.dashboard-trade-plan-item.error {
  border-left-color: var(--red);
  background: #fff7f5;
}

.dashboard-trade-plan-item b {
  width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef4f2;
  color: var(--green);
  font-size: 11px;
}

.dashboard-trade-plan-item.warning b,
.dashboard-trade-plan-item.error b {
  background: #ffe4dd;
  color: var(--red);
}

.dashboard-trade-plan-item em {
  color: var(--red);
  font-size: 12px;
  font-style: normal;
}

.dashboard-trade-ledger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.dashboard-trade-ledger-item {
  display: grid;
  gap: 3px;
  padding: 9px;
  border-left: 3px solid #2367a5;
  border-radius: 8px;
  background: #fff;
}

.dashboard-trade-ledger-item.position {
  border-left-color: var(--green);
}

.dashboard-trade-ledger-item.order {
  border-left-color: #2367a5;
}

.dashboard-trade-ledger-item b {
  font-size: 13px;
}

.dashboard-trade-ledger-item span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.dashboard-trade-ledger-item small,
.dashboard-trade-ledger-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.dashboard-trade-ledger-logic {
  color: var(--green);
  font-weight: 800;
}

.dashboard-trade-chart-stage {
  min-height: clamp(300px, 38vw, 470px);
  border: 1px solid rgba(20, 23, 31, 0.08);
  border-radius: 8px;
  background: #fffdfa;
  overflow: hidden;
}

.dashboard-trade-chart-stage .trading-chart-canvas {
  width: 100%;
  height: clamp(300px, 38vw, 470px);
}

.dashboard-open-positions-table tr[data-dashboard-position-symbol] {
  cursor: pointer;
}

.dashboard-open-positions-table tr[data-dashboard-position-symbol]:hover {
  background: rgba(35, 103, 165, 0.06);
}

.dashboard-capital-chart {
  display: grid;
  gap: 10px;
  min-height: clamp(420px, 44vw, 650px);
}

.dashboard-capital-chart-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid rgba(20, 23, 31, 0.08);
  border-radius: 8px;
  background: #fffdfa;
}

.dashboard-capital-chart svg {
  width: 100%;
  min-width: 1080px;
  height: clamp(420px, 44vw, 650px);
  display: block;
}

.dashboard-capital-chart-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dashboard-capital-chart-tools button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(220, 216, 207, 0.95);
  border-radius: 999px;
  background: #f8f6f1;
  color: #4b5260;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.dashboard-capital-chart-tools button.selected {
  border-color: rgba(31, 109, 90, 0.32);
  background: #eef6f2;
  color: var(--ink);
}

.dashboard-capital-chart-tools i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-color, var(--green));
}

.dashboard-capital-chart-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dashboard-capital-chart-foot strong {
  color: var(--ink);
}

.dashboard-capital-components {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.dashboard-capital-components span {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(220, 216, 207, 0.85);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-capital-components i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-color, var(--green));
}

.dashboard-capital-components b {
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-capital-components small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.dashboard-strategy-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  overflow: visible;
  padding-right: 0;
}

.dashboard-strategy-card:has(.dashboard-strategy-detail:not([hidden])) {
  grid-column: 1 / -1;
}

.dashboard-strategy-tile {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dashboard-strategy-tile:hover,
.dashboard-strategy-tile:focus-visible {
  border-color: rgba(31, 109, 90, 0.35);
  outline: none;
  box-shadow: 0 10px 24px rgba(20, 23, 31, 0.08);
}

.dashboard-strategy-tile-head,
.dashboard-strategy-tile-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.dashboard-strategy-tile-head strong {
  min-width: 0;
  font-size: 14px;
}

.dashboard-strategy-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-strategy-tile-grid span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: #f7f4ee;
}

.dashboard-strategy-tile-grid small,
.dashboard-strategy-tile-foot span {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-strategy-tile-grid b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-strategy-version-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dashboard-strategy-version-switch [role="button"] {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.dashboard-strategy-version-switch [role="button"].selected {
  border-color: rgba(31, 109, 90, 0.45);
  background: rgba(31, 109, 90, 0.1);
  color: var(--green);
}

.dashboard-strategy-card {
  display: grid;
  gap: 8px;
}

.dashboard-strategy-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.dashboard-strategy-totals div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(31, 109, 90, 0.12);
  border-radius: 8px;
  background: #f7f4ee;
}

.dashboard-strategy-totals span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-strategy-totals strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-strategy-detail {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.dashboard-strategy-detail[hidden],
.dashboard-strategy-instrument-panel[hidden],
.dashboard-detail-pane[hidden] {
  display: none;
}

.dashboard-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-detail-summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: #f7f4ee;
}

.dashboard-detail-summary small,
.dashboard-instrument-head span {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-detail-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-detail-tabs,
.dashboard-detail-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-detail-tab {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.dashboard-detail-tab small {
  margin-left: 5px;
  color: inherit;
  opacity: 0.72;
}

.dashboard-detail-tab.selected {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.dashboard-strategy-instrument-panel {
  display: grid;
  gap: 10px;
}

.dashboard-instrument-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.dashboard-detail-table {
  min-width: 720px;
}

.dashboard-detail-table td small,
.dashboard-detail-table th {
  overflow-wrap: anywhere;
}

.dashboard-detail-chart {
  overflow-x: auto;
}

.dashboard-detail-chart svg {
  width: 100%;
  min-width: 420px;
  height: 180px;
}

.dashboard-strategy-risk-table td,
.dashboard-strategy-risk-table th {
  vertical-align: top;
}

.allocation-input {
  width: 92px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.allocation-input:focus {
  border-color: var(--green);
  outline: 2px solid rgba(31, 109, 90, 0.18);
}

.risk-row-button,
.robot-row-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.robot-row-button {
  display: flex;
}

.risk-budget-lost-row {
  background: rgba(184, 70, 70, 0.08);
}

.risk-budget-lost-row strong,
.risk-budget-lost-row .strategy-state-pill {
  color: #8c2d2d;
}

.muted-cell {
  color: var(--muted);
}

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

.allocation-grid div {
  min-height: 104px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
}

.allocation-grid span,
.allocation-grid small {
  display: block;
  color: var(--muted);
}

.allocation-grid strong {
  display: block;
  margin: 10px 0 6px;
  color: var(--blue);
  font-size: 26px;
}

.world-markets-panel {
  overflow: hidden;
}

.favorite-dashboard-panel {
  overflow: hidden;
}

.favorite-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.74fr) minmax(0, 1.26fr);
  gap: 12px;
  align-items: start;
}

.favorite-list-panel,
.favorite-chart-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
}

.favorite-list-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.favorite-chart-panel {
  display: grid;
  gap: 10px;
  min-height: 462px;
  padding: 12px;
  background: #fff;
}

.favorite-instrument-list {
  display: grid;
  gap: 8px;
  max-height: 466px;
  overflow: auto;
  padding-right: 2px;
}

.favorite-instrument-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, auto);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 9px;
  border: 1px solid rgba(220, 216, 207, 0.82);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.favorite-instrument-row:hover,
.favorite-instrument-row:focus-visible,
.favorite-instrument-row.selected {
  outline: none;
  border-color: rgba(35, 103, 165, 0.48);
  background: #f1f7fc;
  box-shadow: 0 0 0 3px rgba(35, 103, 165, 0.1);
}

.favorite-instrument-main,
.favorite-instrument-price {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.favorite-instrument-main strong,
.favorite-instrument-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-instrument-main small,
.favorite-empty span,
.favorite-chart-head span {
  color: var(--muted);
}

.favorite-instrument-price {
  justify-items: end;
}

.favorite-instrument-price small.positive {
  color: var(--green);
}

.favorite-instrument-price small.negative {
  color: var(--red);
}

.favorite-empty {
  display: grid;
  place-items: center;
  min-height: 170px;
  gap: 6px;
  text-align: center;
}

.favorite-chart-head,
.instrument-detail-actions,
.chart-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.favorite-chart-head strong {
  display: block;
  margin-top: 4px;
}

.favorite-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 34px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(184, 134, 43, 0.28);
  border-radius: 999px;
  color: #8a641b;
  background: #fff8e6;
  font-weight: 950;
  cursor: pointer;
}

.favorite-star:hover,
.favorite-star:focus-visible,
.favorite-star.active {
  outline: none;
  border-color: rgba(184, 134, 43, 0.58);
  color: #5d4210;
  background: #ffe4a6;
  box-shadow: 0 0 0 3px rgba(184, 134, 43, 0.12);
}

.favorite-star span {
  font-size: 18px;
  line-height: 1;
}

.favorite-star em {
  font-style: normal;
  font-size: 12px;
}

.world-coverage-grid,
.world-top-grid,
.world-live-grid,
.world-market-layout {
  display: grid;
  gap: 12px;
}

.world-coverage-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.instrument-search-shell {
  position: relative;
  z-index: 6;
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.instrument-search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid rgba(35, 103, 165, 0.28);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 26px rgba(16, 24, 40, 0.06);
}

.instrument-search-box span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.instrument-search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 750;
}

.instrument-search-total {
  justify-self: end;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(32, 115, 93, 0.22);
  color: #176a54;
  background: rgba(32, 115, 93, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.instrument-search-status {
  color: var(--muted);
  font-size: 12px;
}

.instrument-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 430px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(35, 103, 165, 0.24);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 52px rgba(20, 23, 31, 0.18);
}

.instrument-search-results.open {
  display: grid;
  gap: 7px;
}

.instrument-search-result {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(180px, 1fr) minmax(92px, auto);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(220, 216, 207, 0.82);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfaf7;
  text-align: left;
  cursor: pointer;
}

.instrument-search-result:hover,
.instrument-search-result:focus-visible {
  outline: none;
  border-color: rgba(35, 103, 165, 0.5);
  background: #f1f7fc;
}

.instrument-search-symbol,
.instrument-search-price {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.instrument-search-symbol strong,
.instrument-search-symbol em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instrument-search-symbol em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.instrument-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.instrument-search-tags small {
  max-width: 150px;
  overflow: hidden;
  padding: 4px 6px;
  border-radius: 999px;
  color: #405064;
  background: #eef1f4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instrument-search-price {
  justify-items: end;
}

.instrument-search-price small.positive {
  color: var(--green);
}

.instrument-search-price small.negative {
  color: var(--red);
}

.instrument-search-empty {
  padding: 14px;
  color: var(--muted);
  text-align: center;
}

.world-coverage-grid article,
.world-chart-card,
.world-country-browser,
.world-instrument-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
}

.world-coverage-grid article {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 12px;
}

.world-coverage-grid span,
.world-coverage-grid small,
.chart-card-header span,
.market-section-title span,
.world-meta,
.world-subtle,
.empty-state span {
  color: var(--muted);
}

.world-coverage-grid strong {
  font-size: 23px;
}

.world-top-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.world-live-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.world-chart-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 238px;
  padding: 12px;
}

.world-chart-card.wide {
  grid-column: span 2;
}

.chart-card-header,
.world-asset-row,
.world-live-row,
.world-region-row,
.world-instrument-line,
.market-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.world-asset-row > *,
.world-live-row > *,
.world-region-row > *,
.world-instrument-line > *,
.market-section-title > * {
  min-width: 0;
}

.world-asset-list,
.world-live-table,
.world-region-list,
.world-country-tree,
.world-class-list,
.world-subcategory-list {
  display: grid;
  gap: 8px;
}

.world-asset-row,
.world-live-row,
.world-region-row,
.world-instrument-line {
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(220, 216, 207, 0.78);
  border-radius: 8px;
  background: #fff;
}

button.world-asset-row,
button.world-live-row,
button.world-instrument-line {
  text-align: left;
  cursor: pointer;
}

button.world-asset-row:hover,
button.world-asset-row:focus-visible,
button.world-live-row:hover,
button.world-live-row:focus-visible,
button.world-instrument-line:hover,
button.world-instrument-line:focus-visible {
  outline: none;
  border-color: rgba(35, 103, 165, 0.42);
  box-shadow: 0 0 0 3px rgba(35, 103, 165, 0.1);
}

.world-asset-main,
.world-instrument-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.world-asset-main strong,
.world-instrument-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-price-stack {
  display: grid;
  gap: 4px;
  min-width: 92px;
  justify-items: end;
}

.world-change.positive {
  color: var(--green);
}

.world-change.negative {
  color: var(--red);
}

.world-live-row {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  min-height: 58px;
}

.world-live-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: #176a54;
  background: rgba(32, 115, 93, 0.1);
  font-size: 12px;
  font-weight: 900;
}

.world-live-metric {
  display: grid;
  gap: 3px;
  min-width: 104px;
  justify-items: end;
  color: var(--ink);
}

.world-live-metric small {
  color: var(--muted);
  font-size: 11px;
}

.world-live-detail {
  position: static;
}

.empty-state.compact {
  min-height: 116px;
  padding: 14px;
}

.sparkline {
  flex: 0 0 88px;
  width: 88px;
  height: 30px;
}

.world-live-table .sparkline {
  flex-basis: 74px;
  width: 74px;
  height: 26px;
}

.world-megacap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.world-market-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: start;
}

.world-country-browser,
.world-instrument-detail {
  min-height: 380px;
  padding: 12px;
}

.world-country-tree {
  max-height: 680px;
  overflow: auto;
  padding-right: 3px;
}

.world-country-tree details {
  border: 1px solid rgba(220, 216, 207, 0.78);
  border-radius: 8px;
  background: #fff;
}

.world-country-tree summary {
  padding: 11px;
  cursor: pointer;
  font-weight: 800;
}

.world-exchange-block,
.world-class-block,
.world-category-block {
  display: grid;
  gap: 8px;
  margin: 0 10px 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f8f6f0;
}

.world-class-title,
.world-category-title {
  display: block;
  color: #3b404a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.world-instrument-detail {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  background: #fff;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 320px;
  gap: 8px;
  text-align: center;
}

.instrument-detail-head {
  display: grid;
  gap: 8px;
}

.instrument-detail-head h3 {
  margin: 0;
  font-size: 24px;
}

.instrument-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.instrument-detail-grid article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
}

.instrument-detail-grid span,
.instrument-description {
  color: var(--muted);
}

.instrument-detail-grid strong {
  display: block;
  margin-top: 5px;
}

.instrument-characteristics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.instrument-characteristics article {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(220, 216, 207, 0.78);
  border-radius: 8px;
  background: #fbfaf7;
}

.instrument-characteristics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.instrument-characteristics strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.instrument-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.instrument-links a {
  padding: 7px 10px;
  border: 1px solid rgba(31, 95, 82, 0.22);
  border-radius: 8px;
  color: #1f5f52;
  background: #eef7f2;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.technical-chart {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(35, 103, 165, 0.05), transparent),
    #fff;
}

.trading-chart-shell {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(20, 23, 31, 0.1);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.trading-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 0;
}

.trading-chart-toolbar > div:first-child {
  display: grid;
  gap: 3px;
}

.trading-chart-toolbar span,
.trading-chart-badges span {
  color: var(--muted);
  font-size: 11px;
}

.trading-chart-toolbar .favorite-star span {
  color: inherit;
  font-size: 18px;
}

.trading-chart-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.chart-timeframe-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 3px;
  border: 1px solid rgba(220, 216, 207, 0.9);
  border-radius: 8px;
  background: #f6f4ef;
}

.chart-timeframe-switcher button {
  min-width: 42px;
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  color: #3b404a;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.chart-timeframe-switcher button:hover,
.chart-timeframe-switcher button:focus-visible {
  outline: none;
  background: rgba(35, 103, 165, 0.1);
}

.chart-timeframe-switcher button.selected {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 5px 12px rgba(35, 103, 165, 0.2);
}

.trading-chart-badges span {
  padding: 5px 7px;
  border: 1px solid rgba(35, 103, 165, 0.16);
  border-radius: 999px;
  background: #f1f7fc;
  color: var(--blue);
  font-weight: 850;
}

.trading-chart-stage {
  position: relative;
  min-height: 420px;
}

.trading-chart-canvas {
  display: block;
  width: 100%;
  height: 420px;
}

.trading-chart-shell.compact .trading-chart-stage {
  min-height: 330px;
}

.trading-chart-shell.compact .trading-chart-canvas {
  height: 330px;
}

.trading-chart-tooltip {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 3px;
  min-width: 176px;
  padding: 8px;
  border: 1px solid rgba(20, 23, 31, 0.16);
  border-radius: 8px;
  color: #14171f;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 36px rgba(20, 23, 31, 0.16);
  font-size: 11px;
  pointer-events: none;
}

.trading-chart-tooltip strong {
  font-size: 12px;
}

.technical-note {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(35, 103, 165, 0.18);
  border-radius: 8px;
  background: #f1f7fc;
  color: var(--muted);
  font-size: 12px;
}

.technical-control-panel,
.technical-logs-panel {
  display: grid;
  gap: 16px;
}

.technical-actions,
.technical-log-page {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

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

.technical-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
}

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

.technical-agent-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.technical-agent-card header {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: flex-start;
}

.technical-agent-card h3 {
  margin: 0;
  font-size: 14px;
}

.technical-agent-card p,
.technical-agent-card small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.technical-health-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e3d8;
}

.technical-health-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1f5f52;
}

.technical-health-bar.warning span {
  background: #b8862b;
}

.technical-health-bar.error span,
.technical-health-bar.critical span {
  background: #b34b4b;
}

.technical-log-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}

.technical-process-table,
.technical-repair-table,
.technical-log-table {
  min-width: 760px;
}

.technical-process-table small,
.technical-repair-table small,
.technical-log-table small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.log-message {
  max-width: 680px;
  white-space: normal;
}

.games-panel {
  overflow: hidden;
}

.business-ideas-panel {
  display: grid;
  gap: 14px;
}

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

.business-ideas-summary article,
.business-idea-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.business-ideas-summary article {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.business-ideas-summary span,
.business-ideas-summary small,
.business-idea-card p,
.business-idea-card li,
.business-idea-meta {
  color: var(--muted);
}

.business-ideas-summary strong {
  font-size: 22px;
}

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

.business-idea-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
}

.business-idea-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.business-idea-card h3 {
  margin: 3px 0 2px;
  font-size: 20px;
}

.business-idea-index {
  display: inline-flex;
  min-width: 34px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(32, 110, 89, 0.1);
  color: var(--green);
  font-weight: 900;
}

.business-idea-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.business-idea-meta span {
  padding: 6px 8px;
  border: 1px solid rgba(220, 216, 207, 0.9);
  border-radius: 8px;
  background: #f7f4ed;
}

.business-idea-card section {
  display: grid;
  gap: 5px;
}

.business-idea-card section strong {
  color: var(--ink);
}

.business-idea-card p {
  margin: 0;
  line-height: 1.45;
}

.business-idea-model {
  border: 1px solid rgba(32, 110, 89, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: #f4faf6;
}

.business-idea-model-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.95fr) minmax(0, 1.05fr);
  gap: 6px 10px;
  font-size: 12px;
}

.business-idea-model-grid span,
.business-idea-scenarios small,
.business-idea-scenarios em {
  color: var(--muted);
}

.business-idea-model-grid b,
.business-idea-scenarios b {
  color: var(--ink);
}

.business-idea-scenarios {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.business-idea-scenarios article {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(220, 216, 207, 0.9);
  border-radius: 8px;
  background: #fffdfa;
}

.business-idea-scenarios span {
  font-weight: 900;
}

.business-idea-scenarios em {
  font-style: normal;
}

.business-idea-table {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.business-idea-table > strong {
  color: var(--ink);
  font-size: 12px;
}

.business-idea-table-scroll {
  overflow-x: auto;
  border: 1px solid rgba(220, 216, 207, 0.9);
  border-radius: 8px;
  background: #fffdfa;
}

.business-idea-table table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 12px;
}

.business-idea-table th,
.business-idea-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(220, 216, 207, 0.75);
  text-align: left;
  vertical-align: top;
}

.business-idea-table th {
  color: var(--muted);
  font-weight: 900;
  background: rgba(244, 238, 229, 0.74);
}

.business-idea-table tr:last-child td {
  border-bottom: 0;
}

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

.business-idea-card ul {
  margin: 0;
  padding-left: 18px;
}

.business-idea-card li + li {
  margin-top: 4px;
}

.product-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(201, 181, 119, 0.28);
  color: #eef6ee;
  background:
    linear-gradient(140deg, rgba(12, 22, 19, 0.98), rgba(17, 24, 23, 0.96) 45%, rgba(23, 25, 22, 0.98)),
    #111816;
  box-shadow: 0 26px 80px rgba(11, 19, 17, 0.24);
}

.product-panel .eyebrow,
.product-panel p,
.product-panel small,
.product-panel span {
  color: rgba(238, 246, 238, 0.72);
}

.product-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.product-hero h2 {
  margin: 4px 0 8px;
  color: #fffdf5;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.02;
}

.product-hero p {
  max-width: 760px;
  margin: 0;
  line-height: 1.55;
}

.product-source-pill,
.product-data-quality,
.product-disclaimer {
  border: 1px solid rgba(201, 181, 119, 0.26);
  border-radius: 8px;
  background: rgba(255, 253, 245, 0.08);
}

.product-source-pill {
  min-width: 220px;
  padding: 12px 14px;
}

.product-source-pill span,
.product-source-pill strong {
  display: block;
}

.product-source-pill strong {
  margin-top: 4px;
  color: #d7c06c;
  font-size: 18px;
}

.product-result-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.product-result-strip article {
  display: grid;
  gap: 5px;
  min-height: 110px;
  padding: 14px;
  border: 1px solid rgba(255, 253, 245, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 245, 0.06);
}

.product-result-strip strong {
  color: #fffdf5;
  font-size: clamp(20px, 2vw, 30px);
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: stretch;
}

.product-chart-shell,
.product-controls {
  border: 1px solid rgba(255, 253, 245, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 245, 0.055);
}

.product-chart-shell {
  display: grid;
  gap: 10px;
  min-height: min(64vh, 690px);
  padding: 16px;
}

.product-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.product-chart-head strong {
  display: block;
  margin-top: 3px;
  color: #fffdf5;
  font-size: 24px;
}

.product-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  font-size: 12px;
}

.product-chart-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.product-chart-legend i {
  width: 18px;
  height: 4px;
  border-radius: 999px;
}

.legend-value {
  background: #65ddb0;
}

.legend-principal {
  background: #d7c06c;
}

.legend-growth {
  background: rgba(101, 221, 176, 0.22);
}

.product-chart {
  min-height: 520px;
}

.product-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
}

.product-controls {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 14px;
}

.product-scenario-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.product-scenario {
  min-height: 42px;
  border: 1px solid rgba(255, 253, 245, 0.16);
  border-radius: 8px;
  color: rgba(238, 246, 238, 0.78);
  background: rgba(255, 253, 245, 0.06);
  cursor: pointer;
}

.product-scenario.active {
  border-color: rgba(101, 221, 176, 0.72);
  color: #071310;
  background: #65ddb0;
}

.product-field {
  display: grid;
  gap: 8px;
}

.product-field > span {
  color: #fffdf5;
  font-weight: 800;
}

.product-field input,
.product-field select {
  height: 40px;
  border: 1px solid rgba(255, 253, 245, 0.14);
  border-radius: 8px;
  color: #fffdf5;
  background: rgba(4, 9, 8, 0.62);
}

.product-field input[type="range"] {
  height: 24px;
  accent-color: #65ddb0;
}

.product-field select option {
  color: #111816;
}

.product-data-quality {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.product-data-quality strong {
  color: #fffdf5;
  font-size: 13px;
  line-height: 1.35;
}

.product-disclaimer {
  padding: 13px 14px;
  color: rgba(255, 253, 245, 0.86);
  line-height: 1.48;
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 12px;
}

.kingdom-stage,
.kingdom-console,
.game-mode-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
}

.kingdom-stage,
.kingdom-console {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.kingdom-stage-head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.kingdom-stage-head.compact {
  margin-top: 2px;
}

.kingdom-stage-head div,
.kingdom-selected-grid article {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(220, 216, 207, 0.82);
  border-radius: 8px;
  background: #fff;
}

.kingdom-stage-head span,
.kingdom-selected-grid span,
.kingdom-resource span,
.kingdom-market-row small,
.game-mode-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.kingdom-stage-head strong,
.kingdom-selected-grid strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kingdom-planet-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.74fr) minmax(0, 1.26fr);
  gap: 12px;
  align-items: stretch;
}

.kingdom-planet {
  position: relative;
  min-height: 262px;
  overflow: hidden;
  border: 1px solid rgba(35, 103, 165, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9), transparent 11%),
    radial-gradient(circle at 50% 50%, #73b7d2 0 43%, #2d7c9f 44% 52%, transparent 53%),
    linear-gradient(145deg, #102c45, #1a604e 58%, #0f2537);
  box-shadow: inset 0 0 38px rgba(255, 255, 255, 0.22);
}

.kingdom-planet::before,
.kingdom-planet::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  pointer-events: none;
}

.kingdom-planet::before {
  background:
    radial-gradient(ellipse at 35% 42%, rgba(53, 134, 81, 0.92) 0 14%, transparent 15%),
    radial-gradient(ellipse at 57% 30%, rgba(52, 126, 77, 0.88) 0 11%, transparent 12%),
    radial-gradient(ellipse at 61% 60%, rgba(204, 179, 95, 0.9) 0 13%, transparent 14%),
    radial-gradient(ellipse at 43% 67%, rgba(49, 118, 74, 0.88) 0 10%, transparent 11%);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}

.kingdom-planet::after {
  inset: 9%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset -18px -18px 24px rgba(9, 31, 46, 0.28);
}

.planet-continent {
  position: absolute;
  z-index: 2;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #173246;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.planet-continent.selected {
  background: #f0b33a;
  color: #1c1b18;
  box-shadow: 0 0 0 4px rgba(240, 179, 58, 0.18);
}

.continent-0 {
  left: 43%;
  top: 28%;
}

.continent-1 {
  left: 21%;
  top: 49%;
}

.continent-2 {
  left: 50%;
  top: 57%;
}

.kingdom-cluster-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.kingdom-selectors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.kingdom-cluster-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.kingdom-cluster-card {
  display: grid;
  gap: 7px;
  min-height: 74px;
  padding: 10px;
  border: 1px solid rgba(220, 216, 207, 0.84);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.kingdom-cluster-card.selected {
  border-color: rgba(35, 103, 165, 0.52);
  box-shadow: 0 0 0 3px rgba(35, 103, 165, 0.1);
}

.kingdom-cluster-card.owned {
  background: #edf8f1;
  border-color: rgba(33, 132, 91, 0.32);
}

.kingdom-cluster-card span {
  font-weight: 900;
}

.kingdom-cluster-card strong {
  color: var(--blue);
}

.kingdom-map-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(35, 103, 165, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.18), transparent),
    #d8ead7;
}

.cluster-locked .kingdom-map-wrap {
  filter: saturate(0.72);
}

.cluster-locked .kingdom-map-wrap::after {
  content: "Кластер ожидает покупки";
  position: absolute;
  inset: auto 14px 14px;
  z-index: 6;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(20, 23, 31, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.kingdom-map {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  aspect-ratio: 8 / 6;
}

.kingdom-tile {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #17221d;
  cursor: pointer;
}

.kingdom-tile:disabled {
  cursor: default;
}

.terrain-mountain {
  background: linear-gradient(140deg, #879995, #e7edf0 52%, #718176);
}

.terrain-forest {
  background: linear-gradient(140deg, #2f7d57, #83bc78);
}

.terrain-field {
  background: linear-gradient(140deg, #c9b657, #e7d98a);
}

.terrain-plain {
  background: linear-gradient(140deg, #8fcb7c, #d4eab6);
}

.terrain-city {
  background: linear-gradient(140deg, #b4b8b8, #ece5d6);
}

.terrain-water {
  background: linear-gradient(140deg, #5ea6cf, #b2e0f1);
}

.kingdom-tile.has-building span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(20, 23, 31, 0.52);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  font-weight: 1000;
}

.kingdom-tile small {
  position: absolute;
  right: 6px;
  top: 5px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1f5f52;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.kingdom-tile.selected {
  z-index: 3;
  outline: 3px solid rgba(240, 179, 58, 0.72);
  outline-offset: -3px;
}

.kingdom-hero {
  position: absolute;
  left: calc((var(--hero-x, 3) + 0.5) * 12.5%);
  top: calc((var(--hero-y, 3) + 0.5) * 16.666%);
  z-index: 5;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2367a5;
  color: #fff;
  font-size: 11px;
  font-weight: 1000;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: 220ms ease;
}

.kingdom-hero.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.kingdom-resource-grid,
.kingdom-market-list,
.kingdom-log,
.kingdom-actions {
  display: grid;
  gap: 8px;
}

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

.kingdom-resource {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(220, 216, 207, 0.84);
  border-radius: 8px;
  background: #fff;
}

.kingdom-resource i {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e0d6;
}

.kingdom-resource i::before {
  content: "";
  display: block;
  width: var(--fill);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2367a5, #21845b);
}

.kingdom-market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(220, 216, 207, 0.84);
  border-radius: 8px;
  background: #fff;
}

.kingdom-market-row span {
  display: grid;
  gap: 2px;
}

.kingdom-selected {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(35, 103, 165, 0.18);
  border-radius: 8px;
  background: #fff;
}

.kingdom-selected-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

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

.kingdom-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.kingdom-log {
  max-height: 150px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(220, 216, 207, 0.84);
  border-radius: 8px;
  background: #fff;
}

.kingdom-log p {
  margin: 0;
  color: #4a505b;
  font-size: 12px;
}

.game-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.game-mode-grid article {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.xys-panel {
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.xys-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1.15fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(31, 95, 82, 0.22);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(20, 23, 31, 0.98), rgba(31, 95, 82, 0.94)),
    #14171f;
}

.xys-brand-card,
.xys-hero-copy {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.xys-logo {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 142px;
  min-width: 142px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(246, 213, 109, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(246, 213, 109, 0.16), rgba(142, 214, 220, 0.14)),
    rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
}

.xys-logo::after {
  position: absolute;
  right: 10px;
  bottom: 6px;
  content: "x1024";
  color: #f6d56d;
  font-size: 12px;
  font-weight: 900;
}

.xys-brand-card h2 {
  margin: 4px 0 3px;
  font-size: clamp(32px, 4.2vw, 56px);
  line-height: 0.96;
}

.xys-pronunciation,
.xys-hero-copy span {
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.45;
}

.xys-hero-copy {
  display: grid;
  align-content: center;
}

.xys-hero-copy strong {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.08;
}

.xys-metrics,
.xys-layout,
.xys-controls,
.xys-outcome-grid,
.xys-trader-grid {
  display: grid;
  gap: 12px;
}

.xys-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.xys-metrics article,
.xys-simulator,
.xys-rules,
.xys-trader-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
}

.xys-metrics article {
  display: grid;
  gap: 5px;
  min-height: 108px;
  padding: 14px;
}

.xys-metrics span,
.xys-metrics small,
.xys-rules li,
.xys-trader-card span {
  color: var(--muted);
}

.xys-metrics strong {
  font-size: 25px;
}

.xys-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  align-items: start;
}

.xys-simulator,
.xys-rules,
.xys-trader-card {
  padding: 14px;
}

.xys-controls {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  margin-bottom: 12px;
}

.xys-outcome-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.xys-outcome-grid article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(31, 95, 82, 0.16);
  border-radius: 8px;
  background: #fff;
}

.xys-outcome-grid span {
  color: var(--muted);
  font-size: 12px;
}

.xys-outcome-grid strong {
  color: #1f5f52;
  font-size: 24px;
}

.xys-table-wrap {
  max-height: 372px;
}

.xys-steps-table {
  min-width: 680px;
}

.xys-rules ol {
  display: grid;
  gap: 9px;
  margin: 0 0 12px;
  padding-left: 20px;
}

.xys-trader-section {
  display: grid;
  gap: 12px;
}

.xys-trader-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.xys-trader-card {
  display: grid;
  gap: 12px;
}

.xys-trader-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.xys-trader-head strong,
.xys-trader-head span {
  display: block;
}

.xys-trader-head strong {
  font-size: 16px;
}

.xys-trader-head span {
  margin-top: 4px;
  line-height: 1.35;
}

.xys-trader-stats {
  display: grid;
  gap: 7px;
}

.xys-trader-stats span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(220, 216, 207, 0.7);
  font-size: 12px;
}

.xys-trader-stats strong {
  color: #14171f;
  text-align: right;
  overflow-wrap: anywhere;
}

.strategy-panel {
  overflow: hidden;
}

.strategy-registry-panel {
  display: grid;
  gap: 16px;
}

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

.strategy-registry-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
}

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

.strategy-registry-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.strategy-registry-row:hover {
  border-color: rgba(36, 113, 85, 0.45);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}

.strategy-registry-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.strategy-registry-main strong,
.strategy-registry-main small,
.strategy-registry-main em {
  overflow-wrap: anywhere;
}

.strategy-registry-main small,
.strategy-registry-main em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.strategy-registry-main em {
  font-style: normal;
}

.strategy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.options-standalone-panel {
  scroll-margin-top: 24px;
}

.strategy-section-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.strategy-section-overview article {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.strategy-section-overview strong,
.strategy-section-overview span {
  display: block;
}

.strategy-section-overview span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.speculative-robot-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.speculative-robot-card {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.speculative-robot-card strong,
.speculative-robot-card span,
.speculative-robot-card small {
  display: block;
}

.speculative-robot-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.speculative-robot-card .robot-card-stats {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(30, 41, 59, 0.08);
  color: #1f5f52;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.speculative-robot-card.selected {
  border-color: #8c2d2d;
  box-shadow: 0 0 0 2px rgba(140, 45, 45, 0.12);
}

.speculative-robot-card.highlight {
  background: #fff8ef;
}

.strategy-tab {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
  cursor: pointer;
}

.strategy-tab.selected {
  color: #fff;
  border-color: #8c2d2d;
  background: #8c2d2d;
}

.strategy-tab:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.strategy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 16px;
}

.robot-message {
  color: var(--muted);
  font-size: 13px;
}

.strategy-view {
  display: none;
}

.strategy-view.active {
  display: block;
}

.orderbook-panel .strategy-table .ask-row {
  background: #fff1f2;
}

.orderbook-panel .strategy-table .bid-row {
  background: #ecfdf5;
}

.orderbook-panel .strategy-table .mid-row td {
  background: #f8fafc;
  color: #253044;
  text-align: center;
  font-weight: 800;
}

.orderbook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.orderbook-actions .is-paused {
  background: #8f2d2d;
  color: #fff;
}

.orderbook-terminal-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1.2fr) minmax(160px, 0.7fr);
  gap: 18px;
  align-items: center;
  margin: 12px 0 14px;
  padding: 18px;
  border: 1px solid #ebe7df;
  border-radius: 16px;
  background: #f4f2f7;
}

.orderbook-symbol-block,
.orderbook-price-block,
.orderbook-ohl {
  display: grid;
  gap: 6px;
}

.orderbook-symbol-block {
  grid-template-columns: 52px 1fr;
  align-items: center;
}

.orderbook-logo {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: #dff3f6;
  color: #1d5f77;
  font-weight: 900;
}

.orderbook-symbol-block strong {
  font-size: clamp(22px, 2.5vw, 34px);
}

.orderbook-symbol-block span,
.orderbook-ohl span {
  color: var(--muted);
}

.orderbook-price-block strong {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
}

.orderbook-price-block span {
  font-size: 22px;
  font-weight: 800;
}

.orderbook-price-block .positive,
.orderbook-price-block span.positive {
  color: #237b5f;
}

.orderbook-price-block .negative,
.orderbook-price-block span.negative {
  color: #b24a4a;
}

.orderbook-ohl {
  justify-items: end;
  font-size: 20px;
}

.orderbook-ohl strong {
  margin-left: 8px;
  color: #1f2937;
}

.orderbook-tabs {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  margin: 0 0 16px;
  padding-bottom: 2px;
}

.orderbook-tabs button {
  min-width: 108px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: #ebe9ef;
  color: #6b7280;
  text-align: center;
  font-size: 20px;
  font: inherit;
  cursor: pointer;
}

.orderbook-tabs button.active {
  background: #f4d5c7;
  color: #bf5b36;
}

.orderbook-tab-panel {
  display: none;
}

.orderbook-tab-panel.active {
  display: block;
}

.orderbook-chart-card {
  margin-bottom: 16px;
  border: 1px solid #e8e3dc;
  border-radius: 12px;
  background: #fff;
}

.orderbook-chart-card .risk-note {
  margin: 0;
  padding: 0 14px 14px;
}

.mini-chart {
  min-height: 260px;
  padding: 14px;
}

.mini-chart svg {
  width: 100%;
  height: 260px;
  display: block;
}

.pagination-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.orderbook-depth-shell {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #e8e3dc;
  border-radius: 12px;
  background: #fff;
}

.orderbook-depth-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.orderbook-depth-table th {
  padding: 12px 14px;
  background: #f5f4f8;
  color: #555b67;
  font-size: 13px;
  letter-spacing: 0;
}

.orderbook-depth-table th:first-child,
.orderbook-depth-table .bid-price {
  text-align: left;
}

.orderbook-depth-table th:last-child,
.orderbook-depth-table .ask-price {
  text-align: right;
}

.orderbook-depth-row td {
  position: relative;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid #f1f1f1;
  font-size: clamp(17px, 2vw, 26px);
  font-variant-numeric: tabular-nums;
  line-height: 40px;
}

.orderbook-depth-row .bid-volume,
.orderbook-depth-row .ask-volume {
  text-align: right;
}

.orderbook-depth-row .ask-volume {
  text-align: left;
}

.orderbook-depth-row strong {
  position: relative;
  z-index: 1;
  font-weight: 500;
}

.depth-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  opacity: 0.72;
  pointer-events: none;
}

.bid-volume .depth-bar {
  right: 0;
  background: #d9eee8;
}

.ask-volume .depth-bar {
  left: 0;
  background: #f8e0e2;
}

@media (max-width: 760px) {
  .orderbook-terminal-card {
    grid-template-columns: 1fr;
  }

  .orderbook-ohl {
    justify-items: start;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    font-size: 15px;
  }

  .orderbook-tabs button {
    min-width: 86px;
    font-size: 16px;
  }

  .orderbook-depth-row td {
    padding: 0 8px;
    font-size: 18px;
  }
}

.orderbook-panel .launch-preview {
  display: grid;
  gap: 6px;
}

.orderbook-panel .launch-preview span {
  color: var(--muted);
  line-height: 1.4;
}

.strategy-brief,
.strategy-controls,
.strategy-summary,
.probability-road,
.cascade-ladder {
  display: grid;
  gap: 12px;
}

.strategy-brief {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.strategy-brief div,
.strategy-summary article {
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f6f0;
}

.strategy-brief strong,
.strategy-brief span,
.strategy-summary span,
.strategy-summary strong {
  display: block;
}

.strategy-brief span,
.strategy-summary span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.strategy-controls {
  grid-template-columns: repeat(4, minmax(132px, 1fr));
  align-items: end;
  margin-bottom: 16px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field span,
.toggle-field small {
  color: var(--muted);
  font-size: 12px;
}

.form-field .condition-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.form-field input,
.form-field select,
.form-field textarea,
.cascade-input {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  outline: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.cascade-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 103, 165, 0.12);
}

.form-field textarea {
  min-height: 98px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.45;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.toggle-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-ui {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #c9c2b6;
  transition: background 0.2s ease;
}

.toggle-ui::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 23, 31, 0.18);
  content: "";
  transition: transform 0.2s ease;
}

.toggle-field input:checked + .toggle-ui {
  background: var(--green);
}

.toggle-field input:checked + .toggle-ui::after {
  transform: translateX(20px);
}

.strategy-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.strategy-summary.dashboard-risk-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.open-interest-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 12px;
  margin: 0 0 16px;
}

.open-interest-diagram-card {
  min-height: 190px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.open-interest-diagram {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

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

.open-interest-bar span,
.open-interest-net-card span,
.open-interest-net-card small,
.open-interest-empty {
  color: var(--muted);
  font-size: 12px;
}

.open-interest-track {
  position: relative;
  height: 24px;
  overflow: hidden;
  border-radius: 6px;
  background: #f3efe8;
}

.open-interest-fill {
  height: 100%;
  min-width: 2px;
  border-radius: 6px;
}

.open-interest-fill.long {
  background: rgba(31, 95, 82, 0.22);
}

.open-interest-fill.short {
  background: rgba(181, 65, 65, 0.2);
}

.open-interest-net-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  margin-top: 10px;
  padding: 16px;
  border-radius: 8px;
  background: #f8f6f0;
}

.open-interest-net-card strong {
  font-size: 30px;
  line-height: 1.1;
}

.robot-config-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.robot-config-pill {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.robot-config-pill strong,
.robot-config-pill span,
.robot-config-pill small {
  display: block;
}

.robot-config-pill span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.robot-config-pill small {
  margin-top: 6px;
  color: #1f5f52;
  font-weight: 800;
}

.robot-config-pill.selected {
  border-color: #8c2d2d;
  box-shadow: 0 0 0 2px rgba(140, 45, 45, 0.12);
}

.options-controls {
  grid-template-columns: repeat(4, minmax(132px, 1fr));
}

.options-summary {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.options-payoff-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
  margin: 14px 0 16px;
  overflow: hidden;
}

.options-payoff-canvas {
  display: block;
  width: 100%;
  height: 300px;
  max-width: 100%;
  background: linear-gradient(180deg, rgba(248, 251, 249, 0.98), rgba(239, 244, 241, 0.98));
  border: 1px solid rgba(22, 72, 58, 0.12);
  border-radius: 8px;
}

.news-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.backtest-status {
  align-self: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.backtest-summary strong {
  font-size: 16px;
}

.strategy-summary strong {
  margin-top: 8px;
  color: var(--ink);
  font-size: 22px;
}

.strategy-summary.backtest-summary strong {
  font-size: 16px;
  line-height: 1.25;
}

.strategy-table-wrap {
  margin-bottom: 16px;
}

.fixed-income-panel .strategy-controls {
  align-items: end;
}

.fixed-income-panel .wide-field {
  grid-column: 1 / -1;
}

.fixed-income-panel textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.fixed-income-actions {
  margin-top: 14px;
}

.fixed-income-table td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.deposits-panel {
  display: grid;
  gap: 16px;
}

.deposits-panel .strategy-controls {
  align-items: end;
}

.deposits-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.deposits-table td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.strategy-table {
  min-width: 820px;
}

.ghost-button,
.inline-link-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.ghost-button {
  min-height: 38px;
  padding: 0 12px;
}

.ghost-button:hover,
.inline-link-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.inline-link-button {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  text-align: left;
}

.arbitrage-live-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(35, 103, 165, 0.22);
  border-radius: 8px;
  background: #f7fafb;
}

.arbitrage-live-head,
.arbitrage-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.arbitrage-live-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.arbitrage-core-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.arbitrage-core-summary {
  margin: 0;
}

.arbitrage-core-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.arbitrage-core-grid section {
  min-width: 0;
}

.arbitrage-controls {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 0;
}

.correlation-live-panel .arbitrage-controls {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.arbitrage-live-toggle {
  background: #fff;
}

.arbitrage-pair-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.arbitrage-pair-settings article {
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.arbitrage-pair-settings article span,
.arbitrage-pair-settings article strong {
  display: block;
}

.arbitrage-pair-settings article span {
  color: var(--muted);
  font-size: 12px;
}

.arbitrage-pair-settings article strong {
  margin-top: 7px;
  font-size: 16px;
}

.arbitrage-controls article {
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.arbitrage-controls article span,
.arbitrage-chart-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.arbitrage-controls article strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.arbitrage-chart-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.arbitrage-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.arbitrage-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.arbitrage-chart-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.legend-spread {
  background: var(--blue);
}

.legend-fair {
  background: var(--green);
}

.legend-signal {
  background: #c54a3f;
}

.arbitrage-spread-chart,
.correlation-chart {
  min-height: 240px;
  margin-top: 10px;
  overflow: hidden;
}

.arbitrage-spread-chart svg,
.correlation-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.arb-chart-bg {
  fill: #f8f6f0;
}

.arb-chart-grid line {
  stroke: rgba(20, 23, 31, 0.1);
}

.arb-chart-grid text,
.arb-chart-axis {
  fill: var(--muted);
  font-size: 12px;
}

.arb-spread-line,
.arb-fair-line,
.arb-threshold-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arb-spread-line {
  stroke: var(--blue);
  stroke-width: 3;
}

.arb-fair-line {
  stroke: var(--green);
  stroke-width: 2;
  stroke-dasharray: 8 7;
}

.arb-threshold-line {
  stroke: rgba(197, 74, 63, 0.55);
  stroke-width: 1.5;
  stroke-dasharray: 5 7;
}

.arb-signal-points circle {
  fill: #c54a3f;
  stroke: #fff;
  stroke-width: 2;
}

.arb-chart-current {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.arbitrage-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.arbitrage-table {
  min-width: 1120px;
}

.correlation-table {
  min-width: 1280px;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.mini-check input {
  position: absolute;
  opacity: 0;
}

.mini-check span {
  display: block;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.mini-check input:checked + span {
  border-color: var(--green);
  background:
    linear-gradient(135deg, transparent 0 45%, #fff 46% 54%, transparent 55%),
    var(--green);
}

.compact-risk-note {
  margin: -2px 0 0;
}

.cascade-table {
  min-width: 1120px;
}

.options-table {
  min-width: 1080px;
}

.options-board-table {
  min-width: 1280px;
}

.options-board-table td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.option-atm-row {
  background: rgba(32, 111, 91, 0.08);
}

.option-atm-row td {
  border-top: 1px solid rgba(32, 111, 91, 0.24);
  border-bottom: 1px solid rgba(32, 111, 91, 0.24);
}

.news-lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
  margin-bottom: 16px;
}

.news-decision-panel,
.news-source-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.news-decision-steps,
.news-provider-grid {
  display: grid;
  gap: 10px;
}

.news-step,
.news-provider-card {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid rgba(35, 103, 165, 0.14);
  border-radius: 8px;
  background: #f8f6f0;
}

.news-provider-card {
  grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
  align-items: start;
}

.news-step strong,
.news-provider-card strong {
  color: var(--ink);
}

.news-step span,
.news-provider-card span,
.news-provider-card small {
  color: var(--muted);
  line-height: 1.45;
}

.news-provider-card small {
  max-width: 160px;
  text-align: right;
}

.news-robot-decision {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.news-robot-decision .badge {
  width: fit-content;
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}

.news-robot-decision small {
  color: var(--muted);
  line-height: 1.35;
}

.news-robot-urgent_trade small {
  color: #8c2d2d;
  font-weight: 800;
}

.cascade-input {
  min-width: 86px;
  background: #fff;
}

.cascade-direction {
  min-width: 92px;
}

.probability-cell {
  display: grid;
  gap: 6px;
  min-width: 120px;
}

.probability-bar {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e4da;
}

.probability-bar i {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.probability-road {
  grid-template-columns: repeat(10, minmax(82px, 1fr));
  margin-bottom: 12px;
}

.cascade-ladder {
  grid-template-columns: repeat(10, minmax(84px, 1fr));
  margin-bottom: 12px;
}

.optimizer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.value-controls {
  grid-template-columns: repeat(5, minmax(126px, 1fr));
}

.hedge-controls {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.value-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.hedge-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.value-table {
  min-width: 1180px;
}

.hedge-table {
  min-width: 1220px;
}

.hedge-playbook {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.value-table span {
  color: var(--muted);
  font-size: 12px;
}

.compound-road {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.compound-step {
  display: grid;
  gap: 5px;
  min-height: 88px;
  padding: 12px;
  border: 1px solid rgba(33, 132, 91, 0.28);
  border-radius: 8px;
  background: #f0fbf5;
}

.compound-step strong {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 12px;
}

.compound-step span {
  font-weight: 800;
}

.compound-step small {
  color: var(--muted);
}

.optimizer-card {
  display: grid;
  gap: 6px;
  min-height: 148px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.optimizer-card strong,
.optimizer-card span,
.optimizer-card small {
  display: block;
}

.optimizer-card span,
.optimizer-card small {
  color: var(--muted);
  font-size: 12px;
}

.value-channel-card {
  align-content: start;
}

.value-channel-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.value-channel-stats span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.value-channel-stats strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.value-channel-stats small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.road-step {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ladder-step {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ladder-step.reachable {
  border-color: rgba(33, 132, 91, 0.36);
  background: #f0fbf5;
}

.ladder-step strong,
.road-step strong {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--charcoal);
  font-size: 12px;
}

.ladder-step.reachable strong {
  background: var(--green);
}

.ladder-step span,
.road-step span {
  font-weight: 800;
}

.ladder-step small,
.road-step small,
.risk-note {
  color: var(--muted);
}

.risk-note {
  margin: 0;
  padding: 12px;
  border: 1px solid #efd2d2;
  border-radius: 8px;
  background: #fff7f7;
  line-height: 1.45;
}

.mission-panel p {
  margin: 0;
  color: #4a505b;
  line-height: 1.55;
}

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f4ef;
}

.segmented button {
  min-height: 32px;
  border: 0;
  background: transparent;
}

.segmented .selected {
  background: #fff;
  box-shadow: 0 4px 14px rgba(20, 23, 31, 0.1);
}

.robot-list,
.account-list,
.watchlist {
  display: grid;
  gap: 10px;
}

.robot-row,
.account-row,
.watch-row {
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-row.duplicate-capital-row {
  opacity: 0.68;
}

.account-row.duplicate-capital-row strong,
.account-row.duplicate-capital-row span {
  color: var(--muted);
}

.robot-title,
.watch-name {
  display: grid;
  gap: 4px;
}

.robot-title strong,
.account-row strong,
.watch-name strong {
  font-size: 14px;
}

.robot-meta {
  font-size: 12px;
}

.robot-pnl.positive,
.watch-price.positive {
  color: var(--green);
}

.robot-pnl.negative,
.watch-price.negative {
  color: var(--red);
}

.robot-pnl.neutral {
  color: var(--blue);
}

.trade-warning {
  display: block;
  color: #b45309;
  font-weight: 700;
}

.trading-desk-panel {
  display: grid;
  gap: 18px;
}

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

.trading-desk-grid.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.trade-reconciliation-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.strategy-journal-panel {
  margin-top: 18px;
  border: 1px solid rgba(19, 78, 74, 0.14);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.strategy-journal-summary {
  margin-top: 10px;
  margin-bottom: 10px;
}

.strategy-journal-table td,
.strategy-journal-table th {
  vertical-align: top;
}

.journal-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.1);
  color: #3730a3;
  font-size: 0.78rem;
  font-weight: 800;
}

.journal-status.positive {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.journal-status.warning {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.journal-status.negative {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.control-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.secondary-button.compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.secondary-button.micro {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1.1;
}

.mini-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  align-items: center;
}

.trading-desk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 14px;
  align-items: stretch;
}

.trading-equity-card,
.trading-agent-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.trading-equity-chart {
  min-height: 260px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f5ef 100%);
  overflow: hidden;
}

.trading-equity-chart svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: 260px;
}

.trading-agent-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.trading-agent-card h3,
.trading-agent-card ul {
  margin: 0;
}

.trading-agent-card ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  color: #4c5361;
  line-height: 1.45;
}

.agent-guardrail {
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf4f0;
  color: var(--green);
  font-weight: 800;
}

.trading-desk-tables {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.decision-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.decision-pill.approve {
  background: #e6f4ee;
  color: var(--green);
}

.decision-pill.watch {
  background: #edf3fb;
  color: var(--blue);
}

.decision-pill.reject {
  background: #f7e8e8;
  color: var(--red);
}

.committee-panel {
  display: grid;
  gap: 18px;
}

.committee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.committee-layout,
.committee-tables,
.committee-twin-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.committee-report-card,
.committee-risk-card,
.committee-agenda-item,
.committee-asset-card,
.committee-brief-card,
.committee-fact-card,
.committee-debate-card,
.committee-learning-card,
.committee-role-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.committee-report-card h3,
.committee-risk-card h3,
.committee-report-card p,
.committee-risk-card ul {
  margin: 0;
}

.committee-report-card,
.committee-risk-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.committee-directive {
  padding: 12px;
  border-radius: 8px;
  background: #edf4f0;
  color: #1f644c;
  font-weight: 800;
  line-height: 1.45;
}

.committee-risk-card ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  color: #4c5361;
  line-height: 1.45;
}

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

.committee-agenda-item {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.committee-agenda-item strong {
  font-size: 14px;
}

.committee-agenda-item span,
.committee-agenda-item small {
  color: var(--muted);
  font-size: 12px;
}

.committee-asset-section {
  display: grid;
  gap: 12px;
}

.committee-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.committee-asset-card {
  display: grid;
  gap: 8px;
  border-left: 4px solid #1f6d5a;
}

.committee-asset-card span,
.committee-asset-card small,
.committee-asset-card p,
.committee-asset-card em {
  margin: 0;
  color: #4c5361;
  line-height: 1.45;
  font-style: normal;
}

.committee-asset-card strong {
  font-size: 22px;
}

.committee-asset-card em {
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf4f0;
  color: #1f644c;
  font-weight: 800;
}

.committee-principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.committee-principles span {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  color: #4c5361;
  line-height: 1.45;
}

.committee-brief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.committee-evidence-grid,
.committee-learning-grid,
.committee-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.committee-debate-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.committee-brief-card,
.committee-fact-card,
.committee-debate-card,
.committee-learning-card,
.committee-role-card {
  display: grid;
  gap: 8px;
}

.committee-brief-card p,
.committee-brief-card small,
.committee-fact-card p,
.committee-fact-card small,
.committee-debate-card p,
.committee-debate-card small,
.committee-debate-card em,
.committee-learning-card p,
.committee-learning-card small,
.committee-learning-card em,
.committee-role-card p,
.committee-role-card small,
.committee-role-card em {
  margin: 0;
  color: #4c5361;
  line-height: 1.45;
  font-style: normal;
}

.committee-fact-card {
  border-left: 4px solid #9aa4b2;
}

.committee-fact-card.critical,
.committee-debate-card.veto {
  border-left-color: var(--red);
}

.committee-fact-card.high,
.committee-debate-card.challenge {
  border-left-color: #d99414;
}

.committee-fact-card span,
.committee-debate-card span,
.committee-learning-card span {
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf4f0;
  color: #1f644c;
  font-size: 11px;
  font-weight: 900;
}

.committee-debate-card > div,
.committee-learning-card > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.committee-debate-card em,
.committee-learning-card em,
.committee-role-card em {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.priority-pill.critical {
  background: #f7e8e8;
  color: var(--red);
}

.priority-pill.high {
  background: #fff2d8;
  color: #8a5c00;
}

.priority-pill.medium,
.priority-pill.low {
  background: #edf3fb;
  color: var(--blue);
}

.account-row span,
.watch-name span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.table-panel {
  overflow: hidden;
}

.table-wrap {
  position: relative;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

th {
  white-space: nowrap;
}

td {
  white-space: normal;
}

td strong,
td small,
td span {
  overflow-wrap: anywhere;
}

th {
  color: #3b404a;
  font-size: 12px;
  text-transform: uppercase;
}

td strong {
  color: var(--ink);
}

.ui-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(220, 216, 207, 0.82);
  border-radius: 8px;
  background: #fbfaf7;
  color: var(--muted);
  font-size: 12px;
}

.ui-pagination > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ui-pagination strong {
  color: var(--ink);
  white-space: nowrap;
}

.ui-pagination .secondary-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.ui-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 1320px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 38%);
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

@media (max-width: 1100px) {
  .dashboard-live-layout {
    grid-template-columns: 1fr;
  }

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

  .app-shell,
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    z-index: 80;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    height: auto;
    padding: 14px 18px;
    gap: 12px;
    overflow: hidden;
  }

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

  .nav-list {
    display: flex;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
  }

  .sidebar-footer {
    display: none;
  }

  #overviewSection,
  #riskBudgetSection,
  #speculativeStrategies,
  #valueStrategies,
  #hedgeFundStrategies,
  #analyticsSection,
  #robotsSection,
  #strategyRegistrySection,
  #holdingSection,
  #accountsSection,
  #cashflowSection,
  #marketsSection,
  #worldMarketsSection,
  #cryptoFocusCard,
  #xysSection,
  #tradingDeskSection,
  #committeeSection,
  #technicalControlSection,
  #technicalLogsSection,
  #gamesSection,
  #journalSection {
    scroll-margin-top: 122px;
  }

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

  .world-coverage-grid,
  .world-top-grid,
  .world-live-grid,
  .world-market-layout,
  .strategy-registry-grid,
  .favorite-dashboard-layout,
  .news-lab-layout,
  .game-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .world-chart-card.wide,
  .world-country-browser,
  .world-instrument-detail {
    grid-column: 1 / -1;
  }

  .instrument-search-result {
    grid-template-columns: minmax(0, 1fr) minmax(116px, auto);
  }

  .instrument-search-tags {
    grid-column: 1 / -1;
  }

  .world-instrument-detail {
    position: static;
  }

  .game-shell {
    grid-template-columns: 1fr;
  }

  .xys-hero,
  .xys-layout {
    grid-template-columns: 1fr;
  }

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

  .trading-desk-layout,
  .trading-desk-tables,
  .platform-account-split,
  .credit-match-layout,
  .committee-layout,
  .committee-tables,
  .committee-twin-section,
  .technical-two-column,
  .technical-log-controls {
    grid-template-columns: 1fr;
  }

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

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

  .xys-metrics,
  .xys-controls,
  .xys-outcome-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-brief,
  .strategy-summary,
  .news-summary,
  .options-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-controls,
  .news-controls,
  .options-controls,
  .value-controls,
  .hedge-controls,
  .arbitrage-pair-settings,
  .arbitrage-core-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .probability-road,
  .cascade-ladder,
  .optimizer-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }
}

@media (max-width: 720px) {
  .dashboard-strategy-tile-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-asset-summary,
  .dashboard-capital-chart-tools {
    grid-template-columns: 1fr;
  }

  .dashboard-asset-class-card {
    grid-column: auto;
  }

  .dashboard-capital-chart-tools button {
    flex: 1 1 150px;
    justify-content: center;
  }

  .dashboard-detail-summary {
    grid-template-columns: 1fr;
  }

  .dashboard-strategy-tile-head,
  .dashboard-strategy-tile-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace,
  .sidebar {
    padding: 14px;
  }

  .workspace {
    gap: 14px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .train-oracle {
    min-width: 0;
    height: 158px;
    --train-scale: 0.74;
  }

  .topbar,
  .risk-board {
    align-items: flex-start;
  }

  .topbar,
  .topbar-copy,
  .topbar-copy h1 {
    max-width: 100%;
  }

  .risk-board {
    display: grid;
  }

  .risk-ring {
    width: 132px;
    height: 132px;
  }

  .risk-ring span {
    font-size: 28px;
  }

  .panel-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .dashboard-grid,
  .world-coverage-grid,
  .world-top-grid,
  .world-live-grid,
  .world-market-layout,
  .strategy-registry-grid,
  .favorite-dashboard-layout,
  .news-lab-layout,
  .game-shell,
  .kingdom-planet-layout,
  .kingdom-stage-head,
  .kingdom-selectors,
  .kingdom-cluster-list,
  .kingdom-resource-grid,
  .kingdom-selected-grid,
  .kingdom-actions,
  .game-mode-grid,
  .xys-hero,
  .xys-metrics,
  .xys-layout,
  .xys-controls,
  .xys-outcome-grid,
  .xys-trader-grid,
  .world-megacap-grid,
  .instrument-detail-grid,
  .instrument-characteristics,
  .risk-details,
  .allocation-grid,
  .strategy-brief,
  .strategy-controls,
  .strategy-summary,
  .dashboard-strategy-totals,
  .news-controls,
  .news-summary,
  .options-controls,
  .options-summary,
  .value-controls,
  .value-summary,
  .hedge-controls,
  .hedge-summary,
  .arbitrage-pair-settings,
  .arbitrage-core-grid,
  .trading-desk-grid,
  .trading-desk-layout,
  .trading-desk-tables,
  .platform-account-split,
  .committee-grid,
  .committee-layout,
  .committee-tables,
  .committee-twin-section,
  .committee-agenda,
  .technical-status-grid,
  .technical-two-column,
  .technical-agent-grid,
  .technical-log-controls,
  .probability-road,
  .cascade-ladder,
  .optimizer-grid {
    grid-template-columns: 1fr;
  }

  .trading-equity-card,
  .trading-agent-card {
    padding: 12px;
  }

  .trading-equity-chart {
    overflow-x: auto;
  }

  .world-country-tree {
    max-height: none;
  }

  .workspace-tabs {
    gap: 6px;
    padding: 5px;
  }

  .workspace-tab {
    flex: 1 1 140px;
    min-height: 36px;
    padding: 8px 10px;
    text-align: center;
  }

  .personal-finance-summary,
  .personal-finance-grid,
  .personal-finance-grid.two-column,
  .personal-plan-grid,
  .credit-match-layout,
  .credit-match-balance-grid,
  .credit-match-inputs,
  .credit-match-result-grid {
    grid-template-columns: 1fr;
  }

  .credit-match-flow-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }

  .credit-match-flow-bar {
    height: 112px;
  }

  .finance-block-head {
    display: grid;
  }

  .finance-card strong {
    font-size: 20px;
  }

  .finance-chart {
    min-height: 120px;
  }

  .world-live-row {
    flex-wrap: wrap;
  }

  .world-live-row .sparkline {
    order: 5;
    flex-basis: 100%;
    width: 100%;
  }

  .world-live-metric {
    min-width: 84px;
  }

  .world-chart-card {
    min-height: auto;
  }

  .instrument-search-box,
  .instrument-search-result {
    grid-template-columns: 1fr;
  }

  .instrument-search-total {
    justify-self: start;
  }

  .instrument-search-results {
    max-height: 70vh;
  }

  .instrument-search-price {
    justify-items: start;
  }

  .trading-chart-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-timeframe-switcher {
    justify-content: flex-start;
    width: 100%;
  }

  .trading-chart-stage {
    min-height: 320px;
  }

  .trading-chart-canvas {
    height: 320px;
  }

  .trading-chart-shell.compact .trading-chart-stage {
    min-height: 300px;
  }

  .trading-chart-shell.compact .trading-chart-canvas {
    height: 300px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 40px 40px minmax(0, 1fr);
    justify-content: stretch;
    width: 100%;
  }

  .topbar-actions .primary-button {
    min-width: 0;
    padding-inline: 10px;
    white-space: normal;
    line-height: 1.12;
  }

  h1 {
    font-size: 23px;
    line-height: 1.08;
  }

  h2 {
    font-size: 18px;
  }

  .metric-card strong,
  .strategy-summary strong {
    font-size: 21px;
  }

  .strategy-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .speculative-robot-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .speculative-robot-card {
    flex: 0 0 280px;
  }

  .strategy-tab {
    flex: 0 0 auto;
  }

  .service-age-badge {
    right: auto;
    left: 10px;
    max-width: calc(100% - 20px);
    font-size: 9px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-actions .primary-button {
    font-size: 0;
  }

  .topbar-actions .primary-button::after {
    content: "+ Сценарий";
    font-size: 12px;
  }

  .xys-brand-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .xys-logo {
    width: 112px;
    min-width: 112px;
    height: 66px;
    font-size: 26px;
  }

  .xys-trader-head,
  .xys-trader-stats span {
    display: grid;
  }

  .xys-trader-stats strong {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .sidebar {
    padding: 12px;
  }

  .nav-item {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .workspace {
    padding: 12px;
  }

  .panel,
  .metric-card {
    padding: 12px;
  }

  .train-oracle {
    height: 148px;
    --train-scale: 0.68;
  }

  .train-wagon {
    padding-inline: 5px;
    height: 46px;
  }

  .train-wagon span {
    font-size: 10px;
  }

  .train-engine {
    width: 68px;
    height: 46px;
  }

  .topbar-actions {
    grid-template-columns: 38px 38px minmax(0, 1fr);
  }

  .topbar-actions .primary-button {
    font-size: 0;
  }

  .xys-hero {
    padding: 12px;
  }

  .xys-brand-card h2 {
    font-size: 34px;
  }

  h1 {
    font-size: 22px;
  }

  .xys-outcome-grid strong,
  .xys-metrics strong {
    font-size: 21px;
  }

  th,
  td {
    padding: 9px 8px;
  }

  .workspace-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-tab {
    flex-basis: auto;
  }

  .finance-table-wrap table {
    min-width: 620px;
  }
}

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
    max-width: 100vw;
  }

  .login-gate {
    align-items: start;
    padding: 12px;
    overflow-y: auto;
  }

  .login-card {
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100svh - 24px);
    margin: auto 0;
    padding: 18px;
    overflow-y: auto;
  }

  .login-card h1 {
    font-size: clamp(30px, 10vw, 44px);
    line-height: 1.03;
  }

  .sidebar {
    top: 0;
    max-height: none;
    overflow: hidden;
  }

  .brand {
    gap: 10px;
  }

  .nav-list {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .nav-item {
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .workspace {
    max-width: 100vw;
  }

  .panel,
  .metric-card,
  .embedded-platform-panel,
  .platform-account-panel,
  .world-chart-card,
  .world-instrument-detail {
    border-radius: 8px;
  }

  .table-wrap,
  .strategy-table-wrap,
  .xys-table-wrap,
  .trading-desk-table-wrap,
  .platform-account-table,
  .technical-log-table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 640px;
  }

  .panel-header .primary-button,
  .panel-header .secondary-button,
  .panel-header .ghost-button,
  .live-mandate-actions button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .login-card {
    gap: 14px;
    padding: 16px;
  }

  .login-card h1 {
    font-size: 30px;
  }

  .nav-item {
    min-height: 34px;
    padding-inline: 9px;
    font-size: 12px;
  }

  .train-engine {
    width: 64px;
  }

  table {
    min-width: 600px;
  }
}

/* Train scene physics refresh: grounded crossing, foreground sky/life, responsive header. */
.train-oracle {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 204, 111, var(--twilight-opacity)), transparent 45%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-low) 100%);
}

.service-age-badge,
.train-day-toast {
  z-index: 20;
}

.train-sky {
  z-index: 12;
  pointer-events: none;
}

.train-weather-layer {
  z-index: 13;
}

.scenery {
  left: -4%;
  z-index: 2;
  width: 112%;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  transform: translate3d(0, 0, 0) scale(1.04);
}

.scenery-mountains,
.scenery-city {
  bottom: 31px;
  height: 176px;
}

.scenery-forest,
.scenery-fields,
.scenery-sea {
  bottom: 31px;
  height: 154px;
}

.scenery-mountains,
.scenery-forest,
.scenery-fields,
.scenery-sea,
.scenery-city {
  animation-name: sceneryPhotoPanSmooth;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.scenery-mountains { animation-duration: 150s; }
.scenery-forest { animation-duration: 118s; }
.scenery-fields { animation-duration: 132s; }
.scenery-sea { animation-duration: 124s; }
.scenery-city { animation-duration: 146s; }

.train-live-layer {
  z-index: 14;
}

.bird-flock,
.sky-plane,
.sky-ufo {
  z-index: 2;
}

.sky-plane {
  transform-origin: center;
}

.sky-plane::before {
  clip-path: polygon(0 28%, 13% 12%, 76% 0, 100% 50%, 76% 100%, 13% 88%, 0 72%);
}

.pine-track {
  z-index: 5;
}

.rail-track {
  bottom: 21px;
  z-index: 7;
}

.level-crossing {
  right: 2%;
  bottom: 8px;
  left: auto;
  z-index: 10;
  width: 23%;
  min-width: 132px;
  height: 122px;
  opacity: 0;
  transform: translateZ(0);
}

.train-oracle[data-train-state="stopped"] .level-crossing {
  opacity: 1;
}

.crossing-road {
  right: auto;
  bottom: -4px;
  left: 55%;
  z-index: 1;
  width: 66px;
  height: 112px;
  border-radius: 18px 18px 7px 7px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0 3px, transparent 4px calc(100% - 4px), rgba(255, 255, 255, 0.72) calc(100% - 3px)),
    repeating-linear-gradient(180deg, transparent 0 12px, rgba(255, 255, 255, 0.68) 13px 22px, transparent 23px 36px),
    linear-gradient(90deg, #626a73 0%, #333943 48%, #5b636e 100%);
  box-shadow:
    inset 8px 0 0 rgba(255, 255, 255, 0.06),
    0 9px 15px rgba(20, 23, 31, 0.2);
  clip-path: polygon(34% 0, 66% 0, 100% 100%, 0 100%);
  transform: translateX(-50%) skewX(-6deg);
  transform-origin: bottom center;
}

.rail-signal {
  left: 12%;
  bottom: 36px;
  z-index: 6;
}

.crossing-post {
  bottom: 25px;
  z-index: 6;
}

.post-left {
  right: auto;
  left: 30%;
}

.post-right {
  right: 18%;
}

.barrier-arm {
  bottom: 77px;
  z-index: 7;
  width: 78px;
  transform-origin: 4px 50%;
}

.barrier-left {
  right: auto;
  left: 30%;
  transform: rotate(0deg);
}

.barrier-right {
  right: 18%;
  transform: rotate(180deg);
}

.road-car,
.crossing-moose {
  left: 55%;
  right: auto;
  z-index: 4;
  opacity: 0;
  transform-origin: center;
}

.road-car {
  bottom: 88px;
  transform: translateX(-50%) rotate(5deg) scale(var(--car-one-scale));
}

.car-two {
  left: 60%;
  transform: translateX(-50%) rotate(5deg) scale(var(--car-two-scale));
}

.car-three {
  left: 49%;
  transform: translateX(-50%) rotate(5deg) scale(var(--car-three-scale));
}

.car-four {
  left: 57%;
  transform: translateX(-50%) rotate(5deg) scale(var(--car-four-scale));
}

.train-oracle[data-train-state="stopped"] .car-one { animation: carCrossRoadOne 24s linear forwards; }
.train-oracle[data-train-state="stopped"] .car-two { animation: carCrossRoadTwo 24s linear forwards; }
.train-oracle[data-train-state="stopped"] .car-three { animation: carCrossRoadThree 24s linear forwards; }
.train-oracle[data-train-state="stopped"] .car-four { animation: carCrossRoadFour 24s linear forwards; }

.crossing-moose {
  position: absolute;
  bottom: 94px;
  width: 42px;
  height: 27px;
  filter: drop-shadow(0 4px 4px rgba(20, 23, 31, 0.22));
}

.crossing-moose::before {
  position: absolute;
  left: 7px;
  top: 9px;
  width: 27px;
  height: 13px;
  border-radius: 12px 11px 8px 8px;
  background: #7a5235;
  content: "";
}

.crossing-moose::after {
  position: absolute;
  right: 0;
  top: 5px;
  width: 14px;
  height: 13px;
  border-radius: 10px 9px 7px 7px;
  background:
    linear-gradient(90deg, transparent 0 32%, #b89262 33% 42%, transparent 43% 57%, #b89262 58% 67%, transparent 68%),
    #7a5235;
  content: "";
}

.crossing-moose i,
.crossing-moose i::before,
.crossing-moose i::after {
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 13px;
  border-radius: 2px;
  background: #533721;
  content: "";
}

.crossing-moose i {
  left: 12px;
}

.crossing-moose i::before {
  left: 9px;
}

.crossing-moose i::after {
  left: 18px;
}

.moose-two {
  left: 48%;
  transform: translateX(-50%) scale(0.78);
}

.train-oracle[data-train-state="stopped"] .moose-one { animation: mooseCrossRoadOne 24s linear forwards; }
.train-oracle[data-train-state="stopped"] .moose-two { animation: mooseCrossRoadTwo 24s linear forwards; }

.train-set {
  right: 26%;
  bottom: 36px;
  z-index: 9;
  width: 72%;
  gap: 6px;
  padding: 0;
  --train-scale: 0.97;
}

.train-engine {
  width: 112px;
  height: 58px;
}

.train-wagon {
  height: 58px;
  padding: 7px 8px 14px;
}

.train-wagon span {
  white-space: normal;
}

.profit-steam-layer {
  position: absolute;
  left: 16px;
  bottom: 58px;
  z-index: 5;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.profit-steam {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 3px 6px;
  border: 1px solid rgba(31, 109, 90, 0.22);
  border-radius: 999px;
  color: #1f6d5a;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 18px rgba(20, 23, 31, 0.12);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  animation: profitSteamRise 5.2s ease-out forwards;
}

.profit-steam.negative {
  color: #b84646;
  border-color: rgba(184, 70, 70, 0.24);
}

@keyframes sceneryPhotoPanSmooth {
  0% {
    transform: translate3d(0, 0, 0) scale(1.04);
  }
  100% {
    transform: translate3d(-4%, 0, 0) scale(1.04);
  }
}

@keyframes barrierLeftCycle {
  0%,
  10% {
    transform: rotate(0deg);
  }
  24%,
  74% {
    transform: rotate(-73deg);
  }
  88%,
  100% {
    transform: rotate(0deg);
  }
}

@keyframes barrierRightCycle {
  0%,
  10% {
    transform: rotate(180deg);
  }
  24%,
  74% {
    transform: rotate(253deg);
  }
  88%,
  100% {
    transform: rotate(180deg);
  }
}

@keyframes carCrossRoadOne {
  0%, 24% { opacity: 0; transform: translate(-50%, -16px) rotate(5deg) scale(var(--car-one-scale)); }
  31%, 58% { opacity: 1; }
  72%, 100% { opacity: 0; transform: translate(-50%, 116px) rotate(5deg) scale(var(--car-one-scale)); }
}

@keyframes carCrossRoadTwo {
  0%, 33% { opacity: 0; transform: translate(-50%, -14px) rotate(5deg) scale(var(--car-two-scale)); }
  41%, 66% { opacity: 1; }
  80%, 100% { opacity: 0; transform: translate(-50%, 116px) rotate(5deg) scale(var(--car-two-scale)); }
}

@keyframes carCrossRoadThree {
  0%, 44% { opacity: 0; transform: translate(-50%, -15px) rotate(5deg) scale(var(--car-three-scale)); }
  51%, 72% { opacity: 1; }
  86%, 100% { opacity: 0; transform: translate(-50%, 116px) rotate(5deg) scale(var(--car-three-scale)); }
}

@keyframes carCrossRoadFour {
  0%, 54% { opacity: 0; transform: translate(-50%, -16px) rotate(5deg) scale(var(--car-four-scale)); }
  61%, 78% { opacity: 1; }
  91%, 100% { opacity: 0; transform: translate(-50%, 116px) rotate(5deg) scale(var(--car-four-scale)); }
}

@keyframes mooseCrossRoadOne {
  0%, 63% { opacity: 0; transform: translate(-50%, -10px) scale(0.92); }
  68%, 82% { opacity: 1; }
  94%, 100% { opacity: 0; transform: translate(-50%, 95px) scale(0.92); }
}

@keyframes mooseCrossRoadTwo {
  0%, 70% { opacity: 0; transform: translate(-50%, -8px) scale(0.72); }
  75%, 86% { opacity: 1; }
  98%, 100% { opacity: 0; transform: translate(-50%, 90px) scale(0.72); }
}

@keyframes profitSteamRise {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.72);
  }
  16%,
  64% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--drift, 12px), -66px) scale(1.06);
  }
}

@media (max-width: 900px) {
  html,
  body,
  .app-shell,
  .workspace {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .train-oracle {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .dashboard-control-panel,
  .panel,
  .metric-card {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .train-oracle {
    height: 168px;
    --train-scale: 0.66;
  }

  .train-set {
    right: 25%;
    width: 75%;
    bottom: 34px;
    gap: 4px;
  }

  .train-engine {
    width: 72px;
    height: 48px;
  }

  .train-wagon {
    height: 48px;
    padding: 5px 5px 13px;
  }

  .train-wagon strong {
    font-size: 8px;
  }

  .train-wagon span {
    font-size: 9px;
    line-height: 1.06;
  }

  .engine-goal {
    right: 20px;
    font-size: 7px;
  }

  .level-crossing {
    right: 1%;
    width: 26%;
    min-width: 100px;
    transform: scale(0.86);
    transform-origin: right bottom;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scenery-mountains,
  .scenery-forest,
  .scenery-fields,
  .scenery-sea,
  .scenery-city,
  .level-crossing,
  .train-set,
  .road-car,
  .crossing-moose,
  .profit-steam {
    animation: none !important;
  }
}

/* 2026-05-15: wide cinematic train scene */
.topbar {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.topbar-brand-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 0;
  color: #14231f;
}

.topbar-brand-line strong {
  font-size: clamp(24px, 3.2vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

.topbar-brand-line span {
  font-size: 13px;
  font-weight: 800;
  color: #55706a;
  text-transform: uppercase;
}

.topbar-copy {
  max-width: 980px;
}

.train-oracle {
  justify-self: stretch;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: clamp(280px, 35vh, 430px);
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
  background: #dce9ed;
}

.train-oracle::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.1), rgba(6,18,28,0.18)),
    radial-gradient(circle at 76% 17%, rgba(255,236,154,0.34), transparent 20%);
  pointer-events: none;
}

.scenery {
  left: -12%;
  right: auto;
  bottom: 0;
  width: 134%;
  height: 100%;
  background-repeat: repeat-x;
  background-position: center bottom;
  background-size: auto 100%;
  transform: translateZ(0);
  animation: sceneryPhotoPanWide 185s linear infinite;
}

.scenery-mountains {
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(11,23,32,0.18)),
    url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?auto=format&fit=crop&w=1800&q=80");
}

.scenery-forest {
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(10,35,22,0.22)),
    url("https://images.unsplash.com/photo-1448375240586-882707db888b?auto=format&fit=crop&w=1800&q=80");
}

.scenery-fields {
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(88,83,28,0.18)),
    url("https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&w=1800&q=80");
}

.scenery-sea {
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(16,55,74,0.20)),
    url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1800&q=80");
}

.scenery-city {
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(6,15,28,0.36)),
    url("https://images.unsplash.com/photo-1514565131-fce0801e5785?auto=format&fit=crop&w=1800&q=80");
  filter: saturate(1.04) contrast(1.03);
}

.train-oracle[data-landscape="mountains"] .scenery-mountains,
.train-oracle[data-landscape="forest"] .scenery-forest,
.train-oracle[data-landscape="fields"] .scenery-fields,
.train-oracle[data-landscape="water"] .scenery-sea,
.train-oracle[data-landscape="city"] .scenery-city {
  opacity: 1;
  transform: translateZ(0) scale(1.02);
}

.train-oracle[data-phase="night"] .scenery-city::after {
  content: "";
  position: absolute;
  inset: 18% 0 18%;
  background-image:
    radial-gradient(circle, rgba(255,232,137,0.9) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(155,219,255,0.8) 0 1px, transparent 2px);
  background-size: 37px 31px, 53px 43px;
  opacity: 0.75;
  mix-blend-mode: screen;
  animation: cityLightsPulse 4.8s ease-in-out infinite;
}

.train-sky,
.train-weather-layer,
.train-live-layer {
  z-index: 7;
}

.train-weather-layer {
  inset: 0;
  opacity: 0;
  background: transparent;
  pointer-events: none;
}

.train-weather-layer::before,
.train-weather-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.train-oracle[data-weather="rain"] .train-weather-layer,
.train-oracle[data-weather="storm"] .train-weather-layer {
  opacity: 1;
}

.train-oracle[data-weather="rain"] .train-weather-layer::before,
.train-oracle[data-weather="storm"] .train-weather-layer::before {
  opacity: 1;
  background:
    radial-gradient(ellipse at 22% 20%, rgba(45,55,65,0.72), transparent 18%),
    radial-gradient(ellipse at 50% 16%, rgba(36,45,54,0.62), transparent 22%),
    radial-gradient(ellipse at 78% 22%, rgba(38,46,55,0.65), transparent 19%);
  filter: blur(2px);
  animation: stormCloudsDrift 28s linear infinite;
}

.train-oracle[data-weather="rain"] .train-weather-layer::after,
.train-oracle[data-weather="storm"] .train-weather-layer::after {
  opacity: 0.82;
  background-image:
    radial-gradient(circle, rgba(217,237,255,0.72) 0 1.5px, transparent 2.4px),
    radial-gradient(circle, rgba(217,237,255,0.48) 0 1px, transparent 2px);
  background-size: 32px 44px, 54px 70px;
  animation: rainDropsFall 0.74s linear infinite;
}

.train-oracle[data-weather="storm"] .train-weather-layer {
  background:
    linear-gradient(180deg, rgba(9,17,24,0.36), rgba(9,17,24,0.06)),
    radial-gradient(circle at 62% 20%, rgba(255,255,210,0.82) 0 2px, transparent 3px);
  animation: lightningFlash 6.5s steps(1) infinite;
}

.train-cloud {
  z-index: 8;
  animation-duration: 78s;
}

.level-crossing {
  right: 13%;
  bottom: 30px;
  width: 190px;
  height: 150px;
  z-index: 8;
  opacity: 0;
  transform: translateX(105vw);
  pointer-events: none;
}

.train-oracle[data-train-state="stopped"] .level-crossing {
  opacity: 1;
  transform: translateX(0);
  animation: none;
}

.train-oracle[data-train-state="departing"] .level-crossing {
  opacity: 1;
  animation: crossingDepartWide 11s linear forwards;
}

.crossing-road {
  left: 78px;
  bottom: -18px;
  width: 56px;
  height: 174px;
  transform: rotate(0deg) skewX(-8deg);
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.18) 0 2px, transparent 2px 9px, rgba(255,255,255,0.55) 9px 13px, transparent 13px),
    linear-gradient(180deg, #34393d, #4a4f52);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18), 0 16px 28px rgba(0,0,0,0.20);
}

.crossing-post.post-right,
.barrier-arm.barrier-right {
  display: none;
}

.crossing-post.post-left {
  left: 41px;
  bottom: 68px;
  width: 13px;
  height: 70px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #f8f3e7, #d5c7ad);
  box-shadow: 0 5px 12px rgba(0,0,0,0.23);
}

.barrier-arm.barrier-left {
  left: 49px;
  bottom: 117px;
  width: 110px;
  height: 10px;
  border-radius: 999px;
  transform-origin: 0 50%;
  transform: rotate(-72deg);
  background:
    repeating-linear-gradient(90deg, #f8f5ee 0 18px, #d7433d 18px 31px),
    #f8f5ee;
  box-shadow: 0 5px 12px rgba(0,0,0,0.24);
  animation: barrierSingleCycle 24s ease-in-out forwards;
}

.rail-signal {
  left: 26px;
  bottom: 132px;
}

.road-car {
  left: 106px;
  width: 34px;
  height: 20px;
  border-radius: 7px 7px 5px 5px;
  transform: translate(-50%, -22px) rotate(0deg);
}

.road-car::before,
.road-car::after {
  top: 15px;
}

.train-oracle[data-train-state="stopped"] .car-one { animation: carDriveStraightOne 24s linear forwards; }
.train-oracle[data-train-state="stopped"] .car-two { animation: carDriveStraightTwo 24s linear forwards; }
.train-oracle[data-train-state="stopped"] .car-three { animation: carDriveStraightThree 24s linear forwards; }
.train-oracle[data-train-state="stopped"] .car-four { animation: carDriveStraightFour 24s linear forwards; }

.crossing-moose {
  left: 108px;
}

.train-set {
  right: 20%;
  bottom: 50px;
  width: min(960px, 76%);
  min-width: 640px;
  gap: 8px;
  --train-scale: 1;
  z-index: 10;
}

.train-oracle[data-train-state="stopped"] .train-set {
  transform: translateX(-12px) scale(var(--train-scale));
}

.train-oracle[data-train-state="departing"] .train-set,
.train-oracle[data-train-state="moving"] .train-set {
  animation: trainRunWide 3.8s ease-in-out infinite;
}

.train-wagon {
  flex: 1 1 150px;
  height: 72px;
  padding: 9px 10px 17px;
  border-radius: 8px;
}

.train-engine {
  width: 150px;
  height: 74px;
  border-radius: 10px 28px 10px 10px;
}

.engine-cab {
  width: 58px;
  height: 54px;
}

.engine-stack {
  left: 24px;
  top: -20px;
  width: 18px;
  height: 26px;
}

.engine-goal {
  right: 28px;
  top: 19px;
  max-width: 92px;
  font-size: 11px;
  line-height: 1.05;
}

.rail-track {
  bottom: 36px;
  z-index: 9;
}

@keyframes sceneryPhotoPanWide {
  from { background-position-x: 0; }
  to { background-position-x: -1800px; }
}

@keyframes stormCloudsDrift {
  from { transform: translateX(-6%); }
  to { transform: translateX(9%); }
}

@keyframes rainDropsFall {
  from { background-position: 0 -70px, 0 -90px; }
  to { background-position: -18px 0, 16px 0; }
}

@keyframes lightningFlash {
  0%, 88%, 100% { filter: none; }
  89% { filter: brightness(1.45); }
  90% { filter: none; }
  91% { filter: brightness(1.75); }
  92% { filter: none; }
}

@keyframes barrierSingleCycle {
  0%, 11% { transform: rotate(-72deg); }
  24%, 78% { transform: rotate(0deg); }
  91%, 100% { transform: rotate(-72deg); }
}

@keyframes crossingDepartWide {
  0% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0.96; transform: translateX(-126vw); }
}

@keyframes carDriveStraightOne {
  0%, 24% { opacity: 0; transform: translate(-50%, -28px) rotate(0deg) scale(var(--car-one-scale)); }
  31%, 58% { opacity: 1; }
  72%, 100% { opacity: 0; transform: translate(-50%, 134px) rotate(0deg) scale(var(--car-one-scale)); }
}

@keyframes carDriveStraightTwo {
  0%, 33% { opacity: 0; transform: translate(-50%, -30px) rotate(0deg) scale(var(--car-two-scale)); }
  41%, 66% { opacity: 1; }
  80%, 100% { opacity: 0; transform: translate(-50%, 134px) rotate(0deg) scale(var(--car-two-scale)); }
}

@keyframes carDriveStraightThree {
  0%, 44% { opacity: 0; transform: translate(-50%, -30px) rotate(0deg) scale(var(--car-three-scale)); }
  51%, 72% { opacity: 1; }
  86%, 100% { opacity: 0; transform: translate(-50%, 134px) rotate(0deg) scale(var(--car-three-scale)); }
}

@keyframes carDriveStraightFour {
  0%, 54% { opacity: 0; transform: translate(-50%, -28px) rotate(0deg) scale(var(--car-four-scale)); }
  61%, 78% { opacity: 1; }
  91%, 100% { opacity: 0; transform: translate(-50%, 134px) rotate(0deg) scale(var(--car-four-scale)); }
}

@keyframes trainRunWide {
  0%, 100% { transform: translateX(0) scale(var(--train-scale)); }
  50% { transform: translateX(-5px) scale(var(--train-scale)); }
}

@keyframes cityLightsPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.9; }
}

.credit-closed-goal-card {
  border-color: rgba(31, 109, 90, 0.22);
  background: linear-gradient(180deg, rgba(232, 247, 240, 0.9), rgba(255, 255, 255, 0.92));
}

.credit-row-closed {
  background: rgba(232, 247, 240, 0.72);
}

.credit-row-closed td {
  color: #36514a;
}

.credit-prepay-comparison {
  display: grid;
  gap: 12px;
}

.credit-prepay-note {
  padding: 12px 14px;
  border: 1px solid rgba(31, 109, 90, 0.18);
  border-radius: 8px;
  color: #40524d;
  background: rgba(255,255,255,0.72);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .topbar-brand-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .train-oracle {
    height: 260px;
  }

  .train-set {
    min-width: 540px;
    right: 17%;
    width: 82%;
    --train-scale: 0.84;
  }
}

@media (max-width: 560px) {
  .train-oracle {
    height: 220px;
  }

  .train-set {
    min-width: 500px;
    right: 10%;
    bottom: 46px;
    --train-scale: 0.72;
  }

  .level-crossing {
    right: 4%;
    transform-origin: right bottom;
    scale: 0.82;
  }
}

/* Train cinematic physics pass: real photo scenery, grounded level crossing, straight road traffic. */
.train-oracle {
  --mountain-image: url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=2400&q=84");
  --forest-image: url("https://images.unsplash.com/photo-1448375240586-882707db888b?auto=format&fit=crop&w=2400&q=84");
  --field-image: url("https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&w=2400&q=84");
  --sea-image: url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=2400&q=84");
  --city-image: url("https://images.unsplash.com/photo-1514565131-fce0801e5785?auto=format&fit=crop&w=2400&q=84");
}

.train-oracle[data-city="moscow"] { --city-image: url("https://images.unsplash.com/photo-1513326738677-b964603b136d?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="amsterdam"] { --city-image: url("https://images.unsplash.com/photo-1512470876302-972faa2aa9a4?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="london"] { --city-image: url("https://images.unsplash.com/photo-1513635269975-59663e0ac1ad?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="paris"] { --city-image: url("https://images.unsplash.com/photo-1502602898657-3e91760cbb34?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="zurich"] { --city-image: url("https://images.unsplash.com/photo-1515488764276-beab7607c1e6?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="new-york"] { --city-image: url("https://images.unsplash.com/photo-1514565131-fce0801e5785?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="dubai"] { --city-image: url("https://images.unsplash.com/photo-1512453979798-5ea266f8880c?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="singapore"] { --city-image: url("https://images.unsplash.com/photo-1525625293386-3f8f99389edd?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="hong-kong"] { --city-image: url("https://images.unsplash.com/photo-1536599018102-9f803c140fc1?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="tokyo"] { --city-image: url("https://images.unsplash.com/photo-1540959733332-eab4deabeeaf?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="shanghai"] { --city-image: url("https://images.unsplash.com/photo-1548919973-5cef591cdbc9?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="great-wall"] { --city-image: url("https://images.unsplash.com/photo-1508804185872-d7badad00f7d?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="petra"] { --city-image: url("https://images.unsplash.com/photo-1579606032821-4e6161c81bd3?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="colosseum"] { --city-image: url("https://images.unsplash.com/photo-1552832230-c0197dd311b5?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="chichen-itza"] { --city-image: url("https://images.unsplash.com/photo-1518638150340-f706e86654de?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="machu-picchu"] { --city-image: url("https://images.unsplash.com/photo-1526392060635-9d6019884377?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="taj-mahal"] { --city-image: url("https://images.unsplash.com/photo-1564507592333-c60657eea523?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="christ-redeemer"] { --city-image: url("https://images.unsplash.com/photo-1483729558449-99ef09a8c325?auto=format&fit=crop&w=2400&q=84"); }
.train-oracle[data-city="great-pyramid"] { --city-image: url("https://images.unsplash.com/photo-1503177119275-0aa32b3a9368?auto=format&fit=crop&w=2400&q=84"); }

.train-oracle .scenery {
  inset: 0;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  transform: translate3d(0, 0, 0) scale(1.045);
  animation: sceneryPhotoCruiseSmooth 170s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

.train-oracle .scenery-mountains {
  background-image:
    linear-gradient(180deg, rgba(215, 236, 248, 0.12), rgba(13, 29, 43, 0.18) 72%, rgba(9, 19, 26, 0.28)),
    var(--mountain-image);
  filter: saturate(1.05) contrast(1.06);
}

.train-oracle .scenery-forest {
  background-image:
    linear-gradient(180deg, rgba(215, 236, 248, 0.08), rgba(16, 44, 32, 0.2) 76%, rgba(9, 24, 17, 0.28)),
    var(--forest-image);
  filter: saturate(1.08) contrast(1.04);
}

.train-oracle .scenery-fields {
  background-image:
    linear-gradient(180deg, rgba(215, 236, 248, 0.1), rgba(126, 103, 48, 0.14) 70%, rgba(48, 42, 22, 0.22)),
    var(--field-image);
  filter: saturate(1.06) contrast(1.02);
}

.train-oracle .scenery-sea {
  background-image:
    linear-gradient(180deg, rgba(215, 236, 248, 0.08), rgba(6, 67, 91, 0.18) 72%, rgba(5, 36, 55, 0.28)),
    var(--sea-image);
  filter: saturate(1.08) contrast(1.03);
}

.train-oracle .scenery-city {
  background-image:
    linear-gradient(180deg, rgba(215, 236, 248, 0.04), rgba(18, 24, 35, 0.12) 58%, rgba(8, 12, 18, 0.3)),
    var(--city-image);
  filter: saturate(1.06) contrast(1.05) brightness(var(--city-brightness, 1));
}

.train-oracle[data-landscape="mountains"] .scenery-mountains,
.train-oracle[data-landscape="forest"] .scenery-forest,
.train-oracle[data-landscape="fields"] .scenery-fields,
.train-oracle[data-landscape="water"] .scenery-sea,
.train-oracle[data-landscape="city"] .scenery-city {
  transform: translate3d(0, 0, 0) scale(1.045);
}

.train-oracle .train-sky,
.train-oracle .train-weather-layer,
.train-oracle .train-live-layer {
  z-index: 14;
}

.train-oracle .rail-track {
  bottom: 42px;
  z-index: 13;
}

.train-oracle .level-crossing {
  right: clamp(18px, 6vw, 110px);
  bottom: 36px;
  width: 248px;
  height: 172px;
  z-index: 12;
  opacity: 0;
  transform: translateX(108vw);
}

.train-oracle[data-train-state="stopped"] .level-crossing {
  opacity: 1;
  transform: translateX(0);
}

.train-oracle[data-train-state="departing"] .level-crossing {
  opacity: 1;
  animation: crossingDepartWide 11s linear forwards;
}

.train-oracle .crossing-road {
  left: 126px;
  right: auto;
  bottom: -2px;
  width: 92px;
  height: 154px;
  border-radius: 5px 5px 14px 14px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.86) 48% 52%, transparent 52%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0 16px, transparent 16px 34px),
    linear-gradient(90deg, #353a3d, #555d61 48%, #2b3134);
  background-size: 100% 100%, 8px 46px, 100% 100%;
  background-position: center, center 4px, center;
  box-shadow:
    inset 14px 0 18px rgba(0, 0, 0, 0.2),
    inset -14px 0 18px rgba(255, 255, 255, 0.08),
    0 18px 26px rgba(0, 0, 0, 0.24);
  clip-path: polygon(36% 0, 64% 0, 96% 100%, 4% 100%);
  transform: translateX(-50%) perspective(210px) rotateX(58deg);
  transform-origin: bottom center;
}

.train-oracle .crossing-road::before {
  content: "";
  position: absolute;
  left: -18px;
  right: -18px;
  bottom: 56px;
  height: 20px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.78) 0 18px, transparent 18px 34px);
  opacity: 0.72;
  transform: skewX(-8deg);
}

.train-oracle .crossing-post.post-right,
.train-oracle .barrier-arm.barrier-right {
  display: none;
}

.train-oracle .crossing-post.post-left {
  left: 48px;
  right: auto;
  bottom: 62px;
  height: 82px;
  z-index: 9;
}

.train-oracle .barrier-arm.barrier-left {
  left: 54px;
  bottom: 122px;
  width: 144px;
  height: 11px;
  transform-origin: 4px 50%;
  transform: rotate(0deg);
  border-radius: 999px;
  z-index: 10;
  animation: none;
}

.train-oracle[data-train-state="stopped"] .barrier-arm.barrier-left {
  animation: barrierSingleCycle 24s ease-in-out forwards;
}

.train-oracle[data-train-state="departing"] .barrier-arm.barrier-left,
.train-oracle[data-train-state="moving"] .barrier-arm.barrier-left {
  transform: rotate(0deg);
  animation: none;
}

.train-oracle .rail-signal {
  left: 18px;
  bottom: 130px;
  z-index: 10;
}

.train-oracle .road-car {
  left: 126px;
  bottom: 18px;
  width: 24px;
  height: 40px;
  border-radius: 9px 9px 6px 6px;
  z-index: 6;
  opacity: 0;
  transform: translate(-50%, 104px) scale(var(--car-one-scale));
  box-shadow: 0 6px 10px rgba(0,0,0,0.24);
}

.train-oracle .road-car i {
  left: 5px;
  right: 5px;
  top: 8px;
  height: 10px;
  border-radius: 4px;
  background: rgba(217, 241, 255, 0.88);
}

.train-oracle .road-car::before,
.train-oracle .road-car::after {
  top: 27px;
  width: 5px;
  height: 8px;
  border-radius: 2px;
  background: rgba(16, 19, 26, 0.92);
}

.train-oracle .road-car::before { left: -3px; }
.train-oracle .road-car::after { right: -3px; }

.train-oracle[data-train-state="stopped"] .car-one { animation: carDriveStraightOne 24s linear forwards; }
.train-oracle[data-train-state="stopped"] .car-two { animation: carDriveStraightTwo 24s linear forwards; }
.train-oracle[data-train-state="stopped"] .car-three { animation: carDriveStraightThree 24s linear forwards; }
.train-oracle[data-train-state="stopped"] .car-four { animation: carDriveStraightFour 24s linear forwards; }

.train-oracle[data-train-state="departing"] .road-car,
.train-oracle[data-train-state="moving"] .road-car {
  opacity: 0;
  animation: none;
}

.train-oracle .crossing-moose {
  left: 118px;
  bottom: 46px;
  z-index: 7;
  transform: translate(-50%, 58px) scale(0.64);
}

.train-oracle[data-train-state="departing"] .crossing-moose,
.train-oracle[data-train-state="moving"] .crossing-moose {
  opacity: 0;
  animation: none;
}

.train-oracle .train-set {
  right: clamp(150px, 22vw, 360px);
  bottom: 58px;
  width: min(1120px, 80%);
  min-width: 720px;
  gap: 10px;
  z-index: 13;
}

.train-oracle[data-train-state="stopped"] .train-set {
  transform: translateX(-42px) scale(var(--train-scale));
}

.train-oracle .train-wagon {
  flex: 1 1 170px;
}

.train-oracle .train-engine {
  width: 176px;
}

@keyframes sceneryPhotoCruiseSmooth {
  0% { transform: translate3d(-2.6%, 0, 0) scale(1.055); background-position: 42% bottom; }
  50% { transform: translate3d(1.8%, -0.4%, 0) scale(1.06); background-position: 56% bottom; }
  100% { transform: translate3d(4.2%, 0, 0) scale(1.055); background-position: 64% bottom; }
}

@keyframes barrierSingleCycle {
  0%, 12% { transform: rotate(0deg); }
  25%, 72% { transform: rotate(-72deg); }
  88%, 100% { transform: rotate(0deg); }
}

@keyframes carDriveStraightOne {
  0%, 25% { opacity: 0; transform: translate(-50%, 106px) scale(var(--car-one-scale)); }
  33%, 54% { opacity: 1; }
  70%, 100% { opacity: 0; transform: translate(-50%, -72px) scale(var(--car-one-scale)); }
}

@keyframes carDriveStraightTwo {
  0%, 34% { opacity: 0; transform: translate(-50%, 108px) scale(var(--car-two-scale)); }
  42%, 63% { opacity: 1; }
  78%, 100% { opacity: 0; transform: translate(-50%, -72px) scale(var(--car-two-scale)); }
}

@keyframes carDriveStraightThree {
  0%, 45% { opacity: 0; transform: translate(-50%, 108px) scale(var(--car-three-scale)); }
  53%, 72% { opacity: 1; }
  88%, 100% { opacity: 0; transform: translate(-50%, -72px) scale(var(--car-three-scale)); }
}

@keyframes carDriveStraightFour {
  0%, 54% { opacity: 0; transform: translate(-50%, 106px) scale(var(--car-four-scale)); }
  63%, 80% { opacity: 1; }
  94%, 100% { opacity: 0; transform: translate(-50%, -72px) scale(var(--car-four-scale)); }
}

@keyframes trainRunWide {
  0%, 100% { transform: translateX(0) scale(var(--train-scale)); }
  50% { transform: translateX(7px) scale(var(--train-scale)); }
}

@media (max-width: 900px) {
  .train-oracle .train-set {
    right: 16%;
    min-width: 570px;
    width: 88%;
    --train-scale: 0.84;
  }

  .train-oracle .level-crossing {
    right: 3%;
    scale: 0.86;
    transform-origin: right bottom;
  }
}

@media (max-width: 560px) {
  .train-oracle .train-set {
    right: 9%;
    min-width: 510px;
    width: 94%;
    bottom: 52px;
    --train-scale: 0.72;
  }

  .train-oracle .level-crossing {
    right: -5%;
    bottom: 30px;
    scale: 0.74;
  }
}

/* Mobile usability pass: tables become readable cards instead of desktop-width sheets. */
@media (max-width: 700px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
    width: 100%;
    max-width: 100vw;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 70;
    display: grid;
    gap: 10px;
    padding: 10px;
    max-height: 42svh;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

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

  .sidebar .brand span,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    margin: 0 -2px;
    padding: 0 2px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .workspace {
    width: 100%;
    max-width: 100vw;
    padding: 10px;
    gap: 12px;
  }

  .workspace-tabs,
  .topbar-actions,
  .panel-header,
  .finance-block-head,
  .dashboard-allocation-controls,
  .dashboard-allocation-limit-head,
  .dashboard-allocation-limit-values,
  .dashboard-trade-chart-controls,
  .dashboard-capital-chart-tools,
  .ui-pagination {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-tab,
  .panel-header button,
  .topbar-actions button,
  .dashboard-allocation-controls button,
  .dashboard-capital-chart-tools button,
  .ui-pagination button {
    width: 100%;
  }

  .dashboard-grid,
  .dashboard-risk-summary,
  .dashboard-asset-summary,
  .dashboard-strategy-tiles,
  .dashboard-strategy-totals,
  .dashboard-detail-summary,
  .strategy-summary.dashboard-risk-summary,
  .options-summary,
  .value-summary,
  .hedge-summary,
  .strategy-controls,
  .options-controls,
  .value-controls,
  .hedge-controls,
  .arbitrage-pair-settings,
  .arbitrage-core-grid,
  .personal-finance-summary,
  .personal-finance-grid,
  .personal-finance-grid.two-column,
  .credit-match-layout,
  .credit-match-inputs,
  .credit-match-result-grid,
  .committee-grid,
  .technical-status-grid,
  .platform-account-split,
  .favorite-dashboard-layout {
    grid-template-columns: 1fr !important;
  }

  .dashboard-asset-class-card,
  .dashboard-allocation-limit-card,
  .dashboard-strategy-card:has(.dashboard-strategy-detail:not([hidden])) {
    grid-column: auto;
  }

  .dashboard-allocation-plan-columns {
    grid-template-columns: 1fr;
  }

  .panel,
  .metric-card,
  .finance-block,
  .table-panel,
  .chart-card,
  .embedded-platform-panel,
  .platform-account-panel,
  .world-chart-card,
  .world-instrument-detail,
  .dashboard-capital-chart-card,
  .dashboard-robots-card,
  .dashboard-open-positions-card {
    max-width: 100%;
    padding: 12px;
    border-radius: 8px;
    overflow: hidden;
  }

  .table-wrap,
  .strategy-table-wrap,
  .finance-table-wrap,
  .xys-table-wrap,
  .trading-desk-table-wrap,
  .platform-account-table,
  .technical-log-table,
  .dashboard-detail-chart,
  .dashboard-capital-chart-wrap {
    max-width: 100%;
    overflow-x: visible;
  }

  table,
  .finance-table-wrap table,
  .strategy-table,
  .dashboard-open-positions-table,
  .dashboard-detail-table,
  .technical-process-table,
  .technical-repair-table,
  .technical-log-table,
  .xys-steps-table,
  .fixed-income-table,
  .deposits-table,
  .arbitrage-table,
  .correlation-table,
  .cascade-table,
  .options-table,
  .options-board-table,
  .value-table,
  .hedge-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    border-spacing: 0;
  }

  thead,
  table colgroup {
    display: none;
  }

  tbody,
  tr,
  td,
  th {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tbody tr {
    padding: 8px 10px;
    border: 1px solid rgba(220, 216, 207, 0.92);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 20px rgba(20, 23, 31, 0.04);
  }

  td,
  th {
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid rgba(220, 216, 207, 0.62);
    text-align: left;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  td:last-child,
  th:last-child {
    border-bottom: 0;
  }

  td[data-label],
  th[data-label] {
    display: grid;
    grid-template-columns: minmax(92px, 42%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  td[data-label]::before,
  th[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    text-align: left;
  }

  td[data-mobile-empty="true"],
  td[colspan] {
    display: block;
    color: var(--muted);
    text-align: left;
  }

  td[data-mobile-empty="true"]::before,
  td[colspan]::before {
    content: none;
  }

  .dashboard-capital-chart svg,
  .dashboard-detail-chart svg,
  .trading-equity-chart svg,
  .arbitrage-chart svg,
  .correlation-chart svg {
    min-width: 0 !important;
    width: 100%;
  }

  .dashboard-trade-chart-stage,
  .dashboard-trade-chart-stage .trading-chart-canvas,
  .trading-chart-stage,
  .trading-chart-canvas {
    min-height: 260px;
    height: 260px;
  }

  .dashboard-asset-class-pill {
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
  }

  .dashboard-asset-class-pill strong,
  .dashboard-asset-class-pill small {
    white-space: normal;
  }

  .ui-pagination > div {
    justify-content: stretch;
  }
}

@media (max-width: 420px) {
  .workspace {
    padding: 8px;
  }

  .panel,
  .metric-card,
  .finance-block,
  .table-panel,
  .chart-card {
    padding: 10px;
  }

  td[data-label],
  th[data-label] {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  td[data-label]::before,
  th[data-label]::before {
    font-size: 10px;
  }
}

/* 2026-05-17: final desktop guard for photo scenery in the train animation. */
.train-oracle {
  --mountain-image: url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?auto=format&fit=crop&w=1800&q=82");
  --forest-image: url("https://images.unsplash.com/photo-1448375240586-882707db888b?auto=format&fit=crop&w=1800&q=82");
  --field-image: url("https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&w=1800&q=82");
  --sea-image: url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1800&q=82");
  --city-image: url("https://images.unsplash.com/photo-1514565131-fce0801e5785?auto=format&fit=crop&w=1800&q=82");
}

.train-oracle[data-city="moscow"] { --city-image: url("https://images.unsplash.com/photo-1513326738677-b964603b136d?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="amsterdam"] { --city-image: url("https://images.unsplash.com/photo-1512470876302-972faa2aa9a4?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="london"] { --city-image: url("https://images.unsplash.com/photo-1513635269975-59663e0ac1ad?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="paris"] { --city-image: url("https://images.unsplash.com/photo-1502602898657-3e91760cbb34?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="zurich"] { --city-image: url("https://images.unsplash.com/photo-1515488764276-beab7607c1e6?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="new-york"] { --city-image: url("https://images.unsplash.com/photo-1514565131-fce0801e5785?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="dubai"] { --city-image: url("https://images.unsplash.com/photo-1512453979798-5ea266f8880c?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="singapore"] { --city-image: url("https://images.unsplash.com/photo-1525625293386-3f8f99389edd?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="hong-kong"] { --city-image: url("https://images.unsplash.com/photo-1536599018102-9f803c140fc1?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="tokyo"] { --city-image: url("https://images.unsplash.com/photo-1540959733332-eab4deabeeaf?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="shanghai"] { --city-image: url("https://images.unsplash.com/photo-1548919973-5cef591cdbc9?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="great-wall"] { --city-image: url("https://images.unsplash.com/photo-1508804185872-d7badad00f7d?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="petra"] { --city-image: url("https://images.unsplash.com/photo-1579606032821-4e6161c81bd3?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="colosseum"] { --city-image: url("https://images.unsplash.com/photo-1552832230-c0197dd311b5?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="chichen-itza"] { --city-image: url("https://images.unsplash.com/photo-1518638150340-f706e86654de?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="machu-picchu"] { --city-image: url("https://images.unsplash.com/photo-1526392060635-9d6019884377?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="taj-mahal"] { --city-image: url("https://images.unsplash.com/photo-1564507592333-c60657eea523?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="christ-redeemer"] { --city-image: url("https://images.unsplash.com/photo-1483729558449-99ef09a8c325?auto=format&fit=crop&w=1800&q=82"); }
.train-oracle[data-city="great-pyramid"] { --city-image: url("https://images.unsplash.com/photo-1503177119275-0aa32b3a9368?auto=format&fit=crop&w=1800&q=82"); }

.train-oracle .scenery {
  position: absolute;
  inset: -5% -7% 0 -7%;
  width: auto;
  height: 110%;
  z-index: 2;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-color: #dce9ed;
  background-blend-mode: normal;
  mix-blend-mode: normal;
  transform-origin: center bottom;
  animation: sceneryPhotoDesktopCruise 170s ease-in-out infinite alternate;
  transition: opacity 4.5s ease, filter 4.5s ease;
}

.train-oracle .scenery-mountains {
  opacity: var(--mountain-opacity, 0.82);
  background-image:
    linear-gradient(180deg, rgba(225, 242, 250, 0.1), rgba(22, 45, 58, 0.2) 70%, rgba(12, 24, 29, 0.34)),
    var(--mountain-image),
    linear-gradient(180deg, #bcd8e8, #6e8f9f 58%, #334a45);
  filter: saturate(1.08) contrast(1.06);
}

.train-oracle .scenery-forest {
  opacity: var(--forest-opacity, 0);
  background-image:
    linear-gradient(180deg, rgba(225, 242, 250, 0.08), rgba(14, 50, 32, 0.2) 74%, rgba(7, 24, 16, 0.36)),
    var(--forest-image),
    linear-gradient(180deg, #a7d0b4, #38704b 56%, #152b1e);
  filter: saturate(1.08) contrast(1.05);
}

.train-oracle .scenery-fields {
  opacity: var(--field-opacity, 0);
  background-image:
    linear-gradient(180deg, rgba(225, 242, 250, 0.08), rgba(142, 112, 44, 0.16) 74%, rgba(58, 43, 18, 0.3)),
    var(--field-image),
    linear-gradient(180deg, #c8df89, #d8b84e 54%, #6f7a31);
  filter: saturate(1.06) contrast(1.03);
}

.train-oracle .scenery-sea {
  opacity: var(--sea-opacity, 0);
  background-image:
    linear-gradient(180deg, rgba(225, 242, 250, 0.08), rgba(5, 73, 104, 0.18) 72%, rgba(4, 33, 56, 0.34)),
    var(--sea-image),
    linear-gradient(180deg, #9ed8eb, #2d91b5 56%, #0d4664);
  filter: saturate(1.1) contrast(1.04);
}

.train-oracle .scenery-city {
  opacity: var(--city-opacity, 0);
  background-image:
    linear-gradient(180deg, rgba(225, 242, 250, 0.04), rgba(18, 24, 35, 0.12) 58%, rgba(8, 12, 18, 0.3)),
    var(--city-image),
    linear-gradient(180deg, #9eb6cf, #4f6578 56%, #1b2530);
  background-position: center center, var(--city-focus, center center), center center;
  filter: saturate(1.08) contrast(1.06) brightness(var(--city-brightness, 1));
}

.train-oracle .train-sky {
  z-index: 6;
  pointer-events: none;
}

.train-oracle .train-weather-layer {
  z-index: 11;
}

.train-oracle .train-live-layer {
  z-index: 12;
}

.train-oracle .rail-track {
  z-index: 16;
}

.train-oracle .level-crossing {
  z-index: 17;
}

.train-oracle .train-set {
  z-index: 18;
}

@keyframes sceneryPhotoDesktopCruise {
  0% {
    background-position: center center, 44% center, center center;
    transform: translate3d(-1.5%, 0, 0) scale(1.06);
  }

  50% {
    background-position: center center, 50% center, center center;
  }

  100% {
    background-position: center center, 58% center, center center;
    transform: translate3d(1.5%, 0, 0) scale(1.06);
  }
}

@media (max-width: 700px) {
  .train-oracle .scenery {
    inset: -7% -10% 0 -10%;
    height: 114%;
    animation-duration: 140s;
  }
}

/* 2026-05-17: authoritative train visual repair.
   Keeps desktop photo scenery visible and grounds rails/crossing on one plane. */
.train-oracle {
  --train-floor-y: 56px;
  --train-track-y: 51px;
  --train-body-y: 74px;
  --crossing-x: clamp(122px, 19vw, 246px);
  background:
    linear-gradient(180deg, rgba(253, 239, 196, calc(var(--twilight-opacity) * 0.42)), transparent 38%),
    linear-gradient(180deg, #9fc7df 0%, #d7e9ef 54%, #889b72 55%, #41543c 100%) !important;
}

.train-oracle::before {
  position: absolute;
  inset: auto 0 0;
  z-index: 8;
  height: calc(var(--train-floor-y) + 30px);
  background:
    linear-gradient(180deg, rgba(76, 88, 63, 0) 0, rgba(76, 88, 63, 0.88) 24px, rgba(31, 39, 34, 0.96) 100%),
    repeating-linear-gradient(90deg, rgba(211, 180, 120, 0.22) 0 42px, rgba(62, 49, 36, 0.26) 43px 78px),
    linear-gradient(180deg, #6d744a, #283327);
  box-shadow: inset 0 18px 28px rgba(255, 255, 255, 0.12);
  content: "";
  pointer-events: none;
}

.train-oracle::after {
  z-index: 7 !important;
  background:
    linear-gradient(180deg, rgba(8, 14, 36, calc(var(--night-overlay) * 0.58)), rgba(13, 24, 52, calc(var(--night-soft) * 0.44))),
    radial-gradient(circle at 25% 18%, rgba(255, 238, 181, calc(var(--twilight-opacity) * 0.5)), transparent 30%) !important;
  pointer-events: none;
}

.train-oracle .scenery {
  inset: -7% -10% 0 -10% !important;
  z-index: 2 !important;
  width: auto !important;
  height: 118% !important;
  opacity: 0 !important;
  background-repeat: no-repeat !important;
  background-position: center bottom !important;
  background-size: cover !important;
  transform: translate3d(0, 0, 0) scale(1.07) !important;
  animation: sceneryPhotoDesktopPass 190s ease-in-out infinite alternate !important;
  filter: saturate(1.08) contrast(1.05);
  transition: opacity 2.8s ease, filter 2.8s ease;
}

.train-oracle .scenery-mountains {
  background-image:
    linear-gradient(180deg, rgba(239, 248, 255, 0.12), rgba(17, 34, 45, 0.16) 64%, rgba(11, 21, 26, 0.3) 88%),
    var(--mountain-image),
    radial-gradient(ellipse at 44% 39%, #f4f7f6 0 9%, transparent 10%),
    linear-gradient(140deg, transparent 0 23%, #718a95 24% 38%, #f5f8f7 39% 42%, #3d5863 43% 55%, transparent 56%),
    linear-gradient(180deg, #b9d7e8 0%, #58727c 58%, #2c4b43 100%) !important;
}

.train-oracle .scenery-forest {
  background-image:
    linear-gradient(180deg, rgba(233, 247, 238, 0.08), rgba(10, 44, 28, 0.18) 68%, rgba(7, 22, 14, 0.34)),
    var(--forest-image),
    repeating-linear-gradient(78deg, #1d5c3a 0 14px, #143a28 14px 28px, #2c7047 28px 40px),
    linear-gradient(180deg, #9fc99e, #245d3b 62%, #12311f) !important;
}

.train-oracle .scenery-fields {
  background-image:
    linear-gradient(180deg, rgba(243, 250, 224, 0.1), rgba(119, 91, 34, 0.12) 69%, rgba(50, 38, 18, 0.26)),
    var(--field-image),
    repeating-linear-gradient(90deg, #d6bf58 0 84px, #8dbd65 85px 164px, #c99b46 165px 238px),
    linear-gradient(180deg, #cfe693, #d5b557 56%, #607d39) !important;
}

.train-oracle .scenery-sea {
  background-image:
    linear-gradient(180deg, rgba(233, 247, 255, 0.08), rgba(11, 76, 106, 0.16) 72%, rgba(7, 34, 57, 0.32)),
    var(--sea-image),
    radial-gradient(ellipse at 50% 78%, rgba(255, 255, 255, 0.42) 0 7%, transparent 8%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.14) 0 3px, transparent 4px 15px),
    linear-gradient(180deg, #93d3e4, #2d92b7 57%, #0e4967) !important;
}

.train-oracle .scenery-city {
  background-image:
    linear-gradient(180deg, rgba(236, 244, 255, 0.04), rgba(18, 24, 35, 0.1) 54%, rgba(8, 12, 18, 0.3)),
    var(--city-image),
    repeating-linear-gradient(90deg, #2d3d4d 0 30px, #435a6a 31px 48px, #1f2b39 49px 70px),
    linear-gradient(180deg, #9eb6cf, #526678 58%, #172431) !important;
  background-position: center bottom, var(--city-focus, center bottom), center bottom, center bottom !important;
}

.train-oracle:not([data-landscape]) .scenery-mountains,
.train-oracle[data-landscape="mountains"] .scenery-mountains,
.train-oracle[data-landscape="forest"] .scenery-forest,
.train-oracle[data-landscape="fields"] .scenery-fields,
.train-oracle[data-landscape="water"] .scenery-sea,
.train-oracle[data-landscape="city"] .scenery-city {
  opacity: 0.96 !important;
}

.train-oracle[data-phase="night"] .scenery {
  filter: saturate(1.02) contrast(1.08) brightness(0.76);
}

.train-oracle[data-phase="night"] .scenery-city {
  filter: saturate(1.08) contrast(1.14) brightness(0.82);
}

.train-oracle .train-sky {
  inset: 0 !important;
  z-index: 10 !important;
  background: transparent !important;
  pointer-events: none;
}

.train-oracle .train-stars,
.train-oracle .train-sun,
.train-oracle .train-moon,
.train-oracle .train-cloud {
  z-index: 11;
}

.train-oracle .train-weather-layer {
  z-index: 13 !important;
  background: transparent !important;
}

.train-oracle[data-weather="rain"] .train-weather-layer,
.train-oracle[data-weather="storm"] .train-weather-layer {
  background: transparent !important;
  animation: none !important;
}

.train-oracle .train-live-layer {
  z-index: 14 !important;
}

.train-oracle .pine-track {
  bottom: calc(var(--train-track-y) + 8px) !important;
  z-index: 12 !important;
  opacity: 0.82;
}

.train-oracle .rail-track {
  bottom: var(--train-track-y) !important;
  z-index: 20 !important;
  height: 26px !important;
  background:
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(132, 97, 62, 0.9) 25px 34px, transparent 35px 58px),
    linear-gradient(180deg, rgba(53, 58, 62, 0.96) 0 4px, transparent 5px 11px, rgba(43, 49, 54, 0.98) 12px 16px, transparent 17px),
    linear-gradient(180deg, rgba(104, 86, 66, 0.72), rgba(39, 35, 30, 0.86)) !important;
  box-shadow:
    0 7px 0 rgba(21, 25, 27, 0.34),
    0 14px 18px rgba(10, 15, 20, 0.32) !important;
  filter: none !important;
}

.train-oracle .rail-track::before,
.train-oracle .rail-track::after {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #69727a, #252b31);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16);
  content: "";
}

.train-oracle .rail-track::before {
  top: 5px;
}

.train-oracle .rail-track::after {
  top: 16px;
}

.train-oracle .train-set {
  right: clamp(170px, 24vw, 390px) !important;
  bottom: var(--train-body-y) !important;
  z-index: 24 !important;
  width: min(1240px, 86%) !important;
  min-width: 780px !important;
  gap: 11px !important;
}

.train-oracle .train-wagon {
  min-height: 62px;
}

.train-oracle .train-engine {
  height: 64px;
  width: 196px !important;
}

.train-oracle .level-crossing {
  right: clamp(38px, 7vw, 132px) !important;
  bottom: calc(var(--train-track-y) - 36px) !important;
  z-index: 22 !important;
  width: 270px !important;
  height: 194px !important;
  transform-origin: center bottom;
}

.train-oracle .crossing-road {
  left: var(--crossing-x) !important;
  bottom: -8px !important;
  z-index: 1 !important;
  width: 96px !important;
  height: 176px !important;
  border-radius: 4px 4px 18px 18px !important;
  background:
    linear-gradient(90deg, transparent 47%, rgba(255, 255, 255, 0.9) 48% 52%, transparent 53%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0 18px, transparent 19px 42px),
    linear-gradient(90deg, #3c4248, #596269 48%, #2e343a) !important;
  background-size: 100% 100%, 8px 52px, 100% 100% !important;
  clip-path: polygon(39% 0, 61% 0, 98% 100%, 2% 100%) !important;
  transform: translateX(-50%) perspective(280px) rotateX(61deg) !important;
  transform-origin: bottom center !important;
}

.train-oracle .rail-signal {
  left: calc(var(--crossing-x) - 118px) !important;
  bottom: 122px !important;
  z-index: 23 !important;
}

.train-oracle .crossing-post.post-left {
  left: calc(var(--crossing-x) - 86px) !important;
  bottom: 64px !important;
  z-index: 24 !important;
}

.train-oracle .barrier-arm.barrier-left {
  left: calc(var(--crossing-x) - 80px) !important;
  bottom: 126px !important;
  z-index: 25 !important;
  width: 156px !important;
  transform-origin: 5px 50% !important;
}

.train-oracle .road-car {
  left: var(--crossing-x) !important;
  bottom: 22px !important;
  z-index: 23 !important;
  width: 25px !important;
  height: 42px !important;
  border-radius: 9px 9px 6px 6px !important;
  transform: translate(-50%, 118px) scale(var(--car-one-scale)) !important;
}

.train-oracle[data-train-state="stopped"] .car-one { animation: trainRoadCarForwardOne 24s linear forwards !important; }
.train-oracle[data-train-state="stopped"] .car-two { animation: trainRoadCarForwardTwo 24s linear forwards !important; }
.train-oracle[data-train-state="stopped"] .car-three { animation: trainRoadCarForwardThree 24s linear forwards !important; }
.train-oracle[data-train-state="stopped"] .car-four { animation: trainRoadCarForwardFour 24s linear forwards !important; }

@keyframes sceneryPhotoDesktopPass {
  0% {
    background-position: center bottom, 40% bottom, center bottom, center bottom, center bottom;
    transform: translate3d(-2.2%, 0, 0) scale(1.07);
  }
  50% {
    background-position: center bottom, 51% bottom, center bottom, center bottom, center bottom;
    transform: translate3d(0.8%, -0.4%, 0) scale(1.075);
  }
  100% {
    background-position: center bottom, 62% bottom, center bottom, center bottom, center bottom;
    transform: translate3d(3.4%, 0, 0) scale(1.07);
  }
}

@keyframes trainRoadCarForwardOne {
  0%, 23% { opacity: 0; transform: translate(-50%, 130px) scale(var(--car-one-scale)); }
  31%, 58% { opacity: 1; }
  76%, 100% { opacity: 0; transform: translate(-50%, -96px) scale(var(--car-one-scale)); }
}

@keyframes trainRoadCarForwardTwo {
  0%, 32% { opacity: 0; transform: translate(-50%, 132px) scale(var(--car-two-scale)); }
  40%, 64% { opacity: 1; }
  82%, 100% { opacity: 0; transform: translate(-50%, -96px) scale(var(--car-two-scale)); }
}

@keyframes trainRoadCarForwardThree {
  0%, 43% { opacity: 0; transform: translate(-50%, 132px) scale(var(--car-three-scale)); }
  51%, 72% { opacity: 1; }
  88%, 100% { opacity: 0; transform: translate(-50%, -96px) scale(var(--car-three-scale)); }
}

@keyframes trainRoadCarForwardFour {
  0%, 52% { opacity: 0; transform: translate(-50%, 130px) scale(var(--car-four-scale)); }
  61%, 79% { opacity: 1; }
  95%, 100% { opacity: 0; transform: translate(-50%, -96px) scale(var(--car-four-scale)); }
}

@media (max-width: 700px) {
  .train-oracle {
    --train-floor-y: 44px;
    --train-track-y: 40px;
    --train-body-y: 58px;
    --crossing-x: clamp(88px, 38vw, 132px);
  }

  .train-oracle .scenery {
    inset: -8% -14% 0 -14% !important;
    height: 120% !important;
  }

  .train-oracle .train-set {
    right: 8% !important;
    width: 96% !important;
    min-width: 520px !important;
  }

  .train-oracle .level-crossing {
    right: -18px !important;
    width: 190px !important;
    height: 150px !important;
    scale: 0.78;
  }
}

/* 2026-05-18: final local-scene override.
   The train must not depend on external photo CDNs; desktop filters were hiding those images.
   These local SVG panoramas are served from suvcap.ru/assets and override every older pass above. */
.train-oracle {
  --mountain-image: url("assets/train-scenes/mountains.svg") !important;
  --forest-image: url("assets/train-scenes/forest.svg") !important;
  --field-image: url("assets/train-scenes/fields.svg") !important;
  --sea-image: url("assets/train-scenes/sea.svg") !important;
  --city-image: url("assets/train-scenes/city-europe.svg") !important;
  background:
    linear-gradient(180deg, rgba(253, 239, 196, calc(var(--twilight-opacity) * 0.34)), transparent 38%),
    linear-gradient(180deg, #9fc7df 0%, #d7e9ef 54%, #5c704b 55%, #25352b 100%) !important;
}

.train-oracle[data-city="moscow"] { --city-image: url("assets/train-scenes/city-moscow.svg") !important; }
.train-oracle[data-city="amsterdam"],
.train-oracle[data-city="london"],
.train-oracle[data-city="paris"],
.train-oracle[data-city="zurich"] { --city-image: url("assets/train-scenes/city-europe.svg") !important; }
.train-oracle[data-city="new-york"] { --city-image: url("assets/train-scenes/city-new-york.svg") !important; }
.train-oracle[data-city="dubai"] { --city-image: url("assets/train-scenes/city-dubai.svg") !important; }
.train-oracle[data-city="tokyo"] { --city-image: url("assets/train-scenes/city-tokyo.svg") !important; }
.train-oracle[data-city="singapore"],
.train-oracle[data-city="hong-kong"],
.train-oracle[data-city="shanghai"] { --city-image: url("assets/train-scenes/city-asia.svg") !important; }
.train-oracle[data-city="great-wall"],
.train-oracle[data-city="petra"],
.train-oracle[data-city="colosseum"],
.train-oracle[data-city="chichen-itza"],
.train-oracle[data-city="machu-picchu"],
.train-oracle[data-city="taj-mahal"],
.train-oracle[data-city="christ-redeemer"],
.train-oracle[data-city="great-pyramid"] { --city-image: url("assets/train-scenes/wonder.svg") !important; }

.train-oracle .scenery {
  inset: -7% -10% 0 -10% !important;
  width: auto !important;
  height: 118% !important;
  background-repeat: no-repeat !important;
  background-position: center bottom !important;
  background-size: cover !important;
  background-color: transparent !important;
  transform-origin: center bottom;
  animation: sceneryPhotoDesktopPass 190s ease-in-out infinite alternate !important;
}

.train-oracle .scenery-mountains {
  background-image:
    linear-gradient(180deg, rgba(244, 250, 255, 0.06), rgba(12, 24, 32, 0.16) 72%, rgba(9, 17, 22, 0.26)),
    var(--mountain-image) !important;
}

.train-oracle .scenery-forest {
  background-image:
    linear-gradient(180deg, rgba(236, 250, 242, 0.06), rgba(8, 40, 24, 0.16) 74%, rgba(6, 20, 13, 0.28)),
    var(--forest-image) !important;
}

.train-oracle .scenery-fields {
  background-image:
    linear-gradient(180deg, rgba(249, 252, 232, 0.06), rgba(112, 92, 28, 0.12) 72%, rgba(44, 34, 15, 0.24)),
    var(--field-image) !important;
}

.train-oracle .scenery-sea {
  background-image:
    linear-gradient(180deg, rgba(236, 250, 255, 0.06), rgba(5, 68, 96, 0.14) 72%, rgba(4, 30, 50, 0.28)),
    var(--sea-image) !important;
}

.train-oracle .scenery-city {
  background-image:
    linear-gradient(180deg, rgba(238, 246, 255, 0.04), rgba(18, 24, 35, 0.08) 56%, rgba(8, 12, 18, 0.24)),
    var(--city-image) !important;
  background-position: center bottom, var(--city-focus, center bottom) !important;
}

/* 2026-05-18: crossing geometry repair.
   Keep the road, cars, animals, barrier and rails on one shared plane. */
.train-oracle {
  --crossing-x: 142px !important;
  --train-track-y: 52px;
  --train-body-y: 76px;
}

.train-oracle[data-phase="night"] .scenery-city {
  filter: saturate(1.08) contrast(1.08) brightness(0.98) !important;
}

.train-oracle .level-crossing {
  right: clamp(16px, 4vw, 62px) !important;
  bottom: calc(var(--train-track-y) - 48px) !important;
  width: 290px !important;
  height: 220px !important;
  z-index: 23 !important;
}

.train-oracle[data-train-state="stopped"] .level-crossing {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

.train-oracle[data-train-state="departing"] .level-crossing {
  opacity: 1 !important;
  animation: crossingDepartWide 11s linear forwards !important;
}

.train-oracle .crossing-road {
  left: var(--crossing-x) !important;
  bottom: -18px !important;
  width: 88px !important;
  height: 218px !important;
  z-index: 2 !important;
  border-radius: 10px 10px 24px 24px !important;
  clip-path: polygon(35% 0, 65% 0, 96% 100%, 4% 100%) !important;
  transform: translateX(-50%) !important;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 9%, transparent 10% 43%, rgba(255, 255, 255, 0.68) 44% 48%, transparent 49% 56%, rgba(255, 255, 255, 0.68) 57% 61%, transparent 62% 90%, rgba(255, 255, 255, 0.12) 91%),
    repeating-linear-gradient(180deg, rgba(246, 235, 170, 0.72) 0 16px, transparent 17px 42px),
    linear-gradient(90deg, #2e353c 0%, #59626a 48%, #252c32 100%) !important;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.16),
    0 20px 30px rgba(0, 0, 0, 0.24) !important;
}

.train-oracle .rail-track {
  z-index: 24 !important;
}

.train-oracle .train-set {
  right: clamp(360px, 30vw, 520px) !important;
  z-index: 26 !important;
}

.train-oracle[data-train-state="stopped"] .train-set {
  transform: translateX(-18px) scale(var(--train-scale, 1)) !important;
}

.train-oracle .rail-signal {
  left: calc(var(--crossing-x) - 118px) !important;
  bottom: 134px !important;
  z-index: 28 !important;
}

.train-oracle .crossing-post.post-left {
  left: calc(var(--crossing-x) - 90px) !important;
  bottom: 72px !important;
  z-index: 29 !important;
}

.train-oracle .crossing-post.post-right,
.train-oracle .barrier-arm.barrier-right {
  display: none !important;
}

.train-oracle .barrier-arm.barrier-left {
  left: calc(var(--crossing-x) - 84px) !important;
  bottom: 134px !important;
  width: 178px !important;
  height: 10px !important;
  z-index: 30 !important;
  transform-origin: 5px 50% !important;
}

.train-oracle[data-train-state="stopped"] .barrier-arm.barrier-left {
  animation: trainBarrierRoadCycleV2 24s ease-in-out forwards !important;
}

.train-oracle[data-train-state="moving"] .barrier-arm.barrier-left,
.train-oracle[data-train-state="departing"] .barrier-arm.barrier-left {
  transform: rotate(0deg) !important;
}

.train-oracle .road-car {
  left: var(--crossing-x) !important;
  bottom: 4px !important;
  z-index: 31 !important;
  width: 32px !important;
  height: 50px !important;
  border-radius: 10px 10px 7px 7px !important;
  transform: translate(-50%, 148px) scale(var(--car-one-scale, 0.92));
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.28) !important;
}

.train-oracle .road-car i {
  inset: 8px 7px 21px !important;
  border-radius: 7px 7px 3px 3px !important;
  background: linear-gradient(180deg, rgba(230, 246, 255, 0.86), rgba(122, 160, 180, 0.56)) !important;
}

.train-oracle .road-car::before,
.train-oracle .road-car::after {
  top: auto !important;
  bottom: 7px !important;
  width: 7px !important;
  height: 12px !important;
  border-radius: 999px !important;
  background: #171b1f !important;
}

.train-oracle[data-train-state="stopped"] .car-one { animation: trainRoadCarForwardOneV2 24s linear forwards !important; }
.train-oracle[data-train-state="stopped"] .car-two { animation: trainRoadCarForwardTwoV2 24s linear forwards !important; }
.train-oracle[data-train-state="stopped"] .car-three { animation: trainRoadCarForwardThreeV2 24s linear forwards !important; }
.train-oracle[data-train-state="stopped"] .car-four { animation: trainRoadCarForwardFourV2 24s linear forwards !important; }

.train-oracle .crossing-moose {
  left: calc(var(--crossing-x) + 22px) !important;
  bottom: 18px !important;
  z-index: 32 !important;
  width: 38px !important;
  height: 28px !important;
  opacity: 0 !important;
  transform: translate(-50%, 148px) scale(0.9);
}

.train-oracle[data-train-state="stopped"] .moose-one { animation: trainMooseRoadCrossOne 24s linear forwards !important; }
.train-oracle[data-train-state="stopped"] .moose-two { animation: trainMooseRoadCrossTwo 24s linear forwards !important; }

@keyframes trainBarrierRoadCycleV2 {
  0%, 9% { transform: rotate(0deg); }
  18%, 76% { transform: rotate(-72deg); }
  91%, 100% { transform: rotate(0deg); }
}

@keyframes trainRoadCarForwardOneV2 {
  0%, 12% { opacity: 0; transform: translate(-50%, 150px) scale(calc(var(--car-one-scale, 0.95) * 1.08)); }
  18%, 48% { opacity: 1; }
  66%, 100% { opacity: 0; transform: translate(-50%, -92px) scale(calc(var(--car-one-scale, 0.95) * 0.68)); }
}

@keyframes trainRoadCarForwardTwoV2 {
  0%, 22% { opacity: 0; transform: translate(-50%, 150px) scale(calc(var(--car-two-scale, 0.9) * 1.06)); }
  30%, 58% { opacity: 1; }
  78%, 100% { opacity: 0; transform: translate(-50%, -92px) scale(calc(var(--car-two-scale, 0.9) * 0.68)); }
}

@keyframes trainRoadCarForwardThreeV2 {
  0%, 34% { opacity: 0; transform: translate(-50%, 150px) scale(calc(var(--car-three-scale, 0.82) * 1.06)); }
  42%, 68% { opacity: 1; }
  88%, 100% { opacity: 0; transform: translate(-50%, -92px) scale(calc(var(--car-three-scale, 0.82) * 0.68)); }
}

@keyframes trainRoadCarForwardFourV2 {
  0%, 48% { opacity: 0; transform: translate(-50%, 150px) scale(calc(var(--car-four-scale, 0.98) * 1.06)); }
  56%, 82% { opacity: 1; }
  98%, 100% { opacity: 0; transform: translate(-50%, -92px) scale(calc(var(--car-four-scale, 0.98) * 0.68)); }
}

@keyframes trainMooseRoadCrossOne {
  0%, 58% { opacity: 0; transform: translate(-50%, 150px) scale(1.04); }
  66%, 82% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(-50%, -78px) scale(0.68); }
}

@keyframes trainMooseRoadCrossTwo {
  0%, 68% { opacity: 0; transform: translate(-50%, 150px) scale(0.9); }
  76%, 88% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(-50%, -72px) scale(0.6); }
}

@media (max-width: 700px) {
  .train-oracle {
    --crossing-x: 100px !important;
  }

  .train-oracle .level-crossing {
    right: -12px !important;
    width: 210px !important;
    height: 168px !important;
  }

  .train-oracle .train-set {
    right: 190px !important;
    min-width: 520px !important;
  }
}

@media (max-width: 980px) {
  .business-ideas-summary,
  .business-ideas-grid,
  .business-idea-scenarios,
  .business-idea-columns {
    grid-template-columns: 1fr;
  }
}

/* Compact train slot: keep the animation in the upper-right command area and serve cached photo scenery. */
.topbar {
  grid-template-columns: minmax(340px, 1fr) minmax(420px, min(48vw, 760px)) !important;
  grid-template-areas:
    "brand brand"
    "tabs tabs"
    "copy train";
  align-items: start !important;
  gap: 10px 18px !important;
}

.topbar-brand-line {
  grid-area: brand;
}

.workspace-tabs {
  grid-area: tabs;
}

.topbar-copy {
  grid-area: copy;
  align-self: center;
}

.train-oracle {
  --mountain-image: url("assets/train-scenes/photos/mountains.jpg") !important;
  --forest-image: url("assets/train-scenes/photos/forest.jpg") !important;
  --field-image: url("assets/train-scenes/photos/fields.jpg") !important;
  --sea-image: url("assets/train-scenes/photos/sea.jpg") !important;
  --city-image: url("assets/train-scenes/photos/city.jpg") !important;
  --crossing-x: calc(100% - 78px) !important;
  --train-scale: 0.56 !important;
  grid-area: train;
  align-self: start;
  justify-self: stretch !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: clamp(118px, 9.8vw, 152px) !important;
  border-color: rgba(31, 95, 82, 0.22) !important;
  box-shadow: 0 10px 24px rgba(20, 23, 31, 0.08) !important;
}

.train-oracle[data-city="moscow"] { --city-image: url("assets/train-scenes/photos/moscow.jpg") !important; }
.train-oracle[data-city="dubai"] { --city-image: url("assets/train-scenes/photos/dubai.jpg") !important; }
.train-oracle[data-city="tokyo"] { --city-image: url("assets/train-scenes/photos/tokyo.jpg") !important; }
.train-oracle[data-city="great-wall"] { --city-image: url("assets/train-scenes/photos/great-wall.jpg") !important; }
.train-oracle[data-city="machu-picchu"] { --city-image: url("assets/train-scenes/photos/machu-picchu.jpg") !important; }

.train-oracle .scenery {
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-position: center bottom !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  transform: translate3d(0, 0, 0) scale(1.035) !important;
  animation: sceneryPhotoCruiseCompact 118s ease-in-out infinite alternate !important;
}

.train-oracle .scenery-mountains {
  background-image:
    linear-gradient(180deg, rgba(225, 240, 248, 0.08), rgba(9, 18, 28, 0.22)),
    var(--mountain-image),
    url("assets/train-scenes/mountains.svg") !important;
}

.train-oracle .scenery-forest {
  background-image:
    linear-gradient(180deg, rgba(225, 240, 248, 0.08), rgba(7, 30, 19, 0.24)),
    var(--forest-image),
    url("assets/train-scenes/forest.svg") !important;
}

.train-oracle .scenery-fields {
  background-image:
    linear-gradient(180deg, rgba(225, 240, 248, 0.08), rgba(84, 71, 26, 0.2)),
    var(--field-image),
    url("assets/train-scenes/fields.svg") !important;
}

.train-oracle .scenery-sea {
  background-image:
    linear-gradient(180deg, rgba(225, 240, 248, 0.08), rgba(5, 42, 61, 0.24)),
    var(--sea-image),
    url("assets/train-scenes/sea.svg") !important;
}

.train-oracle .scenery-city {
  background-image:
    linear-gradient(180deg, rgba(225, 240, 248, 0.05), rgba(7, 13, 22, 0.34)),
    var(--city-image),
    url("assets/train-scenes/city-new-york.svg") !important;
}

.train-oracle .service-age-badge {
  top: 7px !important;
  right: 8px !important;
  padding: 3px 7px !important;
  font-size: 9px !important;
}

.train-oracle .train-city-name {
  right: 9px !important;
  bottom: 84px !important;
  padding: 3px 6px !important;
  font-size: 8px !important;
}

.train-oracle .train-scene-name {
  left: 9px !important;
  bottom: 82px !important;
  min-width: 44px !important;
  padding: 3px 6px !important;
  font-size: 8px !important;
}

.train-oracle .train-cloud {
  transform: scale(0.7);
}

.train-oracle .rail-track {
  bottom: 18px !important;
  height: 16px !important;
  z-index: 24 !important;
}

.train-oracle .level-crossing {
  right: 4px !important;
  bottom: 13px !important;
  width: 172px !important;
  height: 112px !important;
  z-index: 25 !important;
  scale: 0.52 !important;
  transform-origin: right bottom !important;
}

.train-oracle .crossing-road {
  left: 126px !important;
  bottom: -3px !important;
}

.train-oracle .rail-signal {
  left: calc(var(--crossing-x) - 104px) !important;
  bottom: 82px !important;
}

.train-oracle .crossing-post.post-left {
  left: calc(var(--crossing-x) - 82px) !important;
  bottom: 38px !important;
}

.train-oracle .barrier-arm.barrier-left {
  left: calc(var(--crossing-x) - 76px) !important;
  bottom: 88px !important;
  width: 118px !important;
  height: 8px !important;
}

.train-oracle .road-car {
  left: var(--crossing-x) !important;
  bottom: -4px !important;
  width: 26px !important;
  height: 40px !important;
}

.train-oracle .crossing-moose {
  left: calc(var(--crossing-x) + 16px) !important;
  bottom: 4px !important;
}

.train-oracle .train-set {
  right: 88px !important;
  bottom: 30px !important;
  width: min(560px, 82%) !important;
  min-width: 420px !important;
  gap: 5px !important;
  z-index: 30 !important;
}

.train-oracle[data-train-state="stopped"] .train-set {
  transform: translateX(-10px) scale(var(--train-scale, 0.56)) !important;
}

.train-oracle .train-wagon {
  flex: 1 1 105px !important;
  height: 42px !important;
  padding: 5px 7px 12px !important;
  border-radius: 7px !important;
}

.train-oracle .train-wagon strong {
  font-size: 7px !important;
  line-height: 1.05 !important;
}

.train-oracle .train-wagon span {
  font-size: 8px !important;
  line-height: 1.05 !important;
}

.train-oracle .train-engine {
  width: 88px !important;
  height: 44px !important;
  border-radius: 8px 18px 8px 8px !important;
}

.train-oracle .engine-cab {
  right: 6px !important;
  bottom: 21px !important;
  width: 30px !important;
  height: 28px !important;
}

.train-oracle .engine-stack {
  left: 14px !important;
  top: -14px !important;
  width: 10px !important;
  height: 20px !important;
}

.train-oracle .engine-window {
  right: 13px !important;
  bottom: 29px !important;
  width: 11px !important;
  height: 10px !important;
}

.train-oracle .engine-goal {
  left: 8px !important;
  right: 28px !important;
  bottom: 14px !important;
  font-size: 7px !important;
}

@keyframes sceneryPhotoCruiseCompact {
  0% { transform: translate3d(-1.8%, 0, 0) scale(1.04); background-position: 40% bottom; }
  50% { transform: translate3d(1.2%, -0.25%, 0) scale(1.045); background-position: 53% bottom; }
  100% { transform: translate3d(3.2%, 0, 0) scale(1.04); background-position: 63% bottom; }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 44vw) !important;
  }

  .train-oracle {
    height: 132px !important;
  }
}

@media (max-width: 900px) {
  .product-hero,
  .product-chart-head {
    display: grid;
  }

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

  .product-layout {
    grid-template-columns: 1fr;
  }

  .product-chart-shell,
  .product-chart,
  .product-chart svg {
    min-height: 430px;
  }

  .open-interest-layout {
    grid-template-columns: 1fr;
  }

  .open-interest-bar {
    grid-template-columns: 92px minmax(0, 1fr) 76px;
  }

  .topbar {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "brand"
      "tabs"
      "copy"
      "train";
  }

  .train-oracle {
    height: 170px !important;
  }

  .train-oracle .train-set {
    right: 118px !important;
    min-width: 500px !important;
    width: 86% !important;
    --train-scale: 0.62 !important;
  }
}

@media (max-width: 560px) {
  .product-panel {
    padding: 14px;
  }

  .product-result-strip,
  .product-scenario-tabs {
    grid-template-columns: 1fr;
  }

  .product-chart-shell,
  .product-chart,
  .product-chart svg {
    min-height: 360px;
  }

  .train-oracle {
    height: 148px !important;
  }

  .train-oracle .train-set {
    right: 74px !important;
    bottom: 28px !important;
    min-width: 440px !important;
    --train-scale: 0.52 !important;
  }

  .train-oracle .level-crossing {
    right: -18px !important;
    scale: 0.48 !important;
  }
}
