:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f4f4f5;
  --ink: #27272a;
  --ink-strong: #09090b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --line: #e4e4e7;
  --line-soft: #f0f0f2;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --gold: #a16207;
  --gold-soft: #fefce8;
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.06);
  --radius: 8px;
  --shadcn-background: #ffffff;
  --shadcn-foreground: #09090b;
  --shadcn-card: #ffffff;
  --shadcn-muted: #f4f4f5;
  --shadcn-muted-foreground: #71717a;
  --shadcn-border: #e4e4e7;
  --shadcn-ring: #18181b;
  --shadcn-primary: #18181b;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, #f8fafc 0, #eef2f6 190px),
    var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.68;
}

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

h1 {
  margin-bottom: 0;
  color: var(--ink-strong);
  font-size: 25px;
  line-height: 1.16;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  color: var(--ink-strong);
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0;
}

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

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  padding: 16px 18px;
  border: 1px solid #cfd8e5;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92)),
    linear-gradient(90deg, rgba(217, 45, 32, 0.1), rgba(37, 99, 235, 0.08));
  box-shadow: var(--shadow);
}

.hero > div:first-child {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 300px;
  flex-wrap: wrap;
}

#refreshBtn {
  min-height: 36px;
  padding: 0 14px;
  background: var(--ink-strong);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 23, 40, 0.16);
}

#refreshBtn:hover:not(:disabled) {
  background: #25314a;
}

#statusText {
  position: relative;
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: 30px;
  max-width: 420px;
  padding: 0 10px 0 24px;
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#statusText::before {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(7, 148, 85, 0.12);
  content: "";
  transform: translateY(-50%);
}

.workspace-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.workspace-tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  text-align: left;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.04);
}

.workspace-tab span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef3f9;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}

.workspace-tab strong {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tab.active {
  border-color: #f0aaa4;
  background: linear-gradient(180deg, #ffffff, #fff8f7);
  color: var(--ink-strong);
  box-shadow: inset 0 -3px 0 var(--red), 0 10px 22px rgba(217, 45, 32, 0.08);
}

.workspace-tab.active span {
  background: var(--red-soft);
  color: var(--red);
}

.workspace-module {
  margin-top: 12px;
}

.module-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-bottom: 10px;
}

.module-header span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #ffd5d1;
  border-radius: 999px;
  background: #fff8f7;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.module-header h2 {
  font-size: 18px;
}

.overview-layout,
.opportunity-module-layout,
.heat-module-layout,
.execution-module-layout,
.recovery-module-layout,
.kronos-module-layout {
  display: grid;
  align-items: start;
  gap: 12px;
  margin-top: 12px;
}

.overview-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.34fr);
}

.opportunity-module-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.38fr);
}

.heat-module-layout {
  grid-template-columns: minmax(360px, 0.58fr) minmax(0, 1fr);
}

.execution-module-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recovery-module-layout {
  grid-template-columns: minmax(280px, 0.3fr) minmax(0, 1fr);
}

.kronos-module-layout {
  grid-template-columns: minmax(292px, 0.28fr) minmax(0, 1fr);
}

.overview-layout .limit-ladder-panel {
  margin-top: 0;
}

.summary-grid,
.content-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.summary-grid {
  grid-template-columns: minmax(280px, 1.45fr) repeat(3, minmax(170px, 1fr));
}

.content-grid {
  align-items: start;
  grid-template-columns: minmax(0, 2.2fr) minmax(318px, 0.86fr);
}

.content-grid.lower {
  grid-template-columns: minmax(340px, 0.88fr) minmax(0, 2.12fr);
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
}

.metric-card {
  position: relative;
  min-height: 106px;
  padding: 16px;
  overflow: hidden;
}

.metric-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--blue));
  content: "";
  opacity: 0.82;
}

.metric-card .label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  color: var(--ink-strong);
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

#heatText {
  font-size: clamp(23px, 1.85vw, 30px);
  line-height: 1.12;
  word-break: keep-all;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.score-card {
  display: grid;
  grid-template-columns: minmax(96px, 0.72fr) minmax(180px, 1.28fr);
  align-items: center;
  gap: 16px;
}

.score-card strong,
.positive {
  color: var(--red);
  font-weight: 800;
}

.negative {
  color: var(--green);
  font-weight: 800;
}

.sentiment-main,
.temperature-meter {
  min-width: 0;
}

.temperature-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.temperature-head strong {
  color: var(--ink-strong);
  font-size: 18px;
}

.temperature-track {
  position: relative;
  height: 12px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #10b981, #f59e0b, #f97316, #d92d20);
}

.temperature-track::after {
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  content: "";
}

.temperature-track span {
  position: relative;
  z-index: 1;
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  transition: width 240ms ease;
}

.temperature-track span.cold,
.temperature-track span.cool {
  background: #2563eb;
}

.temperature-track span.neutral,
.temperature-track span.warm {
  background: var(--gold);
}

.temperature-track span.hot,
.temperature-track span.overheat {
  background: var(--red);
}

.temperature-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--faint);
  font-size: 11px;
}

.temperature-meter small {
  color: var(--ink);
  font-weight: 900;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 13px 15px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.panel-header.compact {
  align-items: center;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.limit-ladder-panel {
  margin-top: 12px;
}

.limit-ladder-layout {
  display: grid;
  align-items: start;
  gap: 12px;
  padding: 14px;
}

.limit-chart-box,
.limit-board-ladder,
.limit-tier,
.limit-stock-card,
.stock-result,
.index-item,
.watch-item,
.action-item,
.leader-card {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-soft);
}

.limit-chart-box {
  position: relative;
  align-self: start;
  min-width: 0;
  padding: 13px;
}

.limit-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.limit-chart-head strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.limit-timeline-controls {
  display: grid;
  gap: 7px;
  margin: 8px 0 2px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #ffffff;
}

.limit-timeline-controls > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.limit-timeline-controls strong {
  color: var(--ink);
  font-size: 12px;
}

.limit-timeline-controls input[type="range"] {
  width: 100%;
  accent-color: var(--red);
  cursor: grab;
}

.limit-timeline-controls input[type="range"]:active {
  cursor: grabbing;
}

.limit-height-chart {
  position: relative;
  min-height: 336px;
}

.limit-chart-svg {
  display: block;
  width: 100%;
  height: 336px;
}

.limit-axis {
  stroke: #cfd8e5;
  stroke-width: 1.4;
}

.limit-chart-area {
  fill: rgba(217, 45, 32, 0.08);
}

.limit-chart-line {
  fill: none;
  stroke: var(--red);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.limit-chart-point {
  cursor: pointer;
}

.limit-chart-point circle {
  fill: #ffffff;
  stroke: var(--red);
  stroke-width: 2.8;
}

.limit-chart-point:hover circle {
  fill: var(--red-soft);
  stroke-width: 4;
}

.limit-chart-point text {
  fill: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.limit-chart-point .date-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.limit-chart-bar {
  cursor: pointer;
}

.limit-chart-bar rect {
  fill: rgba(245, 158, 11, 0.22);
  stroke: #d97706;
  stroke-width: 0.9;
  transition: fill 120ms ease, opacity 120ms ease;
}

.limit-chart-bar:hover rect {
  fill: rgba(245, 158, 11, 0.42);
}

.limit-chart-bar text {
  fill: #9a5b05;
  font-size: 10px;
  font-weight: 800;
}

.limit-chart-bar .date-label {
  fill: var(--muted);
}

.limit-chart-bar .limit-emotion-cycle-label {
  font-size: 9px;
  font-weight: 900;
}

.limit-chart-bar .limit-emotion-cycle-label.cycle-hot {
  fill: #dc2626;
}

.limit-chart-bar .limit-emotion-cycle-label.cycle-rise {
  fill: #b45309;
}

.limit-chart-bar .limit-emotion-cycle-label.cycle-repair {
  fill: #2563eb;
}

.limit-chart-bar .limit-emotion-cycle-label.cycle-warn {
  fill: #c2410c;
}

.limit-chart-bar .limit-emotion-cycle-label.cycle-risk {
  fill: #15803d;
}

.limit-chart-bar .limit-emotion-cycle-label.cycle-neutral {
  fill: #667085;
}

.limit-chart-bar.missing rect {
  fill: #f2f4f7;
  stroke: #aab4c2;
}

.limit-chart-bar.missing text {
  fill: #8a94a6;
}

.limit-chart-point.missing circle {
  fill: #f8fafc;
  stroke: #aab4c2;
}

.limit-chart-point.missing text {
  fill: #8a94a6;
}

.limit-chart-tooltip,
.heat-tooltip {
  position: absolute;
  z-index: 8;
  width: 230px;
  padding: 10px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 7px;
  background: rgba(15, 23, 40, 0.82);
  color: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(5px);
  pointer-events: none;
}

.limit-chart-tooltip strong,
.heat-tooltip strong {
  display: block;
  margin-bottom: 4px;
  color: #ffffff;
  font-size: 13px;
}

.limit-chart-tooltip p,
.limit-chart-tooltip small,
.heat-tooltip small {
  color: #dbe4ee;
  font-size: 11px;
}

.limit-chart-tooltip p {
  margin: 0 0 8px;
}

.limit-chart-tooltip div {
  display: grid;
  gap: 5px;
}

.limit-chart-tooltip span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}

.limit-chart-tooltip b,
.limit-chart-tooltip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-chart-tooltip small {
  grid-column: 1 / -1;
}

.limit-chart-tooltip em {
  color: #ffb4ad;
  font-style: normal;
  font-weight: 900;
}

.limit-tier-area,
.limit-tier-list,
.limit-board-groups {
  display: grid;
  min-width: 0;
}

.limit-tier-area {
  align-content: start;
  gap: 10px;
  overflow: visible;
}

.limit-tier-list {
  align-content: start;
  gap: 10px;
}

.limit-judgement {
  display: grid;
  align-self: start;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #ffd5d1;
  border-left: 4px solid var(--red);
  border-radius: 7px;
  background: #fff8f7;
}

.limit-judgement strong {
  color: var(--red);
  font-size: 15px;
}

.limit-judgement span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.limit-ladder-tabs,
.opportunity-tabs {
  border: 1px solid var(--line);
  background: #eef3f9;
}

.limit-ladder-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  justify-self: start;
  padding: 3px;
  border-radius: 7px;
}

.limit-ladder-tabs button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.limit-ladder-tabs button.active {
  background: #ffffff;
  color: var(--ink-strong);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.12);
}

.limit-ladder-view-panel {
  min-width: 0;
}

.limit-board-ladder {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: #fbfdff;
}

.limit-board-ladder-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.72fr);
  gap: 10px;
}

.limit-board-focus,
.limit-board-rank,
.limit-board-other {
  border: 1px solid #dfe7f2;
  border-radius: 7px;
  background: #ffffff;
}

.limit-board-focus {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(180deg, #fffafa, #ffffff);
  border-color: #ffd5d1;
}

.limit-board-focus-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.limit-board-focus-head span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
}

.limit-board-focus-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-board-focus-head em {
  color: var(--red);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

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

.limit-board-focus-metrics span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.limit-board-focus-metrics b {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 16px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-board-focus-metrics small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.limit-board-rank {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
}

.limit-board-rank header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-soft);
}

.limit-board-rank header strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.limit-board-rank header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.limit-board-rank-row {
  display: grid;
  grid-template-columns: 22px minmax(82px, 0.8fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 5px 6px;
  border-radius: 6px;
  background: var(--surface-soft);
}

.limit-board-rank-row i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.limit-board-rank-row strong,
.limit-board-rank-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-board-rank-row strong {
  color: var(--ink-strong);
  font-size: 12px;
}

.limit-board-rank-row span {
  color: var(--muted);
  font-size: 12px;
}

.limit-board-rank-row em {
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.limit-board-ladder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(315px, 1fr));
  gap: 10px;
}

.limit-board-ladder-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #dfe7f2;
  border-radius: 7px;
  background: #ffffff;
}

.limit-board-ladder-card header,
.limit-board-ladder-flow,
.limit-stock-main,
.limit-stock-tags,
.limit-board-group h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.limit-board-ladder-card header,
.limit-board-ladder-flow,
.limit-stock-main,
.limit-board-group h4 {
  justify-content: space-between;
}

.limit-board-ladder-card header strong,
.limit-stock-main strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-board-ladder-card header span,
.limit-stock-main em {
  flex: 0 0 auto;
  color: var(--red);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.limit-board-ladder-flow span,
.limit-board-group h4 span,
.limit-stock-main small {
  color: var(--muted);
  font-size: 12px;
}

.limit-board-ladder-flow em {
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.limit-board-ladder-steps,
.limit-stock-tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.limit-board-ladder-steps span,
.limit-stock-tags span,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}

.limit-board-ladder-card p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-board-tier-list {
  display: grid;
  gap: 6px;
}

.limit-board-tier-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-soft);
}

.limit-board-tier-row > span {
  display: grid;
  gap: 2px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.limit-board-tier-row > span small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.limit-board-tier-stocks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.limit-board-stock-chip,
.limit-board-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px #e3eaf4;
}

.limit-board-stock-chip b {
  overflow: hidden;
  max-width: 74px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-board-stock-chip em {
  flex: 0 0 auto;
  color: var(--red);
  font-style: normal;
  font-weight: 900;
}

.limit-board-more {
  color: var(--blue);
}

.limit-board-other {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.limit-board-other strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.limit-board-other div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.limit-board-other span {
  display: inline-flex;
  gap: 4px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.limit-board-other b {
  color: var(--red);
}

.limit-tier {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 58px;
  padding: 10px;
}

.limit-tier-badge {
  display: grid;
  place-items: center;
  position: sticky;
  top: 10px;
  min-height: 48px;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  text-align: center;
}

.limit-tier-badge strong {
  font-size: 18px;
  line-height: 1;
}

.limit-tier-badge span {
  margin-top: 3px;
  color: #9a3412;
  font-size: 11px;
  font-weight: 900;
}

.limit-board-groups {
  gap: 10px;
}

.limit-tier-warning {
  padding: 8px 10px;
  border: 1px solid #f7d99b;
  border-radius: 7px;
  background: var(--gold-soft);
  color: #9a5b00;
  font-size: 12px;
  font-weight: 800;
}

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

.limit-board-group h4 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 13px;
}

.limit-stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.limit-stock-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  background: #ffffff;
}

.limit-stock-tags {
  justify-content: flex-start;
}

.limit-stock-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.limit-detail-list {
  display: grid;
  gap: 12px;
}

.limit-detail-tier {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #ffffff;
}

.limit-detail-tier-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.limit-detail-tier-badge {
  display: grid;
  place-items: center;
  width: 64px;
  min-height: 50px;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  text-align: center;
}

.limit-detail-tier-badge strong {
  font-size: 18px;
  line-height: 1;
}

.limit-detail-tier-badge span {
  margin-top: 3px;
  color: #9a3412;
  font-size: 11px;
  font-weight: 900;
}

.limit-detail-tier-head > div:last-child {
  min-width: 0;
}

.limit-detail-tier-head > div:last-child strong {
  display: block;
  color: var(--ink-strong);
  font-size: 15px;
}

.limit-detail-tier-head > div:last-child span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-detail-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.limit-detail-table-head,
.limit-detail-row {
  display: grid;
  grid-template-columns: minmax(118px, 0.24fr) minmax(0, 1fr) minmax(180px, 0.36fr);
  align-items: start;
}

.limit-detail-table-head {
  min-height: 34px;
  background: #f3f6fa;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}

.limit-detail-table-head span,
.limit-detail-row > div {
  padding: 9px 10px;
}

.limit-detail-row {
  border-top: 1px solid var(--line-soft);
  background: #ffffff;
}

.limit-detail-row:first-of-type {
  border-top: 0;
}

.limit-detail-row:hover {
  background: #fbfcff;
}

.limit-detail-theme {
  display: grid;
  gap: 4px;
}

.limit-detail-theme strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.limit-detail-theme span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.limit-detail-stock-list,
.limit-detail-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.limit-detail-stock {
  display: inline-grid;
  grid-template-columns: minmax(52px, auto) auto auto;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  box-shadow: inset 0 0 0 1px #e3eaf4;
}

.limit-detail-stock b {
  overflow: hidden;
  max-width: 82px;
  color: var(--ink-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.limit-detail-stock em {
  font-style: normal;
  font-weight: 900;
}

.limit-detail-reasons span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #fff8f7;
  color: #9a3412;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-detail-reasons small {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
}

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

table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #475467;
  background: #f3f6fa;
  font-size: 12px;
  font-weight: 900;
}

tbody tr:hover td {
  background: #fbfcff;
}

td.numeric,
th.numeric {
  text-align: right;
}

.stock-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stock-name strong {
  color: var(--ink-strong);
}

.stock-name small,
.muted {
  color: var(--muted);
}

.risk-tag {
  background: #fff4e5;
  color: #9a5b00;
}

.score-pill {
  display: inline-flex;
  justify-content: center;
  min-width: 48px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 900;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 96px;
  margin: 0;
  padding: 22px;
  border: 1px dashed #cbd5e1;
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(135deg, #f8fafc 0, #f8fafc 10px, #f2f5f9 10px, #f2f5f9 20px);
  background-size: 220px 100%, auto;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  animation: emptySweep 1.8s ease-in-out infinite;
}

.compact-empty {
  min-height: 54px;
  padding: 14px;
}

td.empty {
  display: table-cell;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  animation: none;
}

@keyframes emptySweep {
  0% {
    background-position: -220px 0, 0 0;
  }

  100% {
    background-position: 220px 0, 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .empty,
  .temperature-track span {
    animation: none;
    transition: none;
  }
}

.list-subhead {
  padding: 12px 16px 7px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 900;
}

.opportunity-groups,
.stock-analysis,
.index-list,
.watch-list,
.action-list,
.leader-grid,
.board-heatmap {
  padding: 12px;
}

.opportunity-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.opportunity-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 0 13px;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #eef3f9;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.opportunity-tab:last-child {
  border-right: 0;
}

.opportunity-tab.active {
  background: #ffffff;
  color: var(--red);
  box-shadow: inset 0 -3px 0 var(--red);
}

.opportunity-tab strong {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.opportunity-section {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0 0 7px 7px;
  background: #ffffff;
}

.opportunity-section::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff);
  content: "";
  pointer-events: none;
}

.opportunity-section .table-wrap {
  max-height: 680px;
  overflow: auto;
  scrollbar-color: #c3cbd8 transparent;
  scrollbar-width: thin;
}

.opportunity-section table {
  min-width: 980px;
}

.opportunity-section th,
.opportunity-section td:nth-child(n + 2):nth-child(-n + 7) {
  white-space: nowrap;
}

.opportunity-section td {
  line-height: 1.42;
}

.opportunity-logic,
.opportunity-section td:nth-child(8) > div:first-child {
  display: -webkit-box;
  max-width: 520px;
  overflow: hidden;
  color: var(--ink);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.opportunity-section .tag-row {
  max-height: 48px;
  overflow: hidden;
  margin-top: 7px;
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 12px;
}

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

.stock-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink-strong);
  font-weight: 800;
  outline: none;
}

.stock-input:focus {
  border-color: #9eb7ea;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.stock-form button {
  height: 38px;
  padding: 0 14px;
  background: var(--ink-strong);
  color: #ffffff;
  font-weight: 900;
}

.stock-result {
  margin-top: 10px;
  padding: 11px;
}

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

.stock-card-head strong,
.stock-score-line strong {
  display: block;
}

.stock-card-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.stock-score-line {
  align-items: center;
  margin-top: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.stock-score-line span,
.stock-score-line em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.stock-score-line strong {
  color: var(--red);
  font-size: 26px;
}

.stock-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.stock-metrics span {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.stock-metrics strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.stock-result p {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.index-item,
.watch-item,
.action-item,
.leader-card {
  padding: 10px;
}

.index-item + .index-item,
.watch-item + .watch-item,
.action-item + .action-item {
  margin-top: 8px;
}

.index-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #ffffff;
}

.index-item.placeholder {
  color: var(--muted);
}

.index-item > div:first-child {
  min-width: 0;
}

.index-item > div:last-child {
  flex: 0 0 auto;
  min-width: 92px;
  text-align: right;
}

.index-item strong,
.watch-item strong {
  display: block;
  margin-bottom: 3px;
}

.watch-item {
  display: grid;
  gap: 8px;
}

.watch-item-head,
.watch-meta,
.action-head {
  min-width: 0;
}

.watch-item-head,
.action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.watch-item-head strong,
.action-head strong {
  min-width: 0;
}

.watch-item-head .tag,
.action-head .tag {
  flex: 0 0 auto;
}

.watch-meta {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.action-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.action-item p,
.action-item small {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.action-score {
  min-width: 60px;
  text-align: right;
}

.action-score strong,
.action-score span {
  display: block;
}

.action-score strong {
  color: var(--ink-strong);
  font-size: 17px;
  line-height: 1;
}

.action-score span {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 900;
}

.daily-t-idea-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line-soft);
}

.daily-t-idea-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.daily-t-idea-panel > header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.daily-t-idea-panel > header strong {
  color: var(--ink-strong);
  font-size: 14px;
}

.daily-t-idea-panel > header span,
.daily-t-idea-panel > header em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.daily-t-idea-panel > header em {
  flex: 0 0 auto;
  color: var(--blue);
  text-align: right;
}

.daily-t-idea-list {
  display: grid;
  gap: 6px;
}

.daily-t-idea-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #ffffff;
}

.daily-t-idea-card > div:nth-child(2) {
  min-width: 0;
}

.daily-t-idea-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.daily-t-idea-card strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.daily-t-idea-card strong small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.daily-t-idea-card p,
.daily-t-idea-empty {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.daily-t-idea-card .tag-row {
  margin-top: 5px;
}

.daily-t-idea-card .tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 800;
}

.daily-t-idea-score {
  min-width: 58px;
  text-align: right;
}

.daily-t-idea-score strong,
.daily-t-idea-score span {
  display: block;
}

.daily-t-idea-score strong {
  color: var(--red);
  font-size: 15px;
  line-height: 1;
}

.daily-t-idea-score span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.daily-t-idea-empty {
  margin: 0;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface-soft);
}

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

.leader-card h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 9px;
  color: var(--ink-strong);
  font-size: 14px;
}

.leader-card h3 span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-card h3 em {
  flex: 0 0 auto;
  font-style: normal;
  font-weight: 900;
}

.leader-stock-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leader-stock-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.leader-stock-list strong,
.leader-stock-list small,
.leader-stock-list em {
  display: block;
}

.leader-stock-list strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-stock-list small {
  margin-top: 1px;
  color: var(--muted);
}

.leader-stock-list em {
  font-style: normal;
  font-weight: 900;
}

.heatmap-visual {
  display: grid;
  grid-template-columns: minmax(180px, 225px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.heat-chart-shell {
  position: relative;
  width: min(225px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  isolation: isolate;
}

.heat-pie-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 10px 18px rgba(16, 24, 40, 0.1));
}

.heat-segment {
  cursor: pointer;
  outline: none;
  stroke: #ffffff;
  stroke-width: 1.4;
  transition: filter 160ms ease, opacity 160ms ease, stroke-width 160ms ease;
}

.heatmap-visual.has-active .heat-segment:not(.is-active) {
  opacity: 0.48;
}

.heat-segment.is-active,
.heat-segment:focus-visible {
  filter: brightness(1.08) drop-shadow(0 4px 6px rgba(16, 24, 40, 0.18));
  stroke-width: 3;
}

.heat-segment-label {
  fill: #ffffff;
  font-size: 11px;
  font-weight: 900;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(15, 23, 42, 0.32);
  stroke-width: 2px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.heat-segment-label.is-other {
  fill: #334155;
  stroke: rgba(255, 255, 255, 0.75);
}

.heat-pie-center {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 44%;
  aspect-ratio: 1;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.11);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.heat-pie-center strong {
  display: -webkit-box;
  max-width: 86px;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.heat-pie-center span {
  color: var(--red);
  font-size: 17px;
  font-weight: 900;
}

.heat-tooltip {
  display: grid;
  gap: 3px;
  width: min(210px, calc(100% - 8px));
  font-size: 12px;
  line-height: 1.4;
}

.heat-tooltip span,
.heat-tooltip small {
  display: block;
}

.heat-legend,
.heat-legend-item,
.heat-leader-list {
  display: grid;
}

.heat-legend {
  gap: 8px;
}

.heat-legend-item {
  gap: 6px;
}

.heat-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
  outline: none;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.heat-legend-row.is-active,
.heat-legend-row:focus-visible {
  background: #ffffff;
  box-shadow: inset 3px 0 var(--heat-color), 0 0 0 1px var(--line-soft);
}

.heat-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.heat-legend-row strong,
.heat-legend-row small,
.heat-legend-row em {
  display: block;
}

.heat-legend-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.heat-legend-row em {
  color: var(--ink-strong);
  font-style: normal;
  font-weight: 900;
}

.heat-leader-detail {
  padding: 8px 10px 10px 32px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #ffffff;
}

.heat-leader-list {
  gap: 7px;
}

.heat-leader-stock {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.heat-leader-rank {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.heat-leader-stock strong,
.heat-leader-stock span {
  display: block;
}

.heat-leader-stock strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.heat-leader-stock strong small,
.heat-leader-stock span,
.heat-leader-note,
.heat-leader-loading,
.heat-leader-empty {
  color: var(--muted);
  font-size: 12px;
}

.heat-leader-note {
  margin-bottom: 7px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-soft);
}

.heat-leader-stock em {
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

footer {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.footer-disclaimer {
  max-width: 1120px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.65;
  text-align: right;
}

@media (max-width: 1180px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .content-grid,
  .content-grid.lower,
  .limit-ladder-layout,
  .limit-board-ladder-summary,
  .overview-layout,
  .opportunity-module-layout,
  .heat-module-layout,
  .execution-module-layout,
  .recovery-module-layout,
  .kronos-module-layout {
    grid-template-columns: 1fr;
  }

  .limit-tier-area {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(1480px, calc(100% - 20px));
    padding-top: 10px;
  }

  .hero,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    width: 100%;
    min-width: 0;
  }

  #refreshBtn {
    width: max-content;
  }

  #statusText {
    width: 100%;
    max-width: 100%;
  }

  h1 {
    font-size: 22px;
  }

  .summary-grid,
  .leader-grid,
  .workspace-tabs {
    grid-template-columns: 1fr;
  }

  .workspace-tab {
    min-height: 46px;
  }

  .module-header {
    min-height: 36px;
  }

  .module-header h2 {
    font-size: 16px;
  }

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

  .limit-ladder-tabs,
  .opportunity-tabs {
    width: 100%;
  }

  .limit-ladder-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .limit-ladder-tabs button,
  .opportunity-tab {
    flex: 1 1 0;
    min-width: 0;
  }

  .limit-ladder-tabs button {
    padding: 0 4px;
    font-size: 11px;
  }

  .limit-tier,
  .action-item {
    grid-template-columns: 1fr;
  }

  .daily-t-idea-card {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .daily-t-idea-score {
    grid-column: 2;
    text-align: left;
  }

  .limit-detail-tier-head,
  .limit-detail-row {
    grid-template-columns: 1fr;
  }

  .limit-detail-table-head {
    display: none;
  }

  .limit-detail-row > div {
    padding: 8px 9px;
  }

  .limit-board-focus-head,
  .limit-board-rank-row,
  .limit-board-tier-row {
    grid-template-columns: 1fr;
  }

  .limit-board-focus-head em,
  .limit-board-rank-row em {
    justify-self: start;
  }

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

  .limit-board-ladder-grid {
    grid-template-columns: 1fr;
  }

  .limit-tier-badge {
    position: static;
  }

  .limit-stock-grid {
    grid-template-columns: 1fr;
  }

  .opportunity-tabs {
    grid-template-columns: 1fr;
  }

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

  .opportunity-tab:last-child {
    border-bottom: 0;
  }

  .stock-form,
  .heatmap-visual {
    grid-template-columns: 1fr;
  }

  .limit-timeline-controls > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
  }

  #limitTimelineRange {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .action-score {
    text-align: left;
  }

  footer {
    flex-direction: column;
  }
}

/* shadcn-inspired workstation redesign */
html,
body {
  background: #f8fafc;
}

body {
  background:
    radial-gradient(circle at top left, rgba(220, 38, 38, 0.035), transparent 280px),
    linear-gradient(180deg, #ffffff 0, #f8fafc 220px);
  color: var(--shadcn-foreground);
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.app-shell {
  width: min(1560px, calc(100% - 32px));
  padding: 16px 0 24px;
}

.hero,
.metric-card,
.panel,
.limit-chart-box,
.limit-board-ladder,
.limit-tier,
.stock-result,
.index-item,
.watch-item,
.action-item,
.leader-card,
.limit-detail-tier,
.limit-board-focus,
.limit-board-rank,
.limit-board-other,
.limit-board-ladder-card {
  border: 1px solid var(--shadcn-border);
  border-radius: 8px;
  background: var(--shadcn-card);
  box-shadow: var(--shadow);
}

.hero {
  min-height: 68px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
}

.eyebrow,
.panel-header p,
.metric-card .label,
.metric-card small,
.module-header span,
.workspace-tab span,
.limit-chart-head,
.limit-timeline-controls,
.limit-judgement span,
.limit-detail-theme span,
.muted {
  color: var(--shadcn-muted-foreground);
}

h1 {
  font-size: 24px;
  font-weight: 800;
}

h2 {
  font-size: 15px;
  font-weight: 700;
}

#refreshBtn,
.stock-form button {
  min-height: 36px;
  border: 1px solid var(--shadcn-primary);
  border-radius: 6px;
  background: var(--shadcn-primary);
  color: #ffffff;
  box-shadow: none;
}

#refreshBtn:hover:not(:disabled),
.stock-form button:hover:not(:disabled) {
  background: #27272a;
}

#statusText {
  height: 32px;
  border-color: var(--shadcn-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--shadcn-muted-foreground);
  line-height: 30px;
  box-shadow: none;
}

.workspace-tabs,
.limit-ladder-tabs,
.opportunity-tabs {
  border: 1px solid var(--shadcn-border);
  border-radius: 8px;
  background: var(--shadcn-muted);
  padding: 4px;
}

.workspace-tabs {
  gap: 4px;
}

.workspace-tab {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--shadcn-muted-foreground);
  box-shadow: none;
}

.workspace-tab span,
.module-header span {
  background: #ffffff;
  color: var(--shadcn-muted-foreground);
}

.workspace-tab.active {
  background: #ffffff;
  color: var(--shadcn-foreground);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08);
}

.workspace-tab.active span,
.module-header span {
  background: #18181b;
  color: #ffffff;
}

.workspace-module {
  margin-top: 14px;
}

.module-header {
  min-height: 36px;
  margin-bottom: 8px;
}

.module-header h2 {
  font-size: 18px;
  font-weight: 800;
}

.panel-header {
  min-height: 50px;
  padding: 13px 15px;
  background: #ffffff;
}

.summary-grid,
.overview-layout,
.opportunity-module-layout,
.heat-module-layout,
.execution-module-layout,
.recovery-module-layout,
.kronos-module-layout {
  gap: 10px;
}

.metric-card {
  min-height: 104px;
  padding: 14px;
}

.metric-card::before {
  height: 0;
  opacity: 0;
}

.metric-card strong {
  font-size: 28px;
  font-weight: 800;
}

.score-card {
  gap: 14px;
}

.temperature-track {
  height: 10px;
  background: linear-gradient(90deg, #2563eb, #16a34a, #eab308, #dc2626);
}

.temperature-track::after {
  display: none;
}

.limit-ladder-layout {
  gap: 10px;
  padding: 12px;
}

.limit-chart-box,
.limit-board-ladder,
.stock-analysis,
.index-list,
.watch-list,
.action-list,
.leader-grid,
.board-heatmap,
.opportunity-groups {
  padding: 10px;
}

.limit-chart-box,
.limit-timeline-controls,
.limit-board-ladder,
.limit-detail-table,
.opportunity-section {
  background: #ffffff;
}

.limit-timeline-controls,
.limit-detail-table,
.opportunity-section,
.stock-input {
  border-color: var(--shadcn-border);
  border-radius: 8px;
}

.stock-input:focus {
  border-color: var(--shadcn-ring);
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.12);
}

.limit-judgement {
  border: 1px solid #fecaca;
  border-left: 3px solid var(--red);
  background: #fff7f7;
}

.limit-ladder-tabs button,
.opportunity-tab {
  border-radius: 6px;
  color: var(--shadcn-muted-foreground);
}

.limit-ladder-tabs button.active,
.opportunity-tab.active {
  background: #ffffff;
  color: var(--shadcn-foreground);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08);
}

.opportunity-tab.active {
  box-shadow: inset 0 -2px 0 var(--red), 0 1px 2px rgba(24, 24, 27, 0.08);
}

.limit-board-focus,
.limit-board-rank,
.limit-board-ladder-card,
.limit-detail-tier,
.leader-card,
.watch-item,
.action-item,
.index-item {
  background: #ffffff;
}

.limit-board-focus {
  background: linear-gradient(180deg, #ffffff, #fffafa);
}

.limit-board-focus-head span,
.limit-detail-tier-badge,
.score-pill {
  background: var(--red-soft);
  color: var(--red);
}

.limit-board-focus-metrics span,
.limit-board-rank-row,
.limit-board-tier-row,
.limit-detail-stock,
.limit-detail-reasons span,
.leader-stock-list li,
.heat-legend-row,
.watch-meta,
.stock-metrics span {
  background: var(--shadcn-muted);
  box-shadow: none;
}

.limit-board-stock-chip,
.limit-board-more,
.limit-detail-stock {
  border: 1px solid var(--shadcn-border);
  background: #ffffff;
  box-shadow: none;
}

.limit-board-rank-row i,
.action-rank,
.heat-leader-rank {
  background: #ffffff;
  color: var(--shadcn-foreground);
  box-shadow: inset 0 0 0 1px var(--shadcn-border);
}

.limit-detail-table-head,
th {
  background: var(--shadcn-muted);
  color: #52525b;
}

.limit-detail-row,
td {
  border-color: var(--shadcn-border);
}

.limit-detail-row:hover,
tbody tr:hover td {
  background: #fafafa;
}

.tag,
.limit-stock-tags span,
.limit-board-ladder-steps span {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
}

.risk-tag {
  border-color: #fde68a;
  background: #fefce8;
  color: #a16207;
}

.table-wrap {
  border-radius: 8px;
}

table {
  border-spacing: 0;
}

th,
td {
  padding: 10px 12px;
}

.empty {
  border-color: var(--shadcn-border);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(135deg, #fafafa 0, #fafafa 10px, #f4f4f5 10px, #f4f4f5 20px);
  color: var(--shadcn-muted-foreground);
}

.heat-chart-shell {
  width: min(230px, 100%);
}

.heat-pie-svg {
  filter: none;
}

.heat-pie-center {
  border-color: var(--shadcn-border);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08);
}

.heat-legend-row {
  border: 1px solid transparent;
}

.heat-legend-row.is-active,
.heat-legend-row:focus-visible {
  background: #ffffff;
  box-shadow: inset 3px 0 var(--heat-color);
  border-color: var(--shadcn-border);
}

.heat-leader-detail {
  border-color: var(--shadcn-border);
  background: #ffffff;
}

.limit-chart-tooltip,
.heat-tooltip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(24, 24, 27, 0.86);
  box-shadow: 0 10px 24px rgba(24, 24, 27, 0.18);
}

footer {
  border-top: 1px solid var(--shadcn-border);
  padding-top: 12px;
}

@media (max-width: 1180px) {
  .workspace-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(1560px, calc(100% - 18px));
  }

  .workspace-tabs,
  .summary-grid,
  .leader-grid {
    grid-template-columns: 1fr;
  }

  .workspace-tab {
    min-height: 44px;
  }
}

button:focus-visible,
input:focus-visible,
.heat-segment:focus-visible {
  outline: 2px solid rgba(24, 24, 27, 0.18);
  outline-offset: 2px;
}

.workspace-tab:hover,
.limit-ladder-tabs button:hover,
.opportunity-tab:hover,
.heat-legend-row:hover {
  background: #ffffff;
  color: var(--shadcn-foreground);
}

.positive {
  color: #dc2626;
}

.negative {
  color: #16a34a;
}

.metric-card:hover,
.panel:hover {
  border-color: #d4d4d8;
}

.metric-card .label,
.temperature-head,
.limit-chart-head,
.list-subhead {
  text-transform: none;
  font-weight: 700;
}

.limit-height-chart,
.heat-chart-shell {
  border-radius: 8px;
}

.limit-chart-svg {
  height: 336px;
}

.limit-chart-line {
  stroke-width: 2.4;
}

.limit-chart-area {
  fill: rgba(220, 38, 38, 0.055);
}

.limit-detail-stock-list {
  align-items: center;
}

.limit-detail-stock:hover,
.limit-board-stock-chip:hover,
.leader-stock-list li:hover,
.watch-item:hover,
.action-item:hover,
.index-item:hover {
  background: #fafafa;
}

.limit-detail-reasons span {
  border: 1px solid #fee2e2;
}

.limit-detail-tier-head,
.limit-board-focus-head,
.leader-card h3,
.stock-card-head,
.action-head,
.watch-item-head {
  letter-spacing: 0;
}

.opportunity-section .table-wrap {
  max-height: min(680px, calc(100vh - 260px));
}

.opportunity-section table,
.limit-detail-table {
  font-variant-numeric: tabular-nums;
}

.score-pill {
  border: 1px solid #fecaca;
}

.stock-result.empty {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(135deg, #fafafa 0, #fafafa 10px, #f4f4f5 10px, #f4f4f5 20px);
}

.stock-score-line {
  border-color: var(--shadcn-border);
}

.stock-metrics span,
.watch-meta,
.heat-leader-note {
  border: 1px solid var(--shadcn-border);
}

.leader-grid {
  gap: 8px;
}

.leader-card {
  padding: 10px;
}

.leader-stock-list li {
  border: 1px solid transparent;
}

.leader-stock-list li:hover {
  border-color: var(--shadcn-border);
}

.watch-item,
.action-item,
.index-item {
  transition: background 140ms ease, border-color 140ms ease;
}

.action-score strong {
  color: var(--shadcn-foreground);
}

.stock-clickable {
  cursor: pointer;
}

.stock-clickable:hover {
  color: var(--blue);
}

.stock-clickable:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
  border-radius: 6px;
}

.stock-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
}

.stock-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 24, 27, 0.42);
  backdrop-filter: blur(3px);
}

.stock-detail-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1160px, 100%);
  max-height: min(860px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid var(--shadcn-border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(24, 24, 27, 0.22);
}

.stock-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--shadcn-border);
}

.stock-detail-header span {
  display: inline-flex;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--shadcn-border);
  border-radius: 999px;
  background: var(--shadcn-muted);
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
  font-weight: 800;
}

.stock-detail-header h2 {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 900;
}

.stock-detail-header p {
  margin: 5px 0 0;
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
}

.stock-detail-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--shadcn-border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--shadcn-foreground);
  font-size: 22px;
  line-height: 1;
}

.stock-detail-close:hover {
  background: var(--shadcn-muted);
}

.stock-detail-body {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 14px;
  overflow: auto;
  background: #fafafa;
}

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

.stock-detail-summary div,
.stock-detail-reason,
.stock-chart-card,
.stock-detail-warning {
  border: 1px solid var(--shadcn-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.stock-detail-summary div {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.stock-detail-summary span,
.stock-detail-reason span,
.stock-chart-card header span {
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
  font-weight: 800;
}

.stock-detail-summary strong {
  color: var(--shadcn-foreground);
  font-size: 20px;
  font-weight: 900;
}

.stock-detail-reason {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-color: #fecaca;
  background: #fffafa;
}

.stock-detail-reason strong {
  color: var(--shadcn-foreground);
  font-size: 14px;
  line-height: 1.6;
}

.stock-detail-t-context {
  overflow: hidden;
  border: 1px solid var(--shadcn-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.stock-detail-t-context > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 43px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--shadcn-border);
}

.stock-detail-t-context > header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stock-detail-t-context > header span,
.stock-detail-t-context-grid small {
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 800;
}

.stock-detail-t-context > header strong {
  color: var(--shadcn-foreground);
  font-size: 14px;
}

.stock-detail-t-context > header em {
  padding: 3px 8px;
  border: 1px solid var(--shadcn-border);
  border-radius: 999px;
  background: var(--shadcn-muted);
  color: #52525b;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.stock-detail-t-context > header em.positive {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

.stock-detail-t-context > header em.negative {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.stock-detail-t-context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stock-detail-t-context-grid > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid var(--shadcn-border);
}

.stock-detail-t-context-grid > span:last-child {
  border-right: 0;
}

.stock-detail-t-context-grid strong {
  overflow: hidden;
  color: var(--shadcn-foreground);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-detail-t-context > p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 9px 12px;
  border-top: 1px solid var(--shadcn-border);
  background: #fafafa;
  color: #52525b;
  font-size: 12px;
  line-height: 1.55;
}

.stock-detail-t-context > p b {
  color: var(--shadcn-foreground);
}

.stock-detail-market {
  overflow: hidden;
  border: 1px solid var(--shadcn-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.stock-detail-market > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--shadcn-border);
}

.stock-detail-market > header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stock-detail-market > header span,
.stock-detail-market-grid small {
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 800;
}

.stock-detail-market > header strong {
  color: var(--shadcn-foreground);
  font-size: 14px;
}

.stock-detail-market > header em {
  padding: 3px 8px;
  border: 1px solid var(--shadcn-border);
  border-radius: 999px;
  background: var(--shadcn-muted);
  color: #52525b;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.stock-detail-market > header em.hot,
.stock-detail-market > header em.overheat {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

.stock-detail-market > header em.cold,
.stock-detail-market > header em.cool {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

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

.stock-detail-market-grid > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid var(--shadcn-border);
}

.stock-detail-market-grid > span:last-child {
  border-right: 0;
}

.stock-detail-market-grid strong {
  overflow: hidden;
  color: var(--shadcn-foreground);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-detail-market > p {
  margin: 0;
  padding: 9px 12px;
  border-top: 1px solid var(--shadcn-border);
  background: #fafafa;
  color: #52525b;
  font-size: 12px;
  line-height: 1.55;
}

.stock-bs-diagnostics {
  overflow: hidden;
  border: 1px solid var(--shadcn-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.stock-bs-diagnostics > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 43px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--shadcn-border);
}

.stock-bs-diagnostics > header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stock-bs-diagnostics > header span,
.stock-bs-diagnostics-grid small {
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 800;
}

.stock-bs-diagnostics > header strong {
  font-size: 14px;
}

.stock-bs-diagnostics > header em {
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.stock-bs-diagnostics > header em.positive {
  color: #dc2626;
}

.stock-bs-diagnostics > header em.negative {
  color: #15803d;
}

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

.stock-bs-diagnostics-grid > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid var(--shadcn-border);
  border-bottom: 1px solid var(--shadcn-border);
}

.stock-bs-diagnostics-grid > span:nth-child(4n) {
  border-right: 0;
}

.stock-bs-diagnostics-grid > span:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.stock-bs-diagnostics-grid strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-bs-readiness {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--shadcn-border);
  background: #fafafa;
}

.stock-bs-readiness-title {
  display: grid;
  gap: 2px;
  min-width: 58px;
}

.stock-bs-readiness-title span,
.stock-bs-levels small {
  color: var(--shadcn-muted-foreground);
  font-size: 10px;
  font-weight: 800;
}

.stock-bs-readiness-title strong {
  font-size: 16px;
}

.stock-bs-readiness-items {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.stock-bs-readiness-items > span {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: center;
  column-gap: 5px;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid var(--shadcn-border);
  border-radius: 6px;
  background: #ffffff;
  color: #52525b;
  font-size: 10px;
  font-weight: 800;
}

.stock-bs-readiness-items > span i {
  grid-row: 1 / span 2;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a1a1aa;
}

.stock-bs-readiness-items > span strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-bs-readiness-items > span.pass {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b91c1c;
}

.stock-bs-readiness-items > span.pass i {
  background: #dc2626;
}

.stock-bs-readiness-items > span.block {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.stock-bs-readiness-items > span.block i {
  background: #16a34a;
}

.stock-bs-levels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--shadcn-border);
}

.stock-bs-levels > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 12px;
  border-right: 1px solid var(--shadcn-border);
}

.stock-bs-levels > span:last-child {
  border-right: 0;
}

.stock-bs-levels strong {
  font-size: 14px;
}

.stock-detail-warning {
  padding: 10px 12px;
  background: #fefce8;
  color: #a16207;
  font-size: 12px;
  font-weight: 800;
}

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

.stock-chart-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
}

.stock-chart-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--shadcn-border);
}

.stock-chart-card header strong {
  color: var(--shadcn-foreground);
  font-size: 14px;
}

.stock-detail-chart-loading {
  display: grid;
  place-items: center;
  min-height: 260px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.78), transparent),
    repeating-linear-gradient(135deg, #fafafa 0, #fafafa 10px, #f4f4f5 10px, #f4f4f5 20px);
  background-size: 220px 100%, auto;
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
  font-weight: 800;
  animation: emptySweep 1.4s linear infinite;
}

.stock-detail-svg {
  display: block;
  width: 100%;
  min-height: 260px;
  background: #ffffff;
}

.chart-axis {
  stroke: #e4e4e7;
  stroke-width: 1;
}

.chart-baseline {
  stroke: #a1a1aa;
  stroke-dasharray: 4 4;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: #2563eb;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.chart-line.positive,
.chart-opening-jump.positive {
  stroke: #dc2626;
}

.chart-line.negative,
.chart-opening-jump.negative {
  stroke: #16a34a;
}

.chart-area {
  fill: rgba(37, 99, 235, 0.08);
  stroke: none;
}

.chart-area.positive {
  fill: rgba(220, 38, 38, 0.09);
}

.chart-area.negative {
  fill: rgba(22, 163, 74, 0.09);
}

.chart-opening-jump {
  stroke: #2563eb;
  stroke-dasharray: 3 3;
  stroke-width: 1.8;
}

.chart-opening-point {
  fill: #2563eb;
  stroke: #ffffff;
  stroke-width: 1.4;
}

.chart-opening-point.positive {
  fill: #dc2626;
}

.chart-opening-point.negative {
  fill: #16a34a;
}

.chart-bs-signal {
  cursor: help;
}

.chart-bs-signal line {
  stroke-width: 1.2;
  stroke-dasharray: 2 2;
}

.chart-bs-signal circle {
  stroke: #ffffff;
  stroke-width: 1.8;
  filter: drop-shadow(0 2px 3px rgba(24, 24, 27, 0.22));
}

.chart-bs-signal text {
  fill: #ffffff;
  font-size: 9px;
  font-weight: 900;
  pointer-events: none;
}

.chart-bs-signal.buy line {
  stroke: #dc2626;
}

.chart-bs-signal.buy circle {
  fill: #dc2626;
}

.chart-bs-signal.sell line {
  stroke: #16a34a;
}

.chart-bs-signal.sell circle {
  fill: #16a34a;
}

.chart-flat-note {
  fill: #3f3f46;
  font-size: 13px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 5px;
}

.chart-flat-note.positive {
  fill: #dc2626;
}

.chart-flat-note.negative {
  fill: #16a34a;
}

.stock-chart-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--shadcn-border);
  border-radius: 999px;
  background: var(--shadcn-muted);
}

.stock-chart-state.positive {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

.stock-chart-state.negative {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.chart-line-avg {
  stroke: #f97316;
  stroke-width: 1.6;
}

.chart-label {
  fill: #71717a;
  font-size: 11px;
  font-weight: 700;
}

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

.k-candle line {
  stroke-width: 1.2;
}

.k-candle.up line,
.k-candle.up rect {
  fill: #dc2626;
  stroke: #dc2626;
}

.k-candle.down line,
.k-candle.down rect {
  fill: #16a34a;
  stroke: #16a34a;
}

.k-candle.forecast {
  opacity: 0.9;
}

.k-candle.forecast line,
.k-candle.forecast rect {
  stroke-dasharray: 3 2;
}

.k-candle.forecast.up rect {
  fill: rgba(220, 38, 38, 0.5);
}

.k-candle.forecast.down rect {
  fill: rgba(22, 163, 74, 0.5);
}

.forecast-split-line {
  stroke: #334155;
  stroke-dasharray: 5 5;
  stroke-width: 1.2;
}

.forecast-envelope {
  fill: rgba(37, 99, 235, 0.09);
  stroke: rgba(37, 99, 235, 0.22);
  stroke-width: 1;
}

.forecast-hover-zone {
  fill: transparent;
  pointer-events: all;
}

.forecast-legend text,
.forecast-split-label {
  fill: #334155;
  font-size: 11px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 3px;
}

.forecast-close-line {
  fill: none;
  stroke: #2563eb;
  stroke-dasharray: 6 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.forecast-confidence-badge rect {
  fill: rgba(255, 255, 255, 0.92);
  stroke: rgba(37, 99, 235, 0.35);
  stroke-width: 1;
}

.forecast-confidence-badge {
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.forecast-hover-layer:hover .forecast-confidence-badge,
.forecast-hover-layer:focus .forecast-confidence-badge,
.forecast-hover-layer:focus-visible .forecast-confidence-badge {
  opacity: 1;
}

.forecast-confidence-badge text,
.forecast-bound-label text {
  fill: #1e3a8a;
  font-size: 11px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 4px;
}

.forecast-bound-label.upper text {
  fill: #dc2626;
}

.forecast-bound-label.lower text {
  fill: #15803d;
}

@media (max-width: 960px) {
  .stock-detail-summary,
  .stock-detail-charts {
    grid-template-columns: 1fr;
  }

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

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

  .stock-detail-t-context-grid > span:nth-child(2) {
    border-right: 0;
  }

  .stock-detail-t-context-grid > span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--shadcn-border);
  }

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

  .stock-bs-readiness {
    grid-template-columns: 1fr;
  }

  .stock-bs-readiness-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }

  .stock-bs-readiness-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .stock-bs-levels > span:nth-child(2) {
    border-right: 0;
  }

  .stock-bs-levels > span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--shadcn-border);
  }

  .stock-bs-diagnostics-grid > span:nth-child(2n) {
    border-right: 0;
  }

  .stock-bs-diagnostics-grid > span:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--shadcn-border);
  }

  .stock-bs-diagnostics-grid > span:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .stock-detail-market-grid > span:nth-child(2) {
    border-right: 0;
  }

  .stock-detail-market-grid > span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--shadcn-border);
  }

  .stock-detail-modal {
    padding: 10px;
  }
}

/* System opportunities and user-managed watchlist */
.watch-list-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, max-content);
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--shadcn-border);
  border-radius: 7px;
  background: var(--shadcn-muted);
}

.watch-list-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.watch-list-tabs button span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e4e4e7;
  color: #52525b;
  font-size: 11px;
}

.watch-list-tabs button.active {
  border-color: var(--shadcn-border);
  background: #ffffff;
  color: var(--shadcn-foreground);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08);
}

.watch-list-tabs button.active span {
  background: #18181b;
  color: #ffffff;
}

.personal-watch-form {
  display: grid;
  grid-template-columns: minmax(0, 210px) max-content minmax(80px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px 12px 0;
}

.personal-watch-form .stock-input {
  min-width: 0;
  height: 36px;
}

.personal-watch-form button,
.stock-detail-watch-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #18181b;
  background: #18181b;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.personal-watch-form button:hover:not(:disabled),
.stock-detail-watch-btn:hover {
  background: #27272a;
}

#personalWatchStatus {
  overflow: hidden;
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#personalWatchStatus.success {
  color: #15803d;
}

#personalWatchStatus.error {
  color: #dc2626;
}

.watch-item-actions,
.stock-detail-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.watch-toggle-btn {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--shadcn-border);
  background: #ffffff;
  color: #3f3f46;
  font-size: 12px;
  font-weight: 800;
}

.watch-toggle-btn:hover,
.watch-toggle-btn.active {
  border-color: #a1a1aa;
  background: var(--shadcn-muted);
  color: #18181b;
}

.watch-toggle-btn.compact {
  min-height: 26px;
  padding: 0 8px;
}

.watch-remove-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--shadcn-border);
  background: #ffffff;
  color: #71717a;
  font-size: 18px;
  line-height: 1;
}

.watch-remove-btn:hover {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

.watch-signal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
}

.watch-signal-row span {
  padding-right: 8px;
  border-right: 1px solid var(--shadcn-border);
}

.watch-signal-row span:last-child {
  overflow: hidden;
  padding-right: 0;
  border-right: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-signal-row strong {
  display: inline;
  margin: 0;
  color: var(--shadcn-foreground);
}

.personal-watch-quote {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--shadcn-border);
  border-radius: 6px;
  background: var(--shadcn-muted);
}

.personal-watch-quote > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px;
  border-right: 1px solid var(--shadcn-border);
}

.personal-watch-quote > span:last-child {
  border-right: 0;
}

.personal-watch-quote small {
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
}

.personal-watch-quote strong {
  overflow: hidden;
  margin: 0;
  color: var(--shadcn-foreground);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-watch-sector-group + .personal-watch-sector-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--shadcn-border);
}

.personal-watch-sector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin-bottom: 8px;
  padding: 7px 9px;
  border-left: 3px solid #18181b;
  background: var(--shadcn-muted);
}

.personal-watch-sector-head > div,
.personal-watch-sector-leader,
.personal-watch-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.personal-watch-sector-head > div:first-child > strong {
  overflow: hidden;
  color: var(--shadcn-foreground);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-watch-sector-head > div:first-child > span {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 2px 6px;
  border: 1px solid var(--shadcn-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.personal-watch-sector-leader {
  justify-content: flex-end;
}

.personal-watch-sector-leader > span,
.personal-leader-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid #d4d4d8;
  border-radius: 999px;
  background: #ffffff;
  color: #52525b;
  font-size: 11px;
  font-weight: 900;
}

.personal-watch-sector-leader > strong {
  overflow: hidden;
  color: var(--shadcn-foreground);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-watch-sector-list {
  display: grid;
  gap: 8px;
}

.personal-watch-sector-list .watch-item + .watch-item {
  margin-top: 0;
}

.personal-watch-item.is-leader {
  border-left: 3px solid #dc2626;
}

.personal-leader-badge.market {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

.watch-reason {
  overflow: hidden;
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-detail-watch-btn {
  min-height: 34px;
}

.stock-detail-t-btn {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--shadcn-border);
  background: #ffffff;
  color: #3f3f46;
  font-size: 12px;
  font-weight: 800;
}

.stock-detail-t-btn:hover:not(:disabled) {
  border-color: #a1a1aa;
  background: var(--shadcn-muted);
  color: #18181b;
}

.stock-detail-t-btn.active {
  border-color: #fca5a5;
  background: #fff7f7;
  color: #b91c1c;
}

.stock-detail-t-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.stock-detail-watch-btn.active {
  border-color: var(--shadcn-border);
  background: #ffffff;
  color: #3f3f46;
}

@media (max-width: 720px) {
  .execution-module-layout .panel:first-child .panel-header.compact {
    flex-direction: row;
    align-items: center;
  }

  .watch-list-tabs button {
    gap: 5px;
    padding: 0 7px;
  }

  .personal-watch-form {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  #personalWatchStatus {
    grid-column: 1 / -1;
    min-height: 0;
  }

  .watch-item-head {
    align-items: flex-start;
  }

  .watch-item-actions {
    gap: 4px;
  }

  .personal-watch-sector-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .personal-watch-sector-leader {
    justify-content: flex-start;
    width: 100%;
  }

  .watch-item-actions .tag {
    display: none;
  }

  .stock-detail-header-actions {
    gap: 5px;
  }

  .stock-detail-t-btn,
  .stock-detail-watch-btn {
    padding: 0 9px;
  }
}

.chart-bs-signal.replay circle {
  stroke: #f59e0b;
  stroke-width: 2.4;
}

.chart-bs-signal.t-signal text {
  font-size: 7.5px;
}

.chart-bs-signal.provisional line {
  stroke-dasharray: 4 3;
  opacity: 0.72;
}

.chart-bs-signal.provisional circle {
  fill-opacity: 0.72;
  stroke-dasharray: 2 1;
}

.stock-chart-state.watch {
  border-color: #fde68a;
  background: #fffbeb;
  color: #a16207;
}

.recovery-module-layout {
  display: grid;
  align-items: start;
  gap: 10px;
  margin-top: 12px;
}

.recovery-config-panel {
  overflow: hidden;
}

.recovery-fee-badge,
.recovery-live-state,
.recovery-pair-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--shadcn-border);
  border-radius: 999px;
  background: var(--shadcn-muted);
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.recovery-form {
  display: grid;
  gap: 14px;
  padding: 15px;
  border-top: 1px solid var(--shadcn-border);
}

.recovery-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.recovery-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #52525b;
  font-size: 12px;
  font-weight: 800;
}

.recovery-field > span strong {
  color: var(--shadcn-foreground);
  font-size: 12px;
}

.recovery-field .stock-input {
  width: 100%;
}

.recovery-ratio-field input[type="range"] {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: #18181b;
}

.recovery-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
}

.recovery-form-actions button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #18181b;
  background: #18181b;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.recovery-form-actions button.secondary {
  border-color: var(--shadcn-border);
  background: #ffffff;
  color: #3f3f46;
}

.recovery-form-actions button:hover:not(:disabled) {
  background: #27272a;
  color: #ffffff;
}

.recovery-form-actions button.secondary:hover:not(:disabled) {
  border-color: #a1a1aa;
  background: var(--shadcn-muted);
  color: #18181b;
}

.recovery-form-status {
  min-height: 18px;
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 700;
}

.recovery-form-status.error {
  color: #b91c1c;
}

.recovery-result-shell {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.recovery-empty-state {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 28px;
  color: var(--shadcn-muted-foreground);
  text-align: center;
}

.recovery-empty-state strong {
  color: var(--shadcn-foreground);
  font-size: 16px;
}

.recovery-empty-state span {
  margin-top: 4px;
  font-size: 12px;
}

.recovery-summary-panel,
.recovery-chart-panel,
.recovery-action-panel,
.recovery-ledger-panel {
  min-width: 0;
  overflow: hidden;
}

.recovery-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--shadcn-border);
}

.recovery-stock-id {
  min-width: 0;
}

.recovery-stock-id > span,
.recovery-stock-id > small {
  display: block;
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 700;
}

.recovery-stock-id h3 {
  margin: 3px 0;
  overflow: hidden;
  color: var(--shadcn-foreground);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-live-state {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.recovery-live-state.stale {
  border-color: #fde68a;
  background: #fffbeb;
  color: #a16207;
}

.recovery-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.recovery-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px 15px;
  border-right: 1px solid var(--shadcn-border);
}

.recovery-metric:last-child {
  border-right: 0;
}

.recovery-metric > span,
.recovery-metric > small {
  overflow: hidden;
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-metric > strong {
  overflow: hidden;
  color: var(--shadcn-foreground);
  font-size: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-progress {
  display: grid;
  gap: 8px;
  padding: 12px 15px 14px;
  border-top: 1px solid var(--shadcn-border);
  background: #fafafa;
}

.recovery-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 700;
}

.recovery-progress-copy strong {
  color: var(--shadcn-foreground);
  font-size: 12px;
}

.recovery-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e4e7;
}

.recovery-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.recovery-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.65fr);
  gap: 10px;
}

.recovery-chart-panel .panel-header,
.recovery-action-panel .panel-header,
.recovery-ledger-panel .panel-header {
  border-bottom: 1px solid var(--shadcn-border);
}

.recovery-chart-wrap {
  min-height: 300px;
  background: #ffffff;
}

.recovery-chart-wrap .stock-detail-svg {
  min-height: 300px;
}

.chart-reference-line line {
  stroke-width: 1.2;
  stroke-dasharray: 5 4;
}

.chart-reference-line text {
  font-size: 9px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 3px;
}

.chart-reference-line.cost line {
  stroke: #a16207;
}

.chart-reference-line.cost text {
  fill: #a16207;
}

.chart-reference-line.simulated line {
  stroke: #2563eb;
}

.chart-reference-line.simulated text {
  fill: #2563eb;
}

.recovery-action-content {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.recovery-action-state {
  padding: 12px;
  border-left: 3px solid #a1a1aa;
  background: #fafafa;
}

.recovery-action-state.positive {
  border-left-color: #dc2626;
  background: #fff7f7;
}

.recovery-action-state.negative {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.recovery-action-state.blocked {
  border-left-color: #a16207;
  background: #fffbeb;
}

.recovery-action-state > span {
  color: var(--shadcn-muted-foreground);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.recovery-action-state > strong {
  display: block;
  margin-top: 5px;
  color: var(--shadcn-foreground);
  font-size: 17px;
}

.recovery-action-state p {
  margin: 7px 0 0;
  color: #52525b;
  font-size: 12px;
  line-height: 1.55;
}

.recovery-strategy-route {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--shadcn-border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.recovery-strategy-route > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid var(--shadcn-border);
  border-bottom: 1px solid var(--shadcn-border);
}

.recovery-strategy-route > span:nth-child(2n) {
  border-right: 0;
}

.recovery-strategy-route > span:nth-last-child(-n + 2) {
  border-bottom: 1px solid var(--shadcn-border);
}

.recovery-strategy-route .route-window {
  grid-column: 1 / -1;
  border-right: 0;
  border-bottom: 0;
}

.recovery-strategy-route small {
  color: var(--shadcn-muted-foreground);
  font-size: 10px;
  font-weight: 700;
}

.recovery-strategy-route strong {
  overflow: hidden;
  color: var(--shadcn-foreground);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-action-levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--shadcn-border);
  border-radius: 6px;
}

.recovery-action-levels > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid var(--shadcn-border);
  border-bottom: 1px solid var(--shadcn-border);
}

.recovery-action-levels > span:nth-child(2n) {
  border-right: 0;
}

.recovery-action-levels > span:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.recovery-action-levels small {
  color: var(--shadcn-muted-foreground);
  font-size: 10px;
  font-weight: 700;
}

.recovery-action-levels strong {
  overflow: hidden;
  color: var(--shadcn-foreground);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-market-guard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 700;
}

.recovery-market-guard strong {
  max-width: 72%;
  color: var(--shadcn-foreground);
  line-height: 1.45;
  text-align: right;
}

.recovery-pair-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.recovery-pair-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.3fr) minmax(260px, 1fr) minmax(170px, 0.48fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--shadcn-border);
  border-radius: 6px;
  background: #ffffff;
}

.recovery-pair-title,
.recovery-pair-result {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.recovery-pair-title strong,
.recovery-pair-result strong {
  overflow: hidden;
  color: var(--shadcn-foreground);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-pair-title span,
.recovery-pair-result span {
  color: var(--shadcn-muted-foreground);
  font-size: 10px;
  font-weight: 700;
}

.recovery-pair-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.recovery-pair-flow > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

.recovery-pair-flow > span strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-pair-flow .buy {
  background: #fff1f2;
  color: #b91c1c;
}

.recovery-pair-flow .sell {
  background: #f0fdf4;
  color: #15803d;
}

.recovery-pair-flow i {
  color: #a1a1aa;
  font-style: normal;
}

.recovery-pair-empty {
  padding: 24px;
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.kronos-config-panel {
  position: sticky;
  top: 12px;
}

.kronos-engine-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--shadcn-border);
  border-radius: 999px;
  background: var(--shadcn-muted);
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 900;
}

.kronos-form {
  display: grid;
  gap: 13px;
  padding: 14px;
}

.kronos-preset-box {
  display: grid;
  gap: 4px;
  padding: 12px 12px 11px;
  border: 1px solid var(--shadcn-border);
  border-radius: 8px;
  background: #fafafa;
}

.kronos-preset-box span {
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
  font-weight: 800;
}

.kronos-preset-box strong {
  color: var(--shadcn-foreground);
  font-size: 14px;
  font-weight: 900;
}

.kronos-preset-box em {
  color: #71717a;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.kronos-adjust-btn {
  min-height: 34px;
  border: 1px solid var(--shadcn-border);
  background: #ffffff;
  color: var(--shadcn-foreground);
  font-size: 13px;
  font-weight: 900;
}

.kronos-manual-controls {
  display: grid;
  gap: 13px;
}

.kronos-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.kronos-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
  font-weight: 800;
}

.kronos-field strong {
  color: var(--shadcn-foreground);
}

.kronos-field input[type="range"] {
  width: 100%;
  accent-color: var(--shadcn-foreground);
}

.kronos-form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.kronos-form-actions button {
  min-height: 36px;
  padding: 0 12px;
  background: var(--shadcn-foreground);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.kronos-form-actions button.secondary {
  border: 1px solid var(--shadcn-border);
  background: #ffffff;
  color: var(--shadcn-foreground);
}

.kronos-form-status {
  min-height: 18px;
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
  font-weight: 800;
}

.kronos-form-status.negative {
  color: #dc2626;
}

.kronos-result-shell {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.kronos-summary,
.kronos-diagnostics {
  display: grid;
  gap: 10px;
}

.kronos-summary-card,
.kronos-diagnostics-card {
  border: 1px solid var(--shadcn-border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.05);
}

.kronos-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--shadcn-border);
}

.kronos-summary-head div {
  min-width: 0;
}

.kronos-summary-head span,
.kronos-metrics small,
.kronos-diagnostics-card span {
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 800;
}

.kronos-summary-head h3 {
  margin: 3px 0 0;
  color: var(--shadcn-foreground);
  font-size: 20px;
  line-height: 1.25;
}

.kronos-summary-head em {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--shadcn-border);
  border-radius: 999px;
  background: var(--shadcn-muted);
  color: var(--shadcn-foreground);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.kronos-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--shadcn-border);
}

.kronos-metrics > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--shadcn-border);
}

.kronos-metrics > span:last-child {
  border-right: 0;
}

.kronos-metrics strong {
  overflow: hidden;
  color: var(--shadcn-foreground);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kronos-range-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--shadcn-border);
  background: #fafafa;
}

.kronos-range-stats > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border-right: 1px solid var(--shadcn-border);
}

.kronos-range-stats > span:last-child {
  border-right: 0;
}

.kronos-range-stats small {
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 800;
}

.kronos-range-stats strong {
  overflow: hidden;
  color: var(--shadcn-foreground);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kronos-range-stats strong.positive {
  color: #dc2626;
}

.kronos-range-stats strong.negative {
  color: #15803d;
}

.kronos-range-stats em {
  overflow: hidden;
  color: #71717a;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kronos-summary-card p,
.kronos-warning {
  margin: 0;
  padding: 12px 14px;
  color: #52525b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}

.kronos-warning {
  border-top: 1px solid var(--shadcn-border);
  background: #fffbeb;
  color: #92400e;
}

.kronos-chart-wrap {
  min-height: 360px;
  overflow-x: auto;
  background: #ffffff;
}

.kronos-chart-wrap .stock-detail-svg {
  min-width: 920px;
  min-height: 360px;
}

.kronos-diagnostics-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.kronos-diagnostics-card > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px 14px;
}

.kronos-diagnostics-card > div + div {
  border-left: 1px solid var(--shadcn-border);
}

.kronos-diagnostics-card strong {
  color: var(--shadcn-foreground);
  font-size: 13px;
  line-height: 1.45;
}

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

  .recovery-config-panel,
  .kronos-config-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .recovery-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .kronos-range-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kronos-metrics > span {
    border-bottom: 1px solid var(--shadcn-border);
  }

  .kronos-range-stats > span {
    border-bottom: 1px solid var(--shadcn-border);
  }

  .kronos-metrics > span:nth-child(2n),
  .kronos-range-stats > span:nth-child(2n) {
    border-right: 0;
  }

  .kronos-metrics > span:nth-last-child(-n + 2),
  .kronos-range-stats > span:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .kronos-diagnostics-card {
    grid-template-columns: 1fr;
  }

  .kronos-diagnostics-card > div + div {
    border-top: 1px solid var(--shadcn-border);
    border-left: 0;
  }

  .recovery-metric:nth-child(2) {
    border-right: 0;
  }

  .recovery-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--shadcn-border);
  }

  .recovery-pair-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .recovery-summary-head,
  .recovery-progress-copy,
  .recovery-market-guard {
    align-items: flex-start;
    flex-direction: column;
  }

  .recovery-market-guard strong {
    max-width: 100%;
    text-align: left;
  }

.recovery-metrics,
.recovery-action-levels,
.recovery-strategy-route,
.kronos-form-actions,
.kronos-metrics,
.kronos-range-stats {
  grid-template-columns: 1fr;
}

.kronos-summary-head {
  flex-direction: column;
}

.recovery-metric,
.recovery-action-levels > span,
.recovery-strategy-route > span,
.kronos-metrics > span,
.kronos-range-stats > span {
  border-right: 0;
  border-bottom: 1px solid var(--shadcn-border);
}

  .recovery-metric:last-child,
  .recovery-action-levels > span:last-child,
  .recovery-strategy-route > span:last-child,
  .kronos-metrics > span:last-child,
  .kronos-range-stats > span:last-child {
  border-bottom: 0;
}

  .recovery-pair-flow {
    grid-template-columns: 1fr;
  }

  .recovery-pair-flow i {
    display: none;
  }
}

/* Board fund-flow table */
.board-heatmap {
  padding: 0;
}

.board-flow-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--shadcn-border);
  background: #fafafa;
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
}

.board-flow-summary span,
.board-flow-summary strong {
  white-space: nowrap;
}

.board-flow-summary b {
  margin-right: 3px;
  font-size: 14px;
}

.board-flow-summary em {
  margin-left: auto;
  color: #a1a1aa;
  font-style: normal;
  white-space: nowrap;
}

.board-flow-table-wrap {
  max-height: 620px;
  overflow: auto;
}

.board-flow-table {
  width: 100%;
  min-width: 860px;
  table-layout: fixed;
}

.board-flow-table th,
.board-flow-table td {
  padding: 9px 10px;
  vertical-align: middle;
  white-space: nowrap;
}

.board-flow-table th:nth-child(1),
.board-flow-table td:nth-child(1) {
  width: 42px;
}

.board-flow-table th:nth-child(2),
.board-flow-table td:nth-child(2) {
  width: 170px;
}

.board-flow-table th:nth-child(3),
.board-flow-table td:nth-child(3) {
  width: 105px;
}

.board-flow-table th:nth-child(4),
.board-flow-table td:nth-child(4) {
  width: 72px;
}

.board-flow-table th:nth-child(5),
.board-flow-table td:nth-child(5) {
  width: 170px;
}

.board-flow-table th:nth-child(6),
.board-flow-table td:nth-child(6) {
  width: 78px;
}

.board-flow-table th:nth-child(7),
.board-flow-table td:nth-child(7) {
  width: 70px;
}

.board-flow-table th:nth-child(8),
.board-flow-table td:nth-child(8) {
  width: 150px;
}

.board-flow-row {
  transition: background 140ms ease;
}

.board-flow-row:hover td {
  background: #fafafa;
}

.board-flow-rank {
  color: var(--shadcn-muted-foreground);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.board-flow-board {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.board-flow-board:not(:disabled) {
  cursor: pointer;
}

.board-flow-board:disabled {
  cursor: default;
  opacity: 0.72;
}

.board-flow-board > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.board-flow-board strong,
.board-flow-board small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-flow-board strong {
  color: var(--shadcn-foreground);
  font-size: 13px;
}

.board-flow-board small {
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
}

.board-flow-chevron {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #71717a;
  border-top: 1.5px solid #71717a;
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.board-flow-board[aria-expanded="true"] .board-flow-chevron {
  transform: rotate(135deg);
}

.board-flow-amount {
  font-variant-numeric: tabular-nums;
}

.board-flow-amount strong,
.board-flow-amount small {
  display: block;
}

.board-flow-amount strong {
  font-size: 13px;
}

.board-flow-amount small {
  min-height: 14px;
  margin-top: 2px;
  color: var(--shadcn-muted-foreground);
  font-size: 10px;
}

.board-flow-direction {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.board-flow-direction.inflow {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.board-flow-direction.outflow {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #16a34a;
}

.board-flow-direction.flat,
.board-flow-direction.unknown {
  border-color: var(--shadcn-border);
  background: var(--shadcn-muted);
  color: var(--shadcn-muted-foreground);
}

.board-flow-bar {
  position: relative;
  width: 150px;
  height: 14px;
  overflow: hidden;
  border-radius: 3px;
  background: #f4f4f5;
}

.board-flow-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #a1a1aa;
}

.board-flow-bar span {
  position: absolute;
  top: 3px;
  bottom: 3px;
  min-width: 2px;
  border-radius: 2px;
}

.board-flow-bar span.inflow {
  left: 50%;
  background: #ef4444;
}

.board-flow-bar span.outflow {
  right: 50%;
  background: #22c55e;
}

.board-flow-bar span.flat,
.board-flow-bar span.unknown {
  display: none;
}

.board-flow-breadth {
  font-variant-numeric: tabular-nums;
}

.board-flow-breadth strong,
.board-flow-breadth span,
.board-flow-breadth em {
  font-style: normal;
}

.board-flow-breadth strong {
  color: #dc2626;
}

.board-flow-breadth em {
  color: #16a34a;
}

.board-flow-breadth span {
  margin: 0 3px;
  color: var(--shadcn-muted-foreground);
}

.board-flow-leader {
  max-width: 150px;
  overflow: hidden;
  color: var(--shadcn-muted-foreground);
  text-overflow: ellipsis;
}

.board-flow-detail-row > td {
  padding: 0 10px 10px 52px;
  background: #ffffff;
}

.board-flow-detail-row .heat-leader-detail {
  border-color: var(--shadcn-border);
  background: #fafafa;
}

@media (max-width: 720px) {
  .board-flow-summary {
    align-items: flex-start;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-flow-summary em {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .board-flow-table-wrap {
    max-height: 560px;
  }
}

.board-flow-chart-shell {
  position: relative;
  padding: 4px 12px 8px;
  overflow: hidden;
}

.board-flow-chart-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.board-flow-chart-svg {
  display: block;
  width: 100%;
  min-width: 820px;
  height: auto;
  overflow: visible;
}

.board-flow-axis text {
  fill: var(--shadcn-muted-foreground);
  font-size: 12px;
  font-weight: 800;
}

.board-flow-axis text.positive {
  fill: #dc2626;
}

.board-flow-axis text.negative {
  fill: #16a34a;
}

.board-flow-axis .board-flow-scale-label {
  fill: #a1a1aa;
  font-size: 10px;
  font-weight: 700;
}

.board-flow-axis line {
  stroke: #e4e4e7;
  stroke-width: 1;
}

.board-flow-axis .board-flow-zero-line {
  stroke: #71717a;
  stroke-width: 1.2;
}

.board-flow-axis .board-flow-grid-line {
  stroke: #e4e4e7;
  stroke-dasharray: 3 5;
}

.board-flow-chart-row {
  cursor: pointer;
  outline: none;
}

.board-flow-row-hit {
  fill: transparent;
  transition: fill 140ms ease;
}

.board-flow-chart-row.is-hovered .board-flow-row-hit,
.board-flow-chart-row:focus-visible .board-flow-row-hit {
  fill: #f4f4f5;
}

.board-flow-chart-row.inflow.is-selected .board-flow-row-hit {
  fill: #fff1f2;
}

.board-flow-chart-row.outflow.is-selected .board-flow-row-hit {
  fill: #f0fdf4;
}

.board-flow-row-name,
.board-flow-row-type,
.board-flow-value,
.board-flow-pct {
  pointer-events: none;
}

.board-flow-row-name {
  fill: var(--shadcn-foreground);
  font-size: 13px;
  font-weight: 800;
}

.board-flow-row-type {
  fill: var(--shadcn-muted-foreground);
  font-size: 10px;
  font-weight: 700;
}

.board-flow-track {
  fill: #f4f4f5;
  pointer-events: none;
}

.board-flow-zero-pulse {
  fill: #a1a1aa;
  opacity: 0;
  pointer-events: none;
}

.board-flow-zero-pulse.unknown {
  opacity: 0.7;
  animation: boardFlowPulse 1.4s ease-in-out infinite;
}

.board-flow-animated-bar {
  pointer-events: none;
  transform-box: fill-box;
  animation: boardFlowGrow 680ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--flow-delay, 0ms);
}

.board-flow-animated-bar.inflow {
  fill: #ef4444;
  transform-origin: left center;
}

.board-flow-animated-bar.outflow {
  fill: #22c55e;
  transform-origin: right center;
}

.board-flow-animated-bar.flat,
.board-flow-animated-bar.unknown {
  fill: #a1a1aa;
  opacity: 0.35;
  animation: none;
}

.board-flow-end {
  pointer-events: none;
  animation: boardFlowPointIn 280ms ease-out both;
  animation-delay: calc(var(--flow-delay, 0ms) + 480ms);
}

.board-flow-end.inflow {
  fill: #dc2626;
}

.board-flow-end.outflow {
  fill: #16a34a;
}

.board-flow-end.flat {
  fill: #71717a;
}

.board-flow-value,
.board-flow-pct {
  fill: #52525b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.board-flow-value.positive,
.board-flow-pct.positive {
  fill: #dc2626;
}

.board-flow-value.negative,
.board-flow-pct.negative {
  fill: #16a34a;
}

.board-flow-chart-tooltip {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 3px;
  width: min(240px, calc(100% - 12px));
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(24, 24, 27, 0.88);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 10px 24px rgba(24, 24, 27, 0.18);
  pointer-events: none;
}

.board-flow-chart-tooltip strong,
.board-flow-chart-tooltip span,
.board-flow-chart-tooltip small {
  display: block;
}

.board-flow-chart-tooltip small {
  color: rgba(255, 255, 255, 0.72);
}

.board-flow-chart-tooltip .positive {
  color: #fca5a5;
}

.board-flow-chart-tooltip .negative {
  color: #86efac;
}

.board-flow-leader-panel {
  margin: 0 12px 12px;
  border-top: 1px solid var(--shadcn-border);
  background: #ffffff;
}

.board-flow-leader-panel > header {
  padding: 11px 2px 8px;
  color: var(--shadcn-foreground);
  font-size: 12px;
}

.board-flow-leader-panel [data-flow-leader-body] {
  padding: 2px 2px 8px;
}

.board-flow-leader-panel .heat-leader-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
}

.board-flow-leader-panel .heat-leader-stock {
  padding: 7px 8px;
  border: 1px solid var(--shadcn-border);
  border-radius: 6px;
  background: #fafafa;
}

@keyframes boardFlowGrow {
  from {
    opacity: 0.3;
    transform: scaleX(0);
  }

  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes boardFlowPointIn {
  from {
    opacity: 0;
    transform: scale(0.4);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes boardFlowPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(0.45);
  }

  50% {
    opacity: 0.9;
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .board-flow-animated-bar,
  .board-flow-end,
  .board-flow-zero-pulse.unknown {
    animation: none;
  }
}

@media (max-width: 720px) {
  .board-flow-chart-shell {
    padding-inline: 8px;
  }

  .board-flow-chart-svg {
    min-width: 760px;
  }

  .board-flow-leader-panel .heat-leader-list {
    grid-template-columns: 1fr;
  }
}

/* Full-market animated fund-flow matrix */
.board-flow-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--shadcn-border);
  background: #fafafa;
}

.board-flow-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  min-width: 0;
}

.board-flow-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0 14px;
  border-left: 1px solid var(--shadcn-border);
}

.board-flow-metric:first-child {
  padding-left: 0;
  border-left: 0;
}

.board-flow-metric span {
  overflow: hidden;
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-flow-metric strong {
  overflow: hidden;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-flow-type-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 14px;
  padding: 2px;
  border: 1px solid var(--shadcn-border);
  border-radius: 7px;
  background: #ffffff;
}

.board-flow-type-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
  font-weight: 800;
}

.board-flow-type-tabs button:hover,
.board-flow-type-tabs button:focus-visible {
  background: var(--shadcn-muted);
  color: var(--shadcn-foreground);
}

.board-flow-type-tabs button.active {
  background: var(--shadcn-foreground);
  color: #ffffff;
}

.board-flow-type-tabs span {
  font-variant-numeric: tabular-nums;
  opacity: 0.72;
}

.board-flow-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  min-height: 38px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--shadcn-border);
  color: var(--shadcn-muted-foreground);
  font-size: 11px;
}

.board-flow-context strong {
  color: var(--shadcn-foreground);
  font-variant-numeric: tabular-nums;
}

.board-flow-context em {
  margin-left: auto;
  color: #a1a1aa;
  font-style: normal;
}

.board-flow-quality-warning {
  padding: 8px 14px;
  border-bottom: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
}

.board-flow-rankings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--shadcn-border);
}

.board-flow-ranking {
  min-width: 0;
  padding: 10px 14px 12px;
}

.board-flow-ranking + .board-flow-ranking {
  border-left: 1px solid var(--shadcn-border);
}

.board-flow-ranking > header {
  display: grid;
  grid-template-columns: 8px max-content 1fr;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  color: var(--shadcn-foreground);
  font-size: 12px;
}

.board-flow-ranking > header small {
  justify-self: end;
  color: var(--shadcn-muted-foreground);
  font-size: 10px;
  font-weight: 600;
}

.inflow-dot,
.outflow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.inflow-dot {
  background: var(--red);
}

.outflow-dot {
  background: var(--green);
}

.board-flow-ranking-row {
  display: grid;
  grid-template-columns: 20px minmax(92px, 1fr) minmax(54px, 0.8fr) 70px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 4px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background 140ms ease;
}

.board-flow-ranking-row:hover,
.board-flow-ranking-row:focus-visible,
.board-flow-ranking-row.is-hovered,
.board-flow-ranking-row.is-selected {
  background: var(--shadcn-muted);
  outline: none;
}

.board-flow-ranking-rank {
  color: #a1a1aa;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: center;
}

.board-flow-ranking-name {
  min-width: 0;
}

.board-flow-ranking-name strong,
.board-flow-ranking-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-flow-ranking-name strong {
  color: var(--shadcn-foreground);
  font-size: 12px;
}

.board-flow-ranking-name small {
  color: var(--shadcn-muted-foreground);
  font-size: 9px;
}

.board-flow-ranking-bar {
  display: flex;
  align-items: center;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4f4f5;
}

.board-flow-ranking-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.board-flow-ranking-row.inflow .board-flow-ranking-bar i {
  background: #ef4444;
}

.board-flow-ranking-row.outflow .board-flow-ranking-bar i {
  margin-left: auto;
  background: #22c55e;
}

.board-flow-ranking-row em {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-style: normal;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.board-flow-ranking-row.inflow em {
  color: var(--red);
}

.board-flow-ranking-row.outflow em {
  color: var(--green);
}

.board-flow-ranking-empty {
  display: grid;
  place-items: center;
  min-height: 108px;
  color: var(--shadcn-muted-foreground);
  font-size: 12px;
}

.board-flow-map-svg {
  min-width: 800px;
}

.board-flow-map-region rect {
  stroke: var(--shadcn-border);
  stroke-width: 1;
}

.board-flow-map-region.inflow rect {
  fill: #fff7f7;
}

.board-flow-map-region.outflow rect {
  fill: #f6fcf8;
}

.board-flow-map-region.unknown rect {
  fill: #fafafa;
}

.board-flow-map-region text {
  fill: var(--shadcn-foreground);
  font-size: 12px;
  font-weight: 900;
}

.board-flow-map-region.inflow text:first-of-type {
  fill: #dc2626;
}

.board-flow-map-region.outflow text:first-of-type {
  fill: #16a34a;
}

.board-flow-map-region .board-flow-region-count {
  fill: var(--shadcn-muted-foreground);
  font-size: 10px;
  font-weight: 700;
}

.board-flow-map-tile {
  cursor: pointer;
  outline: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: boardFlowTileIn 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--tile-delay, 0ms);
}

.board-flow-tile-bg {
  transition: filter 150ms ease, opacity 150ms ease;
}

.board-flow-tile-outline {
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 1;
  pointer-events: none;
  transition: stroke 150ms ease, stroke-width 150ms ease;
}

.board-flow-map-tile.is-hovered .board-flow-tile-bg,
.board-flow-map-tile:focus-visible .board-flow-tile-bg {
  filter: brightness(1.08) saturate(1.08);
}

.board-flow-map-tile.is-hovered .board-flow-tile-outline,
.board-flow-map-tile:focus-visible .board-flow-tile-outline {
  stroke: rgba(24, 24, 27, 0.72);
  stroke-width: 2;
}

.board-flow-map-tile.is-selected .board-flow-tile-outline {
  stroke: #18181b;
  stroke-width: 2.6;
}

.board-flow-tile-name,
.board-flow-tile-amount,
.board-flow-tile-meta {
  pointer-events: none;
}

.board-flow-tile-name {
  font-size: 12px;
  font-weight: 900;
}

.board-flow-tile-amount {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.board-flow-tile-meta {
  font-size: 9px;
  font-weight: 700;
}

.board-flow-map-tile.light-text .board-flow-tile-name,
.board-flow-map-tile.light-text .board-flow-tile-amount {
  fill: #ffffff;
}

.board-flow-map-tile.light-text .board-flow-tile-meta {
  fill: rgba(255, 255, 255, 0.78);
}

.board-flow-map-tile.dark-text .board-flow-tile-name,
.board-flow-map-tile.dark-text .board-flow-tile-amount {
  fill: #18181b;
}

.board-flow-map-tile.dark-text .board-flow-tile-meta {
  fill: rgba(24, 24, 27, 0.62);
}

.board-flow-particle {
  fill: rgba(255, 255, 255, 0.82);
  pointer-events: none;
}

@keyframes boardFlowTileIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .board-flow-map-tile {
    animation: none;
  }

  .board-flow-particle animate {
    display: none;
  }
}

@media (max-width: 900px) {
  .board-flow-toolbar {
    grid-template-columns: 1fr;
  }

  .board-flow-type-tabs {
    justify-self: start;
    margin: 0 12px 10px;
  }
}

@media (max-width: 720px) {
  .board-flow-type-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-self: stretch;
  }

  .board-flow-map-svg {
    min-width: 760px;
  }
}

/* Intraday board fund-flow line chart */
.board-flow-line-shell {
  padding: 12px;
  background: var(--surface);
}

.board-flow-line-svg {
  min-width: 900px;
}

.board-flow-plot-bg {
  fill: var(--surface-soft);
  stroke: var(--line);
  stroke-width: 1;
}

.board-flow-line-svg .board-flow-axis text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.board-flow-line-svg .board-flow-axis text.positive {
  fill: var(--red);
}

.board-flow-line-svg .board-flow-axis text.negative {
  fill: var(--green);
}

.board-flow-line-svg .board-flow-axis .board-flow-scale-label {
  fill: var(--muted);
  font-size: 12px;
}

.board-flow-line-svg .board-flow-axis line {
  stroke: var(--line);
}

.board-flow-line-svg .board-flow-axis .board-flow-grid-line {
  stroke-dasharray: none;
}

.board-flow-line-svg .board-flow-axis .board-flow-grid-line.vertical {
  stroke: var(--line-soft);
}

.board-flow-line-svg .board-flow-axis .board-flow-zero-line {
  stroke: #a1a1aa;
  stroke-width: 1.2;
}

.board-flow-pointer-field {
  fill: transparent;
  pointer-events: all;
}

.board-flow-line-group {
  color: var(--flow-color);
  cursor: pointer;
  outline: none;
}

.board-flow-line-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 13;
  pointer-events: stroke;
}

.board-flow-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  opacity: 0.58;
  transition: opacity 140ms ease, stroke-width 140ms ease;
}

.board-flow-line-group.is-labeled .board-flow-line {
  opacity: 1;
  stroke-width: 2.5;
}

.board-flow-line-group.close-summary .board-flow-line {
  stroke-dasharray: 5 5;
}

.board-flow-line-end {
  fill: currentColor;
  stroke: var(--surface-soft);
  stroke-width: 1.4;
  opacity: 0.78;
  transition: opacity 140ms ease, r 140ms ease;
}

.board-flow-line-group.is-hovered .board-flow-line,
.board-flow-line-group:focus-visible .board-flow-line,
.board-flow-line-group.is-selected .board-flow-line {
  opacity: 1;
  stroke-width: 3;
}

.board-flow-line-group.is-hovered .board-flow-line-end,
.board-flow-line-group:focus-visible .board-flow-line-end,
.board-flow-line-group.is-selected .board-flow-line-end {
  opacity: 1;
}

.board-flow-right-label {
  color: var(--flow-color);
  cursor: pointer;
  outline: none;
}

.board-flow-right-label path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.42;
  pointer-events: none;
}

.board-flow-right-label circle {
  fill: currentColor;
  pointer-events: none;
}

.board-flow-right-label text {
  fill: currentColor;
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.board-flow-right-label.is-hovered text,
.board-flow-right-label:focus-visible text,
.board-flow-right-label.is-selected text {
  paint-order: stroke;
  stroke: var(--surface-soft);
  stroke-width: 3px;
}

.board-flow-crosshair {
  stroke: rgba(113, 113, 122, 0.7);
  stroke-width: 1;
  stroke-dasharray: 4 5;
  pointer-events: none;
}

.board-flow-chart-empty text {
  fill: var(--muted);
  font-size: 15px;
  font-weight: 800;
  pointer-events: none;
}

.board-flow-chart-empty .detail {
  fill: var(--faint);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .board-flow-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .board-flow-metric:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .board-flow-type-tabs {
    width: 100%;
    margin-right: 0;
  }

  .board-flow-type-tabs button {
    flex: 1;
  }

  .board-flow-context em {
    width: 100%;
    margin-left: 0;
  }

  .board-flow-rankings {
    grid-template-columns: 1fr;
  }

  .board-flow-ranking + .board-flow-ranking {
    border-top: 1px solid var(--shadcn-border);
    border-left: 0;
  }

  .board-flow-line-shell {
    padding: 8px;
  }

  .board-flow-line-svg {
    min-width: 860px;
  }
}
