﻿:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --ink: #172033;
  --muted: #66758a;
  --faint: #94a3b8;
  --line: #e3e8f0;
  --line-soft: #edf2f7;
  --surface: #ffffff;
  --surface-blue: #f5f8ff;
  --blue: #2563eb;
  --blue-dark: #1e40af;
  --teal: #0f766e;
  --teal-soft: #e7f6f2;
  --green: #16845a;
  --green-soft: #e9f7ef;
  --red: #c2412f;
  --red-soft: #fff1ed;
  --amber: #b7791f;
  --amber-soft: #fff7e6;
  --violet: #6d5bd0;
  --violet-soft: #f1efff;
}

* { box-sizing: border-box; }
html {
  height: 100%;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}
body {
  height: 100%;
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f8fbff 0, var(--bg) 260px);
  overflow: hidden;
}
button, input, select, textarea { font: inherit; }
.layout { display: grid; grid-template-columns: 240px 1fr; height: 100vh; min-height: 100vh; overflow: hidden; }
.mobile-appbar {
  display: none;
}
.mobile-icon-button {
  border: 0;
  background: transparent;
  color: #4b5563;
  min-width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  line-height: 1;
}
.mobile-user-chip {
  min-width: 0;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #5f636b;
  font-size: 16px;
  font-weight: 800;
}
.mobile-user-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-user-avatar {
  width: 30px;
  height: 30px;
  line-height: 30px;
  font-size: 13px;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, #102033 0%, #101827 58%, #0b1220 100%);
  color: white;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sidebar-top {
  flex: 0 0 auto;
  padding-bottom: 18px;
}
.sidebar-middle {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 2px 0 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-bottom {
  flex: 0 0 auto;
  padding-top: 14px;
}
.brand { font-size: 22px; font-weight: 700; }
.brand-logo {
  display: block;
  width: 100%;
  max-width: 196px;
  height: auto;
  margin: 0 0 12px;
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(0,0,0,.16);
}
.brand-fallback { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand span { display: block; }
.brand em,
.nav-label em {
  display: block;
  margin-top: 2px;
  font-family: YouYuan, "YouYuan", "Microsoft YaHei", Arial, sans-serif;
  font-size: .68em;
  font-style: normal;
  font-weight: 650;
  color: #9fb3c8;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand em {
  font-weight: 850;
}
.brand small {
  display: block;
  color: #9fb3c8;
  font-family: "Microsoft YaHei", YouYuan, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.brand-version {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 10px;
  padding: 4px 8px;
  border: 1px solid rgba(159,179,200,.34);
  border-radius: 7px;
  color: #dbeafe;
  background: rgba(37,99,235,.18);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.nav {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 14px 3px 14px 0;
}
.nav button { width: 100%; text-align: left; border: 0; color: #d6e0eb; background: transparent; padding: 11px 12px; border-radius: 8px; cursor: pointer; }
.nav-label { display: block; line-height: 1.25; }
.nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav button.active { background: var(--blue); color: white; box-shadow: inset 3px 0 0 #9cc5ff; }
.nav button.active .nav-label em { color: #dbeafe; }
.userbox {
  flex: 0 0 auto;
  color: #cbd5e1;
  font-size: 13px;
  display: grid;
  gap: 4px;
}
.userbox-profile {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.userbox strong,
.userbox span,
.userbox em {
  display: block;
  overflow-wrap: anywhere;
}
.userbox strong {
  color: #f8fafc;
  font-size: 14px;
}
.userbox em {
  color: #9fb3c8;
  font-style: normal;
  font-size: 12px;
}
.userbox-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.sidebar-disclaimer {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: #92a4ba;
  font-size: 11px;
  line-height: 1.55;
}
.content {
  min-width: 0;
  height: 100vh;
  padding: 18px 24px 0;
  display: grid;
  grid-template-rows: auto 96px minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}
.topbar {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 42px;
  min-width: 0;
}
.topbar h1 { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 24px; color: #111827; white-space: nowrap; }
.title-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
  line-height: 1.12;
}
.title-stack small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-ribbon {
  min-width: 0;
  height: 96px;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #cdddf8;
  border-radius: 8px;
  background: #f3f7ff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 6px 18px rgba(38, 64, 91, .04);
}
.market-ribbon-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.market-ribbon-label {
  color: #17345f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.topbar-controls {
  flex-wrap: nowrap;
  min-width: 0;
  width: 100%;
  justify-content: flex-start;
}
.topbar-market-session {
  min-width: 0;
  max-width: min(452px, 41vw);
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: hidden;
}
.topbar-market-session .market-clock-item {
  width: 140px;
  min-width: 140px;
  min-height: 56px;
  padding: 5px 7px;
  grid-template-columns: minmax(0, 1fr) max-content;
  row-gap: 2px;
}
.topbar-market-session .market-clock-item b {
  grid-column: 1 / -1;
}
.topbar-market-session .market-clock-item u {
  grid-column: 1 / -1;
}
.topbar-market-session .market-clock-item u {
  display: block;
  font-size: 11px;
}
.topbar-market-session .market-clock-item b,
.topbar-market-session .market-clock-item i,
.topbar-market-session .market-clock-item u {
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-market-session .market-clock-item em {
  justify-self: end;
}
.topbar-market-session .market-clock-hint {
  display: none;
}
#view {
  min-height: 0;
  overflow-y: auto;
  padding: 2px 2px 24px 0;
  scrollbar-gutter: stable;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.account-shortcut {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid #d4dce8;
  border-radius: 999px;
  padding: 5px;
  background: #fff;
  color: #25364f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(38, 64, 91, .06);
}
.account-shortcut:hover {
  border-color: #b9c7d8;
  background: #f8fbff;
}
.account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
  line-height: 30px;
  text-align: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}
.account-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}
.account-avatar.has-image {
  background: #eef4fb;
}
.account-avatar[data-avatar="teal"] { background: var(--teal-soft); color: var(--teal); }
.account-avatar[data-avatar="blue"] { background: #eaf1ff; color: var(--blue-dark); }
.account-avatar[data-avatar="amber"] { background: var(--amber-soft); color: #9a5f10; }
.account-avatar[data-avatar="rose"] { background: #fff0f4; color: #be185d; }
.account-avatar[data-avatar="violet"] { background: var(--violet-soft); color: var(--violet); }
.account-avatar[data-avatar="slate"] { background: #e8eef6; color: #334155; }
.account-avatar.has-image { background: #eef4fb; color: transparent; }
.userbox-avatar {
  width: 38px;
  height: 38px;
  font-size: 16px;
  line-height: 38px;
  align-self: center;
}
.status {
  align-self: center;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  display: inline-block;
  width: 132px;
  min-width: 122px;
  min-height: 20px;
  line-height: 20px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-clock {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  padding-bottom: 3px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.ticker-track {
  display: flex;
  width: max-content;
  gap: 6px;
  align-items: center;
  animation: ticker-scroll var(--ticker-duration, 42s) linear infinite;
  will-change: transform;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}
.index-track {
  gap: 5px;
}
.market-clock:hover .ticker-track,
.index-ticker:hover .ticker-track,
.quote-ticker:hover .ticker-track {
  animation-play-state: paused;
}
@keyframes ticker-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
.market-clock-item {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
  display: grid;
  grid-template-columns: max-content max-content;
  column-gap: 6px;
  row-gap: 1px;
  align-items: baseline;
  color: #25364f;
  font-size: 12px;
  line-height: 1.18;
}
.market-clock-item b,
.market-clock-item em,
.market-clock-item i,
.market-clock-item u {
  font-style: normal;
  white-space: nowrap;
}
.market-clock-item b {
  color: #51647c;
}
.market-clock-item em {
  font-weight: 800;
  font-size: 12px;
}
.market-clock-item i {
  grid-column: 1;
  color: var(--muted);
  font-weight: 900;
}
.market-clock-item u {
  display: block;
  grid-column: 2;
  color: #6b778c;
  text-decoration: none;
  font-size: 11px;
}
.market-clock-item.open {
  border-color: #bfe4d1;
  background: #f4fbf7;
}
.market-clock-item.open i {
  color: var(--green);
  font-weight: 800;
}
.market-clock-item.open u {
  color: #2b7f58;
}
.market-clock-item.break {
  border-color: #f0ddb3;
  background: #fffaf0;
}
.market-clock-item.break i {
  color: #9a6b13;
  font-weight: 800;
}
.market-clock-item.break u {
  color: #8d6a20;
}
.market-clock-item.closed,
.market-clock-item.idle {
  background: #f8fafc;
}
.market-clock-hint {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid #e8d6a8;
  border-radius: 999px;
  background: #fff8e7;
  color: #7a5a13;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.topbar-market-hint {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.index-ticker,
.quote-ticker {
  min-width: 0;
  display: block;
  overflow-x: hidden;
  overflow-y: hidden;
  padding-bottom: 3px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.quote-chip {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-grid;
  grid-template-columns: max-content max-content max-content;
  gap: 7px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #25364f;
  font-size: 12px;
  white-space: nowrap;
}
.quote-chip b,
.quote-chip em,
.quote-chip i {
  font-style: normal;
}
.quote-chip b {
  color: #172033;
  font-weight: 900;
}
.quote-chip em {
  color: #51647c;
  font-weight: 800;
}
.quote-chip.ok i {
  color: var(--green);
  font-weight: 900;
}
.quote-chip.warn i {
  color: var(--red);
  font-weight: 900;
}
.quote-chip.empty {
  color: var(--muted);
}
.index-ticker .quote-chip {
  padding: 5px 7px;
  gap: 6px;
}
.card, .panel { max-width: 100%; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; box-shadow: 0 10px 26px rgba(38, 64, 91, .045); contain: layout paint; }
.annual-goal {
  display: grid;
  grid-template-columns: minmax(580px, 640px) minmax(420px, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  border-color: #cdddf8;
  background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 100%);
  min-height: 134px;
}
.annual-goal span,
.annual-goal label {
  color: var(--muted);
  font-size: 13px;
}
.annual-goal .goal-label {
  display: grid;
  gap: 2px;
  color: #31425d;
  line-height: 1.15;
}
.annual-goal .goal-label b {
  color: #172033;
  font-size: 16px;
  font-weight: 900;
}
.annual-goal .goal-label em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.annual-goal strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
  color: var(--blue-dark);
}
.annual-goal small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.annual-goal-main .button {
  margin-top: 10px;
}
.annual-goal-triplet {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  min-height: 118px;
  overflow: hidden;
  border: 1px solid #dce7f4;
  border-radius: 8px;
  background: rgba(255,255,255,.76);
}
.annual-goal-triplet > div {
  position: relative;
  min-width: 0;
  padding: 11px 12px;
  border: 0;
  background: transparent;
  display: grid;
  align-content: start;
}
.annual-goal-triplet > div:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 0;
  width: 1px;
  height: 64px;
  border-radius: 999px;
  background: #e6edf5;
}
.annual-goal-triplet strong {
  font-size: 14px;
}
.annual-goal-triplet .money-stack {
  gap: 2px;
}
.annual-goal-triplet .money-stack span {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 4px;
}
.annual-goal-triplet .money-stack b {
  overflow-wrap: anywhere;
}
.annual-goal-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.annual-goal-progress {
  min-width: 0;
}
.annual-goal-progress b {
  color: var(--teal);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.1;
}
.goal-bar {
  height: 9px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe7f5;
}
.goal-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}
.annual-goal-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; align-items: stretch; }
.grid .metric { min-height: 118px; }
.grid.compact .metric { min-height: 92px; }
.grid.compact .metric strong { font-size: 18px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric .goal-label {
  display: grid;
  gap: 2px;
  color: #31425d;
  line-height: 1.15;
}
.metric .goal-label b {
  display: block;
  color: #172033;
  font-size: 17px;
  font-weight: 900;
}
.metric .goal-label em {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.metric .metric-label b { font-size: 17px; }
.metric strong { display: block; font-size: 16px; margin-top: 9px; color: #1f2a44; min-height: 32px; }
.stock-overview-holdings .metric .metric-label b,
.dashboard-overview-holdings .metric .metric-label b {
  font-size: 15.5px;
}
.stock-overview-holdings .metric .metric-label em,
.dashboard-overview-holdings .metric .metric-label em {
  font-size: 11.5px;
}
.stock-overview-status .metric .metric-label b,
.dashboard-overview-status .metric .metric-label b {
  font-size: 15px;
}
.stock-overview-status .metric .metric-label em,
.dashboard-overview-status .metric .metric-label em {
  font-size: 11px;
}
.risk-highlight-card .metric-label b,
.risk-highlight-card .metric-label em {
  color: #9f2318;
}
.risk-highlight-card strong.risk-low,
.risk-score.risk-low {
  color: #15803d;
}
.risk-highlight-card strong.risk-medium,
.risk-score.risk-medium {
  color: #b7791f;
}
.risk-highlight-card strong.risk-high,
.risk-score.risk-high {
  color: #b91c1c;
}
.risk-score {
  display: block;
  font-weight: 900;
}
.risk-highlight-card .metric-note span {
  display: block;
  margin-top: 3px;
}
.risk-highlight-card strong.warn {
  color: #b91c1c;
}
.risk-highlight-card strong.ok {
  color: #15803d;
}
.risk-highlight-card {
  background: linear-gradient(180deg, #fff8f6 0%, #ffffff 100%);
}
.metric:nth-child(1) { border-top: 3px solid var(--blue); }
.metric:nth-child(2) { border-top: 3px solid var(--teal); }
.metric:nth-child(3) { border-top: 3px solid var(--green); }
.metric:nth-child(4) { border-top: 3px solid var(--violet); }
.risk-highlight-card {
  border-top: 3px solid #dc2626;
}
.metric small { font-size: 12px; color: inherit; }
.metric-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.metric.forecast-metric {
  border-top-color: var(--amber);
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
}
.forecast-metric .metric-note {
  color: var(--amber);
}
.dashboard-overview {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.dashboard-overview-goals {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dashboard-overview-holdings {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.dashboard-overview-status {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.dashboard-overview .metric {
  min-height: 104px;
}
.dashboard-overview-holdings .metric,
.stock-overview-holdings .metric {
  min-height: 128px;
}
.dashboard-overview-status .metric,
.stock-overview-status .metric {
  min-height: 118px;
}
.dashboard-overview-goals .metric {
  min-height: 112px;
}
.dashboard-goal-card {
  align-content: start;
}
.compact-goal-form {
  margin-top: 10px;
  max-width: 420px;
}
.compact-goal-form label {
  color: var(--muted);
  font-size: 12px;
}
.compact-goal-form input {
  min-height: 34px;
  padding-top: 7px;
  padding-bottom: 7px;
}
.compact-goal-form .button {
  align-self: end;
}
.asset-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  margin-bottom: 14px;
  align-items: stretch;
  min-width: 0;
}
.asset-class-card {
  min-width: 0;
  min-height: 214px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.asset-class-card.asset-type-stock { border-top: 3px solid var(--blue); background: #f7faff; }
.asset-class-card.asset-type-fund { border-top: 3px solid var(--green); background: #f6fcf8; }
.asset-class-card.asset-type-precious_metal { border-top: 3px solid var(--amber); background: #fffbf1; }
.asset-class-card.asset-type-crypto { border-top: 3px solid var(--violet); background: #f8f6ff; }
.asset-class-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.asset-class-head small {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.asset-class-card > strong {
  display: block;
  min-height: 62px;
  color: #1f2a44;
  min-width: 0;
  overflow-wrap: anywhere;
}
.asset-class-card > strong .money-stack {
  gap: 3px;
}
.asset-class-card > strong .money-stack span {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
}
.asset-class-card > strong .money-stack b {
  font-size: 17px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.asset-class-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.asset-class-stats span {
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: 12px;
}
.asset-class-stats b {
  display: block;
  margin-top: 4px;
  color: #1f2a44;
}
.asset-class-stats .money-stack span {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  grid-template-columns: 42px minmax(0, 1fr);
}
.asset-class-stats .money-stack b {
  margin-top: 0;
  font-size: 12px;
}
.forecast-value {
  color: var(--blue-dark);
  font-weight: 700;
  white-space: nowrap;
}
.forecast-value.estimate {
  color: var(--amber);
}
.forecast-value.muted {
  color: var(--muted);
}
.stock-overview {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.stock-annual-goal {
  margin-bottom: 0;
}
.stock-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.stock-overview-goals {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stock-overview-holdings {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stock-overview-status {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dashboard-overview .dashboard-overview-status {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.dashboard-overview-status .metric {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: stretch;
}
.dashboard-overview-status .metric .metric-note {
  align-self: end;
}
.dashboard-overview-holdings .metric,
.stock-overview-holdings .metric,
.stock-overview-status .metric {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: stretch;
}
.dashboard-overview-holdings .metric .metric-note,
.stock-overview-holdings .metric .metric-note,
.stock-overview-status .metric .metric-note {
  align-self: end;
}
.stock-overview-grid .metric {
  min-height: 104px;
}
.stock-overview-goals .metric {
  min-height: 92px;
}
.stock-overview-holdings .metric {
  border-top-color: #d6e6dc;
}
.stock-overview-status .metric {
  min-height: 118px;
  border-color: #d8dce8;
  background: #fcfcff;
}
.dashboard-overview-holdings .metric,
.stock-overview-holdings .metric {
  min-height: 128px;
}
.dashboard-overview-status .metric,
.stock-overview-status .metric {
  min-height: 118px;
}
.stock-overview-grid .split-metric {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
}
.stock-overview-grid .split-metric > div + div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.stock-overview-grid .stock-goal-card,
.stock-overview-grid .stock-progress-card {
  border-color: #bfd2ee;
  border-top: 3px solid #5a84c8;
  background: linear-gradient(135deg, #ffffff 0%, #f6f9ff 100%);
}
.stock-overview-grid .stock-judgement-card,
.stock-overview-grid .forecast-metric {
  border-top: 3px solid #74829a;
}
.stock-overview-grid .stock-goal-card .button {
  width: max-content;
  margin-top: 8px;
}
.stock-overview-grid .stock-progress-card .goal-bar {
  margin-top: 8px;
}
.stock-market-strip {
  display: flex;
  gap: 12px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.stock-market-pill {
  flex: 0 0 360px;
  min-width: 360px;
  min-height: 112px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  display: grid;
  gap: 7px;
}
.stock-market-pill strong {
  color: #17345f;
  font-size: 15px;
}
.stock-market-pill span {
  color: var(--muted);
  font-size: 12px;
}
.stock-market-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(145px, 1fr));
  gap: 10px;
  align-items: start;
}
.stock-market-metrics > div {
  min-width: 0;
}
.stock-market-metrics small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}
.stock-market-pill b,
.stock-market-pill em {
  font-style: normal;
  color: #1f2a44;
}
.stock-market-metrics b,
.stock-market-metrics em {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.stock-market-pill .money-stack span {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 5px;
  padding: 0;
  border: 0;
  line-height: 1.25;
}
.stock-market-pill .money-stack b {
  min-width: 0;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .38);
}
.modal-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
  padding: 18px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-head h2 {
  margin: 0;
  color: #15213a;
  font-size: 18px;
}
.mi-report-modal-backdrop {
  align-items: center;
}
.mi-report-modal {
  width: min(1120px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 18px;
}
.mi-report-modal-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
.mi-report-modal .mi-detail {
  border-top: 4px solid var(--blue);
  padding-top: 14px;
}
.confirm-dialog {
  width: min(460px, 100%);
}
.confirm-dialog .modal-head {
  align-items: center;
  margin-bottom: 10px;
}
.confirm-dialog .modal-head .button {
  width: 30px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}
.confirm-message {
  margin: 0;
  color: #172033;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
}
.confirm-detail {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #fef2f2;
  color: #9f2318;
  font-size: 13px;
  line-height: 1.55;
}
.confirm-actions {
  margin-top: 16px;
  justify-content: flex-end;
}
.stock-goal-dialog .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}
.watchlist-action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #a9c6ee;
  border-radius: 8px;
  background: linear-gradient(135deg, #eaf3ff 0%, #f5fbff 52%, #eefaf7 100%);
  box-shadow: 0 12px 28px rgba(38, 64, 91, .075);
}
.watchlist-action-strip span {
  display: block;
  margin-bottom: 3px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}
.watchlist-action-strip strong {
  display: block;
  color: #15213a;
  font-size: 16px;
}
.watchlist-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.button.adjust-action {
  background: var(--teal);
  color: #ffffff;
}
.button.adjust-action:hover {
  background: #14856f;
}
.button.quote-action {
  background: #2563eb;
  color: #ffffff;
}
.button.quote-action:hover {
  background: #1d4ed8;
}
.watch-action-panel {
  border-color: #cdddf8;
}
.operation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--blue);
  border-radius: 7px;
  background: #f5f8ff;
}
.operation-heading span {
  display: block;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}
.operation-heading h2 {
  margin: 2px 0 0;
  color: #15213a;
  font-size: 18px;
}
.operation-heading small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
#watchAdjustPanel .operation-heading {
  border-left-color: var(--teal);
  background: #f3fbf9;
}
#watchAdjustPanel .operation-heading span {
  color: var(--teal);
}
.money-stack {
  display: grid;
  gap: 3px;
  line-height: 1.25;
}
.money-stack span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: inherit;
  font-size: inherit;
}
.money-stack em {
  min-width: 42px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
}
.money-stack b {
  color: #1f2a44;
  font-size: inherit;
  font-weight: 700;
  white-space: nowrap;
}
.metric .money-stack {
  gap: 5px;
  width: max-content;
  max-width: 100%;
}
.metric .money-stack span {
  display: grid;
  grid-template-columns: 48px max-content;
}
.metric .money-stack b {
  font-size: 18px;
  white-space: nowrap;
}
.panel { margin-bottom: 14px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; color: #15213a; }
.source-health h2 { color: #14315f; }
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.source-item {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 11px;
  background: #fbfdff;
  min-height: 82px;
}
.source-item div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.source-item strong { color: #20304a; }
.source-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
}
.source-item em {
  display: block;
  margin-top: 6px;
  color: var(--red);
  font-size: 12px;
  font-style: normal;
}
.dashboard-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  margin-bottom: 14px;
  align-items: stretch;
}
.insight-panel { min-height: 242px; }
.insight-panel h2 {
  color: #17345f;
}
.rank-list,
.summary-list {
  display: grid;
  gap: 8px;
}
.rank-row,
.summary-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
}
.rank-list,
.summary-list {
  min-height: 150px;
}
.fixed-summary {
  grid-template-rows: repeat(3, minmax(46px, auto));
}
.rank-row {
  grid-template-columns: 28px minmax(0, 1fr) 156px 66px;
}
.rank-row > span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-blue);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
}
.rank-row strong,
.summary-row strong {
  display: block;
  color: #20304a;
}
.rank-row small,
.summary-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  white-space: nowrap;
}
.rank-row b,
.summary-row b,
.rank-row em {
  text-align: right;
  font-style: normal;
  white-space: nowrap;
  min-width: 0;
}
.rank-row b {
  text-align: left;
  justify-self: stretch;
}
.rank-row b .money-stack span {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  width: 100%;
}
.rank-row b .money-stack b {
  justify-self: start;
}
.summary-row {
  grid-template-columns: minmax(120px, 1fr) 142px 142px;
}
.market-summary .summary-row {
  grid-template-columns: minmax(90px, .72fr) 142px 142px;
}
.summary-row span {
  color: #20304a;
  text-align: right;
  white-space: nowrap;
  min-width: 0;
}
.summary-row > span,
.summary-row > b {
  justify-self: stretch;
  text-align: left;
}
.summary-row > span .money-stack,
.summary-row > b .money-stack {
  display: grid;
  gap: 2px;
  text-align: left;
  width: 100%;
}
.summary-row > span .money-stack span,
.summary-row > b .money-stack span {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  width: 100%;
}
.summary-row > span .money-stack b,
.summary-row > b .money-stack b {
  justify-self: start;
}
.currency-summary .currency-amount {
  display: grid;
  grid-template-columns: 34px max-content;
  justify-content: start;
  width: 100%;
  text-align: left;
}
.currency-summary .currency-amount em,
.currency-summary .currency-amount i {
  font-style: normal;
  white-space: nowrap;
}
.currency-summary .currency-amount i {
  justify-self: start;
}
.currency-summary .summary-row > span,
.currency-summary .summary-row > b {
  justify-self: stretch;
  text-align: left;
}
.rank-row > div,
.summary-row > div {
  min-width: 0;
}
.rank-row strong,
.rank-row small,
.summary-row strong,
.summary-row small {
  overflow: hidden;
  text-overflow: ellipsis;
}
table { width: 100%; border-collapse: collapse; min-width: 100%; table-layout: auto; }
.panel { overflow-x: auto; min-width: 0; }
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.table-wrap::-webkit-scrollbar,
.market-clock::-webkit-scrollbar,
.stock-market-strip::-webkit-scrollbar,
.quote-ticker::-webkit-scrollbar {
  height: 10px;
}
.table-wrap::-webkit-scrollbar-thumb,
.market-clock::-webkit-scrollbar-thumb,
.stock-market-strip::-webkit-scrollbar-thumb,
.quote-ticker::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #c6d3e3;
  background-clip: padding-box;
}
.table-wrap::-webkit-scrollbar-track,
.market-clock::-webkit-scrollbar-track,
.stock-market-strip::-webkit-scrollbar-track,
.quote-ticker::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #eef4fb;
}
.data-table {
  min-width: 860px;
  min-width: max(100%, 860px);
  table-layout: fixed;
}
.stock-table {
  min-width: 2860px;
  min-width: max(100%, 2860px);
}
.focus-table {
  min-width: 2880px;
  min-width: max(100%, 2880px);
}
.dashboard-stock-table {
  min-width: 2360px;
  min-width: max(100%, 2360px);
}
.latest-asset-table {
  min-width: 1760px;
  min-width: max(100%, 1760px);
}
.admin-table {
  min-width: 1640px;
  min-width: max(100%, 1640px);
}
.admin-deleted-table {
  min-width: 760px;
  min-width: max(100%, 760px);
}
.sim-table {
  min-width: 1230px;
  min-width: max(100%, 1230px);
}
.asset-table {
  min-width: 1760px;
  min-width: max(100%, 1760px);
}
.asset-table th:nth-child(1), .asset-table td:nth-child(1) { width: 110px; }
.asset-table th:nth-child(2), .asset-table td:nth-child(2) { width: 120px; }
.asset-table th:nth-child(3), .asset-table td:nth-child(3) { width: 170px; }
.asset-table th:nth-child(4), .asset-table td:nth-child(4) { width: 112px; }
.asset-table th:nth-child(5), .asset-table td:nth-child(5) { width: 130px; }
.asset-table th:nth-child(6), .asset-table td:nth-child(6),
.asset-table th:nth-child(7), .asset-table td:nth-child(7),
.asset-table th:nth-child(8), .asset-table td:nth-child(8),
.asset-table th:nth-child(10), .asset-table td:nth-child(10) { width: 160px; }
.asset-table th:nth-child(9), .asset-table td:nth-child(9) { width: 84px; }
.asset-table th:nth-child(11), .asset-table td:nth-child(11) { width: 150px; }
.asset-table th:nth-child(12), .asset-table td:nth-child(12) { width: 170px; }
.asset-table th:nth-child(13), .asset-table td:nth-child(13) { width: 142px; }
.latest-asset-table th:nth-child(1), .latest-asset-table td:nth-child(1) { width: 110px; }
.latest-asset-table th:nth-child(2), .latest-asset-table td:nth-child(2) { width: 120px; }
.latest-asset-table th:nth-child(3), .latest-asset-table td:nth-child(3) { width: 180px; }
.latest-asset-table th:nth-child(4), .latest-asset-table td:nth-child(4) { width: 112px; }
.latest-asset-table th:nth-child(5), .latest-asset-table td:nth-child(5) { width: 130px; }
.latest-asset-table th:nth-child(6), .latest-asset-table td:nth-child(6),
.latest-asset-table th:nth-child(7), .latest-asset-table td:nth-child(7),
.latest-asset-table th:nth-child(9), .latest-asset-table td:nth-child(9),
.latest-asset-table th:nth-child(11), .latest-asset-table td:nth-child(11),
.latest-asset-table th:nth-child(12), .latest-asset-table td:nth-child(12) { width: 178px; }
.latest-asset-table th:nth-child(8), .latest-asset-table td:nth-child(8) { width: 130px; }
.latest-asset-table th:nth-child(10), .latest-asset-table td:nth-child(10) { width: 84px; }
.latest-asset-table td:nth-child(3),
.latest-asset-table td:nth-child(7),
.latest-asset-table td:nth-child(8) {
  white-space: normal;
}
.asset-table td:nth-child(3),
.asset-table td:nth-child(11),
.asset-table td:nth-child(12),
.asset-table td:nth-child(13) {
  white-space: normal;
}
.asset-table td:nth-child(12) {
  line-height: 1.45;
  word-break: break-word;
}
.asset-table td:nth-child(3),
.asset-table td:nth-child(12) {
  max-width: 0;
}
.asset-table td:nth-child(3) {
  overflow-wrap: anywhere;
}
.asset-table td:nth-child(13) {
  overflow: visible;
}
.asset-table td:nth-child(13) .button {
  min-width: 86px;
}
.asset-row.asset-type-stock { background: #f4f8ff; }
.asset-row.asset-type-fund { background: #f3fbf6; }
.asset-row.asset-type-precious_metal { background: #fff8e8; }
.asset-row.asset-type-crypto { background: #f6f3ff; }
.asset-row.asset-type-cash { background: #f7fafc; }
.asset-table .asset-symbol,
.asset-table .asset-name {
  font-weight: 800;
}
.asset-table .asset-symbol.asset-type-stock,
.asset-table .asset-name.asset-type-stock { color: #1e40af; }
.asset-table .asset-symbol.asset-type-fund,
.asset-table .asset-name.asset-type-fund { color: #047857; }
.asset-table .asset-symbol.asset-type-precious_metal,
.asset-table .asset-name.asset-type-precious_metal { color: #a16207; }
.asset-table .asset-symbol.asset-type-crypto,
.asset-table .asset-name.asset-type-crypto { color: #6d28d9; }
.asset-type-tag.asset-type-stock {
  color: #1e40af;
  background: #dbeafe;
  border-color: #bfdbfe;
}
.asset-type-tag.asset-type-fund {
  color: #047857;
  background: #dff7e8;
  border-color: #bcebd0;
}
.asset-type-tag.asset-type-precious_metal {
  color: #a16207;
  background: #ffedb8;
  border-color: #f6d36d;
}
.asset-type-tag.asset-type-crypto {
  color: #6d28d9;
  background: #ede9fe;
  border-color: #ddd6fe;
}

.stock-group-row td {
  padding: 9px 12px;
  border-top: 1px solid #cfdced;
  border-bottom: 1px solid #e5edf7;
  background: #f3f7fc;
  color: #17345f;
}
.stock-group-row span,
.stock-group-row strong,
.stock-group-row em {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
}
.stock-group-row span {
  color: #52627a;
  font-size: 12px;
  font-weight: 800;
}
.stock-group-row strong {
  font-size: 14px;
  font-weight: 900;
}
.stock-group-row em {
  color: #6b7890;
  font-size: 12px;
  font-style: normal;
}
.sector-tag,
.theme-tag {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-color: #d7e3f1;
  background: #f5f9ff;
  color: #254060;
}
.theme-tag {
  border-color: #d9eadf;
  background: #f5fbf6;
  color: #28543c;
}
.data-table th,
.data-table td {
  min-width: 0;
  vertical-align: middle;
}
.data-table th,
.data-table td,
.data-table .forecast-value {
  white-space: nowrap;
}
.data-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table td small,
.data-table td .tag {
  white-space: normal;
}
.data-table .money-stack {
  display: grid;
  gap: 2px;
  width: 100%;
}
.data-table .money-stack span {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
}
.data-table .money-stack b {
  justify-self: start;
  white-space: nowrap;
}
.quant-inline-summary {
  display: grid;
  gap: 5px;
  min-width: 190px;
}
.quant-inline-summary .tag {
  margin-right: 4px;
}
.quant-inline-summary small {
  color: var(--muted);
  line-height: 1.35;
  white-space: normal;
}
.quant-watch-compare-table th:nth-child(1), .quant-watch-compare-table td:nth-child(1) { width: 104px; }
.quant-watch-compare-table th:nth-child(2), .quant-watch-compare-table td:nth-child(2),
.quant-watch-compare-table th:nth-child(3), .quant-watch-compare-table td:nth-child(3),
.quant-watch-compare-table th:nth-child(6), .quant-watch-compare-table td:nth-child(6),
.quant-watch-compare-table th:nth-child(9), .quant-watch-compare-table td:nth-child(9) { width: 120px; }
.quant-watch-compare-table th:nth-child(5), .quant-watch-compare-table td:nth-child(5),
.quant-watch-compare-table th:nth-child(7), .quant-watch-compare-table td:nth-child(7),
.quant-watch-compare-table th:nth-child(8), .quant-watch-compare-table td:nth-child(8) { width: 180px; }
.stock-table th:nth-child(1), .stock-table td:nth-child(1),
.dashboard-stock-table th:nth-child(1), .dashboard-stock-table td:nth-child(1) { width: 104px; }
.stock-table th:nth-child(2), .stock-table td:nth-child(2),
.dashboard-stock-table th:nth-child(2), .dashboard-stock-table td:nth-child(2) { width: 190px; }
.stock-table th:nth-child(3), .stock-table td:nth-child(3),
.dashboard-stock-table th:nth-child(3), .dashboard-stock-table td:nth-child(3) { width: 118px; }
.stock-table th:nth-child(4), .stock-table td:nth-child(4),
.dashboard-stock-table th:nth-child(4), .dashboard-stock-table td:nth-child(4) { width: 142px; }
.stock-table th:nth-child(5), .stock-table td:nth-child(5),
.dashboard-stock-table th:nth-child(5), .dashboard-stock-table td:nth-child(5) { width: 168px; }
.stock-table th:nth-child(6), .stock-table td:nth-child(6),
.dashboard-stock-table th:nth-child(6), .dashboard-stock-table td:nth-child(6) { width: 126px; }
.stock-table th:nth-child(7), .stock-table td:nth-child(7),
.stock-table th:nth-child(8), .stock-table td:nth-child(8),
.stock-table th:nth-child(9), .stock-table td:nth-child(9),
.stock-table th:nth-child(11), .stock-table td:nth-child(11),
.stock-table th:nth-child(13), .stock-table td:nth-child(13),
.dashboard-stock-table th:nth-child(7), .dashboard-stock-table td:nth-child(7),
.dashboard-stock-table th:nth-child(8), .dashboard-stock-table td:nth-child(8),
.dashboard-stock-table th:nth-child(9), .dashboard-stock-table td:nth-child(9),
.dashboard-stock-table th:nth-child(11), .dashboard-stock-table td:nth-child(11),
.dashboard-stock-table th:nth-child(13), .dashboard-stock-table td:nth-child(13) { width: 172px; }
.stock-table th:nth-child(10), .stock-table td:nth-child(10),
.stock-table th:nth-child(12), .stock-table td:nth-child(12),
.dashboard-stock-table th:nth-child(10), .dashboard-stock-table td:nth-child(10),
.dashboard-stock-table th:nth-child(12), .dashboard-stock-table td:nth-child(12) { width: 86px; }
.stock-table th:nth-child(14), .stock-table td:nth-child(14),
.dashboard-stock-table th:nth-child(14), .dashboard-stock-table td:nth-child(14) { width: 178px; }
.stock-table th:nth-child(15), .stock-table td:nth-child(15),
.dashboard-stock-table th:nth-child(15), .dashboard-stock-table td:nth-child(15) { width: 150px; }
.stock-table th:nth-child(16), .stock-table td:nth-child(16) { width: 220px; }
.stock-table th:nth-child(17), .stock-table td:nth-child(17) { width: 360px; }
.stock-table td:nth-child(2),
.stock-table td:nth-child(4),
.stock-table td:nth-child(5),
.stock-table td:nth-child(14),
.stock-table td:nth-child(15),
.stock-table td:nth-child(16),
.stock-table td:nth-child(17),
.dashboard-stock-table td:nth-child(2),
.dashboard-stock-table td:nth-child(4),
.dashboard-stock-table td:nth-child(5),
.dashboard-stock-table td:nth-child(14),
.dashboard-stock-table td:nth-child(15) {
  white-space: normal;
}
.stock-table td:nth-child(17) {
  overflow: visible;
}
.focus-table th:nth-child(1), .focus-table td:nth-child(1) { width: 104px; }
.focus-table th:nth-child(2), .focus-table td:nth-child(2) { width: 190px; }
.focus-table th:nth-child(3), .focus-table td:nth-child(3) { width: 118px; }
.focus-table th:nth-child(4), .focus-table td:nth-child(4) { width: 142px; }
.focus-table th:nth-child(5), .focus-table td:nth-child(5) { width: 168px; }
.focus-table th:nth-child(6), .focus-table td:nth-child(6),
.focus-table th:nth-child(8), .focus-table td:nth-child(8),
.focus-table th:nth-child(10), .focus-table td:nth-child(10),
.focus-table th:nth-child(11), .focus-table td:nth-child(11),
.focus-table th:nth-child(12), .focus-table td:nth-child(12) { width: 170px; }
.focus-table th:nth-child(7), .focus-table td:nth-child(7) { width: 86px; }
.focus-table th:nth-child(9), .focus-table td:nth-child(9) { width: 150px; }
.focus-table th:nth-child(13), .focus-table td:nth-child(13) { width: 230px; }
.focus-table th:nth-child(14), .focus-table td:nth-child(14) { width: 210px; }
.focus-table th:nth-child(15), .focus-table td:nth-child(15) { width: 190px; }
.focus-table th:nth-child(16), .focus-table td:nth-child(16) { width: 360px; }
.focus-table td:nth-child(2),
.focus-table td:nth-child(4),
.focus-table td:nth-child(5),
.focus-table td:nth-child(13),
.focus-table td:nth-child(14),
.focus-table td:nth-child(15),
.focus-table td:nth-child(16) {
  white-space: normal;
}
.focus-table td:nth-child(16) {
  overflow: visible;
}
.sim-table th:nth-child(1), .sim-table td:nth-child(1) { width: 100px; }
.sim-table th:nth-child(2), .sim-table td:nth-child(2) { width: 150px; }
.sim-table th:nth-child(3), .sim-table td:nth-child(3) { width: 112px; }
.sim-table th:nth-child(4), .sim-table td:nth-child(4) { width: 90px; }
.sim-table th:nth-child(5), .sim-table td:nth-child(5),
.sim-table th:nth-child(6), .sim-table td:nth-child(6),
.sim-table th:nth-child(7), .sim-table td:nth-child(7),
.sim-table th:nth-child(8), .sim-table td:nth-child(8) { width: 170px; }
.sim-table th:nth-child(9), .sim-table td:nth-child(9) { width: 110px; }
.admin-table th:nth-child(1), .admin-table td:nth-child(1) { width: 250px; }
.admin-table th:nth-child(2), .admin-table td:nth-child(2) { width: 86px; }
.admin-table th:nth-child(3), .admin-table td:nth-child(3) { width: 150px; }
.admin-table th:nth-child(4), .admin-table td:nth-child(4) { width: 118px; }
.admin-table th:nth-child(5), .admin-table td:nth-child(5) { width: 140px; }
.admin-table th:nth-child(6), .admin-table td:nth-child(6) { width: 132px; }
.admin-table th:nth-child(7), .admin-table td:nth-child(7) { width: 160px; }
.admin-table th:nth-child(8), .admin-table td:nth-child(8) { width: 118px; }
.admin-table th:nth-child(9), .admin-table td:nth-child(9) { width: 112px; }
.admin-table th:nth-child(10), .admin-table td:nth-child(10) { width: 360px; }
th, td { border-bottom: 1px solid var(--line-soft); padding: 10px; text-align: left; font-size: 14px; height: 58px; }
th { color: #51647c; font-weight: 700; background: #f7faff; }
td { color: #24324a; vertical-align: top; overflow-wrap: anywhere; }
td.actions {
  display: table-cell;
  min-width: 132px;
  white-space: normal;
}
td.actions .button {
  margin: 0 6px 6px 0;
}
.data-table td.actions {
  vertical-align: middle;
}
.data-table td.actions .button {
  margin: 0 5px 0 0;
}
.admin-table td.actions {
  min-width: 340px;
  white-space: normal;
}
.admin-table td.actions .button {
  margin: 0;
}
.admin-table th,
.admin-table td {
  height: 52px;
  padding-top: 8px;
  padding-bottom: 8px;
  vertical-align: middle;
}
.admin-table td {
  line-height: 1.35;
}
.admin-table td:nth-child(1),
.admin-table td:nth-child(2),
.admin-table td:nth-child(3) {
  overflow-wrap: normal;
  word-break: normal;
}
.admin-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 32px;
}
.admin-actions .button {
  flex: 0 0 auto;
  min-height: 30px;
  line-height: 1;
}
.admin-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: #51647c;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.admin-status-pill.ok {
  background: #dcfce7;
  color: #15803d;
}
.admin-status-pill.warn {
  background: #fee2e2;
  color: #b91c1c;
}
.admin-status-pill.muted {
  background: #eef2f7;
  color: #64748b;
}
.admin-deleted-users {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5edf6;
}
.admin-deleted-users h3 {
  margin: 0;
  color: #334155;
  font-size: 16px;
}
.admin-session-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}
.admin-session-card {
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(24, 39, 75, 0.05);
}
.admin-session-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.admin-session-card-top span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.admin-session-card-top b {
  color: #172033;
  font-size: 26px;
  line-height: 1;
}
.admin-session-card small {
  display: block;
  margin-top: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.admin-session-bar {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}
.admin-session-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #64748b;
}
.admin-session-card.active .admin-session-bar i { background: #2563eb; }
.admin-session-card.recent .admin-session-bar i { background: #16a34a; }
.admin-session-card.expired .admin-session-bar i { background: #dc2626; }
.admin-session-card.total .admin-session-bar i { background: #475569; }
td small { display: inline-block; min-height: 16px; line-height: 1.35; }
tbody tr:hover { background: #fbfdff; }
td small { color: var(--muted); line-height: 1.45; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d4dce8;
  border-radius: 7px;
  padding: 9px 10px;
  background: white;
  min-height: 40px;
}
textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 10px; align-items: end; min-width: 0; }
.form-grid > * {
  min-width: 0;
}
.field-label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.field-label input,
.field-label select { font-size: 14px; font-weight: 500; color: var(--text); }
.account-shell {
  display: grid;
  gap: 14px;
}
.account-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  padding: 18px 20px;
  border: 1px solid #d9e6f5;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f4f9ff 100%);
}
.account-heading span,
.account-card-title span {
  display: block;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}
.account-heading h2,
.account-card-title h3 {
  margin: 4px 0 0;
  color: #17345f;
}
.account-heading p {
  max-width: 560px;
  margin: 0;
  color: #506176;
  font-size: 13px;
  line-height: 1.55;
}
.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 14px;
  align-items: stretch;
}
.account-card {
  margin: 0;
}
.account-card-title {
  margin-bottom: 14px;
}
.account-form {
  display: grid;
  gap: 12px;
}
.account-form .button {
  justify-self: start;
}
.avatar-editor {
  display: grid;
  gap: 10px;
}
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
}
.avatar-choice {
  min-height: 76px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 9px 8px;
  background: #fff;
  display: grid;
  justify-items: center;
  gap: 6px;
  cursor: pointer;
}
.avatar-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.avatar-choice.selected {
  border-color: var(--blue);
  background: #f6f9ff;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.24);
}
.avatar-choice-preview {
  width: 34px;
  height: 34px;
}
.avatar-choice small {
  color: #51647c;
  font-size: 12px;
  font-weight: 800;
}
.avatar-upload-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed #cfd9e7;
  border-radius: 8px;
  background: #fbfdff;
}
.uploaded-avatar-preview {
  width: 48px;
  height: 48px;
  font-size: 18px;
  line-height: 48px;
}
.avatar-upload-actions {
  display: grid;
  gap: 8px;
  align-content: center;
}
.avatar-upload-button {
  position: relative;
  overflow: hidden;
  justify-self: start;
}
.avatar-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.avatar-upload-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}
.avatar-crop-dialog {
  max-width: 560px;
}
.avatar-crop-layout {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.avatar-crop-live {
  position: relative;
  width: 256px;
  height: 256px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef4fb;
  box-shadow: inset 0 0 0 1px #cfd9e7;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.avatar-crop-live.dragging {
  cursor: grabbing;
}
.avatar-crop-live img {
  position: absolute;
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}
.avatar-crop-controls {
  display: grid;
  gap: 12px;
}
.avatar-crop-tip {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}
.avatar-crop-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.avatar-crop-controls input[type="range"] {
  min-height: 28px;
  padding: 0;
}
.account-feedback {
  min-height: 22px;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}
.asset-required { border-color: #d9921e; background: #fffaf0; }
.asset-profile-note {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.asset-profile-note small {
  color: #8a5a0a;
  font-weight: 700;
}
.settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.subscription-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.subscription-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.subscription-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.subscription-card h3 {
  margin: 0 0 12px;
  display: grid;
  gap: 4px;
  font-size: 16px;
}
.subscription-card h3 small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.subscription-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 120px minmax(190px, .8fr);
  gap: 10px;
  align-items: end;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.subscription-option {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: center;
  color: var(--text);
}
.subscription-option input {
  width: 18px;
  min-height: 18px;
}
.subscription-option span {
  display: grid;
  gap: 3px;
}
.subscription-option em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.subscription-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.subscription-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.subscription-feedback.pending {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.subscription-feedback.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}
.subscription-feedback.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}
.button { border: 0; border-radius: 7px; padding: 10px 12px; background: var(--blue); color: white; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.button.secondary { background: #e9eef5; color: #1f2a44; }
.button.danger { background: var(--red); }
.button.small { padding: 6px 8px; font-size: 12px; min-height: 30px; }
.button:disabled { opacity: .55; cursor: wait; }
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, .95fr) minmax(420px, 1.05fr);
  background:
    linear-gradient(180deg, #f8fafc 0%, #eef4f8 100%);
}
.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  min-height: 100vh;
  padding: clamp(38px, 7vw, 84px);
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(9, 24, 42, .98) 0%, rgba(14, 41, 62, .98) 56%, rgba(11, 86, 91, .94) 100%);
  color: white;
}
.auth-visual::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background:
    linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.08) 100%);
  pointer-events: none;
}
.auth-logo {
  position: relative;
  display: block;
  width: min(100%, 420px);
  height: auto;
  border-radius: 8px;
  box-shadow: 0 24px 56px rgba(0,0,0,.24);
}
.auth-brand-copy {
  position: relative;
  max-width: 520px;
  line-height: 1.05;
}
.auth-brand-copy span,
.auth-brand-copy em,
.auth-brand-copy small {
  display: block;
}
.auth-brand-copy span {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 850;
  letter-spacing: 0;
}
.auth-brand-copy em {
  margin-top: 10px;
  color: #d7e6f2;
  font-style: normal;
  font-size: clamp(20px, 2.7vw, 30px);
  font-weight: 850;
}
.auth-brand-copy small {
  margin-top: 18px;
  color: #9fc7cf;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}
.auth-version {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  margin-top: 18px;
  padding: 4px 9px;
  border-top: 1px solid var(--line-soft);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 7px;
  color: var(--faint);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding-top: 14px;
}
.auth {
  align-self: center;
  justify-self: center;
  width: min(100% - 48px, 460px);
  margin: 0;
  padding: 28px;
  border-color: rgba(203, 213, 225, .78);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .13);
}
.auth h1 { margin-top: 0; }
.auth-heading {
  margin-bottom: 22px;
}
.auth-heading > span {
  display: block;
  margin-bottom: 14px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-heading p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.auth-title {
  display: grid;
  gap: 5px;
  line-height: 1.12;
}
.auth-title span,
.auth-title em {
  display: block;
}
.auth-title em {
  color: var(--muted);
  font-size: 15px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0;
}
.auth-title span {
  color: #0f172a;
  font-size: 22px;
  font-weight: 850;
}
.auth form { display: grid; gap: 12px; }
.auth input {
  min-height: 46px;
  border-color: #cbd5e1;
  background: #fbfdff;
}
.auth input:focus {
  outline: 2px solid rgba(37, 99, 235, .18);
  border-color: #7aa2f7;
}
.auth-submit {
  min-height: 46px;
  margin-top: 2px;
  font-weight: 800;
}
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}
.hint { color: var(--muted); font-size: 13px; }
.disclaimer-panel {
  border-color: #e8d6a8;
  background: #fffaf0;
}
.disclaimer-panel h2 {
  color: #7a5a13;
}
.disclaimer-panel p {
  margin: 0;
  color: #5f6570;
  line-height: 1.7;
}
.warn { color: var(--red); }
.ok { color: var(--green); }
.gain { color: #16a34a; }
.loss { color: #dc2626; }
.flat { color: #64748b; }
.gain .money-stack b,
.gain.money-stack b,
.gain .currency-amount em,
.gain .currency-amount i {
  color: #16a34a;
}
.loss .money-stack b,
.loss.money-stack b,
.loss .currency-amount em,
.loss .currency-amount i {
  color: #dc2626;
}
.flat .money-stack b,
.flat.money-stack b,
.flat .currency-amount em,
.flat .currency-amount i {
  color: #64748b;
}
.annual-goal-triplet > div:first-child .money-stack b {
  color: #1d4ed8;
}
.annual-goal-triplet > div:first-child .money-stack em {
  color: #2563eb;
}
.annual-goal-triplet > div:nth-child(2) .money-stack b {
  color: #1f2a44;
}
.annual-goal-triplet > div:nth-child(2) .money-stack em {
  color: var(--muted);
}
.forecast-metric .money-stack b {
  color: #9a6b13;
}
.forecast-metric .money-stack em {
  color: #b7791f;
}
.annual-goal-triplet .gain .money-stack b,
.annual-goal-triplet .gain.money-stack b {
  color: #16a34a;
}
.annual-goal-triplet .loss .money-stack b,
.annual-goal-triplet .loss.money-stack b {
  color: #dc2626;
}
.annual-goal-triplet .flat .money-stack b,
.annual-goal-triplet .flat.money-stack b {
  color: #64748b;
}
.hidden { display: none; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  background: var(--violet-soft);
  color: #4b3ca3;
  font-size: 12px;
  white-space: nowrap;
}
.warn-tag { background: var(--amber-soft); color: var(--amber); }
.danger-tag { background: #fee2e2; color: #b91c1c; }
.muted-tag { background: var(--line); color: var(--muted); }
.inline-auth-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.name-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  color: #506176;
  font-size: 13px;
}
.near-tag { background: var(--blue); color: white; }
.market-tag {
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
}
.focus-tag {
  margin-left: 8px;
  background: var(--blue);
  color: white;
  vertical-align: middle;
}
.decision-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.decision { border: 1px solid #dfe7f2; border-radius: 8px; padding: 14px; background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); min-height: 520px; }
.decision strong { font-size: 18px; color: var(--blue-dark); }
.decision-table-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.decision-table-wrap h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.decision-table {
  min-width: 0;
  table-layout: fixed;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.decision-table th,
.decision-table td {
  vertical-align: top;
  font-size: 13px;
}
.decision-table th:first-child,
.decision-table td:first-child {
  width: 96px;
  color: var(--blue-dark);
  font-weight: 700;
}
.decision-table th:nth-child(2),
.decision-table td:nth-child(2) {
  width: 42%;
}
.decision-table .money-stack {
  gap: 2px;
}
.decision-table .money-stack span {
  justify-content: space-between;
}
.broker-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.broker-box h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.broker-list {
  display: grid;
  gap: 10px;
}
.broker-item {
  padding: 11px;
  border: 1px solid #e1e9f3;
  border-radius: 8px;
  background: white;
  min-height: 124px;
}
.broker-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}
.broker-meta span {
  color: var(--teal);
  font-weight: 700;
}
.broker-meta em {
  font-style: normal;
}
.broker-meta b {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
}
.broker-item h4 {
  margin: 0 0 7px;
  font-size: 14px;
}
.broker-item p {
  margin: 0 0 8px;
  color: #334155;
  line-height: 1.55;
}
.broker-item .risk-text {
  color: var(--amber);
  font-size: 13px;
}
.broker-item a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.mi-detail {
  border-top: 4px solid var(--blue);
}
.mi-detail h2 {
  color: var(--blue-dark);
}
.mi-intelligence {
  border-top: 4px solid var(--teal);
}
.mi-intelligence h2 {
  color: var(--teal);
}
.mi-stock-intel {
  padding: 14px;
  border-top: 1px solid var(--line-soft);
  border-left: 4px solid #cdddf8;
  border-radius: 8px;
  background: #fbfdff;
  margin-top: 12px;
}
.mi-stock-intel:first-of-type {
  border-top: 1px solid var(--line-soft);
}
.mi-stock-intel h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--blue-dark);
}
.mi-stock-intel h3 small {
  color: var(--muted);
  font-size: 12px;
}
.mi-stock-intel .intel-heading {
  margin: 14px 0 8px;
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}
.broker-heading {
  background: var(--surface-blue);
  color: var(--blue-dark);
}
.event-heading {
  background: var(--amber-soft);
  color: var(--amber);
}
.impact-heading {
  background: var(--red-soft);
  color: var(--red);
}
.observation-heading {
  background: var(--teal-soft);
  color: var(--teal);
}
.mi-intel-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.mi-intel-list .source-item { min-height: 150px; }
.mi-intel-list .source-item h4 {
  margin: 7px 0 5px;
  color: #20304a;
}
.mi-intel-list .source-item p,
.mi-observation p {
  margin: 6px 0 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
}
.mi-observation {
  padding: 10px 12px;
  border: 1px solid #cde9e3;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #f6fffc;
}
.help-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border-color: #cfe0f6;
  background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 100%);
  min-height: 132px;
}
.help-hero h2 {
  margin: 0 0 8px;
  color: #13294b;
}
.help-hero p {
  max-width: 760px;
  margin: 0;
  color: #506176;
  line-height: 1.65;
}
.help-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.help-badges span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}
.help-section h2 {
  color: #17345f;
}
.feature-note-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}
.feature-note {
  min-height: 132px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
}
.feature-note h3 {
  margin: 0 0 8px;
  color: #17345f;
  font-size: 15px;
}
.feature-note p {
  margin: 0;
  color: #506176;
  font-size: 13px;
  line-height: 1.55;
}
.help-table {
  min-width: 760px;
}
.help-table th {
  background: #f2f7ff;
  color: #415a77;
}
.help-table td {
  vertical-align: top;
  line-height: 1.55;
}
.term-table td:first-child {
  color: var(--blue-dark);
  width: 190px;
}
.term-table td:nth-child(2) {
  color: var(--teal);
  font-weight: 700;
  width: 150px;
}
.term-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.term-group {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
}
.term-group h3 {
  margin: 0;
  padding: 10px 12px;
  color: #17345f;
  font-size: 15px;
  background: #f2f7ff;
  border-bottom: 1px solid var(--line-soft);
}
.term-list {
  display: grid;
}
.term-row {
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.term-row:last-child {
  border-bottom: 0;
}
.term-row b {
  display: block;
  color: var(--blue-dark);
  font-size: 13px;
}
.term-row span {
  display: block;
  margin-top: 3px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}
.term-row p {
  margin: 0;
  color: #506176;
  font-size: 13px;
  line-height: 1.5;
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.help-card {
  border-top: 3px solid var(--blue);
  min-height: 138px;
}
.help-card:nth-child(2n) {
  border-top-color: var(--teal);
}
.help-card:nth-child(3n) {
  border-top-color: var(--amber);
}
.help-card h3 {
  margin: 0 0 8px;
  color: #19345b;
  font-size: 15px;
}
.help-card p {
  margin: 0;
  color: #506176;
  line-height: 1.62;
  font-size: 13px;
}
.mi-hero {
  margin-bottom: 12px;
}
.mi-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mi-tabs button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  background: white;
  color: #1f2a44;
  cursor: pointer;
  min-width: 92px;
  min-height: 38px;
}
.mi-tabs button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.mi-generate {
  margin-bottom: 10px;
}
.mi-filter {
  margin-bottom: 12px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}
.calendar-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}
.calendar-card h3 {
  margin: 0 0 10px;
  color: #17345f;
  font-size: 16px;
}
.calendar-card h3 small {
  display: block;
  margin-top: 3px;
  color: #5c6b80;
  font-weight: 500;
}
.calendar-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}
.calendar-row span {
  color: #5c6b80;
}
.calendar-row b {
  color: #1f2a44;
  overflow-wrap: anywhere;
}
.schedule-table .actions {
  flex-wrap: nowrap;
}
.mi-table {
  min-width: 980px;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.mi-table th,
.mi-table td {
  height: 52px;
  padding: 8px 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  line-height: 1.35;
}
.mi-table th {
  background: #f7faff;
  color: #51647c;
  font-weight: 800;
}
.mi-table td {
  color: #24324a;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mi-table td small {
  display: block;
  min-height: 0;
  line-height: 1.35;
  color: var(--muted);
}
.mi-table .tag,
.mi-table .button {
  white-space: nowrap;
}
.mi-report-table {
  min-width: 1480px;
}
.mi-report-table th:nth-child(1), .mi-report-table td:nth-child(1) { width: 260px; }
.mi-report-table th:nth-child(2), .mi-report-table td:nth-child(2) { width: 154px; }
.mi-report-table th:nth-child(3), .mi-report-table td:nth-child(3) { width: 118px; }
.mi-report-table th:nth-child(4), .mi-report-table td:nth-child(4) { width: 82px; }
.mi-report-table th:nth-child(5), .mi-report-table td:nth-child(5) { width: 92px; }
.mi-report-table th:nth-child(6), .mi-report-table td:nth-child(6) { width: 104px; }
.mi-report-table th:nth-child(7), .mi-report-table td:nth-child(7) { width: 180px; }
.mi-report-table th:nth-child(8), .mi-report-table td:nth-child(8) { width: 390px; }
.mi-report-table th:nth-child(9), .mi-report-table td:nth-child(9) { width: 100px; }
.mi-email-cell {
  overflow-wrap: anywhere;
}
.mi-alert-table {
  min-width: 1220px;
}
.mi-alert-table th:nth-child(1), .mi-alert-table td:nth-child(1) { width: 154px; }
.mi-alert-table th:nth-child(2), .mi-alert-table td:nth-child(2) { width: 130px; }
.mi-alert-table th:nth-child(3), .mi-alert-table td:nth-child(3) { width: 100px; }
.mi-alert-table th:nth-child(4), .mi-alert-table td:nth-child(4) { width: 120px; }
.mi-alert-table th:nth-child(5), .mi-alert-table td:nth-child(5) { width: 360px; }
.mi-alert-table th:nth-child(6), .mi-alert-table td:nth-child(6) { width: 130px; }
.mi-alert-table th:nth-child(7), .mi-alert-table td:nth-child(7) { width: 116px; }
.mi-alert-table th:nth-child(8), .mi-alert-table td:nth-child(8) { width: 100px; }
.mi-broker-table {
  min-width: 1120px;
}
.mi-broker-table th:nth-child(1), .mi-broker-table td:nth-child(1) { width: 108px; }
.mi-broker-table th:nth-child(2), .mi-broker-table td:nth-child(2) { width: 150px; }
.mi-broker-table th:nth-child(3), .mi-broker-table td:nth-child(3) { width: 150px; }
.mi-broker-table th:nth-child(4), .mi-broker-table td:nth-child(4) { width: 138px; }
.mi-broker-table th:nth-child(5), .mi-broker-table td:nth-child(5) { width: 460px; }
.mi-broker-table th:nth-child(6), .mi-broker-table td:nth-child(6) { width: 90px; }
.mi-mentions-table {
  min-width: 1160px;
}
.mi-title-cell,
.mi-summary-cell {
  white-space: normal;
}
.mi-title-cell {
  font-weight: 800;
  color: #172033;
}
.mi-summary-cell small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mi-summary-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #fbfdff;
}
.mi-summary-card.empty {
  color: var(--muted);
}
.mi-summary-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.mi-summary-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
}
.mi-summary-card ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mi-summary-card li {
  position: relative;
  min-width: 0;
  padding-left: 12px;
  color: #3a4658;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mi-summary-card li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: .68em;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #94a3b8;
}
.mi-summary-detail {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dce8f6;
  border-radius: 8px;
  background: #f8fbff;
}
.mi-summary-detail.empty {
  color: var(--muted);
}
.mi-summary-detail ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mi-summary-detail li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.mi-summary-detail li > span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}
.mi-summary-detail p {
  margin: 1px 0 0;
  color: #25364f;
  font-size: 13px;
  line-height: 1.65;
}
.mi-action-cell {
  text-align: left;
}
.mi-action-cell .button {
  margin: 0;
  min-width: 76px;
}
.schedule-table {
  min-width: 1180px;
}
.schedule-table th:nth-child(1), .schedule-table td:nth-child(1) { width: 90px; }
.schedule-table th:nth-child(2), .schedule-table td:nth-child(2) { width: 126px; }
.schedule-table th:nth-child(3), .schedule-table td:nth-child(3) { width: 108px; }
.schedule-table th:nth-child(4), .schedule-table td:nth-child(4) { width: 170px; }
.schedule-table th:nth-child(5), .schedule-table td:nth-child(5) { width: 170px; }
.schedule-table th:nth-child(6), .schedule-table td:nth-child(6) { width: 98px; }
.schedule-table th:nth-child(7), .schedule-table td:nth-child(7) { width: 250px; white-space: normal; }
.schedule-table th:nth-child(8), .schedule-table td:nth-child(8) { width: 170px; }
.schedule-table td:last-child .button {
  margin: 0 4px 0 0;
}
.mi-detail h3 {
  margin: 16px 0 8px;
  color: #17345f;
  font-size: 15px;
}
.mi-time-block {
  margin-top: 12px;
}
.mi-time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.mi-time-grid div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
}
.mi-time-grid span,
.mi-time-grid b {
  display: block;
}
.mi-time-grid span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.mi-time-grid b {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.mi-html {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}
.mi-quant-report {
  border-top: 4px solid var(--teal);
}
.mi-quant-report h2 {
  color: var(--teal);
}
.mi-quant-table th,
.mi-quant-table td {
  vertical-align: top;
}
.mi-quant-block-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.mi-detail pre {
  overflow: auto;
  max-height: 360px;
  padding: 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
}
.sim-row { display: grid; grid-template-columns: 1fr 120px 120px 120px; gap: 10px; align-items: end; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; overflow: visible; }
  .sidebar-middle { overflow: visible; }
  .nav { overflow: visible; }
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    min-height: 0;
    padding: 28px 20px;
  }
  .auth-logo {
    width: min(100%, 320px);
  }
  .auth-brand-copy span {
    font-size: 30px;
  }
  .auth-brand-copy em {
    font-size: 22px;
  }
  .auth {
    width: min(100% - 32px, 460px);
    margin: 24px auto 32px;
  }
  .content { padding: 16px; }
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .topbar h1 {
    white-space: normal;
  }
  .topbar-market {
    width: 100%;
    grid-template-columns: 1fr;
  }
  .topbar-controls {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }
  .actions { justify-content: flex-start; }
  .market-clock { justify-content: flex-start; }
  .market-clock-hint { text-align: left; }
  .status { min-width: 0; text-align: left; }
  .help-hero { align-items: flex-start; flex-direction: column; }
  .help-badges { justify-content: flex-start; }
  .annual-goal,
  .annual-goal-triplet,
  .grid, .asset-class-grid, .stock-overview-grid, .stock-market-strip, .dashboard-insights, .decision-grid, .form-grid, .two, .sim-row, .help-grid, .feature-note-grid, .term-group-grid, .term-row, .calendar-grid, .subscription-summary, .subscription-grid, .subscription-row, .account-grid { grid-template-columns: 1fr; }
  .account-heading { align-items: flex-start; flex-direction: column; }
  .annual-goal-form { grid-template-columns: 1fr; }
  .stock-goal-dialog .form-grid { grid-template-columns: 1fr; }
  .watchlist-action-strip {
    align-items: flex-start;
    flex-direction: column;
  }
  .watchlist-action-buttons {
    justify-content: flex-start;
    width: 100%;
  }
  .watchlist-action-buttons .button {
    flex: 1 1 160px;
  }
  .grid .metric,
  .grid.compact .metric,
  .insight-panel,
  .decision,
  .help-card {
    min-height: 0;
  }
  .rank-list,
  .summary-list {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    background: #f1f3f7;
  }
  body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
  }
  .layout {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 100dvh;
    background: #f1f3f7;
  }
  .mobile-appbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    height: 68px;
    padding: 10px 14px 9px;
    border-bottom: 1px solid #e1e5ec;
    background: rgba(255,255,255,.96);
    box-shadow: 0 8px 20px rgba(15,23,42,.05);
    z-index: 20;
  }
  .sidebar {
    position: static;
    flex: 0 0 auto;
    height: auto;
    padding: 8px 12px 6px;
    background: #fff;
    color: var(--ink);
    border-bottom: 1px solid #e5e9f0;
    box-shadow: 0 8px 18px rgba(15,23,42,.04);
  }
  .sidebar-top,
  .sidebar-bottom {
    display: none;
  }
  .sidebar-middle {
    padding: 0;
    border: 0;
    overflow: hidden;
  }
  .nav {
    height: auto;
    padding: 0 0 4px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav button {
    width: auto;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #e8edf4;
    border-radius: 999px;
    background: #f8fafc;
    color: #5b6675;
    text-align: center;
    box-shadow: 0 2px 8px rgba(15,23,42,.03);
  }
  .nav-label em {
    display: none;
  }
  .nav button.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
    box-shadow: 0 8px 16px rgba(15,23,42,.13);
  }
  .content {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding: 18px 14px 0;
    grid-template-rows: auto 88px minmax(0, 1fr);
    gap: 12px;
    background: #f1f3f7;
  }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px 10px;
    min-height: 0;
  }
  .topbar h1 {
    white-space: normal;
    font-size: 25px;
    line-height: 1.18;
    letter-spacing: 0;
  }
  .topbar-controls {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
  }
  .topbar-market-session {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .topbar-market-session::-webkit-scrollbar {
    display: none;
  }
  .topbar-market-session .market-clock-item {
    width: 138px;
    min-width: 138px;
    min-height: 52px;
  }
  .status {
    width: auto;
    min-width: 0;
    max-width: 132px;
    text-align: left;
    color: #8a93a1;
    font-size: 12px;
  }
  #refresh {
    grid-column: 2;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #dce2ea;
    border-radius: 999px;
    background: #fff;
    color: #5b6675;
    box-shadow: 0 3px 9px rgba(15,23,42,.06);
  }
  #save,
  .account-shortcut {
    display: none;
  }
  .market-ribbon {
    height: 88px;
    padding: 8px;
    border-color: #e0e6ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15,23,42,.05);
  }
  .market-ribbon-row {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 6px;
  }
  .market-ribbon-label {
    font-size: 11px;
  }
  .quote-chip {
    min-height: 30px;
    border-color: #e7ecf3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(15,23,42,.03);
  }
  #view {
    padding: 0 0 96px;
  }
  .card,
  .panel,
  .metric,
  .insight-panel,
  .decision,
  .help-card {
    border-color: #e4e9f1;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 9px 22px rgba(15,23,42,.05);
  }
  .grid,
  .asset-class-grid,
  .stock-overview-grid,
  .stock-market-strip,
  .dashboard-insights,
  .decision-grid,
  .form-grid,
  .two,
  .sim-row,
  .help-grid,
  .feature-note-grid,
  .term-group-grid,
  .term-row,
  .calendar-grid,
  .subscription-summary,
  .subscription-grid,
  .subscription-row,
  .account-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-insights,
  .grid,
  .stock-overview-grid {
    gap: 12px;
  }
  .table-wrap,
  .mi-table-wrap {
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 9px 22px rgba(15,23,42,.05);
  }
  .card, .panel { padding: 12px; }
  .operation-heading {
    flex-direction: column;
  }
  .rank-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .rank-row b,
  .rank-row em {
    grid-column: 2;
    text-align: left;
  }
  .summary-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .summary-row span,
  .summary-row b {
    text-align: left;
  }
  .money-stack span {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .money-stack b {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .metric .money-stack b,
  .data-table .money-stack b {
    white-space: nowrap;
    overflow-wrap: normal;
  }
  .metric .money-stack span {
    grid-template-columns: 48px max-content;
  }
  table {
    min-width: 820px;
  }
  .mi-table {
    min-width: 820px;
  }
}

@media (max-width: 420px) {
  .content { padding: 12px; }
  .actions { width: 100%; }
  .actions .button { flex: 1 1 120px; }
  .brand { font-size: 19px; }
  .auth {
    width: calc(100% - 24px);
    padding: 20px;
  }
  .auth-links .button {
    flex: 1 1 120px;
  }
  .inline-auth-code {
    grid-template-columns: 1fr;
  }
  .topbar h1 { font-size: 20px; }
  table,
  .mi-table,
  .help-table {
    min-width: 760px;
  }
}


.quant-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: stretch;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 14px;
}
.quant-hero h2 { margin: 4px 0 8px; font-size: 26px; }
.quant-hero span { color: var(--teal); font-weight: 800; }
.quant-hero p { margin: 0; color: var(--muted); max-width: 760px; line-height: 1.65; }
.quant-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 8px;
  min-width: 330px;
}
.quant-hero-metrics article {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfd;
}
.quant-hero-metrics b,
.quant-hero-metrics small { display: block; }
.quant-hero-metrics b { font-size: 18px; color: var(--ink); }
.quant-hero-metrics small { margin-top: 4px; color: var(--muted); }
.quant-warning { color: #7a4d09; background: #fffaf0; border-color: #f1dfb6; font-weight: 700; }
.quant-tabs { margin: 12px 0; }
.quant-datahub-workbench {
  display: grid;
  gap: 14px;
}
.quant-datahub-lead {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, .8fr);
  gap: 14px;
  align-items: start;
}
.quant-datahub-lead span {
  display: block;
  color: var(--teal);
  font-weight: 800;
  margin-bottom: 4px;
}
.quant-datahub-lead h2 {
  margin: 0 0 8px;
  font-size: 22px;
}
.quant-datahub-lead p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.quant-datahub-form {
  align-self: stretch;
}
.quant-datahub-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.quant-datahub-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, .8fr);
  gap: 14px;
}
.quant-data-score-card {
  overflow-x: auto;
}
.quant-data-import-form textarea {
  min-height: 120px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}
.quant-data-import-panel {
  overflow-x: auto;
}
.quant-import-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
}
.quant-import-rules strong {
  color: var(--text);
}
.quant-import-validation {
  margin: -4px 0 14px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
}
.quant-import-validation .error {
  color: #b42318;
}
.quant-import-audit-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.quant-import-audit-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.quant-import-audit-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.quant-import-audit-detail {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.quant-audit-json-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.quant-audit-json-grid .code-block {
  max-height: 260px;
  overflow: auto;
}
.quant-score-profile-draft-form textarea {
  min-height: 74px;
}
.quant-table textarea[data-score-profile-review-note] {
  min-width: 180px;
  min-height: 58px;
  resize: vertical;
}
.quant-grid {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr);
  gap: 14px;
}
.quant-form textarea { min-height: 92px; resize: vertical; }
.quant-table th,
.quant-table td { white-space: normal; }
.quant-feedback { margin: 10px 0; font-weight: 800; }
.quant-running-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
}
.quant-task-feedback {
  margin: 12px 0 16px;
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}
.quant-running-feedback strong,
.quant-running-feedback small {
  display: block;
  overflow-wrap: anywhere;
}
.quant-running-feedback small {
  margin-top: 3px;
  color: #315f9e;
  font-weight: 700;
}
.quant-task-feedback small { color: #0f5f58; }
.quant-running-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2563eb;
  animation: quant-running-pulse 1s ease-in-out infinite;
}
@keyframes quant-running-pulse {
  0%, 100% { transform: scale(.75); opacity: .45; }
  50% { transform: scale(1.15); opacity: 1; }
}
.quant-scope {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}
.quant-scope div {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid var(--line-soft);
}
.quant-scope span,
.quant-scope b {
  display: block;
}
.quant-scope span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.quant-scope b {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.quant-broker-panel,
.quant-runtime-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.quant-broker-panel {
  padding: 14px;
  border: 1px solid #d7e2ef;
  border-radius: 8px;
  background: #fbfdff;
}
.quant-broker-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.quant-broker-head span,
.quant-broker-head strong {
  display: block;
}
.quant-broker-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.quant-broker-head strong {
  margin-top: 3px;
  color: #14213d;
  font-size: 20px;
}
.quant-broker-head p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}
.quant-broker-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.quant-broker-summary div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fff;
}
.quant-broker-summary span,
.quant-broker-summary b {
  display: block;
}
.quant-broker-summary span {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}
.quant-broker-summary b {
  color: var(--ink);
  font-size: 15px;
}
.quant-broker-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.quant-broker-cards article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}
.quant-broker-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.quant-broker-card-head strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}
.quant-broker-card-head span {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef7f4;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}
.quant-broker-cards small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.quant-broker-flags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.quant-broker-flags b {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f4f7fb;
  font-size: 12px;
}
.quant-broker-table small,
.quant-quality-table small {
  color: var(--muted);
}
.quant-metrics { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.quant-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.quant-chart-grid article,
.quant-factor-grid article,
.quant-inner-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}
.quant-chart-grid h3,
.quant-factor-grid h3 { margin: 0 0 10px; font-size: 16px; }
.quant-chart {
  width: 100%;
  height: 180px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #ffffff;
}
.quant-chart path {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}
.quant-chart-empty {
  height: 180px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--muted);
  background: #ffffff;
}
.quant-factor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.quant-factor-grid ul { margin: 0; padding-left: 18px; color: var(--ink); line-height: 1.7; }
.quant-factor-grid p { color: var(--muted); line-height: 1.65; }
@media (max-width: 980px) {
  .quant-hero,
  .quant-grid,
  .quant-datahub-lead,
  .quant-datahub-grid,
  .quant-chart-grid,
  .quant-factor-grid { grid-template-columns: 1fr; display: grid; }
  .quant-hero-metrics { min-width: 0; grid-template-columns: repeat(3, 1fr); }
  .quant-datahub-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.quant-overview-workbench {
  display: grid;
  gap: 14px;
}
.quant-overview-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 22px;
  border-color: #c9d7e8;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}
.quant-overview-title span {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}
.quant-overview-title h2 {
  margin: 0 0 8px;
  font-size: 26px;
  color: #14213d;
}
.quant-overview-title p {
  max-width: 840px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.quant-overview-actions,
.quant-overview-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.quant-overview-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.quant-overview-metrics .metric {
  min-height: 126px;
  display: grid;
  grid-template-rows: auto auto 1fr;
}
.quant-overview-metrics .metric small {
  align-self: end;
  color: var(--muted);
  line-height: 1.45;
}
.quant-overview-main,
.quant-overview-activity {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(340px, .75fr);
  gap: 14px;
  align-items: start;
}
.quant-overview-status h3,
.quant-overview-risk h3,
.quant-overview-activity h3 {
  margin: 0 0 10px;
  font-size: 17px;
  color: #15213a;
}
.quant-overview-risk {
  border-color: #ead6a3;
  background: #fffaf0;
}
.quant-overview-risk ul {
  margin: 0;
  padding-left: 18px;
  color: #65450f;
  line-height: 1.75;
  font-weight: 700;
}
.quant-overview-shortcuts {
  justify-content: flex-start;
}
@media (max-width: 1180px) {
  .quant-overview-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quant-overview-main,
  .quant-overview-activity { grid-template-columns: 1fr; }
  .quant-broker-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .stock-market-pill {
    flex-basis: min(360px, calc(100vw - 44px));
    min-width: min(360px, calc(100vw - 44px));
  }
  .stock-market-metrics {
    grid-template-columns: 1fr;
  }

  .quant-overview-lead { grid-template-columns: 1fr; align-items: start; }
  .quant-overview-actions { justify-content: flex-start; }
  .quant-overview-metrics { grid-template-columns: 1fr; }
  .quant-overview-title h2 { font-size: 22px; }
  .quant-broker-head { display: grid; }
  .quant-broker-head p { text-align: left; }
  .quant-broker-summary,
  .quant-broker-cards { grid-template-columns: 1fr; }
}

.quant-strategy-workbench {
  display: grid;
  gap: 14px;
}
.quant-strategy-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 18px;
  align-items: stretch;
  padding: 20px;
  border-color: #cbd8e8;
  background: #ffffff;
}
.quant-strategy-lead span {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.quant-strategy-lead h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: #14213d;
}
.quant-strategy-lead p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 860px;
}
.quant-strategy-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.quant-strategy-summary article {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfd;
}
.quant-strategy-summary b,
.quant-strategy-summary small {
  display: block;
}
.quant-strategy-summary b {
  color: var(--ink);
  font-size: 22px;
}
.quant-strategy-summary small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}
.quant-strategy-layout {
  display: grid;
  grid-template-columns: minmax(360px, .85fr) minmax(520px, 1.15fr);
  gap: 14px;
  align-items: start;
}
.quant-strategy-editor h3,
.quant-strategy-list h3,
.quant-strategy-version-panel h3 {
  margin: 0 0 10px;
  font-size: 17px;
  color: #15213a;
}
.quant-strategy-editor .quant-form textarea[name="description"] {
  min-height: 76px;
}
.quant-strategy-editor .quant-form textarea[name="factor_config"],
.quant-strategy-editor .quant-form textarea[name="rules"],
.quant-strategy-editor .quant-form textarea[name="risk_config"] {
  min-height: 84px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.quant-strategy-version-panel {
  margin-bottom: 0;
}
.quant-version-form {
  grid-template-columns: minmax(420px, 1.35fr) minmax(260px, .75fr) minmax(260px, .75fr);
  align-items: start;
}
.quant-version-form textarea[name="code_content"] {
  min-height: 260px;
  grid-row: span 3;
}
.quant-version-form textarea[name="default_params"],
.quant-version-form textarea[name="param_schema"] {
  min-height: 126px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
@media (max-width: 1180px) {
  .quant-strategy-lead,
  .quant-strategy-layout,
  .quant-version-form {
    grid-template-columns: 1fr;
  }
  .quant-version-form textarea[name="code_content"] {
    grid-row: auto;
  }
}
@media (max-width: 760px) {
  .stock-market-pill {
    flex-basis: min(360px, calc(100vw - 44px));
    min-width: min(360px, calc(100vw - 44px));
  }
  .stock-market-metrics {
    grid-template-columns: 1fr;
  }

  .quant-strategy-summary {
    grid-template-columns: 1fr;
  }
  .quant-strategy-lead h2 {
    font-size: 22px;
  }
}

.quant-backtest-workbench {
  display: grid;
  gap: 14px;
}
.quant-backtest-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 18px;
  align-items: stretch;
  padding: 20px;
  border-color: #cbd8e8;
  background: #ffffff;
}
.quant-backtest-lead span {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.quant-backtest-lead h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: #14213d;
}
.quant-backtest-lead p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 860px;
}
.quant-backtest-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.2fr) minmax(340px, .8fr);
  gap: 14px;
  align-items: start;
}
.quant-backtest-form-panel h3,
.quant-backtest-guide h3,
.quant-backtest-snapshots h3 {
  margin: 0 0 10px;
  font-size: 17px;
  color: #15213a;
}
.quant-backtest-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}
.quant-backtest-form textarea[name="params_json"] {
  grid-row: span 3;
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.quant-backtest-guide {
  border-color: #d7e2ef;
  background: #fbfdff;
}
.quant-backtest-guide ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.75;
  font-weight: 700;
}
.quant-backtest-snapshots {
  margin-bottom: 0;
}
@media (max-width: 1180px) {
  .quant-backtest-lead,
  .quant-backtest-layout,
  .quant-backtest-form {
    grid-template-columns: 1fr;
  }
  .quant-backtest-form textarea[name="params_json"] {
    grid-row: auto;
  }
}

.quant-result-workbench,
.quant-signal-workbench {
  display: grid;
  gap: 14px;
}
.quant-result-lead,
.quant-signal-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: stretch;
  padding: 20px;
  border-color: #cbd8e8;
  background: #ffffff;
}
.quant-result-lead span,
.quant-signal-lead span {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.quant-result-lead h2,
.quant-signal-lead h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: #14213d;
}
.quant-result-lead p,
.quant-signal-lead p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 860px;
}
.quant-result-headline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.quant-result-headline article {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfd;
}
.quant-result-headline small,
.quant-result-headline b {
  display: block;
}
.quant-result-headline small {
  color: var(--muted);
  line-height: 1.35;
}
.quant-result-headline b {
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
}
.quant-result-context h3,
.quant-result-layout h3,
.quant-result-review h3,
.quant-signal-form-panel h3,
.quant-signal-boundary h3,
.quant-signal-ledger h3 {
  margin: 0 0 10px;
  font-size: 17px;
  color: #15213a;
}
.quant-result-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.quant-result-layout,
.quant-signal-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
  align-items: start;
}
.quant-result-layout .quant-chart,
.quant-result-layout .quant-chart-empty {
  height: 220px;
}
.quant-empty-state {
  display: grid;
  gap: 12px;
  justify-items: start;
}
.quant-signal-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.quant-signal-form textarea[name="params_json"] {
  grid-row: span 3;
  min-height: 170px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.quant-signal-boundary {
  border-color: #ead6a3;
  background: #fffaf0;
}
.quant-signal-boundary ul {
  margin: 0;
  padding-left: 18px;
  color: #65450f;
  line-height: 1.75;
  font-weight: 700;
}
.quant-signal-ledger {
  margin-bottom: 0;
}
@media (max-width: 1180px) {
  .quant-result-lead,
  .quant-signal-lead,
  .quant-result-layout,
  .quant-signal-layout {
    grid-template-columns: 1fr;
  }
  .quant-result-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .stock-market-pill {
    flex-basis: min(360px, calc(100vw - 44px));
    min-width: min(360px, calc(100vw - 44px));
  }
  .stock-market-metrics {
    grid-template-columns: 1fr;
  }

  .quant-result-headline,
  .quant-result-metrics,
  .quant-signal-form {
    grid-template-columns: 1fr;
  }
  .quant-signal-form textarea[name="params_json"] {
    grid-row: auto;
  }
  .quant-result-lead h2,
  .quant-signal-lead h2 {
    font-size: 22px;
  }
}

.quant-credibility-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}
.quant-credibility-list li.warn {
  color: #b91c1c;
}
.quant-credibility-list b {
  color: var(--ink);
}
.quant-credibility-panel .quant-scope {
  margin-top: 8px;
}
.quant-health-cell {
  display: grid;
  gap: 4px;
  min-width: 180px;
}
.quant-health-cell strong {
  font-size: 1.05rem;
}
.quant-health-cell small {
  color: var(--muted);
  line-height: 1.45;
}
.quant-overview-health .panel {
  display: grid;
  gap: 12px;
}
.quant-health-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.quant-health-strip div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f9fbfd;
}
.quant-health-strip span,
.quant-health-strip b {
  display: block;
}
.quant-health-strip span {
  color: var(--muted);
  font-size: 12px;
}
.quant-health-strip b {
  margin-top: 4px;
  font-size: 20px;
  color: var(--ink);
}
@media (max-width: 760px) {
  .stock-market-pill {
    flex-basis: min(360px, calc(100vw - 44px));
    min-width: min(360px, calc(100vw - 44px));
  }
  .stock-market-metrics {
    grid-template-columns: 1fr;
  }

  .quant-health-strip { grid-template-columns: 1fr 1fr; }
}
.quant-health-detail {
  display: grid;
  gap: 12px;
}
.quant-health-detail .quant-table small {
  display: block;
  max-width: 420px;
  word-break: break-word;
}
.quant-health-advice {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}
.quant-health-advice p {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fffaf0;
  color: #65450f;
}

.quant-comparison-panel {
  display: grid;
  gap: 14px;
}
.quant-comparison-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid #d7e2ef;
  border-radius: 8px;
  background: #fbfdff;
}
.quant-comparison-head span,
.quant-comparison-head h3,
.quant-comparison-head p {
  margin: 0;
}
.quant-comparison-head > div > span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
.quant-comparison-head h3 {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
}
.quant-comparison-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.quant-comparison-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.quant-comparison-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
.quant-comparison-card span,
.quant-comparison-card b {
  display: block;
}
.quant-comparison-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 5px;
}
.quant-comparison-card b {
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}
.quant-recommendations {
  padding: 12px 14px;
  border: 1px solid #f1dfb6;
  border-radius: 8px;
  background: #fffaf0;
  color: #6f4708;
}
.quant-recommendations strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}
.quant-recommendations ul {
  margin: 0;
  padding-left: 18px;
}
.quant-recommendations li {
  margin: 4px 0;
  line-height: 1.45;
  font-size: 13px;
}
.quant-action-gauge-panel {
  border-color: #d7e2ee;
  background: #fbfdff;
}
.quant-action-gauge-panel h3,
.quant-ai-judgement-panel h3 {
  margin: 0;
  font-size: 17px;
  color: #15213a;
}
.quant-action-gauge {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(110px, 150px);
  gap: 14px;
  align-items: end;
}
.quant-action-gauge-scale {
  grid-column: 1 / 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 900;
  color: #4b5d72;
}
.quant-action-gauge-scale span:nth-child(1) {
  text-align: left;
  color: #b42318;
}
.quant-action-gauge-scale span:nth-child(2) {
  text-align: center;
  color: #87640a;
}
.quant-action-gauge-scale span:nth-child(3) {
  text-align: right;
  color: #087443;
}
.quant-rainbow-track {
  position: relative;
  grid-column: 1 / 2;
  height: 18px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d92d20 0%, #f97316 26%, #facc15 50%, #84cc16 72%, #16a34a 100%);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12);
}
.quant-rainbow-cursor {
  position: absolute;
  top: -19px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 15px solid #0f172a;
  filter: drop-shadow(0 3px 3px rgba(15, 23, 42, .22));
  transform: translateX(-50%);
}
.quant-action-score {
  grid-column: 2 / 3;
  grid-row: 1 / span 2;
  display: grid;
  justify-items: end;
  gap: 2px;
}
.quant-action-score strong {
  font-size: 32px;
  line-height: 1;
  color: #12233f;
}
.quant-action-score span,
.quant-action-score small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}
.quant-action-reasons {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.7;
}
.quant-stock-topline {
  display: grid;
  gap: 12px;
  border-color: #d7e2ee;
  background: #fbfdff;
}
.quant-stock-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.quant-stock-title-row h3 {
  margin: 0;
  color: #15213a;
  font-size: 18px;
}
.quant-stock-title-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.quant-stock-top-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.quant-stock-top-metrics article {
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}
.quant-stock-top-metrics span,
.quant-stock-top-metrics strong {
  display: block;
}
.quant-stock-top-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}
.quant-stock-top-metrics strong {
  margin-top: 7px;
  color: #12233f;
  font-size: 16px;
  line-height: 1.25;
  word-break: break-word;
}
.quant-stock-review-note {
  margin-top: 0;
}
.quant-stock-decision-grid {
  display: grid;
  grid-template-columns: minmax(360px, .88fr) minmax(0, 1.12fr);
  gap: 14px;
  align-items: stretch;
}
.quant-stock-decision-grid > .panel {
  margin: 0;
}
.quant-risk-heat {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(110px, 150px);
  gap: 7px 14px;
  align-items: center;
}
.quant-risk-heat-head,
.quant-risk-heat-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.quant-risk-heat-head span {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}
.quant-risk-heat-head b {
  grid-column: 2 / 3;
  font-size: 15px;
  color: #12233f;
}
.quant-risk-heat-head {
  grid-column: 1 / -1;
}
.quant-risk-heat-track {
  position: relative;
  grid-column: 1 / 2;
  height: 14px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a 0%, #a3e635 32%, #facc15 55%, #f97316 75%, #d92d20 100%);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12);
}
.quant-risk-heat-track i {
  display: block;
  height: 100%;
  min-width: 5px;
  border-radius: inherit;
  background: rgba(15, 23, 42, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.quant-risk-heat.risk-low .quant-risk-heat-track i {
  background: rgba(22, 163, 74, .82);
}
.quant-risk-heat.risk-medium .quant-risk-heat-track i {
  background: rgba(250, 204, 21, .86);
}
.quant-risk-heat.risk-high .quant-risk-heat-track i {
  background: rgba(217, 45, 32, .86);
}
.quant-risk-cursor {
  position: absolute;
  top: -17px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 14px solid #0f172a;
  filter: drop-shadow(0 3px 3px rgba(15, 23, 42, .22));
  transform: translateX(-50%);
}
.quant-risk-heat-scale {
  grid-column: 1 / 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.quant-risk-heat-scale span:first-child {
  color: #087443;
}
.quant-risk-heat-scale span:nth-child(2) {
  color: #87640a;
}
.quant-risk-heat-scale span:last-child {
  color: #b42318;
}
.quant-metrics-with-knowledge {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.quant-macro-knowledge {
  padding: 12px 14px;
  border: 1px solid #ead6a3;
  border-radius: 8px;
  background: #fffaf0;
  min-height: 100%;
}
.quant-macro-knowledge-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.quant-macro-knowledge-head strong {
  color: #15213a;
  font-size: 17px;
}
.quant-macro-knowledge-head span {
  color: #65450f;
  font-size: 12px;
  font-weight: 700;
}
.quant-macro-knowledge ul {
  margin: 0;
  padding-left: 18px;
  color: #65450f;
  line-height: 1.75;
  font-size: 14px;
  font-weight: 700;
}
.quant-macro-knowledge.compact {
  min-height: 0;
  margin-top: 12px;
  background: #fffaf0;
}
.quant-macro-knowledge.compact summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: #15213a;
  font-size: 15px;
  font-weight: 900;
}
.quant-macro-knowledge.compact summary span {
  color: #65450f;
  font-size: 12px;
  font-weight: 800;
}
.quant-macro-knowledge.compact ul {
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.65;
}
.quant-judgement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.quant-ai-judgement-panel {
  border-color: #cfe0d7;
  background: #fbfefc;
}
.quant-macro-impact-panel {
  border-color: #d8d9f1;
  background: #fbfbff;
}
.quant-ai-judgement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.quant-ai-judgement-grid article,
.quant-macro-impact-body article {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}
.quant-ai-judgement-grid h4,
.quant-macro-impact-body h4 {
  margin: 0 0 8px;
  color: #15213a;
  font-size: 15px;
}
.quant-ai-judgement-grid p {
  margin: 0 0 8px;
  color: #334155;
  line-height: 1.65;
}
.quant-ai-judgement-grid ul,
.quant-macro-impact-body ul {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.7;
}
.quant-macro-impact-body {
  display: grid;
  gap: 12px;
}
.quant-decision-replay-panel {
  display: grid;
  gap: 13px;
  border-color: #d7e2ee;
  background: #fbfdff;
}
.quant-decision-replay-panel h3 {
  margin: 0;
  font-size: 17px;
  color: #15213a;
}
.quant-replay-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.quant-replay-summary div {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}
.quant-replay-summary span,
.quant-replay-summary b {
  display: block;
}
.quant-replay-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.quant-replay-summary b {
  margin-top: 4px;
  color: var(--ink);
  font-size: 17px;
}
.quant-replay-chart {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(#f8fafc, #ffffff);
}
.quant-replay-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.quant-replay-filters label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #ffffff;
  color: #20304d;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.quant-replay-filters input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #2563eb;
}
.quant-replay-filters b {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  text-align: center;
  font-size: 11px;
}
.quant-replay-svg {
  display: block;
  width: 100%;
  height: 260px;
}
.quant-replay-axis {
  stroke: #cbd5e1;
  stroke-width: .7;
  vector-effect: non-scaling-stroke;
}
.quant-replay-price {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}
.quant-replay-marker {
  stroke: #ffffff;
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
}
.quant-replay-marker.marker-buy,
.quant-replay-legend .marker-buy {
  fill: #16a34a;
  background: #16a34a;
}
.quant-replay-marker.marker-sell,
.quant-replay-legend .marker-sell {
  fill: #d92d20;
  background: #d92d20;
}
.quant-replay-marker.marker-hit,
.quant-replay-legend .marker-hit {
  fill: #0891b2;
  background: #0891b2;
}
.quant-replay-marker.marker-miss,
.quant-replay-legend .marker-miss {
  fill: #f97316;
  background: #f97316;
}
.quant-replay-marker.marker-pending,
.quant-replay-marker.marker-hold,
.quant-replay-legend .marker-pending {
  fill: #64748b;
  background: #64748b;
}
.quant-replay-marker.marker-report,
.quant-replay-legend .marker-report {
  fill: #7c3aed;
  background: #7c3aed;
}
.quant-replay-marker.marker-factor,
.quant-replay-legend .marker-factor {
  fill: #2563eb;
  background: #2563eb;
}
.quant-replay-marker.marker-factor_positive {
  fill: #0f9f6e;
}
.quant-replay-marker.marker-factor_negative {
  fill: #dc2626;
}
.quant-replay-marker.marker-attribution_support,
.quant-replay-legend .marker-attribution-support {
  fill: #059669;
  background: #059669;
}
.quant-replay-marker.marker-attribution_risk,
.quant-replay-legend .marker-attribution-risk {
  fill: #b91c1c;
  background: #b91c1c;
}
.quant-replay-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}
.quant-replay-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.quant-replay-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(15, 23, 42, .12);
}
.quant-replay-table td strong,
.quant-replay-table td small {
  display: block;
}
.quant-replay-table td small {
  color: var(--muted);
  line-height: 1.45;
}
.quant-stock-chart-panel {
  display: grid;
  gap: 13px;
  border-color: #dbe4ef;
  background: #fbfdff;
}
.stock-chart-dialog {
  width: min(1180px, calc(100vw - 28px));
  max-height: calc(100vh - 34px);
  overflow: auto;
}
.stock-chart-dialog .modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.stock-chart-dialog-body {
  display: grid;
  gap: 12px;
}
.stock-chart-dialog-body .quant-stock-chart-panel {
  margin: 0;
}
.stock-detail-dialog {
  width: min(1280px, calc(100vw - 28px));
  max-height: calc(100vh - 34px);
  overflow: auto;
}
.stock-detail-dialog .modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.stock-detail-dialog-body {
  display: grid;
  gap: 12px;
}
.stock-detail-dialog-body .quant-stock-chart-panel {
  margin: 0;
}
.stock-detail-overview,
.stock-detail-quant-panel {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}
.stock-detail-overview {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(120px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.stock-detail-overview .metric strong,
.stock-detail-quant-panel .metric strong {
  display: block;
  margin-top: 3px;
  color: #15213a;
  font-size: 15px;
}
.stock-detail-quant-panel h3 {
  margin: 0;
  color: #15213a;
  font-size: 16px;
}
.stock-detail-quant-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.stock-symbol-link {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.stock-symbol-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}
.stock-symbol-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 320px;
}
.stock-symbol-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 26px;
  padding: 2px 4px 2px 7px;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  background: #f8fbff;
}
.mini-icon-button {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.mini-icon-button:hover {
  border-color: #2563eb;
  color: #2563eb;
}
.quant-calibration-verdict {
  display: grid;
  gap: 7px;
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}
.quant-calibration-verdict p {
  margin: 0;
  color: #15213a;
  font-weight: 850;
  line-height: 1.55;
}
.quant-calibration-verdict small {
  color: #64748b;
  font-weight: 750;
}
.quant-calibration-viz article {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}
.quant-calibration-viz h4 {
  margin: 0 0 8px;
  color: #15213a;
}
.quant-calibration-bars {
  display: grid;
  gap: 8px;
}
.quant-calibration-bar {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(130px, 1.3fr) 64px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.quant-calibration-bar strong {
  color: #15213a;
}
.quant-calibration-bar small {
  display: block;
  color: #64748b;
  font-weight: 750;
}
.quant-calibration-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.quant-calibration-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f59e0b;
}
.quant-calibration-bar.ok .quant-calibration-track span {
  background: #16a34a;
}
.quant-calibration-bar.warn .quant-calibration-track span {
  background: #d92d20;
}
.quant-calibration-bar b {
  color: #15213a;
  text-align: right;
}
.quant-calibration-recent .stock-symbol-link-list {
  max-width: 180px;
  margin-bottom: 4px;
}
.quant-calibration-trend {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}
.quant-calibration-trend h4 {
  margin: 0;
  color: #15213a;
}
.quant-calibration-trend-bars {
  display: flex;
  gap: 8px;
  min-height: 190px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.quant-calibration-trend-item {
  display: grid;
  grid-template-rows: auto 96px auto auto;
  grid-template-columns: 22px 22px;
  gap: 5px 4px;
  min-width: 58px;
  align-items: end;
  justify-content: center;
  color: #334155;
  font-size: 11px;
  font-weight: 850;
}
.quant-calibration-trend-item small,
.quant-calibration-trend-item b,
.quant-calibration-trend-item em {
  grid-column: 1 / -1;
  text-align: center;
}
.quant-calibration-trend-item em {
  color: #64748b;
  font-style: normal;
}
.quant-calibration-trend-track {
  position: relative;
  height: 96px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.quant-calibration-trend-track span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
}
.quant-calibration-trend-track.sample span {
  background: #94a3b8;
}
.quant-calibration-trend-track.hit span {
  background: #f59e0b;
}
.quant-calibration-trend-item.ok .quant-calibration-trend-track.hit span {
  background: #16a34a;
}
.quant-calibration-trend-item.warn .quant-calibration-trend-track.hit span {
  background: #d92d20;
}
.quant-calibration-market-trend {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}
.quant-calibration-market-trend h4 {
  margin: 0;
  color: #15213a;
}
.quant-calibration-market-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
}
.quant-calibration-market-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.quant-calibration-market-card.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.quant-calibration-market-card.warn {
  border-color: #fecaca;
  background: #fff7f7;
}
.quant-calibration-market-card strong {
  color: #15213a;
  font-size: 17px;
}
.quant-calibration-market-card small {
  color: #64748b;
  font-weight: 750;
}
.quant-calibration-market-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.quant-calibration-market-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.quant-calibration-market-metrics b {
  color: #15213a;
  font-size: 13px;
}
.quant-calibration-policy {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}
.quant-calibration-policy h4 {
  margin: 0;
}
.quant-calibration-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
}
.quant-calibration-policy-grid article {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
}
.quant-calibration-policy-grid strong {
  color: #15213a;
  font-size: 18px;
}
.quant-calibration-policy-grid span {
  color: #1d4ed8;
  font-weight: 900;
}
.quant-calibration-policy-grid small {
  color: #475569;
  line-height: 1.45;
}
.quant-calibration-policy-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.quant-calibration-policy-metrics b {
  padding: 5px 6px;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 11px;
  text-align: center;
}
.quant-report-version-chain {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}
.quant-report-version-chain h4 {
  margin: 0;
}
.quant-report-version-chain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
}
.quant-report-version-chain-grid article {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.quant-report-chain-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.quant-report-chain-steps span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 7px;
  border-radius: 7px;
  background: #ffffff;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}
.quant-report-chain-steps b {
  overflow-wrap: anywhere;
  color: #15213a;
  font-size: 12px;
}
.admin-system-health {
  border-color: #dbeafe;
  background: #f8fbff;
}
.admin-system-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.admin-system-health-grid article {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
}
.admin-system-health-grid span,
.admin-system-counts b {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}
.admin-system-health-grid strong {
  color: #15213a;
  font-size: 18px;
}
.admin-system-health-grid small {
  color: #64748b;
  font-weight: 750;
}
.admin-system-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.admin-system-counts span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #15213a;
  font-weight: 850;
}
.stock-detail-footer {
  justify-content: flex-end;
  padding-top: 4px;
}
.quant-stock-chart-panel h3 {
  margin: 0;
  font-size: 17px;
  color: #15213a;
}
.quant-stock-chart-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}
.quant-kline-controls {
  display: grid;
  grid-template-columns: auto minmax(360px, 1fr) auto auto;
  gap: 10px 12px;
  align-items: stretch;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}
.quant-kline-control-cluster {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.quant-kline-view-cluster {
  justify-self: end;
}
.quant-kline-control-label {
  display: inline-grid;
  min-width: 36px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}
.quant-kline-control-cluster .segmented-control,
.quant-kline-toggle-group,
.quant-kline-zoom-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quant-kline-zoom-group {
  margin-left: auto;
}
.quant-kline-controls button {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}
.quant-kline-controls button.active {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
}
.quant-kline-zoom-group button:active {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
}
.quant-kline-controls button:hover {
  border-color: #64748b;
}
.quant-stock-chart-meta div {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}
.quant-kline-inspector {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}
.quant-kline-inspector div {
  min-width: 0;
}
.quant-stock-chart-meta span,
.quant-stock-chart-meta b,
.quant-kline-inspector span,
.quant-kline-inspector b {
  display: block;
}
.quant-stock-chart-meta span,
.quant-kline-inspector span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.quant-stock-chart-meta b,
.quant-kline-inspector b {
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.quant-stock-chart-grid {
  display: grid;
  gap: 12px;
}
.quant-stock-chart-grid article {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}
.quant-stock-chart-grid article[data-quant-chart-pan] {
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}
.quant-stock-chart-grid article[data-quant-chart-pan]:active {
  cursor: grabbing;
}
.quant-stock-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.quant-stock-chart-head strong {
  color: #15213a;
  font-size: 14px;
}
.quant-stock-chart-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.quant-kline-svg {
  display: block;
  width: 100%;
  height: 320px;
  background: linear-gradient(#f8fafc, #ffffff);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}
.quant-volume-svg {
  display: block;
  width: 100%;
  height: 120px;
  background: linear-gradient(#ffffff, #f8fafc);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}
.quant-chart-axis {
  stroke: #cbd5e1;
  stroke-width: .7;
  vector-effect: non-scaling-stroke;
}
.quant-chart-cursor {
  stroke: #0f172a;
  stroke-width: .7;
  stroke-dasharray: 2 2;
  opacity: .65;
  vector-effect: non-scaling-stroke;
}
.quant-candle line {
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
}
.quant-candle rect {
  stroke-width: .5;
  vector-effect: non-scaling-stroke;
}
.quant-candle.up line,
.quant-candle.up rect {
  stroke: #16a34a;
  fill: rgba(22, 163, 74, .28);
}
.quant-candle.down line,
.quant-candle.down rect {
  stroke: #d92d20;
  fill: rgba(217, 45, 32, .28);
}
.quant-ma-line {
  fill: none;
  stroke-width: 1.35;
  vector-effect: non-scaling-stroke;
  opacity: .95;
}
.quant-ma-line.ma5,
.quant-ma-legend .ma5 {
  stroke: #0891b2;
  background: #0891b2;
}
.quant-ma-line.ma10,
.quant-ma-legend .ma10 {
  stroke: #7c3aed;
  background: #7c3aed;
}
.quant-ma-line.ma15,
.quant-ma-legend .ma15 {
  stroke: #0f766e;
  background: #0f766e;
}
.quant-ma-line.ma20,
.quant-ma-legend .ma20 {
  stroke: #d97706;
  background: #d97706;
}
.quant-ma-line.ma30,
.quant-ma-legend .ma30 {
  stroke: #db2777;
  background: #db2777;
}
.quant-ma-line.ma60,
.quant-ma-legend .ma60 {
  stroke: #475569;
  background: #475569;
}
.quant-boll-line {
  fill: none;
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
  opacity: .74;
}
.quant-boll-line.upper,
.quant-boll-line.lower,
.quant-ma-legend .boll {
  stroke: #9333ea;
  background: #9333ea;
}
.quant-boll-line.mid {
  stroke: #a855f7;
  stroke-dasharray: 2 2;
}
.quant-kline-marker {
  stroke: #ffffff;
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
}
.quant-kline-marker.marker-buy,
.quant-ma-legend .marker-buy {
  fill: #16a34a;
  background: #16a34a;
}
.quant-kline-marker.marker-sell,
.quant-ma-legend .marker-sell {
  fill: #d92d20;
  background: #d92d20;
}
.quant-volume-bar.up {
  fill: rgba(22, 163, 74, .58);
}
.quant-volume-bar.down {
  fill: rgba(217, 45, 32, .58);
}
.quant-volume-ma {
  fill: none;
  stroke-width: 1.35;
  vector-effect: non-scaling-stroke;
  opacity: .95;
}
.quant-volume-ma.ma5 {
  stroke: #0891b2;
}
.quant-volume-ma.ma20,
.quant-ma-legend .volume-ma {
  stroke: #d97706;
  background: #d97706;
}
.quant-ma-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}
.quant-ma-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.quant-ma-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(15, 23, 42, .12);
}
@media (max-width: 900px) {
  .quant-action-gauge,
  .quant-risk-heat,
  .quant-stock-decision-grid,
  .quant-judgement-row,
  .quant-ai-judgement-grid,
  .quant-metrics-with-knowledge,
  .quant-replay-summary,
  .stock-detail-overview,
  .stock-detail-quant-grid,
  .quant-calibration-bar,
  .quant-calibration-market-grid,
  .quant-calibration-policy-grid,
  .quant-report-version-chain-grid,
  .quant-report-chain-steps,
  .admin-system-health-grid,
  .quant-stock-chart-meta,
  .quant-kline-inspector {
    grid-template-columns: 1fr;
  }
  .quant-calibration-bar b {
    text-align: left;
  }
  .quant-stock-top-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quant-action-score {
    grid-column: 1 / 2;
    grid-row: auto;
    justify-items: start;
  }
  .quant-action-score span,
  .quant-action-score small {
    text-align: left;
  }
  .quant-replay-svg {
    height: 220px;
  }
  .quant-kline-svg {
    height: 260px;
  }
  .quant-volume-svg {
    height: 105px;
  }
  .quant-kline-controls {
    grid-template-columns: 1fr;
  }
  .quant-kline-view-cluster {
    justify-self: stretch;
  }
  .quant-kline-control-cluster {
    grid-template-columns: 46px minmax(0, 1fr);
  }
}
.quant-comparison-table th,
.quant-comparison-table td {
  vertical-align: top;
}
.quant-comparison-table td strong,
.quant-comparison-table td small {
  display: block;
}
.quant-comparison-table td small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}
.quant-watch-compare-table th,
.quant-watch-compare-table td {
  vertical-align: top;
}
.quant-decision-cell {
  display: grid;
  gap: 4px;
  min-width: 84px;
}
.quant-decision-cell .tag {
  justify-self: start;
  white-space: nowrap;
}
.quant-decision-cell small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.quant-curve-compare-panel {
  display: grid;
  gap: 14px;
}
.quant-curve-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}
.quant-curve-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
.quant-curve-grid h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
}
.quant-multi-chart {
  display: block;
  width: 100%;
  height: 190px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(#f8fafc, #ffffff);
}
.quant-multi-chart path {
  fill: none;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
  opacity: .92;
}
.quant-drawdown-chart {
  background: linear-gradient(#fffaf0, #ffffff);
}
.quant-curve-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}
.quant-curve-legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
}
.quant-curve-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.quant-curve-legend span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.quant-curve-legend b {
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 860px) {
  .quant-curve-grid { grid-template-columns: 1fr; }
}
.quant-compare-reports-panel {
  display: grid;
  gap: 14px;
}
.quant-report-form {
  grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.2fr) auto;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.quant-report-form textarea {
  min-height: 44px;
  resize: vertical;
}
.quant-report-form small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
}
@media (max-width: 900px) {
  .quant-report-form { grid-template-columns: 1fr; }
}
.quant-briefing-panel {
  display: grid;
  gap: 14px;
}
.quant-briefing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}
.quant-briefing-grid article {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
.quant-briefing-grid h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
}
.quant-briefing-grid ul {
  margin: 0;
  padding-left: 18px;
}
.quant-briefing-grid li {
  margin: 5px 0;
  line-height: 1.5;
  color: var(--ink);
}
.quant-briefing-markdown summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
}
.quant-briefing-markdown .code-block {
  max-height: 360px;
  overflow: auto;
}
@media (max-width: 860px) {
  .quant-briefing-grid { grid-template-columns: 1fr; }
}
.quant-briefing-blocks-panel {
  display: grid;
  gap: 14px;
}
.quant-briefing-blocks-panel .quant-table td small {
  line-height: 1.4;
}

.mi-quant-report {
  display: grid;
  gap: 14px;
  border-color: #d7e2ef;
  background: #fbfdff;
}
.mi-quant-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.mi-quant-head span,
.mi-quant-head h2,
.mi-quant-head p {
  margin: 0;
}
.mi-quant-head > div > span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
.mi-quant-head h2 {
  color: var(--ink);
  font-size: 20px;
}
.mi-quant-head p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}
.mi-quant-block-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
.mi-quant-block-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.mi-quant-block-title strong {
  color: var(--ink);
  font-size: 15px;
}
.mi-quant-block-card ul {
  margin: 10px 0;
  padding-left: 18px;
}
.mi-quant-block-card li {
  margin: 5px 0;
  line-height: 1.5;
}
.mi-quant-block-card details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
}
.quant-briefing-timeline-panel {
  display: grid;
  gap: 14px;
}
.quant-timeline-list {
  display: grid;
  gap: 10px;
  position: relative;
}
.quant-timeline-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.quant-timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 11px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 4px #dbeafe;
}
.quant-timeline-body {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
.quant-timeline-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.quant-timeline-title strong {
  color: var(--ink);
  font-size: 14px;
}
.quant-timeline-body h4 {
  margin: 6px 0 4px;
  color: var(--ink);
  font-size: 15px;
}
.quant-timeline-body p {
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.45;
}
.quant-timeline-body small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Quant layout guardrails: keep research tables and long evidence text readable. */
.quant-table,
.mi-quant-table {
  width: 100%;
  table-layout: fixed;
}
.quant-table {
  min-width: 720px;
}
.mi-quant-table {
  min-width: 680px;
}
.quant-table th,
.quant-table td,
.mi-quant-table th,
.mi-quant-table td {
  max-width: 260px;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.quant-table td small,
.mi-quant-table td small,
.quant-credibility-list,
.quant-briefing-grid,
.quant-briefing-blocks-panel,
.mi-quant-report,
.mi-quant-block-card,
.quant-timeline-body {
  min-width: 0;
}
.quant-briefing-markdown .code-block,
.code-block {
  max-width: 100%;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.quant-scope,
.quant-health-strip,
.quant-result-metrics,
.quant-portfolio-grid,
.quant-briefing-grid {
  min-width: 0;
}
.quant-scope div,
.quant-health-cell,
.quant-timeline-title,
.mi-quant-head,
.mi-quant-block-title {
  min-width: 0;
}
.quant-timeline-title,
.mi-quant-head,
.mi-quant-block-title {
  flex-wrap: wrap;
}
.quant-timeline-title strong,
.mi-quant-block-title strong,
.mi-quant-head h2,
.mi-quant-head p {
  overflow-wrap: anywhere;
}
.quant-actions,
.actions {
  flex-wrap: wrap;
}
.quant-actions button,
.actions button {
  max-width: 100%;
  white-space: normal;
}

@media (max-width: 760px) {
  .stock-market-pill {
    flex-basis: min(360px, calc(100vw - 44px));
    min-width: min(360px, calc(100vw - 44px));
  }
  .stock-market-metrics {
    grid-template-columns: 1fr;
  }

  .quant-hero,
  .quant-broker-head,
  .mi-quant-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .quant-hero-metrics {
    min-width: 0;
    grid-template-columns: 1fr;
  }
  .quant-grid {
    grid-template-columns: 1fr;
  }
  .quant-table,
  .mi-quant-table {
    min-width: 620px;
  }
  .quant-table th,
  .quant-table td,
  .mi-quant-table th,
  .mi-quant-table td {
    max-width: 220px;
  }
}

.quant-linked-object-drawer {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #c7d7ea;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
.quant-linked-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.quant-linked-head strong {
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}
.quant-linked-coverage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}
.quant-linked-coverage article {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
.quant-linked-coverage span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.quant-linked-coverage b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
}
.quant-linked-checklist {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}





.quant-audit-compare-panel {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}
.quant-audit-compare-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.quant-audit-compare-controls label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #475569;
}
.quant-audit-compare-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.quant-audit-compare-summary article {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.quant-audit-compare-summary span,
.quant-audit-compare-summary small {
  display: block;
  color: #64748b;
}
.quant-audit-compare-summary b {
  display: block;
  margin: 4px 0;
  font-size: 18px;
}
@media (max-width: 900px) {
  .quant-audit-compare-controls,
  .quant-audit-compare-summary {
    grid-template-columns: 1fr;
  }
}
