:root {
  color-scheme: dark;
  --bg: #0d0e0c;
  --bg-2: #151612;
  --ink: #f5f1e8;
  --muted: #b7b2a8;
  --subtle: #7f7a70;
  --line: rgba(245, 241, 232, 0.14);
  --gold: #d8a94f;
  --gold-2: #f0c56e;
  --teal: #35d0bf;
  --red: #e26b5f;
  --violet: #9e8cff;
  --green: #6ed89a;
  --panel: rgba(23, 24, 20, 0.78);
  --panel-solid: #181914;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --max: 1180px;
  font-family:
    "Avenir Next", Avenir, Futura, ui-sans-serif, system-ui, -apple-system,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(13, 14, 12, 0) 0, #0d0e0c 760px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 120px),
    var(--bg);
  color: var(--ink);
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 76px;
  padding: 14px max(24px, calc((100vw - var(--max)) / 2));
  color: var(--ink);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    backdrop-filter 180ms ease;
}

.site-header[data-elevated="true"] {
  background: rgba(13, 14, 12, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(216, 169, 79, 0.65);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(216, 169, 79, 0.32), rgba(53, 208, 191, 0.1));
  color: var(--gold-2);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a {
  padding: 10px 0;
}

.nav-links a:hover {
  color: var(--ink);
}

.header-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-button,
.ghost-button,
.glass-button,
.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  white-space: nowrap;
}

.primary-button {
  background: var(--gold);
  color: #15100a;
  box-shadow: 0 10px 30px rgba(216, 169, 79, 0.2);
}

.primary-button:hover {
  background: var(--gold-2);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ghost-button {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.language-toggle {
  min-width: 48px;
  padding-inline: 12px;
  border-color: rgba(53, 208, 191, 0.32);
  color: var(--teal);
  background: rgba(53, 208, 191, 0.08);
  letter-spacing: 0.06em;
}

.language-toggle:hover {
  border-color: var(--teal);
  background: rgba(53, 208, 191, 0.14);
}

.glass-button {
  border-color: rgba(245, 241, 232, 0.28);
  color: var(--ink);
  background: rgba(13, 14, 12, 0.35);
  backdrop-filter: blur(14px);
}

.large {
  min-height: 50px;
  padding-inline: 24px;
}

.nav-toggle {
  display: none;
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(660px, 88vh, 840px);
  padding: 116px max(24px, calc((100vw - var(--max)) / 2)) 72px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(13, 14, 12, 0.92) 0%, rgba(13, 14, 12, 0.74) 38%, rgba(13, 14, 12, 0.2) 76%),
    linear-gradient(180deg, rgba(13, 14, 12, 0) 70%, #0d0e0c 100%),
    url("./assets/hero-ai-trading-command.png") center right / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 160px;
  background: linear-gradient(180deg, rgba(13, 14, 12, 0), #0d0e0c 80%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  min-width: 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.mobile-title {
  display: none;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.22;
}

.hero-copy {
  max-width: 680px;
  margin-bottom: 30px;
  color: #ddd6ca;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.75;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(640px, 100%);
  margin: 42px 0 0;
}

.hero-metrics div {
  padding: 18px;
  border: 1px solid rgba(245, 241, 232, 0.16);
  border-radius: 8px;
  background: rgba(16, 17, 14, 0.48);
  backdrop-filter: blur(16px);
}

.hero-metrics dt {
  color: var(--gold-2);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
}

.hero-metrics dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.section {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 92px 0;
  scroll-margin-top: 92px;
}

.intro-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding-top: 28px;
}

.strip-item {
  min-height: 148px;
  padding: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.strip-item span {
  display: block;
  margin-bottom: 24px;
  color: var(--teal);
  font-weight: 800;
}

.strip-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.view-switcher {
  position: sticky;
  top: 76px;
  z-index: 15;
  display: flex;
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 16, 13, 0.9);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
  overflow-x: auto;
  scrollbar-width: none;
}

.view-switcher::-webkit-scrollbar {
  display: none;
}

.view-tab {
  flex: 1 0 max-content;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.view-tab.active,
.nav-links a.active {
  color: #15100a;
  background: var(--gold);
}

.nav-links a.active {
  padding-inline: 10px;
  border-radius: 6px;
}

.section-view[hidden] {
  display: none;
}

.signal-history {
  min-height: 760px;
}

.history-heading {
  margin-bottom: 28px;
}

.history-summary {
  align-self: end;
}

.history-summary p {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.history-count {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

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

.history-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 420px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(245, 241, 232, 0.13);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(53, 208, 191, 0.055), rgba(53, 208, 191, 0) 46%),
    var(--panel-solid);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.24);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.history-card:hover {
  transform: translateY(-4px);
  border-color: rgba(53, 208, 191, 0.42);
}

.history-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.history-card-head {
  min-height: 116px;
  padding: 24px 24px 8px;
}

.history-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.history-symbol,
.history-badge {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-symbol {
  color: var(--gold-2);
}

.history-badge {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(110, 216, 154, 0.1);
}

.history-badge.review {
  color: var(--red);
  background: rgba(226, 107, 95, 0.1);
}

.history-card h3 {
  display: -webkit-box;
  min-height: 48px;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-period {
  margin: 8px 0 0;
  color: var(--subtle);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.history-chart {
  position: relative;
  height: 138px;
  margin: 8px 20px 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(245, 241, 232, 0.08);
}

.history-chart::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 33px, rgba(245, 241, 232, 0.035) 33px 34px);
}

.history-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.history-chart .area {
  fill: rgba(53, 208, 191, 0.1);
}

.history-chart .line {
  fill: none;
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.history-card.negative .history-chart .area {
  fill: rgba(226, 107, 95, 0.09);
}

.history-card.negative .history-chart .line {
  stroke: var(--red);
}

.history-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 20px 0;
}

.history-metrics span,
.history-pnl span {
  display: block;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.history-metrics strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 15px;
}

.history-card-foot {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 18px 20px 22px;
}

.history-pnl strong {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 26px;
  line-height: 1;
}

.history-card.negative .history-pnl strong {
  color: var(--red);
}

.history-detail-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(245, 241, 232, 0.16);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
}

.history-detail-button:hover {
  border-color: var(--gold);
  color: var(--gold-2);
}

.history-footnote {
  max-width: 780px;
  margin: 24px 0 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.7;
}

.console {
  width: 100%;
  max-width: none;
  padding-inline: max(24px, calc((100vw - var(--max)) / 2));
  background:
    linear-gradient(180deg, rgba(53, 208, 191, 0.055), rgba(53, 208, 191, 0)),
    #10110e;
}

.metric-grid,
.console-grid {
  width: min(var(--max), 100%);
  margin-inline: auto;
}

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

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

.metric-card {
  min-height: 142px;
  padding: 22px;
}

.metric-card span,
.card-kicker {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 18px 0 8px;
  color: var(--gold-2);
  font-size: 30px;
  line-height: 1;
}

.metric-card p,
.console-card p,
.strategy-card p,
.account-logic,
.status-list dd,
.auth-user small,
.form-status {
  color: var(--muted);
  line-height: 1.65;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr) minmax(260px, 0.8fr);
  gap: 16px;
}

.console-card {
  min-height: 340px;
  padding: 24px;
}

.status-list {
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
}

.status-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(245, 241, 232, 0.09);
}

.status-list dt {
  color: var(--subtle);
  font-size: 12px;
}

.status-list dd {
  margin: 0;
  text-align: right;
}

#api-state[data-state="ok"] {
  color: var(--green);
}

#api-state[data-state="bad"] {
  color: var(--red);
}

.signal-list {
  display: grid;
  gap: 12px;
}

.signal-item {
  padding: 16px;
  border: 1px solid rgba(245, 241, 232, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.signal-top,
.risk-event-top,
.strategy-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.signal-top span,
.risk-event-top span,
.strategy-top span {
  color: var(--subtle);
  font-size: 12px;
}

.signal-item h4 {
  margin: 12px 0 8px;
  font-size: 16px;
}

.signal-item p {
  margin-bottom: 14px;
  font-size: 13px;
}

.decision {
  color: var(--gold-2);
  font-size: 12px;
}

.decision.sell,
.decision.reject {
  color: var(--red);
}

.decision.buy {
  color: var(--green);
}

.confidence,
.risk-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.confidence span,
.risk-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.risk-event-list {
  display: grid;
  gap: 18px;
}

.risk-event-top {
  margin-bottom: 8px;
}

.risk-event-top strong {
  color: var(--ink);
}

.risk-bar .high {
  background: linear-gradient(90deg, var(--red), var(--gold));
}

.risk-bar .mid {
  background: linear-gradient(90deg, var(--gold), var(--teal));
}

.embedded-workbench {
  width: min(var(--max), 100%);
  margin: 18px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(216, 169, 79, 0.06), rgba(53, 208, 191, 0.04)),
    rgba(18, 19, 15, 0.86);
  box-shadow: var(--shadow);
}

.workbench-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 24px;
  border-bottom: 1px solid rgba(245, 241, 232, 0.1);
}

.workbench-toolbar h3 {
  margin-bottom: 0;
  font-size: 24px;
}

.workspace-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.workspace-tab {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.workspace-tab.active {
  color: #15100a;
  background: var(--gold);
}

.workspace-panels {
  min-height: 480px;
  padding: 18px;
}

.workspace-panel {
  min-height: 444px;
}

.workspace-frame {
  display: block;
  width: 100%;
  height: clamp(720px, 70vw, 820px);
  min-height: 720px;
  border: 1px solid rgba(245, 241, 232, 0.1);
  border-radius: 8px;
  background: #0b0d0c;
}

.embedded-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) repeat(2, minmax(260px, 1fr));
  gap: 14px;
  min-height: inherit;
}

.embedded-summary,
.embedded-breakdown,
.status-workspace,
.ready-check,
.risk-result {
  border: 1px solid rgba(245, 241, 232, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.embedded-summary {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.embedded-summary div,
.risk-result div {
  padding: 14px;
  border: 1px solid rgba(245, 241, 232, 0.08);
  border-radius: 8px;
  background: rgba(13, 14, 12, 0.3);
}

.embedded-summary span,
.risk-result span,
.ready-check span {
  display: block;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.embedded-summary strong,
.risk-result strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 24px;
}

.embedded-breakdown {
  padding: 18px;
}

.embedded-breakdown h4,
.status-workspace h4 {
  margin: 0 0 16px;
  font-size: 18px;
}

.mini-list {
  display: grid;
  gap: 12px;
}

.mini-row {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(245, 241, 232, 0.08);
  border-radius: 8px;
  background: rgba(13, 14, 12, 0.32);
}

.mini-row div {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mini-row strong {
  color: var(--ink);
}

.mini-row span {
  color: var(--subtle);
  font-size: 12px;
}

.mini-row em {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-weight: 900;
}

.mini-row em.win {
  color: var(--green);
}

.mini-row em.loss {
  color: var(--red);
}

.mini-row i {
  position: absolute;
  inset: auto auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

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

.risk-calculator label {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(245, 241, 232, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.risk-calculator span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.risk-calculator input {
  width: 100%;
  border: 1px solid rgba(245, 241, 232, 0.16);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: rgba(13, 14, 12, 0.45);
  outline: none;
}

.risk-calculator input:focus {
  border-color: rgba(216, 169, 79, 0.72);
  box-shadow: 0 0 0 3px rgba(216, 169, 79, 0.12);
}

.risk-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.risk-result p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.status-workspace {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 18px;
}

.status-workspace p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

#ready-state[data-state="ok"] {
  color: var(--green);
}

#ready-state[data-state="bad"] {
  color: var(--red);
}

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

.ready-check {
  padding: 18px;
}

.ready-check strong {
  display: block;
  margin-top: 12px;
  color: var(--green);
  font-size: 24px;
}

.ready-check.bad strong {
  color: var(--red);
}

.ready-check p,
.empty-state {
  color: var(--muted);
  line-height: 1.7;
}

.empty-state {
  padding: 18px;
  border: 1px solid rgba(245, 241, 232, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.empty-state.compact {
  padding: 12px;
  font-size: 13px;
}

.strip-item p,
.section-heading p,
.product-card p,
.pipeline p,
.risk-rule p,
.release-list p,
.contact p,
.lab-copy p {
  color: var(--muted);
  line-height: 1.75;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 36px;
}

.section-heading.compact {
  max-width: 700px;
  text-align: center;
  margin-inline: auto;
}

.section-visual {
  position: relative;
  width: min(var(--max), 100%);
  margin: 0 auto 34px;
  overflow: hidden;
  border: 1px solid rgba(245, 241, 232, 0.16);
  border-radius: 8px;
  background: #10110e;
  box-shadow: var(--shadow);
}

.section-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(13, 14, 12, 0), rgba(13, 14, 12, 0.12)),
    linear-gradient(90deg, rgba(216, 169, 79, 0.08), rgba(53, 208, 191, 0.06));
}

.section-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.architecture-visual {
  margin-top: 10px;
}

.observation-visual {
  margin-bottom: 26px;
}

.observation-visual img {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
}

.section-heading.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.7fr);
  gap: 40px;
  max-width: none;
  align-items: end;
}

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

.product-card,
.pipeline article,
.risk-rule,
.release-list article,
.prompt-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.product-card {
  position: relative;
  min-height: 380px;
  padding: 26px;
  overflow: hidden;
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.accent-gold {
  --accent: var(--gold);
}

.accent-teal {
  --accent: var(--teal);
}

.accent-red {
  --accent: var(--red);
}

.accent-violet {
  --accent: var(--violet);
}

.card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 34px;
  border: 1px solid rgba(245, 241, 232, 0.16);
  border-radius: 8px;
  color: var(--accent);
  font-weight: 900;
}

.product-card ul {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.product-card li {
  position: relative;
  padding-left: 18px;
  color: #ddd6ca;
  font-size: 14px;
}

.product-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

.architecture {
  width: 100%;
  max-width: none;
  padding-inline: max(24px, calc((100vw - var(--max)) / 2));
  background:
    linear-gradient(180deg, rgba(245, 241, 232, 0.04), rgba(245, 241, 232, 0.01)),
    #11120f;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  width: min(var(--max), 100%);
  margin: 0 auto;
}

.pipeline article {
  position: relative;
  min-height: 252px;
  padding: 24px;
}

.pipeline article:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 34px;
  right: -14px;
  z-index: 1;
  width: 14px;
  height: 1px;
  background: var(--gold);
}

.pipeline span,
.risk-rule span,
.panel-topline span,
.release-list time {
  display: inline-flex;
  margin-bottom: 34px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.observation {
  padding-bottom: 76px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segment,
.prompt-tab {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.segment.active,
.prompt-tab.active {
  color: #15100a;
  background: var(--gold);
  font-weight: 800;
}

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

.account-insight div {
  min-height: 96px;
  padding: 18px;
  border: 1px solid rgba(245, 241, 232, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.account-insight span {
  display: block;
  margin-bottom: 16px;
  color: var(--subtle);
  font-size: 12px;
}

.account-insight strong {
  color: var(--ink);
  font-size: 24px;
}

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

.account-card {
  appearance: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.account-card:hover,
.account-card.selected {
  border-color: rgba(216, 169, 79, 0.62);
  background: rgba(216, 169, 79, 0.06);
}

.account-card .status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--subtle);
  font-size: 12px;
}

.account-card h3 {
  margin-top: 20px;
  min-height: 50px;
}

.account-card .pnl {
  margin: 20px 0 10px;
  color: var(--green);
  font-size: 30px;
  font-weight: 900;
}

.account-card .drawdown {
  color: var(--muted);
  font-size: 13px;
}

.account-source {
  margin-top: 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.account-logic {
  min-height: 68px;
  margin: 14px 0 0;
  font-size: 13px;
}

.sparkline {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  align-items: end;
  gap: 3px;
  height: 42px;
  margin-top: 18px;
}

.sparkline span {
  min-height: 6px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--teal), rgba(53, 208, 191, 0.28));
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.trade-detail-panel {
  margin: 18px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(53, 208, 191, 0.07), rgba(53, 208, 191, 0)),
    var(--panel);
  box-shadow: var(--shadow);
}

.trade-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.trade-detail-head h3 {
  margin-bottom: 8px;
}

.trade-detail-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.trade-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 10px;
}

.trade-kpis div {
  min-width: 92px;
  padding: 12px;
  border: 1px solid rgba(245, 241, 232, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.trade-kpis span {
  display: block;
  color: var(--subtle);
  font-size: 12px;
}

.trade-kpis strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 18px;
}

.trade-table-shell {
  overflow: auto;
  border: 1px solid rgba(245, 241, 232, 0.1);
  border-radius: 8px;
}

.trade-side,
.trade-pnl {
  font-weight: 900;
}

.trade-side.buy,
.trade-pnl.win {
  color: var(--green);
}

.trade-side.sell,
.trade-pnl.loss {
  color: var(--red);
}

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

th,
td {
  padding: 18px;
  border-bottom: 1px solid rgba(245, 241, 232, 0.09);
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--subtle);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  color: #e7e0d3;
}

td small {
  display: block;
  max-width: 360px;
  margin-top: 6px;
  color: var(--subtle);
  line-height: 1.55;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rating::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.rating.low {
  color: var(--green);
}

.rating.mid {
  color: var(--gold);
}

.rating.high {
  color: var(--red);
}

.lab {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(420px, 1fr);
  gap: 40px;
  align-items: center;
}

.prompt-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.strategy-board {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.strategy-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
}

.strategy-top strong {
  color: var(--gold-2);
  font-size: 22px;
}

.strategy-card h3 {
  margin-top: 14px;
  font-size: 17px;
}

.strategy-card p {
  margin-bottom: 14px;
  font-size: 13px;
}

.strategy-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.strategy-card li {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(53, 208, 191, 0.1);
  color: #dfe8df;
  font-size: 12px;
}

.prompt-panel {
  min-height: 460px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(53, 208, 191, 0.08), rgba(53, 208, 191, 0)),
    #11120f;
}

.panel-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-topline strong {
  color: var(--gold-2);
}

pre {
  margin: 0;
  white-space: pre-wrap;
  color: #dfe8df;
  font:
    14px/1.72 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.risk {
  width: 100%;
  max-width: none;
  padding-inline: max(24px, calc((100vw - var(--max)) / 2));
  background: #14130f;
}

.risk-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(var(--max), 100%);
  margin: 0 auto;
}

.risk-rule {
  min-height: 260px;
  padding: 28px;
}

.release-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.release-list article {
  min-height: 220px;
  padding: 26px;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.contact h2 {
  max-width: 720px;
}

.contact p {
  max-width: 760px;
  font-size: 18px;
}

.modal-open {
  overflow: hidden;
}

.modal-layer[hidden] {
  display: none;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 6, 5, 0.74);
  backdrop-filter: blur(18px);
}

.modal {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(245, 241, 232, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(216, 169, 79, 0.08), rgba(216, 169, 79, 0)),
    #12130f;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  font-size: 24px;
  line-height: 1;
}

.modal-heading {
  padding-right: 38px;
}

.modal-heading h2 {
  font-size: 32px;
}

.modal-heading p {
  color: var(--muted);
  line-height: 1.7;
}

.auth-switch {
  display: inline-flex;
  gap: 4px;
  margin: 18px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-mode {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.auth-mode.active {
  color: #15100a;
  background: var(--gold);
  font-weight: 800;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-form label span {
  color: var(--subtle);
  font-size: 13px;
}

.auth-form input,
.auth-form textarea {
  width: 100%;
  border: 1px solid rgba(245, 241, 232, 0.18);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.auth-form input:focus,
.auth-form textarea:focus {
  border-color: rgba(216, 169, 79, 0.72);
  box-shadow: 0 0 0 3px rgba(216, 169, 79, 0.12);
}

.auth-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-user span,
.auth-user strong,
.auth-user small {
  display: block;
}

.auth-user span {
  margin-bottom: 6px;
  color: var(--subtle);
  font-size: 12px;
}

.form-status {
  min-height: 24px;
  margin: 14px 0 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px max(24px, calc((100vw - var(--max)) / 2));
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1060px) {
  .site-header {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .nav-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    place-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
  }

  .nav-toggle span {
    width: 18px;
    height: 2px;
    background: var(--ink);
  }

  .nav-links,
  .header-actions {
    display: none;
  }

  .site-header.menu-open .nav-links,
  .site-header.menu-open .header-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .site-header.menu-open .nav-links {
    flex-wrap: wrap;
    padding-top: 8px;
  }

  .site-header.menu-open .header-actions {
    padding-bottom: 8px;
  }

  .product-grid,
  .history-grid,
  .account-grid,
  .metric-grid,
  .account-insight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench-toolbar,
  .embedded-grid,
  .risk-calculator,
  .risk-result,
  .ready-checks {
    grid-template-columns: 1fr;
  }

  .workbench-toolbar {
    align-items: start;
  }

  .workspace-tabs {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .workspace-tabs::-webkit-scrollbar {
    display: none;
  }

  .workspace-tab {
    flex: 1 0 max-content;
  }

  .console-grid {
    grid-template-columns: 1fr;
  }

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

  .pipeline article:not(:last-child)::after {
    display: none;
  }

  .lab {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 66px;
    padding: 12px 18px;
  }

  .view-switcher {
    top: 66px;
    width: calc(100% - 24px);
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: 760px;
    padding: 104px 20px 56px;
    background:
      linear-gradient(180deg, rgba(13, 14, 12, 0.82) 0%, rgba(13, 14, 12, 0.58) 42%, rgba(13, 14, 12, 0.95) 100%),
      url("./assets/hero-ai-trading-command.png") center / cover no-repeat;
  }

  h1 {
    max-width: calc(100vw - 40px);
    font-size: 32px;
    line-height: 1.14;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: block;
  }

  .hero-copy {
    max-width: calc(100vw - 40px);
    font-size: 16px;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .hero-content,
  .section-heading,
  .strip-item,
  .product-card,
  .pipeline article,
  .risk-rule,
  .release-list article,
  .contact,
  .lab-copy {
    min-width: 0;
  }

  h2,
  h3,
  p,
  li,
  a {
    overflow-wrap: break-word;
    word-break: normal;
  }

  .hero-actions,
  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions a,
  .hero-actions button,
  .header-actions a,
  .header-actions button {
    width: 100%;
  }

  .hero-metrics,
  .intro-strip,
  .product-grid,
  .history-grid,
  .pipeline,
  .account-grid,
  .metric-grid,
  .account-insight,
  .section-heading.split,
  .console-grid,
  .trade-detail-head,
  .trade-kpis,
  .risk-layout,
  .release-list,
  .contact {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    margin-top: 30px;
  }

  .section {
    width: min(calc(100% - 36px), var(--max));
    padding: 68px 0;
  }

  .architecture,
  .risk,
  .console {
    padding-inline: 18px;
  }

  .workspace-panels {
    min-height: auto;
    padding: 12px;
  }

  .workspace-panel {
    min-height: auto;
  }

  .workspace-frame {
    height: 620px;
    min-height: 560px;
  }

  .status-workspace {
    align-items: stretch;
    flex-direction: column;
  }

  .section-visual img {
    aspect-ratio: 4 / 3;
  }

  .observation-visual img {
    aspect-ratio: 16 / 9;
    object-fit: contain;
  }

  .product-card {
    min-height: auto;
  }

  .segmented {
    width: 100%;
    overflow: auto;
  }

  .segment {
    min-width: max-content;
  }

  .prompt-panel {
    min-height: 430px;
    padding: 18px;
  }

  pre {
    font-size: 12px;
  }

  .contact .primary-button {
    width: 100%;
  }

  .auth-user {
    align-items: stretch;
    flex-direction: column;
  }

  .modal {
    padding: 22px;
  }

  .site-footer {
    display: grid;
    padding-inline: 18px;
  }
}
