:root {
  --canvas: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fd;
  --ink: #1d2638;
  --muted: #737e94;
  --faint: #9ba5b8;
  --line: #e8ebf2;
  --line-strong: #dce1eb;
  --teal: #4167ef;
  --teal-dark: #2f50d5;
  --teal-soft: #edf1ff;
  --indigo: #6777d9;
  --orange: #e88a3d;
  --rose: #e25b6a;
  --lime: #66a34f;
  --cyan: #32a0b8;
  --positive: #15956f;
  --negative: #df5261;
  --nav: #ffffff;
  --nav-muted: #69758b;
  --shadow: 0 8px 26px rgba(41, 59, 102, 0.08);
  font-family: Inter, "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
.hidden { display: none !important; }
.workspace-page-hidden { display: none !important; }
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }

.auth-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--canvas); }
.auth-panel { width: min(410px, 100%); border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 11px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.auth-brand .brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--teal); color: var(--teal-dark); font-family: Georgia, serif; font-size: 20px; }
.auth-brand strong, .auth-brand small { display: block; }.auth-brand strong { font-size: 16px; }.auth-brand small { margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: 1px; }
.auth-heading { padding: 26px 24px 0; }.auth-heading h1 { font-size: 22px; }
.auth-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 20px 24px 0; padding: 3px; background: var(--surface-soft); border: 1px solid var(--line); }
.auth-mode-switch button { min-height: 34px; border: 0; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; }
.auth-mode-switch button.active { color: var(--teal-dark); background: var(--surface); box-shadow: 0 1px 4px rgba(41,59,102,.08); }
.auth-form { display: grid; gap: 15px; padding: 22px 24px 26px; }
.auth-field { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
.auth-field input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); outline: 0; color: var(--ink); background: var(--surface-soft); font-size: 13px; }
.auth-field input:focus { border-color: #8ecfc1; box-shadow: 0 0 0 3px rgba(14,139,130,.12); }
.auth-error { margin: 0; padding: 9px 10px; color: #9a3940; background: #fae9eb; font-size: 11px; line-height: 1.5; }
.auth-submit { width: 100%; margin-top: 3px; font-size: 13px !important; }
.auth-submit svg { margin: 0 !important; }
.auth-code-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
.auth-code-row .button { min-height: 40px; padding: 0 10px; font-size: 11px; white-space: nowrap; }
.auth-agreement { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.auth-agreement input { margin-top: 2px; accent-color: var(--teal); }
@media (max-width: 420px) { .auth-code-row { grid-template-columns: minmax(0, 1fr) 102px; } }
@media (max-height: 760px) {
  .auth-screen { place-items: start center; padding-top: 12px; padding-bottom: 12px; }
  .auth-brand { padding-top: 16px; padding-bottom: 16px; }
  .auth-heading { padding-top: 18px; }
  .auth-mode-switch { margin-top: 14px; }
  .auth-form { gap: 12px; padding-top: 16px; padding-bottom: 18px; }
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; width: 246px; height: 100vh; min-height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; align-self: flex-start; overflow-y: auto; overscroll-behavior: contain; padding: 23px 14px 16px; background: var(--nav); color: #f3f7f4; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 28px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #67d2be; color: #c8fbef; font-family: Georgia, serif; font-size: 20px; }
.brand strong, .brand small, .profile strong, .profile small { display: block; }
.brand strong { font-size: 16px; line-height: 1.1; }
.brand small { margin-top: 4px; color: #95aaa1; font-size: 9px; letter-spacing: 1px; }
.primary-nav, .secondary-nav { display: grid; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 12px; border: 1px solid transparent; color: var(--nav-muted); text-decoration: none; font-size: 14px; }
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #e4fff8; background: rgba(76, 179, 156, .16); border-color: rgba(112, 219, 193, .18); }
.nav-item b { min-width: 20px; margin-left: auto; padding: 1px 6px; color: #d8f9ef; background: rgba(115, 214, 190, .18); font-size: 11px; text-align: center; }
.nav-section { margin: 29px 10px 8px; color: #798c83; font-size: 11px; letter-spacing: .8px; }
.sidebar-status { display: flex; align-items: center; gap: 7px; margin-top: auto; padding: 11px 10px; border-top: 1px solid rgba(255,255,255,.09); color: #aebbb4; font-size: 11px; }
.status-dot, .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4fd1ad; box-shadow: 0 0 0 3px rgba(79,209,173,.13); }
.profile { display: flex; align-items: center; gap: 9px; padding: 11px 7px 0; }
.profile strong { color: #f2f7f3; font-size: 12px; }
.profile small { margin-top: 3px; color: #93a59c; font-size: 10px; }
.profile .icon-button { margin-left: auto; color: #b8c7bf; }
.mobile-menu-button, .mobile-sidebar-close, .mobile-sidebar-backdrop { display: none; }

.main-content { width: min(100%, 1660px); padding: 31px clamp(22px, 3vw, 52px) 92px; margin: 0 auto; }
.topbar, .section-heading, .aside-heading, .chart-heading, .modal-header, .drawer-header, .card-topline, .card-footer, .detail-title-row, .compare-bar { display: flex; align-items: center; justify-content: space-between; }
.topbar-heading { display: flex; min-width: 0; align-items: flex-start; gap: 10px; }
.topbar-copy { min-width: 0; }
.eyebrow { margin: 0 0 5px; color: var(--teal-dark); font-size: 11px; font-weight: 700; letter-spacing: .75px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; line-height: 1.2; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 19px; line-height: 1.3; letter-spacing: 0; }
h3 { margin-bottom: 0; font-size: 15px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.workspace-help-button { min-width: 112px; }
.button, .icon-button, .filter-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; color: var(--ink); background: var(--surface); }
.button { min-height: 38px; padding: 0 14px; font-size: 13px; font-weight: 700; }
.button svg { width: 16px; height: 16px; }
.button.primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { border-color: var(--line-strong); }
.button.text { background: transparent; color: var(--muted); }
.icon-button { position: relative; width: 36px; height: 36px; padding: 0; border-color: var(--line); }
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover, .icon-button.active { color: var(--teal-dark); background: var(--teal-soft); border-color: #c5e7df; }
.sidebar .icon-button { width: 28px; height: 28px; background: transparent; border: 0; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--rose); }

.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 32px 0 40px; }
.stat-block { min-height: 132px; padding: 17px 18px; border: 1px solid var(--line); background: var(--surface); }
.stat-block > div { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.stat-block svg { width: 16px; color: var(--teal); }
.stat-block strong { display: block; margin: 12px 0 6px; font-size: 28px; font-variant-numeric: tabular-nums; }
.stat-block small { color: var(--muted); font-size: 11px; }

.market-section { margin-bottom: 17px; }
.view-actions { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.view-actions .icon-button { width: 31px; height: 31px; }
.filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 18px; padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.search-input { display: flex; align-items: center; flex: 1 1 235px; min-height: 37px; gap: 8px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface-soft); }
.search-input svg { width: 16px; color: var(--faint); }
.search-input input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.select-control { display: flex; align-items: center; gap: 6px; min-height: 37px; padding: 0 8px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.select-control select { min-width: 68px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.filter-toggle { min-height: 37px; padding: 0 10px; border-color: var(--line); color: var(--muted); font-size: 12px; }
.filter-toggle svg { width: 15px; }
.filter-toggle.active { color: var(--teal-dark); border-color: #bde2da; background: var(--teal-soft); }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 23px; align-items: start; }
.strategy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.strategy-card { min-height: 310px; padding: 16px; border: 1px solid var(--line); background: var(--surface); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.strategy-card:hover { border-color: #b8d7cf; box-shadow: 0 8px 22px rgba(23,32,28,.07); transform: translateY(-1px); }
.strategy-card.selected { border: 2px solid var(--teal); padding: 15px; }
.strategy-backtest-scope { display: flex; min-height: 31px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 8px; margin-top: 10px; padding: 7px 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.strategy-backtest-scope span { display: inline-flex; min-width: 0; align-items: center; gap: 5px; }
.strategy-backtest-scope svg { width: 12px; height: 12px; flex: 0 0 auto; color: var(--teal-dark); }
.strategy-backtest-scope b { flex: 0 0 auto; color: var(--ink-soft); font-weight: 600; }
.card-topline { min-height: 25px; }
.status-group { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.live-dot { width: 6px; height: 6px; box-shadow: none; }
.divider { width: 1px; height: 11px; background: var(--line-strong); }
.watch-button { width: 29px; height: 29px; border: 0; background: transparent; }
.watch-button.is-watched, .icon-button.is-watched { color: var(--teal-dark); background: var(--teal-soft); }
.strategy-title { display: flex; align-items: center; width: 100%; gap: 10px; padding: 8px 0 3px; border: 0; color: var(--ink); background: transparent; text-align: left; }
.strategy-title:hover strong { color: var(--teal-dark); }
.strategy-title > span:nth-child(2) { min-width: 0; }
.strategy-title strong, .strategy-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strategy-title strong { font-size: 16px; }
.strategy-title small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.strategy-title > svg { width: 17px; margin-left: auto; color: var(--faint); }
.strategy-avatar, .avatar { display: inline-grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; color: #fff; font-size: 11px; font-weight: 800; }
.strategy-avatar.large { width: 45px; height: 45px; font-size: 13px; }
.avatar { width: 27px; height: 27px; font-size: 11px; }
.avatar-teal { background: var(--teal); }.avatar-orange { background: var(--orange); }.avatar-indigo { background: var(--indigo); }.avatar-rose { background: var(--rose); }.avatar-lime { background: var(--lime); }.avatar-cyan { background: var(--cyan); }
.card-description { display: -webkit-box; min-height: 39px; margin: 12px 0 10px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; min-height: 24px; }
.tag-row span { padding: 3px 7px; color: #51605a; background: #eef2f0; font-size: 10px; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 15px 0 12px; }
.metric-row > div { min-width: 0; }
.metric-row span, .metric-row strong { display: block; }
.metric-row span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.metric-row strong { margin-top: 5px; font-size: 14px; font-variant-numeric: tabular-nums; }
.card-footer { min-height: 34px; gap: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.score-pill { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 10px; }
.score-pill svg { width: 14px; color: var(--teal); }.score-pill b { color: var(--ink); font-size: 12px; }
.strategy-card-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.strategy-backtest-button { display: inline-flex; min-height: 28px; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid #b8d7cf; color: var(--teal-dark); background: var(--teal-soft); font-size: 10px; font-weight: 800; }
.strategy-backtest-button:hover { border-color: var(--teal); background: #d8f0ea; }
.strategy-backtest-button svg { width: 13px; height: 13px; }
.strategy-publication-button { display: inline-flex; min-height: 28px; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 800; }
.strategy-publication-button.published { color: #a33f4c; border-color: #ecc8ce; background: #fff5f6; }
.strategy-publication-button svg { width: 13px; height: 13px; }
.strategy-delete-button { display: inline-flex; min-height: 28px; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid #ecc8ce; color: #a33f4c; background: #fff5f6; font-size: 10px; font-weight: 800; }
.strategy-delete-button:hover { border-color: #d98d98; background: #fae9eb; }
.strategy-delete-button svg { width: 13px; height: 13px; }
.compare-check { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; cursor: pointer; }
.compare-check input { width: 14px; height: 14px; accent-color: var(--teal); }

.ranking-panel { padding: 17px; border: 1px solid var(--line); background: var(--surface); }
.aside-heading h2 { font-size: 16px; }.aside-heading .icon-button { width: 29px; height: 29px; border: 0; }
.ranking-list { margin-top: 14px; }
.ranking-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; width: 100%; align-items: center; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.ranking-row:hover strong { color: var(--teal-dark); }
.rank { display: grid; place-items: center; width: 20px; height: 20px; color: var(--muted); background: #edf1ef; font-size: 10px; font-weight: 800; }
.rank-1 { color: #785c14; background: #f7efcf; }.rank-2 { color: #5f6765; background: #e8eceb; }.rank-3 { color: #805435; background: #f2e1d4; }
.ranking-name { min-width: 0; }.ranking-name strong, .ranking-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-name strong { font-size: 12px; }.ranking-name small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.ranking-score { color: var(--teal-dark); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-note { display: flex; gap: 7px; margin-top: 15px; padding-top: 13px; border-top: 1px dashed var(--line-strong); color: var(--muted); font-size: 10px; line-height: 1.55; }
.score-note svg { flex: 0 0 auto; width: 14px; color: var(--teal); }.score-note p { margin: 0; }
.empty-state { padding: 80px 20px; border: 1px dashed var(--line-strong); background: var(--surface); text-align: center; }.empty-state svg { width: 28px; color: var(--teal); }.empty-state h3 { margin: 10px 0 6px; }.empty-state p { color: var(--muted); font-size: 13px; }

.research-workspace { margin-top: 48px; scroll-margin-top: 22px; }
.research-heading { align-items: end; }
.research-heading .button { min-height: 34px; font-size: 11px; }
.research-heading-actions { display: inline-flex; align-items: center; gap: 8px; }
.research-as-of { color: var(--muted); font-size: 11px; }
.research-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 16px 0 13px; border: 1px solid var(--line); background: var(--surface); }
.research-summary > div { min-width: 0; padding: 15px 17px; border-right: 1px solid var(--line); }
.research-summary > div:last-child { border-right: 0; }
.research-summary span, .research-summary strong, .research-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.research-summary span, .research-summary small { color: var(--muted); font-size: 10px; }
.research-summary strong { margin: 7px 0 5px; color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.research-grid { display: grid; gap: 13px; align-items: start; }
.watchlist-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, .38fr); }
.compare-workspace-grid { grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); margin-top: 13px; }
.research-panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.research-panel-heading { display: flex; min-height: 58px; align-items: end; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.research-panel-heading h3 { margin: 0; color: var(--ink); font-size: 13px; }
.research-panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.research-panel-heading > span { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.research-toolbar { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.research-search { display: flex; flex: 1; min-width: 0; min-height: 34px; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--line-strong); background: var(--surface); }
.research-search svg { width: 14px; color: var(--muted); }
.research-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.research-select select { min-width: 118px; height: 34px; padding: 0 25px 0 9px; border: 1px solid var(--line-strong); outline: 0; color: var(--ink); background: var(--surface); font-size: 10px; }
.research-table-wrap { position: relative; min-width: 0; overflow-x: auto; }
.research-table { width: 100%; border-collapse: collapse; }
.research-table th, .research-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: #4d5a54; font-size: 10px; text-align: left; vertical-align: middle; white-space: nowrap; }
.research-table thead th { color: var(--muted); background: var(--surface-soft); font-size: 9px; font-weight: 700; }
.research-table tbody tr:last-child td { border-bottom: 0; }
.research-table tbody tr:hover { background: #fbfdfc; }
.research-strategy { display: flex; min-width: 190px; align-items: center; gap: 9px; }
.research-strategy > span:last-child { min-width: 0; }
.research-strategy strong, .research-strategy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.research-strategy strong { color: var(--ink); font-size: 10px; }
.research-strategy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.research-strategy-button { padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.research-strategy-button:hover strong { color: var(--teal-dark); }
.research-row-actions { display: inline-flex; gap: 5px; align-items: center; }
.research-row-actions .icon-button { width: 28px; height: 28px; }
.research-row-actions .icon-button svg { width: 13px; height: 13px; }
.research-row-actions .compare-check { min-height: 28px; padding: 0 6px; border: 1px solid var(--line); background: var(--surface); }
.research-empty { min-height: 210px; place-items: center; align-content: center; gap: 7px; padding: 24px; color: var(--muted); text-align: center; }
.research-empty:not(.hidden) { display: grid; }
.research-empty.compact { min-height: 104px; font-size: 10px; }
.research-empty svg { width: 23px; color: var(--teal); }
.research-empty strong { color: var(--ink); font-size: 12px; }
.research-empty p { margin: 0; font-size: 10px; }
.watchlist-activity { max-height: 430px; overflow-y: auto; }
.watchlist-activity-item { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.watchlist-activity-item:last-child { border-bottom: 0; }
.watchlist-activity-item > time { color: var(--faint); font-size: 9px; font-variant-numeric: tabular-nums; }
.watchlist-activity-copy { min-width: 0; }
.watchlist-activity-copy > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.watchlist-activity-copy strong { overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.watchlist-activity-copy b { flex: 0 0 auto; color: var(--teal-dark); font-size: 9px; }
.watchlist-activity-copy p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.paper-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 13px 0; border: 1px solid var(--line); background: var(--surface-soft); }
.paper-summary > div { min-width: 0; padding: 13px 17px; border-right: 1px solid var(--line); }
.paper-summary > div:last-child { border-right: 0; }
.paper-summary span, .paper-summary strong, .paper-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-summary span, .paper-summary small { color: var(--muted); font-size: 9px; }
.paper-summary strong { margin: 6px 0 4px; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.paper-today-panel { margin-bottom: 13px; }
.paper-today-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.paper-today-grid > div { min-width: 0; padding: 13px 15px; border-right: 1px solid var(--line); }
.paper-today-grid > div:last-child { border-right: 0; }
.paper-today-grid span, .paper-today-grid strong, .paper-today-grid small { display: block; }
.paper-today-grid span, .paper-today-grid small { color: var(--muted); font-size: 9px; }
.paper-today-grid strong { margin: 6px 0; font-size: 17px; }
.paper-today-grid small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-quote-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 42px; margin-top: 13px; padding: 8px 12px; border: 1px solid var(--line); background: var(--surface); }
.paper-quote-banner p { min-width: 0; margin: 0; overflow: hidden; color: #52605a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.paper-quote-banner small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.paper-quote-state { display: inline-flex; min-height: 23px; align-items: center; gap: 5px; padding: 0 7px; color: #5c6862; background: #e8ecea; font-size: 9px; font-weight: 800; white-space: nowrap; }
.paper-quote-state svg { width: 13px; height: 13px; }
.paper-quote-state.realtime { color: #166d51; background: #dff1e9; }
.paper-quote-state.mixed, .paper-quote-state.market_closed { color: #84641e; background: #f4e9c1; }
.paper-quote-state.degraded, .paper-quote-state.disconnected { color: var(--negative); background: #fae1e5; }
.paper-quote-state.loading { color: #166d81; background: #dceff3; }
.paper-trading-grid { display: grid; grid-template-columns: minmax(265px, .34fr) minmax(0, 1fr); gap: 13px; margin-bottom: 13px; align-items: start; }
.paper-account-list { max-height: 438px; overflow-y: auto; }
.paper-account-row { display: block; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); color: inherit; background: var(--surface); text-align: left; }
.paper-account-row:last-child { border-bottom: 0; }
.paper-account-row:hover, .paper-account-row.selected { background: var(--surface-soft); }
.paper-account-row.selected { box-shadow: inset 3px 0 0 var(--teal); }
.paper-account-row-main, .paper-account-row-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.paper-account-row-main strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.paper-account-row-main span { flex: 0 0 auto; }
.paper-account-row > small { display: block; margin: 5px 0 8px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.paper-account-row-meta { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.paper-account-row-meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-account-row-meta b { color: var(--ink); font-size: 10px; }
.paper-status { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; color: #5c6862; background: #e8ecea; font-size: 9px; font-weight: 700; white-space: nowrap; }
.paper-status.running { color: #166d81; background: #dceff3; }
.paper-status.paused { color: #84641e; background: #f4e9c1; }
.paper-status.stopped { color: var(--negative); background: #fae1e5; }
.paper-detail-heading { display: flex; min-height: 69px; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.paper-detail-heading h3 { margin: 3px 0 0; font-size: 14px; }
.paper-detail-heading small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.paper-detail-actions { display: inline-flex; align-items: center; gap: 5px; }
.paper-detail-actions .icon-button { width: 29px; height: 29px; }
.paper-detail-actions .icon-button svg { width: 14px; height: 14px; }
.paper-detail-empty { display: grid; min-height: 292px; place-items: center; padding: 30px; color: var(--muted); font-size: 11px; text-align: center; }
.paper-runtime-note { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.paper-runtime-note p { margin: 0; overflow: hidden; color: #52605a; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.paper-runtime-note small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.paper-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.paper-metrics > div { min-width: 0; padding: 12px 14px; border-right: 1px solid var(--line); }
.paper-metrics > div:last-child { border-right: 0; }
.paper-metrics span, .paper-metrics strong, .paper-metrics small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-metrics span, .paper-metrics small { color: var(--muted); font-size: 8px; }
.paper-metrics strong { margin: 5px 0 3px; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.paper-equity-block { padding: 11px 14px 8px; border-bottom: 1px solid var(--line); background: #fcfdfd; }
.paper-equity-heading, .paper-equity-axis { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.paper-equity-heading span, .paper-equity-heading strong { display: inline; font-size: 9px; }
.paper-equity-heading span { color: var(--muted); }
.paper-equity-heading strong { margin-left: 7px; color: var(--ink); }
.paper-equity-heading small, .paper-equity-axis { color: var(--muted); font-size: 8px; }
.paper-equity-chart { display: block; width: 100%; height: 118px; margin-top: 6px; }
.paper-equity-axis { margin-top: 2px; font-variant-numeric: tabular-nums; }
.paper-tabs { display: flex; gap: 18px; min-height: 39px; align-items: end; padding: 0 14px; border-bottom: 1px solid var(--line); }
.paper-tabs button { height: 39px; padding: 0; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 10px; }
.paper-tabs button.active { color: var(--teal-dark); border-bottom-color: var(--teal); font-weight: 700; }
.paper-table-panel { display: none; position: relative; min-height: 156px; overflow-x: auto; }
.paper-table-panel.active { display: block; }
.paper-table { width: 100%; min-width: 650px; border-collapse: collapse; }
.paper-table th, .paper-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: #4d5a54; font-size: 9px; text-align: left; vertical-align: middle; white-space: nowrap; }
.paper-table th { color: var(--muted); background: var(--surface-soft); font-size: 8px; }
.paper-table td strong, .paper-table td small { display: block; }
.paper-table td strong { color: var(--ink); font-size: 9px; }
.paper-table td small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.paper-position-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 11px 14px 9px; border-bottom: 1px solid var(--line); background: #fcfdfd; }
.paper-position-toolbar .eyebrow { margin-bottom: 3px; font-size: 9px; }
.paper-position-toolbar strong, .paper-position-toolbar > span { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.paper-position-table { min-width: 1260px; }
.paper-position-table th, .paper-position-table td { text-align: right; font-variant-numeric: tabular-nums; }
.paper-position-table th:first-child, .paper-position-table td:first-child,
.paper-position-table th:nth-child(2), .paper-position-table td:nth-child(2),
.paper-position-table th:nth-child(3), .paper-position-table td:nth-child(3) { text-align: left; }
.paper-position-table .numeric { text-align: right; }
.paper-position-table tfoot th, .paper-position-table tfoot td { color: var(--ink); background: var(--surface-soft); font-weight: 800; }
.paper-table-empty { display: grid; min-height: 156px; place-items: center; color: var(--muted); font-size: 10px; }
.paper-account-modal { width: min(700px, calc(100vw - 28px)); }
.paper-account-form { padding: 18px; }
.paper-account-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.paper-account-wide { grid-column: 1 / -1; }
.paper-account-disclaimer { display: flex; align-items: flex-start; gap: 8px; margin-top: 13px; padding: 10px 11px; color: #57645e; background: var(--surface-soft); font-size: 9px; line-height: 1.5; }
.paper-account-disclaimer svg { flex: 0 0 auto; width: 14px; color: var(--teal); }
.compare-picker-panel { margin-top: 13px; }
.compare-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compare-picker-option { display: flex; min-width: 0; min-height: 68px; align-items: center; gap: 9px; padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.compare-picker-option:nth-child(3n) { border-right: 0; }
.compare-picker-option:nth-last-child(-n+3) { border-bottom: 0; }
.compare-picker-option:hover { background: var(--surface-soft); }
.compare-picker-option.selected { background: #edf8f5; box-shadow: inset 3px 0 0 var(--teal); }
.compare-picker-option.disabled { cursor: not-allowed; opacity: .5; }
.compare-picker-option input { flex: 0 0 auto; accent-color: var(--teal); }
.compare-picker-option > span:last-child { min-width: 0; }
.compare-picker-option strong, .compare-picker-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-picker-option strong { color: var(--ink); font-size: 10px; }
.compare-picker-option small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.compare-chart-panel { position: relative; }
.strategy-compare-chart { display: block; width: 100%; height: 286px; }
.strategy-compare-chart { padding: 8px 10px 10px; }
.research-chart-empty { position: absolute; inset: 59px 0 0; display: grid; place-items: center; color: var(--muted); background: rgba(255,255,255,.92); font-size: 10px; }
.research-chart-empty.hidden { display: none; }
.compare-chart-legend { display: flex; min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 5px 9px; }
.compare-chart-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8px; }
.compare-chart-legend i { width: 12px; height: 2px; }
.compare-metrics-wrap { min-height: 286px; }
.compare-workspace-table { min-width: 480px; }
.compare-workspace-table th:not(:first-child), .compare-workspace-table td:not(:first-child) { text-align: right; }
.compare-overlap-panel { margin-top: 13px; }
.compare-overlap-panel .research-table { min-width: 650px; }

.compare-bar { position: fixed; z-index: 10; right: 28px; bottom: 20px; left: 274px; min-height: 60px; padding: 10px 14px 10px 17px; border: 1px solid #b8d7cf; background: #fbfffd; box-shadow: var(--shadow); }
.compare-bar > div { display: flex; align-items: center; gap: 9px; }.compare-bar svg { width: 19px; color: var(--teal-dark); }.compare-bar span { font-size: 13px; font-weight: 800; }.compare-bar small { color: var(--muted); font-size: 11px; }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(18, 26, 22, .36); }
.detail-drawer { position: fixed; z-index: 21; top: 0; right: 0; bottom: 0; width: min(680px, 100vw); overflow-y: auto; background: var(--surface); box-shadow: -20px 0 44px rgba(17,28,23,.15); }
.drawer-header { position: sticky; top: 0; z-index: 2; min-height: 62px; padding: 13px 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(9px); }.drawer-header-actions { display: flex; gap: 7px; }
.detail-hero { padding: 25px 26px 20px; }.detail-title-row { justify-content: flex-start; gap: 12px; }.detail-title-row h2 { font-size: 23px; }.detail-title-row > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }.detail-description { margin: 18px 0 11px; color: #55615c; font-size: 13px; line-height: 1.7; }
.detail-action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 15px; }.detail-action-row .button { min-height: 34px; }.detail-action-note { color: var(--muted); font-size: 10px; }
.iquant-source-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 26px 22px; padding: 15px 16px; border: 1px solid #cfd9d4; border-radius: 6px; background: #f7faf8; }
.iquant-source-panel-copy { display: flex; min-width: 0; align-items: center; gap: 11px; }
.iquant-source-panel-copy strong, .iquant-source-panel-copy p { display: block; margin: 0; }
.iquant-source-panel-copy strong { color: var(--ink); font-size: 12px; }
.iquant-source-panel-copy p { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.iquant-source-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; color: #176c5a; border: 1px solid #b7d5cb; border-radius: 6px; background: #e9f5f1; }
.iquant-source-icon svg { width: 17px; height: 17px; }
.iquant-source-panel-actions, .iquant-review-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.iquant-source-panel-actions .button { min-height: 32px; }
.iquant-source-modal { width: min(980px, 100%); }
.iquant-source-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 18px; color: #53615b; border-bottom: 1px solid var(--line); background: var(--surface-soft); font-size: 10px; }
.iquant-source-toolbar > span { display: inline-flex; align-items: center; gap: 7px; line-height: 1.5; }
.iquant-source-toolbar svg { width: 14px; height: 14px; }
.iquant-source-code { height: min(68vh, 700px); margin: 0; padding: 18px 20px; overflow: auto; color: #dbe8e3; background: #17251f; font: 11px/1.65 Consolas, "Courier New", monospace; tab-size: 4; white-space: pre; }
.iquant-review-panel { margin-top: 16px; }
.iquant-review-table { min-width: 980px; }
.iquant-review-reason { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.iquant-review-actions .approve { color: #176c5a; background: #e9f5f1; }
.iquant-review-actions .reject { color: #a33f4c; background: #fff0f1; }
@media (max-width: 640px) {
  .paper-today-grid { grid-template-columns: 1fr; }
  .paper-today-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .paper-today-grid > div:last-child { border-bottom: 0; }
  .iquant-source-panel { align-items: stretch; flex-direction: column; margin-right: 18px; margin-left: 18px; }
  .iquant-source-panel-actions { flex-wrap: wrap; }
  .iquant-source-toolbar { align-items: flex-start; flex-direction: column; }
  .iquant-source-code { height: 62vh; padding: 14px; font-size: 10px; }
}
.detail-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }.detail-metrics > div { padding: 15px 18px; border-right: 1px solid var(--line); }.detail-metrics > div:last-child { border-right: 0; }.detail-metrics span, .detail-metrics strong, .detail-metrics small { display: block; }.detail-metrics span, .detail-metrics small { color: var(--muted); font-size: 10px; }.detail-metrics strong { margin: 6px 0; font-size: 16px; font-variant-numeric: tabular-nums; }
.chart-section { padding: 20px 26px 16px; }.chart-heading h3 { font-size: 15px; }.chart-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }.chart-legend i { width: 16px; height: 2px; background: var(--teal); }.equity-chart { display: block; width: 100%; height: 164px; margin-top: 14px; }.chart-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 10px; }
.detail-tabs { padding: 0 26px 22px; }.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); }.tabs button { padding: 10px 0; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 12px; }.tabs button.active { border-color: var(--teal); color: var(--teal-dark); font-weight: 800; }.tab-panel { display: none; }.tab-panel.active { display: block; }
.holdings-table, .compare-table { width: 100%; border-collapse: collapse; }.holdings-table th { padding: 12px 0 8px; color: var(--muted); font-size: 10px; font-weight: 500; text-align: right; }.holdings-table th:first-child, .holdings-table td:first-child { text-align: left; }.holdings-table td { padding: 10px 0; border-top: 1px solid var(--line); color: #4d5a54; font-size: 12px; text-align: right; }.holdings-table td strong, .holdings-table td small { display: block; }.holdings-table td small { margin-top: 3px; color: var(--muted); font-size: 10px; }.holding-change { color: var(--muted); font-size: 11px; }.holding-change.new { color: var(--positive); }
.strategy-holdings-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 11px 0 9px; border-bottom: 1px solid var(--line); }.strategy-holdings-toolbar .eyebrow { margin-bottom: 3px; font-size: 9px; }.strategy-holdings-toolbar strong, .strategy-holdings-toolbar > span { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }.strategy-holdings-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }.strategy-holdings-actions .button { min-height: 30px; padding: 0 9px; font-size: 10px; }.strategy-holdings-actions svg { width: 13px; height: 13px; }.strategy-holdings-table-wrap { overflow-x: auto; }.strategy-holdings-table { min-width: 1260px; }.strategy-holdings-table th, .strategy-holdings-table td { padding: 9px 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }.strategy-holdings-table th:not(:first-child), .strategy-holdings-table td:not(:first-child) { text-align: right; }.strategy-holdings-table th:first-child, .strategy-holdings-table td:first-child, .strategy-holdings-table th:nth-child(2), .strategy-holdings-table td:nth-child(2), .strategy-holdings-table th:nth-child(3), .strategy-holdings-table td:nth-child(3) { text-align: left; }.strategy-holdings-table tfoot th, .strategy-holdings-table tfoot td { color: var(--ink); background: var(--surface-soft); font-weight: 800; }
.backtest-holdings-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }.backtest-holdings-summary > div { min-width: 0; padding: 12px 10px 10px 0; border-right: 1px solid var(--line); }.backtest-holdings-summary > div:not(:first-child) { padding-left: 10px; }.backtest-holdings-summary > div:last-child { border-right: 0; }.backtest-holdings-summary span, .backtest-holdings-summary strong { display: block; }.backtest-holdings-summary span { color: var(--muted); font-size: 9px; }.backtest-holdings-summary strong { margin-top: 5px; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.backtest-holdings-table { min-width: 1380px; }.backtest-holdings-table th:first-child, .backtest-holdings-table td:first-child, .backtest-holdings-table th:nth-child(2), .backtest-holdings-table td:nth-child(2), .backtest-holdings-table th:nth-child(3), .backtest-holdings-table td:nth-child(3), .backtest-holdings-table th:nth-child(4), .backtest-holdings-table td:nth-child(4), .backtest-holdings-table th:nth-child(9), .backtest-holdings-table td:nth-child(9), .backtest-holdings-table th:last-child, .backtest-holdings-table td:last-child { text-align: left; }.backtest-holdings-table th:last-child, .backtest-holdings-table td:last-child { min-width: 250px; white-space: normal; line-height: 1.45; }.backtest-record-action { font-weight: 800; }.backtest-record-state { color: var(--muted); font-size: 11px; }
.backtest-holdings-table tr.is-collapsed { display: none; }
.button.danger { color: #a33f4c; border-color: #ecc8ce; background: #fff5f6; }
.button.danger:hover { border-color: #d98d98; background: #fae9eb; }

@media (max-width: 640px) {
  .strategy-holdings-toolbar { align-items: stretch; flex-direction: column; }
  .strategy-holdings-actions { width: 100%; justify-content: flex-end; }
}
.rebalance-list { padding: 5px 0 0; margin: 0; list-style: none; }.rebalance-list li { display: grid; grid-template-columns: 75px 40px 1fr; gap: 8px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 11px; }.rebalance-list li > span { color: var(--muted); }.rebalance-list li > strong { color: var(--teal-dark); }.rebalance-list b, .rebalance-list small { display: block; }.rebalance-list small { margin-top: 4px; color: var(--muted); line-height: 1.4; }.rebalance-list .empty-list-item { display: block; color: var(--muted); }.empty-cell { color: var(--muted) !important; text-align: center !important; }.method-copy { padding: 16px 0 2px; color: #56625d; font-size: 12px; line-height: 1.8; }.method-copy p { margin-bottom: 9px; }.method-copy code { padding: 2px 4px; color: var(--teal-dark); background: var(--teal-soft); font-size: 11px; }
.strategy-rule-notice { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 12px; padding: 12px 14px; border: 1px solid #b9d7d0; background: #f2faf7; }
.strategy-rule-notice > svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--teal-dark); }
.strategy-rule-notice strong, .strategy-rule-notice p { display: block; margin: 0; }.strategy-rule-notice strong { color: var(--ink); font-size: 12px; }.strategy-rule-notice p { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.strategy-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 4px; }
.strategy-rule-card { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.strategy-rule-card-title { display: flex; align-items: center; gap: 7px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }.strategy-rule-card-title svg { width: 15px; height: 15px; color: var(--teal); }.strategy-rule-card-title h4 { flex: 1; margin: 0; color: var(--ink); font-size: 12px; }.strategy-rule-card-title span { color: var(--muted); font-size: 9px; }
.strategy-rule-card ol { padding-left: 19px; margin: 10px 0 0; color: #48544f; font-size: 11px; line-height: 1.7; }
.strategy-rule-card li + li { margin-top: 6px; }.strategy-rule-card li::marker { color: var(--teal); font-weight: 800; }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 26px 30px; }.trust-grid > div { padding: 12px; background: var(--surface-soft); }.trust-grid span, .trust-grid strong { display: block; }.trust-grid span { color: var(--muted); font-size: 10px; }.trust-grid strong { margin: 4px 0 9px; font-size: 15px; }.progress { height: 4px; background: #e2e9e5; }.progress i { display: block; height: 4px; background: var(--teal); }

.modal-backdrop { display: grid; place-items: center; padding: 20px; }.modal { width: min(760px, 100%); max-height: min(680px, 92vh); overflow: auto; background: var(--surface); box-shadow: var(--shadow); }.modal-header { padding: 19px 22px; border-bottom: 1px solid var(--line); }.compare-table-wrap { padding: 8px 22px 22px; overflow-x: auto; }.compare-table { min-width: 600px; }.compare-table th, .compare-table td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; }.compare-table thead th { color: var(--muted); font-size: 11px; font-weight: 700; }.compare-table thead th:not(:first-child) { min-width: 155px; color: var(--ink); }.compare-table thead .strategy-avatar { width: 25px; height: 25px; margin-right: 7px; font-size: 9px; vertical-align: middle; }.compare-table tbody th { color: var(--muted); font-size: 11px; font-weight: 500; }.compare-table td { font-variant-numeric: tabular-nums; font-weight: 700; }
.workspace-help-modal { width: min(720px, 100%); }
.workspace-help-content { padding: 0 22px; }
.workspace-help-intro { display: flex; align-items: flex-start; gap: 13px; padding: 20px 0 18px; border-bottom: 1px solid var(--line); }
.workspace-help-icon { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; color: var(--teal-dark); background: var(--teal-soft); }
.workspace-help-icon svg { width: 19px; height: 19px; }
.workspace-help-intro strong { display: block; font-size: 14px; }
.workspace-help-intro p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.workspace-help-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.workspace-help-section-title { display: flex; align-items: center; gap: 8px; }
.workspace-help-section-title svg { width: 16px; height: 16px; color: var(--teal); }
.workspace-help-section-title h3 { font-size: 13px; }
.workspace-help-feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; padding: 0; margin: 14px 0 0; list-style: none; }
.workspace-help-feature-list li { position: relative; padding-left: 14px; color: #4f5c56; font-size: 11px; line-height: 1.55; }
.workspace-help-feature-list li::before { position: absolute; top: 7px; left: 0; width: 5px; height: 5px; background: var(--teal); content: ""; }
.workspace-help-step-list { display: grid; gap: 10px; padding: 0; margin: 14px 0 0; list-style: none; counter-reset: workspace-help-step; }
.workspace-help-step-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 9px; align-items: start; color: #4f5c56; font-size: 11px; line-height: 1.6; counter-increment: workspace-help-step; }
.workspace-help-step-list li::before { display: grid; place-items: center; width: 22px; height: 22px; color: var(--teal-dark); background: var(--teal-soft); font-size: 10px; font-weight: 800; content: counter(workspace-help-step); }
.workspace-help-note { margin: 18px 0 20px; padding: 13px 14px; border-left: 3px solid var(--teal); background: var(--surface-soft); }
.workspace-help-note > div { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 11px; }
.workspace-help-note > div svg { width: 15px; height: 15px; color: var(--orange); }
.workspace-help-note ul { display: grid; gap: 5px; padding-left: 17px; margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.workspace-help-actions { display: flex; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.sync-job-modal { width: min(590px, 100%); }
.sync-job-form { padding: 19px 22px 22px; }
.sync-job-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.sync-job-field { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 11px; }
.sync-job-field textarea, .sync-job-field input, .sync-job-field select { width: 100%; min-height: 35px; border: 1px solid var(--line-strong); outline: 0; color: var(--ink); background: var(--surface-soft); font: inherit; font-size: 12px; }
.sync-job-field textarea { min-height: 76px; padding: 9px 10px; resize: vertical; line-height: 1.45; }
.sync-job-field input, .sync-job-field select { padding: 0 9px; }
.sync-job-field textarea:focus, .sync-job-field input:focus, .sync-job-field select:focus { border-color: #8ecfc1; box-shadow: 0 0 0 3px rgba(14,139,130,.12); }
.sync-job-field small { color: var(--faint); font-size: 10px; line-height: 1.45; }
.sync-job-error { margin: 13px 0 0; padding: 8px 10px; color: #9a3940; background: #fae9eb; font-size: 11px; line-height: 1.5; }
.sync-job-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.data-section { margin-top: 48px; scroll-margin-top: 22px; }
.data-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 17px; padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.instrument-picker, .indicator-picker { position: relative; }
.instrument-trigger, .indicator-trigger { display: inline-flex; align-items: center; gap: 9px; min-height: 36px; border: 1px solid var(--line); color: var(--ink); background: var(--surface-soft); font: inherit; text-align: left; }
.instrument-trigger { min-width: 246px; padding: 5px 9px 5px 11px; justify-content: space-between; }.instrument-trigger svg, .indicator-trigger svg { width: 15px; height: 15px; color: var(--muted); }
.instrument-trigger-copy { min-width: 0; }.instrument-trigger-copy small, .instrument-trigger-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.instrument-trigger-copy small { color: var(--muted); font-size: 9px; }.instrument-trigger-copy strong { margin-top: 1px; font-size: 12px; font-weight: 700; }
.indicator-trigger { padding: 0 10px; font-size: 12px; }.indicator-trigger svg:last-child { margin-left: 2px; }
.instrument-popover, .indicator-popover { position: absolute; z-index: 12; top: calc(100% + 7px); left: 0; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); }
.instrument-popover { width: min(440px, calc(100vw - 48px)); }.indicator-popover { right: 0; left: auto; width: 196px; max-height: 310px; padding: 7px; overflow-y: auto; }
.instrument-popover-header { display: flex; gap: 7px; padding: 9px; border-bottom: 1px solid var(--line); }.instrument-popover-header .icon-button { width: 31px; height: 31px; flex: 0 0 auto; }
.instrument-search { display: flex; flex: 1; align-items: center; gap: 7px; min-width: 0; padding: 0 9px; border: 1px solid var(--line); background: var(--surface-soft); }.instrument-search svg { width: 14px; color: var(--muted); }.instrument-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font: inherit; font-size: 12px; }
.instrument-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 9px; border-bottom: 1px solid var(--line); }.instrument-category-tabs { display: flex; gap: 3px; }.instrument-category-tabs button { padding: 5px 7px; border: 0; color: var(--muted); background: transparent; font-size: 11px; }.instrument-category-tabs button.active { color: var(--teal-dark); background: var(--teal-soft); font-weight: 800; }.instrument-filter-row select { min-width: 88px; height: 28px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); font: inherit; font-size: 11px; }
.instrument-list-meta { display: flex; justify-content: space-between; padding: 8px 11px; color: var(--muted); font-size: 10px; }.instrument-list { max-height: 278px; overflow-y: auto; }.instrument-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 11px; border: 0; border-top: 1px solid var(--line); color: var(--ink); background: var(--surface); text-align: left; }.instrument-option:hover, .instrument-option.selected { background: var(--teal-soft); }.instrument-option-main { min-width: 0; }.instrument-option-main strong, .instrument-option-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.instrument-option-main strong { font-size: 12px; }.instrument-option-main small { margin-top: 3px; color: var(--muted); font-size: 10px; }.instrument-option-meta { flex: 0 0 auto; color: var(--muted); font-size: 10px; }.instrument-list-empty { padding: 24px 12px; color: var(--muted); text-align: center; font-size: 12px; }
.indicator-option { display: flex; align-items: center; gap: 8px; padding: 8px; color: #4c5a54; font-size: 11px; }.indicator-option:hover { background: var(--surface-soft); }.indicator-option input { accent-color: var(--teal); }
.data-source-note { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); font-size: 12px; }
.data-source-note .status-dot { width: 6px; height: 6px; box-shadow: none; }
.futures-data-note { display: flex; align-items: flex-start; gap: 9px; margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid #c8962e; color: #5d5647; background: #fff8e8; font-size: 11px; line-height: 1.55; }
.futures-data-note svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; color: #b57a16; }
.futures-data-note strong, .futures-data-note span { display: block; }
.futures-data-note strong { margin-bottom: 2px; color: #4f4736; font-size: 11px; }
.data-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 13px 0; border: 1px solid var(--line); background: var(--surface); }
.data-summary > div { min-width: 0; padding: 15px 17px; border-right: 1px solid var(--line); }
.data-summary > div:last-child { border-right: 0; }
.data-summary span, .data-summary strong, .data-summary small { display: block; }
.data-summary span, .data-summary small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.data-summary strong { margin: 7px 0 5px; overflow: hidden; font-size: 15px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.data-management-panel { margin: 13px 0; border: 1px solid var(--line); background: var(--surface); }
.data-management-heading, .data-subheading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.data-quality-panel { margin: 13px 0; border: 1px solid var(--line); background: var(--surface); }
.data-quality-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 14px 17px 12px; border-bottom: 1px solid var(--line); }
.data-quality-heading h3 { margin: 3px 0 0; font-size: 14px; }
.data-quality-state { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; color: var(--muted); background: #edf1ef; font-size: 10px; font-weight: 700; }
.data-quality-state.healthy { color: var(--positive); background: #e6f5ee; }
.data-quality-state.warning { color: #84641e; background: #f7efcf; }
.data-quality-state.error, .data-quality-state.empty { color: var(--negative); background: #fae9eb; }
.data-quality-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.data-quality-summary > div { min-width: 0; padding: 12px 17px; border-right: 1px solid var(--line); }
.data-quality-summary > div:last-child { border-right: 0; }
.data-quality-summary span, .data-quality-summary strong, .data-quality-summary small { display: block; }
.data-quality-summary span, .data-quality-summary small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.data-quality-summary strong { margin: 5px 0 3px; font-size: 14px; font-variant-numeric: tabular-nums; }
.data-quality-message { padding: 10px 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.5; }
.data-quality-issues { display: grid; gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.data-quality-issue { display: flex; justify-content: space-between; gap: 12px; padding: 8px 17px; color: #5b625e; background: var(--surface-soft); font-size: 10px; }
.data-quality-issue span { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-management-heading { padding: 17px 18px 14px; border-bottom: 1px solid var(--line); }
.data-management-heading h3 { margin: 3px 0 0; font-size: 16px; }
.data-management-actions { display: flex; align-items: center; gap: 10px; }
.data-management-source, .data-subheading > span { color: var(--muted); font-size: 11px; }
.sync-job-create-button { min-height: 32px; padding: 0 10px; font-size: 11px; }
.sync-job-create-button svg { width: 14px; height: 14px; }
.data-coverage-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.data-coverage-summary > div { min-width: 0; padding: 14px 17px; border-right: 1px solid var(--line); }
.data-coverage-summary > div:last-child { border-right: 0; }
.data-coverage-summary span, .data-coverage-summary strong, .data-coverage-summary small { display: block; }
.data-coverage-summary span, .data-coverage-summary small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.data-coverage-summary strong { margin: 6px 0 4px; overflow: hidden; font-size: 15px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.data-backfill-progress { padding: 15px 17px 0; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.backfill-progress-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.backfill-title-row { display: flex; align-items: center; gap: 8px; }
.backfill-title-row h4 { margin: 0; font-size: 12px; }
.backfill-state { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; color: #5c6862; background: #e7ece9; font-size: 10px; font-weight: 700; white-space: nowrap; }
.backfill-state.running { color: #166d81; background: #dceff3; }
.backfill-state.completed { color: var(--positive); background: #dff2e9; }
.backfill-state.failed { color: var(--negative); background: #fae1e5; }
.backfill-state.paused { color: #84641e; background: #f4e9c1; }
.backfill-progress-heading p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.backfill-progress-value { flex: 0 0 auto; text-align: right; }
.backfill-progress-value strong, .backfill-progress-value small { display: block; font-variant-numeric: tabular-nums; }
.backfill-progress-value strong { color: var(--ink); font-size: 18px; }
.backfill-progress-value small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.backfill-progress-track { height: 7px; margin-top: 12px; overflow: hidden; background: #dfe7e3; }
.backfill-progress-track span { display: block; width: 0; height: 100%; background: var(--teal); transition: width .25s ease; }
.backfill-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; border-top: 1px solid var(--line); }
.backfill-metrics > div { min-width: 0; padding: 10px 12px 11px; border-right: 1px solid var(--line); }
.backfill-metrics > div:first-child { padding-left: 0; }
.backfill-metrics > div:last-child { padding-right: 0; border-right: 0; }
.backfill-metrics span, .backfill-metrics strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backfill-metrics span { color: var(--muted); font-size: 9px; }
.backfill-metrics strong { margin-top: 4px; color: #46534d; font-size: 11px; font-variant-numeric: tabular-nums; }
.data-management-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, .42fr); }
.coverage-table-section { min-width: 0; }
.data-subheading { min-height: 52px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.data-subheading h4 { margin: 0; font-size: 12px; }
.coverage-table-wrap { position: relative; min-height: 190px; overflow-x: auto; }
.coverage-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.coverage-table th, .coverage-table td { padding: 10px 17px; border-bottom: 1px solid var(--line); color: #4d5a54; font-size: 11px; font-variant-numeric: tabular-nums; text-align: left; white-space: nowrap; }
.coverage-table td strong { color: var(--ink); font-size: 11px; }
.coverage-table thead th { color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 700; }
.coverage-table tbody tr:last-child td { border-bottom: 0; }
.coverage-state, .sync-job-state { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; color: #5c6862; background: #edf1ef; font-size: 10px; font-weight: 700; white-space: nowrap; }
.coverage-state.available, .sync-job-state.succeeded { color: var(--positive); background: #e6f5ee; }
.coverage-state.empty, .sync-job-state.failed { color: var(--negative); background: #fae9eb; }
.sync-job-state.queued { color: #84641e; background: #f7efcf; }
.sync-job-state.running { color: #166d81; background: #e2f2f5; }
.data-management-empty { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); background: rgba(249,251,250,.94); font-size: 12px; }
.data-management-empty svg { width: 23px; color: var(--teal); }
.data-management-empty p { margin: 0; }
.sync-job-panel { min-width: 0; border-left: 1px solid var(--line); }
.sync-job-list { min-height: 190px; }
.sync-job-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 47px; padding: 9px 15px 9px 17px; border-bottom: 1px solid var(--line); }
.sync-job-row:last-child { border-bottom: 0; }
.sync-job-copy { min-width: 0; }
.sync-job-copy strong, .sync-job-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-job-copy strong { color: var(--ink); font-size: 11px; }
.sync-job-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.sync-job-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.sync-job-retry { width: 25px; height: 25px; }
.sync-job-retry svg { width: 13px; height: 13px; }
.sync-job-empty { display: grid; min-height: 190px; place-items: center; padding: 24px 17px; color: var(--muted); font-size: 12px; text-align: center; }
.data-chart-panel { position: relative; min-height: 330px; padding: 18px; border: 1px solid var(--line); background: var(--surface); }
.market-chart-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 12px; }
.chart-window-indicator { min-width: 76px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.chart-action-group { display: inline-flex; gap: 5px; }.chart-action-group .icon-button { width: 29px; height: 29px; }.chart-action-group .icon-button svg { width: 15px; height: 15px; }
.market-data-chart { display: block; width: 100%; height: 282px; margin-top: 13px; cursor: crosshair; touch-action: none; }
.market-data-chart.is-panning { cursor: grabbing; }
.chart-legend .down { background: var(--teal); }
.data-empty { position: absolute; inset: 74px 18px 18px; display: grid; place-items: center; align-content: center; gap: 9px; color: var(--muted); border: 1px dashed var(--line-strong); background: rgba(249,251,250,.9); font-size: 12px; }
.data-empty svg { width: 25px; color: var(--teal); }.data-empty p { margin: 0; }
.market-data-tooltip { position: absolute; z-index: 2; width: 180px; padding: 10px 11px; border: 1px solid #bbd8d1; color: #dce9e4; background: rgba(30, 47, 40, .96); box-shadow: 0 8px 22px rgba(29, 48, 40, .18); font-size: 11px; pointer-events: none; }
.market-data-tooltip-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(220, 233, 228, .18); }.market-data-tooltip-title strong { font-size: 11px; font-variant-numeric: tabular-nums; }.market-data-tooltip-title span { color: #9fc8bb; font-size: 10px; text-transform: uppercase; }
.market-data-tooltip dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 9px; padding: 8px 0 0; margin: 0; }.market-data-tooltip dl div { display: flex; justify-content: space-between; gap: 4px; }.market-data-tooltip dt { color: #9cada5; }.market-data-tooltip dd { margin: 0; color: #ffffff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-financials { margin-top: 13px; border: 1px solid var(--line); background: var(--surface); }
.data-financials-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 17px 18px 14px; border-bottom: 1px solid var(--line); }
.data-financials-heading h3 { margin: 3px 0 0; font-size: 16px; }.data-financials-heading > span { color: var(--muted); font-size: 11px; }
.financial-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.financial-summary > div { min-width: 0; padding: 14px 17px; border-right: 1px solid var(--line); }.financial-summary > div:last-child { border-right: 0; }
.financial-summary span, .financial-summary strong, .financial-summary small { display: block; }.financial-summary span, .financial-summary small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.financial-summary strong { margin: 6px 0 4px; overflow: hidden; font-size: 15px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.financial-table-wrap { position: relative; min-height: 104px; overflow-x: auto; }.financial-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.financial-table th, .financial-table td { padding: 11px 17px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.financial-table thead th { color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 700; }.financial-table tbody tr:last-child td { border-bottom: 0; }
.financial-empty { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); background: rgba(249,251,250,.94); font-size: 12px; }.financial-empty svg { width: 23px; color: var(--teal); }.financial-empty p { margin: 0; }

.workflow-section { margin-top: 48px; scroll-margin-top: 22px; }
.workflow-heading { align-items: end; }
.workflow-heading .button { min-height: 34px; padding: 0 11px; font-size: 11px; }
.workflow-heading .button svg { width: 14px; height: 14px; }
.workflow-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 17px 0 13px; border: 1px solid var(--line); background: var(--surface); }
.workflow-summary > div { min-width: 0; padding: 15px 17px; border-right: 1px solid var(--line); }
.workflow-summary > div:last-child { border-right: 0; }
.workflow-summary span, .workflow-summary strong, .workflow-summary small { display: block; }
.workflow-summary span, .workflow-summary small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-summary strong { margin: 7px 0 5px; font-size: 17px; font-variant-numeric: tabular-nums; }
.workflow-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .55fr); gap: 13px; align-items: start; }
.workflow-panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.workflow-panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; min-height: 64px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.workflow-panel-heading h3 { margin: 0; font-size: 14px; }
.workflow-panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.workflow-panel-heading > span { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.workflow-panel-heading .icon-button { width: 30px; height: 30px; }
.workflow-table-wrap { position: relative; min-height: 190px; overflow-x: auto; }
.workflow-table { width: 100%; min-width: 850px; border-collapse: collapse; }
.workflow-table th, .workflow-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: #4d5a54; font-size: 10px; text-align: left; vertical-align: middle; white-space: nowrap; }
.workflow-table thead th { color: var(--muted); background: var(--surface-soft); font-size: 9px; font-weight: 700; }
.workflow-table tbody tr:last-child td { border-bottom: 0; }
.workflow-table tbody tr.selected td { background: #f3faf8; }
.workflow-table td strong, .workflow-table td small { display: block; }
.workflow-table td strong { color: var(--ink); font-size: 10px; }
.workflow-table td small { max-width: 185px; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; }
.workflow-strategy-link { min-width: 150px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.workflow-strategy-link:hover strong { color: var(--teal-dark); }
.workflow-row-actions { display: inline-flex; gap: 5px; }
.workflow-row-actions .icon-button, .review-queue-table .icon-button { width: 28px; height: 28px; }
.workflow-row-actions .icon-button svg, .review-queue-table .icon-button svg { width: 14px; height: 14px; }
.workflow-muted { color: var(--faint); }
.workflow-status { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; font-size: 9px; font-weight: 700; }
.workflow-status.draft { color: #166d81; background: #e2f2f5; }
.workflow-status.submitted, .workflow-status.pending { color: #84641e; background: #f7efcf; }
.workflow-status.approved { color: #516d28; background: #edf5df; }
.workflow-status.published { color: var(--positive); background: #e6f5ee; }
.workflow-status.rejected, .workflow-status.auto_rejected { color: var(--negative); background: #fae9eb; }
.workflow-status.suspended, .workflow-status.superseded { color: #656f6a; background: #e9edeb; }
.workflow-empty { min-height: 190px; place-items: center; align-content: center; gap: 8px; padding: 24px; color: var(--muted); font-size: 12px; text-align: center; }
.workflow-empty:not(.hidden) { display: grid; }
.workflow-empty svg { width: 22px; color: var(--teal); }
.workflow-empty p { margin: 0; }
.version-timeline { max-height: 520px; overflow-y: auto; }
.version-timeline-item { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.version-timeline-item:last-child { border-bottom: 0; }
.version-timeline-item::before { position: absolute; top: 24px; bottom: -15px; left: 21px; width: 1px; content: ""; background: var(--line-strong); }
.version-timeline-item:last-child::before { display: none; }
.version-timeline-marker { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 5px; border: 2px solid var(--surface); border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1px #9dcfc4; }
.version-timeline-copy { min-width: 0; }
.version-timeline-copy > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.version-timeline-copy > div:first-child > strong { color: var(--ink); font-size: 11px; }
.version-timeline-copy p { margin: 8px 0 10px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.version-timeline-copy dl { display: grid; gap: 6px; margin: 0; }
.version-timeline-copy dl div { display: flex; justify-content: space-between; gap: 10px; min-width: 0; font-size: 9px; }
.version-timeline-copy dt { flex: 0 0 auto; color: var(--faint); }
.version-timeline-copy dd { min-width: 0; margin: 0; overflow: hidden; color: #52605a; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.review-heading-actions { display: flex; align-items: center; gap: 7px; }
.review-heading-actions .icon-button { width: 34px; height: 34px; }
.review-check-count { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; font-size: 9px; font-weight: 700; }
.review-check-count.passed { color: var(--positive); background: #e6f5ee; }
.review-check-count.failed { color: var(--negative); background: #fae9eb; }
.strategy-editor-modal { width: min(820px, 100%); }
.strategy-editor-form { padding: 19px 22px 22px; }
.strategy-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.strategy-editor-wide { grid-column: 1 / -1; }
.create-user-field textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line-strong); outline: 0; color: var(--ink); background: var(--surface-soft); font: inherit; font-size: 12px; line-height: 1.55; resize: vertical; }
.create-user-field textarea:focus { border-color: #8ecfc1; box-shadow: 0 0 0 3px rgba(14,139,130,.12); }
.dsl-editor { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.dsl-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dsl-editor-heading h3 { margin: 0; color: var(--ink); font-size: 12px; }
.dsl-editor-heading span { color: var(--muted); font-size: 9px; font-family: Consolas, monospace; }
.backtest-modal { width: min(1080px, 100%); max-height: min(820px, 94vh); }
.backtest-form, .backtest-result { padding: 18px 22px 22px; }
.backtest-rule-toggle { display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 8px 10px; border: 1px solid var(--line-strong); background: var(--surface-soft); cursor: pointer; }
.backtest-rule-toggle input { accent-color: var(--teal); }
.backtest-rule-toggle span, .backtest-rule-toggle strong, .backtest-rule-toggle small { display: block; }
.backtest-rule-toggle strong { color: var(--ink); font-size: 11px; }
.backtest-rule-toggle small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.backtest-identity { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface-soft); }
.backtest-identity > span:nth-child(2) { min-width: 0; }
.backtest-identity strong, .backtest-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backtest-identity strong { color: var(--ink); font-size: 12px; }
.backtest-identity small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.backtest-engine-badge { flex: 0 0 auto; min-height: 24px; padding: 5px 8px; margin-left: auto; color: var(--teal-dark); background: var(--teal-soft); font-size: 9px; font-weight: 700; }
.backtest-config-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); margin-top: 14px; border: 1px solid var(--line); }
.backtest-config-section, .backtest-code-section { min-width: 0; padding: 15px; }
.backtest-code-section { border-left: 1px solid var(--line); background: #17251f; }
.backtest-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.backtest-section-heading h3 { margin: 0; color: var(--ink); font-size: 12px; }
.backtest-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.backtest-section-heading > span { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.backtest-code-section .backtest-section-heading h3 { color: #f0f6f3; }
.backtest-code-section .backtest-section-heading p, .backtest-code-section .backtest-section-heading > span { color: #93aca2; }
.backtest-code-section pre { height: 236px; margin: 0; overflow: auto; color: #d8e7e1; font: 10px/1.62 Consolas, "Courier New", monospace; white-space: pre; }
.backtest-code-toolbar { display: flex; align-items: center; gap: 7px; margin: -2px 0 10px; }
.backtest-code-button { display: inline-flex; min-height: 30px; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid #3b5148; color: #cfe1da; background: #20342b; font-size: 9px; font-weight: 700; cursor: pointer; }
.backtest-code-button:hover { border-color: #6a9282; color: #fff; background: #294238; }
.backtest-code-button svg { width: 13px; height: 13px; }
.backtest-custom-code { display: block; width: 100%; height: 236px; padding: 0; border: 0; outline: 0; color: #d8e7e1; background: transparent; font: 10px/1.62 Consolas, "Courier New", monospace; resize: vertical; tab-size: 4; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.backtest-custom-code:focus { box-shadow: inset 2px 0 0 #57b7a4; }
.backtest-code-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 9px; border-top: 1px solid #31463d; color: #8fa99f; font-size: 8px; }
.backtest-code-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backtest-code-meta strong { flex: 0 0 auto; color: #b8cdc5; font-variant-numeric: tabular-nums; }
.backtest-code-meta strong.invalid { color: #ff9da6; }
.backtest-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.backtest-ma-parameters { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.backtest-classic-parameters { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; padding-top: 11px; border-top: 1px solid var(--line); }
.backtest-dsl-summary { display: grid; grid-column: 1 / -1; gap: 7px; padding-top: 11px; border-top: 1px solid var(--line); }
.backtest-dsl-summary > div { display: flex; justify-content: space-between; gap: 12px; min-width: 0; font-size: 9px; }
.backtest-dsl-summary span { flex: 0 0 auto; color: var(--muted); }
.backtest-dsl-summary strong { min-width: 0; overflow: hidden; color: var(--ink); font-weight: 600; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.backtest-symbol-section { margin-top: 14px; padding: 15px; border: 1px solid var(--line); }
.backtest-scope-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 13px; border: 1px solid var(--line-strong); }
.backtest-scope-switch label { position: relative; min-width: 0; cursor: pointer; }
.backtest-scope-switch label + label { border-left: 1px solid var(--line-strong); }
.backtest-scope-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.backtest-scope-switch label > span { display: grid; grid-template-columns: 24px minmax(0, 1fr); min-height: 54px; align-content: center; gap: 2px 8px; padding: 8px 11px; color: var(--muted); background: var(--surface); }
.backtest-scope-switch label > span > svg { grid-row: 1 / 3; align-self: center; width: 17px; height: 17px; }
.backtest-scope-switch strong, .backtest-scope-switch small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backtest-scope-switch strong { color: var(--ink); font-size: 10px; }
.backtest-scope-switch small { font-size: 8px; }
.backtest-scope-switch input:checked + span { color: var(--teal-dark); background: var(--teal-soft); box-shadow: inset 0 -2px 0 var(--teal); }
.backtest-scope-switch input:focus-visible + span { outline: 2px solid #8ecfc1; outline-offset: -2px; }
.backtest-selected-symbols { display: flex; min-height: 30px; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.backtest-symbol-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 5px 0 8px; color: var(--teal-dark); background: var(--teal-soft); font-size: 9px; font-weight: 700; }
.backtest-symbol-chip button { display: inline-grid; width: 20px; height: 20px; place-items: center; padding: 0; border: 0; color: var(--teal-dark); background: transparent; }
.backtest-symbol-chip button svg { width: 12px; height: 12px; }
.backtest-selected-empty { color: var(--faint); font-size: 10px; }
.backtest-instrument-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 130px 120px; gap: 7px; }
.backtest-instrument-toolbar .instrument-search { min-height: 34px; border: 1px solid var(--line-strong); }
.backtest-instrument-toolbar select { min-width: 0; min-height: 34px; padding: 0 25px 0 9px; border: 1px solid var(--line-strong); outline: 0; color: var(--ink); background: var(--surface); font-size: 10px; }
.backtest-instrument-meta { margin: 9px 0 6px; color: var(--faint); font-size: 9px; }
.backtest-instrument-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 174px; overflow-y: auto; border: 1px solid var(--line); }
.backtest-instrument-option { display: flex; min-width: 0; align-items: center; gap: 8px; min-height: 48px; padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.backtest-instrument-option:nth-child(3n) { border-right: 0; }
.backtest-instrument-option:hover { background: var(--surface-soft); }
.backtest-instrument-option input { flex: 0 0 auto; accent-color: var(--teal); }
.backtest-instrument-option span { min-width: 0; }
.backtest-instrument-option strong, .backtest-instrument-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backtest-instrument-option strong { color: var(--ink); font-size: 10px; }
.backtest-instrument-option small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.backtest-instrument-empty { min-height: 74px; place-items: center; padding: 18px; color: var(--muted); font-size: 10px; text-align: center; }
.backtest-instrument-empty:not(.hidden) { display: grid; }
.backtest-stock-pool-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .72fr); gap: 11px; }
.backtest-stock-pool-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 11px; border: 1px solid var(--line); }
.backtest-stock-pool-summary > div { min-width: 0; padding: 10px 11px; border-right: 1px solid var(--line); }
.backtest-stock-pool-summary > div:last-child { border-right: 0; }
.backtest-stock-pool-summary span, .backtest-stock-pool-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backtest-stock-pool-summary span { color: var(--muted); font-size: 8px; }
.backtest-stock-pool-summary strong { margin-top: 5px; color: var(--ink); font-size: 10px; }
.backtest-stock-pool-members { display: flex; min-height: 38px; flex-wrap: wrap; align-items: center; gap: 5px; padding: 9px 10px; border: 1px solid var(--line); border-top: 0; background: var(--surface-soft); }
.backtest-stock-pool-members span { padding: 4px 6px; color: #41514b; background: #e8eeeb; font: 8px/1 Consolas, monospace; }
.backtest-stock-pool-members b { color: var(--teal-dark); font-size: 8px; }
.backtest-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.backtest-form-actions .button.primary { font-size: 11px; }
.backtest-job-panel { padding: 26px 22px 22px; }
.backtest-job-heading { display: flex; align-items: flex-start; gap: 13px; padding: 18px; border: 1px solid var(--line); background: var(--surface-soft); }
.backtest-job-icon { display: inline-grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; color: var(--teal-dark); background: var(--teal-soft); }
.backtest-job-icon svg { width: 18px; height: 18px; }
.backtest-job-icon.running svg, .backtest-job-icon.canceling svg { animation: backtest-job-spin 1s linear infinite; }
.backtest-job-icon.failed, .backtest-job-icon.canceled { color: var(--negative); background: #fae9eb; }
.backtest-job-icon.completed { color: var(--positive); background: #e6f5ee; }
.backtest-job-heading > div { min-width: 0; }
.backtest-job-heading h3 { margin: 7px 0 0; color: var(--ink); font-size: 16px; }
.backtest-job-heading p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.backtest-job-status { display: inline-flex; min-height: 21px; align-items: center; padding: 0 6px; color: #765f22; background: #f7efcf; font-size: 8px; font-weight: 700; }
.backtest-job-status.running, .backtest-job-status.canceling { color: var(--teal-dark); background: var(--teal-soft); }
.backtest-job-status.completed { color: var(--positive); background: #e6f5ee; }
.backtest-job-status.failed, .backtest-job-status.canceled { color: var(--negative); background: #fae9eb; }
.backtest-job-progress { margin-top: 16px; }
.backtest-job-progress > div:first-child { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.backtest-job-progress strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.backtest-job-progress-track { height: 7px; margin-top: 8px; overflow: hidden; background: #e2e9e5; }
.backtest-job-progress-track i { display: block; width: 0; height: 100%; background: var(--teal); transition: width .25s ease; }
.backtest-job-status.failed ~ h3 + p, .backtest-job-status.canceled ~ h3 + p { color: var(--negative); }
.backtest-job-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; border: 1px solid var(--line); }
.backtest-job-meta > div { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--line); }
.backtest-job-meta > div:last-child { border-right: 0; }
.backtest-job-meta span, .backtest-job-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backtest-job-meta span { color: var(--muted); font-size: 8px; }
.backtest-job-meta strong { margin-top: 5px; color: var(--ink); font-size: 10px; font-weight: 600; }
.backtest-job-log { margin-top: 14px; border: 1px solid var(--line); }
.backtest-job-log-heading { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.backtest-job-log-heading h4 { margin: 0; color: var(--ink); font-size: 11px; }
.backtest-job-log-heading p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.backtest-job-log-heading > span { flex: 0 0 auto; color: var(--muted); font-size: 8px; }
.backtest-job-events { max-height: 190px; padding: 0; margin: 0; overflow-y: auto; list-style: none; }
.backtest-job-event { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 9px; align-items: start; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.backtest-job-event:last-child { border-bottom: 0; }
.backtest-job-event-marker { width: 8px; height: 8px; margin-top: 4px; border: 2px solid #c0b47c; background: #fff9df; }
.backtest-job-event.running .backtest-job-event-marker, .backtest-job-event.canceling .backtest-job-event-marker { border-color: var(--teal); background: var(--teal-soft); }
.backtest-job-event.completed .backtest-job-event-marker { border-color: var(--positive); background: #e6f5ee; }
.backtest-job-event.failed .backtest-job-event-marker, .backtest-job-event.canceled .backtest-job-event-marker { border-color: var(--negative); background: #fae9eb; }
.backtest-job-event > div { min-width: 0; }
.backtest-job-event strong { display: block; color: var(--ink); font-size: 9px; }
.backtest-job-event p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.backtest-job-event time { color: var(--faint); font-size: 8px; white-space: nowrap; }
.backtest-result-log-section { margin-top: 13px; padding: 0; }
.backtest-result-log-section .backtest-section-heading { min-height: 58px; padding: 13px 14px; margin: 0; border-bottom: 1px solid var(--line); }
.backtest-result-events { max-height: 230px; }
.backtest-job-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.backtest-job-actions .button { font-size: 10px; }
@keyframes backtest-job-spin { to { transform: rotate(360deg); } }
.backtest-result { padding-top: 16px; }
.backtest-result-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.backtest-result-heading h3 { margin: 3px 0 0; font-size: 18px; }
.backtest-result-heading small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.backtest-result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.backtest-result-heading .button { min-height: 33px; padding: 0 10px; font-size: 10px; }
.backtest-result-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; border: 1px solid var(--line); }
.backtest-result-metrics > div { min-width: 0; padding: 12px 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.backtest-result-metrics > div:nth-child(4n) { border-right: 0; }
.backtest-result-metrics > div:nth-last-child(-n+4) { border-bottom: 0; }
.backtest-result-metrics span, .backtest-result-metrics strong, .backtest-result-metrics small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backtest-result-metrics span { color: var(--muted); font-size: 8px; }
.backtest-result-metrics strong { margin-top: 6px; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.backtest-result-metrics small { margin-top: 4px; color: var(--faint); font-size: 8px; }
.backtest-report-overview { margin-top: 13px; border: 1px solid var(--line); background: var(--surface); }
.backtest-report-overview-heading { display: flex; min-height: 58px; align-items: end; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.backtest-report-overview-heading h3 { margin: 3px 0 0; color: var(--ink); font-size: 13px; }
.backtest-verdict { display: inline-flex; min-height: 23px; align-items: center; padding: 0 7px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.backtest-verdict.positive { color: var(--positive); background: #e6f5ee; }
.backtest-verdict.neutral { color: #84641e; background: #f7efcf; }
.backtest-verdict.negative { color: var(--negative); background: #fae9eb; }
.backtest-diagnosis-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.backtest-diagnosis-grid article { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; min-width: 0; padding: 13px 12px; border-right: 1px solid var(--line); }
.backtest-diagnosis-grid article:last-child { border-right: 0; }
.backtest-diagnosis-grid article > svg { width: 17px; height: 17px; color: var(--teal-dark); }
.backtest-diagnosis-grid article > div { min-width: 0; }
.backtest-diagnosis-grid strong { display: block; color: var(--ink); font-size: 9px; }
.backtest-diagnosis-grid p { margin: 5px 0 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.backtest-chart-section { position: relative; margin-top: 13px; padding: 14px; border: 1px solid var(--line); }
.backtest-chart-legend { display: inline-flex; align-items: center; gap: 5px; }
.backtest-chart-legend i { width: 13px; height: 2px; background: var(--teal); }
.backtest-chart-legend i.drawdown { margin-left: 7px; background: #b44b55; }
.backtest-result-chart { display: block; width: 100%; height: 250px; cursor: crosshair; touch-action: pan-y; }
.backtest-chart-tooltip { position: absolute; z-index: 2; width: 170px; padding: 9px 10px; border: 1px solid #bbd8d1; color: #dce9e4; background: rgba(30, 47, 40, .96); box-shadow: 0 8px 22px rgba(29, 48, 40, .18); font-size: 10px; line-height: 1.55; pointer-events: none; }
.backtest-chart-tooltip strong, .backtest-chart-tooltip span { display: block; }
.backtest-chart-tooltip strong { color: #fff; }
.backtest-chart-tooltip span { color: #a8c8bd; }
.backtest-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 13px; }
.backtest-analysis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 13px; }
.backtest-report-section { min-width: 0; padding: 14px; border: 1px solid var(--line); }
.backtest-analysis-section, .backtest-table-analysis-section { padding: 0; }
.backtest-analysis-section .backtest-section-heading, .backtest-table-analysis-section .backtest-section-heading { min-height: 58px; padding: 12px 14px; margin: 0; border-bottom: 1px solid var(--line); }
.backtest-analysis-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.backtest-analysis-metrics > div { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.backtest-analysis-metrics > div:nth-child(2n) { border-right: 0; }
.backtest-analysis-metrics > div:nth-last-child(-n+2) { border-bottom: 0; }
.backtest-analysis-metrics span, .backtest-analysis-metrics strong, .backtest-analysis-metrics small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backtest-analysis-metrics span, .backtest-analysis-metrics small { color: var(--muted); font-size: 8px; }
.backtest-analysis-metrics strong { margin: 5px 0 3px; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.backtest-analysis-metrics small { color: var(--faint); }
.backtest-monthly-table-wrap, .backtest-drawdown-table-wrap { min-height: 114px; overflow: auto; }
.backtest-monthly-table, .backtest-drawdown-table { width: 100%; border-collapse: collapse; }
.backtest-monthly-table { min-width: 760px; }
.backtest-drawdown-table { min-width: 470px; }
.backtest-monthly-table th, .backtest-monthly-table td, .backtest-drawdown-table th, .backtest-drawdown-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); color: #4d5a54; font-size: 8px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.backtest-monthly-table th, .backtest-drawdown-table th { color: var(--muted); background: var(--surface-soft); font-size: 8px; font-weight: 700; }
.backtest-monthly-table th:first-child, .backtest-monthly-table td:first-child, .backtest-drawdown-table th:not(:nth-child(4)), .backtest-drawdown-table td:not(:nth-child(4)) { text-align: left; }
.backtest-monthly-table tbody tr:last-child td, .backtest-drawdown-table tbody tr:last-child td { border-bottom: 0; }
.backtest-monthly-table .muted { color: var(--faint); }
.backtest-config-summary, .backtest-data-summary { display: grid; gap: 7px; }
.backtest-config-summary > div, .backtest-data-summary > div { display: flex; justify-content: space-between; gap: 12px; min-width: 0; padding-bottom: 7px; border-bottom: 1px solid var(--line); font-size: 9px; }
.backtest-config-summary > div:last-child, .backtest-data-summary > div:last-child { padding-bottom: 0; border-bottom: 0; }
.backtest-config-summary span, .backtest-data-summary span { flex: 0 0 auto; color: var(--muted); }
.backtest-config-summary strong, .backtest-data-summary strong { min-width: 0; overflow: hidden; color: var(--ink); font-weight: 600; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.backtest-rebalance-section { margin-top: 13px; padding: 0; }
.backtest-rebalance-section .backtest-section-heading { min-height: 58px; padding: 13px 14px; margin: 0; border-bottom: 1px solid var(--line); }
.backtest-rebalance-table-wrap { position: relative; max-height: 310px; min-height: 92px; overflow: auto; }
.backtest-rebalance-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.backtest-rebalance-table th, .backtest-rebalance-table td { padding: 9px 11px; border-bottom: 1px solid var(--line); color: #4d5a54; font-size: 9px; text-align: left; vertical-align: top; font-variant-numeric: tabular-nums; white-space: nowrap; }
.backtest-rebalance-table thead th { position: sticky; z-index: 1; top: 0; color: var(--muted); background: var(--surface-soft); font-size: 8px; }
.backtest-rebalance-table tbody tr:last-child td { border-bottom: 0; }
.backtest-rebalance-values { display: grid; gap: 3px; }
.backtest-rebalance-values span { display: flex; min-height: 20px; align-items: center; }
.backtest-rebalance-values.numeric span { justify-content: flex-end; }
.backtest-rebalance-values strong { color: var(--ink); font-size: 9px; }
.backtest-trade-section { margin-top: 13px; padding: 0; }
.backtest-trade-section .backtest-section-heading { min-height: 58px; padding: 13px 14px; margin: 0; border-bottom: 1px solid var(--line); }
.backtest-trade-table-wrap { position: relative; max-height: 260px; min-height: 92px; overflow: auto; }
.backtest-trade-table { width: 100%; min-width: 1240px; border-collapse: collapse; }
.backtest-trade-table th, .backtest-trade-table td { padding: 9px 11px; border-bottom: 1px solid var(--line); color: #4d5a54; font-size: 9px; text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
.backtest-trade-table thead th { position: sticky; z-index: 1; top: 0; color: var(--muted); background: var(--surface-soft); font-size: 8px; }
.backtest-trade-table tbody tr:last-child td { border-bottom: 0; }
.backtest-trade-table tfoot th, .backtest-trade-table tfoot td { color: var(--ink); background: var(--surface-soft); font-weight: 800; }
.backtest-trade-state { display: inline-flex; min-height: 19px; align-items: center; padding: 0 5px; font-size: 8px; font-weight: 700; }
.backtest-trade-state.closed { color: var(--positive); background: #e6f5ee; }
.backtest-trade-state.open { color: #84641e; background: #f7efcf; }
.backtest-pnl.positive { color: var(--positive); }
.backtest-pnl.negative { color: var(--negative); }
.submission-checklist { display: grid; gap: 8px; }
.submission-checklist > div, .review-check-list > div { display: flex; align-items: flex-start; gap: 9px; min-height: 52px; padding: 10px 11px; border: 1px solid var(--line); background: var(--surface-soft); }
.submission-checklist svg, .review-check-list svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; }
.submission-checklist .passed svg, .review-check-list .passed svg { color: var(--positive); }
.submission-checklist .failed svg, .review-check-list .failed svg { color: var(--negative); }
.submission-checklist strong, .submission-checklist small, .review-check-list strong, .review-check-list small { display: block; }
.submission-checklist strong, .review-check-list strong { color: var(--ink); font-size: 10px; }
.submission-checklist small, .review-check-list small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.risk-acknowledgement { margin-top: 12px; }
.review-detail-modal { width: min(780px, 100%); }
.review-detail-content { padding: 17px 20px 0; }
.review-detail-identity { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.review-detail-identity > div { display: flex; align-items: center; gap: 10px; }
.review-detail-identity strong, .review-detail-identity small { display: block; }
.review-detail-identity strong { color: var(--ink); font-size: 12px; }
.review-detail-identity small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.review-detail-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.review-detail-metrics > div { min-width: 0; padding: 13px 10px; border-right: 1px solid var(--line); }
.review-detail-metrics > div:last-child { border-right: 0; }
.review-detail-metrics span, .review-detail-metrics strong { display: block; }
.review-detail-metrics span { color: var(--muted); font-size: 9px; }
.review-detail-metrics strong { margin-top: 6px; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.review-detail-block { padding: 15px 0; border-bottom: 1px solid var(--line); }
.review-check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.review-definition-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.review-definition-grid > div { min-width: 0; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.review-definition-grid > div:nth-child(4n) { border-right: 0; }
.review-definition-grid > div:nth-last-child(-n+4) { border-bottom: 0; }
.review-definition-grid span, .review-definition-grid strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-definition-grid span { color: var(--muted); font-size: 8px; }
.review-definition-grid strong { margin-top: 5px; color: var(--ink); font-size: 10px; }
#review-note-field { margin-top: 15px; }
.review-detail-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 20px 20px; }
.review-reject-button { color: var(--negative) !important; }

.access-control-section { margin-top: 48px; scroll-margin-top: 22px; }
.access-control-heading { align-items: end; }
.access-control-heading .button { min-height: 34px; padding: 0 11px; font-size: 11px; }
.access-control-heading .button svg { width: 14px; height: 14px; }
.access-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 17px 0 13px; border: 1px solid var(--line); background: var(--surface); }
.access-summary > div { min-width: 0; padding: 15px 17px; border-right: 1px solid var(--line); }
.access-summary > div:last-child { border-right: 0; }
.access-summary span, .access-summary strong, .access-summary small { display: block; }
.access-summary span, .access-summary small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.access-summary strong { margin: 7px 0 5px; font-size: 17px; font-variant-numeric: tabular-nums; }
.access-control-grid { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(360px, .68fr); gap: 13px; align-items: start; }
.access-panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.access-panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; min-height: 64px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.access-panel-heading h3 { margin: 0; font-size: 14px; }
.access-panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.access-panel-heading > span { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.access-table-wrap { position: relative; min-height: 174px; overflow-x: auto; }
.access-table { width: 100%; min-width: 830px; border-collapse: collapse; }
.access-table th, .access-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: #4d5a54; font-size: 11px; text-align: left; white-space: nowrap; }
.access-table thead th { color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 700; }
.access-table tbody tr:last-child td { border-bottom: 0; }
.access-table td strong, .access-table td small { display: block; }
.access-table td strong { color: var(--ink); font-size: 11px; }
.access-table td small { max-width: 145px; margin-top: 3px; overflow: hidden; color: var(--faint); font-size: 9px; text-overflow: ellipsis; }
.access-role-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.access-role-tags span, .role-name, .permission-chip-list span, .account-state { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; font-size: 9px; font-weight: 700; }
.access-role-tags span, .role-name { color: var(--teal-dark); background: var(--teal-soft); }
.account-state.enabled { color: var(--positive); background: #e6f5ee; }
.account-state.disabled { color: var(--negative); background: #fae9eb; }
.account-state.pending { color: #8a5b00; background: #fff2cc; }
.access-row-actions { display: inline-flex; gap: 5px; }
.access-row-actions .icon-button { width: 28px; height: 28px; }
.access-row-actions .icon-button svg { width: 14px; height: 14px; }
.access-approve-button { min-height: 28px; padding: 0 9px; font-size: 10px; }
.access-approve-button svg { width: 13px; height: 13px; }
.invitation-panel { margin-bottom: 13px; }
.invitation-create-form { display: grid; grid-template-columns: 130px 130px minmax(220px, 1fr) auto; gap: 10px; align-items: end; padding: 13px 17px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.invitation-create-form label, .invitation-create-form label > span { display: block; }
.invitation-create-form label > span { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.invitation-create-form input, .invitation-create-form select { width: 100%; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); font: inherit; font-size: 11px; }
.invitation-create-form .button { min-height: 34px; white-space: nowrap; }
.invitation-table { min-width: 760px; }
.invitation-table-wrap { min-height: 122px; }
.invitation-code { font-family: Consolas, "SFMono-Regular", monospace; letter-spacing: 0; }
.invitation-state { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; font-size: 9px; font-weight: 700; }
.invitation-state.available { color: var(--positive); background: #e6f5ee; }
.invitation-state.revoked, .invitation-state.expired, .invitation-state.exhausted { color: var(--muted); background: #edf0f4; }
.access-row-actions .icon-button.danger { color: var(--negative); }
.root-protected { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 7px; color: #785c14; background: #f7efcf; font-size: 9px; font-weight: 700; }
.root-protected svg { width: 13px; height: 13px; }
.role-definition-list { max-height: 520px; overflow-y: auto; }
.role-definition-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 13px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.role-definition-row:last-child { border-bottom: 0; }
.role-definition-copy { min-width: 0; }
.role-definition-copy .role-name { margin-bottom: 7px; }
.role-definition-copy strong, .role-definition-copy small { display: block; overflow: hidden; text-overflow: ellipsis; }
.role-definition-copy strong { color: var(--ink); font-size: 10px; white-space: nowrap; }
.role-definition-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.permission-chip-list { display: flex; align-content: flex-start; flex-wrap: wrap; gap: 5px; }
.permission-chip-list span { color: #54615b; background: #edf1ef; font-weight: 500; }
.role-definition-row:first-child .role-name, .role-definition-row:first-child .permission-chip-list span { color: #785c14; background: #f7efcf; }
.access-empty { min-height: 174px; place-items: center; padding: 24px; color: var(--muted); font-size: 12px; text-align: center; }
.access-empty:not(.hidden) { display: grid; }
.access-audit-panel { margin-top: 13px; }
.audit-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 13px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.audit-search { display: flex; flex: 1 1 220px; align-items: center; gap: 7px; min-height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); background: var(--surface); }
.audit-search svg { flex: 0 0 auto; width: 14px; height: 14px; color: var(--faint); }
.audit-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.audit-select { display: flex; min-height: 34px; border: 1px solid var(--line-strong); background: var(--surface); }
.audit-select select { min-width: 112px; padding: 0 25px 0 9px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.audit-toolbar .icon-button { flex: 0 0 auto; width: 34px; height: 34px; }
.audit-export-button { flex: 0 0 auto; min-height: 34px; padding: 0 11px; font-size: 11px; }
.audit-export-button svg { width: 14px; height: 14px; }
.access-audit-table-wrap { position: relative; min-height: 138px; overflow-x: auto; }
.access-audit-table { width: 100%; min-width: 880px; border-collapse: collapse; }
.access-audit-table th, .access-audit-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: #4d5a54; font-size: 10px; text-align: left; white-space: nowrap; }
.access-audit-table thead th { color: var(--muted); background: var(--surface-soft); font-size: 9px; font-weight: 700; }
.access-audit-table tbody tr:last-child td { border-bottom: 0; }
.access-audit-table td strong { color: var(--ink); font-size: 10px; }
.audit-outcome { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; font-size: 9px; font-weight: 700; }
.audit-outcome.succeeded { color: var(--positive); background: #e6f5ee; }
.audit-outcome.failed { color: var(--negative); background: #fae9eb; }
.audit-outcome.locked { color: #84641e; background: #f7efcf; }
.access-audit-table .audit-details { max-width: 320px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.create-user-modal { width: min(620px, 100%); }
.create-user-form { padding: 19px 22px 22px; }
.create-user-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 13px; }
.create-user-field { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 11px; }
.create-user-field input, .create-user-field select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); outline: 0; color: var(--ink); background: var(--surface-soft); font: inherit; font-size: 12px; }
.create-user-field input:focus, .create-user-field select:focus { border-color: #8ecfc1; box-shadow: 0 0 0 3px rgba(14,139,130,.12); }
.create-user-field small { min-height: 29px; color: var(--faint); font-size: 9px; line-height: 1.55; }
.create-user-error { margin: 14px 0 0; padding: 8px 10px; color: #9a3940; background: #fae9eb; font-size: 11px; line-height: 1.5; }
.create-user-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.account-action-modal { width: min(590px, 100%); }
.account-action-form { padding: 19px 22px 22px; }
.account-target { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; margin-bottom: 15px; border: 1px solid var(--line); background: var(--surface-soft); }
.account-target strong, .account-target small { display: block; }
.account-target strong { color: var(--ink); font-size: 12px; }
.account-target small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.account-status-toggle { position: relative; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 10px 12px; margin-top: 14px; border: 1px solid var(--line); cursor: pointer; }
.account-status-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.account-status-toggle input:focus-visible + .account-status-switch { box-shadow: 0 0 0 3px rgba(14,139,130,.14); }
.account-status-switch { position: relative; flex: 0 0 auto; width: 34px; height: 18px; background: #cbd3cf; transition: background .16s ease; }
.account-status-switch::after { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; content: ""; background: #fff; transition: transform .16s ease; }
.account-status-toggle input:checked + .account-status-switch { background: var(--teal); }
.account-status-toggle input:checked + .account-status-switch::after { transform: translateX(16px); }
.account-status-toggle input:disabled + .account-status-switch { opacity: .5; }
.account-status-toggle:has(input:disabled) { cursor: not-allowed; }
.account-status-toggle > span:last-child { min-width: 0; }
.account-status-toggle strong, .account-status-toggle small { display: block; }
.account-status-toggle strong { color: var(--ink); font-size: 11px; }
.account-status-toggle small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.reset-password-fields { display: grid; gap: 12px; }

.toast { position: fixed; z-index: 30; top: 22px; right: 23px; max-width: 320px; padding: 12px 15px; color: #fff; background: #293630; box-shadow: var(--shadow); font-size: 13px; }.toast.error { background: #973f46; }.toast.success { background: #257c68; }

@media (max-width: 1140px) {
  .watchlist-grid, .compare-workspace-grid { grid-template-columns: 1fr; }
  .watchlist-activity { max-height: 320px; }
  .paper-trading-grid { grid-template-columns: 1fr; }
  .paper-account-list { max-height: 300px; }
}
@media (max-width: 960px) {
  .research-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .research-summary > div:nth-child(2) { border-right: 0; }
  .research-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .compare-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare-picker-option:nth-child(3n) { border-right: 1px solid var(--line); }
  .compare-picker-option:nth-child(2n) { border-right: 0; }
  .compare-picker-option:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .compare-picker-option:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 640px) {
  .research-workspace { margin-top: 32px; }
  .research-heading { align-items: flex-start; }
  .research-heading .button { width: 34px; padding: 0; font-size: 0; }
  .research-summary > div { padding: 12px 13px; }
  .research-toolbar { flex-wrap: wrap; }
  .research-search { flex-basis: 100%; }
  .research-select { flex: 1; }
  .research-select select { width: 100%; }
  .research-panel-heading { min-height: 55px; padding: 12px 13px; }
  .research-table th, .research-table td { padding: 10px 11px; }
  .watchlist-table { min-width: 760px; }
  .research-heading-actions { gap: 5px; }
  .research-heading-actions .button { padding: 0 8px; font-size: 0; }
  .research-heading-actions .button svg { margin: 0; }
  .paper-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paper-summary > div:nth-child(2) { border-right: 0; }
  .paper-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .paper-summary > div { padding: 11px 13px; }
  .paper-quote-banner { grid-template-columns: auto minmax(0, 1fr); padding: 8px 10px; }
  .paper-quote-banner small { display: none; }
  .paper-runtime-note { grid-template-columns: auto minmax(0, 1fr); padding: 9px 11px; }
  .paper-runtime-note small { display: none; }
  .paper-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paper-metrics > div:nth-child(2) { border-right: 0; }
  .paper-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .paper-metrics > div { padding: 10px 11px; }
  .paper-equity-block { padding: 10px 11px 7px; }
  .paper-equity-chart { height: 104px; }
  .paper-equity-heading { align-items: flex-start; }
  .paper-equity-heading small { max-width: 46%; text-align: right; white-space: normal; }
  .paper-detail-heading { padding: 11px; }
  .paper-account-form { padding: 15px 13px; }
  .paper-account-form-grid { grid-template-columns: 1fr; gap: 10px; }
  .paper-account-wide { grid-column: auto; }
  .compare-picker { grid-template-columns: 1fr; }
  .compare-picker-option, .compare-picker-option:nth-child(2n), .compare-picker-option:nth-child(3n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .compare-picker-option:last-child { border-bottom: 0; }
  .strategy-compare-chart { height: 240px; }
  .compare-chart-legend { display: none; }
  .insight-risk-list { grid-template-columns: 1fr; }
  .insight-risk-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .insight-risk-item:last-child { border-bottom: 0; }
  .insight-highlight-list { grid-template-columns: 1fr; }
  .insight-highlight-item, .insight-highlight-item:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .insight-highlight-item:last-child { border-bottom: 0; }
}

@media (max-width: 1380px) { .access-control-grid { grid-template-columns: 1fr; }.role-definition-list { max-height: none; } }
@media (max-width: 1140px) { .content-layout { grid-template-columns: 1fr; }.ranking-panel { display: none; }.strategy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.workflow-grid, .access-control-grid { grid-template-columns: 1fr; }.version-timeline { max-height: none; }.role-definition-list { max-height: none; } }
@media (max-width: 900px) { .invitation-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }.invitation-note-field { grid-column: 1 / -1; }.invitation-create-form .button { grid-column: 1 / -1; } }
@media (max-width: 960px) { .sidebar { width: 72px; padding-right: 9px; padding-left: 9px; }.brand { justify-content: center; padding-right: 0; padding-left: 0; }.brand > span:last-child, .nav-item span, .nav-item b, .nav-section, .sidebar-status span:last-child, .profile > span:not(.avatar), .profile .icon-button { display: none; }.nav-item { justify-content: center; padding: 0; }.main-content { padding-right: 22px; padding-left: 22px; }.compare-bar { left: 94px; }.overview-grid { grid-template-columns: repeat(2, 1fr); }.strategy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .auth-screen { padding: 14px; }.auth-brand { padding: 19px 18px; }.auth-heading { padding: 21px 18px 0; }.auth-heading h1 { font-size: 20px; }.auth-form { padding: 18px 18px 21px; }.sidebar { display: none; }.main-content { padding: 20px 14px 90px; }.topbar { align-items: flex-start; }.topbar h1 { font-size: 24px; }.top-actions { gap: 6px; }.workspace-help-button { min-width: 36px; width: 36px; padding: 0; }.workspace-help-button span { display: none; }.button.primary { padding: 0 10px; }.button.primary svg { margin: 0; }.button.primary { font-size: 0; }.overview-grid { gap: 8px; margin: 20px 0 28px; }.stat-block { min-height: 112px; padding: 13px; }.stat-block strong { margin: 9px 0 5px; font-size: 23px; }.stat-block small { font-size: 9px; }.section-heading { align-items: flex-end; }.section-heading h2 { font-size: 17px; }.filters { gap: 7px; padding: 9px; }.search-input { flex-basis: 100%; }.select-control { flex: 1 1 30%; justify-content: space-between; }.select-control span { display: none; }.filter-toggle { flex: 1; }.strategy-grid { grid-template-columns: 1fr; }.compare-bar { right: 10px; bottom: 10px; left: 10px; }.compare-bar small, .compare-bar .button.text { display: none; }.detail-metrics { grid-template-columns: repeat(2, 1fr); }.detail-metrics > div:nth-child(2) { border-right: 0; }.detail-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.detail-hero, .chart-section, .detail-tabs { padding-right: 18px; padding-left: 18px; }.drawer-header { padding-right: 18px; padding-left: 18px; }.trust-grid { padding-right: 18px; padding-left: 18px; }.trust-grid { gap: 7px; }.trust-grid > div { padding: 9px; }.detail-title-row h2 { font-size: 20px; }.rebalance-list li { grid-template-columns: 68px 35px 1fr; }.workspace-help-content { padding: 0 14px; }.workspace-help-feature-list { grid-template-columns: 1fr; gap: 8px; }.workspace-help-intro { padding-top: 16px; }.workspace-help-section { padding: 15px 0; }.workspace-help-actions { padding: 12px 14px 15px; }.workspace-help-actions .button.primary { font-size: 12px; } }
@media (max-width: 640px) { .strategy-rule-grid { grid-template-columns: 1fr; } }

@media (max-width: 640px) {
  .data-section { margin-top: 32px; }
  .data-toolbar { align-items: stretch; }
  .data-toolbar .select-control { flex: 1 1 42%; }
  .instrument-picker { flex: 1 1 58%; }.instrument-trigger { width: 100%; min-width: 0; }.indicator-picker { flex: 1; }.indicator-trigger { width: 100%; justify-content: center; }.instrument-popover { width: min(440px, calc(100vw - 28px)); }
  .data-source-note { width: 100%; margin-left: 0; }
  .data-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-summary > div:nth-child(2) { border-right: 0; }
  .data-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .data-quality-heading { padding: 13px; }
  .data-quality-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-quality-summary > div:nth-child(2) { border-right: 0; }
  .data-quality-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .data-quality-summary > div { padding: 11px 13px; }
  .data-quality-message, .data-quality-issue { padding-right: 13px; padding-left: 13px; }
  .data-management-heading { padding: 14px 13px 12px; }
  .data-management-actions { gap: 7px; }
  .data-management-source { display: none; }
  .sync-job-form { padding: 16px 14px 17px; }
  .sync-job-form-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
  .data-coverage-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-coverage-summary > div:nth-child(2) { border-right: 0; }
  .data-coverage-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .data-coverage-summary > div { padding: 12px 13px; }
  .data-backfill-progress { padding: 13px 13px 0; }
  .backfill-progress-heading { gap: 10px; }
  .backfill-progress-value strong { font-size: 16px; }
  .backfill-progress-value small { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .backfill-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backfill-metrics > div { padding: 9px 10px; }
  .backfill-metrics > div:first-child { padding-left: 0; }
  .backfill-metrics > div:nth-child(2) { padding-right: 0; border-right: 0; }
  .backfill-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .backfill-metrics > div:nth-child(3) { padding-left: 0; }
  .backfill-metrics > div:last-child { padding-right: 0; }
  .data-management-grid { grid-template-columns: 1fr; }
  .sync-job-panel { border-top: 1px solid var(--line); border-left: 0; }
  .data-subheading { min-height: 48px; padding: 12px 13px; }
  .coverage-table th, .coverage-table td { padding: 10px 13px; }
  .coverage-table-wrap, .sync-job-list, .sync-job-empty { min-height: 166px; }
  .data-chart-panel { min-height: 282px; padding: 13px; }
  .market-data-chart { height: 225px; }
  .data-empty { inset: 70px 13px 13px; }
  .chart-heading { align-items: flex-start; }.market-chart-actions { gap: 7px; }.chart-window-indicator { display: none; }.chart-legend { display: none; }.chart-action-group .icon-button { width: 27px; height: 27px; }
  .market-data-tooltip { width: 168px; }
  .data-financials-heading { padding: 14px 13px 12px; }.financial-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .financial-summary > div:nth-child(2) { border-right: 0; }.financial-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .financial-summary > div { padding: 12px 13px; }.financial-table th, .financial-table td { padding: 10px 13px; }
  .workflow-section { margin-top: 32px; }
  .workflow-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-summary > div:nth-child(2) { border-right: 0; }
  .workflow-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workflow-summary > div { padding: 12px 13px; }
  .workflow-panel-heading { min-height: 58px; padding: 12px 13px; }
  .workflow-table th, .workflow-table td { padding: 10px 13px; }
  .review-heading-actions .audit-select { max-width: 145px; }
  .strategy-editor-form { padding: 16px 14px 17px; }
  .strategy-editor-grid { grid-template-columns: 1fr; gap: 10px; }
  .strategy-editor-wide { grid-column: auto; }
  .backtest-form, .backtest-result { padding: 14px; }
  .backtest-job-panel { padding: 18px 14px 16px; }
  .backtest-job-heading { padding: 14px; }
  .backtest-job-meta { grid-template-columns: 1fr; }
  .backtest-job-meta > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .backtest-job-meta > div:last-child { border-bottom: 0; }
  .backtest-job-event { grid-template-columns: 12px minmax(0, 1fr); }
  .backtest-job-event time { grid-column: 2; }
  .backtest-job-actions { flex-wrap: wrap; }
  .backtest-engine-badge { display: none; }
  .backtest-config-layout { grid-template-columns: 1fr; }
  .backtest-code-section { border-top: 1px solid var(--line); border-left: 0; }
  .backtest-code-section pre { height: 190px; }
  .backtest-custom-code { height: 230px; min-height: 190px; }
  .backtest-code-toolbar { flex-wrap: wrap; }
  .backtest-field-grid { grid-template-columns: 1fr; }
  .backtest-ma-parameters { grid-column: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backtest-classic-parameters { grid-column: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backtest-dsl-summary { grid-column: auto; }
  .backtest-scope-switch { grid-template-columns: 1fr; }
  .backtest-scope-switch label + label { border-top: 1px solid var(--line-strong); border-left: 0; }
  .backtest-stock-pool-controls { grid-template-columns: 1fr; gap: 9px; }
  .backtest-stock-pool-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backtest-stock-pool-summary > div { border-bottom: 1px solid var(--line); }
  .backtest-stock-pool-summary > div:nth-child(2n) { border-right: 0; }
  .backtest-stock-pool-summary > div:nth-last-child(-n+2) { border-bottom: 0; }
  .backtest-instrument-toolbar { grid-template-columns: 1fr 1fr; }
  .backtest-instrument-toolbar .instrument-search { grid-column: 1 / -1; }
  .backtest-instrument-list { grid-template-columns: 1fr; max-height: 198px; }
  .backtest-instrument-option { border-right: 0; }
  .backtest-result-heading { align-items: flex-start; }
  .backtest-result-heading .button { width: 34px; padding: 0; font-size: 0; }
  .backtest-result-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backtest-result-metrics > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .backtest-result-metrics > div:nth-child(2n) { border-right: 0; }
  .backtest-result-metrics > div:nth-last-child(-n+2) { border-bottom: 0; }
  .backtest-result-metrics > div:last-child { grid-column: auto; border-right: 0; }
  .backtest-report-overview-heading { align-items: flex-start; padding: 11px 12px; }
  .backtest-report-overview-heading .backtest-verdict { max-width: 48%; white-space: normal; text-align: right; }
  .backtest-diagnosis-grid { grid-template-columns: 1fr; }
  .backtest-diagnosis-grid article { grid-template-columns: 25px minmax(0, 1fr); padding: 11px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .backtest-diagnosis-grid article:last-child { border-bottom: 0; }
  .backtest-analysis-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
  .backtest-analysis-section .backtest-section-heading, .backtest-table-analysis-section .backtest-section-heading { min-height: 54px; padding: 11px 12px; }
  .backtest-analysis-metrics > div { padding: 10px 11px; }
  .backtest-monthly-table-wrap, .backtest-drawdown-table-wrap { max-width: 100%; overflow-x: auto; }
  .backtest-monthly-table th, .backtest-monthly-table td, .backtest-drawdown-table th, .backtest-drawdown-table td { padding: 9px 7px; }
  .backtest-result-chart { height: 220px; }
  .backtest-result-grid { grid-template-columns: 1fr; }
  .detail-action-row .button.primary { width: auto; padding: 0 10px; font-size: 10px; }
  .card-footer { align-items: flex-start; flex-direction: column; }
  .strategy-card-actions { width: 100%; justify-content: space-between; }
  .review-detail-content { padding: 14px 14px 0; }
  .review-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-detail-metrics > div:nth-child(2) { border-right: 0; }
  .review-detail-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .review-check-list { grid-template-columns: 1fr; }
  .review-definition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-definition-grid > div:nth-child(2n) { border-right: 0; }
  .review-definition-grid > div:nth-child(-n+6) { border-bottom: 1px solid var(--line); }
  .review-definition-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
  .review-detail-actions { flex-wrap: wrap; padding: 13px 14px 16px; }
  .review-detail-actions .button.primary { font-size: 11px; }
  .access-control-section { margin-top: 32px; }
  .access-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-summary > div:nth-child(2) { border-right: 0; }
  .access-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .access-summary > div { padding: 12px 13px; }
  .access-panel-heading { min-height: 58px; padding: 12px 13px; }
  .access-table th, .access-table td { padding: 10px 13px; }
	.invitation-create-form { grid-template-columns: 1fr; padding: 12px 13px; }
	.invitation-note-field, .invitation-create-form .button { grid-column: auto; }
  .audit-toolbar { gap: 7px; padding: 9px; }
  .audit-search { flex-basis: 100%; }
  .audit-select { flex: 1 1 120px; }
  .audit-select select { width: 100%; min-width: 0; }
  .audit-export-button { width: 34px; padding: 0; }
  .audit-export-button span { display: none; }
  .access-audit-table th, .access-audit-table td { padding: 10px 13px; }
  .role-definition-row { grid-template-columns: 108px minmax(0, 1fr); padding: 12px 13px; }
  .create-user-form, .account-action-form { padding: 16px 14px 17px; }
  .create-user-form-grid { grid-template-columns: 1fr; gap: 11px; }
  .create-user-field small { min-height: 0; }
  .create-user-form-actions .button.primary { font-size: 12px; }
}

@media (max-width: 640px) {
  body.mobile-sidebar-open { overflow: hidden; }
  .sidebar {
    position: fixed;
    z-index: 51;
    top: 0;
    left: 0;
    display: flex;
    visibility: hidden;
    width: min(286px, 86vw);
    height: 100dvh;
    min-height: 100vh;
    padding: 23px 14px 16px;
    pointer-events: none;
    transform: translateX(-102%);
    transition: transform .2s ease, visibility 0s linear .2s;
    box-shadow: 18px 0 42px rgba(10, 17, 14, .24);
  }
  .sidebar.mobile-open {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }
  .sidebar .brand { justify-content: flex-start; padding: 0 44px 28px 10px; }
  .sidebar .brand > span:last-child,
  .sidebar .nav-item span,
  .sidebar .nav-item b,
  .sidebar .nav-section,
  .sidebar .sidebar-status span:last-child,
  .sidebar .profile > span:not(.avatar) { display: block; }
  .sidebar .profile .icon-button { display: inline-flex; }
  .sidebar .nav-item { justify-content: flex-start; padding: 0 12px; }
  .mobile-sidebar-close {
    position: absolute;
    z-index: 1;
    top: 22px;
    right: 14px;
    display: inline-flex;
    color: #c9d7d0;
  }
  .mobile-sidebar-close:hover { color: #fff; background: rgba(255,255,255,.08); }
  .mobile-sidebar-backdrop {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(12, 18, 15, .48);
  }
  .mobile-menu-button { display: inline-flex; flex: 0 0 auto; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar-heading { flex: 1 1 auto; }
  .topbar-copy h1 { overflow-wrap: anywhere; }
  .top-actions { flex: 0 0 auto; margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) and (max-width: 640px) {
  .sidebar { transition: none; }
}

/* 2026 light data-dashboard refresh */
body {
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7f8fc 0, var(--canvas) 240px);
}

::selection { color: #fff; background: var(--teal); }

.app-shell { background: transparent; }

.sidebar {
  width: 220px;
  padding: 18px 12px 14px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  background: var(--nav);
  box-shadow: 5px 0 24px rgba(45, 62, 104, .04);
}

.brand {
  min-height: 50px;
  gap: 10px;
  padding: 0 10px 19px;
  color: var(--ink);
}

.brand-mark,
.auth-brand .brand-mark {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 7px 16px rgba(65, 103, 239, .22);
  font-family: Inter, "Microsoft YaHei UI", sans-serif;
  font-size: 16px;
  font-weight: 800;
}

.brand strong { color: var(--ink); font-size: 15px; }
.brand small { color: #9aa4b6; letter-spacing: .7px; }

.primary-nav,
.secondary-nav { gap: 4px; }

.nav-item {
  min-height: 40px;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  color: var(--nav-muted);
  font-size: 13px;
  font-weight: 600;
}

.nav-item svg { width: 16px; height: 16px; }
.nav-item:hover { color: var(--teal-dark); background: #f5f7fd; }
.nav-item.active {
  color: var(--teal-dark);
  border: 0;
  background: var(--teal-soft);
  box-shadow: inset 3px 0 0 var(--teal);
}

.nav-item b {
  min-width: 20px;
  color: var(--teal-dark);
  border-radius: 8px;
  background: #dfe6ff;
}

.nav-section {
  margin: 24px 11px 8px;
  color: #a2aabd;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
}

.sidebar-status {
  padding: 12px 10px;
  border-color: var(--line);
  color: var(--muted);
}

.profile { padding: 11px 8px 0; border-top: 1px solid var(--line); }
.profile strong { color: var(--ink); }
.profile small { color: var(--muted); }
.profile .icon-button { color: var(--muted); }
.sidebar .icon-button:hover { color: var(--teal-dark); background: var(--teal-soft); }

.main-content {
  --page-gutter: clamp(20px, 2.5vw, 38px);
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  min-width: 0;
  padding: 22px var(--page-gutter) 86px;
  margin: 0;
}

.topbar {
  position: sticky;
  z-index: 9;
  top: 0;
  min-height: 66px;
  margin: -22px calc(0px - var(--page-gutter)) 22px;
  padding: 13px var(--page-gutter);
  border-bottom: 1px solid rgba(220, 225, 235, .86);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--teal-dark);
  font-size: 10px;
  letter-spacing: .45px;
}

h1 { font-size: 24px; font-weight: 720; }
h2 { font-size: 18px; }
h3 { font-size: 14px; }

.top-actions { gap: 7px; }
.workspace-help-button { min-width: 102px; }

.button,
.icon-button,
.filter-toggle {
  border-radius: 6px;
  transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(65, 103, 239, .72);
  outline-offset: 2px;
}

.button { min-height: 36px; font-size: 12px; }
.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 6px 14px rgba(65, 103, 239, .16);
}
.button.primary:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
  box-shadow: 0 7px 18px rgba(47, 80, 213, .22);
}
.button.secondary { border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(41, 59, 102, .03); }
.button.secondary:hover { color: var(--teal-dark); border-color: #bcc8f4; background: #f8f9ff; }

.icon-button {
  width: 35px;
  height: 35px;
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(41, 59, 102, .03);
}
.icon-button:hover,
.icon-button.active { color: var(--teal-dark); border-color: #cbd4f7; background: var(--teal-soft); }

.overview-grid {
  gap: 12px;
  margin: 22px 0 30px;
}

.stat-block {
  min-height: 118px;
  padding: 16px 17px;
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-block > div { align-items: center; font-size: 11px; }
.stat-block svg {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 7px;
  color: var(--teal);
  background: var(--teal-soft);
}
.stat-block strong { margin: 10px 0 5px; font-size: 25px; }
.stat-block small { font-size: 10px; }

.overview-grid .stat-block:first-child {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #3e64ed, #7186f5);
  box-shadow: 0 14px 28px rgba(65, 103, 239, .22);
}
.overview-grid .stat-block:first-child > div,
.overview-grid .stat-block:first-child small { color: rgba(255, 255, 255, .78); }
.overview-grid .stat-block:first-child svg { color: #fff; background: rgba(255, 255, 255, .16); }

.filters,
.data-toolbar,
.research-toolbar,
.audit-toolbar {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(41, 59, 102, .045);
}

.search-input,
.research-search,
.instrument-search,
.audit-search,
.select-control,
.filter-toggle,
.instrument-trigger,
.indicator-trigger,
.create-user-field input,
.create-user-field select,
.create-user-field textarea,
.sync-job-field input,
.sync-job-field select,
.sync-job-field textarea {
  border-radius: 6px;
}

.search-input,
.instrument-trigger,
.indicator-trigger,
.auth-field input,
.create-user-field input,
.create-user-field select,
.create-user-field textarea {
  background: #fbfcff;
}

.auth-field input:focus,
.sync-job-field textarea:focus,
.sync-job-field input:focus,
.sync-job-field select:focus,
.create-user-field input:focus,
.create-user-field select:focus,
.create-user-field textarea:focus {
  border-color: #9bacef;
  box-shadow: 0 0 0 3px rgba(65, 103, 239, .11);
}

.strategy-card,
.ranking-panel,
.research-panel,
.workflow-panel,
.access-panel,
.data-management-panel,
.data-quality-panel,
.data-chart-panel,
.data-financials,
.backtest-report-section,
.backtest-chart-section,
.backtest-rebalance-section,
.backtest-trade-section {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 5px 20px rgba(41, 59, 102, .055);
  overflow: hidden;
}

.strategy-card:hover {
  border-color: #c7d1f4;
  box-shadow: 0 10px 26px rgba(41, 59, 102, .10);
}
.strategy-card.selected { border-color: var(--teal); }

.strategy-avatar,
.avatar { border-radius: 7px; }
.tag-row span,
.score-pill,
.strategy-backtest-button,
.workflow-status,
.coverage-state,
.sync-job-state,
.paper-quote-state,
.backfill-state,
.data-quality-state,
.account-state,
.role-name,
.access-role-tags span,
.permission-chip-list span,
.backtest-job-status,
.backtest-trade-state {
  border-radius: 5px;
}

.strategy-backtest-button {
  color: var(--teal-dark);
  border-color: #cbd4f7;
  background: var(--teal-soft);
}

.ranking-panel { padding: 16px; }
.rank { border-radius: 5px; }

.research-workspace,
.workflow-section,
.access-control-section,
.data-section { margin-top: 24px; }

.research-summary,
.paper-summary,
.workflow-summary,
.access-summary,
.data-summary,
.data-coverage-summary,
.financial-summary,
.backtest-job-meta,
.backtest-stock-pool-summary {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(41, 59, 102, .045);
  overflow: hidden;
}

.data-summary > div:first-child,
.paper-summary > div:first-child {
  color: #fff;
  border-color: rgba(255, 255, 255, .14);
  background: var(--teal);
}
.data-summary > div:first-child span,
.data-summary > div:first-child small,
.paper-summary > div:first-child span,
.paper-summary > div:first-child small { color: rgba(255, 255, 255, .76); }

.research-panel-heading,
.workflow-panel-heading,
.access-panel-heading,
.data-management-heading,
.data-quality-heading,
.data-financials-heading,
.data-subheading {
  background: #fff;
}

.data-management-panel,
.data-quality-panel,
.data-financials { margin-top: 12px; margin-bottom: 12px; }

.data-backfill-progress {
  padding: 16px 17px 0;
  background: #f6f8ff;
}
.backfill-progress-track {
  height: 8px;
  border-radius: 4px;
  background: #e2e7f5;
}
.backfill-progress-track span {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #7a8df1);
}
.backfill-progress-value strong { color: var(--teal-dark); font-size: 20px; }
.backfill-state.running { color: var(--teal-dark); background: #e3e9ff; }
.backfill-metrics strong { color: var(--ink); }

.data-chart-panel { min-height: 350px; }
.market-data-chart { height: 296px; }

.instrument-popover,
.indicator-popover {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(36, 50, 88, .15);
  overflow: hidden;
}

.instrument-category-tabs button { border-radius: 5px; }
.instrument-option:hover,
.instrument-option.selected { background: var(--teal-soft); }

.research-table thead th,
.workflow-table thead th,
.coverage-table thead th,
.financial-table thead th,
.access-table thead th,
.access-audit-table thead th,
.backtest-monthly-table th,
.backtest-drawdown-table th,
.backtest-rebalance-table thead th,
.backtest-trade-table thead th {
  color: #79849a;
  background: #f7f8fc;
}

.research-table td,
.workflow-table td,
.coverage-table td,
.financial-table td,
.access-table td,
.access-audit-table td,
.backtest-monthly-table td,
.backtest-drawdown-table td,
.backtest-rebalance-table td,
.backtest-trade-table td { color: #4d5870; }

.research-table tbody tr:hover,
.workflow-table tbody tr:hover,
.coverage-table tbody tr:hover,
.financial-table tbody tr:hover,
.access-table tbody tr:hover,
.access-audit-table tbody tr:hover { background: #fafbff; }

.paper-account-row:hover,
.paper-account-row.selected { background: #f7f9ff; }
.paper-account-row.selected { box-shadow: inset 3px 0 0 var(--teal); }

.detail-drawer {
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(36, 50, 88, .14);
}

.modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(28, 39, 70, .20);
}

.modal-backdrop { background: rgba(30, 40, 65, .38); backdrop-filter: blur(3px); }

.compare-bar {
  left: 244px;
  border-color: #c8d1f5;
  border-radius: 8px;
  background: #fbfcff;
}

.backtest-code-section { background: #1c2540; }
.backtest-code-button { color: #dce3ff; border-color: #405077; background: #263250; }
.backtest-code-button:hover { border-color: #7184bc; background: #303e62; }
.backtest-code-section .backtest-section-heading p,
.backtest-code-section .backtest-section-heading > span { color: #98a7cf; }
.backtest-custom-code,
.backtest-code-section pre { color: #dce4ff; }
.backtest-code-meta { border-color: #3b486b; color: #91a0c8; }

.auth-screen {
  background:
    linear-gradient(135deg, rgba(65, 103, 239, .08), transparent 42%),
    #f4f6fb;
}
.auth-panel {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 58px rgba(37, 52, 91, .14);
  overflow: hidden;
}
.auth-brand { background: #fbfcff; }

.toast { border-radius: 7px; background: #29334e; }

@media (min-width: 1440px) {
  .main-content { padding-right: 34px; padding-left: 34px; }
  .topbar { margin-right: -34px; margin-left: -34px; padding-right: 34px; padding-left: 34px; }
  .overview-grid { grid-template-columns: 1.2fr repeat(3, 1fr); }
}

@media (max-width: 960px) {
  .sidebar { width: 72px; padding-right: 8px; padding-left: 8px; }
  .compare-bar { left: 92px; }
  .main-content { padding-right: 20px; padding-left: 20px; }
  .topbar { margin-right: -20px; margin-left: -20px; padding-right: 20px; padding-left: 20px; }
}

@media (max-width: 640px) {
  body { background: var(--canvas); }
  .main-content { padding: 16px 12px 82px; }
  .topbar {
    min-height: 62px;
    margin: -16px -12px 18px;
    padding: 11px 12px;
  }
  .topbar h1 { font-size: 21px; }
  .sidebar {
    width: min(286px, 86vw);
    padding: 18px 12px 14px;
    box-shadow: 18px 0 42px rgba(30, 40, 65, .22);
  }
  .sidebar .brand { padding: 0 44px 19px 10px; }
  .mobile-sidebar-close { top: 17px; color: var(--muted); }
  .mobile-sidebar-close:hover { color: var(--teal-dark); background: var(--teal-soft); }
  .mobile-sidebar-backdrop { background: rgba(30, 40, 65, .42); }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-block { min-height: 108px; }
  .data-summary > div:first-child,
  .paper-summary > div:first-child { border-bottom-color: rgba(255, 255, 255, .14); }
  .research-workspace,
  .workflow-section,
  .access-control-section,
  .data-section { margin-top: 18px; }
}

/* Daily A-share sector fund flow */
.today-market-workspace { margin-top: 24px; }
.today-market-heading-actions { display: flex; align-items: center; gap: 9px; }
.market-index-workspace { margin-bottom: 12px; }
.market-index-section-heading {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}
.market-index-section-heading h3 { margin: 0; color: var(--ink); font-size: 14px; }
.market-index-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.market-index-section-heading > span {
  max-width: 50%;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-index-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.market-index-cards-empty {
  display: flex;
  min-height: 91px;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}
.market-index-cards-empty svg { width: 17px; }
.market-index-card {
  display: grid;
  min-width: 0;
  min-height: 91px;
  align-content: center;
  gap: 5px;
  padding: 12px 13px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.market-index-card:last-child { border-right: 0; }
.market-index-card:hover { background: #f8f9fc; }
.market-index-card.active {
  background: #f3f7f6;
  box-shadow: inset 0 -3px 0 var(--teal);
}
.market-index-card span,
.market-index-card strong,
.market-index-card small,
.market-index-card b { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-index-card span { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.market-index-card strong { font-size: 11px; }
.market-index-card small { color: var(--muted); font-size: 8px; }
.market-index-card b { font-size: 17px; font-variant-numeric: tabular-nums; }
.market-index-card em { font-size: 9px; font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.market-index-chart-panel {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.market-index-chart-heading {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.market-index-active-copy { display: flex; min-width: 0; align-items: center; gap: 24px; }
.market-index-active-copy > span { display: grid; min-width: 0; gap: 4px; }
.market-index-active-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.market-index-active-copy b { font-size: 20px; font-variant-numeric: tabular-nums; }
.market-index-active-copy small { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.market-index-active-copy > span:last-child small { font-size: 10px; font-weight: 800; }
.market-index-range {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 3px;
  border-radius: 6px;
  background: #f1f3f8;
}
.market-index-range button {
  min-width: 52px;
  padding: 0 11px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}
.market-index-range button.active { color: var(--teal-dark); background: #fff; box-shadow: 0 1px 5px rgba(37, 50, 84, .11); }
.market-index-chart-shell {
  position: relative;
  height: 330px;
  min-width: 0;
  overflow: hidden;
  background: #fbfcfe;
}
#market-index-chart { display: block; width: 100%; height: 100%; cursor: crosshair; }
.market-index-chart-tooltip {
  position: absolute;
  z-index: 2;
  width: 164px;
  padding: 8px 10px;
  border: 1px solid #cbd4df;
  border-radius: 5px;
  color: #eef4f2;
  background: rgba(31, 43, 39, .94);
  box-shadow: 0 8px 20px rgba(23, 36, 31, .16);
  font-size: 9px;
  line-height: 1.55;
  pointer-events: none;
}
.market-index-chart-tooltip strong { display: block; margin-bottom: 3px; color: #fff; font-size: 10px; }
.market-index-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.market-index-chart-empty svg { width: 18px; }
.market-index-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}
.market-index-stats > div { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--line); }
.market-index-stats > div:last-child { border-right: 0; }
.market-index-stats dt { color: var(--muted); font-size: 9px; }
.market-index-stats dd {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.fund-flow-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}
.fund-flow-status svg { width: 14px; height: 14px; }
.fund-flow-status.connected { color: #257458; border-color: #cce8dc; background: #f0faf6; }
.fund-flow-status.stale { color: #9a6428; border-color: #f0d9b8; background: #fff8ed; }
.fund-flow-status.failed { color: #a13d4b; border-color: #f0cbd1; background: #fff4f5; }
.fund-flow-status.loading svg,
#refresh-fund-flow.loading svg { animation: fund-flow-spin .8s linear infinite; }
@keyframes fund-flow-spin { to { transform: rotate(360deg); } }

.fund-flow-notice {
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid #f0d9b8;
  border-radius: 6px;
  color: #89591f;
  background: #fff9f0;
  font-size: 11px;
  line-height: 1.55;
}

.fund-flow-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(41, 59, 102, .045);
}
.fund-flow-summary > div { min-width: 0; padding: 15px 17px; border-right: 1px solid var(--line); }
.fund-flow-summary > div:last-child { border-right: 0; }
.fund-flow-summary span,
.fund-flow-summary strong,
.fund-flow-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fund-flow-summary span,
.fund-flow-summary small { color: var(--muted); font-size: 10px; }
.fund-flow-summary strong { margin: 7px 0 5px; color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }

.inflow-text { color: #d9455b !important; }
.outflow-text { color: #15956f !important; }
.flat-text { color: var(--muted) !important; }

.fund-flow-toolbar {
  display: flex;
  min-height: 58px;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(41, 59, 102, .045);
}
.fund-flow-segments { display: inline-flex; min-height: 36px; padding: 3px; border-radius: 6px; background: #f1f3f8; }
.fund-flow-segments button {
  min-width: 88px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}
.fund-flow-segments button.active { color: var(--teal-dark); background: #fff; box-shadow: 0 1px 5px rgba(37, 50, 84, .11); }
.fund-flow-search {
  display: flex;
  min-width: 210px;
  min-height: 37px;
  flex: 1 1 260px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
}
.fund-flow-search svg { width: 15px; color: var(--faint); }
.fund-flow-search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.fund-flow-sort-control select { min-width: 110px; }
.fund-flow-meta { margin-left: auto; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }

.fund-flow-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 12px; margin-top: 12px; align-items: stretch; }
.fund-flow-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 5px 20px rgba(41, 59, 102, .055);
}
.fund-flow-panel-heading { display: flex; min-height: 61px; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.fund-flow-panel-heading h3 { font-size: 14px; }
.fund-flow-panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.fund-flow-panel-heading > span { color: var(--muted); font-size: 10px; }
.fund-flow-legend { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.fund-flow-legend span { display: inline-flex; align-items: center; gap: 4px; }
.fund-flow-legend i { width: 9px; height: 9px; border-radius: 2px; }
.inflow-swatch { background: #d9455b; }
.outflow-swatch { background: #15956f; }

.fund-flow-heatmap {
  display: grid;
  min-height: 520px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: 54px;
  gap: 4px;
  padding: 12px;
  background: #f7f8fc;
}
.fund-flow-heat-cell {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 4px;
  text-align: left;
}
.fund-flow-heat-cell[data-heat-size="xl"] { grid-column: span 4; grid-row: span 3; }
.fund-flow-heat-cell[data-heat-size="lg"] { grid-column: span 3; grid-row: span 2; }
.fund-flow-heat-cell[data-heat-size="md"] { grid-column: span 3; grid-row: span 2; }
.fund-flow-heat-cell[data-heat-size="sm"] { grid-column: span 3; grid-row: span 1; }
.fund-flow-heat-cell.inflow { color: #fff; border-color: rgb(255 255 255 / .28); background: rgb(205 49 75 / var(--heat-alpha)); }
.fund-flow-heat-cell.outflow { color: #fff; border-color: rgb(255 255 255 / .28); background: rgb(10 132 96 / var(--heat-alpha)); }
.fund-flow-heat-cell.flat { color: #fff; border-color: rgb(255 255 255 / .28); background: #758094; }
.fund-flow-heat-cell:hover { filter: saturate(1.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.fund-flow-heat-cell.selected { outline: 2px solid #1d2638; outline-offset: -2px; }
.fund-flow-heat-cell strong {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 11px;
  line-height: 1.24;
  overflow-wrap: anywhere;
}
.fund-flow-heat-values {
  display: flex;
  max-width: 100%;
  align-items: baseline;
  gap: 3px 7px;
  overflow: hidden;
  line-height: 1.1;
  white-space: nowrap;
}
.fund-flow-heat-values b {
  overflow: hidden;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
}
.fund-flow-heat-values small { flex: 0 0 auto; font-size: 9px; font-weight: 800; }
.fund-flow-heat-cell .fund-flow-heat-values small { color: rgb(255 255 255 / .88); }
.fund-flow-heat-cell[data-heat-size="xl"] strong { font-size: 15px; }
.fund-flow-heat-cell[data-heat-size="xl"] .fund-flow-heat-values b { font-size: 13px; }
.fund-flow-heat-cell[data-heat-size="xl"] .fund-flow-heat-values small { font-size: 10px; }
.fund-flow-heat-cell[data-heat-size="lg"] strong { font-size: 12px; }
.fund-flow-heat-cell[data-heat-size="lg"] .fund-flow-heat-values b { font-size: 11px; }
.fund-flow-heat-cell[data-heat-size="sm"] {
  gap: 3px;
  padding: 5px 8px;
}
.fund-flow-heat-cell[data-heat-size="sm"] strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fund-flow-heat-cell[data-heat-size="sm"] .fund-flow-heat-values { gap: 3px 5px; }
.fund-flow-heat-cell[data-heat-size="sm"] .fund-flow-heat-values b { font-size: 9px; }
.fund-flow-heat-cell[data-heat-size="sm"] .fund-flow-heat-values small { font-size: 8px; }

.fund-flow-focus { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.fund-flow-focus-title { display: flex; min-height: 57px; align-items: center; justify-content: space-between; gap: 12px; }
.fund-flow-focus-title span,
.fund-flow-focus-title strong,
.fund-flow-focus-title small { display: block; min-width: 0; }
.fund-flow-focus-title strong { font-size: 13px; }
.fund-flow-focus-title small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.fund-flow-focus-title b { font-size: 13px; font-variant-numeric: tabular-nums; }
.fund-flow-focus dl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.fund-flow-focus dl > div { min-width: 0; padding: 9px 10px; border-right: 1px solid var(--line); }
.fund-flow-focus dl > div:last-child { border-right: 0; }
.fund-flow-focus dt { color: var(--muted); font-size: 9px; }
.fund-flow-focus dd { margin: 5px 0 2px; overflow: hidden; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.fund-flow-focus dl small { color: var(--muted); font-size: 8px; }

.fund-flow-ranking-groups { display: grid; gap: 12px; padding: 12px 14px 15px; }
.fund-flow-ranking-title { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.fund-flow-ranking-title h4 { margin: 0; color: var(--ink); font-size: 11px; }
.fund-flow-ranking-title span { width: 3px; height: 13px; border-radius: 2px; }
.inflow-rank-mark { background: #d9455b; }
.outflow-rank-mark { background: #15956f; }
.fund-flow-ranking-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.fund-flow-ranking-list button { display: grid; width: 100%; min-height: 32px; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 3px 2px; border: 0; border-radius: 4px; color: var(--ink); background: transparent; text-align: left; }
.fund-flow-ranking-list button:hover { background: #f7f8fc; }
.fund-flow-rank-index { color: var(--faint); font-size: 9px; text-align: center; }
.fund-flow-rank-copy { display: grid; min-width: 0; gap: 4px; }
.fund-flow-rank-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.fund-flow-rank-copy i { display: block; width: 100%; height: 3px; overflow: hidden; border-radius: 2px; background: #eef0f5; }
.fund-flow-rank-copy i b { display: block; height: 100%; border-radius: inherit; background: currentColor; }
.fund-flow-ranking-list li > button > span:last-child { font-size: 9px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fund-flow-ranking-groups section:first-child .fund-flow-rank-copy i { color: #d9455b; }
.fund-flow-ranking-groups section:last-child .fund-flow-rank-copy i { color: #15956f; }

.fund-flow-table-panel { margin-top: 12px; }
.fund-flow-table-wrap { position: relative; min-width: 0; max-height: 620px; overflow: auto; }
.fund-flow-table { width: 100%; min-width: 1020px; border-collapse: collapse; }
.fund-flow-table th,
.fund-flow-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: #4d5870; font-size: 10px; text-align: right; vertical-align: middle; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fund-flow-table th:first-child,
.fund-flow-table td:first-child { text-align: left; }
.fund-flow-table thead th { color: #79849a; background: #f7f8fc; font-size: 9px; font-weight: 700; }
.fund-flow-table thead { position: sticky; z-index: 2; top: 0; }
.fund-flow-table tbody tr:hover { background: #fafbff; }
.fund-flow-table tbody tr.selected { background: #f3f6ff; box-shadow: inset 3px 0 0 var(--teal); }
.fund-flow-table tbody tr:last-child td { border-bottom: 0; }
.fund-flow-name-button { display: grid; gap: 3px; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; }
.fund-flow-name-button strong { font-size: 10px; }
.fund-flow-name-button small { color: var(--muted); font-size: 8px; }
.fund-flow-empty { display: flex; min-height: 160px; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 11px; }
.fund-flow-empty svg { width: 17px; }

@media (max-width: 1120px) {
  .market-index-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .market-index-card:nth-child(3n) { border-right: 0; }
  .market-index-card:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .fund-flow-dashboard-grid { grid-template-columns: 1fr; }
  .fund-flow-ranking-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
}

@media (max-width: 760px) {
  .market-index-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-index-card { min-height: 82px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .market-index-card:nth-child(2n) { border-right: 0; }
  .market-index-card:nth-last-child(-n+2) { border-bottom: 0; }
  .market-index-chart-shell { height: 300px; }
  .market-index-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .market-index-stats > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .market-index-stats > div:nth-child(3n) { border-right: 0; }
  .market-index-stats > div:nth-last-child(-n+3) { border-bottom: 0; }
  .fund-flow-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fund-flow-summary > div:nth-child(2) { border-right: 0; }
  .fund-flow-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .fund-flow-toolbar { align-items: stretch; }
  .fund-flow-segments { flex: 1 1 100%; }
  .fund-flow-segments button { flex: 1; }
  .fund-flow-search { flex-basis: calc(100% - 150px); min-width: 170px; }
  .fund-flow-meta { flex: 1 1 100%; margin-left: 0; }
  .fund-flow-heatmap { min-height: 500px; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 54px; }
  .fund-flow-heat-cell[data-heat-size="xl"] { grid-column: span 3; grid-row: span 2; }
  .fund-flow-heat-cell[data-heat-size="lg"] { grid-column: span 3; grid-row: span 2; }
  .fund-flow-heat-cell[data-heat-size="md"] { grid-column: span 3; grid-row: span 2; }
  .fund-flow-heat-cell[data-heat-size="sm"] { grid-column: span 3; grid-row: span 1; }
  .fund-flow-heat-cell:nth-child(n+25) { display: none; }
  .fund-flow-focus dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fund-flow-focus dl > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .fund-flow-focus dl > div:nth-child(2n) { border-right: 0; }
  .fund-flow-focus dl > div:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
  .fund-flow-ranking-groups { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 640px) {
  .today-market-workspace { margin-top: 18px; }
  .today-market-heading { align-items: center; }
  .market-index-section-heading > span { max-width: 42%; }
  .market-index-card { min-height: 78px; padding: 10px 11px; }
  .market-index-card b { font-size: 15px; }
  .market-index-chart-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .market-index-active-copy { width: 100%; justify-content: space-between; gap: 14px; }
  .market-index-active-copy > span:last-child { text-align: right; }
  .market-index-range { width: 100%; }
  .market-index-range button { flex: 1; min-width: 0; }
  .market-index-chart-shell { height: 270px; }
  .market-index-chart-tooltip { width: 146px; }
  .market-index-stats > div { padding: 9px 10px; }
  .fund-flow-status { max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fund-flow-summary > div { padding: 12px 13px; }
  .fund-flow-summary strong { font-size: 15px; }
  .fund-flow-sort-control { flex: 1 1 118px; }
  .fund-flow-sort-control select { width: 100%; min-width: 0; }
  .fund-flow-panel-heading { min-height: 56px; padding: 11px 12px; }
  .fund-flow-legend { gap: 6px; }
  .fund-flow-heatmap { padding: 8px; gap: 3px; }
  .fund-flow-heat-cell { padding: 6px; }
  .fund-flow-heat-cell strong { font-size: 10px; }
  .fund-flow-heat-cell[data-heat-size="xl"] strong { font-size: 13px; }
  .fund-flow-heat-cell[data-heat-size="sm"] { padding: 5px 6px; }
  .fund-flow-focus { padding: 0 11px 12px; }
  .fund-flow-table th,
  .fund-flow-table td { padding: 10px 9px; }
}

/* Product price snapshots */
.product-price-workspace { margin-top: 24px; }
.product-price-heading { align-items: flex-end; }
.product-price-heading-actions { display: flex; align-items: center; gap: 9px; }
.product-price-load-state {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 5px;
  color: var(--muted);
  background: #edf0f5;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.product-price-load-state.loading { color: #166d81; background: #e2f2f5; }
.product-price-load-state.ready { color: var(--positive); background: #e6f5ee; }
.product-price-load-state.failed { color: var(--negative); background: #fae9eb; }
.product-price-refresh-button { min-height: 34px; padding: 0 11px; font-size: 11px; }
.product-price-refresh-button svg { width: 14px; height: 14px; }
.product-price-refresh-button.loading svg { animation: product-price-spin .9s linear infinite; }
@keyframes product-price-spin { to { transform: rotate(360deg); } }
.product-price-notice {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #f0cbd1;
  border-radius: 6px;
  color: #973d49;
  background: #fff1f3;
  font-size: 11px;
  line-height: 1.5;
}

.product-price-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 17px 0 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(41, 59, 102, .045);
}
.product-price-summary > div { min-width: 0; padding: 14px 17px; border-right: 1px solid var(--line); }
.product-price-summary > div:last-child { border-right: 0; }
.product-price-summary span,
.product-price-summary strong,
.product-price-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-price-summary span,
.product-price-summary small { color: var(--muted); font-size: 10px; }
.product-price-summary strong { margin: 7px 0 5px; color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }

.product-price-toolbar {
  display: flex;
  min-height: 58px;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(41, 59, 102, .045);
}
.product-price-search {
  display: flex;
  min-width: 240px;
  min-height: 37px;
  flex: 1 1 340px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
}
.product-price-search svg { width: 15px; color: var(--faint); }
.product-price-search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.product-price-category-control select { min-width: 120px; }
.product-price-filter-meta { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }

.product-price-grid {
  display: grid;
  grid-template-columns: minmax(270px, .42fr) minmax(0, 1.3fr);
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}
.product-price-list-panel,
.product-price-chart-panel,
.product-price-history-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 5px 20px rgba(41, 59, 102, .055);
}
.product-price-panel-heading,
.product-price-detail-heading {
  display: flex;
  min-height: 61px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.product-price-panel-heading h3,
.product-price-detail-heading h3 { font-size: 14px; }
.product-price-panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.product-price-panel-heading > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.product-price-list { max-height: 478px; overflow-y: auto; }
.product-price-list-item {
  display: grid;
  width: 100%;
  min-height: 91px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 12px;
  padding: 12px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}
.product-price-list-item:last-child { border-bottom: 0; }
.product-price-list-item:hover { background: #fafbff; }
.product-price-list-item.selected { background: #f3f6ff; box-shadow: inset 3px 0 0 var(--teal); }
.product-price-list-copy,
.product-price-list-value { min-width: 0; }
.product-price-list-copy strong,
.product-price-list-copy small,
.product-price-list-value strong,
.product-price-list-value small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-price-list-copy strong { font-size: 11px; line-height: 1.35; }
.product-price-list-copy small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.product-price-list-value { text-align: right; }
.product-price-list-value strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.product-price-list-value small { margin-top: 5px; font-size: 9px; font-weight: 700; }
.product-price-list-meta { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); }
.product-price-list-meta b { padding: 3px 6px; border-radius: 4px; color: var(--teal-dark); background: var(--teal-soft); font-size: 8px; }
.product-price-list-meta small { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.product-price-active-copy { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; }
.product-price-active-copy > span { min-width: 0; }
.product-price-active-copy strong,
.product-price-active-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-price-active-copy strong { font-size: 13px; }
.product-price-active-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.product-price-source-link { display: inline-grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
.product-price-source-link:hover { color: var(--teal-dark); background: var(--teal-soft); }
.product-price-source-link svg { width: 14px; height: 14px; }
.product-price-availability,
.product-price-table-state {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 0 7px;
  border-radius: 5px;
  color: var(--muted);
  background: #edf0f5;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.product-price-availability.available,
.product-price-table-state.available { color: var(--positive); background: #e6f5ee; }
.product-price-availability.unavailable,
.product-price-table-state.unavailable { color: #7a6470; background: #f1edf0; }
.product-price-detail-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.product-price-detail-stats > div { min-width: 0; padding: 11px 13px; border-right: 1px solid var(--line); }
.product-price-detail-stats > div:last-child { border-right: 0; }
.product-price-detail-stats span,
.product-price-detail-stats strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-price-detail-stats span { color: var(--muted); font-size: 9px; }
.product-price-detail-stats strong { margin-top: 5px; font-size: 12px; font-variant-numeric: tabular-nums; }
.price-higher { color: #d9455b !important; }
.price-lower { color: #15956f !important; }

.product-price-chart-shell { position: relative; height: 355px; padding: 10px 12px 4px; }
.product-price-chart-shell canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.product-price-chart-tooltip {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 170px;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #cad2e5;
  border-radius: 6px;
  color: #eef2ff;
  background: rgba(35, 45, 68, .96);
  box-shadow: 0 8px 22px rgba(29, 38, 58, .18);
  font-size: 10px;
  pointer-events: none;
}
.product-price-chart-tooltip strong { font-size: 10px; }
.product-price-chart-tooltip span { color: #cbd4e8; }
.product-price-chart-empty,
.product-price-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.product-price-chart-empty { position: absolute; inset: 10px 12px 4px; border: 1px dashed var(--line-strong); background: rgba(251, 252, 255, .94); }
.product-price-empty { min-height: 190px; padding: 22px 14px; text-align: center; }
.product-price-empty.compact { position: absolute; inset: 0; min-height: 100px; background: rgba(251, 252, 255, .95); }
.product-price-chart-empty svg,
.product-price-empty svg { width: 22px; color: var(--teal); }

.product-price-history-panel { margin-top: 12px; }
.product-price-history-wrap { position: relative; min-height: 110px; max-height: 420px; overflow: auto; }
.product-price-history-table { width: 100%; min-width: 650px; border-collapse: collapse; }
.product-price-history-table th,
.product-price-history-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: #4d5870; font-size: 10px; text-align: left; vertical-align: middle; white-space: nowrap; font-variant-numeric: tabular-nums; }
.product-price-history-table thead { position: sticky; z-index: 2; top: 0; }
.product-price-history-table thead th { color: #79849a; background: #f7f8fc; font-size: 9px; font-weight: 700; }
.product-price-history-table tbody tr:last-child td { border-bottom: 0; }
.product-price-history-table tbody tr:hover { background: #fafbff; }

@media (max-width: 980px) {
  .product-price-grid { grid-template-columns: minmax(250px, .52fr) minmax(0, 1fr); }
  .product-price-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-price-detail-stats > div:nth-child(2) { border-right: 0; }
  .product-price-detail-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .product-price-grid { grid-template-columns: 1fr; }
  .product-price-list { max-height: 320px; }
  .product-price-chart-shell { height: 320px; }
}

@media (max-width: 640px) {
  .product-price-workspace { margin-top: 18px; }
  .product-price-heading-actions { gap: 6px; }
  .product-price-refresh-button { width: 36px; min-width: 36px; padding: 0; font-size: 0 !important; }
  .product-price-refresh-button span { display: none; }
  .product-price-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-price-summary > div { padding: 12px 13px; }
  .product-price-summary > div:nth-child(2) { border-right: 0; }
  .product-price-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .product-price-search { min-width: 100%; flex-basis: 100%; }
  .product-price-category-control { flex: 1 1 150px; }
  .product-price-category-control select { width: 100%; min-width: 0; }
  .product-price-filter-meta { flex: 1 1 100%; margin-left: 0; }
  .product-price-panel-heading,
  .product-price-detail-heading { min-height: 56px; padding: 11px 12px; }
  .product-price-list-item { min-height: 88px; padding: 11px 12px; }
  .product-price-detail-stats > div { padding: 10px 11px; }
  .product-price-chart-shell { height: 286px; padding-right: 7px; padding-left: 7px; }
  .product-price-chart-empty { right: 7px; left: 7px; }
  .product-price-chart-tooltip { width: 158px; }
  .product-price-history-table th,
  .product-price-history-table td { padding: 10px 11px; }
}

.agent-research-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.agent-research-history-panel {
  grid-column: 1 / -1;
}

.agent-research-create-panel,
.agent-research-runtime-panel,
.agent-research-history-panel {
  min-width: 0;
}

.agent-research-create-panel .workflow-empty,
.agent-research-runtime-panel .workflow-empty,
.agent-research-history-panel .workflow-empty {
  min-height: 120px;
}

@media (max-width: 900px) {
  .agent-research-layout {
    grid-template-columns: 1fr;
  }

  .agent-research-history-panel {
    grid-column: auto;
  }
}

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

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

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

.agent-research-analyst-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.agent-research-form-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .agent-research-form-grid,
  .agent-research-analysts {
    grid-template-columns: 1fr;
  }
}

.agent-research-job-summary {
  display: grid;
  gap: 4px;
}

.agent-research-history-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.agent-research-history-item small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.agent-research-current {
  display: grid;
  gap: 12px;
}

.agent-research-current-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-research-current-heading div {
  display: grid;
  gap: 3px;
}

.agent-research-current-heading small {
  color: var(--muted);
}

.agent-research-events {
  display: grid;
  gap: 8px;
}

.agent-research-event {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-left: 3px solid var(--teal);
  background: var(--surface-muted);
}

.agent-research-event small {
  color: var(--muted);
}

.agent-research-detail-panel {
  grid-column: 1 / -1;
}

.agent-research-tabs {
  margin-bottom: 12px;
}

.agent-research-detail-content {
  min-height: 160px;
}

.agent-research-report-block {
  display: grid;
  gap: 10px;
}

.agent-research-report-block pre {
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .agent-research-detail-panel {
    grid-column: auto;
  }
}

.agent-research-event pre,
.agent-research-report-block pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.agent-research-history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.agent-research-history-item span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.agent-research-history-item em {
  align-self: center;
  font-style: normal;
  color: var(--primary);
  white-space: nowrap;
}

.agent-research-history-item.active {
  border-color: var(--primary);
  background: rgba(64, 99, 235, 0.08);
}

.agent-research-summary,
.agent-research-panel-card {
  display: grid;
  gap: 12px;
}

.agent-research-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(70, 90, 160, 0.12);
}

.agent-research-summary-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.agent-research-metric {
  padding: 12px;
  border: 1px solid rgba(70, 90, 160, 0.12);
  border-radius: 10px;
  background: rgba(248, 250, 255, 0.85);
}

.agent-research-metric span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 4px;
}

.agent-research-metric strong {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.agent-research-panel-card {
  padding: 14px;
  border: 1px solid rgba(70, 90, 160, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.agent-research-panel-card h4 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

.agent-research-json {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
  background: rgba(247, 248, 252, 0.88);
  border: 1px solid rgba(70, 90, 160, 0.10);
  border-radius: 8px;
  padding: 12px;
}

.agent-research-event {
  padding: 12px 14px;
  border-left: 3px solid var(--primary);
  background: rgba(248, 250, 255, 0.9);
  border-radius: 8px;
}

.agent-research-event pre {
  margin: 8px 0 0;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
}

.agent-research-history-item {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.86);
}

.agent-research-history-item.active {
  border-color: rgba(64, 99, 235, 0.4);
  background: rgba(64, 99, 235, 0.08);
}

.agent-research-heading {
  align-items: center;
  margin-bottom: 12px;
}

.agent-research-heading h2 {
  margin-bottom: 2px;
}

.agent-research-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.agent-research-summary-strip > div {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.agent-research-summary-strip > div:last-child {
  border-right: 0;
}

.agent-research-summary-strip span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.agent-research-summary-strip strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.agent-research-summary-strip small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.agent-research-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.94fr) minmax(420px, 1.06fr);
  gap: 14px;
}

.agent-research-create-panel,
.agent-research-runtime-panel,
.agent-research-detail-panel,
.agent-research-history-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}

.agent-research-create-panel .panel-heading,
.agent-research-runtime-panel .panel-heading,
.agent-research-detail-panel .panel-heading,
.agent-research-history-panel .panel-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.agent-research-form {
  padding-top: 12px;
}

.agent-research-analysts {
  gap: 10px;
}

.agent-research-analyst-option {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.agent-research-runtime {
  min-height: 280px;
}

.agent-research-events {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.agent-research-event {
  position: relative;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 8px;
  background: var(--surface-soft);
}

.agent-research-event::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary);
}

.agent-research-event strong,
.agent-research-event small,
.agent-research-event pre {
  margin-left: 16px;
}

.agent-research-event pre {
  margin-top: 8px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
}

.agent-research-summary,
.agent-research-panel-card {
  display: grid;
  gap: 12px;
}

.agent-research-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.agent-research-summary-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.agent-research-metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.agent-research-metric span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.agent-research-metric strong {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.agent-research-panel-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.agent-research-panel-card h4 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.agent-research-json {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
}

.agent-research-history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}

.agent-research-history-item span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.agent-research-history-item em {
  align-self: center;
  color: var(--primary);
  font-style: normal;
  white-space: nowrap;
}

.agent-research-history-item.active {
  border-color: rgba(64, 99, 235, 0.35);
  background: rgba(64, 99, 235, 0.08);
}

@media (max-width: 900px) {
  .agent-research-summary-strip {
    grid-template-columns: 1fr;
  }

  .agent-research-layout {
    grid-template-columns: 1fr;
  }
}

.agent-research-create-panel,
.agent-research-runtime-panel {
  align-self: start;
}

.agent-research-create-panel .panel-heading,
.agent-research-runtime-panel .panel-heading {
  padding-bottom: 8px;
}

.agent-research-form-grid {
  gap: 10px 12px;
}

.agent-research-analysts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.agent-research-analyst-option {
  min-height: 30px;
  padding: 6px 9px;
}

.agent-research-form-actions {
  margin-top: 10px;
}

.agent-research-runtime {
  min-height: 240px;
}

.agent-research-events {
  max-height: 300px;
}

.agent-research-event {
  padding: 10px 12px;
}

.agent-research-event pre {
  max-height: 110px;
  font-size: 11px;
}

.agent-research-detail-panel {
  margin-top: 0;
}

.agent-research-detail-content {
  min-height: 220px;
}

.agent-research-json {
  max-height: 220px;
}

.agent-research-detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.agent-research-detail-actions .button {
  min-height: 34px;
  padding: 0 12px;
  gap: 6px;
}

.agent-research-detail-actions .button i {
  width: 16px;
  height: 16px;
}

/* Agent research workspace: task configuration, live execution and report review. */
#agent-research {
  min-width: 0;
  margin-top: 18px;
}

.agent-research-heading {
  gap: 24px;
  min-width: 0;
  margin-bottom: 16px;
}

.agent-research-heading > div:first-child {
  min-width: 0;
}

.agent-research-heading > div:first-child > p:last-child {
  max-width: 760px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.agent-research-new-button {
  flex: 0 0 auto;
  min-width: 124px;
}

.agent-research-summary-strip {
  min-width: 0;
}

.agent-research-summary-strip > div {
  position: relative;
  min-width: 0;
  padding: 14px 16px 13px 47px;
}

.agent-research-summary-strip > div > svg {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.agent-research-summary-strip strong {
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-research-layout {
  grid-template-columns: minmax(340px, 0.92fr) minmax(380px, 1.08fr);
  gap: 14px;
  min-width: 0;
}

.agent-research-create-panel,
.agent-research-runtime-panel,
.agent-research-detail-panel,
.agent-research-history-panel {
  overflow: hidden;
}

.agent-research-panel-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.agent-research-panel-title > span {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(64, 99, 235, 0.24);
  border-radius: 6px;
  background: rgba(64, 99, 235, 0.08);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}

.agent-research-panel-title > div {
  min-width: 0;
}

.agent-research-capability-badge,
.agent-research-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.agent-research-status-pill::before,
.agent-research-history-item em::before {
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #94a3b8;
  content: "";
}

.agent-research-status-pill[data-status="queued"]::before,
.agent-research-history-item em[data-status="queued"]::before { background: #d99713; }
.agent-research-status-pill[data-status="running"]::before,
.agent-research-history-item em[data-status="running"]::before { background: #3b82f6; }
.agent-research-status-pill[data-status="completed"]::before,
.agent-research-history-item em[data-status="completed"]::before { background: #12a67d; }
.agent-research-status-pill[data-status="failed"]::before,
.agent-research-history-item em[data-status="failed"]::before { background: #dc4c4c; }
.agent-research-status-pill[data-status="cancelled"]::before,
.agent-research-history-item em[data-status="cancelled"]::before { background: #64748b; }

.agent-research-form {
  gap: 16px;
  padding: 15px 16px 16px;
}

.agent-research-form-grid {
  gap: 13px 12px;
}

.agent-research-form .create-user-field {
  min-width: 0;
}

.agent-research-form .create-user-field > span {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
}

.agent-research-form .create-user-field input,
.agent-research-form .create-user-field select {
  min-width: 0;
  height: 42px;
  background: #fff;
  font-size: 13px;
}

.agent-research-form .create-user-field > small {
  display: block;
  min-height: 15px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.agent-research-team {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.agent-research-team legend {
  padding: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.agent-research-team > p {
  margin: 4px 0 9px;
  color: var(--muted);
  font-size: 9px;
}

.agent-research-analyst-option {
  position: relative;
  align-items: flex-start;
  min-width: 0;
  min-height: 54px;
  padding: 9px 10px;
  cursor: pointer;
}

.agent-research-analyst-option:has(input:checked) {
  border-color: rgba(64, 99, 235, 0.34);
  background: rgba(64, 99, 235, 0.06);
}

.agent-research-analyst-option input {
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--primary);
}

.agent-research-analyst-option > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.agent-research-analyst-option strong {
  font-size: 11px;
  line-height: 1.3;
}

.agent-research-analyst-option small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-research-analyst-option em {
  position: absolute;
  top: 8px;
  right: 9px;
  color: var(--primary);
  font-size: 9px;
  font-style: normal;
}

.agent-research-form-actions {
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.agent-research-form-actions > span {
  color: var(--muted);
  font-size: 10px;
}

.agent-research-form-actions .button {
  min-width: 116px;
}

.agent-research-runtime {
  display: grid;
  min-height: 363px;
  padding: 16px;
}

.agent-research-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 180px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.agent-research-empty.compact {
  min-height: 150px;
}

.agent-research-empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: #8b9bb5;
}

.agent-research-empty strong {
  color: var(--ink);
  font-size: 12px;
}

.agent-research-empty p {
  max-width: 360px;
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.65;
}

.agent-research-current-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.agent-research-current-heading > div > strong {
  font-size: 17px;
}

.agent-research-events {
  max-height: 298px;
  gap: 9px;
}

.agent-research-event {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  padding: 10px 11px;
  border-left: 1px solid var(--line);
}

.agent-research-event::before {
  display: none;
}

.agent-research-event-index {
  display: grid;
  grid-row: 1 / span 2;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: rgba(64, 99, 235, 0.09);
  color: var(--primary);
  font-size: 9px;
  font-weight: 700;
}

.agent-research-event strong,
.agent-research-event small,
.agent-research-event pre {
  margin-left: 0;
}

.agent-research-event strong {
  font-size: 11px;
}

.agent-research-event small {
  justify-self: end;
  font-size: 9px;
}

.agent-research-event pre {
  grid-column: 2 / -1;
  margin: 6px 0 0;
}

.agent-research-detail-panel,
.agent-research-history-panel {
  min-width: 0;
}

.agent-research-detail-panel {
  grid-column: 1 / -1;
}

.agent-research-history-panel {
  grid-column: 1 / -1;
}

.agent-research-tabs {
  gap: 2px;
  margin: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.agent-research-tabs button {
  min-height: 42px;
  padding: 0 13px;
}

.agent-research-detail-content {
  min-width: 0;
  min-height: 250px;
  padding: 16px;
}

.agent-research-summary-head > span:first-child {
  display: grid;
  gap: 3px;
}

.agent-research-summary-head > span:first-child small {
  color: var(--muted);
  font-size: 9px;
}

.agent-research-summary-head strong {
  width: max-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.10);
  font-size: 13px;
}

.agent-research-summary-head strong[data-action="buy"] { background: rgba(220, 76, 76, 0.10); color: #c43d3d; }
.agent-research-summary-head strong[data-action="sell"] { background: rgba(18, 166, 125, 0.10); color: #078361; }
.agent-research-summary-head strong[data-action="hold"] { background: rgba(217, 151, 19, 0.11); color: #a76c00; }

.agent-research-thesis p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.agent-research-engine-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(217, 151, 19, 0.32);
  border-radius: 8px;
  background: rgba(255, 248, 228, 0.76);
  color: #7e5700;
}

.agent-research-engine-warning svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.agent-research-engine-warning strong {
  font-size: 11px;
}

.agent-research-engine-warning p {
  margin: 3px 0 0;
  font-size: 10px;
  line-height: 1.55;
}

.agent-research-failure {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(196, 61, 61, 0.3);
  border-radius: 8px;
  background: rgba(254, 242, 242, 0.84);
  color: #9d2525;
}

.agent-research-failure > svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin-top: 1px;
}

.agent-research-failure > div {
  min-width: 0;
}

.agent-research-failure strong {
  color: #9d2525;
  font-size: 12px;
}

.agent-research-failure p {
  margin: 4px 0;
  color: #6f3030;
  font-size: 11px;
  line-height: 1.6;
}

.agent-research-failure small {
  display: block;
  color: #8d4949;
  font-size: 10px;
  line-height: 1.55;
}

.agent-research-failure details {
  margin-top: 9px;
}

.agent-research-failure summary {
  width: max-content;
  color: #a33a3a;
  cursor: pointer;
  font-size: 10px;
}

.agent-research-failure pre {
  max-height: 180px;
  margin: 7px 0 0;
  overflow: auto;
  padding: 9px 10px;
  border: 1px solid rgba(196, 61, 61, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: #703232;
  font-size: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.agent-research-detail-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.agent-research-history-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px 16px;
}

.agent-research-history-list > .agent-research-empty {
  grid-column: 1 / -1;
}

.agent-research-history-item {
  min-width: 0;
  min-height: 66px;
  border-color: var(--line);
  background: var(--surface-soft);
  cursor: pointer;
}

.agent-research-history-item:hover {
  border-color: rgba(64, 99, 235, 0.32);
}

.agent-research-history-item em {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1120px) {
  .agent-research-layout {
    grid-template-columns: 1fr;
  }

  .agent-research-detail-panel,
  .agent-research-history-panel {
    grid-column: auto;
  }

  .agent-research-runtime {
    min-height: 280px;
  }
}

@media (max-width: 760px) {
  .agent-research-heading {
    align-items: flex-start;
  }

  .agent-research-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-research-summary-strip > div:nth-child(2) {
    border-right: 0;
  }

  .agent-research-summary-strip > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .agent-research-form-grid,
  .agent-research-analysts,
  .agent-research-history-list {
    grid-template-columns: 1fr;
  }

  .agent-research-form .create-user-field > small {
    min-height: 0;
  }

  .agent-research-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #agent-research {
    margin-top: 10px;
  }

  .agent-research-heading {
    gap: 12px;
  }

  .agent-research-heading > div:first-child > p:last-child {
    font-size: 11px;
  }

  #agent-research .agent-research-new-button {
    display: none;
  }

  .agent-research-summary-strip > div {
    padding: 12px 10px 11px 40px;
  }

  .agent-research-summary-strip > div > svg {
    top: 14px;
    left: 12px;
    width: 16px;
    height: 16px;
  }

  .agent-research-summary-strip strong {
    font-size: 16px;
  }

  .agent-research-create-panel .panel-heading,
  .agent-research-runtime-panel .panel-heading,
  .agent-research-detail-panel .panel-heading,
  .agent-research-history-panel .panel-heading {
    align-items: center;
    padding: 11px 12px;
  }

  .agent-research-panel-title > span {
    flex-basis: 25px;
    width: 25px;
    height: 25px;
  }

  .agent-research-panel-title p,
  .agent-research-capability-badge {
    display: none;
  }

  .agent-research-form,
  .agent-research-runtime,
  .agent-research-detail-content,
  .agent-research-history-list {
    padding-right: 12px;
    padding-left: 12px;
  }

  .agent-research-form-actions .button {
    min-width: 42px;
  }

  .agent-research-form-actions .button span {
    display: inline;
    font-size: 11px;
  }

  .agent-research-current-heading {
    align-items: flex-start;
  }

  .agent-research-current-heading .button {
    min-width: 36px;
    padding: 0 9px;
    font-size: 0;
  }

  .agent-research-current-heading .button svg {
    margin: 0;
  }

  .agent-research-detail-actions .button {
    width: 34px;
    min-width: 34px;
    padding: 0;
    font-size: 0;
  }

  .agent-research-detail-actions .button svg {
    margin: 0;
  }

  .agent-research-tabs {
    overflow-x: auto;
    padding: 0 10px;
  }

  .agent-research-tabs button {
    flex: 0 0 auto;
    padding: 0 11px;
  }
}

/* Cloud model profiles for the intelligent research workspace. */
.agent-research-heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.agent-model-modal {
  width: min(1040px, 100%);
  max-height: min(760px, 94vh);
  overflow: hidden;
}

.agent-model-modal-header {
  min-height: 82px;
}

.agent-model-modal-header > div {
  min-width: 0;
}

.agent-model-modal-header h2 {
  font-size: 18px;
}

.agent-model-modal-header p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.agent-model-workspace {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 540px;
}

.agent-model-list-pane {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.agent-model-list-heading {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px 11px 17px;
  border-bottom: 1px solid var(--line);
}

.agent-model-list-heading strong,
.agent-model-list-heading small {
  display: block;
}

.agent-model-list-heading strong {
  color: var(--ink);
  font-size: 12px;
}

.agent-model-list-heading small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.agent-model-profile-list {
  max-height: 478px;
  overflow-y: auto;
}

.agent-model-profile-item {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 13px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.agent-model-profile-item:hover {
  background: #f1f4fb;
}

.agent-model-profile-item.active {
  background: #fff;
  box-shadow: inset 3px 0 0 var(--teal);
}

.agent-model-provider-mark {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid #d7def3;
  color: var(--teal-dark);
  background: #f3f6ff;
}

.agent-model-provider-mark svg {
  width: 15px;
  height: 15px;
}

.agent-model-profile-item > span:nth-child(2) {
  min-width: 0;
}

.agent-model-profile-item strong,
.agent-model-profile-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-model-profile-item strong {
  font-size: 11px;
}

.agent-model-profile-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.agent-model-profile-item em {
  min-width: 32px;
  padding: 3px 5px;
  color: var(--positive);
  background: #eaf7f2;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

.agent-model-profile-item em[data-state="disabled"] {
  color: var(--muted);
  background: #eceff4;
}

.agent-model-list-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.agent-model-list-empty svg { width: 24px; }
.agent-model-list-empty strong { color: var(--ink); font-size: 11px; }
.agent-model-list-empty small { font-size: 9px; }

.agent-model-editor-pane {
  min-width: 0;
  overflow-y: auto;
}

.agent-model-editor-pane form {
  padding: 17px 20px 20px;
}

.agent-model-editor-heading {
  display: flex;
  min-height: 45px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.agent-model-editor-heading span,
.agent-model-editor-heading strong {
  display: block;
}

.agent-model-editor-heading > div > span {
  color: var(--muted);
  font-size: 9px;
}

.agent-model-editor-heading > div > strong {
  margin-top: 4px;
  font-size: 14px;
}

.agent-model-key-state {
  display: inline-flex !important;
  min-height: 26px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: var(--negative);
  background: #fcedef;
  font-size: 9px;
  font-weight: 700;
}

.agent-model-key-state[data-state="saved"] {
  color: var(--positive);
  background: #eaf7f2;
}

.agent-model-key-state svg { width: 13px; height: 13px; }

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

.agent-model-wide { grid-column: 1 / -1; }

.agent-model-secret-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
}

.agent-model-secret-field input {
  min-width: 0;
  border-right: 0;
}

.agent-model-secret-field .icon-button {
  width: 38px;
  height: 38px;
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.agent-model-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 15px;
}

.agent-model-toggle {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.agent-model-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.agent-model-toggle > span {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 18px;
  background: #cbd3df;
}

.agent-model-toggle > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  content: "";
  background: #fff;
  transition: transform .16s ease;
}

.agent-model-toggle > input:checked + span { background: var(--teal); }
.agent-model-toggle > input:checked + span::after { transform: translateX(14px); }
.agent-model-toggle > input:focus-visible + span { box-shadow: 0 0 0 3px rgba(65, 103, 239, .14); }
.agent-model-toggle strong, .agent-model-toggle small { display: block; }
.agent-model-toggle strong { font-size: 10px; }
.agent-model-toggle small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; }

.agent-model-test-result {
  margin-top: 14px;
  padding: 9px 10px;
  color: var(--positive);
  background: #eaf7f2;
  font-size: 10px;
}

.agent-model-test-result[data-state="loading"] {
  color: #8b6813;
  background: #fff6db;
}

.agent-model-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 17px 0 0;
  border-top: 1px solid var(--line);
  margin-top: 17px;
}

.agent-model-delete {
  color: var(--negative) !important;
}

@media (max-width: 760px) {
  #agent-model-modal-backdrop { padding: 8px; }
  .agent-model-modal { max-height: 96vh; overflow-y: auto; }
  .agent-model-workspace { display: block; min-height: 0; }
  .agent-model-list-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .agent-model-profile-list { display: flex; max-height: none; overflow-x: auto; }
  .agent-model-profile-item { flex: 0 0 min(260px, 78vw); border-right: 1px solid var(--line); border-bottom: 0; }
  .agent-model-form-grid, .agent-model-options { grid-template-columns: 1fr; }
  .agent-model-wide { grid-column: auto; }
  .agent-model-editor-pane form { padding: 14px; }
  .agent-model-actions { grid-template-columns: 1fr 1fr; }
  .agent-model-actions > span { display: none; }
  .agent-model-actions .button { width: 100%; }
  .agent-research-heading-actions { align-self: stretch; }
  .agent-research-heading-actions .button { flex: 1; min-width: 0; }
}

/* Intelligent research v2 follows the same compact workspace language as data and strategy pages. */
.agent-research-workbench {
  grid-template-columns: minmax(330px, 0.72fr) minmax(0, 1.48fr);
  align-items: start;
  gap: 14px;
}

.agent-research-control-column,
.agent-research-output-column {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.agent-research-workbench .agent-research-detail-panel,
.agent-research-workbench .agent-research-history-panel {
  grid-column: auto;
}

.agent-research-workbench .panel-heading {
  min-height: 61px;
  padding: 12px 14px;
}

.agent-research-panel-title > svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.agent-research-panel-title h3 {
  font-size: 13px;
  line-height: 1.35;
}

.agent-research-panel-title p {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.45;
}

.agent-research-workbench .agent-research-form {
  gap: 13px;
  padding: 14px;
}

.agent-research-workbench .agent-research-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 10px;
}

.agent-research-workbench .agent-research-form .create-user-field input,
.agent-research-workbench .agent-research-form .create-user-field select {
  height: 39px;
}

.agent-research-workbench .agent-research-analysts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.agent-research-workbench .agent-research-analyst-option {
  min-height: 50px;
  padding: 8px 9px;
  background: #fff;
}

.agent-research-workbench .agent-research-analyst-option small {
  max-width: 120px;
}

.agent-research-symbol-picker { position: relative; }
.agent-research-symbol-results {
  position: absolute;
  z-index: 10;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.13);
}
.agent-research-symbol-option {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.agent-research-symbol-option:hover,
.agent-research-symbol-option.active { background: var(--surface-soft); }
.agent-research-symbol-option strong { font-size: 11px; }
.agent-research-symbol-option small { color: var(--muted); font-size: 10px; }
.agent-research-analyst-models {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}
.agent-research-analyst-model {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.agent-research-analyst-model span { display: grid; gap: 2px; min-width: 0; }
.agent-research-analyst-model strong { font-size: 10px; }
.agent-research-analyst-model small { color: var(--muted); font-size: 9px; }
.agent-research-analyst-model select { min-width: 0; height: 32px; }
.agent-research-analyst-model:has(select:disabled) { opacity: 0.58; background: var(--surface-soft); }
.agent-research-risk-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.agent-research-risk-list li { position: relative; padding-left: 15px; color: var(--ink); font-size: 12px; line-height: 1.6; }
.agent-research-risk-list li::before { position: absolute; top: 8px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); content: ""; }
.agent-research-reading-empty { margin: 0; color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .agent-research-analyst-models { grid-template-columns: 1fr; }
  .agent-research-analyst-model { grid-template-columns: 1fr; }
}

.agent-research-history-list {
  grid-template-columns: 1fr;
  max-height: 274px;
  overflow-y: auto;
  padding: 8px;
}

.agent-research-history-item {
  min-height: 56px;
  padding: 9px 10px;
  border-color: transparent;
  background: transparent;
}

.agent-research-history-item + .agent-research-history-item {
  border-top-color: var(--line);
  border-radius: 0;
}

.agent-research-history-item:hover,
.agent-research-history-item.active {
  border-color: rgba(64, 99, 235, 0.22);
  border-radius: 6px;
  background: rgba(64, 99, 235, 0.055);
}

.agent-research-report-heading {
  border-bottom: 0 !important;
}

.agent-research-tabs {
  padding: 0 14px;
  background: var(--surface-soft);
}

.agent-research-tabs button {
  min-height: 38px;
  font-size: 11px;
}

.agent-research-detail-content {
  min-height: 370px;
  padding: 18px;
}

.agent-research-summary {
  gap: 16px;
}

.agent-research-summary-head {
  align-items: center;
  padding-bottom: 15px;
}

.agent-research-summary-head > span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-research-summary-head > span:first-child small {
  font-size: 11px;
}

.agent-research-summary-head strong {
  font-size: 14px;
}

.agent-research-metrics {
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.agent-research-metric {
  padding: 13px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.agent-research-metric + .agent-research-metric {
  border-left: 1px solid var(--line);
}

.agent-research-panel-card {
  padding: 15px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.agent-research-json {
  max-height: 260px;
  margin-top: 8px;
  background: #f7f8fb;
  color: #334155;
}

.agent-research-reading-list { display: grid; gap: 0; }
.agent-research-reading-card { padding: 15px 0; border-bottom: 1px solid var(--line); }
.agent-research-reading-card:first-child { padding-top: 0; }
.agent-research-reading-card:last-child { border-bottom: 0; }
.agent-research-reading-card > div { display: flex; align-items: center; gap: 8px; }
.agent-research-reading-card svg { width: 16px; height: 16px; color: var(--primary); }
.agent-research-reading-card h4 { margin: 0; font-size: 12px; }
.agent-research-reading-card p {
  margin: 9px 0 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.agent-research-citation-list { display: grid; gap: 0; }
.agent-research-citation {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.agent-research-citation > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}
.agent-research-citation > div { display: grid; gap: 3px; min-width: 0; }
.agent-research-citation strong { font-size: 11px; overflow-wrap: anywhere; }
.agent-research-citation small { color: var(--muted); font-size: 10px; }

.agent-research-runtime {
  min-height: 0;
  padding: 0;
}

.agent-research-runtime > .agent-research-empty {
  min-height: 220px;
}

.agent-research-current {
  min-width: 0;
}

.agent-research-current-heading {
  padding: 13px 14px;
}

.agent-research-current-heading > div > strong {
  font-size: 15px;
}

.agent-research-progress {
  display: grid;
  gap: 7px;
  padding: 11px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.agent-research-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.agent-research-progress > div:first-child strong {
  color: var(--ink);
}

.agent-research-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eaf2;
}

.agent-research-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 220ms ease;
}

.agent-research-progress-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.agent-research-events {
  max-height: 340px;
  gap: 0;
  overflow-y: auto;
  padding: 4px 14px 10px 18px;
}

.agent-research-event {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 2px 9px;
  padding: 12px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.agent-research-event + .agent-research-event {
  border-top: 1px solid var(--line);
}

.agent-research-event-index {
  display: grid;
  grid-row: 1 / span 2;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #dbe2ef;
  border-radius: 50%;
  background: #fff;
  color: #64748b;
}

.agent-research-event-index svg {
  width: 12px;
  height: 12px;
}

.agent-research-event[data-event-type="result"] .agent-research-event-index {
  border-color: rgba(18, 166, 125, 0.28);
  background: rgba(18, 166, 125, 0.08);
  color: #078361;
}

.agent-research-event[data-event-type="warning"] .agent-research-event-index {
  border-color: rgba(217, 151, 19, 0.3);
  background: rgba(217, 151, 19, 0.09);
  color: #a76c00;
}

.agent-research-event[data-event-type="error"] .agent-research-event-index {
  border-color: rgba(196, 61, 61, 0.28);
  background: rgba(196, 61, 61, 0.08);
  color: #b23636;
}

.agent-research-event-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.agent-research-event-copy strong {
  margin: 0;
  font-size: 11px;
}

.agent-research-event-copy small {
  justify-self: auto;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.agent-research-event time {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.agent-research-event details {
  grid-column: 2 / -1;
  margin-top: 5px;
}

.agent-research-event summary {
  width: max-content;
  color: var(--primary);
  cursor: pointer;
  font-size: 9px;
}

.agent-research-event details pre {
  margin: 7px 0 0;
  max-height: 170px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8fb;
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 1120px) {
  .agent-research-workbench {
    grid-template-columns: 1fr;
  }

  .agent-research-control-column {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    align-items: start;
  }
}

@media (max-width: 760px) {
  .agent-research-control-column {
    grid-template-columns: 1fr;
  }

  .agent-research-detail-content {
    min-height: 300px;
  }
}

@media (max-width: 640px) {
  .agent-research-workbench .agent-research-form-grid,
  .agent-research-workbench .agent-research-analysts {
    grid-template-columns: 1fr;
  }

  .agent-research-workbench .panel-heading {
    min-height: 54px;
  }

  .agent-research-panel-title > svg {
    width: 16px;
    height: 16px;
  }

  .agent-research-detail-content {
    padding: 14px 12px;
  }

  .agent-research-metrics {
    grid-template-columns: 1fr;
  }

  .agent-research-metric + .agent-research-metric {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .agent-research-event {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .agent-research-event time {
    grid-column: 2;
  }

  .agent-research-event details {
    grid-column: 2;
  }
}

.agent-paper-proposal-body {
  display: grid;
  gap: 14px;
}

.agent-paper-proposal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.agent-paper-proposal-grid .field {
  margin: 0;
}

.agent-paper-proposal-risk {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.agent-paper-proposal-risk strong {
  font-size: 12px;
  color: var(--muted);
}

.agent-paper-proposal-risk pre {
  margin: 0;
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .agent-paper-proposal-grid {
    grid-template-columns: 1fr;
  }

  .agent-research-detail-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
