:root {
  color-scheme: light;
  --bg: #f4efe6;
  --panel: #fffaf2;
  --border: #d9c8ac;
  --text: #1e1b18;
  --muted: #6a5d51;
  --accent: #0f766e;
  --accent-soft: #d7f2ed;
  --success-border: #88c9bc;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --danger-border: #f1b3ad;
  --warning: #b54708;
  --warning-soft: #ffead5;
  --warning-border: #f3c792;
  --shadow: 0 18px 40px rgba(53, 43, 32, 0.1);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 28rem),
    linear-gradient(180deg, #f9f4eb 0%, var(--bg) 100%);
}

.shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.lede {
  max-width: 54rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.lede.compact {
  max-width: 64rem;
  margin-bottom: 0;
}

.feedback {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.feedback.hidden {
  display: none;
}

.feedback.success {
  background: var(--accent-soft);
  border-color: rgba(15, 118, 110, 0.2);
}

.feedback.error {
  background: var(--danger-soft);
  border-color: rgba(180, 35, 24, 0.22);
}

.app-shell {
  display: grid;
  gap: 18px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: grid;
  gap: 18px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.home-summary-grid,
.workspace-grid {
  display: grid;
  gap: 14px;
}

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

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

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

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

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel {
  background: rgba(255, 250, 242, 0.9);
  border: 1px solid rgba(217, 200, 172, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  backdrop-filter: blur(8px);
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.panel-hero {
  border-width: 2px;
}

.panel-hero.working {
  border-color: var(--success-border);
}

.panel-hero.needs-attention {
  border-color: var(--warning-border);
}

.panel-hero.blocked {
  border-color: var(--danger-border);
}

.compact-warning {
  display: grid;
  gap: 12px;
  border-color: var(--warning-border);
  background: rgba(255, 234, 213, 0.52);
}

.shell-nav {
  border-width: 2px;
}

.shell-nav-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

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

.view-nav-link {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(217, 200, 172, 0.8);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
}

.view-nav-link.active {
  border-color: var(--success-border);
  background: rgba(215, 242, 237, 0.64);
}

.view-nav-label {
  font-weight: 700;
}

.view-nav-copy {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-actions {
  align-self: center;
}

.meta-list,
.action-list,
.bullet-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.meta-list li,
.action-list li,
.bullet-list li {
  padding: 10px 0;
  border-top: 1px solid rgba(217, 200, 172, 0.5);
}

.meta-list li:first-child,
.action-list li:first-child,
.bullet-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.bullet-list.compact li,
.action-list.compact li {
  padding: 8px 0;
}

.meta-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-value {
  display: block;
  margin-top: 4px;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  word-break: break-word;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
}

.status-pill.live {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill.missing {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.working {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill.needs-attention {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.blocked {
  background: var(--danger-soft);
  color: var(--danger);
}

.step-grid,
.source-check-grid {
  display: grid;
  gap: 14px;
}

.step-card,
.source-card,
.sub-panel,
.home-card,
.recommendation-card {
  border: 1px solid rgba(217, 200, 172, 0.8);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.recommendation-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.step-card.working,
.source-card.working {
  border-color: var(--success-border);
}

.step-card.needs-attention,
.source-card.needs-attention {
  border-color: var(--warning-border);
}

.step-card.blocked,
.source-card.blocked,
.home-card.blocked {
  border-color: var(--danger-border);
}

.home-card.working {
  border-color: var(--success-border);
}

.home-card.needs-attention {
  border-color: var(--warning-border);
}

.recommendation-card.critical,
.recommendation-card.high {
  border-color: var(--warning-border);
  background: linear-gradient(180deg, rgba(255, 234, 213, 0.62), rgba(255, 255, 255, 0.78));
}

.recommendation-card.critical {
  border-color: var(--danger-border);
}

.recommendation-card.medium {
  border-color: var(--warning-border);
}

.recommendation-card.low {
  border-color: var(--success-border);
}

.recommendation-header {
  display: grid;
  gap: 10px;
}

.recommendation-header h3 {
  margin-bottom: 0;
}

.recommendation-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.priority-pill,
.confidence-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.priority-pill.critical {
  color: var(--danger);
  background: var(--danger-soft);
}

.priority-pill.high,
.priority-pill.medium {
  color: var(--warning);
  background: var(--warning-soft);
}

.priority-pill.low,
.confidence-pill {
  color: var(--accent);
  background: var(--accent-soft);
}

.recommendation-evidence,
.recommendation-impact,
.recommendation-action {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.recommendation-action strong {
  color: var(--text);
}

.insight-card-list {
  display: grid;
  gap: 14px;
}

.insight-card-list .source-card h3 {
  font-size: 1rem;
  line-height: 1.35;
}

.insight-card-list code {
  white-space: normal;
}

.compact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.button.subtle {
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
}

.inline-form label {
  display: grid;
  gap: 6px;
  min-width: min(260px, 100%);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.inline-form select {
  border: 1px solid rgba(217, 200, 172, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
}

.analysis-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 1.35fr) auto;
  gap: 18px;
  align-items: end;
}

.analysis-range-form,
.export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.analysis-range-form label {
  display: grid;
  gap: 6px;
  min-width: 140px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.analysis-range-form select,
.analysis-range-form input,
.field input,
.field select {
  border: 1px solid rgba(217, 200, 172, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

.heatmap-workspace {
  display: grid;
  gap: 18px;
  align-items: start;
}

.heatmap-hero-panel {
  padding: 18px;
}

.heatmap-support-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr) auto;
  gap: 18px;
  align-items: start;
}

.snapshot-heatmap-frame {
  position: relative;
  min-height: 72vh;
  max-height: none;
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(217, 200, 172, 0.9);
  background: #f7efe2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.snapshot-image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 72vh;
  background: #fffaf1;
}

.snapshot-status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 8px 11px;
  border-radius: 14px;
  border: 1px solid rgba(18, 53, 47, 0.14);
  background: rgba(255, 250, 241, 0.94);
  color: var(--ink);
  font-size: 0.78rem;
  box-shadow: 0 10px 28px rgba(22, 39, 33, 0.16);
}

.snapshot-status-badge.needs-attention {
  border-color: rgba(182, 116, 37, 0.38);
  background: rgba(255, 246, 225, 0.96);
}

.snapshot-status-badge span {
  color: var(--muted);
}

.snapshot-upgrade-note {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  max-width: min(420px, calc(100% - 240px));
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 15px;
  border: 1px solid rgba(182, 116, 37, 0.3);
  background: rgba(255, 249, 237, 0.95);
  color: var(--ink);
  font-size: 0.78rem;
  box-shadow: 0 10px 28px rgba(22, 39, 33, 0.14);
}

.snapshot-upgrade-note .button {
  white-space: nowrap;
}

.snapshot-missing .snapshot-upgrade-note {
  position: static;
  justify-self: center;
  max-width: min(720px, 100%);
}

.snapshot-missing.approximate-only {
  border-style: solid;
  background: linear-gradient(135deg, rgba(255, 250, 241, 0.9), rgba(255, 239, 208, 0.82));
}

.snapshot-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.snapshot-overlay-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 14px;
  max-width: min(680px, calc(100% - 48px));
  border-radius: 18px;
  background: rgba(255, 250, 241, 0.92);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 28px rgba(53, 43, 32, 0.14);
}

.stack-tight {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.snapshot-missing,
.sankey-empty {
  display: grid;
  gap: 14px;
  min-height: 320px;
  place-content: center;
  padding: 26px;
  border-radius: 22px;
  border: 1px dashed rgba(181, 71, 8, 0.45);
  background: rgba(255, 250, 241, 0.72);
  color: var(--muted);
  text-align: center;
}

.snapshot-missing h3,
.sankey-empty h3 {
  color: var(--text);
}

.snapshot-legend,
.sankey-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.snapshot-legend span,
.sankey-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

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

.legend-swatch.clicks,
.legend-swatch.flow {
  background: rgba(15, 118, 110, 0.76);
}

.legend-swatch.scroll {
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.18), rgba(180, 83, 9, 0.68));
}

.legend-swatch.friction {
  background: rgba(180, 35, 24, 0.78);
}

.legend-swatch.exit {
  background: rgba(83, 65, 42, 0.56);
}

.mode-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.heatmap-canvas {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(217, 200, 172, 0.9);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 16% 12%, rgba(255, 234, 213, 0.9), transparent 28%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.95), rgba(215, 242, 237, 0.58));
  background-size: 48px 48px, 48px 48px, auto, auto;
}

.heatmap-canvas.empty-state {
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.heatmap-blob,
.heatmap-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  pointer-events: auto;
}

.heatmap-blob {
  display: block;
  filter: blur(7px) saturate(1.24);
  background:
    radial-gradient(circle,
      rgba(255, 246, 94, 0.98) 0%,
      rgba(249, 115, 22, 0.82) 28%,
      rgba(220, 38, 38, 0.52) 52%,
      rgba(220, 38, 38, 0.12) 74%,
      rgba(220, 38, 38, 0) 100%);
  box-shadow:
    0 0 34px rgba(249, 115, 22, 0.34),
    0 0 64px rgba(220, 38, 38, 0.16);
}

.heatmap-dot {
  display: inline-grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 10px 24px rgba(53, 43, 32, 0.18);
}

.heatmap-dot.click {
  background: radial-gradient(circle, rgba(15, 118, 110, 0.96), rgba(15, 118, 110, 0.18));
}

.heatmap-dot.friction {
  width: 42px;
  height: 42px;
  background: radial-gradient(circle, rgba(180, 35, 24, 0.94), rgba(180, 35, 24, 0.18));
}

.heatmap-dot.friction.medium {
  background: radial-gradient(circle, rgba(181, 71, 8, 0.94), rgba(181, 71, 8, 0.18));
}

.heatmap-dot.friction.low {
  background: radial-gradient(circle, rgba(15, 118, 110, 0.9), rgba(15, 118, 110, 0.16));
}

.scroll-band {
  position: absolute;
  left: 0;
  right: 0;
  opacity: var(--scroll-intensity, 0.4);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.16), rgba(245, 158, 11, 0.46), rgba(180, 35, 24, 0.2)),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.16) 0 10px, rgba(255,255,255,0) 10px 20px);
  border-top: 1px solid rgba(255, 255, 255, 0.38);
  border-bottom: 1px solid rgba(53, 43, 32, 0.08);
}

.sankey-chart {
  overflow: auto;
  min-height: 620px;
  border-radius: 24px;
  border: 1px solid rgba(217, 200, 172, 0.9);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(255, 250, 241, 0.92), rgba(245, 232, 211, 0.78));
}

.sankey-chart svg {
  display: block;
  width: 100%;
  min-width: 1480px;
  height: auto;
}

.sankey-link {
  fill: none;
  stroke: url(#sankeyLinkGradient);
  stroke-linecap: round;
  stroke-opacity: 0.72;
  cursor: pointer;
  transition: stroke-opacity 0.16s ease, filter 0.16s ease;
}

.sankey-link:hover {
  stroke-opacity: 0.92;
  filter: drop-shadow(0 4px 10px rgba(53, 43, 32, 0.18));
}

.sankey-link.has-friction {
  stroke: rgba(180, 83, 9, 0.5);
  stroke-opacity: 0.66;
}

.sankey-link.is-exit-flow {
  stroke: url(#sankeyExitGradient);
  stroke-dasharray: 8 10;
  stroke-opacity: 0.54;
}

.sankey-link.is-backtrack {
  stroke-dasharray: 5 8;
  stroke-opacity: 0.44;
}

.sankey-link.has-friction.is-exit-flow {
  stroke: rgba(181, 71, 8, 0.48);
}

.sankey-node {
  cursor: pointer;
}

.sankey-node rect {
  fill: rgba(255, 250, 241, 0.96);
  stroke: rgba(83, 65, 42, 0.2);
  stroke-width: 1.4;
  filter: drop-shadow(0 10px 18px rgba(53, 43, 32, 0.12));
}

.sankey-node.entry rect {
  fill: rgba(222, 247, 236, 0.96);
}

.sankey-node.checkout rect {
  fill: rgba(219, 234, 254, 0.96);
}

.sankey-node.exit {
  cursor: default;
}

.sankey-node.exit rect {
  fill: rgba(248, 241, 229, 0.96);
  stroke-dasharray: 5 4;
  stroke: rgba(138, 111, 73, 0.42);
}

.sankey-node.class-home rect {
  stroke: rgba(15, 118, 110, 0.38);
}

.sankey-node.class-cart rect,
.sankey-node.class-checkout rect {
  stroke: rgba(37, 99, 235, 0.34);
}

.sankey-node text {
  fill: var(--text);
  font-size: 14.5px;
  font-weight: 800;
  pointer-events: none;
}

.sankey-node-meta {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.sankey-node-subtitle {
  fill: rgba(83, 65, 42, 0.72);
  font-size: 10.5px;
  font-weight: 700;
}

.sankey-column-labels text {
  fill: rgba(83, 65, 42, 0.62);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-anchor: middle;
  text-transform: uppercase;
}

.sankey-support-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) 1.6fr;
  gap: 16px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(217, 200, 172, 0.9);
  background: rgba(255, 250, 241, 0.72);
}

.sankey-support-panel h3 {
  margin: 0 0 4px;
}

.sankey-loop-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.sankey-loop-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(181, 71, 8, 0.26);
  border-radius: 16px;
  background: rgba(255, 247, 237, 0.95);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.sankey-loop-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.scroll-heatmap {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(217, 200, 172, 0.9);
  background: rgba(255, 255, 255, 0.64);
}

.scroll-row {
  display: grid;
  grid-template-columns: 90px 1fr 90px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.scroll-bar-track {
  height: 16px;
  border-radius: 999px;
  background: rgba(217, 200, 172, 0.42);
  overflow: hidden;
}

.scroll-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #65a30d);
}

.recommendation-score {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.evidence-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  justify-items: end;
}

.evidence-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(53, 43, 32, 0.32);
}

.evidence-panel {
  position: relative;
  width: min(760px, calc(100vw - 28px));
  height: calc(100vh - 28px);
  margin: 14px;
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(217, 200, 172, 0.9);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(53, 43, 32, 0.28);
}

.evidence-list {
  margin-top: 14px;
}

.timeline-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.timeline-list li {
  display: grid;
  grid-template-columns: 74px 140px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid rgba(217, 200, 172, 0.56);
}

.timeline-list small,
.timeline-list em {
  color: var(--muted);
}

.summary-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.summary-value {
  margin: 0 0 6px;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1.1;
}

.summary-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.step-header,
.source-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.step-number {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

form {
  display: grid;
  gap: 16px;
}

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

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

.field.full {
  grid-column: 1 / -1;
}

label {
  font-weight: 600;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
  color: inherit;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: white;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  border: 1px solid rgba(217, 200, 172, 0.95);
}

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

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

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-top: 1px solid rgba(217, 200, 172, 0.5);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
}

.action-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.settings-stack {
  display: grid;
  gap: 16px;
}

.settings-section {
  padding-top: 4px;
  border-top: 1px solid rgba(217, 200, 172, 0.5);
}

.settings-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.settings-section h3 {
  margin-bottom: 6px;
}

.danger-note {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--warning-soft);
  color: #7a2e0e;
}

.signal-list {
  margin: 0;
  padding-left: 18px;
}

.signal-list li + li {
  margin-top: 10px;
}

.details-panel summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

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

.details-content {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

@media (max-width: 860px) {
  .grid.two,
  .field-grid,
  .hero-row,
  .analysis-toolbar,
  .heatmap-support-panel,
  .home-summary-grid,
  .compact-grid,
  .issue-grid,
  .recommendation-grid,
  .view-nav {
    grid-template-columns: 1fr;
  }

  .hero-row {
    display: grid;
  }
}
