:root {
  color-scheme: light;
  --canvas: #e8edf0;
  --surface: #f8faf9;
  --paper: #ffffff;
  --ink: #152337;
  --muted: #657286;
  --line: #c9d2d8;
  --line-strong: #9daab4;
  --navy: #173a5e;
  --blue: #245fa8;
  --jade: #137b68;
  --jade-soft: #d9ece7;
  --red: #b64334;
  --red-soft: #f4e1dd;
  --amber: #9b6517;
  --amber-soft: #f3e8d1;
  --shadow: 0 16px 44px rgba(20, 37, 57, 0.08);
  --sidebar: 236px;
  --display: "STZhongsong", "Noto Serif SC", "Songti SC", serif;
  --body: "Microsoft YaHei UI", "Noto Sans SC", "PingFang SC", sans-serif;
  --data: "Bahnschrift", "DIN Alternate", "Microsoft YaHei UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  background: var(--paper);
  border: 2px solid var(--blue);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

body.is-authenticating {
  overflow: hidden;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #102d4a;
  color: #edf3f5;
}

.login-atmosphere,
.login-atmosphere::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-atmosphere {
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(127, 193, 178, 0.09), transparent 45%),
    radial-gradient(circle at 78% 20%, rgba(78, 132, 176, 0.24), transparent 32%);
}

.login-atmosphere::before {
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to right, black, transparent 72%);
}

.login-atmosphere span {
  position: absolute;
  right: -12vw;
  width: 68vw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(127, 193, 178, 0.55), transparent);
  transform: rotate(-19deg);
}

.login-atmosphere span:nth-child(1) { top: 26%; }
.login-atmosphere span:nth-child(2) { top: 48%; right: -2vw; }
.login-atmosphere span:nth-child(3) { top: 70%; right: -20vw; }

.login-card {
  position: relative;
  width: min(100%, 430px);
  padding: 42px;
  background: rgba(248, 250, 249, 0.98);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 4px;
  box-shadow: 0 32px 90px rgba(3, 18, 34, 0.36);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.login-brand .brand-mark {
  width: 40px;
  height: 40px;
  padding: 3px;
  background: var(--navy);
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: 0.18em;
}

.login-brand span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.login-card h1 {
  margin: 4px 0 8px;
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.15;
}

.login-intro {
  margin: 0 0 30px;
  color: var(--muted);
}

.login-card form,
.login-card label {
  display: grid;
}

.login-card form {
  gap: 18px;
}

.login-card label {
  gap: 7px;
  color: #46566b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.login-card input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
}

.login-card input:focus {
  border-color: var(--blue);
}

.login-error {
  margin: -4px 0 0;
  padding: 10px 12px;
  color: var(--red);
  background: var(--red-soft);
  border-left: 3px solid var(--red);
}

.login-submit {
  min-height: 50px;
  margin-top: 2px;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 2px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.login-submit:hover { background: #214d77; }
.login-submit:disabled { cursor: wait; opacity: 0.68; }

.login-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 28px;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.login-foot span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 7px 1px 0;
  background: var(--jade);
  border-radius: 50%;
}

:focus-visible {
  outline: 3px solid rgba(36, 95, 168, 0.42);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  scroll-margin-top: 84px;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  background: var(--navy);
  color: #edf3f5;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  overscroll-behavior: contain;
}

.brand {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
}

.brand-frame,
.brand-base {
  fill: none;
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 1.5;
}

.brand-line {
  fill: none;
  stroke: #7fc1b2;
  stroke-width: 2.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.brand small {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.primary-nav {
  display: grid;
  gap: 4px;
  padding: 24px 14px;
}

.nav-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  min-height: 46px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.nav-item:first-child svg {
  fill: currentColor;
  stroke: none;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.14);
}

.nav-item.is-active::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 28px;
  background: #7fc1b2;
  content: "";
}

.nav-count {
  min-width: 24px;
  padding: 1px 6px;
  color: #d9f0ea;
  font-family: var(--data);
  font-size: 11px;
  text-align: center;
  border: 1px solid rgba(127, 193, 178, 0.45);
}

.sidebar-foot {
  margin-top: auto;
  padding: 18px 22px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mode-lock {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: none;
  background: #78c3b1;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(120, 195, 177, 0.12);
}

.mode-lock strong,
.mode-lock small {
  display: block;
}

.mode-lock strong {
  font-size: 13px;
}

.mode-lock small,
.sidebar-foot p {
  color: rgba(255, 255, 255, 0.57);
  font-size: 11px;
}

.sidebar-foot p {
  margin: 13px 0 0;
  line-height: 1.7;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  z-index: 25;
  top: 0;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding-right: max(clamp(22px, 3vw, 48px), env(safe-area-inset-right));
  padding-left: max(clamp(22px, 3vw, 48px), env(safe-area-inset-left));
  background: rgba(232, 237, 240, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--data);
  font-size: 12px;
}

.breadcrumb strong {
  color: var(--ink);
  font-weight: 650;
}

.topbar-actions,
.freshness {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 18px;
}

.freshness {
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.freshness strong {
  color: var(--ink);
  font-family: var(--data);
}

.quiet-button,
.icon-button,
.primary-action,
.text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.quiet-button {
  min-height: 36px;
  gap: 7px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
}

.quiet-button:hover {
  background: var(--paper);
  border-color: var(--navy);
}

.user-button {
  display: grid;
  grid-template-columns: 28px auto auto;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 4px 9px 4px 5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}

.user-button:hover {
  border-color: var(--line-strong);
}

.user-button small {
  color: var(--muted);
}

.user-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #fff;
  background: var(--navy);
  border-radius: 2px;
  font-family: var(--display);
}

.operations-panel {
  margin-top: 20px;
}

.operations-head {
  align-items: center;
}

.operations-status {
  display: flex;
  align-items: center;
  gap: 24px;
}

.provider-state,
.scheduler-state {
  display: grid;
  grid-template-columns: 8px auto;
  align-items: center;
  gap: 0 8px;
  text-align: right;
}

.provider-state > span,
.scheduler-state > span {
  grid-row: 1 / 3;
  width: 8px;
  height: 8px;
  background: var(--line-strong);
  border-radius: 50%;
}

.provider-state > span.is-running,
.scheduler-state > span.is-running { background: var(--jade); }
.provider-state > span.is-missing { background: var(--red); }
.provider-state strong,
.scheduler-state strong { font-size: 12px; }
.provider-state small,
.scheduler-state small { color: var(--muted); }

.external-data-action:has(button:disabled) {
  background: rgba(244, 225, 221, 0.34);
}

.operation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  border-top: 1px solid var(--line);
}

.job-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.job-actions article {
  display: flex;
  min-height: 166px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.job-actions article:nth-last-child(-n + 2) { border-bottom: 0; }

.job-actions strong,
.job-actions p {
  display: block;
}

.job-actions strong { margin-top: 9px; }

.job-actions p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.job-actions button,
.dialog-actions button {
  min-height: 38px;
  padding: 0 13px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  cursor: pointer;
}

.job-actions button:hover,
.dialog-actions button:hover { border-color: var(--blue); }

.job-actions button.is-caution {
  color: var(--amber);
  border-color: rgba(155, 101, 23, 0.52);
}

.job-actions button:disabled,
.dialog-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.automation-control.is-enabled {
  background: rgba(217, 236, 231, 0.42);
}

.automation-control.is-enabled button {
  color: var(--red);
  border-color: rgba(182, 67, 52, 0.45);
}

.job-history {
  padding: 24px;
  background: #f3f6f5;
}

.job-history > header {
  display: flex;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.job-history > header span {
  color: var(--muted);
  font-size: 12px;
}

#job-history-list {
  display: grid;
}

.job-record {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.job-record:last-child { border-bottom: 0; }
.job-record strong { font-size: 12px; }
.job-record small { color: var(--muted); }

.job-error {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 11px 12px;
  background: var(--red-soft);
  border-left: 3px solid var(--red);
  overflow-wrap: anywhere;
}

.job-error-title {
  color: var(--red);
}

.job-error-advice,
.job-error-details p {
  margin: 0;
  color: var(--ink);
  font-size: 11px;
}

.job-error-details summary {
  width: fit-content;
  color: var(--red);
  cursor: pointer;
  font-size: 11px;
}

.job-error-details summary:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.job-error-details summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.job-error-details p {
  margin-top: 6px;
  font-family: var(--data);
}

.job-state {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.job-state.is-success { color: var(--jade); }
.job-state.is-failed { color: var(--red); }
.job-state.is-running { color: var(--blue); }

.operation-notice {
  margin: 0;
  padding: 13px 24px;
  color: var(--muted);
  background: #f8faf9;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.automation-dialog {
  width: min(calc(100% - 32px), 540px);
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  box-shadow: 0 28px 90px rgba(13, 31, 51, 0.32);
  overscroll-behavior: contain;
}

.automation-dialog::backdrop {
  background: rgba(10, 27, 45, 0.62);
  backdrop-filter: blur(2px);
}

.automation-dialog .dialog-head {
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
}

.automation-warning {
  margin: 24px 26px 16px;
  padding: 16px;
  background: var(--amber-soft);
  border-left: 3px solid var(--amber);
}

.automation-warning p {
  margin: 5px 0 0;
  color: #65543c;
}

.automation-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  margin: 0 26px;
  align-items: start;
}

.automation-check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--jade);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 24px 26px;
}

.dialog-actions .primary-action {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.account-record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.account-record-panel {
  min-width: 0;
}

.account-record-panel .table-scroll {
  border-top: 1px solid var(--line);
}

.compact-table th,
.compact-table td {
  padding: 11px 13px;
  font-size: 11px;
  white-space: nowrap;
}

.symbol-cell {
  font-family: var(--data);
  font-weight: 700;
}

.positive-text { color: var(--jade); }

.record-empty {
  margin: 0;
  padding: 28px 20px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

.icon-button:hover {
  color: var(--blue);
  background: var(--paper);
  border-color: var(--blue);
}

.quiet-button svg,
.primary-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.quiet-button.is-loading svg {
  animation: spin 0.85s linear infinite;
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.menu-button {
  display: none;
}

.loading-bar {
  position: fixed;
  z-index: 80;
  top: 67px;
  right: 0;
  left: var(--sidebar);
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.loading-bar span {
  display: block;
  width: 30%;
  height: 100%;
  background: var(--blue);
  opacity: 0;
}

body[data-loading="true"] .loading-bar span {
  opacity: 1;
  animation: loading 1.2s ease-in-out infinite;
}

.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 22px clamp(22px, 3vw, 48px) 0;
  padding: 14px 16px;
  background: var(--red-soft);
  border: 1px solid rgba(182, 67, 52, 0.35);
}

.error-banner strong,
.error-banner span {
  display: block;
}

.error-banner span {
  color: #73483f;
  font-size: 12px;
}

.error-banner button {
  min-height: 36px;
  padding: 0 14px;
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: 2px;
}

.error-banner button:hover {
  background: #8f3328;
}

.view {
  max-width: 1600px;
  margin: 0 auto;
  padding: 30px clamp(22px, 3vw, 48px) 42px;
  animation: view-in 260ms ease-out;
}

.decision-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(270px, 0.9fr) minmax(380px, 1.5fr) 150px;
  min-height: 330px;
  overflow: hidden;
  color: #f2f6f7;
  background: var(--navy);
  border-top: 5px solid #76b7a8;
  box-shadow: var(--shadow);
}

.decision-stage::after {
  position: absolute;
  right: 150px;
  bottom: -118px;
  width: 320px;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: skewX(-28deg);
  content: "";
  pointer-events: none;
}

.decision-copy {
  padding: clamp(30px, 4vw, 52px);
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.decision-copy .eyebrow {
  color: #8ac8ba;
}

.decision-copy h1,
.page-head h1 {
  margin: 18px 0 14px;
  font-family: var(--display);
  font-size: clamp(36px, 4.2vw, 62px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.stage-note {
  max-width: 360px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

.stage-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid currentColor;
}

.status-badge.is-safe {
  color: #9ee0d0;
}

.status-badge.is-watch {
  color: #efd296;
}

.status-badge.is-risk {
  color: #f2b2a7;
}

.decision-chain {
  position: relative;
  display: grid;
  align-content: center;
  gap: 0;
  margin: 0;
  padding: 38px 18px 38px 42px;
  list-style: none;
}

.decision-chain::before {
  position: absolute;
  top: 64px;
  bottom: 64px;
  left: 59px;
  width: 1px;
  background: rgba(255, 255, 255, 0.23);
  content: "";
}

.decision-chain li {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 16px;
  min-height: 62px;
}

.chain-index {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #9cd7ca;
  font-size: 11px;
  font-weight: 700;
  background: var(--navy);
  border: 1px solid rgba(156, 215, 202, 0.52);
  border-radius: 50%;
}

.decision-chain strong,
.decision-chain small {
  display: block;
}

.decision-chain strong {
  font-size: 14px;
}

.decision-chain small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.exposure-gauge {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.exposure-gauge svg {
  width: 122px;
  height: 122px;
  transform: rotate(-90deg);
}

.gauge-track,
.gauge-value {
  fill: none;
  stroke-width: 5;
}

.gauge-track {
  stroke: rgba(255, 255, 255, 0.15);
}

.gauge-value {
  stroke: #8fd2c2;
  stroke-linecap: square;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 339.3;
}

.exposure-gauge > div {
  position: absolute;
  display: grid;
  place-items: center;
}

.exposure-gauge strong,
.exposure-gauge span {
  display: block;
}

.exposure-gauge strong {
  font-family: var(--data);
  font-size: 31px;
  font-variant-numeric: tabular-nums;
}

.exposure-gauge span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
}

.metric-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
}

.metric-ribbon > div {
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}

.metric-ribbon > div:last-child {
  border-right: 0;
}

.metric-ribbon span,
.metric-ribbon strong,
.metric-ribbon small {
  display: block;
}

.metric-ribbon span {
  color: var(--muted);
  font-size: 11px;
}

.metric-ribbon strong {
  margin: 4px 0 1px;
  font-family: var(--data);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.metric-ribbon small {
  color: var(--muted);
  font-size: 10px;
}

.overview-grid,
.validation-grid,
.risk-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.72fr);
  gap: 18px;
  margin-top: 18px;
}

.secondary-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr);
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.panel-head {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.signal-toolbar h2,
.risk-gates h2,
.locked-live h2 {
  margin: 3px 0 0;
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.25;
}

.range-switch {
  display: flex;
  border: 1px solid var(--line);
}

.range-switch button {
  min-height: 31px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
}

.range-switch button:last-child {
  border-right: 0;
}

.range-switch button.is-active {
  color: #fff;
  background: var(--navy);
}

.range-switch button:hover:not(.is-active) {
  color: var(--blue);
  background: var(--paper);
}

.chart-summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 18px 22px 0;
}

.chart-summary strong {
  font-family: var(--data);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}

.chart-summary > span {
  color: var(--jade);
  font-family: var(--data);
  font-weight: 700;
}

.chart-summary output {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.chart-wrap {
  position: relative;
  padding: 4px 14px 14px;
}

.equity-chart {
  width: 100%;
  min-height: 280px;
  overflow: visible;
}

.chart-grid {
  stroke: #d8dfe3;
  stroke-width: 1;
}

.chart-axis-label {
  fill: #718093;
  font-family: var(--data);
  font-size: 11px;
}

.chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.chart-area {
  fill: rgba(36, 95, 168, 0.08);
  stroke: none;
}

.chart-cursor {
  stroke: var(--line-strong);
  stroke-dasharray: 4 4;
}

.chart-dot {
  fill: var(--paper);
  stroke: var(--blue);
  stroke-width: 2;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 130px;
  padding: 8px 10px;
  color: #fff;
  font-family: var(--data);
  font-size: 11px;
  pointer-events: none;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -110%);
}

.duty-list {
  padding: 2px 20px;
}

.duty-list article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.duty-list article:last-child {
  border-bottom: 0;
}

.duty-list strong {
  font-size: 13px;
}

.duty-list p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.duty-mark {
  align-self: start;
  padding: 2px 0;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  border: 1px solid currentColor;
}

.duty-mark.is-watch {
  color: var(--amber);
}

.duty-mark.is-safe {
  color: var(--jade);
}

.duty-mark.is-risk {
  color: var(--red);
}

.text-action {
  gap: 8px;
  margin: 4px 20px 18px;
  padding: 8px 0;
  color: var(--blue);
  font-weight: 700;
  background: transparent;
  border: 0;
}

.text-action:hover span {
  transform: translateX(3px);
}

.panel-aside {
  color: var(--muted);
  font-family: var(--data);
  font-size: 11px;
}

.sector-bars {
  display: grid;
  gap: 13px;
  padding: 22px;
}

.sector-row {
  display: grid;
  grid-template-columns: 90px minmax(120px, 1fr) 54px 38px;
  align-items: center;
  gap: 12px;
}

.sector-name {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sector-track {
  height: 8px;
  overflow: hidden;
  background: #dce3e7;
}

.sector-fill {
  width: 0;
  height: 100%;
  background: var(--blue);
}

.sector-row:first-child .sector-fill {
  background: var(--navy);
}

.sector-value,
.sector-count {
  color: var(--muted);
  font-family: var(--data);
  font-size: 11px;
  text-align: right;
}

.rebalance-list {
  padding: 8px 20px 16px;
}

.rebalance-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.rebalance-item:last-child {
  border-bottom: 0;
}

.rebalance-item time,
.rebalance-item span {
  color: var(--muted);
  font-family: var(--data);
  font-size: 11px;
}

.rebalance-item strong {
  font-size: 12px;
}

.page-head {
  display: flex;
  min-height: 230px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  padding: 36px 0 34px;
  border-bottom: 1px solid var(--line-strong);
}

.page-head h1 {
  margin-bottom: 0;
  font-size: clamp(38px, 5vw, 68px);
}

.primary-action {
  min-height: 44px;
  gap: 9px;
  padding: 0 17px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 2px;
}

.primary-action:hover {
  background: var(--navy);
  border-color: var(--navy);
}

.signal-summary-line {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.35fr;
  margin: 20px 0;
  background: transparent;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.signal-summary-line > div {
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.signal-summary-line > div:last-child {
  border-right: 0;
}

.signal-summary-line span,
.signal-summary-line strong {
  display: block;
}

.signal-summary-line span {
  color: var(--muted);
  font-size: 10px;
}

.signal-summary-line strong {
  margin-top: 3px;
  font-family: var(--data);
  font-size: 13px;
}

.status-inline {
  color: var(--amber);
}

.signal-approval button {
  min-height: 30px;
  margin-top: 4px;
  padding: 0 10px;
  color: var(--jade);
  background: transparent;
  border: 1px solid rgba(19, 123, 104, 0.42);
  border-radius: 2px;
  cursor: pointer;
}

.signal-approval button:hover { border-color: var(--jade); }
.signal-approval button:disabled { cursor: not-allowed; opacity: 0.55; }

.signal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.signal-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.signal-filters input,
.signal-filters select {
  height: 38px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
}

.signal-filters input {
  width: 210px;
  padding: 0 10px 0 36px;
}

.signal-filters select {
  min-width: 116px;
  padding: 0 30px 0 10px;
}

.search-field {
  position: relative;
}

.search-field:focus-within {
  outline: 3px solid rgba(36, 95, 168, 0.22);
  outline-offset: 2px;
}

.search-field svg {
  position: absolute;
  top: 10px;
  left: 11px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  pointer-events: none;
}

.table-meta {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 930px;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 13px 15px;
  text-align: left;
  border-bottom: 1px solid #dce2e6;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  background: #eef2f3;
}

.data-table tbody tr:hover {
  background: #f0f5f6;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.sort-button,
.symbol-button {
  padding: 0;
  color: inherit;
  font-weight: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.sort-button:hover,
.symbol-button:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.symbol-button {
  color: var(--blue);
  font-family: var(--data);
  font-weight: 700;
}

.action-tag,
.review-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid currentColor;
}

.action-tag.buy {
  color: var(--red);
  background: var(--red-soft);
}

.action-tag.sell {
  color: var(--jade);
  background: var(--jade-soft);
}

.review-tag {
  color: var(--amber);
  background: var(--amber-soft);
}

.score-cell,
.money-cell {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: 56px 20px;
  text-align: center;
}

.empty-state p {
  color: var(--muted);
}

.signal-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  box-shadow: 0 30px 100px rgba(12, 27, 43, 0.28);
  overscroll-behavior: contain;
}

.signal-dialog::backdrop {
  background: rgba(11, 25, 40, 0.58);
  backdrop-filter: blur(3px);
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 4px 0 0;
  font-family: var(--data);
  font-size: 30px;
}

.dialog-head p:last-child {
  margin: 0;
  color: var(--muted);
}

.dialog-decision {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 5px 20px;
  padding: 20px 24px;
  background: var(--navy);
  color: #fff;
}

.dialog-decision span {
  grid-row: 1 / 3;
  align-self: center;
  font-size: 18px;
  font-weight: 700;
}

.dialog-decision strong {
  font-family: var(--data);
  font-size: 28px;
}

.dialog-decision small {
  color: rgba(255, 255, 255, 0.55);
  text-align: right;
}

.factor-list {
  display: grid;
  gap: 14px;
  padding: 22px 24px;
}

.factor-row {
  display: grid;
  grid-template-columns: 70px 1fr 60px;
  align-items: center;
  gap: 12px;
}

.factor-row span,
.factor-row strong {
  font-size: 11px;
}

.factor-row strong {
  font-family: var(--data);
  text-align: right;
}

.factor-track {
  position: relative;
  height: 7px;
  background: #dbe2e6;
}

.factor-track::after {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 50%;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.factor-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--blue);
}

.factor-fill.is-negative {
  background: var(--amber);
}

.dialog-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dialog-facts div {
  padding: 13px;
  border-right: 1px solid var(--line);
}

.dialog-facts div:last-child {
  border-right: 0;
}

.dialog-facts dt {
  color: var(--muted);
  font-size: 9px;
}

.dialog-facts dd {
  margin: 3px 0 0;
  font-family: var(--data);
  font-size: 12px;
}

.dialog-reason {
  margin: 0;
  padding: 18px 24px 24px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.account-head {
  align-items: center;
}

.account-mode {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 18px;
  color: #fff;
  background: var(--navy);
  border-left: 4px solid #78c3b1;
}

.account-mode strong,
.account-mode small {
  display: block;
}

.account-mode strong {
  font-family: var(--data);
  letter-spacing: 0.08em;
}

.account-mode small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
}

.account-ledger {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.balance-block,
.ledger-status {
  padding: clamp(26px, 4vw, 48px);
}

.balance-block {
  border-right: 1px solid var(--line);
}

.balance-block h2 {
  margin: 15px 0 0;
  font-family: var(--data);
  font-size: clamp(45px, 6vw, 78px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.balance-block h2 small {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.balance-block > p:last-of-type {
  color: var(--muted);
  font-family: var(--data);
  font-size: 11px;
}

.balance-split {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 34px;
  border-top: 1px solid var(--line);
}

.balance-split > div {
  padding: 15px 12px 0 0;
}

.balance-split span,
.balance-split strong {
  display: block;
}

.balance-split span {
  color: var(--muted);
  font-size: 10px;
}

.balance-split strong {
  margin-top: 4px;
  font-family: var(--data);
  font-size: 16px;
}

.ledger-status h2 {
  margin: 8px 0 10px;
  font-family: var(--display);
  font-size: 24px;
}

.ledger-status > p {
  color: var(--muted);
  font-size: 12px;
}

.ledger-status dl {
  margin: 26px 0 0;
}

.ledger-status dl div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.ledger-status dt {
  color: var(--muted);
}

.ledger-status dd {
  margin: 0;
  font-family: var(--data);
}

.danger-text {
  color: var(--red);
  font-weight: 700;
}

.lifecycle-panel {
  margin-top: 20px;
}

.lifecycle {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 30px 24px 32px;
  list-style: none;
}

.lifecycle li {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding-right: 18px;
}

.lifecycle li::after {
  position: absolute;
  top: 17px;
  right: 0;
  left: 36px;
  height: 1px;
  background: var(--line);
  content: "";
}

.lifecycle li:last-child::after {
  display: none;
}

.lifecycle li > span {
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--muted);
  font-family: var(--data);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.lifecycle .is-done > span {
  color: #fff;
  background: var(--jade);
  border-color: var(--jade);
}

.lifecycle .is-current > span {
  color: #fff;
  background: var(--amber);
  border-color: var(--amber);
}

.lifecycle strong,
.lifecycle p {
  display: block;
}

.lifecycle strong {
  margin-top: 7px;
  font-size: 12px;
}

.lifecycle p {
  margin: 6px 0 0 -48px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.locked-live {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding: 24px;
  color: #fff;
  background: var(--ink);
  border-left: 5px solid var(--red);
}

.locked-live .section-kicker {
  color: #e7a79c;
}

.locked-live h2 {
  margin-top: 4px;
}

.locked-live p:last-child {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

.lock-symbol {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.lock-symbol svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: #e8ada3;
  stroke-width: 1.7;
}

.locked-live button {
  min-height: 42px;
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.research-stamp {
  display: grid;
  min-width: 160px;
  padding: 16px 20px;
  color: var(--red);
  border: 3px double var(--red);
  transform: rotate(-3deg);
}

.research-stamp span,
.research-stamp strong,
.research-stamp small {
  line-height: 1;
}

.research-stamp span {
  font-family: var(--data);
  font-size: 13px;
  letter-spacing: 0.2em;
}

.research-stamp strong {
  margin: 4px 0;
  font-family: var(--data);
  font-size: 34px;
  letter-spacing: 0.08em;
}

.research-stamp small {
  font-size: 10px;
}

.validation-scoreboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 20px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.validation-scoreboard article {
  padding: 22px 18px;
  border-right: 1px solid var(--line);
}

.validation-scoreboard article:last-child {
  border-right: 0;
}

.validation-scoreboard span,
.validation-scoreboard strong,
.validation-scoreboard p {
  display: block;
}

.validation-scoreboard span {
  color: var(--muted);
  font-size: 10px;
}

.validation-scoreboard strong {
  margin: 6px 0 2px;
  font-family: var(--data);
  font-size: 28px;
}

.validation-scoreboard p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 14px;
  height: 5px;
  background: var(--blue);
}

.legend i.stress {
  background: var(--amber);
}

.window-chart {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.window-row {
  display: grid;
  grid-template-columns: 86px 1fr 68px;
  align-items: center;
  gap: 12px;
}

.window-row > span {
  color: var(--muted);
  font-family: var(--data);
  font-size: 10px;
}

.window-bars {
  display: grid;
  gap: 4px;
}

.window-track {
  position: relative;
  height: 8px;
  background: #dce2e6;
}

.window-zero {
  position: absolute;
  z-index: 2;
  top: -2px;
  bottom: -2px;
  left: 35%;
  width: 1px;
  background: var(--line-strong);
}

.window-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 35%;
  background: var(--blue);
}

.window-bar.is-negative {
  background: var(--red);
}

.window-bar.stress {
  background: var(--amber);
}

.window-return {
  font-family: var(--data);
  font-size: 11px;
  text-align: right;
}

.metric-list {
  margin: 0;
  padding: 8px 20px 18px;
}

.metric-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.metric-list div:last-child {
  border-bottom: 0;
}

.metric-list dt {
  color: var(--muted);
}

.metric-list dd {
  margin: 0;
  font-family: var(--data);
  font-weight: 650;
}

.plain-list {
  margin: 0;
  padding: 8px 20px 18px;
  list-style: none;
}

.plain-list li {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.plain-list li:last-child {
  border-bottom: 0;
}

.plain-list strong,
.plain-list span {
  display: block;
}

.plain-list strong {
  font-size: 12px;
}

.plain-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.gate-state {
  display: grid;
  min-width: 180px;
  padding: 15px 18px;
  color: #fff;
  background: var(--red);
}

.gate-state span,
.gate-state small {
  font-size: 10px;
}

.gate-state strong {
  font-family: var(--display);
  font-size: 22px;
}

.gate-state small {
  color: rgba(255, 255, 255, 0.72);
}

.risk-gates {
  margin-top: 24px;
}

.risk-gates > header {
  margin-bottom: 14px;
}

.gate-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.gate-grid article {
  min-height: 210px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
}

.gate-grid article:last-child {
  border-right: 0;
}

.gate-code {
  display: inline-block;
  min-width: 42px;
  padding: 2px 5px;
  color: var(--blue);
  font-family: var(--data);
  font-size: 10px;
  text-align: center;
  border: 1px solid var(--blue);
}

.gate-grid strong,
.gate-grid p,
.gate-grid em {
  display: block;
}

.gate-grid strong {
  margin-top: 22px;
  font-family: var(--display);
  font-size: 18px;
}

.gate-grid p {
  min-height: 48px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.gate-pass {
  color: var(--jade);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.data-health-panel {
  margin-top: 24px;
}

.health-table {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.health-source {
  padding: 20px;
  border-right: 1px solid var(--line);
}

.health-source:last-child {
  border-right: 0;
}

.health-source header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.health-source header strong {
  font-size: 13px;
}

.health-ok {
  color: var(--jade);
  font-size: 10px;
  font-weight: 700;
}

.health-source dl {
  margin: 0;
}

.health-source dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 10px;
  border-bottom: 1px solid var(--line);
}

.health-source dl div:last-child {
  border-bottom: 0;
}

.health-source dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--data);
}

.risk-config-grid {
  grid-template-columns: 1fr 1fr;
}

.factor-config > div {
  display: grid;
  gap: 13px;
  padding: 22px 20px 10px;
}

.weight-row {
  display: grid;
  grid-template-columns: 74px 1fr 48px;
  align-items: center;
  gap: 12px;
}

.weight-row span,
.weight-row strong {
  font-size: 11px;
}

.weight-row strong {
  font-family: var(--data);
  text-align: right;
}

.weight-track {
  height: 7px;
  background: #dce2e6;
}

.weight-fill {
  height: 100%;
  background: var(--blue);
}

.config-note {
  margin: 8px 20px 20px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 10px;
  border-top: 1px solid var(--line);
}

.app-footer {
  display: flex;
  max-width: 1600px;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 20px clamp(22px, 3vw, 48px) 30px;
  color: var(--muted);
  font-family: var(--data);
  font-size: 10px;
  border-top: 1px solid var(--line);
}

.sidebar-scrim {
  display: none;
}

@keyframes loading {
  from { transform: translateX(-120%); }
  to { transform: translateX(430%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  :root {
    --sidebar: 210px;
  }

  .decision-stage {
    grid-template-columns: 1fr 1.35fr;
  }

  .exposure-gauge {
    position: absolute;
    top: 28px;
    right: 26px;
    border-left: 0;
  }

  .decision-chain {
    padding-right: 150px;
  }

  .gate-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gate-grid article:nth-child(3) {
    border-right: 0;
  }

  .gate-grid article:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .health-table {
    grid-template-columns: repeat(2, 1fr);
  }

  .health-source:nth-child(2) {
    border-right: 0;
  }

  .health-source:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 920px) {
  .account-record-grid {
    grid-template-columns: 1fr;
  }

  .operation-layout {
    grid-template-columns: 1fr;
  }

  .job-actions article:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .job-history {
    border-top: 1px solid var(--line);
  }
  :root {
    --sidebar: 248px;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: 20px 0 60px rgba(12, 27, 43, 0.28);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 35;
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgba(13, 27, 42, 0.5);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .sidebar-scrim.is-visible {
    visibility: visible;
    opacity: 1;
  }

  .workspace {
    margin-left: 0;
  }

  .menu-button {
    display: inline-flex;
  }

  .topbar {
    gap: 14px;
  }

  .breadcrumb {
    margin-right: auto;
  }

  .loading-bar {
    left: 0;
  }

  .decision-stage {
    grid-template-columns: 1fr;
  }

  .decision-copy {
    padding-right: 170px;
  }

  .decision-chain {
    grid-template-columns: repeat(4, 1fr);
    padding: 20px 30px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .decision-chain::before {
    top: 38px;
    right: 74px;
    bottom: auto;
    left: 74px;
    width: auto;
    height: 1px;
  }

  .decision-chain li {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
    text-align: center;
  }

  .decision-chain small {
    display: none;
  }

  .overview-grid,
  .secondary-grid,
  .validation-grid,
  .risk-config-grid {
    grid-template-columns: 1fr;
  }

  .metric-ribbon,
  .validation-scoreboard {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-ribbon > div:nth-child(2),
  .validation-scoreboard article:nth-child(2) {
    border-right: 0;
  }

  .metric-ribbon > div:nth-child(n + 3),
  .validation-scoreboard article:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .signal-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .signal-filters {
    width: 100%;
  }

  .search-field,
  .signal-filters input {
    width: 100%;
  }

  .account-ledger {
    grid-template-columns: 1fr;
  }

  .balance-block {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .lifecycle {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 0;
  }

  .lifecycle li:nth-child(2)::after {
    display: none;
  }

  .locked-live {
    grid-template-columns: 58px 1fr;
  }

  .locked-live button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .login-card {
    padding: 30px 24px;
  }

  .login-brand {
    margin-bottom: 36px;
  }

  .job-actions {
    grid-template-columns: 1fr;
  }

  .job-actions article {
    min-height: auto;
    border-right: 0;
  }

  .scheduler-state {
    text-align: left;
  }

  .operations-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .provider-state {
    text-align: left;
  }

  .operations-head {
    align-items: flex-start;
  }

  .user-button {
    grid-template-columns: 28px;
    padding-right: 5px;
  }

  .user-button > span:not(.user-avatar),
  .user-button small {
    display: none;
  }
  .topbar {
    height: 60px;
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }

  .freshness span,
  .quiet-button span,
  .breadcrumb > span:first-child,
  .breadcrumb > span:nth-child(2) {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .quiet-button {
    width: 40px;
    padding: 0;
  }

  .loading-bar {
    top: 59px;
  }

  .view {
    padding: 18px 14px 30px;
  }

  .decision-stage {
    min-height: 0;
  }

  .decision-copy {
    padding: 28px 24px 25px;
  }

  .decision-copy h1,
  .page-head h1 {
    font-size: 38px;
  }

  .stage-note {
    max-width: 230px;
    font-size: 12px;
  }

  .exposure-gauge {
    top: 24px;
    right: 14px;
    transform: scale(0.72);
    transform-origin: top right;
  }

  .decision-chain {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 0;
  }

  .decision-chain::before {
    display: none;
  }

  .decision-chain li {
    min-height: 54px;
  }

  .metric-ribbon > div {
    padding: 16px;
  }

  .metric-ribbon strong {
    font-size: 21px;
  }

  .panel-head {
    min-height: 68px;
    padding: 14px 15px;
  }

  .panel-head h2,
  .signal-toolbar h2 {
    font-size: 18px;
  }

  .range-switch button {
    padding: 0 8px;
    font-size: 10px;
  }

  .chart-summary {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 14px 15px 0;
  }

  .chart-summary strong {
    font-size: 25px;
  }

  .chart-summary output {
    width: 100%;
    margin-left: 0;
  }

  .equity-chart {
    min-height: 220px;
  }

  .sector-row {
    grid-template-columns: 74px minmax(80px, 1fr) 44px;
    gap: 8px;
  }

  .sector-count {
    display: none;
  }

  .page-head {
    min-height: 190px;
    align-items: flex-start;
    flex-direction: column;
    padding: 26px 0;
  }

  .page-head h1 {
    margin-top: 13px;
  }

  .primary-action,
  .research-stamp,
  .gate-state,
  .account-mode {
    align-self: flex-start;
  }

  .signal-summary-line {
    grid-template-columns: repeat(2, 1fr);
  }

  .signal-summary-line > div:nth-child(2) {
    border-right: 0;
  }

  .signal-summary-line > div:nth-child(4) {
    border-right: 0;
  }

  .signal-summary-line > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .signal-summary-line > div:last-child {
    grid-column: 1 / -1;
  }

  .signal-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .signal-filters select {
    width: 100%;
    min-width: 0;
  }

  .dialog-facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .dialog-facts div:nth-child(2) {
    border-right: 0;
  }

  .dialog-facts div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .balance-block,
  .ledger-status {
    padding: 24px 20px;
  }

  .balance-block h2 {
    font-size: 48px;
  }

  .balance-split {
    grid-template-columns: 1fr;
  }

  .balance-split > div {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .lifecycle {
    grid-template-columns: 1fr;
  }

  .lifecycle li::after {
    top: 34px;
    bottom: -29px;
    left: 17px;
    width: 1px;
    height: auto;
  }

  .lifecycle li:nth-child(2)::after {
    display: block;
  }

  .lifecycle p {
    margin-left: 0;
    padding-top: 0;
  }

  .locked-live {
    grid-template-columns: 1fr;
  }

  .locked-live button {
    grid-column: 1;
  }

  .validation-scoreboard article {
    padding: 17px 13px;
  }

  .validation-scoreboard strong {
    font-size: 23px;
  }

  .legend {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .window-row {
    grid-template-columns: 70px 1fr 52px;
    gap: 8px;
  }

  .gate-grid,
  .health-table {
    grid-template-columns: 1fr;
  }

  .gate-grid article,
  .health-source {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .gate-grid article:last-child,
  .health-source:last-child {
    border-bottom: 0;
  }

  .gate-grid p {
    min-height: 0;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
