@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&display=swap");

@font-face {
  font-family: "Quant Noto Sans SC";
  src: url("/assets/fonts/NotoSansCJKsc-Regular.ttf") format("truetype");
  font-display: swap;
  font-weight: 400 700;
}

@font-face {
  font-family: "Quant Noto Sans SC";
  src: url("/assets/fonts/NotoSansCJKsc-Bold.ttf") format("truetype");
  font-display: swap;
  font-weight: 700 900;
}

:root {
  --bg: #f7f5ee;
  --bg-rgb: 247, 245, 238;
  --sidebar: #f0eee6;
  --surface: #fffefa;
  --surface-rgb: 255, 254, 250;
  --surface-2: #f3f0e8;
  --surface-3: #e9e4d8;
  --ink: #141413;
  --ink-soft: #3d3b37;
  --muted: #6f6b64;
  --muted-2: #958f84;
  --line: rgba(20, 20, 19, 0.1);
  --line-strong: rgba(20, 20, 19, 0.18);
  --accent: #8c5a2b;
  --accent-strong: #6f4522;
  --accent-soft: rgba(140, 90, 43, 0.12);
  --positive: #28795a;
  --negative: #b23b32;
  --warning: #b06d18;
  --orange: #c9642d;
  --neutral: #6f6b64;
  --shadow:
    0 1px 2px rgba(20, 20, 19, 0.04), 0 18px 46px rgba(64, 49, 32, 0.08);
  --shadow-soft: 0 10px 30px rgba(64, 49, 32, 0.06);
  --glow: 0 18px 46px rgba(140, 90, 43, 0.12);
  --radius: 12px;
  --font-ui:
    "Inter", "Quant Noto Sans SC", "PingFang SC", "Microsoft YaHei",
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --factor-1: #8c5a2b;
  --factor-2: #28795a;
  --factor-3: #b06d18;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255, 254, 250, 0.94),
      rgba(247, 245, 238, 0.98) 42%,
      #f0eee6 100%
    ),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

svg {
  display: block;
}

.mono,
.market-clock strong,
.metric-card strong,
.data-table td,
.price,
.gauge-score strong,
.perf-metric strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 200ms ease-in-out;
}

body.sidebar-collapsed .layout {
  grid-template-columns: 64px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(
      180deg,
      rgba(250, 249, 245, 0.98),
      rgba(240, 238, 230, 0.96)
    ),
    var(--sidebar);
  padding: 18px 14px;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-radius: 10px;
  padding: 4px 8px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(20, 20, 19, 0.14);
  border-radius: 10px;
  background: #141413;
  box-shadow: 0 10px 24px rgba(20, 20, 19, 0.12);
  color: #faf9f5;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.brand-copy {
  min-width: 0;
  transition: opacity 100ms ease;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .side-nav span,
body.sidebar-collapsed .side-status,
body.sidebar-collapsed .sidebar-toggle svg {
  opacity: 0;
  pointer-events: none;
}

.side-nav {
  display: grid;
  gap: 3px;
}

.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.side-nav a svg,
.icon-button svg,
.sidebar-toggle svg,
.search-input svg,
.icon-label svg,
.sector-icon svg,
.stale-banner button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.icon-label svg {
  width: 16px;
  height: 16px;
}

.side-nav a:hover,
.side-nav a:focus-visible {
  border-color: rgba(20, 20, 19, 0.08);
  background: rgba(255, 254, 250, 0.72);
  color: var(--ink);
  outline: none;
}

.side-nav a.active {
  border-color: rgba(140, 90, 43, 0.16);
  background: rgba(140, 90, 43, 0.1);
  color: var(--ink);
}

.side-nav a.active::before {
  position: absolute;
  left: -12px;
  width: 3px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.side-status {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.58);
}

.side-status span,
.side-status small {
  color: var(--muted);
  font-size: 11px;
}

.side-status strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.sidebar-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

body.sidebar-collapsed .sidebar-toggle::before {
  color: var(--muted);
  content: "›";
  font-size: 24px;
}

.workspace {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.42), transparent 210px),
    transparent;
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--bg-rgb), 0.86);
  padding: 15px 28px;
  backdrop-filter: blur(16px);
}

.page-heading {
  min-width: 0;
}

.eyebrow,
.panel-kicker,
.label {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-heading h1 {
  margin-bottom: 0;
  overflow: hidden;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.connection-badge,
.user-chip,
.pill,
.tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  white-space: nowrap;
}

.connection-badge {
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.user-chip {
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid rgba(20, 20, 19, 0.14);
  background: #141413;
  color: #faf9f5;
  font-size: 11px;
  font-weight: 700;
}

.connection-badge.live {
  border-color: rgba(40, 121, 90, 0.24);
  background: rgba(40, 121, 90, 0.09);
  color: var(--positive);
}

.connection-badge.mock {
  border-color: rgba(176, 109, 24, 0.28);
  background: rgba(176, 109, 24, 0.1);
  color: var(--warning);
}

.connection-badge.error {
  border-color: rgba(178, 59, 50, 0.26);
  background: rgba(178, 59, 50, 0.09);
  color: var(--negative);
}

.connection-badge.stale {
  border-color: rgba(176, 109, 24, 0.34);
  background: rgba(176, 109, 24, 0.11);
  color: var(--warning);
}

.market-clock {
  display: grid;
  gap: 2px;
  min-width: 154px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: right;
}

.market-clock span {
  color: var(--muted);
  font-size: 11px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(140, 90, 43, 0.34);
  color: var(--accent);
  outline: none;
  transform: translateY(-1px);
}

.page-content {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.stale-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(176, 109, 24, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(176, 109, 24, 0.12),
    rgba(255, 254, 250, 0.7)
  );
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.stale-banner strong,
.stale-banner span {
  display: block;
}

.stale-banner strong {
  margin-bottom: 4px;
  color: var(--warning);
  font-size: 13px;
}

.stale-banner span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.stale-banner button {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(176, 109, 24, 0.3);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.62);
  color: var(--warning);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.stale-banner button:hover,
.stale-banner button:focus-visible {
  border-color: rgba(176, 109, 24, 0.56);
  outline: none;
}

.page-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  width: min(1480px, 100%);
  margin: auto auto 0;
  padding: 18px 24px 24px;
  color: var(--muted);
  font-size: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.main-grid,
.overview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.span-3 {
  grid-column: span 3;
}
.span-4 {
  grid-column: span 4;
}
.span-5 {
  grid-column: span 5;
}
.span-6 {
  grid-column: span 6;
}
.span-7 {
  grid-column: span 7;
}
.span-8 {
  grid-column: span 8;
}
.span-12 {
  grid-column: 1 / -1;
}

.panel,
.metric-card,
.sentiment-card,
.pick-card,
.perf-metric,
.strategy-toolbar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel,
.sentiment-card {
  min-width: 0;
  padding: 18px;
}

.panel,
.metric-card,
.sentiment-card,
.pick-card,
.perf-metric,
.sector-card,
.treemap-cell,
.compact-action-item,
.signal-card {
  transition:
    border-color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.panel:hover,
.metric-card:hover,
.sentiment-card:hover,
.pick-card:hover,
.perf-metric:hover,
.sector-card:hover,
.signal-card:hover {
  border-color: rgba(140, 90, 43, 0.24);
  box-shadow: var(--shadow), var(--glow);
  transform: translateY(-1px);
}

.panel-header,
.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-title h2,
.module-header h2,
.section-heading h2 {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.panel-title p:not(.panel-kicker),
.module-header p:not(.panel-kicker),
.section-heading span {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 9px;
  border: 1px solid var(--line);
  background: rgba(20, 20, 19, 0.03);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pill.positive,
.tag.positive,
.change-badge.positive {
  border-color: rgba(40, 121, 90, 0.24);
  background: rgba(40, 121, 90, 0.1);
  color: var(--positive);
}

.pill.negative,
.tag.negative,
.change-badge.negative {
  border-color: rgba(178, 59, 50, 0.24);
  background: rgba(178, 59, 50, 0.1);
  color: var(--negative);
}

.pill.warning,
.tag.warning {
  border-color: rgba(176, 109, 24, 0.26);
  background: rgba(176, 109, 24, 0.1);
  color: var(--warning);
}

.pill.blue,
.tag.blue {
  border-color: rgba(140, 90, 43, 0.22);
  background: rgba(140, 90, 43, 0.1);
  color: var(--accent);
}

.tone-positive {
  color: var(--positive);
}
.tone-negative {
  color: var(--negative);
}
.tone-neutral {
  color: var(--neutral);
}
.tone-warning {
  color: var(--warning);
}
.tone-blue {
  color: var(--accent);
}

.metric-card {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 15px 16px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 254, 250, 0.96),
      rgba(250, 248, 242, 0.96)
    ),
    var(--surface);
}

.metric-card span,
.metric-card small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card span {
  font-size: 12px;
  font-weight: 650;
}

.metric-card strong {
  overflow: hidden;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
  gap: 1px;
  align-items: stretch;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.decision-copy {
  min-width: 0;
  background:
    linear-gradient(
      135deg,
      rgba(255, 254, 250, 0.98),
      rgba(243, 240, 232, 0.94)
    ),
    var(--surface);
  padding: 30px;
}

.decision-copy h2 {
  max-width: 850px;
  margin: 4px 0 10px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
}

.decision-copy p:not(.panel-kicker) {
  max-width: 860px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

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

.decision-metric {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 6px;
  background: var(--surface-2);
  padding: 18px;
}

.decision-metric span,
.action-card span,
.strategy-snapshot-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.decision-metric strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.sentiment-card {
  grid-column: span 8;
  min-height: 360px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 254, 250, 0.98),
      rgba(243, 240, 232, 0.86)
    ),
    var(--surface);
}

.info-tip {
  position: relative;
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  place-items: center;
  vertical-align: 2px;
  border: 1px solid rgba(140, 90, 43, 0.28);
  border-radius: 50%;
  background: rgba(140, 90, 43, 0.09);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

.info-tip > span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  width: min(360px, 82vw);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.98);
  box-shadow: var(--shadow);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.info-tip:hover > span,
.info-tip:focus-visible > span {
  opacity: 1;
  transform: translate(-50%, 0);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 0 rgba(40, 121, 90, 0.38);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px rgba(40, 121, 90, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 121, 90, 0);
  }
}

.gauge-wrap {
  position: relative;
  display: grid;
  justify-items: center;
  margin-top: 4px;
}

.sentiment-gauge {
  width: min(260px, 100%);
  height: auto;
  overflow: visible;
}

.gauge-zone {
  fill: none;
  stroke-linecap: round;
  stroke-width: 12;
}

.z1 {
  stroke: #b23b32;
}
.z2 {
  stroke: #c9642d;
}
.z3 {
  stroke: #8892a4;
}
.z4 {
  stroke: #8aa681;
}
.z5 {
  stroke: #28795a;
}

.gauge-dot {
  fill: var(--accent);
}

.gauge-score {
  position: absolute;
  top: 72px;
  display: grid;
  justify-items: center;
}

.gauge-score strong {
  font-size: 48px;
  line-height: 1;
}

.gauge-score span {
  color: var(--muted);
  font-size: 14px;
}

.sentiment-compare {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: -8px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.sentiment-trend-wide {
  margin-top: 8px;
}

.trend-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.sparkline {
  width: 100%;
  height: auto;
  color: currentColor;
}

.sparkline path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.heatmap-panel {
  min-height: 520px;
}

.heatmap-panel.is-refreshing {
  opacity: 0.86;
}

.heatmap-stale-note {
  margin: 0 24px 14px;
  padding: 10px 12px;
  border: 1px solid rgba(176, 109, 24, 0.26);
  border-radius: 12px;
  background: rgba(176, 109, 24, 0.1);
  color: var(--warning);
  font-size: 12px;
}

.heatmap-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.market-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.025);
}

.treemap-grid {
  display: grid;
  grid-template-columns: repeat(72, minmax(0, 1fr));
  grid-auto-rows: 4px;
  gap: 2px;
  height: 420px;
}

.treemap-cell {
  position: relative;
  display: grid;
  min-width: 0;
  align-content: end;
  overflow: hidden;
  border: 1px solid rgba(255, 254, 250, 0.22);
  border-radius: 5px;
  background: var(--cell);
  padding: 8px;
}

.treemap-cell:hover {
  z-index: 2;
  border-color: rgba(20, 20, 19, 0.38);
  transform: none;
}

.treemap-cell strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.1vw, 18px);
}

.treemap-cell small {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 254, 250, 0.82);
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.treemap-cell em {
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.9vw, 13px);
  font-style: normal;
}

.sector-float {
  position: absolute;
  top: 6px;
  left: 7px;
  color: rgba(255, 254, 250, 0.76);
  font-size: 10px;
  font-weight: 700;
}

.segmented button,
.mini-tabs button,
.mini-tabs a,
.ghost-button,
.primary-button,
.segmented select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.72);
  color: var(--muted);
  cursor: pointer;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
}

.mini-tabs button {
  gap: 6px;
}

.mini-tabs button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented button.active,
.mini-tabs button.active,
.mini-tabs a.active,
.primary-button {
  border-color: transparent;
  background: #141413;
  color: #faf9f5;
}

.panel-link {
  color: var(--muted);
  font-size: 11px;
}

.panel-link {
  justify-self: end;
  margin-top: 12px;
  color: var(--accent);
}

.sector-strip {
  display: grid;
  grid-auto-columns: minmax(130px, 1fr);
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sector-card {
  display: grid;
  gap: 9px;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
}

.sector-card.best {
  border-top: 3px solid var(--positive);
  background:
    linear-gradient(rgba(40, 121, 90, 0.08), transparent), var(--surface);
}

.sector-card.worst {
  border-top: 3px solid var(--negative);
  background:
    linear-gradient(rgba(178, 59, 50, 0.08), transparent), var(--surface);
}

.sector-card:hover {
  transform: translateY(-1px);
}

.sector-icon {
  color: var(--accent);
}

.sector-icon svg {
  width: 24px;
  height: 24px;
}

.sector-card small,
.sector-card div {
  color: var(--muted);
  font-size: 11px;
}

.sector-card strong {
  font-family: var(--font-mono);
  font-size: 22px;
}

.range-bar {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.08);
}

.range-bar span {
  position: absolute;
  left: var(--pos);
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

.range-bar.positive span {
  background: var(--positive);
}
.range-bar.negative span {
  background: var(--negative);
}

.stack,
.bar-list,
.timeline,
.alert-list,
.compact-action-list {
  display: grid;
  gap: 10px;
}

.strategy-status-panel .compact-action-list {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.strategy-status-panel .compact-action-item {
  display: grid;
  gap: 14px;
  min-height: 112px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(116px, 1fr) 72px;
  gap: 10px;
  align-items: center;
}

.bar-label strong,
.bar-label span,
.compact-action-item strong,
.compact-action-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-label strong,
.compact-action-item strong {
  font-size: 13px;
  font-weight: 700;
}

.bar-label span,
.compact-action-item span,
.note {
  color: var(--muted);
  font-size: 12px;
}

.bar-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.bar-track {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.08);
}

.bar-fill {
  width: clamp(0%, var(--bar), 100%);
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--accent));
}

.score-block {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.score-ring,
.mini-ring {
  --score: 0%;
  --score-color: var(--accent);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 58%, transparent 59%),
    conic-gradient(var(--score-color) var(--score), rgba(20, 20, 19, 0.08) 0);
}

.score-ring {
  width: 124px;
  height: 124px;
}

.score-ring strong {
  font-family: var(--font-mono);
  font-size: 28px;
}

.score-ring span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.timeline-item,
.alert-item,
.compact-action-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(20, 20, 19, 0.025);
  padding: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.timeline-time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.strategy-log-console {
  display: grid;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(20, 20, 19, 0.035), rgba(20, 20, 19, 0.012)),
    rgba(255, 254, 250, 0.7);
}

.strategy-log-line {
  display: grid;
  grid-template-columns: 168px 72px 148px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 820px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
}

.strategy-log-line:last-child {
  border-bottom: 0;
}

.strategy-log-line:hover {
  background: rgba(140, 90, 43, 0.055);
}

.strategy-log-line span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-log-line p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.strategy-log-line .log-level {
  justify-self: start;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(20, 20, 19, 0.06);
}

.strategy-log-line.positive .log-level {
  color: var(--positive);
}
.strategy-log-line.warning .log-level {
  color: var(--warning);
}
.strategy-log-line.negative .log-level {
  color: var(--negative);
}
.strategy-log-line.blue .log-level {
  color: var(--accent);
}

.inline-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.compact-action-meta,
.strategy-snapshot-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.compact-action-meta span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

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

.signal-card {
  display: grid;
  min-width: 0;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.78);
  padding: 15px;
}

.signal-card.positive {
  border-left-color: var(--positive);
}
.signal-card.warning {
  border-left-color: var(--warning);
}
.signal-card.negative {
  border-left-color: var(--negative);
}

.signal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.signal-card-head div {
  min-width: 0;
}

.signal-card-head span,
.signal-card-metrics span,
.signal-rationale dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.signal-card-head strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  font-size: 17px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.signal-card-metrics div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 9px;
}

.signal-card-metrics strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.detail-box {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(20, 20, 19, 0.025);
  padding: 12px;
}

.detail-box span,
.detail-box small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-box strong {
  display: block;
  overflow: hidden;
  margin: 4px 0;
  font-family: var(--font-mono);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.data-table td {
  font-size: 13px;
}

.data-table tbody tr:hover {
  background: rgba(140, 90, 43, 0.055);
}

.profit-row {
  background: rgba(40, 121, 90, 0.035);
}

.loss-row {
  background: rgba(178, 59, 50, 0.035);
}

.pnl-bar {
  position: relative;
  min-width: 90px;
  height: 24px;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(20, 20, 19, 0.06);
}

.pnl-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--bar);
}

.pnl-bar.positive i {
  left: 50%;
  background: rgba(40, 121, 90, 0.28);
}

.pnl-bar.negative i {
  right: 50%;
  background: rgba(178, 59, 50, 0.28);
}

.pnl-bar span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
}

.mini-donut {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 56%, transparent 57%),
    conic-gradient(var(--accent) var(--score), rgba(20, 20, 19, 0.08) 0);
}

.allocation-panel {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.allocation-donut {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 55%, transparent 56%),
    conic-gradient(
      #8c5a2b 0 34%,
      #28795a 34% 60%,
      #b06d18 60% 78%,
      #b23b32 78% 100%
    );
}

.strategy-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.strategy-toolbar {
  margin-bottom: 16px;
  padding: 12px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 254, 250, 0.92),
      rgba(243, 240, 232, 0.78)
    ),
    var(--surface);
}

.strategy-method-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 20, 19, 0.025);
}

.strategy-method-strip h2 {
  margin: 1px 0 5px;
  font-size: 18px;
}

.strategy-method-strip span,
.strategy-method-strip small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.strategy-method-strip small {
  justify-self: end;
  max-width: 360px;
  text-align: right;
}

.search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.76);
  padding: 8px 12px;
  color: var(--muted);
}

.search-input input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
}

.checkbox-field {
  min-height: 34px;
  align-content: center;
}

.checkbox-field input {
  width: auto;
  min-height: 0;
  margin-right: 6px;
}

.checkbox-field span {
  color: var(--ink);
}

.is-muted {
  opacity: 0.45;
}

.holding-state {
  margin-top: 5px;
}

.inline-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

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

.strategy-overview-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.72);
  padding: 14px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.strategy-overview-card:hover {
  border-color: rgba(140, 90, 43, 0.24);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.strategy-overview-card h3 {
  margin: 2px 0;
  font-size: 17px;
}

.strategy-overview-card p {
  min-height: 34px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.strategy-card-metrics div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(243, 240, 232, 0.64);
  padding: 8px;
}

.strategy-card-metrics span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.strategy-card-metrics strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 15px;
}

.strategy-holding-groups,
.strategy-instance-list {
  display: grid;
  gap: 12px;
}

.strategy-holding-group,
.strategy-instance-panel {
  display: grid;
  min-width: 0;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.72);
  padding: 12px;
}

.strategy-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.strategy-group-head h3 {
  margin: 2px 0;
  font-size: 16px;
}

.strategy-group-head small,
.instance-detail {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.strategy-group-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.strategy-group-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.strategy-group-metrics div {
  min-width: 0;
  border: 1px solid rgba(31, 33, 31, 0.08);
  border-radius: 8px;
  background: rgba(243, 240, 232, 0.62);
  padding: 8px;
}

.strategy-group-metrics span,
.subsection-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.strategy-group-metrics strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.strategy-group-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 12px;
  align-items: start;
}

.subsection-label {
  margin-bottom: 7px;
}

.crypto-funding-signal-list {
  display: grid;
  gap: 10px;
}

.crypto-funding-signal {
  display: grid;
  min-width: 0;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.82);
  padding: 13px 14px 14px;
}

.crypto-funding-signal.positive {
  border-left-color: var(--positive);
}

.crypto-funding-signal.warning {
  border-left-color: var(--warning);
}

.crypto-funding-signal.negative {
  border-left-color: var(--negative);
}

.crypto-funding-signal-head,
.crypto-funding-signal-foot {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.crypto-funding-signal-head > div {
  min-width: 0;
}

.crypto-funding-signal-head .tag {
  flex: 0 0 auto;
}

.crypto-funding-signal-head span,
.crypto-funding-signal-metrics dt,
.crypto-funding-signal-foot {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.crypto-funding-signal-head strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.12;
}

.crypto-funding-signal-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.crypto-funding-signal-metrics div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(var(--surface-rgb), 0.84);
  padding: 8px 9px;
}

.crypto-funding-signal-metrics dt,
.crypto-funding-signal-metrics dd {
  margin: 0;
}

.crypto-funding-signal-metrics dd {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
}

.crypto-funding-signal-foot {
  align-items: flex-start;
  line-height: 1.45;
}

.crypto-funding-signal-foot span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.crypto-funding-signal-foot time {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.compact-action-list.dense {
  gap: 7px;
}

.compact-action-list.dense .compact-action-item {
  border-radius: 8px;
  padding: 9px;
}

.empty-state.small {
  min-height: 64px;
  padding: 14px;
}

.strategy-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.strategy-create-form .span-2,
.form-actions.span-2 {
  grid-column: 1 / -1;
}

.strategy-create-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.strategy-create-form input,
.strategy-create-form select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.82);
  color: var(--ink);
  padding: 7px 10px;
  outline: none;
}

.strategy-create-form input:focus,
.strategy-create-form select:focus {
  border-color: rgba(140, 90, 43, 0.42);
  box-shadow: 0 0 0 3px rgba(140, 90, 43, 0.08);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.form-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-status.negative {
  color: var(--negative);
}

.action-status.loading {
  color: var(--muted);
}

.action-status.success {
  color: var(--positive);
}

.action-status.error,
.action-status.forbidden {
  color: var(--negative);
}

.row-action {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.72);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transition:
    opacity 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    background 120ms ease;
}

.row-action:focus-visible {
  opacity: 1;
}

.row-action.danger:hover,
.row-action.danger:focus-visible {
  border-color: rgba(178, 59, 50, 0.32);
  background: rgba(178, 59, 50, 0.1);
  color: var(--negative);
  outline: none;
}

.stock-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stock-logo {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.stock-cell strong,
.stock-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.change-badge {
  justify-content: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.volume-bar {
  position: relative;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.06);
}

.volume-bar i {
  display: block;
  width: var(--bar);
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(140, 90, 43, 0.32),
    rgba(178, 59, 50, 0.3)
  );
}

.volume-bar span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
}

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

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 14px;
}

.pick-card {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 220px;
  padding: 16px;
}

.pick-card.fresh {
  border-left: 3px solid var(--accent);
  animation: freshPulse 3s ease-out;
}

@keyframes freshPulse {
  0%,
  80% {
    box-shadow:
      var(--shadow),
      0 0 22px rgba(140, 90, 43, 0.2);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

.mini-ring {
  width: 54px;
  height: 54px;
}

.mini-ring span {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.pick-rank {
  display: grid;
  min-width: 52px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.48);
}

.pick-rank span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.pick-rank strong {
  font-family: var(--font-mono);
  font-size: 18px;
}

.raw-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.35);
}

.raw-metric-grid div {
  min-width: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.raw-metric-grid div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.raw-metric-grid div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.raw-metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.raw-metric-grid strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 13px;
}

.factor-bars {
  display: grid;
  gap: 8px;
}

.factor-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.factor-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.08);
}

.factor-track i {
  display: block;
  width: var(--bar);
  height: 100%;
  background: var(--factor-color);
}

.trade-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.trade-levels div {
  padding: 10px;
  text-align: center;
}

.trade-levels div + div {
  border-left: 1px solid var(--line);
}

.trade-levels span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.trade-levels strong {
  font-family: var(--font-mono);
  font-size: 14px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.holding-signal-tags,
.holding-exit-alert {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.holding-exit-alert {
  max-width: 260px;
  flex-direction: column;
}

.holding-exit-alert small,
.muted-text {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

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

.chart-summary-bar > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 8px 11px;
  background: rgba(var(--surface-rgb), 0.92);
}

.chart-summary-bar span,
.chart-summary-bar small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-summary-bar strong {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equity-chart {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgba(20, 20, 19, 0.06);
}

.chart-grid-line.x-grid {
  stroke: rgba(20, 20, 19, 0.035);
}

.axis-line {
  stroke: rgba(20, 20, 19, 0.28);
  stroke-width: 1;
}

.axis-tick,
.axis-label {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.y-tick {
  text-anchor: end;
}

.x-tick {
  text-anchor: middle;
}

.axis-label {
  fill: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
}

.chart-x-label {
  text-anchor: end;
}

.zero-line {
  stroke: rgba(20, 20, 19, 0.2);
  stroke-dasharray: 6 8;
}

.drawdown-zone {
  fill: rgba(178, 59, 50, 0.08);
}

.equity-area {
  fill: url(#equityFill);
}

.equity-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15;
}

.benchmark-line {
  fill: none;
  stroke: var(--muted);
  stroke-dasharray: 6 7;
  stroke-width: 1.4;
}

.chart-last-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}

.chart-points {
  pointer-events: all;
}

.chart-point-hit {
  outline: none;
}

.chart-point-target {
  fill: transparent;
  pointer-events: all;
}

.chart-point-dot {
  fill: var(--surface);
  opacity: 0;
  stroke: var(--accent);
  stroke-width: 2.1;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.chart-hover-line {
  opacity: 0;
  stroke: rgba(20, 20, 19, 0.34);
  stroke-dasharray: 3 5;
  transition: opacity 0.12s ease;
}

.chart-tooltip-fo {
  display: none;
  overflow: visible;
  pointer-events: none;
}

.chart-point-hit:hover .chart-point-dot,
.chart-point-hit:focus .chart-point-dot,
.chart-point-hit:focus-visible .chart-point-dot {
  opacity: 1;
  transform: scale(1.15);
}

.chart-point-hit:hover .chart-hover-line,
.chart-point-hit:focus .chart-hover-line,
.chart-point-hit:focus-visible .chart-hover-line {
  opacity: 1;
}

.chart-point-hit:hover .chart-tooltip-fo,
.chart-point-hit:focus .chart-tooltip-fo,
.chart-point-hit:focus-visible .chart-tooltip-fo {
  display: block;
}

.chart-tooltip {
  display: grid;
  gap: 5px;
  width: 166px;
  padding: 9px 10px;
  border: 1px solid rgba(20, 20, 19, 0.2);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.98);
  box-shadow: 0 14px 34px rgba(20, 20, 19, 0.16);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.25;
}

.chart-tooltip-head,
.chart-tooltip-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-tooltip-head span,
.chart-tooltip-row span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tooltip-head b {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tooltip-main {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 850;
  line-height: 1;
}

.chart-tooltip-main small {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
}

.chart-tooltip-head strong,
.chart-tooltip-row b {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.legend-swatch {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.legend-swatch.strategy {
  background: var(--accent);
}

.legend-swatch.benchmark {
  background: repeating-linear-gradient(
    90deg,
    var(--muted) 0 5px,
    transparent 5px 9px
  );
}

.metric-strip {
  display: grid;
  grid-auto-columns: minmax(160px, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.perf-metric {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.perf-metric span,
.perf-metric small {
  color: var(--muted);
  font-size: 11px;
}

.perf-metric strong {
  font-size: 22px;
}

.source-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.source-status-grid > div {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 20, 19, 0.03);
}

.source-status-grid span,
.source-status-grid small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-status-grid strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="performance"] .page-content {
  width: min(1680px, 100%);
  padding-top: 18px;
}

body[data-page="performance"] .summary-grid {
  gap: 10px;
  margin-bottom: 12px;
}

body[data-page="performance"] .metric-card {
  gap: 5px;
  padding: 11px 12px;
}

body[data-page="performance"] .metric-card strong {
  font-size: 21px;
}

body[data-page="performance"] .strategy-toolbar {
  margin-bottom: 12px;
  padding: 10px 12px;
}

body[data-page="performance"] .side-status {
  gap: 3px;
  padding: 8px 10px;
}

body[data-page="performance"] .side-status small {
  display: none;
}

.performance-analysis-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.performance-chart-panel {
  padding: 14px;
}

.performance-chart-panel .panel-header {
  margin-bottom: 10px;
}

.performance-chart-panel .equity-chart {
  min-width: 920px;
}

.performance-metrics-panel {
  grid-column: 1 / -1;
  grid-auto-columns: minmax(128px, 1fr);
  gap: 8px;
  margin-bottom: 0;
}

.performance-metrics-panel .perf-metric {
  gap: 4px;
  padding: 10px 11px;
}

.performance-metrics-panel .perf-metric strong {
  font-size: 18px;
}

.performance-status-strip {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 20, 19, 0.025);
  color: var(--muted);
  font-size: 11px;
}

.performance-status-strip span {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  border-right: 1px solid var(--line);
  padding-right: 8px;
  overflow-wrap: anywhere;
}

.performance-status-strip span:last-child {
  border-right: 0;
}

.performance-status-strip b {
  color: var(--ink-soft);
  font-weight: 750;
}

.performance-frequency-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(176, 109, 24, 0.2);
  border-radius: 8px;
  background: rgba(176, 109, 24, 0.07);
}

.performance-technical-details {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(var(--surface-rgb), 0.74);
}

.performance-technical-details summary {
  cursor: pointer;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.performance-technical-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.compact-source-status {
  padding: 10px;
}

.compact-source-status > div {
  padding: 9px 10px;
}

.monthly-heat {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 5px;
}

.monthly-heat span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.monthly-heat .positive {
  background: rgba(40, 121, 90, 0.14);
  color: var(--positive);
}

.monthly-heat .negative {
  background: rgba(178, 59, 50, 0.13);
  color: var(--negative);
}

.monthly-heat .neutral {
  background: rgba(111, 107, 100, 0.12);
  color: var(--neutral);
}

.market-heat-section {
  grid-column: 1 / -1;
  margin: 0 0 16px;
}

.market-heat-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.heat-title-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--positive));
}

.market-heat-scroll {
  overflow-x: auto;
}

.market-heat-grid {
  display: grid;
  grid-template-columns: 64px repeat(var(--heat-cols), 40px);
  min-width: max-content;
  gap: 5px;
  align-items: center;
}

.heat-corner,
.heat-head {
  height: 132px;
}

.heat-head {
  display: grid;
  place-items: end center;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.05;
}

.heat-head span {
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.heat-date,
.heat-value {
  display: grid;
  height: 32px;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
}

.heat-date {
  color: var(--muted);
}

.heat-value {
  border-radius: 5px;
  font-weight: 700;
  background: var(--heat-bg);
  color: var(--heat-ink);
}

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

.heat-cell {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--heat-bg);
  color: var(--heat-ink);
}

.heat-cell strong,
.heat-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heat-cell span {
  margin-top: 4px;
  color: inherit;
  font-size: 12px;
}

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

.macro-indicator-card {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(var(--surface-rgb), 0.82);
}

.macro-indicator-card span,
.macro-indicator-card small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.macro-indicator-card strong {
  display: block;
  margin: 4px 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 20px;
}

.empty-sparkline {
  display: inline-flex;
  min-width: 60px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted-2);
  font-size: 10px;
}

.treemap-empty {
  grid-column: 1 / -1;
  grid-row: 1 / span 6;
}

.empty-state,
.error-state {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.error-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--negative);
}

.error-state span {
  display: block;
  margin-bottom: 16px;
}

@media (min-width: 1400px) {
  .sector-strip {
    grid-auto-columns: 1fr;
  }
}

@media (max-width: 1240px) {
  .summary-grid,
  .source-status-grid,
  .chart-summary-bar,
  .macro-indicator-grid,
  .pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-status-panel .compact-action-list {
    grid-template-columns: 1fr;
  }

  .decision-hero,
  .strategy-method-strip {
    grid-template-columns: 1fr;
  }

  .strategy-method-strip small {
    justify-self: start;
    max-width: none;
    text-align: left;
  }

  .sentiment-card,
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 6;
  }
}

@media (max-width: 920px) {
  .layout,
  body.sidebar-collapsed .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .side-nav a {
    flex: 0 0 auto;
  }

  .side-status,
  .sidebar-toggle,
  .brand-copy {
    display: none;
  }

  .topbar {
    position: static;
  }
}

@media (max-width: 760px) {
  .topbar,
  .topbar-actions,
  .panel-header,
  .module-header,
  .strategy-toolbar,
  .inline-between,
  .signal-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .user-chip,
  .connection-badge,
  .market-clock,
  .icon-button,
  .search-input {
    width: 100%;
  }

  .market-clock {
    text-align: left;
  }

  .page-content {
    padding: 16px;
  }

  .summary-grid,
  .decision-metrics,
  .source-status-grid,
  .chart-summary-bar,
  .signal-card-grid,
  .strategy-card-grid,
  .strategy-create-form,
  .split-detail,
  .heatmap-grid,
  .macro-indicator-grid,
  .pick-grid,
  .allocation-panel {
    grid-template-columns: 1fr;
  }

  .sentiment-card,
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: 1 / -1;
  }

  .decision-copy {
    padding: 20px;
  }

  .decision-copy h2 {
    font-size: 23px;
  }

  .score-block,
  .timeline-item {
    grid-template-columns: 1fr;
  }

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

  .performance-metrics-panel {
    grid-auto-columns: minmax(120px, 72vw);
  }

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

  .performance-status-strip span {
    border-right: 0;
    padding-right: 0;
  }
}

.readonly-tabs {
  align-items: center;
}

.readonly-tab,
.readonly-note {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: default;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
}

.readonly-tab.active {
  border-color: rgba(140, 90, 43, 0.28);
  background: rgba(140, 90, 43, 0.08);
  color: var(--accent);
}

.action-cell,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.action-cell .row-action {
  opacity: 1;
}

.action-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.action-status.loading {
  color: var(--accent);
}

.action-status.success {
  color: var(--positive);
}

.action-status.error,
.action-status.forbidden {
  color: var(--negative);
}

button[disabled],
button.is-loading {
  cursor: wait;
  opacity: 0.62;
}

/* Mobile-first trading surfaces */
.table-scroll-hint {
  display: none;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.row-action,
.icon-button,
.mini-tabs button,
.mini-tabs a {
  min-height: 40px;
}

.row-action {
  padding: 8px 12px;
}

.mini-tabs button,
.mini-tabs a {
  padding-inline: 14px;
}

@media (max-width: 760px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .layout,
  body.sidebar-collapsed .layout {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 12;
    top: 0;
    display: block;
    height: auto;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(var(--bg-rgb), 0.94);
    backdrop-filter: blur(18px);
  }

  .brand {
    display: none;
  }

  .side-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 0 2px;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav a {
    min-height: 40px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: rgba(255, 254, 250, 0.62);
    padding: 8px 12px;
  }

  .side-nav a.active::before {
    left: 12px;
    right: 12px;
    bottom: -1px;
    width: auto;
    height: 2px;
  }

  .side-status,
  .sidebar-toggle {
    display: none;
  }

  .topbar {
    position: relative;
    min-height: auto;
    padding: 14px 16px;
  }

  .page-heading h1 {
    white-space: normal;
  }

  body[data-page="holdings"] .table-scroll-hint {
    display: none;
  }

  body[data-page="holdings"] .table-wrap {
    overflow: visible;
    border: 0;
  }

  body[data-page="holdings"] .data-table,
  body[data-page="holdings"] .data-table tbody,
  body[data-page="holdings"] .data-table tr,
  body[data-page="holdings"] .data-table td {
    display: block;
    width: 100%;
    min-width: 0 !important;
  }

  body[data-page="holdings"] .data-table thead {
    display: none;
  }

  body[data-page="holdings"] .data-table tbody {
    display: grid;
    gap: 12px;
  }

  body[data-page="holdings"] .holding-card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-2);
    padding: 14px;
  }

  body[data-page="holdings"] .data-table td {
    border: 0;
    padding: 0;
    white-space: normal;
  }

  body[data-page="holdings"] .data-table td::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    content: attr(data-label);
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
  }

  body[data-page="holdings"] .holding-stock,
  body[data-page="holdings"] .holding-strategy-signal,
  body[data-page="holdings"] .holding-exit-cell,
  body[data-page="holdings"] .holding-market-value,
  body[data-page="holdings"] .data-table td:last-child,
  body[data-page="holdings"] .data-table td:nth-child(7) {
    grid-column: 1 / -1;
  }

  body[data-page="holdings"] .holding-stock strong,
  body[data-page="holdings"] .holding-price {
    font-size: 18px;
  }

  body[data-page="holdings"]
    .data-table
    td:nth-child(n + 4):nth-child(-n + 10) {
    display: none;
  }

  body[data-page="holdings"] .holding-card-row:focus-within td,
  body[data-page="holdings"] .holding-card-row:hover td {
    display: block;
  }

  body[data-page="holdings"] .action-cell {
    align-items: stretch;
  }

  body[data-page="holdings"] .action-cell .row-action {
    flex: 1 1 120px;
  }

  .signal-card {
    padding-bottom: 0;
    overflow: hidden;
  }

  .signal-card .card-actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    align-items: stretch;
    margin: 0 -15px;
    border-top: 1px solid var(--line);
    background: rgba(var(--surface-rgb), 0.96);
    padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
    backdrop-filter: blur(12px);
  }

  .signal-card .card-actions .ghost-button,
  .signal-card .card-actions .primary-button {
    min-height: 44px;
    flex: 1 1 auto;
  }

  body[data-page="performance"] .metric-strip {
    grid-auto-columns: minmax(145px, 1fr);
    order: -1;
  }

  .performance-chart-panel .chart-panel {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
  }

  .performance-chart-panel .equity-chart {
    min-width: 760px;
    max-height: 320px;
  }

  .chart-panel::before,
  .table-scroll-hint {
    display: block;
  }

  .chart-panel::before {
    position: sticky;
    left: 0;
    display: inline-block;
    margin-bottom: 8px;
    color: var(--muted);
    content: "左右滑动查看更多";
    font-size: 11px;
    font-weight: 700;
  }
}

.holding-card-list {
  display: none;
}

@media (max-width: 760px) {
  .strategy-group-head,
  .strategy-group-actions {
    display: grid;
    justify-content: stretch;
  }

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

  .strategy-group-split {
    grid-template-columns: 1fr;
  }

  .crypto-funding-signal-head,
  .crypto-funding-signal-foot {
    display: grid;
    justify-content: stretch;
  }

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

  body[data-page="holdings"] .holding-card-list {
    display: grid;
    gap: 12px;
  }

  body[data-page="holdings"] .panel .holding-card-list + .table-scroll-hint,
  body[data-page="holdings"]
    .panel
    .holding-card-list
    + .table-scroll-hint
    + .table-wrap {
    display: none;
  }

  .holding-card {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-2);
    padding: 14px;
  }

  .holding-card-top,
  .holding-card-core {
    display: grid;
    gap: 10px;
  }

  .holding-card-top {
    grid-template-columns: minmax(0, 1.2fr) minmax(86px, 0.8fr) minmax(
        96px,
        0.8fr
      );
  }

  .holding-card-core {
    grid-template-columns: 1fr 1fr;
  }

  .holding-card span,
  .holding-card small,
  .holding-card-detail summary {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  .holding-card strong {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    font-family: var(--font-mono);
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .holding-card-detail {
    border-top: 1px solid var(--line);
    padding-top: 2px;
  }

  .holding-card-detail summary {
    min-height: 40px;
    cursor: pointer;
    line-height: 40px;
  }

  .holding-detail-grid {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 8px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.96), rgba(240, 238, 230, 0.98)),
    var(--bg);
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-panel {
  display: grid;
  gap: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

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

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(247, 245, 238, 0.62);
  padding: 8px 11px;
  outline: none;
}

.login-form input:focus {
  border-color: rgba(140, 90, 43, 0.42);
  background: var(--surface);
}

/* ETFQuant-inspired high-density light dashboard shell */
:root {
  --bg: #f4f7fb;
  --bg-rgb: 244, 247, 251;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-rgb: 255, 255, 255;
  --surface-2: #f7fbff;
  --surface-3: #eaf2fc;
  --ink: #111827;
  --ink-soft: #263244;
  --muted: #6b788a;
  --muted-2: #9aa8ba;
  --line: rgba(25, 45, 72, 0.1);
  --line-strong: rgba(25, 45, 72, 0.18);
  --accent: #348bea;
  --accent-strong: #1671d8;
  --accent-soft: rgba(52, 139, 234, 0.12);
  --positive: #00a862;
  --negative: #ef4444;
  --warning: #f59e0b;
  --orange: #fb923c;
  --neutral: #64748b;
  --shadow:
    0 1px 2px rgba(17, 24, 39, 0.04), 0 10px 24px rgba(31, 59, 94, 0.08);
  --shadow-soft: 0 8px 20px rgba(31, 59, 94, 0.06);
  --glow: 0 16px 32px rgba(52, 139, 234, 0.14);
  --radius: 8px;
}

html {
  background: var(--bg);
  color-scheme: light;
}

body {
  background:
    radial-gradient(circle at 50% -18%, rgba(52, 139, 234, 0.08), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0, #f4f7fb 250px, #eef3f9 100%);
}

.layout,
body.sidebar-collapsed .layout {
  display: block;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(116px, auto) minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  width: 100%;
  height: auto;
  min-height: 72px;
  overflow: visible;
  border-right: 0;
  border-bottom: 1px solid rgba(25, 45, 72, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(31, 59, 94, 0.06);
  padding: 30px max(22px, calc((100vw - 1180px) / 2)) 0;
  backdrop-filter: blur(16px);
}

.site-notice {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-bottom: 1px solid rgba(52, 139, 234, 0.1);
  background: #e6f2ff;
  color: #5b6778;
  font-size: 12px;
  font-weight: 650;
}

.site-notice button {
  position: absolute;
  right: max(18px, calc((100vw - 1180px) / 2));
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #8a96a8;
  cursor: pointer;
}

.site-notice button svg {
  width: 16px;
  height: 16px;
}

.brand {
  align-self: center;
  min-height: 40px;
  padding: 0;
  border-radius: 6px;
}

.brand:hover {
  color: inherit;
}

.brand-mark {
  width: 134px;
  height: 36px;
  border: 0;
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #6b7280, #9ca3af);
  box-shadow: 0 8px 18px rgba(31, 59, 94, 0.18);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 16px;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(17, 24, 39, 0.22);
}

.brand-copy {
  display: none;
}

.side-nav {
  display: flex;
  min-width: 0;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.side-nav::-webkit-scrollbar {
  display: none;
}

.side-nav a {
  min-height: 44px;
  flex: 0 0 auto;
  gap: 7px;
  border: 0;
  border-radius: 0;
  padding: 10px 14px 13px;
  color: #111827;
  font-size: 14px;
  font-weight: 650;
}

.side-nav a svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.side-nav a:hover,
.side-nav a:focus-visible {
  background: transparent;
  color: var(--accent);
}

.side-nav a.active {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}

.side-nav a.active::before {
  left: 10px;
  right: 10px;
  bottom: -1px;
  width: auto;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--accent);
}

.side-status,
.sidebar-toggle {
  display: none;
}

.workspace {
  display: flex;
  min-height: calc(100vh - 72px);
  flex-direction: column;
  background: transparent;
}

.topbar {
  position: relative;
  top: auto;
  z-index: 3;
  width: min(1180px, calc(100% - 40px));
  min-height: 96px;
  margin: 0 auto;
  border-bottom: 0;
  background: transparent;
  padding: 30px 0 18px;
  backdrop-filter: none;
}

.page-heading .eyebrow {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  background: rgba(52, 139, 234, 0.1);
  color: var(--accent);
  padding: 6px 12px;
  font-size: 12px;
  text-transform: none;
}

.page-heading h1 {
  margin-top: 8px;
  color: #0b1220;
  font-size: 26px;
  font-weight: 760;
}

.topbar-actions {
  align-items: center;
}

.connection-badge,
.user-chip,
.market-clock,
.icon-button,
.pill,
.tag,
.segmented button,
.mini-tabs button,
.mini-tabs a,
.ghost-button,
.primary-button,
.segmented select {
  border-radius: 999px;
}

.connection-badge {
  min-height: 34px;
  border-color: rgba(52, 139, 234, 0.18);
  background: #eaf4ff;
  color: var(--accent);
}

.user-chip {
  background: #0f172a;
}

.user-chip[hidden] {
  display: none;
}

.market-clock {
  min-width: 164px;
  border-color: rgba(52, 139, 234, 0.16);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  padding: 6px 14px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-color: rgba(52, 139, 234, 0.18);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(52, 139, 234, 0.42);
  color: var(--accent);
}

.page-content,
.page-footer {
  width: min(1180px, calc(100% - 40px));
}

body[data-page="performance"] .page-content {
  width: min(1180px, calc(100% - 40px));
  padding-top: 0;
}

.page-content {
  padding: 0 0 34px;
}

.page-footer {
  padding: 10px 0 28px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.overview-top-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 18px;
}

.overview-daily-card {
  display: grid;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid rgba(25, 45, 72, 0.1);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.overview-daily-head {
  display: flex;
  min-height: 84px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(25, 45, 72, 0.08);
  padding: 20px 22px 16px;
}

.overview-daily-head h2 {
  margin: 3px 0 0;
  color: #0f172a;
  font-size: 19px;
}

.overview-daily-head > span {
  color: #6b788a;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.overview-focus-box {
  display: grid;
  gap: 7px;
  margin: 20px 22px;
  border: 1px solid rgba(52, 139, 234, 0.18);
  border-radius: 10px;
  background: #eef7ff;
  padding: 18px;
  text-align: center;
}

.overview-focus-box span,
.overview-focus-box small,
.overview-card-row span,
.overview-market-list span {
  color: #6b788a;
  font-size: 12px;
  font-weight: 650;
}

.overview-focus-box strong {
  color: #0f172a;
  font-size: 20px;
}

.overview-focus-box small {
  line-height: 1.5;
}

.overview-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 22px 20px;
}

.overview-card-row strong {
  font-family: var(--font-mono);
  font-size: 19px;
}

.overview-gauge-card {
  display: grid;
  min-height: 166px;
  place-items: center;
  padding: 6px 16px 18px;
}

.overview-gauge-card .sentiment-card {
  width: 100%;
  min-height: 0;
  grid-column: auto;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.overview-gauge-card .sentiment-card .module-header,
.overview-gauge-card .sentiment-trend-wide {
  display: none;
}

.overview-gauge-card .sentiment-gauge {
  width: min(230px, 100%);
}

.overview-gauge-card .gauge-score {
  top: 66px;
}

.overview-gauge-card .gauge-score strong {
  font-size: 38px;
}

.overview-market-list {
  display: grid;
  gap: 12px;
  padding: 20px 22px 22px;
}

.overview-market-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.overview-market-list strong {
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 18px;
  text-align: right;
}

.main-grid,
.overview-grid {
  gap: 18px;
}

.panel,
.metric-card,
.sentiment-card,
.pick-card,
.perf-metric,
.strategy-toolbar,
.sector-card,
.signal-card,
.strategy-overview-card,
.strategy-holding-group,
.strategy-instance-panel,
.macro-indicator-card,
.login-panel {
  border-color: rgba(25, 45, 72, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.panel,
.sentiment-card {
  padding: 18px 20px;
}

.panel:hover,
.metric-card:hover,
.sentiment-card:hover,
.pick-card:hover,
.perf-metric:hover,
.sector-card:hover,
.signal-card:hover,
.strategy-overview-card:hover {
  border-color: rgba(52, 139, 234, 0.26);
  box-shadow: var(--shadow), var(--glow);
}

.panel-title h2,
.module-header h2,
.section-heading h2 {
  color: #111827;
  font-size: 18px;
  font-weight: 760;
}

.eyebrow,
.panel-kicker,
.label {
  color: var(--accent);
  letter-spacing: 0;
}

.metric-card {
  min-height: 98px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98)),
    var(--surface);
  padding: 16px 18px;
}

.metric-card span {
  color: #5f6f83;
  font-size: 13px;
}

.metric-card strong {
  color: #0f172a;
  font-size: 24px;
}

.metric-card small {
  color: #7b8798;
}

.pill.blue,
.tag.blue,
.readonly-tab.active {
  border-color: rgba(52, 139, 234, 0.22);
  background: rgba(52, 139, 234, 0.1);
  color: var(--accent);
}

.segmented button.active,
.mini-tabs button.active,
.mini-tabs a.active,
.primary-button {
  background: var(--accent);
  box-shadow: 0 10px 18px rgba(52, 139, 234, 0.24);
  color: #ffffff;
}

.ghost-button:hover,
.segmented button:hover,
.mini-tabs button:hover,
.mini-tabs a:hover {
  border-color: rgba(52, 139, 234, 0.32);
  color: var(--accent);
}

.decision-hero {
  overflow: hidden;
  border-color: rgba(25, 45, 72, 0.1);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.decision-copy {
  background:
    linear-gradient(135deg, rgba(234, 244, 255, 0.88), rgba(255, 255, 255, 0.98)),
    var(--surface);
  padding: 26px 28px;
}

.decision-copy h2 {
  font-size: 28px;
}

.decision-metric {
  background: #f8fbff;
}

.table-wrap {
  border-color: rgba(25, 45, 72, 0.1);
  border-radius: 8px;
}

.data-table th {
  background: #f7fbff;
  color: #5f6f83;
}

.data-table td {
  border-color: rgba(25, 45, 72, 0.07);
}

.data-table tbody tr:hover {
  background: rgba(52, 139, 234, 0.055);
}

.bar-track,
.range-bar {
  background: #eef3f9;
}

.bar-fill {
  background: var(--bar-color, var(--accent));
}

.score-ring,
.mini-ring {
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(var(--score-color) var(--score), #eef3f9 0);
}

.sentiment-gauge {
  filter: drop-shadow(0 8px 18px rgba(31, 59, 94, 0.08));
}

.z1 {
  stroke: #38bdf8;
}
.z2 {
  stroke: #7dd3fc;
}
.z3 {
  stroke: #cfd8e3;
}
.z4 {
  stroke: #fecaca;
}
.z5 {
  stroke: #ef4444;
}

.gauge-score strong {
  color: #38bdf8;
}

.market-heat-section {
  margin-bottom: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.market-heat-title {
  align-items: center;
  margin: 8px 0 12px;
}

.market-heat-title h2 {
  color: #0f172a;
  font-size: 18px;
}

.heat-title-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background:
    linear-gradient(90deg, #87c4ff 0 33%, #ffffff 33% 36%, #fecaca 36% 66%, #ffffff 66% 69%, #ef4444 69%),
    #eaf4ff;
}

.market-heat-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.market-heat-grid {
  --heat-cell: 30px;
  display: grid;
  grid-template-columns: 48px repeat(var(--heat-cols), var(--heat-cell));
  min-width: calc(48px + var(--heat-cols) * var(--heat-cell));
  align-items: stretch;
  gap: 2px;
}

.heat-corner {
  border-bottom: 1px solid #c6d3e2;
}

.heat-head {
  display: grid;
  min-height: 72px;
  align-items: end;
  border-bottom: 1px solid #c6d3e2;
  padding-bottom: 6px;
  color: #61738a;
  font-size: 11px;
  writing-mode: vertical-rl;
}

.heat-head span {
  max-height: 66px;
}

.heat-date,
.heat-value {
  display: grid;
  min-height: 25px;
  align-items: center;
  justify-items: center;
  border: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 750;
}

.heat-date {
  background: #ffffff;
  color: #5f6f83;
}

.heat-value {
  background: var(--heat-bg);
  color: var(--heat-ink);
}

.heat-value.total-cell {
  box-shadow: inset 0 0 0 1px rgba(25, 45, 72, 0.06);
}

.heatmap-grid {
  gap: 8px;
}

.heat-cell {
  border-color: rgba(25, 45, 72, 0.08);
  border-radius: 6px;
  background: var(--heat-bg);
}

.strategy-log-console {
  border-radius: 8px;
  background: #0f172a;
}

.strategy-log-line {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.strategy-log-line p {
  color: #e5edf7;
}

.strategy-log-line span {
  color: #9fb1c7;
}

.chart-grid-line {
  stroke: rgba(25, 45, 72, 0.08);
}

.chart-grid-line.x-grid {
  stroke: rgba(25, 45, 72, 0.05);
}

.axis-line {
  stroke: rgba(25, 45, 72, 0.28);
}

.equity-line,
.legend-swatch.strategy,
.sparkline path {
  stroke: var(--accent);
}

.chart-last-dot,
.chart-point-dot {
  fill: #ffffff;
  stroke: var(--accent);
}

.chart-tooltip {
  border-color: rgba(25, 45, 72, 0.16);
  background: rgba(255, 255, 255, 0.98);
}

.login-page {
  background:
    radial-gradient(circle at 50% 0, rgba(52, 139, 234, 0.14), transparent 30rem),
    linear-gradient(180deg, #f8fbff, #eef3f9);
}

@media (max-width: 1240px) {
  .sidebar {
    padding-inline: 20px;
  }

  .topbar,
  .page-content,
  .page-footer {
    width: calc(100% - 40px);
  }

  .overview-top-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .sidebar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    padding-top: 36px;
    padding-bottom: 8px;
  }

  .brand {
    justify-self: start;
  }

  .side-nav {
    justify-content: flex-start;
  }

  .topbar {
    min-height: auto;
    padding-top: 18px;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: sticky;
    display: grid;
    padding: 34px 12px 8px;
    background: rgba(255, 255, 255, 0.94);
  }

  .brand {
    display: flex;
  }

  .brand-mark {
    width: 116px;
  }

  .side-nav a {
    min-height: 38px;
    border: 1px solid rgba(25, 45, 72, 0.1);
    border-radius: 999px;
    background: #ffffff;
    padding: 8px 11px;
  }

  .side-nav a.active::before {
    display: none;
  }

  .topbar,
  .page-content,
  .page-footer {
    width: calc(100% - 24px);
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .overview-top-cards {
    gap: 12px;
  }

  .overview-daily-card {
    min-height: auto;
  }

  .metric-card {
    min-height: 88px;
    padding: 13px;
  }

  .metric-card strong {
    font-size: 20px;
  }

  .market-heat-grid {
    --heat-cell: 28px;
  }
}

.login-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-status.success {
  color: var(--positive);
}

.login-status.error {
  color: var(--negative);
}
