@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  color-scheme: dark light;
  /* Phase 13 premium medical editorial palette — calmer surgical-green replaces military olive; softer neon */
  --bg: #0b0e14;
  --bg-surface: #131822;
  --bg-card: #181e29;
  --bg-card-hover: #1e2533;
  --bg-glass: rgba(24, 30, 41, 0.58);
  --fg: #ebeef2;
  --fg-dim: #bcc2cc;
  --muted: #757d8a;
  --border: #262e3c;
  --border-bright: #3a4358;
  --olive: #6b9a87;         /* surgical green-teal (was olive military #87a16c) */
  --olive-bright: #8ec0aa;  /* lighter surgical green (was #a8c485) */
  --olive-deep: #3a5547;
  --ukr-blue: #4d8fc9;      /* softer */
  --ukr-yellow: #f0c95a;    /* softer warm */
  --cyan: #74bdcc;          /* softer (was neon #5dd5e8) */
  --magenta: #b487bb;       /* softer (was neon #d56dde) */
  --danger: #c96763;
  --success: #6db36a;
  --grid: rgba(255, 255, 255, 0.018);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.28);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.42);
  --shadow-glow: 0 0 18px rgba(107, 154, 135, 0.10);
  --radius: 6px;
  --radius-lg: 10px;
}
:root[data-theme="light"] {
  --bg: #f5f3ed;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fafaf5;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --fg: #14181f;
  --fg-dim: #3a4250;
  --muted: #6a7180;
  --border: #d6d0c2;
  --border-bright: #a8a094;
  --olive-bright: #4a5d3a;
  --grid: rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.72;
  font-feature-settings: 'cv11', 'ss01', 'kern';
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
  background-attachment: fixed;
  min-height: 100vh;
  transition: background-color 0.2s, color 0.2s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.mono { font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace; }
.layout { max-width: 1200px; margin: 0 auto; padding: 16px 24px 80px; }

/* === Theme toggle === */
.toolbar { position: fixed; top: 14px; right: 14px; z-index: 1000; display: flex; gap: 6px; }
.toolbar button {
  background: var(--bg-glass); backdrop-filter: blur(8px);
  border: 1px solid var(--border-bright); color: var(--fg);
  width: 38px; height: 38px; border-radius: var(--radius); cursor: pointer;
  font-size: 1.05em; display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.toolbar button:hover { border-color: var(--olive); color: var(--olive-bright); }

/* === Top nav === */
.topnav { display: flex; gap: 4px; padding: 8px 0 14px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }
.topnav a {
  color: var(--fg-dim); text-decoration: none; padding: 6px 12px; border-radius: 4px;
  border: 1px solid transparent; transition: all 0.12s;
}
.topnav a:hover { color: var(--olive-bright); border-color: var(--border-bright); background: var(--bg-card); }
.topnav a.active { color: var(--olive-bright); border-color: var(--olive); }
.topnav .sep { color: var(--muted); padding: 6px 0; user-select: none; }

/* === HUD elements === */
.hud-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.74em; color: var(--olive);
  letter-spacing: 0.04em; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.hud-label::before { content: ''; width: 18px; height: 1px; background: var(--olive); display: inline-block; }
.hud-divider {
  display: flex; align-items: center; gap: 14px; margin: 72px 0 26px;
  font-family: 'Inter', sans-serif; font-size: 1.12em; font-weight: 500; color: var(--fg);
  letter-spacing: -0.005em;
}
.hud-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* === Hero === */
.hero {
  position: relative;
  padding: 56px 52px;
  background: linear-gradient(135deg, #11161f 0%, #1a2030 55%, #0c1118 100%);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 36px;
  color: #e8eaed;
}
:root[data-theme="light"] .hero { background: linear-gradient(135deg, #2f3d24 0%, #3d4d2f 55%, #1f2917 100%); color: #fff; }
.hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, rgba(74,144,217,0.5) 0%, rgba(94,196,138,0.5) 50%, rgba(122,180,230,0.5) 100%);
}
.hero::after {
  content: ''; position: absolute; top: -50px; right: -50px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(94, 196, 138, 0.08) 0%, transparent 65%);
  pointer-events: none;
}
.hero .corner { position: absolute; width: 18px; height: 18px; border: 1px solid var(--olive); opacity: 0.22; }
.hero .corner.tl { top: 16px; left: 16px; border-right: none; border-bottom: none; }
.hero .corner.tr { top: 16px; right: 16px; border-left: none; border-bottom: none; }
.hero .corner.bl { bottom: 16px; left: 16px; border-right: none; border-top: none; }
.hero .corner.br { bottom: 16px; right: 16px; border-left: none; border-top: none; }
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: center; position: relative; z-index: 2; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } .hero { padding: 36px 28px; } }

.hero .meta-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 0.74em; color: var(--olive);
  letter-spacing: 0.04em; margin-bottom: 14px; opacity: 0.85;
}
.hero h1 { font-size: 2.9em; font-weight: 800; margin: 0 0 4px; line-height: 1.08; letter-spacing: -0.02em; color: #fff; }
.hero .callsign { font-size: 1.6em; color: var(--ukr-yellow); font-weight: 600; margin: 0 0 22px; font-family: 'JetBrains Mono', monospace; }
.hero .position { font-size: 1.05em; line-height: 1.55; margin: 0 0 8px; opacity: 0.96; max-width: 560px; }
.hero .position-en { font-size: 0.9em; opacity: 0.65; max-width: 560px; margin: 0 0 24px; font-style: italic; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hero .badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; font-size: 0.78em; font-weight: 500;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 100px; color: #fff;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.02em;
}
.hero .badge.gold { background: rgba(255,213,79,0.12); border-color: rgba(255,213,79,0.4); color: var(--ukr-yellow); }
.hero .badge.blue { background: rgba(74,144,217,0.12); border-color: rgba(74,144,217,0.4); color: var(--ukr-blue); }
.hero .badge.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--success); animation: pulse 1.4s infinite ease-in-out; }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(92,184,92,0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 5px rgba(92,184,92,0); }
}

/* === Portrait placeholder === */
.portrait-card {
  position: relative; aspect-ratio: 1/1.15; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(135,161,108,0.18), rgba(74,144,217,0.10));
  border: 1px solid rgba(135,161,108,0.3); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.portrait-card svg { width: 70%; height: 70%; opacity: 0.55; }
.portrait-card .stamp {
  position: absolute; top: 12px; left: 12px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.62em; color: var(--olive-bright); letter-spacing: 0.05em; opacity: 0.55;
}
.portrait-card .id {
  position: absolute; bottom: 12px; right: 12px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.62em; color: var(--fg-dim); letter-spacing: 0.05em; opacity: 0.55;
}

/* === Stat dashboard === */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 18px 0; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; position: relative; transition: all 0.18s; overflow: hidden;
}
.stat-card:hover { border-color: var(--olive); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 0%; height: 1px; background: var(--olive); opacity: 0.6;
  transition: width 0.25s;
}
.stat-card:hover::before { width: 100%; }
.stat-card .stat-icon { display: none; }
.stat-card .stat-num {
  font-family: 'JetBrains Mono', monospace; font-size: 1.85em; font-weight: 700;
  color: var(--olive-bright); letter-spacing: -0.02em; line-height: 1; margin-bottom: 6px;
  display: flex; align-items: baseline; gap: 4px;
}
.stat-card .stat-num .unit { font-size: 0.55em; color: var(--muted); font-weight: 500; }
.stat-card .stat-label { font-size: 0.84em; color: var(--fg-dim); line-height: 1.4; }
.stat-card .stat-context {
  font-family: 'Inter', sans-serif; font-size: 0.78em; color: var(--muted);
  margin-top: 6px; letter-spacing: 0;
}

/* === Dossier nav cards === */
.dossier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 18px 0; }
.dossier-card {
  background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--olive);
  border-radius: var(--radius); padding: 20px 22px; text-decoration: none; color: var(--fg);
  transition: all 0.18s; position: relative; display: block;
}
.dossier-card:hover { background: var(--bg-card-hover); border-left-color: var(--ukr-blue); transform: translateY(-2px); }
.dossier-card .d-icon { display: none; }
.dossier-card h3 { margin: 0 0 6px; font-size: 1.05em; color: var(--fg); font-weight: 600; }
.dossier-card p { margin: 0 0 10px; color: var(--fg-dim); font-size: 0.88em; line-height: 1.5; }
.dossier-card .d-cta {
  font-family: 'Inter', sans-serif; font-size: 0.84em; font-weight: 500; color: var(--olive);
  letter-spacing: 0.01em; display: inline-flex; align-items: center; gap: 6px;
}
.dossier-card:hover .d-cta { color: var(--ukr-blue); }
.dossier-card .d-cta::after { content: '→'; transition: transform 0.15s; }
.dossier-card:hover .d-cta::after { transform: translateX(3px); }

/* === Section headings === */
h2 { font-size: 1.6em; font-weight: 700; color: var(--fg); margin: 28px 0 12px; letter-spacing: -0.01em; }
h3 { color: var(--fg); font-weight: 600; }
p { margin: 10px 0; color: var(--fg); }
a { color: var(--ukr-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Two-column info block === */
.info-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; margin: 22px 0; }
@media (max-width: 860px) { .info-grid { grid-template-columns: 1fr; } }
.info-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.info-box h3 { margin: 0 0 12px; font-size: 1.1em; }
.info-box ul { padding-left: 22px; margin: 8px 0; }
.info-box li { margin: 7px 0; color: var(--fg-dim); font-size: 0.95em; }
.info-box li strong { color: var(--fg); }

/* === Entity pills === */
.entity-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.entity-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 0.82em;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 100px;
  color: var(--fg-dim); font-family: 'JetBrains Mono', monospace; letter-spacing: 0.01em;
}
.entity-pill .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* === Graph preview === */
.graph-preview {
  position: relative; background: var(--bg-card); border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg); padding: 0; margin: 22px 0; overflow: hidden;
  aspect-ratio: 16/8; min-height: 380px;
}
.graph-preview .overlay {
  position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(10,13,18,0.85) 100%);
  pointer-events: none; z-index: 2;
}
.graph-preview .label {
  position: absolute; bottom: 20px; left: 24px; right: 24px; z-index: 3; display: flex;
  justify-content: space-between; align-items: flex-end; pointer-events: none;
}
.graph-preview .label .info h3 { margin: 0 0 2px; color: #fff; font-size: 1.15em; }
.graph-preview .label .info p { margin: 0; color: rgba(255,255,255,0.7); font-size: 0.85em; }
.graph-preview .cta-link {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; background: rgba(135,161,108,0.18); border: 1px solid var(--olive);
  border-radius: var(--radius); color: var(--olive-bright); text-decoration: none;
  font-family: 'JetBrains Mono', monospace; font-size: 0.85em; letter-spacing: 0.05em;
  font-weight: 500; transition: all 0.15s;
}
.graph-preview .cta-link:hover { background: var(--olive); color: #fff; }
.graph-preview canvas { display: block; width: 100%; height: 100%; cursor: grab; }

/* === Source tree === */
.source-tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 18px 0; }
.source-group {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px;
}
.source-group .group-title {
  font-family: 'Inter', sans-serif; font-size: 0.88em; font-weight: 600; color: var(--fg);
  letter-spacing: 0.01em; margin: 0 0 14px; display: flex; align-items: center; gap: 8px;
}
.source-group .group-title::before { content: ''; width: 18px; height: 1px; background: var(--olive); }
.source-list { list-style: none; padding: 0; margin: 0; }
.source-list li { margin: 8px 0; padding: 10px 12px; background: var(--bg-surface); border-radius: 4px;
  border-left: 2px solid var(--border-bright); transition: all 0.15s; }
.source-list li:hover { border-left-color: var(--olive); background: var(--bg-card-hover); }
.source-list a { color: var(--fg); text-decoration: none; font-size: 0.92em; font-weight: 500; display: block; }
.source-list a:hover { color: var(--olive-bright); }
.source-list .pub {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7em; color: var(--muted);
  display: block; margin-top: 3px; letter-spacing: 0.02em;
}
.source-list .type-badge {
  display: inline-block; font-size: 0.68em; padding: 1px 6px; border-radius: 3px;
  background: var(--bg); color: var(--olive); font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em; margin-left: 6px; vertical-align: middle;
}

/* === LLM/RAG block === */
.llm-block {
  background: linear-gradient(135deg, rgba(74,144,217,0.06), rgba(135,161,108,0.04));
  border: 1px solid var(--border-bright); border-radius: var(--radius-lg);
  padding: 28px 32px; margin: 28px 0;
}
.llm-block .label { color: var(--ukr-blue); }
.llm-block h2 { margin: 8px 0 14px; font-size: 1.5em; }
.llm-block .desc { color: var(--fg-dim); font-size: 0.95em; max-width: 720px; margin-bottom: 18px; }
.llm-data-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.llm-data-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; text-decoration: none; color: var(--fg); display: block; transition: all 0.15s;
}
.llm-data-card:hover { border-color: var(--ukr-blue); transform: translateY(-2px); }
.llm-data-card .file { font-family: 'JetBrains Mono', monospace; font-size: 0.78em; color: var(--ukr-blue); font-weight: 500; }
.llm-data-card .desc-mini { font-size: 0.78em; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* === Disclaimer === */
.disclaimer {
  background: var(--bg-card); border-left: 3px solid var(--ukr-yellow);
  padding: 14px 18px; margin: 24px 0; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.88em; color: var(--fg-dim);
}
.disclaimer strong { color: var(--ukr-yellow); }

/* === Social media block === */
.social-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 18px 0; }
.social-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; text-decoration: none; color: var(--fg); display: block; transition: all 0.15s;
  border-left: 3px solid var(--ukr-blue);
}
.social-card:hover { background: var(--bg-card-hover); border-left-color: var(--cyan); transform: translateY(-2px); }
.social-card .s-platform { font-family: 'Inter', sans-serif; font-size: 0.78em; font-weight: 500; color: var(--ukr-blue); letter-spacing: 0.01em; }
.social-card .s-handle { font-weight: 600; margin: 4px 0; color: var(--fg); font-size: 0.98em; }
.social-card .s-role { font-size: 0.78em; color: var(--muted); margin-bottom: 8px; }
.social-card .s-metric { font-family: 'JetBrains Mono', monospace; font-size: 1.35em; color: var(--olive-bright); font-weight: 700; margin-top: 8px; }
.social-card .s-meta { font-size: 0.72em; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-top: 3px; }

/* === Reliability tiers === */
.reliability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 14px 0; }
.tier-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; position: relative; padding-left: 38px; }
.tier-card .tier-letter { position: absolute; left: 10px; top: 10px; width: 22px; height: 22px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--bg); font-size: 0.85em; }
.tier-card .tier-label { font-weight: 600; font-size: 0.92em; color: var(--fg); }
.tier-card .tier-desc { font-size: 0.78em; color: var(--muted); line-height: 1.45; margin-top: 4px; }

/* === System architecture layers === */
.arch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 16px 0; }
.arch-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; border-top: 3px solid var(--olive); position: relative; }
.arch-card .arch-num { position: absolute; top: -10px; right: 14px; background: var(--olive); color: var(--bg); width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 0.85em; }
.arch-card h4 { color: var(--olive-bright); margin: 0 0 6px; font-size: 0.92em; font-weight: 600; letter-spacing: 0; }
.arch-card h3 { font-size: 1.04em; margin: 4px 0 8px; color: var(--fg); }
.arch-card p { font-size: 0.85em; color: var(--fg-dim); margin: 0; line-height: 1.5; }

/* === Confidence/decree inline badges === */
.cb { display: inline-block; padding: 1px 7px; border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 0.7em; letter-spacing: 0.04em; margin-left: 6px; vertical-align: baseline; }
.cb-decree { background: rgba(92,184,92,0.14); color: var(--success); border: 1px solid rgba(92,184,92,0.3); }
.cb-official { background: rgba(74,144,217,0.14); color: var(--ukr-blue); border: 1px solid rgba(74,144,217,0.3); }
.cb-media { background: rgba(135,161,108,0.14); color: var(--olive-bright); border: 1px solid rgba(135,161,108,0.3); }
.cb-social { background: rgba(255,213,79,0.14); color: var(--ukr-yellow); border: 1px solid rgba(255,213,79,0.3); }
.cb-volatile { background: rgba(213,109,222,0.14); color: var(--magenta); border: 1px solid rgba(213,109,222,0.3); }

/* === Footer === */
.layout footer {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.78em; color: var(--muted);
}
.layout footer a { color: var(--fg-dim); }
.layout footer a:hover { color: var(--olive-bright); }
.layout footer .meta-stamp { display: flex; gap: 14px; align-items: center; }
.layout footer .live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block;
  animation: pulse 1.4s infinite ease-in-out;
}

/* === Generic content for inner pages === */
.nav-back { margin-bottom: 1em; font-size: 0.9em; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.nav-back a { color: var(--olive); text-decoration: none; margin-right: 16px; font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }
.nav-back a:hover { color: var(--ukr-blue); }
.layout h1 { font-size: 2em; color: var(--fg); margin: 0 0 0.4em; line-height: 1.2; font-weight: 700; }
.layout h2 { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.layout .meta { color: var(--muted); font-size: 0.9em; margin: 0 0 22px; padding: 12px 18px;
  background: var(--bg-card); border-radius: var(--radius); border-left: 3px solid var(--olive); }
.layout blockquote { border-left: 3px solid var(--ukr-yellow); padding: 8px 18px;
  margin: 14px 0; background: var(--bg-card); border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--fg-dim); }
.layout table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.94em; }
.layout th, .layout td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.layout th { background: var(--bg-card); color: var(--olive-bright); font-weight: 600; font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }
.layout code { background: var(--bg-card); border: 1px solid var(--border); padding: 1px 5px; border-radius: 3px; font-size: 0.88em; color: var(--cyan); }
.layout .sources { border-top: 1px solid var(--border); margin-top: 32px; padding-top: 18px; color: var(--muted); font-size: 0.85em; }
.layout .sources h3 { color: var(--muted); margin: 0 0 8px; font-size: 0.95em; }

/* === Responsive === */
@media (max-width: 720px) {
  .layout { padding: 12px 16px 60px; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 2.1em; }
  .hero .callsign { font-size: 1.25em; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card .stat-num { font-size: 1.5em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ===========================================================
   v2.4 — Premium medical aesthetic for Valikhnovski hub
   =========================================================== */
:root {
  --accent-medical: #5ec48a;   /* surgical green */
  --accent-clinical: #7ab4e6;  /* clinical cyan */
}
body {
  line-height: 1.7;            /* softer reading rhythm */
}
.layout { padding: 16px 24px 100px; }   /* more breathing room at bottom */

.dossier-card { border-left-color: var(--accent-medical); }
.dossier-card:hover { border-left-color: var(--accent-clinical); }
.dossier-card .d-cta { color: var(--accent-medical); }
.dossier-card:hover .d-cta { color: var(--accent-clinical); }

.info-box { padding: 26px 28px; }
.info-box p { margin: 10px 0 14px; }

.timeline-list .timeline-card .tl-marker { border-color: var(--accent-medical); }
.timeline-card[data-category="medical"] .tl-marker,
.timeline-card[data-category="career"] .tl-marker { border-color: var(--accent-medical); }
.timeline-card[data-category="religious"] .tl-marker { border-color: var(--accent-clinical); }

.fact-card { border-left: 2px solid var(--accent-medical); }
.fact-card:hover { border-color: var(--accent-medical); }

.toc-item:hover { border-left-color: var(--accent-medical); }
.cta-link { border-color: var(--accent-medical); color: var(--accent-medical); background: rgba(94,196,138,0.10); }
.cta-link:hover { background: var(--accent-medical); color: var(--bg); }

.shared-footer .sf-col h4 { color: var(--accent-medical); }
.shared-footer a:hover { color: var(--accent-clinical); }

/* Soften table styling for editorial feel */
.layout table { border-radius: var(--radius); overflow: hidden; }
.layout th { background: rgba(94,196,138,0.06); color: var(--accent-medical); }
.layout td { font-size: 0.92em; }

/* Larger spacing between content blocks */
.info-grid, .dossier-grid, .stat-grid, .arch-grid, .timeline-list, .source-tree, .reliability-grid { margin: 24px 0; }

/* === Image cards (multimedia content) === */
.image-card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px; margin: 22px 0 32px;
}
.image-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.image-card:hover { transform: translateY(-2px); border-color: var(--accent-medical); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.image-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg);
}
.image-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  transition: transform 0.35s;
}
.image-card:hover .image-card__media img { transform: scale(1.04); }
.image-card__play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4em; color: rgba(255,255,255,0.85);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.25) 100%);
  pointer-events: none;
}
.image-card__body {
  padding: 16px 20px 18px;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
}
.image-card__body h3 {
  margin: 4px 0 4px; font-size: 1.02em; color: var(--fg); font-weight: 600;
}
.image-card__body p {
  margin: 4px 0 10px; font-size: 0.88em; color: var(--fg-dim); line-height: 1.55;
}
.image-card__tag {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7em;
  color: var(--accent-medical); letter-spacing: 0.04em;
}
.image-card__cta {
  margin-top: auto; align-self: flex-start;
  font-size: 0.82em; color: var(--accent-medical); text-decoration: none;
  font-weight: 500;
}
.image-card__cta:hover { color: var(--accent-clinical); text-decoration: none; }

/* Compact variant — smaller text, no body p */
.image-card--compact .image-card__body { padding: 10px 14px 14px; }
.image-card--compact .image-card__body h3 { font-size: 0.92em; }

/* ===========================================================
   v3.1 — Reusable components (added 2026-05-13)
   =========================================================== */

/* === Skip-to-content link === */
.skip-link {
  position: absolute; top: -40px; left: 8px; z-index: 2000;
  background: var(--olive); color: var(--bg);
  padding: 8px 14px; border-radius: var(--radius);
  font-family: 'JetBrains Mono', monospace; font-size: 0.85em; font-weight: 600;
  text-decoration: none; transition: top 0.15s;
}
.skip-link:focus { top: 8px; }

/* === Responsive nav (hamburger for mobile) === */
.topnav { position: relative; }
.nav-toggle {
  display: none; background: var(--bg-card); border: 1px solid var(--border-bright);
  color: var(--fg); width: 38px; height: 38px; border-radius: var(--radius);
  cursor: pointer; font-size: 1.1em; align-items: center; justify-content: center;
}
.nav-toggle:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
@media (max-width: 720px) {
  .topnav { gap: 6px; }
  .nav-toggle { display: inline-flex; }
  .topnav .nav-links { display: none; flex-direction: column; gap: 4px;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
    background: var(--bg-surface); border: 1px solid var(--border-bright);
    border-radius: var(--radius); padding: 8px; margin-top: 6px;
    box-shadow: var(--shadow-md); }
  .topnav.nav-open .nav-links { display: flex; }
  .topnav .nav-links a { width: 100%; }
}
@media (min-width: 721px) {
  .nav-toggle { display: none; }
  .topnav .nav-links { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
}

/* === Fact card === */
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin: 18px 0; }
.fact-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; position: relative; transition: all 0.18s;
  display: flex; flex-direction: column;
}
.fact-card:hover { border-color: var(--olive); box-shadow: var(--shadow-glow); }
.fact-card .fact-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.fact-card .fact-date {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72em; color: var(--olive);
  letter-spacing: 0.08em;
}
.fact-card .fact-claim { color: var(--fg); margin: 4px 0 10px; font-size: 0.95em; line-height: 1.55; }
.fact-card .fact-claim-en {
  color: var(--muted); font-size: 0.82em; font-style: italic;
  margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--border);
}
.fact-card .fact-foot {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px;
  align-items: center;
}
.fact-card .fact-confidence {
  font-family: 'JetBrains Mono', monospace; font-size: 0.68em;
  color: var(--muted); letter-spacing: 0.06em; margin-left: auto;
}
.fact-card[data-safety="requires_human_review"] {
  border-left: 3px solid var(--ukr-yellow);
}
.fact-card[data-safety="requires_human_review"]::after {
  content: 'human-review'; position: absolute; top: 12px; right: 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.62em;
  color: var(--ukr-yellow); letter-spacing: 0.08em;
  background: rgba(255,213,79,0.08); padding: 2px 7px; border-radius: 3px;
  border: 1px solid rgba(255,213,79,0.3);
}

/* === Source badge (unified) === */
.source-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.7em;
  letter-spacing: 0.04em; font-weight: 500;
  background: var(--bg-surface); border: 1px solid var(--border-bright);
  color: var(--fg-dim); text-decoration: none;
}
.source-badge:hover { border-color: var(--olive); color: var(--olive-bright); text-decoration: none; }
.source-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0;
}
.source-badge[data-tier="A"] { color: #8ddc8d; border-color: rgba(92,184,92,0.3); }
.source-badge[data-tier="A"]::before { background: var(--success); }
.source-badge[data-tier="B"] { color: #7ab4e6; border-color: rgba(74,144,217,0.3); }
.source-badge[data-tier="B"]::before { background: var(--ukr-blue); }
.source-badge[data-tier="C"] { color: var(--olive-bright); border-color: rgba(135,161,108,0.3); }
.source-badge[data-tier="C"]::before { background: var(--olive); }
.source-badge[data-tier="D"] { color: var(--ukr-yellow); border-color: rgba(255,213,79,0.3); }
.source-badge[data-tier="D"]::before { background: var(--ukr-yellow); }
.source-badge[data-tier="E"] { color: var(--magenta); border-color: rgba(213,109,222,0.3); }
.source-badge[data-tier="E"]::before { background: var(--magenta); }

/* === Timeline card === */
.timeline-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; position: relative; }
.timeline-list::before {
  content: ''; position: absolute; left: 16px; top: 8px; bottom: 8px;
  width: 1px; background: var(--border); z-index: 0;
}
.timeline-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px 14px 50px; position: relative; transition: all 0.15s;
}
.timeline-card:hover { border-color: var(--olive); background: var(--bg-card-hover); }
.timeline-card .tl-marker {
  position: absolute; left: 10px; top: 18px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--olive);
  display: flex; align-items: center; justify-content: center;
  font-size: 0; z-index: 1;
}
.timeline-card .tl-date {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72em; color: var(--olive);
  letter-spacing: 0.08em; margin-bottom: 4px;
}
.timeline-card .tl-title { font-size: 1em; font-weight: 600; margin: 0 0 4px; color: var(--fg); }
.timeline-card .tl-desc { font-size: 0.88em; color: var(--fg-dim); line-height: 1.5; margin: 0; }
.timeline-card[data-category="combat"] .tl-marker,
.timeline-card[data-category="operation"] .tl-marker {
  border-color: var(--muted);
}

/* === Public-source disclaimer block (reusable) === */
.disclaimer-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--ukr-yellow);
  padding: 16px 20px; margin: 28px 0 18px; border-radius: 0 var(--radius) var(--radius) 0;
}
.disclaimer-block .d-label {
  font-family: 'Inter', sans-serif; font-size: 0.86em; font-weight: 600;
  color: var(--ukr-yellow); letter-spacing: 0.01em;
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.disclaimer-block .d-label::before { content: '⚠'; }
.disclaimer-block p { font-size: 0.88em; color: var(--fg-dim); margin: 4px 0 0; line-height: 1.55; }

/* === Reported-metrics caveat (lighter than disclaimer) === */
.metrics-caveat {
  background: rgba(255,213,79,0.04); border: 1px dashed rgba(255,213,79,0.3);
  border-radius: var(--radius); padding: 10px 14px; margin: 6px 0 14px;
  font-size: 0.82em; color: var(--fg-dim); line-height: 1.5;
}
.metrics-caveat strong { color: var(--ukr-yellow); font-family: 'JetBrains Mono', monospace; font-weight: 500; letter-spacing: 0.04em; }

/* === Shared footer === */
.shared-footer {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.78em; color: var(--muted);
}
@media (max-width: 600px) { .shared-footer { grid-template-columns: 1fr; } }
.shared-footer a { color: var(--fg-dim); text-decoration: none; }
.shared-footer a:hover { color: var(--olive-bright); }
.shared-footer .sf-col h4 {
  color: var(--olive); font-size: 0.72em; letter-spacing: 0.12em;
  text-transform: uppercase; margin: 0 0 8px; font-weight: 600;
}
.shared-footer .sf-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.shared-footer .sf-meta { grid-column: 1 / -1; display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.shared-footer .sf-meta .live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block;
  animation: pulse 1.4s infinite ease-in-out; margin-right: 6px;
}

/* === Reported-metrics section (separate from hero) === */
.reported-metrics { margin: 18px 0; }
.reported-metrics .rm-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.reported-metrics .rm-head h3 { margin: 0; font-size: 1.05em; color: var(--fg); }
.reported-metrics .rm-head .rm-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 0.68em;
  color: var(--ukr-yellow); letter-spacing: 0.1em;
  padding: 2px 8px; border: 1px solid rgba(255,213,79,0.3); border-radius: 10px;
}
.reported-metrics .rm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.reported-metrics .rm-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 2px solid var(--ukr-yellow);
  border-radius: var(--radius); padding: 14px 16px;
}
.reported-metrics .rm-card .rm-num {
  font-family: 'JetBrains Mono', monospace; font-size: 1.5em; font-weight: 700;
  color: var(--fg); letter-spacing: -0.02em; line-height: 1.1;
}
.reported-metrics .rm-card .rm-label { font-size: 0.82em; color: var(--fg-dim); margin-top: 6px; line-height: 1.4; }
.reported-metrics .rm-card .rm-src {
  font-family: 'JetBrains Mono', monospace; font-size: 0.62em; color: var(--muted);
  margin-top: 8px; letter-spacing: 0.04em;
}

/* === Classic timeline (timeline.html) — minimalist line with category dots === */
.timeline { position: relative; margin: 18px 0 28px; padding-left: 8px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 1px; background: var(--border);
}
.tl-item {
  position: relative; padding: 12px 18px 12px 28px;
  border-radius: var(--radius); margin: 2px 0;
  transition: background 0.15s;
}
.tl-item:hover { background: var(--bg-card); }
.tl-item::before {
  content: ''; position: absolute; left: 3px; top: 18px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--muted);
  box-sizing: border-box;
}
.tl-item.biography::before { border-color: var(--muted); }
.tl-item.career::before    { border-color: var(--olive); }
.tl-item.military::before  { border-color: var(--olive-bright); background: var(--olive-deep); }
.tl-item.operation::before { border-color: var(--ukr-blue); background: rgba(74,144,217,0.25); }
.tl-item.award::before     { border-color: var(--ukr-yellow); background: rgba(255,213,79,0.25); }
.tl-item.media::before     { border-color: var(--cyan); }
.tl-item.external::before  { border-color: var(--magenta); }
.tl-item .tl-date {
  font-family: 'JetBrains Mono', monospace; font-size: 0.78em;
  color: var(--olive); letter-spacing: 0.02em; margin-bottom: 3px;
}
.tl-item .tl-title { font-size: 1em; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.tl-item .tl-desc { font-size: 0.88em; color: var(--fg-dim); line-height: 1.55; }

.legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin: 0 0 18px; font-size: 0.82em; color: var(--fg-dim);
}
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend .legend-dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid currentColor; background: transparent;
  display: inline-block; box-sizing: border-box;
}

/* === Compact table-of-contents list (replaces audience-targeting block) === */
.toc-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 4px 18px;
  margin: 8px 0 4px;
}
.toc-item {
  display: block;
  padding: 9px 14px 9px 12px;
  border-left: 2px solid var(--border);
  color: var(--fg-dim);
  font-size: 0.9em; line-height: 1.5;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.toc-item strong { color: var(--fg); font-weight: 600; }
.toc-item:hover {
  border-left-color: var(--olive);
  color: var(--fg);
  background: var(--bg-card);
  text-decoration: none;
}

/* === Quieter disclaimer (placed near footer, less alarming) === */
.disclaimer-block--quiet {
  border-left-color: var(--border-bright);
  background: var(--bg-surface);
  margin-top: 56px;
}
.disclaimer-block--quiet .d-label { color: var(--fg-dim); }
.disclaimer-block--quiet .d-label::before { content: ''; margin-right: 0; }

/* === Collapsible research blocks === */
.research-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0; margin: 12px 0;
  transition: border-color 0.15s;
}
.research-block[open] { border-color: var(--border-bright); }
.research-block > summary {
  list-style: none; cursor: pointer; padding: 14px 22px;
  display: flex; align-items: center; gap: 10px;
  font-family: 'Inter', sans-serif; font-size: 0.92em; font-weight: 500;
  color: var(--fg);
}
.research-block > summary::-webkit-details-marker { display: none; }
.research-block > summary::before {
  content: '+'; display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 4px;
  background: var(--bg-surface); border: 1px solid var(--border-bright);
  color: var(--olive); font-family: 'JetBrains Mono', monospace;
  font-size: 0.95em; line-height: 1; transition: transform 0.18s;
}
.research-block[open] > summary::before { content: '−'; }
.research-block > *:not(summary) {
  padding-left: 22px; padding-right: 22px;
}
.research-block > *:last-child { padding-bottom: 18px; }

/* === Visually-hidden (a11y) === */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* === Multimedia wall filter chips === */
.video-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  border-radius: 100px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.84em;
  line-height: 1.2;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.video-chip:hover {
  border-color: var(--border-bright);
  color: var(--fg);
}
.video-chip.is-active {
  background: var(--bg-surface, var(--bg-card-hover));
  border-color: var(--olive, var(--ukr-blue));
  color: var(--fg);
}
.video-chip:focus-visible {
  outline: 2px solid var(--olive, var(--ukr-blue));
  outline-offset: 2px;
}

/* === Phase 12: Reader / Research mode toggle === */
/* Default = Reader: technical research-only layer is hidden */
.research-only { display: none; }
.research-only-inline { display: none; }
html[data-mode="research"] .research-only { display: block; }
html[data-mode="research"] .research-only-inline { display: inline; }
html[data-mode="research"] tr.research-only { display: table-row; }
html[data-mode="research"] li.research-only { display: list-item; }

/* Mode-toggle button mirrors theme-toggle look */
#mode-toggle {
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-bright);
  color: var(--fg);
  width: 38px; height: 38px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
#mode-toggle:hover { border-color: var(--olive, var(--ukr-blue)); }
#mode-toggle[aria-pressed="true"] {
  background: var(--bg-surface, var(--bg-card-hover));
  border-color: var(--olive, var(--ukr-blue));
  color: var(--olive, var(--ukr-blue));
}
#mode-toggle:focus-visible {
  outline: 2px solid var(--olive, var(--ukr-blue));
  outline-offset: 2px;
}

/* Research-only inline chips (fact_id, source_id badges) */
.research-only-inline.id-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72em;
  padding: 1px 6px;
  margin-left: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 100px;
  vertical-align: middle;
}

/* Reader-only counterpart (shown when not in research mode) */
.reader-only { display: block; }
html[data-mode="research"] .reader-only { display: none; }
.reader-only-inline { display: inline; }
html[data-mode="research"] .reader-only-inline { display: none; }

/* === Phase 13: Premium medical editorial polish === */
h1, h2, h3, h4 {
  letter-spacing: -0.012em;
  font-weight: 600;
}
h1 { font-size: 2.1em; line-height: 1.2; margin: 0 0 18px; }
h2 { font-size: 1.45em; line-height: 1.3; margin: 36px 0 14px; }
h3 { font-size: 1.1em; line-height: 1.35; margin: 16px 0 8px; }

main p { margin: 0 0 14px; max-width: 78ch; }
main ul, main ol { max-width: 78ch; }
main ul li, main ol li { margin: 4px 0; }

/* Slightly more breathing room on cards */
.dossier-card { padding: 18px 22px; }
.info-box { padding: 22px 26px; }
.stat-card { padding: 22px 24px; }

/* Toolbar buttons inherit calmer accent on hover */
.toolbar button:hover {
  border-color: var(--olive);
  color: var(--olive-bright);
  background: var(--bg-card);
}

/* ===========================================================
   v3.3 — Mobile polish (Phase A)
   Comprehensive responsive refinements for phones 320-720px
   =========================================================== */

/* Toolbar: prevent overlap with H1 on small screens by shrinking gap and adding margin to hero */
@media (max-width: 720px) {
  .toolbar { top: 10px; right: 10px; gap: 4px; }
  .toolbar button,
  .toolbar a { width: 34px !important; height: 34px !important; font-size: 0.95em !important; }
  .hero { padding-top: 60px !important; /* leave room for toolbar */ }
}

/* Phase 13 spacing was too generous for mobile — tighten on small screens */
@media (max-width: 720px) {
  .layout { padding: 12px 14px 60px; }
  .hud-divider { margin: 48px 0 18px; font-size: 1.02em; gap: 10px; }
  h1 { font-size: 1.85em; line-height: 1.18; }
  h2 { font-size: 1.25em; margin: 28px 0 10px; }
  h3 { font-size: 1.05em; }
  .info-box { padding: 18px 18px; }
  .dossier-card { padding: 16px 16px; }
  .dossier-card h3 { font-size: 1em; }
  .dossier-card p { font-size: 0.86em; }
  .stat-card { padding: 16px 16px; }
  .stat-card .stat-num { font-size: 1.45em; }
  .stat-card .stat-label { font-size: 0.82em; }
  .stat-card .stat-context { font-size: 0.74em; }
  .arch-card, .info-box ul { font-size: 0.9em; }

  /* Hero refinements */
  .hero h1 { font-size: 1.7em; line-height: 1.15; }
  .hero .callsign { font-size: 1.05em; margin-bottom: 14px; }
  .hero .position { font-size: 0.95em; }
  .hero .position-en { font-size: 0.82em; margin-bottom: 16px; }
  .hero .badges { gap: 6px; }
  .hero .badge { padding: 4px 10px; font-size: 0.72em; }
  .hero .meta-tag { font-size: 0.68em; margin-bottom: 10px; }
  .portrait-card { max-width: 220px; margin: 0 auto; }

  /* Filter chips bar (Phase 6) — touch-friendly */
  .video-filter { gap: 5px !important; }
  .video-chip { padding: 7px 13px; font-size: 0.8em; min-height: 32px; }

  /* TOC list / nav cards — denser */
  .toc-list { gap: 8px; }
  .toc-item { padding: 12px 14px; font-size: 0.88em; }

  /* Source tree — wrap nicely */
  .source-tree { gap: 12px; }
  .source-group { padding: 14px 16px; }
  .source-list li { font-size: 0.85em; }
  .pub { display: block; margin-top: 2px; font-size: 0.8em; }

  /* Image cards (clinic/projects) — reasonable height */
  .image-card { padding: 0 !important; }
  .image-card img { max-height: 200px; object-fit: cover; }

  /* Stat-grid 2 cols (existing) — but ensure unit fits */
  .stat-card .stat-num .unit { font-size: 0.5em; }

  /* Graph controls (Phase 11) — stack vertically on mobile */
  #graph-modes { gap: 4px !important; }
  #graph-modes button { padding: 6px 12px !important; font-size: 0.82em !important; flex: 1 1 calc(50% - 4px); min-width: 0; }
  #graph-controls { gap: 8px !important; }
  #graph-search { flex: 1 1 100% !important; min-width: 0 !important; font-size: 0.88em !important; padding: 8px 12px !important; }
  #graph-filters { width: 100%; gap: 4px !important; }
  #graph-filters button { font-size: 0.72em !important; padding: 4px 9px !important; }
  #graph-reset { font-size: 0.78em !important; padding: 7px 12px !important; }
  #graph-stage { height: 520px !important; }
  #graph-controls > span { display: none; /* hide drag hint on mobile */ }
  #graph-panel { width: calc(100% - 28px) !important; max-width: 320px; }

  /* Footer 1-col on phones */
  .shared-footer { padding: 28px 18px; gap: 22px; }

  /* Tables — make horizontally scrollable */
  .layout table { display: block; overflow-x: auto; white-space: nowrap; max-width: 100%; }
  .layout table th, .layout table td { white-space: normal; }

  /* Timeline list density */
  .timeline-card { padding: 14px 16px; }
  .timeline-card .tl-title { font-size: 1em; }
  .timeline-card .tl-desc { font-size: 0.86em; }

  /* Research-mode tier cards */
  .reliability-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tier-card { padding: 10px 12px; font-size: 0.82em; }

  /* Reduce mode-toggle horizontal hint paragraphs on small screen */
  .reader-only, .research-only-inline { font-size: 0.75em !important; }
}

/* Very small phones (<= 480px) */
@media (max-width: 480px) {
  .layout { padding: 10px 12px 56px; }
  .hud-divider { margin: 36px 0 14px; font-size: 0.98em; }
  h1 { font-size: 1.65em; }
  h2 { font-size: 1.18em; }
  .hero { padding: 56px 18px 28px !important; }
  .hero h1 { font-size: 1.5em; }
  .hero .callsign { font-size: 0.95em; }
  .hero .badge { font-size: 0.68em; padding: 3px 9px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card .stat-num { font-size: 1.3em; }
  .stat-card .stat-label { font-size: 0.78em; }
  .stat-card .stat-context { font-size: 0.7em; }
  .stat-card { padding: 12px 12px; }
  .dossier-card { padding: 14px 14px; }
  .info-box { padding: 16px 14px; }
  #graph-stage { height: 420px !important; }
  #graph-modes button { flex: 1 1 calc(50% - 4px); font-size: 0.78em !important; padding: 6px 10px !important; }
  .reliability-grid { grid-template-columns: 1fr; }
}

/* Touch tap targets — make buttons at least 44px tall (Apple HIG / Material) */
@media (pointer: coarse) {
  .topnav a, .video-chip, #graph-modes button, .toc-item, .dossier-card .d-cta,
  .source-list a, .llm-data-card { min-height: 44px; display: flex; align-items: center; }
  .source-list a { display: inline-flex; flex-wrap: wrap; align-items: center; }
  .video-chip { padding-top: 10px; padding-bottom: 10px; }
}

/* Smooth horizontal-scroll for any overflowing container */
.hscroll-container { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }

/* Hide outline animations on touch devices for less visual noise */
@media (hover: none) {
  .dossier-card:hover, .stat-card:hover, .toc-item:hover { transform: none; }
}

/* === Phase C1: Copyable blocks (media-kit) === */
.copyable-block { margin: 18px 0; }
.copyable-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px; flex-wrap: wrap;
}
.copy-btn {
  background: var(--bg-card); border: 1px solid var(--olive); color: var(--olive);
  padding: 7px 14px; border-radius: 100px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 0.78em; font-weight: 500;
  letter-spacing: 0.02em; transition: background 0.15s, color 0.15s, border-color 0.15s;
  min-height: 32px;
}
.copy-btn:hover { background: var(--olive); color: var(--bg); }
.copy-btn--ok { background: var(--success); color: var(--bg); border-color: var(--success); }
.copy-btn:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }

/* === Phase C1: Comparison layer (vs encyclopedia) === */
.compare-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 24px; margin: 22px 0;
}
.compare-col h4 { margin: 0 0 12px; font-size: 0.9em; color: var(--muted); font-family: 'JetBrains Mono', monospace; letter-spacing: 0.06em; text-transform: uppercase; }
.compare-col.hub h4 { color: var(--olive); }
.compare-col ul { list-style: none; padding: 0; margin: 0; }
.compare-col li {
  padding: 8px 0; font-size: 0.92em; color: var(--fg-dim);
  border-top: 1px solid var(--border); line-height: 1.5;
}
.compare-col li:first-child { border-top: none; }
.compare-col.hub li { color: var(--fg); }
.compare-col.hub li::before { content: '✓ '; color: var(--olive-bright); font-weight: 600; }
.compare-col.enc li::before { content: '◦ '; color: var(--muted); }
@media (max-width: 720px) {
  .compare-grid { grid-template-columns: 1fr; padding: 18px 16px; gap: 12px; }
  .compare-col + .compare-col { border-top: 1px solid var(--border); padding-top: 14px; }
}

/* === Phase C2: Featured video card === */
.video-featured {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
  background: var(--bg-card); border: 1px solid var(--olive); border-radius: var(--radius-lg);
  overflow: hidden; margin: 0 0 22px; text-decoration: none; color: var(--fg);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-glow);
}
.video-featured:hover { border-color: var(--olive-bright); transform: translateY(-2px); box-shadow: 0 0 32px rgba(107,154,135,0.18); }
.video-featured-thumb { position: relative; min-height: 280px; overflow: hidden; }
.video-featured-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-featured-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(11,14,20,0.12) 60%, var(--bg-card) 100%);
  pointer-events: none;
}
.video-featured-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(11,14,20,0.78); color: var(--olive-bright);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8em; padding-left: 6px;
  border: 1px solid var(--olive-bright);
  transition: transform 0.2s, background 0.2s;
}
.video-featured:hover .video-featured-play { transform: translate(-50%, -50%) scale(1.08); background: var(--olive); color: var(--bg); }
.video-featured-body { padding: 28px 30px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.video-featured-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 0.74em;
  color: var(--olive); letter-spacing: 0.06em; opacity: 0.92;
}
.video-featured-body h3 { margin: 4px 0 2px; font-size: 1.4em; line-height: 1.2; font-weight: 600; color: var(--fg); }
.video-featured-body p { margin: 0 0 6px; color: var(--fg-dim); font-size: 0.95em; line-height: 1.55; }
.video-featured-cta {
  margin-top: 8px; color: var(--olive-bright);
  font-family: 'JetBrains Mono', monospace; font-size: 0.84em; font-weight: 500;
}
@media (max-width: 760px) {
  .video-featured { grid-template-columns: 1fr; }
  .video-featured-thumb { min-height: 200px; }
  .video-featured-thumb::after { background: linear-gradient(180deg, transparent 0%, rgba(11,14,20,0.1) 60%, var(--bg-card) 100%); }
  .video-featured-body { padding: 20px 18px; }
  .video-featured-body h3 { font-size: 1.18em; }
  .video-featured-play { width: 54px; height: 54px; font-size: 1.5em; }
}

/* === Phase C2: Publisher "logos" (text-based brand cards) === */
.publisher-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
  margin: 14px 0 22px;
}
.publisher-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 14px;
  text-decoration: none; color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
  display: flex; flex-direction: column; gap: 4px;
}
.publisher-card:hover { border-color: var(--olive); transform: translateY(-2px); }
.publisher-name {
  font-family: 'Inter', serif; font-size: 0.98em; font-weight: 700;
  color: var(--fg); letter-spacing: -0.005em; line-height: 1.2;
}
.publisher-meta { color: var(--muted); font-size: 0.78em; font-family: 'JetBrains Mono', monospace; }
.publisher-card[data-tier="A"] .publisher-name { color: var(--success); }
.publisher-card[data-tier="B"] .publisher-name { color: var(--ukr-blue); }
.publisher-card[data-tier="C"] .publisher-name { color: var(--olive); }
.publisher-tier-badge {
  position: absolute; top: 8px; right: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.68em;
  padding: 1px 7px; border-radius: 100px;
  background: var(--bg-surface); color: var(--muted);
  border: 1px solid var(--border);
}
.publisher-card { position: relative; padding-right: 36px; }
