/*
 * ohmoveagain — mobile-first, dark mono, zero framework.
 * Tuned for Lighthouse 90+ on mobile.
 */

:root {
  --bg: #0b0e0f;
  --bg-alt: #11161a;
  --bg-card: #141b20;
  --border: #1f2a31;
  --border-bright: #2a3a44;
  --fg: #d7dee3;
  --fg-dim: #8a969e;
  --fg-muted: #7a8890;
  --accent: #7ee787;
  --accent-dim: #4a8953;
  --warn: #f5a623;
  --err: #ff6b6b;
  --link: #58a6ff;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Inter", "Helvetica Neue", Arial, sans-serif;
  --maxw: 920px;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--link); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

p { margin: 0 0 1em; }

h1, h2, h3, h4 {
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.6em;
}
h1 { font-size: 1.75rem; color: var(--accent); }
h2 { font-size: 1.25rem; color: var(--fg); }
h3 { font-size: 1.05rem; color: var(--fg); }

code, pre, kbd {
  font-family: var(--mono);
  background: var(--bg-alt);
  border-radius: 4px;
}
code { padding: 1px 6px; font-size: 0.95em; color: var(--accent); }
pre  { padding: 12px 14px; overflow-x: auto; border: 1px solid var(--border); font-size: 0.9rem; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

ul, ol { padding-left: 1.2em; }
blockquote {
  border-left: 2px solid var(--border-bright);
  margin: 0;
  padding: 0 0 0 12px;
  color: var(--fg-dim);
}

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px 80px;
}

header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 14, 15, 0.92);
  backdrop-filter: saturate(1.2) blur(6px);
  -webkit-backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--border);
}
.top-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
  white-space: nowrap;
  display: inline-block;
  padding: 4px 0;
  line-height: 1.3;
}
.brand:hover, .brand:focus-visible { text-decoration: none; }
.nav { display: flex; gap: 16px; flex-wrap: wrap; min-width: 0; }
.nav a {
  color: var(--fg-dim);
  padding: 4px 6px;
  border-radius: var(--radius);
  display: inline-block;
  line-height: 1.3;
}
.nav a:hover { color: var(--fg); }
.nav-star { border-radius: var(--radius); }
.nav-star-icon { display: block; flex: 0 0 auto; }
.star-count { font-size: 0.78rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; }

/* Hide keyboard shortcut hint on touch devices */
@media (pointer: coarse) {
  [data-hk-open] { display: none !important; }
}

@media (max-width: 960px) {
  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    /* fade indicating more items to the right */
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}

/* ---------- Hero ---------- */

.hero { padding: 28px 0 12px; }
.tagline {
  color: var(--fg-dim);
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(1.6rem, 4.6vw, 2rem);
  margin-bottom: 12px;
}
.subtitle { color: var(--fg-dim); margin-bottom: 20px; }
.hero-byline {
  color: var(--fg-dim);
  font-size: 0.92rem;
  border-left: 2px solid var(--accent-dim);
  padding-left: 12px;
  margin: 0 0 18px;
  font-style: normal;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 8px 0 20px;
}
.hero-actions .btn {
  display: inline-block;
  padding: 12px 20px;
  text-decoration: none;
  width: auto;
}
.hero-actions .btn.secondary {
  padding: 10px 16px;
  font-size: 0.9rem;
}

/* ---------- Stage extras: prerequisites + documents ---------- */

.stage-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0 20px;
}
.stage-block h2 {
  font-size: 1rem;
  margin-bottom: 6px;
}
.stage-block p.dim {
  color: var(--fg-dim);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.plainlist {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}
.plainlist li {
  margin: 4px 0;
  color: var(--fg);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* ---------- Pipeline ---------- */

.pipeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0;
}
@media (min-width: 720px) {
  .pipeline { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
.stage-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
}
.stage-card:hover, .stage-card:focus-visible {
  text-decoration: none;
  border-color: var(--accent-dim);
  transform: translateY(-1px);
}
.stage-card .step { color: var(--fg-muted); font-size: 0.8rem; }
.stage-card .name { color: var(--accent); font-weight: 600; margin-top: 4px; }
.stage-card .desc { color: var(--fg-dim); font-size: 0.9rem; margin-top: 6px; }

/* ---------- Stage page ---------- */

.stage-disclaimer {
  font-size: 0.8rem;
  color: var(--fg-dim);
  border-left: 2px solid var(--border-bright);
  padding: 4px 10px;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}

.stage-head .kv {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--fg-dim);
  font-size: 0.85rem;
  margin: 6px 0 20px;
}
.stage-head .kv span strong { color: var(--fg); font-weight: 500; }

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2em;
}
.checklist li {
  border-left: 2px solid var(--border-bright);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: border-color 0.15s, background 0.15s;
}
.checklist li label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  width: 100%;
}
.checklist li input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  background: var(--bg);
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: background 0.1s, border-color 0.1s;
}
.checklist li input[type="checkbox"]:hover { border-color: var(--accent-dim); }
.checklist li input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.checklist li input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.checklist li input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #08110b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
/* Ensure full checklist row is the tap target */
.checklist li {
  min-height: 44px;
}
.checklist li label {
  min-height: 44px;
  padding: 2px 0;
}
.checklist li .label-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.checklist li .label { color: var(--fg); display: block; }
.checklist li .note  { color: var(--fg-dim); font-size: 0.85rem; margin-top: 4px; display: block; padding-left: 10px; border-left: 2px solid var(--border); }
.checklist li.done { border-left-color: var(--accent-dim); background: rgba(126,231,135,0.04); }
.checklist li.done .label { color: var(--fg-dim); text-decoration: line-through; }

.gotchas {
  border: 1px dashed var(--warn);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(245, 166, 35, 0.05);
}
.gotchas h3 { color: var(--warn); margin-bottom: 8px; }
.gotchas ul { margin: 0; padding-left: 1.2em; color: var(--fg-dim); }

.artifacts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.artifacts a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--fg);
  font-size: 0.85rem;
}
.artifacts a:hover { border-color: var(--accent-dim); text-decoration: none; }
.artifacts a .kind { color: var(--fg-muted); margin-right: 6px; }
.artifact-wip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--fg-muted);
  font-size: 0.85rem;
  opacity: 0.55;
}
.artifact-wip .kind { color: var(--fg-muted); margin-right: 6px; }
.artifact-wip .wip-badge { margin-left: 8px; font-size: 0.75rem; color: var(--warn); }

/* ---------- Progress visualization ---------- */

.progress-bar {
  height: 6px;
  background: var(--border-bright);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}
.progress-bar.wide { height: 8px; }
.progress-bar .fill {
  height: 100%;
  width: 0%;
  background: var(--fg-muted);
  transition: width 0.25s ease, background 0.2s ease;
}

.pipeline-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 16px 0 20px;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.pipeline-summary .progress-bar { flex: 1 1 120px; min-width: 100px; }
.pipeline-summary .summary-txt { white-space: nowrap; }

.card-progress {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-progress .progress-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
}
.stage-card.partial {
  border-color: rgba(245, 166, 35, 0.35);
}
.stage-card.partial .card-progress .fill { background: var(--warn); }
.stage-card.partial .card-progress .progress-label { color: var(--warn); }
.stage-card.passed {
  border-color: var(--accent-dim);
  background: linear-gradient(180deg, rgba(126,231,135,0.05), var(--bg-card));
}
.stage-card.passed .card-progress .fill { background: var(--accent); }
.stage-card.passed .card-progress .progress-label { color: var(--accent); }
.stage-card.passed .name::after { content: " ✓"; color: var(--accent); }

.checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.checklist-head h2 { margin: 0; }
.stage-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--fg-muted);
  flex: 1 1 180px;
  min-width: 0;
  flex-wrap: wrap;
}
.stage-status .progress-bar { flex: 1 1 60px; min-width: 40px; max-width: 180px; }
.stage-status .status-txt { white-space: nowrap; min-width: 0; }
.stage-status[data-status="running"] .fill { background: var(--warn); }
.stage-status[data-status="running"] .status-txt { color: var(--warn); }
.stage-status[data-status="passed"] .fill { background: var(--accent); }
.stage-status[data-status="passed"] .status-txt { color: var(--accent); }

.privacy-note {
  font-size: 0.75rem;
  margin: -2px 0 14px;
}

.verified-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--fg-muted);
  background: rgba(126,231,135,0.06);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 5px 10px;
  margin-top: 10px;
}
.verified-note strong { color: var(--accent); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--fg-dim);
  padding: 10px 14px;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 0.78rem;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}
.btn-ghost:hover { color: var(--fg); border-color: var(--accent-dim); }
.btn-ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.stage-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 30px;
  font-size: 0.9rem;
}
.stage-nav a { color: var(--fg-dim); }
.stage-nav a:hover { color: var(--accent); }

/* ---------- Forms / Calculator ---------- */

.form {
  display: grid;
  gap: 12px;
  max-width: 540px;
}
.form label {
  display: block;
  font-size: 0.85rem;
  color: var(--fg-dim);
  margin-bottom: 4px;
}
.form input, .form select, .form button {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 16px; /* >= 16px prevents iOS auto-zoom on focus */
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
}
.form input:focus-visible, .form select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.form .row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) {
  .form .row { grid-template-columns: 1fr 1fr; }
}
.btn {
  cursor: pointer;
  background: var(--accent);
  color: #08110b;
  border: none;
  font-weight: 700;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: #a5f0a9; }
.btn:active { transform: translateY(1px); }
.btn.secondary {
  display: inline-block;
  width: auto;
  padding: 12px 18px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  font-weight: 400;
  text-decoration: none;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* At wide screens, form and result sit side-by-side */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}
@media (min-width: 720px) {
  .calc-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
  }
  .calc-layout .form { max-width: none; }
  /* Error message spans col 2 (beside form), result also col 2 */
  .calc-layout .error,
  .calc-layout .result { margin-top: 0; }
}

.result {
  margin-top: 24px;
  padding: 18px 16px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.result h2 { color: var(--accent); margin-bottom: 8px; }
.result .delta {
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 700;
  margin: 10px 0;
}
.result .delta.neg { color: var(--err); }
.result .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.result table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 0.9rem; }
@media (max-width: 640px) {
  .result table th, .result table td { padding: 5px 6px; font-size: 0.82rem; }
  .result .ref-note { display: none; }
}
@media (max-width: 480px) {
  .result table th:nth-child(3), .result table td:nth-child(3) { display: none; }
}
.result th, .result td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.result th { color: var(--fg-dim); font-weight: 500; }
.result .share {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-alt);
  border-left: 2px solid var(--accent);
  font-size: 0.85rem;
  color: var(--fg-dim);
  cursor: pointer;
  user-select: all;
  word-break: break-word;
}
.share-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.share-ctas .btn-ghost { text-decoration: none; }

.error, .success {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-top: 10px;
  font-size: 0.9rem;
}
.error   { background: rgba(255,107,107,0.08); border: 1px solid var(--err);    color: var(--err); }
.success { background: rgba(126,231,135,0.08); border: 1px solid var(--accent-dim); color: var(--accent); }

[x-cloak] { display: none !important; }

/* ---------- Footer ---------- */

footer.foot {
  margin-top: 60px;
  padding: 24px 16px;
  border-top: 1px solid var(--border);
  color: var(--fg-dim);
  font-size: 0.85rem;
  text-align: center;
}
footer.foot a {
  color: var(--fg-dim);
  display: inline-block;
  padding: 4px 6px;
}
footer.foot p { margin: 0 0 0.6em; }

/* footer activity ribbon — terminal-style live signal */
.activity-ribbon {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-alt);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-dim);
  margin-bottom: 14px !important;
}
.ribbon-prompt { color: var(--accent); font-weight: 700; margin-right: 2px; }
.ribbon-key { color: var(--fg-dim); }
.ribbon-val { color: var(--accent); font-weight: 600; }
.ribbon-sep { color: var(--fg-dim); }
.ribbon-link { color: var(--link) !important; padding: 0 !important; }

.edit-link {
  font-family: var(--mono);
  font-size: 0.8rem;
}
.edit-link a { color: var(--link); }

/* Machine-translation notice banner (Russian pages) */
.mt-banner {
  background: rgba(245, 166, 35, 0.08);
  border-bottom: 1px solid rgba(245, 166, 35, 0.3);
  color: var(--warn);
  font-size: 0.82rem;
  text-align: center;
  padding: 7px 16px;
  line-height: 1.4;
}

/* Subscribe form */
.subscribe-form { max-width: 480px; }
.subscribe-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.subscribe-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 16px;
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
}
.subscribe-row input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.subscribe-row input:disabled { opacity: 0.55; }
.subscribe-row .btn {
  white-space: nowrap;
  min-width: 130px;
  padding: 12px 18px;
  font-size: 0.9rem;
  width: auto;
}
@media (max-width: 420px) {
  .subscribe-row { flex-direction: column; }
  .subscribe-row .btn { width: 100%; }
}

/* freshness page */
.freshness-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.92rem;
}
.freshness-table th,
.freshness-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.freshness-table th {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-alt);
}
.freshness-table tbody tr:hover { background: var(--bg-alt); }
.freshness-table a { color: var(--link); }
.freshness-table code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ---------- Arrival tabs ---------- */

.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.tab-nav button {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 8px 16px;
  font-size: 0.9rem;
  color: var(--fg-dim);
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: color 0.12s, border-color 0.12s;
}
.tab-nav button:hover { color: var(--fg); }
.tab-nav button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel-desc { margin: 0 0 16px; font-size: 0.9rem; }
.arrival-stage-link { margin-top: 16px; display: block; }

.exit-country-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.exit-country-nav button {
  background: transparent;
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.9rem;
  color: var(--fg-dim);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.exit-country-nav button:hover { color: var(--fg); border-color: var(--accent-dim); }
.exit-country-nav button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}

/* ---------- Utility ---------- */

.muted { color: var(--fg-muted); }
.dim   { color: var(--fg-dim); }
.acc   { color: var(--accent); }
.center { text-align: center; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Global progress strip ---------- */

.global-progress {
  position: sticky;
  top: 49px; /* sits below header */
  z-index: 9;
  background: rgba(11, 14, 15, 0.94);
  backdrop-filter: saturate(1.2) blur(6px);
  -webkit-backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--border);
}
.global-progress-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--fg-muted);
  overflow: hidden;
}
.stage-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.stage-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-bright);
  background: var(--bg-alt);
  color: var(--fg-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.stage-dot:hover, .stage-dot:focus-visible {
  border-color: var(--accent-dim);
  color: var(--fg);
  text-decoration: none;
}
.stage-dot.partial {
  border-color: var(--warn);
  color: var(--warn);
  background: rgba(245, 166, 35, 0.08);
}
.stage-dot.passed {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(126, 231, 135, 0.08);
}
.global-progress .progress-bar {
  flex: 1 1 80px;
  min-width: 60px;
  height: 6px;
}
.global-progress .prog-txt {
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--fg-dim);
}
.persona-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

/* On desktop the picker is always inline; the toggle button doesn't render here,
   so override Alpine's x-show inline display:none in case state was set on mobile. */
@media (min-width: 681px) {
  .persona-picker[x-show] { display: flex !important; }
}
.persona-label {
  font-size: 0.72rem;
  color: var(--fg-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.persona-select {
  background: var(--bg-alt);
  color: var(--fg-dim);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 6px 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  max-width: 140px;
  min-height: 32px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.persona-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.persona-select:hover { border-color: var(--accent-dim); color: var(--fg); }

@media (max-width: 680px) {
  .persona-picker {
    flex-basis: 100%;
    min-width: 0;
    width: 100%;
    order: 10;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    /* Switch to grid for guaranteed equal-width 3-up selects */
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  /* "Filter:" label spans all 3 columns; compact labels hidden — placeholders are sufficient */
  .persona-label { grid-column: 1 / -1; width: auto; margin-bottom: 0; }
  .persona-label-compact { display: none !important; }
  .persona-select { max-width: none; font-size: 16px; min-height: 44px; width: 100%; }
  .prog-help { display: none; }
}

.persona-label-compact { display: none; }

.strip-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--fg-muted);
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.6;
}
.strip-toggle:hover { color: var(--fg); border-color: var(--accent-dim); }
.strip-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 680px) {
  .strip-toggle { display: inline-block; }
}

.prog-help {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--fg-dim);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.prog-help:hover { color: var(--fg); border-color: var(--accent-dim); }
.prog-help:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 520px) {
  .global-progress .prog-txt { display: none; }
  .stage-dot { width: 36px; height: 36px; font-size: 0.8rem; }
  .stage-dots { gap: 2px; }
}

/* ---------- Checklist groups ---------- */

.checklist-group {
  margin-bottom: 18px;
}
.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding-bottom: 4px;
}
.group-name {
  margin: 0;
  font-size: 0.9rem;
  color: var(--fg-dim);
  font-weight: 500;
}
.group-status {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Source references ---------- */

.checklist li .source {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--link);
  padding: 2px 0;
}
.checklist li .source:hover { text-decoration: underline; }
.checklist li .source .asof {
  color: var(--fg-muted);
  font-size: 0.85em;
}

/* freshness signal — green <6mo, yellow 6-12mo, red >12mo */
.asof-fresh { color: var(--accent); }
.asof-aging { color: var(--warn); }
.asof-stale { color: var(--err); font-weight: 600; }
.asof-stale::after { content: " (stale)"; }

.verified-note.asof-aging { border-color: var(--warn); background: rgba(245,166,35,0.08); }
.verified-note.asof-aging strong { color: var(--warn); }
.verified-note.asof-stale { border-color: var(--err); background: rgba(255,107,107,0.08); }
.verified-note.asof-stale strong { color: var(--err); }

/* ---------- Hotkeys modal ---------- */

.hk-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
html.hk-open .hk-modal { display: flex; }
html.hk-open { overflow: hidden; }
.hk-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.hk-card {
  position: relative;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.hk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.hk-head h2 { margin: 0; }
.hk-section { margin-top: 14px; }
.hk-section-title {
  margin: 0 0 8px;
  color: var(--fg-dim);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--mono);
}
.hk-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 0;
}
.hk-grid dt {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.hk-grid dd {
  margin: 0;
  color: var(--fg-dim);
  font-size: 0.88rem;
  align-self: center;
}
.hk-card kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.78rem;
  line-height: 1;
  color: var(--fg);
  background: var(--bg-alt);
  border: 1px solid var(--border-bright);
  border-bottom-width: 2px;
  border-radius: 4px;
  min-width: 18px;
  text-align: center;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Print ---------- */

@media print {
  /* Hide interactive / nav chrome */
  .top, .global-progress, .hk-modal, .share-ctas,
  .btn, .btn-ghost, .btn-ghost, .persona-picker,
  nav, .edit-link, .activity-ribbon,
  .export-stage, .reset-stage,
  [data-hk-open], .prog-help,
  .watch-cta { display: none !important; }

  /* Page setup */
  @page { margin: 18mm 14mm; size: A4 portrait; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.45; }
  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }

  /* Stage checklist */
  .checklist li { page-break-inside: avoid; margin-bottom: 6pt; }
  .checklist input[type=checkbox] { appearance: auto; width: 12pt; height: 12pt; }
  details > summary { display: none; }
  details[open] > summary { display: block; }

  /* Stage header */
  .stage-head h1 { font-size: 18pt; margin-bottom: 4pt; }
  .stage-disclaimer {
    border: 1pt solid #999;
    padding: 4pt 6pt;
    font-size: 8pt;
    margin-bottom: 10pt;
    page-break-after: avoid;
  }

  /* Office directory cards */
  .office-card { page-break-inside: avoid; border: 1pt solid #ccc; padding: 6pt; margin-bottom: 8pt; }

  /* Form/template pages */
  .form-template { page-break-before: always; }
  .form-template h1 { font-size: 16pt; }

  /* Footer disclaimer always printed */
  .foot { border-top: 1pt solid #ccc; margin-top: 12pt; padding-top: 6pt; font-size: 8pt; color: #555; }
  .foot a::after { content: ""; }
}

/* ---------- Pet countdown widget ---------- */

.pet-countdown {
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 24px 0;
  background: var(--bg-alt);
}
.pet-countdown-title { margin: 0 0 6px; font-size: 1rem; }
.pet-countdown-desc { color: var(--fg-dim); font-size: 0.85rem; margin: 0 0 14px; }
.pet-countdown-form { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pet-countdown-form label { font-size: 0.88rem; }
.pet-countdown-form input[type=date] {
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  color: var(--fg);
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 0.88rem;
}
.pc-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.pc-table th { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border); color: var(--fg-dim); }
.pc-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.pc-note { font-size: 0.78rem; color: var(--fg-dim); margin-top: 2px; }
.pc-status { font-size: 0.8rem; font-weight: 500; }
.pc-ok td { }
.pc-urgent td:first-child { border-left: 3px solid #f59e0b; }
.pc-missed td:first-child { border-left: 3px solid #ef4444; }
.pc-urgent .pc-status { color: #f59e0b; }
.pc-missed .pc-status { color: #ef4444; }
.pc-ok .pc-status { color: #22c55e; }
.pet-countdown-warn { color: #ef4444; font-size: 0.85rem; margin: 10px 0 0; }
.pet-countdown-source { font-size: 0.78rem; color: var(--fg-dim); margin: 10px 0 0; }

@media (max-width: 600px) {
  .pc-table th:nth-child(3), .pc-table td:nth-child(3) { display: none; }
}

/* ---------- Office directory ---------- */

.office-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0 28px;
}
@media (min-width: 720px) {
  .office-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
.office-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.office-authority { font-size: 0.75rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.office-name { font-size: 0.95rem; margin: 0 0 10px; color: var(--accent); }
.office-details { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.85rem; margin: 0; }
.office-details dt { color: var(--fg-muted); font-weight: 500; }
.office-details dd { margin: 0; color: var(--fg); }
.office-note { font-size: 0.8rem; color: var(--fg-dim); }
.office-verified { font-size: 0.75rem; color: var(--fg-muted); margin: 10px 0 0; }

/* ---------- Forms directory ---------- */

.form-list { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 14px 0 24px; }
@media (min-width: 640px) { .form-list { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }
.form-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.form-authority { font-size: 0.75rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.form-title { font-size: 0.9rem; margin: 0 0 8px; color: var(--fg); }
.form-note { font-size: 0.8rem; color: var(--fg-dim); margin: 0 0 10px; }
.form-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-verified { font-size: 0.75rem; color: var(--fg-muted); }

/* Watch CTA */
.watch-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }

/* ---------- Calculator fees toggle ---------- */

.fees-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-direction: column;
  margin: 4px 0 8px;
  font-size: 0.88rem;
}
.fees-toggle label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fees-hint { color: var(--fg-muted); font-size: 0.78rem; padding-left: 22px; }

/* ---------- Pet Gantt ---------- */

.pet-gantt-wrap {
  margin: 22px 0 26px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.pet-gantt-caption {
  margin: 0 0 14px;
  color: var(--fg);
  font-weight: 700;
  line-height: 1.35;
}

.pet-gantt-source {
  display: block;
  margin-top: 4px;
  color: var(--fg-muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.pet-timeline {
  display: grid;
  gap: 12px;
}

.pet-path {
  display: grid;
  grid-template-columns: minmax(112px, 0.28fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: rgba(11,14,15,0.52);
}

.pet-path-label {
  min-width: 0;
  padding: 10px 0;
  color: var(--fg);
}

.pet-path-label strong {
  display: block;
  color: var(--accent);
  font-size: 0.9rem;
  line-height: 1.3;
}

.pet-path-label span {
  display: block;
  margin-top: 4px;
  color: var(--fg-dim);
  font-size: 0.76rem;
  line-height: 1.35;
}

.pet-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.pet-steps.unlisted {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pet-step {
  position: relative;
  min-width: 0;
  min-height: 104px;
  padding: 10px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  overflow: hidden;
}

.pet-step::after {
  content: "";
  position: absolute;
  top: 22px;
  right: -8px;
  width: 16px;
  height: 1px;
  background: var(--accent-dim);
}

.pet-step:last-child::after {
  display: none;
}

.pet-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(126,231,135,0.06);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.pet-step strong {
  display: block;
  min-width: 0;
  color: var(--fg);
  font-size: 0.82rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pet-step span {
  display: block;
  min-width: 0;
  margin-top: 5px;
  color: var(--fg-dim);
  font-size: 0.74rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pet-step.warn {
  border-color: rgba(245,166,35,0.55);
  background: rgba(245,166,35,0.06);
}

.pet-step.warn .pet-step-index {
  border-color: rgba(245,166,35,0.8);
  color: var(--warn);
  background: rgba(245,166,35,0.08);
}

.pet-step.flight {
  border-color: var(--accent-dim);
  background: rgba(126,231,135,0.06);
}

.pet-dependency-note,
.pet-gantt-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(126,231,135,0.04);
  color: var(--fg-dim);
  font-size: 0.82rem;
  line-height: 1.5;
}

.pet-dependency-note strong,
.pet-gantt-note strong {
  color: var(--fg);
}

.pet-gantt-note {
  border-left-color: var(--warn);
  background: rgba(245,166,35,0.06);
}

.pet-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 14px 0 0;
  color: var(--fg-muted);
  font-size: 0.76rem;
}

.pet-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pet-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--border-bright);
}

.pet-legend .ok i { background: var(--accent-dim); }
.pet-legend .warn i { background: var(--warn); }

@media (max-width: 860px) {
  .pet-path {
    grid-template-columns: 1fr;
  }

  .pet-path-label {
    padding: 0;
  }

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

  .pet-step::after {
    display: none;
  }
}

@media (max-width: 520px) {
  .pet-gantt-wrap {
    padding: 12px;
  }

  .pet-steps,
  .pet-steps.unlisted {
    grid-template-columns: 1fr;
  }

  .pet-step {
    min-height: 0;
  }
}
/* Navigation redesign — primary journey first, resources grouped, scalable language selector. */
header.top {
  z-index: 20;
}

.top-inner {
  gap: 18px;
}

.nav {
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.global-progress {
  top: 61px;
}

.nav-link,
.nav a,
.nav-menu > summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--fg-dim);
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav a:hover,
.nav a:focus-visible,
.nav-menu > summary:hover,
.nav-menu > summary:focus-visible {
  color: var(--fg);
  text-decoration: none;
  background: rgba(255,255,255,0.035);
}

.nav-link.active,
.nav-menu > summary.active,
.nav-menu-panel a.active {
  color: var(--accent);
  background: rgba(126,231,135,0.08);
}

.nav-spacer {
  flex: 1 1 auto;
  min-width: 12px;
}

.nav-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-menu > summary {
  list-style: none;
  user-select: none;
}

.nav-menu > summary::-webkit-details-marker {
  display: none;
}

.nav-caret {
  color: var(--fg-muted);
  font-size: 0.8em;
  line-height: 1;
  transition: transform 0.15s ease;
}

.nav-menu[open] .nav-caret {
  transform: rotate(180deg);
}

.nav-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: rgba(17,22,26,0.98);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}

.resources-menu .nav-menu-panel {
  left: 0;
  right: auto;
}

.nav-menu-panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 4px;
  color: var(--fg-dim);
}

.nav-menu-panel a + a {
  margin-top: 2px;
}

.nav-menu-panel a:hover,
.nav-menu-panel a:focus-visible {
  background: var(--bg-card);
  color: var(--fg);
}

.nav-lang-summary {
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

.nav-lang-current,
.nav-lang-code {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-lang-panel {
  min-width: 190px;
}

.nav-lang-panel a {
  justify-content: flex-start;
}

.nav-star {
  margin-left: 2px;
}

.nav-star .star-count {
  color: var(--fg-muted);
}

.nav-star:hover .star-count,
.nav-star:focus-visible .star-count {
  color: var(--fg);
}

@media (min-width: 961px) {
  .nav {
    overflow: visible;
    flex-wrap: nowrap;
  }
}

@media (max-width: 960px) {
  .top-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .nav {
    order: 2;
    flex-basis: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto 1fr;
    gap: 6px;
    align-items: stretch;
    padding-bottom: 2px;
    overflow: visible;
    scrollbar-width: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .nav-spacer {
    display: none;
  }

  .nav-link,
  .nav a,
  .nav-menu > summary {
    min-height: 44px;
    justify-content: center;
    padding: 10px 8px;
  }

  .nav-star {
    padding-left: 10px;
    padding-right: 10px;
  }

  .lang-menu,
  .resources-menu {
    justify-self: stretch;
  }

  .lang-menu > summary,
  .resources-menu > summary {
    width: 100%;
    min-height: 44px;
  }

  .nav-menu-panel {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 96px;
    min-width: 0;
  }

  .resources-menu .nav-menu-panel {
    left: 16px;
    right: 16px;
  }

  .global-progress {
    position: static;
  }
}

@media (max-width: 520px) {
  .nav-link,
  .nav a,
  .nav-menu > summary {
    font-size: 0.82rem;
    padding: 8px 6px;
  }

  .nav-star {
    padding-left: 8px;
    padding-right: 8px;
  }

  .nav-menu-panel {
    top: 104px;
  }
}
/* Home page overview and tool routing. */
.home-map {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 1.08fr);
  gap: 28px;
  align-items: center;
  margin: 28px 0 36px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: radial-gradient(circle at top right, rgba(126,231,135,0.08), transparent 34%), var(--bg-card);
}

.home-map-copy {
  min-width: 0;
}

.home-map-copy h2 {
  color: var(--fg);
}

.pipeline-visual {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
  padding-left: 18px;
}

.pipeline-visual::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 9px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-dim), rgba(74,137,83,0.15));
}

.visual-node {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas:
    "index title"
    "index desc";
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: rgba(11,14,15,0.62);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

.visual-node::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 22px;
  width: 9px;
  height: 9px;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  background: var(--bg-card);
}

.visual-index {
  grid-area: index;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(126,231,135,0.06);
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1;
}

.visual-node strong {
  grid-area: title;
  min-width: 0;
  color: var(--fg);
  font-size: 0.98rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.visual-node span:last-child {
  grid-area: desc;
  min-width: 0;
  color: var(--fg-dim);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.visual-connector {
  display: none;
}

.home-tools {
  margin: 34px 0;
}

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

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.tool-card:hover,
.tool-card:focus-visible {
  text-decoration: none;
  border-color: var(--accent-dim);
  background: rgba(126,231,135,0.04);
  transform: translateY(-1px);
}

.tool-card strong {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.tool-card span:last-child {
  color: var(--fg-dim);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.tool-kicker {
  color: var(--fg-dim);
  font-size: 0.76rem;
  font-weight: 700;
}

.pipeline-page-hero {
  padding-bottom: 4px;
}

@media (max-width: 860px) {
  .home-map {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .pipeline-visual {
    margin-top: 4px;
  }

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

@media (max-width: 520px) {
  .home-map {
    padding: 14px;
  }

  .pipeline-visual {
    padding-left: 0;
  }

  .pipeline-visual::before,
  .visual-node::before {
    display: none;
  }

  .visual-node {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 12px;
  }

  .visual-index {
    width: 34px;
    min-width: 34px;
    height: 34px;
    font-size: 0.72rem;
  }

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

  .tool-card {
    min-height: 0;
  }
}

@media (max-width: 340px) {
  .visual-node {
    grid-template-columns: 1fr;
    grid-template-areas:
      "index"
      "title"
      "desc";
  }
}
.trust-summary {
  margin: 16px 0 20px;
  padding: 16px 18px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(88,166,255,0.08), rgba(20,27,32,0.92));
}

.trust-summary-kicker {
  margin: 0 0 4px;
  color: var(--fg-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trust-summary-title {
  margin: 0 0 8px;
  color: var(--fg);
  font-size: 1.05rem;
  font-weight: 700;
}

.trust-summary-copy {
  max-width: 720px;
  margin: 0 0 12px;
  color: var(--fg-dim);
  font-size: 0.86rem;
  line-height: 1.5;
}

.trust-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.trust-block {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 0.82rem;
}

.trust-item-hint {
  margin-top: 6px;
  color: var(--fg-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  margin-bottom: 8px;
}

.trust-line {
  color: var(--fg-dim);
}

.trust-line strong {
  color: var(--fg);
  font-weight: 600;
}

.trust-note,
.trust-warning {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 0.8rem;
}

.trust-note {
  background: rgba(88,166,255,0.08);
  border: 1px solid rgba(88,166,255,0.25);
  color: var(--fg-dim);
}

.trust-warning {
  background: rgba(245,166,35,0.08);
  border: 1px solid rgba(245,166,35,0.25);
  color: var(--warn);
}

.trust-block .source {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.78rem;
}

.stage-section {
  margin: 18px 0 22px;
}

.trust-details {
  margin-top: 8px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}

.trust-details > summary {
  cursor: pointer;
  list-style: none;
  color: var(--fg-dim);
  font-size: 0.78rem;
  user-select: none;
}

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

.trust-details > summary::before {
  content: "+";
  display: inline-block;
  margin-right: 8px;
  color: var(--link);
}

.trust-details[open] > summary::before {
  content: "−";
}

.trust-details-body {
  margin-top: 10px;
}

/* ---------- Trust v2 — factual strip + unified source line ---------- */

.trust-strip {
  margin: 14px 0 18px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--fg-dim);
  font-size: 0.86rem;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
}
.trust-strip[data-age="aging"] { border-left-color: var(--warn); }
.trust-strip[data-age="stale"] { border-left-color: var(--err); }
.trust-strip-empty {
  border-left-color: var(--border-bright);
  color: var(--fg-muted);
  font-style: italic;
}
.trust-strip-count {
  color: var(--fg);
  font-weight: 700;
  margin-right: 2px;
}
.trust-strip-sep {
  color: var(--fg-muted);
  user-select: none;
}
.trust-strip-tiers { color: var(--fg-dim); }
.trust-strip-oldest { color: var(--fg-dim); }
.trust-strip[data-age="aging"] .trust-strip-oldest { color: var(--warn); font-weight: 600; }
.trust-strip[data-age="stale"] .trust-strip-oldest { color: var(--err); font-weight: 600; }
.trust-methodology-link {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--link);
  white-space: nowrap;
}
.trust-methodology-link:hover { text-decoration: underline; }

.trust-consequence {
  margin: 6px 0 2px;
  padding: 6px 10px;
  border-left: 3px solid var(--err);
  background: rgba(255,107,107,0.06);
  color: var(--fg);
  font-size: 0.86rem;
  line-height: 1.45;
  border-radius: 3px;
}
.trust-consequence strong {
  color: var(--err);
  font-weight: 700;
  margin-right: 4px;
}

.source-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.5;
}
.source-line .source { margin-top: 0; }
.verified-inline {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  white-space: nowrap;
}
.verified-inline[data-age="fresh"] { color: var(--accent); }
.verified-inline[data-age="aging"] { color: var(--warn); }
.verified-inline[data-age="stale"] { color: var(--err); font-weight: 600; }
.verified-rel { color: inherit; opacity: 0.85; }
.verified-stale {
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,107,107,0.12);
  border: 1px solid rgba(255,107,107,0.35);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tier-chip {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: lowercase;
  color: var(--fg-dim);
  background: var(--bg);
  white-space: nowrap;
}
.tier-chip[data-tier="official"] {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: rgba(126,231,135,0.06);
}
.tier-chip[data-tier="supranational"] {
  border-color: rgba(88,166,255,0.45);
  color: var(--link);
  background: rgba(88,166,255,0.06);
}
.tier-chip[data-tier="community"] {
  border-color: var(--border);
  color: var(--fg-muted);
}

@media (max-width: 600px) {
  .trust-strip { gap: 4px; }
  .trust-methodology-link { margin-left: 0; flex-basis: 100%; margin-top: 4px; }
  .source-line { font-size: 0.76rem; }
  .verified-inline { white-space: normal; }
}

/* ---------- Methodology page ---------- */

.methodology .methodology-tiers {
  margin: 12px 0 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 18px;
}
.methodology .methodology-tiers dt {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
  margin-top: 4px;
}
.methodology .methodology-tiers dd {
  margin: 0 0 0 0;
  color: var(--fg-dim);
  font-size: 0.92rem;
  line-height: 1.55;
}
.methodology .methodology-cadence {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.methodology .methodology-cadence li {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 0.9rem;
}
.methodology .methodology-cadence .verified-inline { font-family: inherit; font-size: inherit; white-space: normal; }
.methodology code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.85em;
}

@media print {
  .trust-strip { display: none; }
  .trust-methodology-link, .verified-stale, .tier-chip { display: none; }
  .verified-inline { color: #000 !important; font-weight: normal !important; }
}

.trust-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trust-microcopy {
  margin-top: 6px;
  color: var(--fg-muted);
  font-size: 0.78rem;
}

.checklist > li {
  padding-bottom: 14px;
}

