:root {
  color-scheme: light;
  --bg: #f4f6f1;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #18212a;
  --muted: #667380;
  --line: #d8dfdc;
  --line-strong: #aebbb7;
  --green: #13764f;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #b42318;
  --violet: #6f56c9;
  --shadow: 0 16px 36px rgba(24, 33, 42, 0.08);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(19, 118, 79, 0.11), transparent 32%),
    linear-gradient(180deg, rgba(37, 99, 235, 0.08), transparent 360px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.flow-shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.flow-header,
.decision-grid,
.toolbar-panel,
.kpi-grid,
.history-memory-section,
.trend-stack-section,
.cluster-section,
.daily-depth-section,
.route-panel,
.turnover-section,
.workbench-grid,
.table-section,
.schema-section {
  margin-bottom: 18px;
}

.flow-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.flow-nav a,
.tab-button,
.source-badge,
.state-pill {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.flow-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.flow-nav a:hover,
.tab-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 18px;
  align-items: stretch;
}

.title-copy,
.sync-panel,
.decision-panel,
.check-panel,
.toolbar-panel,
.history-memory-section,
.trend-stack-section,
.cluster-section,
.daily-depth-section,
.route-panel,
.turnover-section,
.panel,
.table-section,
.schema-section {
  border: 1px solid rgba(216, 223, 220, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.title-copy {
  padding: 24px;
}

.sync-panel {
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 18px;
}

.sync-panel span,
.muted-text,
.source-badge,
.state-pill,
.panel-kicker,
.kicker,
.flow-table th,
.flow-table span,
.kpi-card span,
.kpi-card p,
.index-flow-card span,
.index-flow-card p,
.north-row span,
.schema-card span {
  color: var(--muted);
}

.sync-panel strong {
  font-size: 26px;
}

.source-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-status-list span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 760;
}

.source-status-list span.has-error {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.07);
  color: var(--red);
}

.kicker,
.panel-kicker {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.hero-read {
  max-width: 900px;
  margin-bottom: 0;
  color: #33414d;
  font-size: 17px;
  font-weight: 680;
  line-height: 1.65;
}

.decision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.decision-panel,
.check-panel,
.panel,
.table-section,
.schema-section,
.history-memory-section,
.trend-stack-section,
.cluster-section,
.daily-depth-section,
.route-panel,
.turnover-section {
  padding: 18px;
}

.panel-head,
.section-head,
.index-head,
.score-row,
.toolbar-panel,
.north-row {
  display: flex;
  gap: 14px;
}

.panel-head,
.section-head,
.index-head,
.toolbar-panel {
  align-items: flex-start;
  justify-content: space-between;
}

.score-row {
  align-items: center;
  margin-top: 18px;
}

.score-ring {
  display: grid;
  flex: 0 0 118px;
  width: 118px;
  height: 118px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 56%, transparent 57%),
    conic-gradient(var(--green) 0 var(--score, 0deg), #dfe6e3 var(--score, 0deg) 360deg);
  color: var(--green);
  font-size: 32px;
  font-weight: 860;
}

.decision-panel p,
.check-list,
.risk-box p,
.schema-card p {
  color: #46535e;
  line-height: 1.68;
}

.risk-box {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-radius: 8px;
  background: rgba(180, 35, 24, 0.06);
}

.risk-box span {
  color: var(--red);
  font-size: 12px;
  font-weight: 820;
}

.risk-box p {
  margin: 6px 0 0;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.state-pill,
.source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 820;
}

.state-pill {
  border-color: rgba(19, 118, 79, 0.25);
  background: rgba(19, 118, 79, 0.1);
  color: var(--green);
}

.toolbar-panel {
  align-items: center;
  padding: 14px;
}

.toolbar-panel p {
  margin: 0;
  color: #46535e;
  font-weight: 680;
  line-height: 1.55;
}

.tab-row,
.sort-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button {
  min-width: 62px;
  padding: 0 12px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.tab-button.active {
  border-color: rgba(19, 118, 79, 0.34);
  background: rgba(19, 118, 79, 0.11);
  color: var(--green);
}

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

.kpi-card,
.index-flow-card,
.schema-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.kpi-card {
  min-height: 126px;
  padding: 16px;
}

.kpi-card strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
}

.kpi-card p {
  margin: 8px 0 0;
}

.kpi-card.pos {
  border-color: rgba(19, 118, 79, 0.25);
}

.kpi-card.neg {
  border-color: rgba(180, 35, 24, 0.25);
}

.memory-summary {
  margin: 14px 0 0;
  color: #46535e;
  font-weight: 680;
  line-height: 1.62;
}

.memory-metrics,
.history-window-cards,
.history-sector-memory,
.history-migration {
  display: grid;
  gap: 10px;
}

.memory-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.history-window-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-sector-memory {
  max-height: 520px;
  overflow: auto;
}

.history-migration {
  max-height: 420px;
  overflow: auto;
}

.memory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 12px;
  margin-top: 12px;
}

.memory-layout.secondary {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.84fr);
}

.memory-panel,
.memory-metric,
.history-window-card,
.timeline-row,
.memory-sector-row,
.migration-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.memory-panel {
  padding: 14px;
  background: var(--surface-soft);
}

.memory-panel h3 {
  margin-bottom: 12px;
}

.memory-metric {
  padding: 12px;
}

.memory-metric span,
.memory-metric p,
.history-window-card span,
.history-window-card dt,
.timeline-row span,
.memory-sector-row span,
.memory-sector-row dt,
.migration-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.memory-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.memory-metric p,
.history-window-card p,
.timeline-row p,
.migration-row p {
  margin: 7px 0 0;
  color: #46535e;
  font-size: 13px;
  line-height: 1.52;
}

.history-window-card p,
.migration-row p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-window-card,
.memory-sector-row {
  display: grid;
  width: 100%;
  gap: 8px;
  padding: 12px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.history-window-card:hover,
.history-window-card.active,
.memory-sector-row:hover,
.memory-sector-row.active {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(37, 99, 235, 0.06);
}

.history-window-card > div:first-child,
.timeline-row,
.migration-row > div,
.memory-sector-row > div:first-child {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.history-window-card > div:first-child strong {
  color: var(--green);
  font-size: 24px;
}

.history-window-card dl,
.memory-sector-row dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.history-window-card dt,
.memory-sector-row dt {
  margin-bottom: 3px;
}

.history-window-card dd,
.memory-sector-row dd {
  margin: 0;
  font-weight: 820;
}

.history-timeline {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(128px, 0.78fr) minmax(96px, 0.48fr) minmax(108px, 0.58fr);
  gap: 8px;
  padding: 10px;
}

.timeline-row p {
  grid-column: 1 / -1;
}

.timeline-row strong,
.memory-sector-row strong,
.migration-row strong {
  display: block;
}

.migration-row {
  padding: 12px;
}

.migration-row {
  border-left: 4px solid var(--blue);
}

.migration-row.tone-pos {
  border-left-color: var(--green);
}

.migration-row.tone-warn {
  border-left-color: var(--amber);
}

.migration-row.tone-neg {
  border-left-color: var(--red);
}

.migration-row em {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-weight: 840;
}

.trend-stack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.trend-layer-card,
.resonance-check {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.trend-layer-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.trend-layer-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.trend-layer-head span,
.trend-layer-card small,
.trend-layer-card dt,
.resonance-main span,
.resonance-check span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.trend-layer-head strong {
  font-size: 26px;
}

.trend-layer-card h3,
.trend-layer-card p {
  margin: 0;
}

.trend-layer-card p,
.trend-layer-card small,
.resonance-main p,
.resonance-check p {
  color: #46535e;
  line-height: 1.56;
}

.trend-score {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ece9;
}

.trend-score i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.trend-layer-card.tone-warn .trend-score i {
  background: var(--amber);
}

.trend-layer-card.tone-neg .trend-score i {
  background: var(--red);
}

.trend-layer-card.tone-flat .trend-score i {
  background: var(--blue);
}

.trend-layer-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.trend-layer-card dl div {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.trend-layer-card dd {
  margin: 3px 0 0;
  font-weight: 840;
}

.trend-resonance {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 12px;
  margin-top: 12px;
}

.resonance-main {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(19, 118, 79, 0.22);
  border-radius: 8px;
  background: rgba(19, 118, 79, 0.07);
}

.resonance-main strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.resonance-main p,
.resonance-check p {
  margin: 8px 0 0;
}

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

.resonance-check {
  padding: 12px;
}

.resonance-check strong {
  display: block;
  margin-top: 5px;
}

.resonance-check.tone-pos {
  border-left: 4px solid var(--green);
}

.resonance-check.tone-warn {
  border-left: 4px solid var(--amber);
}

.resonance-check.tone-neg {
  border-left: 4px solid var(--red);
}

.resonance-check.tone-flat {
  border-left: 4px solid var(--blue);
}

.cluster-summary {
  margin: 14px 0 0;
  color: #46535e;
  font-weight: 680;
  line-height: 1.62;
}

.cluster-method {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cluster-method span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: #3b4650;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 760;
}

.cluster-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 430px);
  gap: 14px;
  margin-top: 16px;
}

.cluster-chart-panel,
.cluster-side {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.cluster-chart-panel,
.cluster-side,
.cluster-detail {
  padding: 14px;
}

.cluster-chart-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 12px;
  margin-bottom: 12px;
}

.cluster-chart-head h3,
.cluster-chart-head p {
  margin: 0;
}

.cluster-chart-head p,
.cluster-detail p,
.cluster-card p {
  color: #46535e;
  line-height: 1.55;
}

.cluster-selected-metrics,
.cluster-detail-grid {
  display: grid;
  gap: 8px;
}

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

.cluster-selected-metrics div,
.cluster-detail-grid div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.cluster-selected-metrics span,
.cluster-detail-grid span,
.cluster-members span,
.cluster-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.cluster-selected-metrics strong,
.cluster-detail-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
}

.cluster-list {
  display: grid;
  gap: 8px;
}

.cluster-card {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px 10px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.cluster-card:hover,
.cluster-card.active {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(37, 99, 235, 0.06);
}

.cluster-card.tone-pos {
  border-left: 4px solid var(--green);
}

.cluster-card.tone-warn {
  border-left: 4px solid var(--amber);
}

.cluster-card.tone-neg {
  border-left: 4px solid var(--red);
}

.cluster-card.tone-flat {
  border-left: 4px solid var(--blue);
}

.cluster-card strong {
  display: block;
}

.cluster-card p {
  margin: 4px 0 0;
  font-size: 13px;
}

.cluster-card dl {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.cluster-card dl div {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.cluster-card dd {
  margin: 3px 0 0;
  font-weight: 820;
}

.cluster-detail {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.cluster-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.cluster-members {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.cluster-members div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cluster-members em {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: #3b4650;
  padding: 0 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
}

.depth-summary {
  margin: 14px 0 0;
  color: #46535e;
  font-weight: 680;
  line-height: 1.62;
}

.thermometer-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.thermo-card,
.signal-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.thermo-card {
  padding: 12px;
}

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

.thermo-head span,
.thermo-card small,
.signal-card span,
.signal-card em {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.thermo-head strong {
  font-size: 24px;
}

.thermo-meter {
  height: 8px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ece9;
}

.thermo-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.thermo-card.tone-warn .thermo-meter i {
  background: var(--amber);
}

.thermo-card.tone-flat .thermo-meter i {
  background: var(--blue);
}

.thermo-card.tone-neg .thermo-meter i {
  background: var(--red);
}

.thermo-card p {
  margin: 0 0 8px;
  color: #46535e;
  font-size: 13px;
  line-height: 1.52;
}

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

.signal-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px;
  cursor: pointer;
  color: inherit;
  text-align: left;
}

.signal-card:hover,
.signal-card.active {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(37, 99, 235, 0.06);
}

.signal-card strong {
  display: block;
  font-size: 15px;
}

.signal-card p {
  margin: 0;
  color: #46535e;
  font-size: 13px;
  line-height: 1.52;
}

.signal-card em {
  font-style: normal;
}

.signal-risk {
  border-left: 4px solid var(--red);
}

.signal-watch {
  border-left: 4px solid var(--amber);
}

.signal-confirm {
  border-left: 4px solid var(--green);
}

.signal-info {
  border-left: 4px solid var(--blue);
}

.daily-depth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.92fr) minmax(320px, 0.92fr);
  gap: 12px;
  margin-top: 14px;
}

.depth-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.depth-panel h3 {
  margin-bottom: 12px;
}

.intraday-rhythm,
.attribution-list,
.continuity-list {
  display: grid;
  gap: 10px;
}

.rhythm-step,
.attribution-row,
.continuity-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.rhythm-step {
  padding: 10px;
}

.rhythm-head,
.rhythm-values,
.continuity-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.rhythm-head span,
.rhythm-values span,
.attribution-row span,
.continuity-main span,
.continuity-facts span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.rhythm-bar {
  height: 8px;
  margin: 9px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ece9;
}

.rhythm-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.rhythm-step.neg .rhythm-bar i {
  background: var(--red);
}

.rhythm-step p,
.attribution-row p {
  margin: 8px 0 0;
  color: #46535e;
  font-size: 13px;
  line-height: 1.55;
}

.attribution-row,
.continuity-row {
  display: grid;
  width: 100%;
  gap: 8px;
  padding: 10px;
  cursor: pointer;
  color: inherit;
  text-align: left;
}

.attribution-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.attribution-row p {
  grid-column: 1 / -1;
}

.attribution-row:hover,
.attribution-row.active,
.continuity-row:hover,
.continuity-row.active {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(37, 99, 235, 0.06);
}

.attribution-row.tone-pos {
  border-left: 4px solid var(--green);
}

.attribution-row.tone-neg {
  border-left: 4px solid var(--red);
}

.attribution-row.tone-flat {
  border-left: 4px solid var(--amber);
}

.attribution-row div:last-of-type {
  text-align: right;
}

.attribution-row strong,
.continuity-row strong {
  display: block;
}

.score-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ece9;
}

.score-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--green));
}

.continuity-main {
  display: grid;
  gap: 4px;
}

.diagnostic-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 12px;
  margin-top: 12px;
}

.phase-heatmap,
.divergence-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.phase-heatmap {
  overflow-x: auto;
}

.heatmap-head,
.heatmap-row {
  display: grid;
  gap: 8px;
  align-items: center;
  min-width: 620px;
}

.heatmap-head {
  padding: 0 8px;
}

.heatmap-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.heatmap-row,
.divergence-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.heatmap-row {
  padding: 9px 8px;
}

.heatmap-row:hover,
.heatmap-row.active,
.divergence-card:hover,
.divergence-card.active {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(37, 99, 235, 0.06);
}

.heat-cell {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 820;
}

.heat-cell.pos {
  background: rgba(19, 118, 79, var(--heat-alpha, 0.2));
}

.heat-cell.neg {
  background: rgba(180, 35, 24, var(--heat-alpha, 0.2));
}

.heat-cell.flat {
  background: rgba(102, 115, 128, 0.12);
}

.heatmap-row em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 720;
}

.divergence-card {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.divergence-card span,
.divergence-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.divergence-card strong {
  display: block;
  margin-top: 2px;
}

.divergence-card p {
  margin: 0;
  color: #46535e;
  font-size: 13px;
  line-height: 1.52;
}

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

.divergence-card dl div {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.divergence-card dd {
  margin: 3px 0 0;
  font-weight: 820;
}

.route-chart {
  min-height: 310px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(19, 118, 79, 0.05), transparent 42%),
    var(--surface-soft);
}

.route-chart svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: 310px;
}

.turnover-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
}

.share-main,
.share-side {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.share-main {
  padding: 14px;
}

.share-side {
  padding: 14px;
}

.share-summary,
.share-side p,
.share-metric p {
  color: #46535e;
  line-height: 1.62;
}

.share-summary {
  margin-bottom: 12px;
  font-weight: 680;
}

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

.share-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.share-metric span,
.share-metric p,
.share-chip span {
  color: var(--muted);
}

.share-metric span,
.share-chip span {
  font-size: 12px;
  font-weight: 760;
}

.share-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.share-metric p {
  margin: 6px 0 0;
  font-size: 13px;
}

.share-chart {
  min-height: 282px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.share-chart svg {
  display: block;
  width: 100%;
  min-width: 680px;
  height: 282px;
}

.share-plot-bg {
  fill: #f8faf7;
}

.share-grid {
  stroke: #dbe3df;
  stroke-width: 1;
}

.share-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-line.selected {
  opacity: 1;
  stroke-width: 4;
}

.share-line.dim {
  opacity: 0.28;
  stroke-width: 2.4;
}

.share-dot {
  opacity: 0.8;
}

.share-dot.selected {
  stroke: #ffffff;
  stroke-width: 2;
}

.share-axis-label,
.share-line-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.share-line-label {
  fill: var(--ink);
  font-weight: 820;
}

.share-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

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

.share-chip:hover,
.share-chip.active {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(37, 99, 235, 0.06);
}

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

.share-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-chip em {
  font-style: normal;
  font-weight: 840;
}

.share-chip span:last-child {
  grid-column: 2 / 4;
}

.route-pos {
  stroke: rgba(19, 118, 79, 0.34);
}

.route-neg {
  stroke: rgba(180, 35, 24, 0.26);
}

.route-node rect {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.route-node text {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 780;
}

.node-pos rect {
  fill: #e9f6ef;
}

.node-neg rect {
  fill: #faecea;
}

.node-neutral rect {
  fill: #eef2ff;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
}

.index-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.index-flow-card {
  padding: 14px;
}

.index-head {
  align-items: center;
}

.flow-split,
.detail-metrics,
.schema-grid {
  display: grid;
  gap: 10px;
}

.flow-split {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0;
}

.flow-split div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.flow-split strong,
.flow-split span {
  display: block;
}

.index-flow-card p {
  margin: 0;
  line-height: 1.55;
}

.mini-chart {
  min-height: 138px;
  margin-top: 14px;
}

.line-chart,
.bar-chart {
  width: 100%;
  height: 138px;
}

.axis {
  stroke: #ccd6d2;
  stroke-width: 1;
}

.line-pos {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.bar-pos {
  fill: var(--green);
  opacity: 0.82;
}

.bar-neg {
  fill: var(--red);
  opacity: 0.78;
}

.line-chart text,
.bar-chart text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.line-chart circle {
  fill: var(--blue);
}

.north-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.north-row {
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.north-row div {
  min-width: 0;
}

.north-row strong,
.north-row span {
  display: block;
}

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 420px);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

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

.flow-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

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

.flow-table th {
  background: #f3f6f4;
  font-size: 12px;
  font-weight: 820;
}

.flow-table tr:last-child td {
  border-bottom: 0;
}

.flow-table tbody tr {
  cursor: default;
}

#sector-body tr {
  cursor: pointer;
}

.flow-table tbody tr:hover,
.flow-table tbody tr.selected {
  background: rgba(37, 99, 235, 0.06);
}

.flow-table strong,
.flow-table span {
  display: block;
}

.detail-panel {
  position: sticky;
  top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.detail-panel p {
  color: #46535e;
  line-height: 1.65;
}

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

.detail-metrics div {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
}

.detail-metrics dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-metrics dd {
  margin: 5px 0 0;
  font-weight: 820;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-cloud span,
.field-list code {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #3b4650;
  font-size: 12px;
  font-weight: 760;
}

.tag-cloud span {
  padding: 0 10px;
}

.section-head {
  margin-bottom: 0;
}

.schema-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.schema-card {
  padding: 14px;
}

.schema-card p {
  margin-bottom: 10px;
}

.field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.field-list code {
  padding: 0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.pos {
  color: var(--green);
}

.neg {
  color: var(--red);
}

.flat {
  color: var(--muted);
}

.empty-chart {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--muted);
  font-weight: 720;
}

@media (max-width: 1180px) {
  .kpi-grid,
  .index-flow-grid,
  .trend-stack-grid,
  .trend-resonance,
  .memory-metrics,
  .thermometer-grid,
  .signal-alerts,
  .daily-depth-grid,
  .schema-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .decision-grid,
  .workbench-grid,
  .resonance-grid,
  .memory-layout,
  .memory-layout.secondary,
  .cluster-layout,
  .cluster-chart-head,
  .diagnostic-lower-grid,
  .ranking-layout,
  .turnover-layout,
  .title-row {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .flow-shell {
    width: min(100% - 20px, 1500px);
    padding-top: 14px;
  }

  .title-copy,
  .decision-panel,
  .check-panel,
  .panel,
  .table-section,
  .schema-section,
  .history-memory-section,
  .trend-stack-section,
  .cluster-section,
  .daily-depth-section,
  .route-panel,
  .turnover-section {
    padding: 14px;
  }

  .kpi-grid,
  .index-flow-grid,
  .trend-stack-grid,
  .trend-resonance,
  .memory-metrics,
  .history-window-cards,
  .history-window-card dl,
  .memory-sector-row dl,
  .resonance-grid,
  .trend-layer-card dl,
  .thermometer-grid,
  .signal-alerts,
  .cluster-selected-metrics,
  .cluster-card dl,
  .cluster-detail-grid,
  .daily-depth-grid,
  .diagnostic-lower-grid,
  .divergence-card dl,
  .schema-grid,
  .flow-split,
  .detail-metrics,
  .share-metrics {
    grid-template-columns: 1fr;
  }

  .toolbar-panel,
  .score-row,
  .panel-head,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .score-ring {
    flex-basis: auto;
    width: 104px;
    height: 104px;
    font-size: 28px;
  }

  h1 {
    font-size: 34px;
  }

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

  .timeline-row {
    grid-template-columns: 1fr;
  }

  .flow-table {
    min-width: 880px;
  }
}
