:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-soft: #f4f5f7;
  --surface-muted: #eef1f4;
  --border: #e5e7eb;
  --text: #111827;
  --text-secondary: #374151;
  --muted: #6b7280;
  --brand: #e33f32;
  --brand-soft: #fff2f0;
  --green: #10b981;
  --green-soft: #ecfdf5;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --blue: #3b82f6;
  --blue-soft: #eff6ff;
  --violet: #8b5cf6;
  --violet-soft: #f5f3ff;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --gold: #c67d00;
  --gold-soft: #fff7ed;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --page-max: 1620px;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-secondary);
  font: 14px/1.5 var(--font);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner,
.dashboard {
  width: min(var(--page-max), calc(100vw - 64px));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-copy h1,
.section-head h2,
.metric-card h3,
.trend-head h3,
.section-mini-head h3,
.problem-mini-card h4,
.report-card h4 {
  margin: 0;
}

.brand-copy h1 {
  margin-top: 4px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.circle-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.circle-option {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  font-weight: 700;
}

.circle-option.is-active {
  background: var(--brand);
  color: #fff;
}

.meta-chip,
.tag,
.legend-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.meta-chip {
  background: var(--brand-soft);
  color: var(--brand);
}

.dashboard {
  padding: 24px 0 40px;
}

.card,
.metric-card,
.summary-card-block,
.visual-card,
.problem-row,
.problem-mini-card,
.report-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metrics-panel,
.module-panel {
  margin-top: 20px;
}

.module-panel {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.section-head,
.section-mini-head,
.trend-head,
.problem-row-head,
.problem-head-main,
.problem-head-tags,
.trend-event-list,
.filters-bar,
.module-foot,
.topbar-actions,
.distribution-label-row,
.funnel-layer-top,
.toast-root,
.trend-inline-panel,
.report-grid,
.mini-data-list li,
.sankey-row,
.action-stack {
  display: flex;
  gap: 12px;
}

.section-head {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2 {
  margin-top: 6px;
  color: var(--text);
  font-size: 18px;
}

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

.metrics-strip-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(180px, 1fr));
  gap: 12px;
  min-width: 1400px;
}

.metric-card {
  border: 1px solid var(--border);
  text-align: left;
  padding: 16px;
}

.metric-card.is-active {
  border-color: rgba(227, 63, 50, 0.35);
  background: var(--brand-soft);
}

.metric-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-card h3 {
  font-size: 14px;
  color: var(--text-secondary);
}

.metric-value {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  min-height: 32px;
}

.metric-deltas {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.metric-delta {
  font-size: 12px;
  font-weight: 700;
}

.metric-good {
  background: transparent;
  color: var(--green);
}

.tag-good {
  background: var(--green-soft);
  color: var(--green);
}

.metric-bad {
  background: transparent;
  color: var(--danger);
}

.tag-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.metric-neutral {
  background: transparent;
  color: var(--muted);
}

.tag-muted {
  background: var(--surface-soft);
  color: var(--muted);
}

.tag-warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag-info {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag-violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.tag-gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.tag-slate {
  background: #f1f5f9;
  color: #475569;
}

.metric-empty {
  background: transparent;
}

.info-dot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.info-dot:hover {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue);
}

.metric-info-trigger {
  flex: 0 0 auto;
}

.module-title-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.module-help-trigger {
  border: 1px solid var(--border);
  padding: 0;
}

.trend-inline-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.trend-inline-panel.is-hidden {
  display: none;
}

.trend-head {
  justify-content: space-between;
  align-items: center;
}

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

.trend-head h3 {
  margin-top: 6px;
  color: var(--text);
  font-size: 18px;
}

.text-button,
.tab-button,
.sort-button,
.mini-button,
.ghost-button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
}

.text-button {
  border: none;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
}

.view-toggle-button {
  border: 1px solid rgba(227, 63, 50, 0.18);
  border-radius: 999px;
  background: #fff7f5;
  color: var(--brand);
  padding: 8px 14px;
  font-weight: 700;
}

.view-toggle-button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(227, 63, 50, 0.18);
}

.tab-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button {
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
}

.tab-button.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.summary-grid {
  display: grid;
  gap: 16px;
}

.summary-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-card-block {
  padding: 18px;
}

.summary-card-block p,
.summary-card-block span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.summary-card-block strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 28px;
  line-height: 1.1;
}

.summary-card-block.is-alert {
  border-color: rgba(227, 63, 50, 0.2);
  background: var(--brand-soft);
}

.module-summary,
.module-filters,
.module-content {
  margin-top: 16px;
}

.filters-bar {
  flex-wrap: wrap;
}

.filter-item {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.filter-search {
  flex: 1 1 280px;
}

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

.filter-item select,
.filter-item input {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0 12px;
}

.problem-list {
  display: grid;
  gap: 16px;
}

.problem-row {
  padding: 18px;
}

.problem-row.is-head {
  background: linear-gradient(180deg, #fff6f5 0%, #ffffff 100%);
  border-color: rgba(227, 63, 50, 0.25);
}

.problem-head-main {
  flex: 1;
  align-items: flex-start;
  justify-content: space-between;
}

.problem-head-main strong {
  color: var(--text);
  font-size: 18px;
}

.problem-head-tags {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.problem-card-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1.2fr 0.9fr;
  gap: 12px;
  margin-top: 14px;
}

.problem-mini-card,
.report-card {
  padding: 16px;
}

.problem-mini-card h4,
.report-card h4 {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 12px;
}

.mini-data-list,
.suggestion-bullets,
.detail-list {
  margin: 0;
  padding-left: 18px;
}

.mini-data-list li,
.detail-list li {
  justify-content: space-between;
}

.mini-data-list li + li,
.suggestion-bullets li + li,
.detail-list li + li {
  margin-top: 8px;
}

.mini-data-list span {
  color: var(--muted);
}

.mini-data-list strong {
  color: var(--text);
}

.evidence-tag {
  display: inline-block;
  margin: 0 0 10px;
  color: var(--brand);
  font-weight: 700;
}

.actions-card .action-stack {
  display: grid;
  gap: 8px;
}

.mini-button,
.ghost-button {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.ghost-button {
  padding: 0 14px;
}

.problem-detail-report {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

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

.result-preview {
  display: grid;
  gap: 10px;
}

.result-preview-row {
  display: grid;
  gap: 4px;
}

.result-preview-row span,
.result-preview-row small {
  color: var(--muted);
  font-size: 12px;
}

.report-table-wrap,
.module-table-wrap {
  margin-top: 14px;
}

.visual-grid {
  display: grid;
  gap: 16px;
}

.visual-grid-wide {
  grid-template-columns: 1.45fr 1fr;
}

.visual-card {
  padding: 20px;
}

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

.decision-tree-card,
.decision-evidence-card {
  padding: 20px;
}

.decision-tree {
  position: relative;
  display: grid;
  gap: 16px;
  padding-left: 18px;
}

.decision-tree::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 7px;
  width: 2px;
  background: var(--border);
}

.decision-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.92fr);
  gap: 14px;
  align-items: start;
}

.decision-stage::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 30px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--brand);
  border-radius: 999px;
  background: var(--surface);
}

.decision-stage-main,
.decision-branch-list {
  display: grid;
  gap: 10px;
}

.decision-node,
.decision-branch {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  text-align: left;
  padding: 16px;
}

.decision-node {
  position: relative;
  border-left: 4px solid var(--green);
}

.decision-branch {
  background: var(--surface-soft);
}

.decision-node.is-active,
.decision-branch.is-active {
  border-color: rgba(227, 63, 50, 0.34);
  background: var(--brand-soft);
}

.decision-node-step {
  display: inline-block;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.decision-node-top,
.decision-branch-top,
.decision-evidence-metrics {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.decision-node-top,
.decision-branch-top {
  margin-top: 10px;
}

.decision-node-top strong,
.decision-branch-top strong,
.decision-evidence-head strong {
  color: var(--text);
  font-size: 16px;
}

.decision-node-metric,
.decision-branch-metric {
  margin-top: 12px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.decision-node p,
.decision-node small,
.decision-branch p,
.decision-branch small,
.decision-evidence-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.decision-evidence-head {
  display: grid;
  gap: 6px;
}

.decision-evidence-metrics {
  margin-top: 14px;
}

.decision-evidence-metric {
  flex: 1;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.decision-evidence-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.decision-evidence-metric strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
}

.section-mini-head {
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-mini-head h3 {
  color: var(--text);
  font-size: 16px;
}

.section-mini-head span,
.sankey-label,
.funnel-layer p,
.funnel-layer small,
.full-width-note p {
  color: var(--muted);
}

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

.funnel-layer {
  display: grid;
  gap: 8px;
  text-align: left;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
}

.funnel-layer.is-active {
  border-color: rgba(227, 63, 50, 0.32);
  background: var(--brand-soft);
}

.funnel-layer-top {
  align-items: center;
  justify-content: space-between;
}

.funnel-layer strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

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

.sankey-row {
  align-items: center;
  grid-template-columns: 1.2fr 1fr auto;
}

.sankey-track,
.distribution-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.sankey-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

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

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

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  font-weight: 700;
}

.data-table tbody tr:hover {
  background: var(--surface-soft);
}

.sort-button {
  border: none;
  background: transparent;
  padding: 0;
  font-weight: 700;
}

.sort-button.is-active {
  color: var(--brand);
}

.full-width-note {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.module-foot {
  justify-content: flex-end;
  margin-top: 14px;
}

.trend-chart-shell {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.trend-chart-shell.is-ppt-report {
  padding: 20px 18px 16px;
  background: #ffffff;
}

.trend-chart {
  width: 100%;
  height: auto;
}

.trend-chart-ppt {
  overflow: visible;
}

.ppt-axis-line {
  stroke: rgba(17, 24, 39, 0.48);
  stroke-width: 1.6;
}

.ppt-divider-line {
  stroke: rgba(17, 24, 39, 0.35);
  stroke-width: 1.6;
  stroke-dasharray: 8 8;
}

.ppt-axis-text,
.ppt-month-text {
  fill: rgba(17, 24, 39, 0.72);
  font-size: 12px;
}

.ppt-axis-text {
  text-anchor: end;
}

.ppt-month-text {
  text-anchor: middle;
}

.ppt-axis-title {
  fill: rgba(17, 24, 39, 0.82);
  font-size: 18px;
  font-weight: 700;
  text-anchor: middle;
}

.ppt-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.ppt-line-main {
  stroke: #c91512;
}

.ppt-line-benchmark {
  stroke: #111111;
}

.ppt-point {
  stroke-width: 3;
}

.ppt-point-main {
  fill: #c91512;
  stroke: #c91512;
}

.ppt-point-benchmark {
  fill: #111111;
  stroke: #111111;
}

.ppt-point-label {
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
}

.ppt-point-label-main {
  fill: #c91512;
}

.ppt-point-label-benchmark {
  fill: #111111;
}

.ppt-event-tag {
  fill: #c91512;
}

.ppt-event-tag-text {
  fill: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}

.ppt-event-tag-line {
  stroke: #c91512;
  stroke-width: 2;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-dasharray: 4 4;
}

.chart-event-band {
  fill: var(--blue);
  fill-opacity: 0.12;
  stroke: none;
}

.chart-event-band-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.chart-event-marker-label {
  fill: var(--amber);
  font-size: 10px;
  font-weight: 700;
}

.chart-event-marker-line {
  stroke: var(--amber);
  stroke-width: 2;
}

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

.chart-axis-bottom {
  text-anchor: middle;
}

.chart-axis-right {
  text-anchor: end;
}

.chart-point-value {
  fill: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

.chart-point-value-benchmark {
  fill: var(--muted);
}

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

.chart-line-benchmark {
  stroke: var(--muted);
  stroke-width: 2;
  stroke-dasharray: 8 6;
}

.chart-point {
  fill: var(--surface);
  stroke: var(--brand);
  stroke-width: 2;
}

.chart-point-benchmark {
  fill: var(--surface);
  stroke: var(--muted);
  stroke-width: 2;
}

.trend-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legend-item {
  background: var(--surface-soft);
  color: var(--text-secondary);
}

.legend-item-main {
  background: var(--brand-soft);
  color: var(--brand);
}

.legend-item-benchmark {
  background: var(--surface-soft);
  color: var(--muted);
}

.trend-event-summary {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(227, 63, 50, 0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fff8f6 0%, #ffffff 100%);
}

.trend-event-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.trend-event-summary-head strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
}

.trend-event-summary-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(227, 63, 50, 0.08);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

.event-scroll-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.event-scroll-button:hover {
  border-color: rgba(227, 63, 50, 0.28);
  background: var(--brand-soft);
}

.trend-event-track {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 10px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 24, 39, 0.18) transparent;
}

.trend-event-track::-webkit-scrollbar {
  height: 8px;
}

.trend-event-track::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.18);
}

.trend-event-track::-webkit-scrollbar-track {
  background: transparent;
}

.trend-event-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.98);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.trend-event-card-inline {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 258px;
  min-height: 96px;
  padding: 12px 14px 13px;
  white-space: normal;
  align-content: start;
}

.trend-event-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trend-event-card:hover,
.trend-event-card:focus-visible {
  border-color: rgba(227, 63, 50, 0.24);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.trend-event-date {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
}

.trend-event-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}

.trend-event-badge.is-gray {
  background: var(--blue-soft);
  color: var(--blue);
}

.trend-event-badge.is-launch {
  background: var(--amber-soft);
  color: var(--gold);
}

.trend-event-badge.is-default {
  background: var(--surface-soft);
  color: var(--muted);
}

.trend-event-title {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trend-event-meta,
.trend-event-body {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.trend-event-meta {
  color: var(--muted);
}

.trend-event-inline-meta {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.trend-event-inline-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(249, 250, 251, 0.7);
  backdrop-filter: blur(6px);
}

.loading-overlay.is-hidden,
.event-tooltip.is-hidden {
  display: none;
}

.loading-card {
  display: grid;
  gap: 12px;
  place-items: center;
  padding: 28px 36px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

.toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  display: grid;
}

.toast {
  min-width: 220px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.22);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-out {
  opacity: 0;
  transform: translateY(10px);
}

.event-tooltip {
  position: fixed;
  z-index: 90;
  max-width: 320px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.event-tooltip.is-module-help {
  max-width: 420px;
}

.event-tooltip-card + .event-tooltip-card {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.event-tooltip-card strong {
  display: block;
  color: var(--text);
  margin-bottom: 8px;
}

.event-tooltip-card p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.module-help-card strong {
  margin-bottom: 10px;
}

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

.module-help-section {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.module-help-section:first-child {
  padding-top: 0;
  border-top: none;
}

.module-help-section-title {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1280px) {
  .topbar-inner,
  .dashboard {
    width: calc(100vw - 32px);
  }

  .summary-grid-3,
  .report-grid,
  .problem-card-grid,
  .visual-grid-wide,
  .funnel-grid,
  .decision-layout,
  .decision-stage {
    grid-template-columns: 1fr;
  }

  .decision-tree {
    padding-left: 0;
  }

  .decision-tree::before,
  .decision-stage::before {
    display: none;
  }
}

@media (max-width: 960px) {
  .topbar-inner {
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .problem-head-main {
    flex-direction: column;
  }

  .problem-head-tags {
    justify-content: flex-start;
  }

  .trend-head,
  .trend-head-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .trend-event-summary-head,
  .trend-event-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .trend-event-strip {
    display: flex;
    width: 100%;
  }

  .event-scroll-button {
    flex: 0 0 auto;
  }

  .data-table {
    min-width: 960px;
  }
}

.problem-card-grid-3 {
  display: grid;
  grid-template-columns: 0.85fr 1.8fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.decision-svg-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.decision-svg {
  display: block;
  min-width: 500px;
}

.dt-node:hover rect {
  filter: brightness(0.97);
}


  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: grid;
  gap: 12px;
}

.cause-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.cause-primary {
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.cause-secondary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

.cause-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.cause-label-primary {
  background: var(--danger-soft);
  color: var(--danger);
}

.cause-label-secondary {
  background: var(--surface-soft);
  color: var(--muted);
}

.evidence-section,
.preview-section {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.section-label-small {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.evidence-list {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 5px;
}

.evidence-list li {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.detail-toggle-section {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}

.detail-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.detail-toggle-btn:hover {
  background: var(--surface-soft);
  border-color: var(--brand);
}

.detail-toggle-btn .toggle-label {
  flex: 1;
  text-align: left;
}

.detail-toggle-btn .toggle-icon {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s;
}

.detail-collapsible {
  margin-top: 10px;
}

.sample-section {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}

.result-preview-inline {
  display: grid;
  gap: 6px;
}

.result-preview-inline-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.result-preview-inline-row.is-bad {
  background: var(--danger-soft);
}

.result-preview-inline-row.is-warn {
  background: var(--amber-soft);
}

.result-preview-inline-row .rank {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.result-preview-inline-row .product-name {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-preview-inline-row .product-meta {
  color: var(--muted);
  white-space: nowrap;
}

.result-preview-inline-row .quality-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.preview-quality {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  justify-self: end;
}

.quality-dot-bad { background: var(--danger); }
.quality-dot-warn { background: var(--amber); }
.quality-dot-ok { background: var(--green); }

.inline-sample-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.inline-sample-table th {
  color: var(--muted);
  font-weight: 700;
  padding: 3px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.inline-sample-table td {
  padding: 4px 6px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--surface-muted);
}

.actions-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.action-section {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

@media (max-width: 1280px) {
  .problem-card-grid-3 {
    grid-template-columns: 1fr;
  }

  .result-preview-inline-row {
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
  }
}
