:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #162033;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --blue: #2563eb;
  --amber: #a16207;
  --red: #b42318;
  --green: #027a48;
  --shadow: 0 16px 40px rgba(22, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button {
  font: inherit;
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 5px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  font-weight: 750;
  letter-spacing: 0;
}

.status {
  align-items: center;
  background: #e9f8f5;
  border: 1px solid #b7e4db;
  border-radius: 8px;
  color: var(--accent-strong);
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  padding: 10px 12px;
  white-space: nowrap;
}

.status-dot {
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.auth-status {
  flex-wrap: wrap;
}

.auth-link,
.auth-user {
  font-weight: 700;
}

.auth-link {
  color: var(--accent-strong);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-logout {
  padding: 4px 10px;
}

.inline-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.auth-body {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-shell {
  width: min(420px, 100%);
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-card h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

.auth-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
}

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

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

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

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  padding: 10px 12px;
}

.auth-form select,
.auth-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  padding: 10px 12px;
  width: 100%;
  background: var(--panel);
  color: inherit;
}

.auth-form textarea {
  resize: vertical;
  min-height: 120px;
}

.auth-message {
  color: var(--red);
  font-size: 14px;
  margin-top: 12px;
  min-height: 1.2em;
}

.auth-back-link {
  color: var(--muted);
  display: inline-block;
  font-size: 14px;
  margin-top: 18px;
  text-decoration: none;
}

.auth-back-link:hover {
  color: var(--accent-strong);
}

.account-shell {
  max-width: 560px;
}

.account-card {
  display: grid;
  gap: 1.25rem;
}

.account-section {
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}

.account-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.account-section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.layout {
  display: grid;
  gap: 16px;
}

.controls,
.metrics,
.data-status,
.workspace {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.controls {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) minmax(220px, 1.1fr) auto;
  padding: 16px;
}

.watchlist-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px 10px;
}

.watchlist-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  justify-content: space-between;
  list-style: none;
  padding: 10px 2px;
}

.watchlist-summary::-webkit-details-marker {
  display: none;
}

.watchlist-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.watchlist-details-body {
  display: grid;
  gap: 8px;
}

.control-group {
  display: grid;
  gap: 8px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.segmented {
  background: #eef1f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
}

.segment {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #475467;
  cursor: pointer;
  min-height: 38px;
  padding: 0 12px;
}

.segment.active {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(22, 32, 51, 0.1);
  color: var(--ink);
  font-weight: 750;
}

.primary-button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: 760;
  min-height: 46px;
  padding: 0 18px;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.watchlist-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.watchlist-search {
  position: relative;
}

.watchlist-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  min-height: 38px;
  padding: 0 12px;
  width: 100%;
}

.search-results {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  display: grid;
  left: 0;
  max-height: 240px;
  overflow: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.search-result {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result strong {
  color: var(--text);
  font-size: 14px;
}

.search-result span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.search-result:hover,
.search-result.active {
  background: #f8fafc;
}

.watchlist-hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.watchlist-bulk {
  display: grid;
  gap: 8px;
}

.watchlist-bulk-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.watchlist-bulk textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}

.watchlist-bulk-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.watchlist-bulk-note {
  color: var(--muted);
  font-size: 12px;
}

.watchlist-manage {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.watchlist-empty {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.watchlist-item {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 10px;
}

.watchlist-item strong {
  display: block;
  font-size: 13px;
}

.watchlist-item span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.watchlist-remove {
  flex-shrink: 0;
  font-size: 12px;
  padding: 6px 10px;
  white-space: nowrap;
}

.danger-button {
  border-color: #fecdca;
  color: #b42318;
}

.danger-button:hover {
  background: #fff5f5;
}

.detail-header {
  align-items: start;
}

.detail-header > div {
  min-width: 0;
}

.section-title.compact.detail-header {
  justify-content: space-between;
}

.symbol-row {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.symbol-link {
  color: var(--text);
  font-size: inherit;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.symbol-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.stock-body {
  background: var(--bg);
}

.stock-shell {
  margin: 0 auto;
  max-width: 1280px;
  padding: 16px 20px 32px;
  width: min(100vw - 24px, 1280px);
}

.stock-topbar {
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 18px 20px;
}

.stock-topbar-main {
  display: grid;
  gap: 10px;
}

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

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

.stock-switcher {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stock-switch-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  gap: 6px;
  max-width: 220px;
  padding: 8px 14px;
}

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

.stock-switch-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.stock-switch-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-switch-arrow {
  flex: 0 0 auto;
  font-weight: 700;
}

.stock-switch-position {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  min-width: 56px;
  text-align: center;
}

.stock-title-block h1 {
  font-size: 32px;
  line-height: 1.15;
  margin: 0;
}

.stock-subtitle {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 10px;
}

.stock-topbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stock-hero {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 14px;
}

.stock-hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  padding: 14px 16px;
}

.stock-hero-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stock-hero-card strong {
  font-size: 28px;
  line-height: 1;
}

.stock-hero-card.muted-card strong {
  font-size: 18px;
}

.stock-tabs {
  margin-bottom: 14px;
}

.stock-main {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 18px 20px 22px;
}

.stock-tab-panel {
  display: grid;
  gap: 14px;
}

.stock-tab-panel[hidden] {
  display: none !important;
}

.stock-chart-panel {
  gap: 12px;
}

.stock-chart-main {
  height: 420px;
  min-height: 320px;
}

.stock-chart-sub {
  height: 140px;
  min-height: 120px;
}

.stock-insight-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stock-fundamentals-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stock-page .indicator-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.watchlist-star {
  background: transparent;
  border: 0;
  color: #98a2b3;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}

.watchlist-star.active {
  color: #f59e0b;
}

.pool-segmented {
  grid-template-columns: repeat(3, 1fr);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  overflow: hidden;
}

.metrics article {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metrics article:last-child {
  border-right: 0;
}

.metrics span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metrics strong {
  font-size: 30px;
  line-height: 1;
}

.metrics .text-metric strong {
  font-size: 17px;
  line-height: 1.15;
  word-break: keep-all;
}

.data-status {
  overflow: hidden;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.replay-grid {
  grid-template-columns: repeat(5, 1fr);
}

.report-grid {
  grid-template-columns: repeat(5, 1fr);
}

.report-actions,
.report-highlights,
.report-symbols {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 12px 18px;
}

.report-actions h3,
.report-highlights h3,
.report-symbols h3 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
}

.report-actions ul,
.report-highlights ul {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.report-actions li,
.report-highlight-item {
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
}

.report-highlight-item.warning {
  color: #614700;
}

.report-highlight-item.positive {
  color: var(--accent-strong);
}

.report-symbol-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.report-symbol-row strong {
  font-size: 14px;
}

.report-symbol-row span {
  color: var(--muted);
  font-size: 12px;
}

.replay-timeline {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0;
}

.replay-day {
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
}

.replay-day-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.replay-day-header strong {
  font-size: 15px;
}

.replay-day-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 10px;
}

.replay-day-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.replay-chip {
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  padding: 4px 10px;
}

.status-grid article {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 16px 18px;
}

.status-grid article:last-child {
  border-right: 0;
}

.status-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-grid strong {
  font-size: 20px;
}

.sync-message {
  border-top: 1px solid var(--line);
  color: #614700;
  font-size: 13px;
  line-height: 1.5;
  max-height: 88px;
  overflow: auto;
  padding: 12px 18px;
  white-space: pre-wrap;
}

.sync-list {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0;
}

.sync-instrument,
.empty-state {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 11px 18px;
}

.sync-instrument:last-child {
  border-bottom: 0;
}

.sync-instrument strong {
  font-size: 14px;
}

.sync-instrument span,
.empty-state {
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(400px, 1fr);
  min-height: 520px;
}

.workspace-primary {
  box-shadow: 0 20px 48px rgba(22, 32, 51, 0.1);
}

.signal-list {
  border-right: 1px solid var(--line);
  min-width: 0;
}

.signal-list .table-wrap {
  max-height: min(72vh, 680px);
  overflow: auto;
}

.signal-toolbar {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px 12px;
  grid-template-columns: repeat(3, minmax(100px, 1fr)) auto minmax(120px, 1fr);
  padding: 12px 18px;
}

.toolbar-field {
  display: grid;
  gap: 6px;
}

.toolbar-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.toolbar-field select {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  min-height: 36px;
  padding: 0 10px;
}

.toolbar-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.signal-list thead th {
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 1;
}

.section-title {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 16px 18px;
}

.section-title h2 {
  font-size: 18px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.section-title.compact {
  border-bottom: 0;
  padding-bottom: 8px;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f8fafc;
}

tbody tr.selected {
  background: #ecfdf5;
  box-shadow: inset 4px 0 0 var(--accent);
}

.symbol {
  display: grid;
  gap: 3px;
}

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

.symbol span {
  color: var(--muted);
  font-size: 12px;
}

.pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  min-width: 48px;
  padding: 5px 9px;
}

.pill.watch {
  background: #e8f6ef;
  color: var(--green);
}

.pill.observe {
  background: #e8efff;
  color: var(--blue);
}

.pill.wait {
  background: #fff6df;
  color: var(--amber);
}

.pill.avoid {
  background: #ffebe8;
  color: var(--red);
}

.scorebar {
  background: #edf0f4;
  border-radius: 999px;
  height: 8px;
  margin-top: 7px;
  overflow: hidden;
  width: 112px;
}

.scorebar span {
  background: var(--accent);
  display: block;
  height: 100%;
}

.riskbar span {
  background: var(--amber);
}

.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 40px);
  min-width: 0;
  overflow: auto;
  padding: 0 0 18px;
  position: sticky;
  top: 16px;
}

.detail-sticky-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 14px 18px 12px;
  position: sticky;
  top: 0;
  z-index: 3;
}

.detail-scorebar {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
}

.detail-chip {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
}

.detail-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.detail-chip strong {
  font-size: 20px;
}

.detail-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.detail-tab-panel {
  display: grid;
  gap: 14px;
  padding: 14px 18px 0;
}

.detail-tab-panel[hidden] {
  display: none !important;
}

.secondary-panels {
  display: grid;
  gap: 10px;
}

.secondary-collapsible {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.secondary-collapsible > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 15px;
  font-weight: 700;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  padding: 14px 18px;
}

.secondary-collapsible > summary::-webkit-details-marker {
  display: none;
}

.secondary-collapsible > summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.secondary-collapsible > .data-status {
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  box-shadow: none;
}

.fundamentals-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

canvas {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 180px;
  width: 100%;
}

.chart-panel {
  display: grid;
  gap: 10px;
}

.chart-toolbar {
  display: grid;
  gap: 10px;
}

.chart-toolbar-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-toolbar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-width: 32px;
}

.chart-range-tabs,
.chart-type-tabs {
  flex: 1;
}

.chart-indicator-toggles {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 12px;
}

.chart-indicator-toggles label {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.chart-meta {
  color: var(--muted);
  flex: 1;
  font-size: 12px;
  min-width: 180px;
}

.stock-chart {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 320px;
  min-height: 240px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.stock-chart.sub-chart {
  height: 120px;
  min-height: 100px;
}

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

.indicator-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
}

.indicator-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.indicator-metric strong {
  font-size: 16px;
}

.detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 13px;
}

.detail-grid span,
.notes h3 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-grid strong {
  font-size: 24px;
}

.fundamentals-panel {
  display: grid;
  gap: 10px;
}

.fundamentals-panel h3 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
}

.fundamentals-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

.fundamentals-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 13px;
}

.fundamentals-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.fundamentals-grid strong {
  font-size: 20px;
}

.fundamentals-meta {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.metric-hint {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.replay-note {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.explain-panel {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.explain-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.explain-header h3 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
}

.explain-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.explain-badge {
  background: #eef1f5;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #475467;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
}

.explain-badge.llm {
  background: #e8f6ef;
  border-color: #b7e4db;
  color: var(--accent-strong);
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #475467;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
}

.ghost-button:hover {
  background: #ffffff;
}

.explain-summary {
  color: #344054;
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.explain-sections {
  display: grid;
  gap: 10px;
}

.explain-section {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
}

.explain-section h4 {
  font-size: 13px;
  margin: 0;
}

.explain-section p {
  color: #344054;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.explain-section small {
  color: var(--muted);
  font-size: 11px;
}

.explain-citations {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.explain-disclaimer {
  color: #614700;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.notes {
  display: grid;
  gap: 8px;
}

ul {
  display: grid;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  color: #344054;
  font-size: 14px;
  line-height: 1.48;
}

.risk-notes li {
  color: #614700;
}

.disclaimer {
  background: #f3f5f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #475467;
  font-size: 13px;
  line-height: 1.5;
  margin-top: auto;
  padding: 12px;
}

.error {
  color: var(--red);
  padding: 18px;
}

@media (max-width: 980px) {
  .controls,
  .workspace {
    grid-template-columns: 1fr;
  }

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

  .watchlist-form {
    grid-template-columns: 1fr;
  }

  .signal-toolbar {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    max-height: none;
    position: static;
  }

  .signal-list .table-wrap {
    max-height: none;
  }

  .signal-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

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

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

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

  .metrics article:nth-child(2),
  .metrics article:nth-child(4),
  .status-grid article {
    border-right: 0;
  }

  .status-grid article {
    border-bottom: 1px solid var(--line);
  }

  .sync-instrument {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 1440px);
    padding-top: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 24px;
  }

  .controls {
    padding: 12px;
  }

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

  .metrics article {
    border-right: 0;
  }

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

  .stock-chart {
    height: 260px;
  }

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

  .stock-insight-grid,
  .stock-fundamentals-grid {
    grid-template-columns: 1fr;
  }

  .stock-chart-main {
    height: 300px;
  }

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