:root {
  scrollbar-gutter: stable;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f6f7f6;
  --text: #25282b;
  --muted: #60676b;
  --line: #e1e5e2;
  --line-dark: #cbd2cf;
  --accent: #087b75;
  --accent-strong: #06645f;
  --accent-soft: #eaf6f3;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-hover: #f6f7f6;
  --favorable: #137c63;
  --favorable-soft: rgba(19, 124, 99, 0.09);
  --neutral: #606b64;
  --neutral-soft: rgba(96, 107, 100, 0.07);
  --downside: #bd4658;
  --downside-soft: rgba(189, 70, 88, 0.09);
  --warning: #9b641d;
  --warning-soft: #fbf4e9;
  --info: #6454a4;
  --info-soft: #f3f0fb;
  --early-repair: #7861b5;
  --chart-grid: #e1e5e2;
  --chart-axis: #60676b;
  color-scheme: light;
  font-family:
    "Aptos", "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--line-dark) transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

button {
  appearance: none;
  border: 1px solid var(--line-dark);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 400;
  min-height: 30px;
  padding: 0 10px;
  box-shadow: none;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 18px 18px 32px;
}

.top-bar {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
}

.title-block {
  min-width: 0;
}

.summary-marks {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.summary-marks span {
  align-items: baseline;
  border-left: 2px solid var(--line-dark);
  display: inline-flex;
  gap: 7px;
  line-height: 1;
  padding-left: 9px;
}

.summary-marks small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.summary-marks strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

#favorable-count { color: var(--favorable); }
#downside-count { color: var(--downside); }

.top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 100%;
}

.market-switch {
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.market-switch button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 400;
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.market-switch button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.service-status {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  min-height: 32px;
  max-width: min(340px, 100%);
  overflow: hidden;
  padding: 0 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-status.is-failed {
  background: var(--downside-soft);
  border-color: rgba(189, 70, 88, 0.25);
  color: var(--downside);
}

.service-status.is-warning {
  background: var(--warning-soft);
  border-color: rgba(155, 100, 29, 0.22);
  color: var(--warning);
}

.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.detail-section {
  margin: 18px 0 30px;
}

.detail-section h2 {
  margin-bottom: 8px;
}

.latest-table-wrap {
  background: var(--surface);
  overflow-x: auto;
}

.regime-table {
  border-collapse: collapse;
  border-bottom: 1px solid var(--line-dark);
  border-top: 2px solid var(--text);
  min-width: 900px;
  table-layout: fixed;
  width: 100%;
}

.regime-table th,
.regime-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

.regime-table th {
  background: transparent;
  border-bottom: 1px solid var(--line-dark);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.regime-table tbody tr.clickable-row {
  cursor: pointer;
}

.regime-table tbody tr.clickable-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.regime-table .numeric { text-align: right; white-space: nowrap; }
.regime-table th:nth-child(1) { width: 22%; }
.regime-table th:nth-child(2) { width: 13%; }
.regime-table th:nth-child(3), .regime-table th:nth-child(4),
.regime-table th:nth-child(5), .regime-table th:nth-child(6) { width: 10%; text-align: right; }
.regime-table th:nth-child(7) { width: 12%; }
.regime-table th:nth-child(8) { width: 13%; }

.name-cell {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.name-cell .row-symbol {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.name-cell span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.regime-cell {
  text-align: center;
}

.regime-dot {
  --dot-color: var(--neutral);
  --dot-border: rgba(96, 107, 100, 0.35);
  --dot-ring: rgba(96, 107, 100, 0.12);
  background: var(--dot-color);
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow:
    0 0 0 1px var(--dot-border),
    0 0 0 4px var(--dot-ring);
  display: inline-block;
  height: 13px;
  vertical-align: middle;
  width: 13px;
}

.regime-dot.favorable {
  --dot-color: var(--favorable);
  --dot-border: rgba(19, 124, 99, 0.36);
  --dot-ring: rgba(19, 124, 99, 0.13);
}

.regime-dot.downside {
  --dot-color: var(--downside);
  --dot-border: rgba(189, 70, 88, 0.36);
  --dot-ring: rgba(189, 70, 88, 0.14);
}

.regime-dot.unclassified {
  --dot-color: var(--neutral);
}

.spark-cell {
  line-height: 0;
}

.sparkline {
  display: inline-block;
  height: 34px;
  max-width: 132px;
  overflow: visible;
  vertical-align: middle;
  width: min(132px, 100%);
}

.spark-mid {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.spark-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.spark-line.favorable,
.spark-last.favorable {
  stroke: var(--favorable);
}

.spark-line.bad,
.spark-last.bad {
  stroke: var(--downside);
}

.spark-line.other,
.spark-last.other {
  stroke: var(--neutral);
}

.spark-last {
  fill: #fff;
  stroke-width: 1.7;
}

.spark-empty {
  color: var(--muted);
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  min-width: 132px;
  text-align: center;
}

.positive {
  color: var(--favorable);
}

.negative {
  color: var(--downside);
}

.change-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  justify-content: center;
  min-width: 76px;
  padding: 3px 8px;
}

.change-chip.changed {
  border-color: var(--line-dark);
  color: var(--text);
}

.change-chip.maintain {
  border-color: transparent;
  color: var(--muted);
}

.change-chip.unknown {
  border-color: var(--line);
  color: var(--muted);
}

.history-header {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  justify-content: flex-end;
}

.legend-swatch {
  border-radius: 3px;
  display: inline-block;
  height: 10px;
  margin-right: 5px;
  width: 18px;
}

.legend-swatch.favorable {
  background: rgba(19, 124, 99, 0.48);
}

.legend-swatch.downside {
  background: rgba(189, 70, 88, 0.46);
}

.legend-swatch.unclassified {
  background: rgba(96, 107, 100, 0.26);
}

.trend-legend {
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  height: 16px;
  justify-content: center;
  line-height: 1;
  margin-right: 5px;
  width: 16px;
}

.trend-legend.call {
  color: var(--favorable);
}

.trend-legend.put {
  color: var(--downside);
}

.trend-legend.flat {
  color: var(--neutral);
}

.early-repair-legend {
  color: var(--early-repair);
  display: inline-block;
  font-size: 15px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  margin-right: 5px;
  vertical-align: -1px;
}

.history-grid {
  background: var(--surface);
  border-bottom: 1px solid var(--line-dark);
  border-top: 2px solid var(--text);
  display: block;
  overflow: hidden;
}

.chart-panel {
  border-bottom: 1px solid var(--line);
  min-width: 0;
  padding: 0;
  scroll-margin-top: 14px;
}

.chart-panel:last-child {
  border-bottom: 0;
}

.chart-panel.targeted {
  background: var(--surface-strong);
}

.chart-title {
  flex-wrap: wrap;
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  min-height: 34px;
  padding: 7px 12px;
}

.chart-title > div:first-child {
  flex: 1 1 220px;
  align-items: baseline;
  display: flex;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.chart-title strong {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 500;
}

.chart-title em {
  color: var(--text);
  flex: 1 1 auto;
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-title em::before {
  color: var(--muted);
  content: "·";
  margin-right: 8px;
}

.chart-title span {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
}

.chart-frame {
  position: relative;
  height: 320px;
  cursor: crosshair;
  width: 100%;
}

.chart-shell {
  width: 100%;
}

.chart-frame:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.chart-navigator {
  position: absolute;
  z-index: 3;
  min-height: 7px;
}

.chart-controls {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-left: auto;
}

.chart-visible-range {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-window-presets {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.chart-window-button {
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  min-height: 28px;
  padding: 0 2px;
}

.chart-window-button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.chart-navigator-track {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--line);
}

.chart-navigator-window {
  position: absolute;
  top: 0;
  bottom: 0;
  box-sizing: border-box;
  min-width: 14px;
  border: 1px solid var(--line-dark);
  border-radius: 0;
  background: var(--accent-soft);
  cursor: grab;
  touch-action: none;
}

.chart-navigator-window:hover,
.chart-navigator-window:focus-visible,
.chart-navigator-window.dragging {
  border-color: var(--accent);
  background: rgba(8, 123, 117, 0.16);
  outline: none;
}

.chart-navigator-window.dragging {
  cursor: grabbing;
}

.chart-navigator.disabled .chart-navigator-window {
  border-color: var(--line);
  background: var(--panel-soft);
  cursor: default;
}

.axis-text {
  fill: var(--chart-axis);
  font-size: 11.5px;
}

.axis-date {
  text-anchor: middle;
}

.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  padding: 22px;
}

.hover-line {
  stroke: var(--muted);
  stroke-dasharray: 4 4;
  stroke-width: 1;
}

.hover-dot {
  fill: #fff;
  stroke-width: 2;
}

.hover-dot.favorable {
  stroke: var(--favorable);
}

.hover-dot.bad {
  stroke: var(--downside);
}

.hover-dot.other {
  stroke: var(--neutral);
}

.trend-signal-line line {
  opacity: 0.78;
  pointer-events: stroke;
  stroke: currentColor;
  stroke-width: 1.8;
}

.trend-signal-line text {
  dominant-baseline: middle;
  fill: currentColor;
  font-size: 10px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #fff;
  stroke-linejoin: round;
  stroke-width: 3px;
  text-anchor: middle;
}

.trend-signal-line.call {
  color: var(--favorable);
}

.trend-signal-line.put {
  color: var(--downside);
}

.trend-signal-line.flat {
  color: var(--neutral);
}

.trend-signal-line.flat line {
  opacity: 0.55;
  stroke-dasharray: 4 4;
}

.early-repair-marker {
  color: var(--early-repair);
  pointer-events: none;
}

.early-repair-marker line {
  stroke: currentColor;
  stroke-width: 1.2;
}

.early-repair-marker text {
  dominant-baseline: middle;
  fill: currentColor;
  font-size: 14px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #fff;
  stroke-linejoin: round;
  stroke-width: 3px;
  text-anchor: middle;
}

.chart-tooltip rect {
  fill: #fff;
  stroke: var(--line-dark);
}

.chart-tooltip text {
  fill: var(--text);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .history-grid {
    grid-template-columns: 1fr;
  }
}

.audit-shell {
  display: grid;
  gap: 18px;
}

.back-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.audit-link {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.audit-link:hover {
  color: var(--text);
}

.audit-subtitle {
  color: var(--muted);
  margin: 6px 0 0;
}

.audit-controls {
  align-items: end;
  display: flex;
  gap: 10px;
}

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

.audit-controls select,
.audit-controls button {
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-radius: 0;
  color: var(--text);
  font: inherit;
  min-height: 30px;
  padding: 4px 10px;
}

.audit-table-wrap {
  overflow-x: auto;
}

.audit-table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 840px;
  width: 100%;
}

.audit-table th,
.audit-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.audit-table th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.audit-table td small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.audit-selectable {
  cursor: pointer;
}

.audit-selectable:hover,
.audit-selectable:focus-visible {
  background: var(--surface-strong);
  outline: none;
}

.audit-badge,
.audit-active,
.audit-state {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  padding: 3px 7px;
}

.audit-badge.succeeded,
.audit-active,
.audit-state.favorable {
  background: rgba(19, 124, 99, 0.12);
  color: var(--favorable);
}

.audit-badge.failed,
.audit-state.downside {
  background: rgba(189, 70, 88, 0.12);
  color: var(--downside);
}

.audit-badge.running {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.audit-badge.not-run,
.audit-state.unclassified {
  background: rgba(96, 107, 100, 0.12);
  color: var(--neutral);
}

.audit-history-header {
  padding: 0 0 10px;
}

.audit-run-label,
.audit-empty {
  color: var(--muted);
}

.service-status.error {
  color: var(--downside);
  background: var(--downside-soft);
  border-color: rgba(189, 70, 88, 0.25);
}

#audit-status { max-width: 100%; margin-bottom: 12px; }

@media (max-width: 760px) {
  .top-bar,
  .history-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .market-switch {
    width: 100%;
  }

  .summary-marks {
    gap: 10px 14px;
  }

  .chart-navigator {
    min-width: 0;
  }

  .chart-panel {
    overflow-x: auto;
  }

}

@media (max-width: 480px) {
  .summary-marks {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Investment Studio page frame, matching Watchlist and Portfolio. */
:root[lang^="zh"] { font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Aptos", "Inter", "Segoe UI", sans-serif; }
body { min-width: 320px; }
button, select, input { font: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.language-switcher {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 30px;
  padding: 0 5px;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
}

.language-switcher span {
  color: var(--muted);
}

.language-switcher select {
  min-width: 86px;
  height: 28px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  outline: none;
}

.language-switcher:hover,
.language-switcher:focus-within,
.studio-workspace-switcher:hover,
.studio-workspace-switcher:focus-visible {
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.language-switcher:has(select:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.workspace-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  min-height: 38px;
  margin-bottom: 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line-dark);
}
.workspace-breadcrumbs > .language-switcher { margin-left: auto; }
.workspace-breadcrumbs [aria-current] { color: var(--text); }
.workspace-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.workspace-tabs a { padding: 9px 0; border-bottom: 2px solid transparent; color: var(--muted); }
.workspace-tabs a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.regime-table th, .audit-table th { background: var(--panel-soft); font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: .01em; }
.audit-table { border-top: 2px solid var(--text); border-bottom: 1px solid var(--line-dark); }
.audit-shell { display: block; }
.audit-shell .detail-section { margin-top: 24px; }
.audit-badge, .audit-active, .audit-state { border-radius: 3px; }
.service-status { white-space: normal; overflow-wrap: anywhere; padding-top: 5px; padding-bottom: 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 640px) {
  .app-shell { padding: 16px 14px 32px; }
}

/* Investment Studio visual system. */

body {
  background: #ffffff;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
}

.app-shell {
  padding: 20px 18px 50px;
}

button,
select,
a {
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.workspace-tabs {
  gap: 22px;
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-dark);
  border-radius: 0;
  background: transparent;
}

.workspace-tabs a {
  padding: 10px 0 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}

.workspace-tabs a:hover {
  color: var(--text);
  background: transparent;
}

.workspace-tabs a[aria-current] {
  border: 0;
  border-bottom: 2px solid var(--accent);
  color: var(--text);
  background: transparent;
}

.top-bar {
  min-height: 92px;
  margin-bottom: 18px;
  padding: 19px 0 17px;
  border: 0;
  border-top: 2px solid var(--text);
  border-bottom: 1px solid var(--line-dark);
  border-radius: 0;
  background: #ffffff;
}

h1 {
  font-size: clamp(25px, 2.7vw, 33px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.summary-marks {
  gap: 16px;
  margin-top: 10px;
}

.summary-marks span {
  gap: 7px;
  padding: 0 0 0 9px;
  border: 0;
  border-left: 2px solid var(--line-dark);
  border-radius: 0;
  background: transparent;
}

.summary-marks small {
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: none;
}

.market-switch {
  gap: 10px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-dark);
  border-radius: 0;
  background: transparent;
}

.market-switch button {
  min-height: 30px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}

.market-switch button:hover {
  color: var(--text);
  background: transparent;
}

.market-switch button.active {
  border: 0;
  border-bottom: 2px solid var(--accent);
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.service-status {
  min-height: 30px;
  border-color: var(--line);
  border-radius: 2px;
  background: var(--panel-soft);
}

.service-status[hidden],
.service-status:empty,
.info-hint[hidden] {
  display: none;
}

.title-with-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  --info-hint-inline-gap: 0;
}

.info-hint {
  display: inline-flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  max-height: 16px;
  flex: 0 0 16px;
  padding: 0;
  border: 1px solid var(--hint-color, var(--info));
  border-radius: 50%;
  color: var(--hint-color, var(--info));
  background: var(--hint-background, var(--info-soft));
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  margin: 0;
  margin-inline-start: var(--info-hint-inline-gap, 6px);
  cursor: help;
  appearance: none;
}

.info-hint > span {
  display: block;
  font: inherit;
  line-height: 1;
}

.info-hint-attention {
  --hint-color: var(--warning);
  --hint-background: var(--warning-soft);
}

.info-hint:hover,
.info-hint[aria-expanded="true"] {
  box-shadow: 0 0 0 2px var(--hint-background, var(--info-soft));
}

.info-hint:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.info-popup {
  position: fixed;
  z-index: 1700;
  box-sizing: border-box;
  width: max-content;
  max-width: min(420px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 4px 14px #25282b14;
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.info-popup strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.info-popup p { margin: 6px 0 0; }

.chart-loading,
.table-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--muted);
  background: var(--panel);
  font-size: 12px;
}

.chart-loading::before,
.table-loading::before {
  content: "";
  width: 22px;
  height: 22px;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: loading-turn 900ms linear infinite;
}

.chart-loading { height: 320px; }
.table-loading { min-height: 180px; }
.audit-table:has(.table-loading) { min-width: 0; }
.audit-table:has(.table-loading) thead { display: none; }
.table-loading.is-failed { color: var(--downside); }
.table-loading.is-failed::before { display: none; }

@keyframes loading-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .chart-loading::before, .table-loading::before { animation: none; }
}

.detail-section {
  margin: 18px 0 28px;
}

.detail-section h2,
.history-header {
  margin-bottom: 10px;
  padding: 0;
}

.latest-table-wrap,
.audit-table-wrap {
  border: 0;
  border-top: 2px solid var(--text);
  border-bottom: 1px solid var(--line-dark);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
}

:is(.latest-table-wrap, .audit-table-wrap)[data-table-panning],
:is(.latest-table-wrap, .audit-table-wrap)[data-table-panning] * { cursor: grabbing; user-select: none; }
.latest-table-wrap:focus-visible, .audit-table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.regime-table,
.audit-table {
  border: 0;
}

/* Match Studio's cell overlay without replacing semantic cell colors. */
:is(.regime-table, .audit-table) > tbody > tr:hover > :is(th, td) {
  background-image: linear-gradient(rgba(37, 40, 43, 0.045), rgba(37, 40, 43, 0.045)) !important;
}

.audit-table {
  min-width: 880px;
  table-layout: fixed;
}

.audit-runs-table th:nth-child(1) { width: 22%; }
.audit-runs-table th:nth-child(2) { width: 15%; }
.audit-runs-table th:nth-child(3) { width: 15%; }
.audit-runs-table th:nth-child(4) { width: 15%; }
.audit-runs-table th:nth-child(5) { width: 23%; }
.audit-runs-table th:nth-child(6) { width: 10%; }
.audit-history-table { min-width: 700px; }
.audit-history-table th:nth-child(1) { width: 22%; }
.audit-history-table th:nth-child(2) { width: 28%; }
.audit-history-table th:nth-child(3) { width: 18%; }
.audit-history-table th:nth-child(4) { width: 12%; }
.audit-history-table th:nth-child(5) { width: 20%; }

.audit-table td,
.audit-table td small {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.regime-table th,
.audit-table th {
  border-bottom-color: var(--line-dark);
  background: var(--panel-soft);
  color: var(--muted);
}

.state-pill,
.regime-pill,
.change-pill,
.change-chip,
.audit-badge,
.audit-active,
.audit-state,
.audit-run-label {
  border-radius: 2px;
}

.regime-dot {
  box-shadow: 0 0 0 1px var(--dot-border);
}

.history-header {
  align-items: flex-end;
}

.legend {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.trend-legend {
  border-radius: 2px;
}

.history-grid {
  border: 0;
  border-top: 2px solid var(--text);
  border-bottom: 1px solid var(--line-dark);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  overflow: visible;
}

.chart-panel {
  border-bottom-color: var(--line);
  background: #ffffff;
  overflow: visible;
}

.chart-panel.targeted {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.chart-title {
  min-height: 40px;
  padding: 8px 12px;
  background: transparent;
}

.chart-frame,
.chart-shell,
.chart-frame svg {
  min-width: 0;
  background: #ffffff;
  overflow: visible;
}

.chart-navigator {
  min-width: 0;
  padding: 0;
  background: transparent;
}

.chart-tooltip rect {
  fill: #ffffff;
  stroke: var(--line-dark);
  filter: drop-shadow(0 7px 14px rgba(23, 33, 43, 0.11));
}

.empty-state {
  border-radius: 0;
}

.audit-shell {
  gap: 18px;
}

.audit-controls select,
.audit-controls button {
  border-color: var(--line-dark);
  background: #ffffff;
}

.audit-controls button:hover {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.audit-run-label {
  padding: 4px 7px;
  background: var(--panel-soft);
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px 14px 32px;
  }

  .workspace-tabs {
    overflow-x: auto;
  }

  .workspace-tabs a {
    flex: 0 0 auto;
  }

  .top-bar {
    padding: 18px 0 16px;
  }

  .summary-marks span {
    border-left: 2px solid var(--line-dark);
  }
}

.coverage-gaps { margin: 0 0 24px; border: 1px solid rgba(155, 100, 29, 0.22); border-left: 3px solid var(--warning); padding: 12px 16px; background: var(--warning-soft); }
.coverage-gaps summary { cursor: pointer; color: var(--warning); font-weight: 600; }
#coverage-gap-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-top: 16px; }
#coverage-gap-list p { margin: 6px 0; font-size: 13px; }

.regime-status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.regime-cell { min-width: 110px; }
.chart-reading { margin: 0 16px 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-history-coverage { margin: 0 16px 8px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.chart-back { margin: 0 16px 12px; padding: 3px 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }
.chart-title:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.studio-workspace-switcher { width: 142px; min-width: 0; height: 30px; padding: 3px 5px; border: 1px solid transparent; border-radius: 0; background: transparent; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.technical-menu { position: relative; margin-left: auto; font-size: 12px; color: var(--muted); }
.technical-menu summary { padding: 9px 0; cursor: pointer; }
.technical-menu[open] > a { position: absolute; z-index: 10; right: 0; min-width: 130px; padding: 12px; border: 1px solid var(--line); background: #fff; }
@media (max-width: 600px) {
  .history-header { align-items: flex-start; text-align: left; }
  .chart-frame, .chart-loading { height: 280px; }
  .chart-title { align-items: flex-start; }
  .chart-title em { white-space: normal; }
}

.method-details, .return-evidence { font-size: 12px; line-height: 1.6; color: var(--muted); }
.method-details { margin: 8px 0 16px; }
.method-details summary, .return-evidence summary { cursor: pointer; color: var(--accent); }
.return-evidence { padding: 0 16px 14px; overflow-wrap: anywhere; }
.instrument-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin: 12px 0; }
.instrument-toolbar label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.instrument-toolbar input[type="search"], .instrument-toolbar select { font: inherit; color: var(--text); border: 1px solid var(--line-dark); background: white; padding: 6px 8px; height: 32px; min-width: 0; }
.instrument-toolbar .search-control { flex: 1; min-width: 160px; }
.instrument-toolbar .changed-filter { display: flex; align-items: center; padding-bottom: 7px; }
.instrument-toolbar button, #no-filter-results button, .history-error button { background: white; border: 1px solid var(--line-dark); color: var(--accent); padding: 6px 8px; font: inherit; font-size: 12px; cursor: pointer; }
#filter-count { padding-bottom: 7px; font-size: 12px; color: var(--muted); }
.summary-filter { background: transparent; border: 0; padding: 0; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.summary-filter:hover { color: var(--accent); }
.table-context, #metrics-status { font-size: 12px; color: var(--muted); margin: 8px 0; }
#metrics-status:empty { display: none; }
.metric-pending, .metric-missing, .metric-failed { font-size: 11px; color: var(--muted); }
.metric-failed { color: var(--warning); }
.latest-price { display: block; }
.chart-title .latest-price span { font-size: inherit; }
@media (max-width: 900px) {
  .top-bar { flex-direction: column; align-items: stretch; }
  .top-actions { align-items: flex-start; }
  .regime-table { min-width: 0; }
  .regime-table .secondary-column { display: none; }
  .regime-table th:nth-child(1) { width: 32%; }
  .regime-table th:nth-child(2) { width: 25%; }
  .regime-table th:nth-child(3) { width: 23%; }
  .regime-table th:nth-child(4) { width: 20%; }
  .regime-table th, .regime-table td { padding: 10px 6px; }
  .regime-table .regime-cell { min-width: 0; }
  .regime-status { font-size: 12px; gap: 5px; }
  .regime-dot { height: 8px; width: 8px; flex: 0 0 auto; border-width: 1px; }
  .name-cell .row-symbol { font-size: 13px; }
  .name-cell span { white-space: normal; overflow-wrap: anywhere; }
}

/* Bounded audit directories: current result first, detail identifiers on demand. */
.instrument-toolbar[hidden], .audit-overview[hidden] { display: none; }
.summary-filter:disabled { cursor: default; color: inherit; }
.axis-text { font-size: 12px; }
.audit-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 20px 0; border-block: 1px solid var(--line); }
.audit-overview h2 { color: var(--muted); font-size: 12px; font-weight: 400; margin: 0 0 10px; }
.audit-overview p { margin: 8px 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.audit-overview span { display: block; color: var(--muted); line-height: 1.6; font-size: 12px; }
.audit-overview button { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 20px; cursor: pointer; }
.audit-overview button:disabled { color: var(--muted); cursor: default; }
.audit-scope { color: var(--muted); font-size: 13px; line-height: 1.6; }
.audit-filters { flex-wrap: wrap; margin: 16px 0; }
.audit-controls input { min-height: 32px; padding: 5px 8px; border: 1px solid var(--line-dark); border-radius: 0; color: var(--text); background: var(--surface); font: inherit; }
.audit-controls select, .audit-controls button { min-height: 32px; }
.audit-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.audit-pagination button { font: inherit; min-height: 30px; padding: 4px 10px; background: var(--surface); border: 1px solid var(--line-dark); color: var(--text); cursor: pointer; }
.audit-pagination button:disabled { opacity: .45; cursor: default; }
.audit-identifiers { margin-top: 8px; color: var(--muted); font-size: 12px; }
.audit-identifiers summary { cursor: pointer; }
.audit-identifiers dl { min-width: 190px; margin: 10px 0; }
.audit-identifiers dt { color: var(--muted); margin: 10px 0 3px; }
.audit-identifiers dd { margin: 0; }
.audit-identifiers code { white-space: normal; overflow-wrap: anywhere; font-size: 12px; user-select: text; }
.audit-badge, .audit-active, .audit-state { font-size: 12px; }
.audit-quality-warning { display: inline-block; font-size: 12px; padding: 3px 7px; border-radius: 3px; background: #fff4d9; color: #825500; margin: 3px 3px 3px 0; }
.audit-table time { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .audit-overview { grid-template-columns: 1fr; gap: 18px; } .audit-filters label { min-width: 0; flex: 1; } .audit-controls input { width: 100%; } }

.state-reading-guide { color: var(--muted); font-size: 13px; line-height: 1.7; margin: -4px 0 14px; }
.candidate-note { margin: 0 0 20px; padding: 12px 16px; border-left: 3px solid var(--muted); background: var(--surface); font-size: 13px; line-height: 1.6; }
.candidate-note p { margin: 4px 0; }
