:root {
  --ink: #1a1f24;
  --muted: #5c6570;
  --line: #e3e7eb;
  --line-strong: #cfd6dd;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --sidebar: #101418;
  --sidebar-text: #c5ccd3;
  --sidebar-active: #ffffff;
  --accent: #1f5f8b;
  --accent-hover: #184c6f;
  --brand-amber: #F2A93B;
  --good: #1f6b3a;
  --good-bg: #e8f3ec;
  --bad: #9b2c1f;
  --bad-bg: #f8ebe8;
  --warn: #8a5a12;
  --warn-bg: #f7f0e4;
  --cetacean: #1f5f8b;
  --pinniped: #9a4e24;
  --turtle: #1f6b3a;
  --radius: 6px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sidebar-w: 220px;
  --top-h: 48px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.4;
}
body.presenter-mode .presenter-note { display: block; }

a { color: var(--accent); }
button, input, select { font: inherit; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection { background: #d5e6f2; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 16px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  padding: 4px 8px 12px;
  border-bottom: 1px solid #243039;
}
/* Matches heimdall-data MarineShell / Layout Brand: HR mark + product name */
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.brand .hr-mark {
  height: 28px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.brand .product {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand .contract {
  margin: 8px 0 0;
  font-size: 11px;
  color: #8b96a1;
  line-height: 1.35;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 9px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.nav button:hover { background: #1a2229; color: #fff; }
.nav button.active {
  background: #24303a;
  color: var(--sidebar-active);
}
.nav .section-label {
  margin: 12px 10px 4px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6f7b86;
}

.sidebar-foot {
  margin-top: auto;
  padding: 10px 8px 0;
  border-top: 1px solid #243039;
  font-size: 11px;
  color: #7b8792;
  line-height: 1.4;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--top-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}
.topbar .meta {
  color: var(--muted);
  font-size: 12px;
  margin-left: 10px;
  font-weight: 400;
}
.topbar-left { display: flex; align-items: baseline; gap: 0; min-width: 0; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.2;
}
.btn:hover { background: #f7f8fa; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef1f4; color: var(--ink); }

.content {
  padding: 16px 18px 28px;
  max-width: 1120px;
}
.panel { display: none; }
.panel.active { display: block; }

.page-intro {
  margin: 0 0 14px;
  max-width: 70ch;
}
.page-intro h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.page-intro .step-purpose {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 450;
  line-height: 1.4;
  color: var(--muted);
}
.page-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.page-intro .problem-line {
  margin-top: 2px;
}

.presenter-note {
  display: none;
  margin: 0 0 14px;
  padding: 8px 10px;
  border: 1px solid #d7e2ea;
  background: #f2f7fb;
  color: #23465c;
  font-size: 12px;
  border-radius: var(--radius);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  margin-bottom: 14px;
}
.stat {
  background: var(--surface);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(16, 20, 24, 0.04);
}
.stat .label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat .value {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat .sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.layout-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.layout-qa {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 12px;
}
.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 0 rgba(16, 20, 24, 0.04);
}
.box h3,
.panel-card h3 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3a4450;
  font-weight: 700;
}
.panel-card {
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(16, 20, 24, 0.04);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th, table.data td {
  text-align: left;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 650;
  background: #fafbfc;
}
table.data td.num, table.data th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.data tr.selected td { background: #eef5fa; }

.rule-list { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow: auto; }
.rule-btn {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
}
.rule-btn:hover { background: #f7f9fb; }
.rule-btn.active { border-color: #8fb0c8; background: #eef5fa; }
.rule-btn .top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.rule-btn .blurb {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 650;
  background: #eef1f4;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

.map-frame {
  height: 400px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: #c9d7e2;
}
.map-frame.short { height: 360px; }
.map-legend {
  position: absolute;
  z-index: 500;
  left: 10px;
  bottom: 10px;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 9px;
  font-size: 12px;
}
.legend-item { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.swatch { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}
.field { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.field label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 650;
}
.field select, .field input[type="range"], .field input[type="text"], .field input[type="email"], .field input[type="password"] {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: #fff;
}
.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding-bottom: 2px;
}

.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.alert {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #fff;
}
.alert.bad { border-color: #e2b8b1; background: var(--bad-bg); }
.alert.good { border-color: #b7d4c1; background: var(--good-bg); }
.alert strong { display: block; margin-bottom: 2px; }

.chart-box { height: 230px; position: relative; }
.chart-box canvas { width: 100% !important; height: 100% !important; }

.download-list { display: flex; flex-direction: column; gap: 0; }
.download-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.download-list a:hover .name { color: var(--accent); }
.download-list .name { font-weight: 650; }
.download-list .desc { color: var(--muted); font-size: 12px; margin-top: 2px; }
.download-list .action { color: var(--accent); font-size: 13px; align-self: center; font-weight: 600; }

.upload-zone {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  background: #fafbfc;
  text-align: left;
}
.upload-zone.drag { border-color: var(--accent); background: #eef5fa; }
.upload-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.footer-note {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  max-width: 90ch;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #101418;
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  display: none;
  z-index: 100;
}
.toast.show { display: block; }

/* Auth gate */
body.locked { overflow: hidden; }
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #0d1216;
}
.auth-gate[hidden] { display: none !important; }
.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 22px 18px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  min-width: 0;
}
.auth-brand .hr-mark {
  height: 32px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.auth-card h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.auth-lead, .auth-problem {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
}
.auth-problem { color: var(--muted); }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.auth-form .field input {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  width: 100%;
}
.auth-error { margin: 0; color: var(--bad); font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-hint { margin: 10px 0 0; }

.problem-line {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  max-width: 62ch;
  color: var(--ink);
  font-weight: 550;
}
.plain-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
}
.plain-list li { margin: 6px 0; }

/* Overview polish */
#panel-overview .overview-intro {
  margin-bottom: 18px;
  max-width: 68ch;
}
#panel-overview .overview-intro h2 {
  font-size: 22px;
}
.overview-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 20, 24, 0.04);
  padding: 16px 18px 14px;
}
.overview-card h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #3a4450;
}
.overview-hero {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  background:
    linear-gradient(180deg, #fbfcfd 0%, #fff 55%),
    radial-gradient(120% 80% at 100% 0%, rgba(242, 169, 59, 0.08), transparent 55%);
}
.overview-hero-copy h3 {
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 6px;
}
.overview-hero-copy p { margin: 0; max-width: 36ch; line-height: 1.5; }
.pipeline-stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
  padding: 8px 6px 4px;
  overflow: hidden;
}
.pipeline-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  font-family: var(--font);
}
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 14px;
  margin-bottom: 4px;
}
.does-list { padding-left: 0; list-style: none; }
.does-list li {
  position: relative;
  padding: 8px 0 8px 14px;
  margin: 0;
  border-bottom: 1px solid #eef1f4;
}
.does-list li:last-child { border-bottom: 0; }
.does-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-amber);
}
.does-k {
  font-weight: 700;
  color: var(--ink);
}
.aecom-payoff {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--brand-amber);
  background: #fbf8f2;
  color: #3a4450;
  font-size: 12.5px;
  line-height: 1.45;
  border-radius: 0 6px 6px 0;
}
.contract-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.flow-step {
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 8px;
  padding: 10px 8px 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  position: relative;
}
.flow-step:hover {
  border-color: #9bb8cb;
  background: #f3f7fa;
  transform: translateY(-1px);
}
.flow-step .flow-ico {
  display: block;
  width: 40px;
  height: 22px;
  margin-bottom: 6px;
  color: var(--accent);
}
.flow-step .flow-ico svg { width: 40px; height: 22px; display: block; }
.flow-step .n {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  vertical-align: middle;
}
.flow-step .t { font-weight: 650; font-size: 13px; vertical-align: middle; }
.flow-step .d { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.step-nav-mid { flex: 1; text-align: center; }
.workflow-hint { margin: -2px 0 10px; }

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 14px;
  align-items: center;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, #fbfcfd 0%, #fff 60%),
    radial-gradient(100% 80% at 100% 0%, rgba(242, 169, 59, 0.07), transparent 55%);
  box-shadow: 0 1px 0 rgba(16, 20, 24, 0.04);
}
.page-head-copy { min-width: 0; max-width: 70ch; }
.page-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.page-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.page-head .step-purpose {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.page-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.step-gfx {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
  padding: 6px;
  overflow: hidden;
}
.step-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--font);
}

.step-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.step-rail-item {
  appearance: none;
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 8px;
  padding: 8px 8px 9px;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  position: relative;
}
.step-rail-item:hover {
  border-color: #9bb8cb;
  background: #f3f7fa;
  transform: translateY(-1px);
}
.step-rail-item .sr-n {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d8dee4;
  color: #3a4450;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  vertical-align: middle;
}
.step-rail-item .sr-t {
  font-weight: 650;
  font-size: 12px;
  vertical-align: middle;
}
.step-rail-item .sr-d {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.flow-step.is-current,
.step-rail-item.is-current {
  border-color: #8fb0c8;
  background: #eef5fa;
  box-shadow: inset 0 0 0 1px rgba(31, 95, 139, 0.18);
}
.flow-step.is-current .n,
.step-rail-item.is-current .sr-n {
  background: var(--accent);
  color: #fff;
}
.flow-step.is-done .n,
.step-rail-item.is-done .sr-n {
  background: var(--good);
  color: #fff;
}
.flow-step.is-done,
.step-rail-item.is-done {
  border-color: #c5d8c9;
  background: #f4faf6;
}
.toolbar.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 0 rgba(16, 20, 24, 0.04);
}
.map-card {
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(16, 20, 24, 0.04);
}
.upload-zone.panel-card {
  border-radius: 10px;
}

/* Pipeline motion */
@keyframes pipe-dot {
  0% { transform: translateX(0); opacity: 0; }
  12% { opacity: 1; }
  78% { opacity: 1; }
  100% { transform: translateX(150px); opacity: 0.15; }
}
@keyframes pipe-drop {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 0.9; }
  100% { transform: translateY(36px); opacity: 0; }
}
@keyframes map-pulse {
  0% { transform: scale(0.7); opacity: 0.55; }
  70% { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}
@keyframes pack-lift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes src-soft {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 1; }
}
@keyframes flow-ico-run {
  0%, 100% { opacity: 0.55; }
  40% { opacity: 1; }
}

.pipeline-svg .dot {
  animation: pipe-dot 3.6s linear infinite;
}
.pipeline-svg .d1 { animation-delay: 0s; }
.pipeline-svg .d2 { animation-delay: 0.45s; }
.pipeline-svg .d3 { animation-delay: 0.9s; }
.pipeline-svg .d4 { animation-delay: 1.35s; }
.pipeline-svg .d5 { animation-delay: 1.8s; }
.pipeline-svg .d6 { animation-delay: 2.25s; }
.pipeline-svg .d7 { animation-delay: 2.7s; }
.pipeline-svg .drop {
  animation: pipe-drop 2.4s ease-in infinite;
}
.pipeline-svg .drop-a { animation-delay: 0.2s; }
.pipeline-svg .drop-b { animation-delay: 0.8s; }
.pipeline-svg .drop-c { animation-delay: 1.4s; }
.pipeline-svg .map-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: map-pulse 2.8s ease-out infinite;
}
.pipeline-svg .pack {
  transform-box: fill-box;
  transform-origin: center;
  animation: pack-lift 3.2s ease-in-out infinite;
}
.pipeline-svg .src { animation: src-soft 3.5s ease-in-out infinite; }
.pipeline-svg .src-gbif { animation-delay: 0.4s; }
.pipeline-svg .src-csv { animation-delay: 0.8s; }

.flow-step .fi { animation: flow-ico-run 2.8s ease-in-out infinite; }
.flow-step .fi.b { animation-delay: 0.35s; }
.flow-step .fi.c { animation-delay: 0.7s; }
.flow-step .fi-check { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw-check 2.8s ease-in-out infinite; }
.flow-step .fi-map { animation: map-ring 2.6s ease-out infinite; }
@keyframes draw-check {
  0%, 25% { stroke-dashoffset: 24; }
  50%, 100% { stroke-dashoffset: 0; }
}
@keyframes map-ring {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* Step header motion */
@keyframes intake-arr {
  0% { transform: translateX(0); opacity: 0.2; }
  20% { opacity: 1; }
  100% { transform: translateX(28px); opacity: 0.15; }
}
@keyframes qa-fail-drop {
  0% { transform: translateY(0); opacity: 0.9; }
  100% { transform: translateY(10px); opacity: 0.25; }
}
@keyframes qa-pass-draw {
  0%, 20% { stroke-dashoffset: 40; }
  55%, 100% { stroke-dashoffset: 0; }
}
@keyframes map-dot-in {
  0%, 100% { opacity: 0.35; transform: scale(0.75); }
  40% { opacity: 1; transform: scale(1); }
}
@keyframes report-bar {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}
@keyframes up-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.gfx-intake .arr { animation: intake-arr 2.8s linear infinite; }
.gfx-intake .a1 { animation-delay: 0s; }
.gfx-intake .a2 { animation-delay: 0.45s; }
.gfx-intake .a3 { animation-delay: 0.9s; }
.gfx-intake .a4 { animation-delay: 1.35s; }
.gfx-qa .qa-pass {
  stroke-dasharray: 40;
  stroke-dashoffset: 0;
  animation: qa-pass-draw 2.8s ease-in-out infinite;
}
.gfx-qa .qa-fail { animation: qa-fail-drop 2.2s ease-in-out infinite; }
.gfx-qa .f2 { animation-delay: 0.35s; }
.gfx-qa .f3 { animation-delay: 0.7s; }
.gfx-map .mp {
  transform-box: fill-box;
  transform-origin: center;
  animation: map-dot-in 2.6s ease-in-out infinite;
}
.gfx-map .m2 { animation-delay: 0.3s; }
.gfx-map .m3 { animation-delay: 0.6s; }
.gfx-map .m4 { animation-delay: 0.9s; }
.gfx-map .mp-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: map-pulse 2.8s ease-out infinite;
}
.gfx-report .bar {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: report-bar 2.8s ease-in-out infinite;
}
.gfx-report .b2 { animation-delay: 0.2s; }
.gfx-report .b3 { animation-delay: 0.4s; }
.gfx-pack .pack-lift {
  transform-box: fill-box;
  transform-origin: center;
  animation: pack-lift 3.2s ease-in-out infinite;
}
.gfx-upload .up-arrow { animation: up-bounce 2.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .pipeline-svg .dot,
  .pipeline-svg .drop,
  .pipeline-svg .map-pulse,
  .pipeline-svg .pack,
  .pipeline-svg .src,
  .flow-step .fi,
  .flow-step .fi-check,
  .flow-step .fi-map,
  .gfx-intake .arr,
  .gfx-qa .qa-pass,
  .gfx-qa .qa-fail,
  .gfx-map .mp,
  .gfx-map .mp-ring,
  .gfx-report .bar,
  .gfx-pack .pack-lift,
  .gfx-upload .up-arrow {
    animation: none !important;
  }
  .flow-step:hover,
  .step-rail-item:hover { transform: none; }
  .pipeline-svg .dot { opacity: 1; }
  .pipeline-svg .drop { opacity: 0.55; }
  .pipeline-svg .map-pulse { opacity: 0.35; }
  .gfx-qa .qa-pass { stroke-dashoffset: 0; }
}

@media (max-width: 980px) {
  .flow-steps,
  .step-rail { grid-template-columns: 1fr 1fr; }
  .overview-hero,
  .overview-grid,
  .page-head { grid-template-columns: 1fr; }
  .step-gfx { max-width: 220px; }
}

.leaflet-container { font: inherit; }
.popup-title { font-weight: 700; margin-bottom: 4px; }
.popup-meta { font-size: 12px; color: #445; line-height: 1.35; }

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

/* Guided walkthrough */
.tour-chrome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: rgba(16, 20, 24, 0.94);
  border-top: 1px solid #2a343d;
  padding: 10px 16px;
}
.tour-chrome-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tour-chrome-meta {
  flex: 1;
  min-width: 0;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tour-chrome-meta strong { font-size: 13px; font-weight: 650; }
.tour-chrome .btn-ghost { color: #c5ccd3; }
.tour-chrome .btn-ghost:hover { background: #24303a; color: #fff; }
body.tour-active .content { padding-bottom: 84px; }
body.tour-active .sidebar-foot { padding-bottom: 64px; }

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}
.tour-spotlight {
  position: fixed;
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgba(16, 20, 24, 0.45),
    0 0 0 2px rgba(242, 169, 59, 0.85);
  transition: top 180ms ease, left 180ms ease, width 180ms ease, height 180ms ease;
  background: transparent;
}
.tour-arrow {
  position: fixed;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  z-index: 72;
}
.tour-arrow[data-side="down"] {
  border-top: 10px solid #F2A93B;
  border-bottom: 0;
}
.tour-arrow[data-side="up"] {
  border-bottom: 10px solid #F2A93B;
  border-top: 0;
}
.tour-callout {
  position: fixed;
  z-index: 73;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(16, 20, 24, 0.14);
  max-width: 340px;
}
.tour-callout-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.tour-callout-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #3a4450;
}

.metric-pulse .stat {
  animation: metric-soft 0.7s ease;
}
@keyframes metric-soft {
  0% { background: #eef5fa; }
  100% { background: var(--surface); }
}
@keyframes rule-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.rule-btn.rule-enter {
  animation: rule-in 0.4s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .tour-spotlight { transition: none; }
  .metric-pulse .stat,
  .rule-btn.rule-enter { animation: none !important; }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .layout-2, .layout-qa { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .map-frame, .map-frame.short { height: 320px; }
  .tour-chrome-inner { flex-wrap: wrap; }
  .tour-callout { max-width: min(340px, calc(100vw - 24px)); }
}
