:root {
  --bg: #eef3f8;
  --bg-soft: #f7fafc;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --line: rgba(25, 42, 62, 0.12);
  --line-strong: rgba(25, 42, 62, 0.2);
  --ink: #172033;
  --muted: #647084;
  --faint: #8a97aa;
  --accent: #0f8f9d;
  --accent-2: #2563eb;
  --entity: #087f8c;
  --category: #2f80ed;
  --stage: #17a673;
  --automation: #f59e0b;
  --workflow: #7c3aed;
  --trigger: #ef4444;
  --field: #44546a;
  --card: #0ea5e9;
  --unknown: #7b8794;
  --shadow: 0 18px 45px rgba(31, 50, 74, 0.1);
  --shadow-soft: 0 8px 24px rgba(31, 50, 74, 0.08);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.14), transparent 28%),
    radial-gradient(circle at 82% 4%, rgba(15, 143, 157, 0.12), transparent 24%),
    linear-gradient(180deg, #f8fbfe 0%, var(--bg) 100%);
  font-family: "Segoe UI Variable", "Aptos", "Segoe UI", sans-serif;
  font-size: 14px;
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  padding: 18px 16px;
  border-right: 1px solid var(--line);
  background: rgba(248, 251, 254, 0.82);
  backdrop-filter: blur(16px);
}

.brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(15, 143, 157, 0.22);
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #e8f7fa);
  box-shadow: var(--shadow-soft);
  display: grid;
  place-items: center;
  grid-template-columns: repeat(2, 9px);
  grid-auto-rows: 9px;
  gap: 4px;
}

.brand-mark span {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--accent);
}

.brand-mark span:nth-child(2) {
  background: var(--accent-2);
}

.brand-mark span:nth-child(3) {
  grid-column: span 2;
  width: 22px;
  background: var(--stage);
}

.brand-kicker,
.hero-kicker,
.section-eyebrow {
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 700;
}

.brand h1,
.hero-panel h2 {
  margin: 5px 0 6px;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 760;
}

.brand p,
.hero-panel p,
.panel-head p,
.muted,
.insight-strip span {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.search-box {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box input:focus {
  border-color: rgba(37, 99, 235, 0.48);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.type-filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  cursor: pointer;
}

.type-filter.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.stats-card,
.panel,
.hero-panel,
.graph-panel,
.insight-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stats-card {
  padding: 12px;
  margin-bottom: 14px;
}

.stats-title,
.list-header {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

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

.stat-chip {
  border: 1px solid rgba(25, 42, 62, 0.08);
  border-radius: 13px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.82);
}

.stat-chip strong {
  display: block;
  font-size: 18px;
  line-height: 1;
}

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

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

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  color: var(--ink);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
}

.legend-entity { background: var(--entity); }
.legend-category { background: var(--category); }
.legend-stage { background: var(--stage); }
.legend-automation { background: var(--automation); }
.legend-workflow { background: var(--workflow); }
.legend-trigger { background: var(--trigger); }
.legend-field { background: var(--field); }
.legend-card-dot { background: var(--card); }

.list-header {
  display: flex;
  justify-content: space-between;
  margin: 8px 2px 10px;
}

.result-list {
  display: grid;
  gap: 7px;
  max-height: calc(100vh - 366px);
  overflow: auto;
  padding-right: 3px;
}

.tree-root,
.tree-branch,
.tree-children {
  display: grid;
  gap: 6px;
}

.tree-item,
.result-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 8px 9px;
  text-align: left;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.tree-item:hover,
.result-item:hover,
.mini-link:hover,
.relation-link:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.tree-static {
  cursor: default;
}

.tree-item.active,
.result-item.active {
  border-color: rgba(15, 143, 157, 0.38);
  background: linear-gradient(135deg, rgba(15, 143, 157, 0.11), rgba(37, 99, 235, 0.08));
}

.tree-depth-1 { margin-left: 10px; }
.tree-depth-2 { margin-left: 20px; }
.tree-depth-3 { margin-left: 30px; }
.tree-depth-4,
.tree-depth-5 { margin-left: 40px; }

.tree-label,
.result-item .title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.tree-caret {
  width: 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.tree-caret.blank {
  visibility: hidden;
}

.tree-meta,
.result-item .meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.type-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}

.type-icon-entity { background: var(--entity); }
.type-icon-category { background: var(--category); }
.type-icon-stage { background: var(--stage); }
.type-icon-automation { background: var(--automation); color: #3d2600; }
.type-icon-workflow { background: var(--workflow); }
.type-icon-trigger { background: var(--trigger); }
.type-icon-field { background: var(--field); }
.type-icon-card { background: var(--card); }
.type-icon-unknown { background: var(--unknown); }

.content {
  min-width: 0;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 560px;
  gap: 14px;
  grid-auto-flow: dense;
}

.hero-panel {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 252, 0.9)),
    radial-gradient(circle at 94% 0%, rgba(15, 143, 157, 0.12), transparent 24%);
}

.hero-copy {
  min-width: 0;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-button,
.source-link,
.badge,
.insight-strip a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
}

.nav-button {
  cursor: pointer;
}

.nav-button-primary {
  color: var(--accent-2);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.16);
}

.nav-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.badge {
  color: #fff;
  border-color: transparent;
}

.source-link {
  color: var(--accent-2);
}

.insight-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}

.insight-strip div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.panel,
.graph-panel {
  padding: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-head h3,
.stage-card h4,
.relation-group h4,
.action-card h4,
.process-step h4 {
  margin: 0;
  color: var(--ink);
}

.panel-head h3 {
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.panel-head p {
  max-width: 620px;
  font-size: 12px;
  text-align: right;
}

.process-summary {
  display: none;
}

.right-rail {
  grid-column: 2;
  grid-row: 3 / span 2;
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.workspace-inspector {
  grid-column: auto;
}

.stage-summary {
  grid-row: auto;
}

.process-summary {
  grid-row: auto;
}

.graph-panel {
  grid-column: 1;
  grid-row: 3 / span 2;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.5fr) repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.workspace-inspector .stage-grid {
  grid-template-columns: 1fr;
}

.workspace-inspector .stage-card-wide {
  grid-row: auto;
}

.stage-card {
  min-width: 0;
  border: 1px solid rgba(25, 42, 62, 0.1);
  border-radius: var(--radius-md);
  padding: 11px;
  background: rgba(248, 251, 254, 0.74);
}

.stage-card-wide {
  grid-row: span 2;
}

.stage-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.mini-icon {
  width: 18px;
  height: 18px;
  border-radius: 7px;
  display: inline-block;
  background: var(--unknown);
}

.robot-icon { background: linear-gradient(135deg, var(--automation), #fbbf24); }
.trigger-icon { background: linear-gradient(135deg, var(--trigger), #fb7185); }
.workflow-icon { background: linear-gradient(135deg, var(--workflow), #a78bfa); }
.read-icon { background: linear-gradient(135deg, var(--field), #94a3b8); }
.write-icon { background: linear-gradient(135deg, var(--stage), #4ade80); }
.transition-icon { background: linear-gradient(135deg, var(--category), #60a5fa); }

.mini-list,
.relations,
.actions-list,
.process-steps {
  display: grid;
  gap: 8px;
}

.mini-link,
.relation-link {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
  cursor: pointer;
}

.mini-link span,
.relation-link {
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.mini-link small,
.relation-link small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.mini-link strong {
  display: inline-block;
  margin-top: 5px;
  border-radius: 999px;
  padding: 3px 7px;
  color: #754100;
  background: rgba(245, 158, 11, 0.14);
  font-size: 10px;
}

.inspector-row {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.86);
  text-align: left;
  cursor: pointer;
}

.inspector-row:hover,
.field-chip:hover {
  border-color: rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}

.row-index {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.row-play {
  display: inline-flex;
  justify-content: center;
  color: var(--accent-2);
  font-weight: 820;
}

.row-main {
  min-width: 0;
  overflow-wrap: anywhere;
}

.row-main strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.22;
}

.row-main small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.status-pill {
  border-radius: 999px;
  padding: 4px 8px;
  color: #16723c;
  background: rgba(34, 197, 94, 0.14);
  font-size: 10px;
  font-weight: 800;
}

.transition-row {
  grid-template-columns: 24px minmax(0, 1fr);
}

.field-chip {
  border: 0;
  border-radius: 999px;
  padding: 5px 9px;
  color: #166534;
  background: rgba(34, 197, 94, 0.11);
  text-align: left;
  font-size: 11px;
  cursor: pointer;
}

.field-chip::before {
  content: "• ";
}

.field-chip.write {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
}

.empty-state,
.process-placeholder {
  border: 1px dashed rgba(100, 112, 132, 0.24);
  border-radius: 13px;
  padding: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
  font-size: 12px;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.map-toolbar span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 720;
}

.pipeline-map {
  min-height: 520px;
  border: 1px solid rgba(25, 42, 62, 0.08);
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(rgba(25, 42, 62, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 42, 62, 0.028) 1px, transparent 1px),
    rgba(248, 251, 254, 0.72);
  background-size: 28px 28px;
}

.pipeline-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.pipeline-title strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.pipeline-title > span {
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--accent-2);
  background: rgba(37, 99, 235, 0.08);
  font-size: 12px;
  font-weight: 750;
}

.stage-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 34px 30px;
  align-items: start;
}

.category-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.category-tile {
  border: 1px solid var(--line);
  border-top: 3px solid var(--category);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.category-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 16px 34px rgba(31, 50, 74, 0.14);
}

.category-icon {
  display: inline-flex;
  margin-bottom: 12px;
}

.category-title {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 820;
  line-height: 1.24;
}

.category-subtitle {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.category-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(25, 42, 62, 0.08);
}

.category-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.stage-tile {
  position: relative;
  min-height: 116px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--stage);
  border-radius: 15px;
  padding: 15px 13px 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.stage-tile::after {
  content: "→";
  position: absolute;
  top: 43px;
  right: -23px;
  color: rgba(100, 112, 132, 0.48);
  font-size: 20px;
}

.stage-tile:nth-child(4n)::after,
.stage-tile:last-child::after {
  content: "";
}

.stage-tile:hover,
.stage-tile.active {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 16px 34px rgba(31, 50, 74, 0.14);
}

.stage-tile.active {
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

.accent-1 { border-top-color: #2f80ed; }
.accent-2 { border-top-color: #0f8f9d; }
.accent-3 { border-top-color: #f59e0b; }
.accent-4 { border-top-color: #17a673; }
.accent-5 { border-top-color: #7c3aed; }
.accent-6 { border-top-color: #64748b; }

.stage-number {
  position: absolute;
  top: 13px;
  left: 13px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.accent-1 .stage-number { background: #2f80ed; }
.accent-2 .stage-number { background: #0f8f9d; }
.accent-3 .stage-number { background: #f59e0b; color: #3d2600; }
.accent-4 .stage-number { background: #17a673; }
.accent-5 .stage-number { background: #7c3aed; }
.accent-6 .stage-number { background: #64748b; }

.stage-title {
  display: block;
  margin-left: 34px;
  min-height: 30px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.stage-subtitle {
  display: block;
  margin: 10px 0 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.stage-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid rgba(25, 42, 62, 0.08);
}

.stage-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.stage-metrics .type-icon,
.map-summary .type-icon {
  width: 17px;
  height: 17px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 17px;
}

.map-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.map-summary div {
  display: grid;
  grid-template-columns: 22px auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
}

.map-summary .type-icon {
  grid-row: span 2;
}

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

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

.pipeline-empty {
  min-height: 420px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.pipeline-empty strong {
  color: var(--ink);
  font-size: 17px;
}

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

.panel-wide {
  grid-column: 1 / -1;
}

.details-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.detail-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row .key,
.detail-row .value {
  min-width: 0;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.detail-row .key {
  color: var(--muted);
  background: rgba(248, 251, 254, 0.9);
  font-weight: 720;
}

.detail-row .value {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
}

.relation-group {
  display: grid;
  gap: 7px;
}

.relation-group h4 {
  font-size: 12px;
  color: var(--muted);
}

.relation-links {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
}

.action-card,
.process-step {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.action-card h4,
.process-step h4 {
  font-size: 13px;
}

.action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.action-meta span {
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  background: rgba(100, 112, 132, 0.1);
  font-size: 10px;
}

.action-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 12px;
}

.process-step p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .content {
    grid-template-columns: 1fr;
  }

  .graph-panel,
  .right-rail,
  .workspace-inspector,
  .hero-panel,
  .insight-strip,
  .details-grid {
    grid-column: 1;
    grid-row: auto;
  }

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

  .stage-card-wide,
  .panel-wide {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

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

  .result-list {
    max-height: 420px;
  }

  .hero-panel,
  .panel-head,
  .insight-strip,
  .insight-strip div {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head p {
    text-align: left;
  }

  .stage-grid,
  .details-grid,
  .map-summary {
    grid-template-columns: 1fr;
  }

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

  .stage-tile::after {
    content: "";
  }
}

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