:root {
  color-scheme: dark;
  --bg-canvas: #0b1017;
  --bg-surface: #111822;
  --bg-elevated: #151f2c;
  --border-hairline: #1e2b3b;
  --border-subtle: #27374b;
  --text-primary: #f4f3ee;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-gold: #eab308;
  --accent-gold-hover: #facc15;
  --accent-sky: #7dd3fc;
  --accent-sky-hover: #bae6fd;
  --accent-green: #4ade80;
  --ua-blue: #0057b7;
  --ua-yellow: #ffd700;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg-canvas);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.72;
  letter-spacing: 0.008em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-sky);
  text-underline-offset: 3px;
  transition: color 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

a:hover {
  color: var(--accent-sky-hover);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Subtle Ukrainian flag top accent hairline */
.ua-hairline {
  height: 3px;
  display: flex;
  width: 100%;
}

.ua-hairline > div:first-child {
  width: 50%;
  background: var(--ua-blue);
}

.ua-hairline > div:last-child {
  width: 50%;
  background: var(--ua-yellow);
}

/* Strict 3-Zone Top Bar Contract */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 16, 23, 0.92);
  border-bottom: 1px solid var(--border-hairline);
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand-wordmark {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-wordmark span {
  color: var(--accent-gold-hover);
}

.primary-nav {
  display: none;
  align-items: center;
  gap: 1.75rem;
}

@media (min-width: 820px) {
  .primary-nav {
    display: flex;
  }
}

.primary-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.primary-nav a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border-subtle);
}

.primary-nav a[aria-current='page'] {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--accent-gold);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 1.15rem;
  border-radius: 8px;
  background: var(--accent-gold);
  color: #0f172a;
  font-family: 'Oswald', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 160ms ease, transform 160ms ease;
}

.header-cta:hover {
  background: var(--accent-gold-hover);
  color: #0f172a;
}

/* Mobile non-sticky page navigation strip (keeps sticky header compact) */
.mobile-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  overflow-x: auto;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  scrollbar-width: none;
}

.mobile-subnav::-webkit-scrollbar {
  display: none;
}

.mobile-subnav a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.mobile-subnav a[aria-current='page'] {
  color: var(--accent-gold-hover);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (min-width: 820px) {
  .mobile-subnav {
    display: none;
  }
}

/* Editorial Page Shell */
.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.75rem 1.5rem 4.5rem;
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0.75rem 1rem;
    gap: 1rem;
  }
  .page-shell {
    padding: 2rem 1rem 3.5rem;
  }
}

/* Hero Banner Area */
.page-hero {
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 2.75rem;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.meta-line .sep {
  color: #475569;
}

.page-hero h1 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(2.1rem, 4.2vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin: 0 0 1rem;
  max-width: 24ch;
  text-wrap: balance;
}

.page-lead {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 66ch;
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.4rem;
  font-size: 0.9rem;
}

/* Asymmetric Two-Column Reading Grid */
.editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

@media (min-width: 960px) {
  .editorial-grid {
    grid-template-columns: minmax(0, 1fr) 276px;
    gap: 3.5rem;
  }
}

.article-body {
  min-width: 0;
  max-width: 780px;
}

.article-body > section > p,
.article-body .clean-list {
  max-width: 66ch;
}

.article-body section {
  margin-bottom: 2.75rem;
}

.article-body section:last-child {
  margin-bottom: 0;
}

.article-body h2 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.4rem, 2.3vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin: 0 0 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-hairline);
  text-wrap: balance;
}

.article-body h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin: 1.5rem 0 0.45rem;
}

.article-body p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-body code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.86em;
  color: var(--accent-gold-hover);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

/* Editorial Pull Quote (top & bottom hairlines, zero thick left bar) */
.pull-quote {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.pull-quote p {
  font-size: 1.18rem;
  line-height: 1.65;
  color: var(--text-primary);
  margin: 0 0 0.65rem;
}

.pull-quote cite {
  display: block;
  font-style: normal;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Figure Frame */
.editorial-figure {
  margin: 0 0 2.25rem;
}

.editorial-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.editorial-figure figcaption {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Surface Panels (single-elevation hairline borders, no nested boxes) */
.surface-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  margin: 1.25rem 0;
}

.surface-panel h3 {
  margin-top: 0;
}

/* Verified Organization / Step Cards */
.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.9rem;
}

.info-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
}

.info-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.58;
  color: var(--text-secondary);
}

.info-card .card-kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.info-card .card-link {
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

/* Clean Lists */
.clean-list {
  margin: 0.75rem 0 1rem;
  padding-left: 1.2rem;
  color: var(--text-secondary);
}

.clean-list li {
  margin-bottom: 0.75rem;
}

.clean-list li:last-child {
  margin-bottom: 0;
}

/* KPI Strip & Data Tables (tabular numerals) */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0 1.5rem;
}

@media (min-width: 640px) {
  .kpi-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.kpi-cell {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}

.kpi-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-value.accent-green {
  color: var(--accent-green);
}

.kpi-value.accent-sky {
  color: var(--accent-sky);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  background: var(--bg-surface);
  margin: 1.25rem 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-hairline);
}

.data-table th {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table .num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* Interactive Controls (Cookie Preference Toggle) */
.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn-primary {
  background: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  color: #0f172a;
}

.btn-primary:hover {
  background: var(--accent-gold-hover);
  color: #0f172a;
}

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--accent-sky);
  color: var(--text-primary);
}

.btn-secondary[aria-pressed='true'] {
  background: #1a314a;
  border-color: var(--accent-sky);
  color: #f0f9ff;
}

.btn-primary[aria-pressed='true'] {
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.35);
}

.status-note {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--accent-sky);
}

/* Right Margin Sidebar Rail */
.margin-rail {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 960px) {
  .margin-rail {
    position: sticky;
    top: 5.25rem;
  }
}

.rail-block {
  padding-top: 1.15rem;
  border-top: 1px solid var(--border-hairline);
}

.rail-block:first-child {
  padding-top: 0;
  border-top: none;
}

.rail-heading {
  font-family: 'Oswald', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.8rem;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-list a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.toc-list a:hover {
  color: var(--accent-gold-hover);
  text-decoration: underline;
}

.facts-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.facts-dl dt {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.facts-dl dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.muted-copy {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Interactive Category Filter Bar (Equipment Catalog) */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.25rem 0 1.5rem;
}

.filter-btn {
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  border-radius: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.filter-btn:hover {
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.filter-btn[aria-pressed='true'] {
  background: #1a314a;
  border-color: var(--accent-sky);
  color: #f0f9ff;
  font-weight: 600;
}

.equip-group {
  margin-bottom: 1.75rem;
}

.equip-group:last-child {
  margin-bottom: 0;
}

.equip-group[hidden] {
  display: none;
}

.equip-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.equip-group-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.equip-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  padding: 2rem 1.5rem 2.75rem;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.footer-links a:hover,
.footer-cookie-btn:hover {
  color: var(--accent-gold-hover);
  text-decoration: underline;
}

.footer-cookie-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

/* EU GDPR / ePrivacy Cookie Consent Banner (Standalone Editorial Pages) */
.eu-consent-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  max-width: 1080px;
  margin: 0 auto;
  background: rgba(13, 21, 32, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid #334155;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.72);
  padding: 1.15rem 1.25rem;
  color: var(--text-primary);
}

.eu-consent-inner {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.eu-consent-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 0.3rem;
}

.eu-consent-desc {
  font-size: 0.82rem;
  line-height: 1.55;
  color: #cbd5e1;
  margin: 0;
}

.eu-consent-desc a {
  color: #7dd3fc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.eu-consent-desc a:hover {
  color: #bae6fd;
}

.eu-consent-prefs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.85rem;
  border-top: 1px solid #1e293b;
}

.eu-consent-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #111c2a;
  border: 1px solid #243244;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
}

.eu-consent-pref-info strong {
  display: block;
  font-size: 0.82rem;
  color: #f8fafc;
  margin-bottom: 0.15rem;
}

.eu-consent-pref-info p {
  font-size: 0.76rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.45;
}

.eu-consent-always {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: #86efac;
  background: #143026;
  border: 1px solid #22543d;
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  white-space: nowrap;
}

.eu-consent-toggle {
  flex-shrink: 0;
  min-width: 60px;
  min-height: 34px;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #1b2533;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.eu-consent-toggle.is-on {
  background: #0369a1;
  border-color: #38bdf8;
  color: #f8fafc;
}

.eu-consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

/* Equal visual prominence for Reject Non-Essential & Accept All (EU EDPB compliant) */
.eu-btn-equal {
  min-height: 40px;
  padding: 0.5rem 1.05rem;
  border-radius: 8px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.eu-btn-equal:hover {
  background: #ffffff;
}

.eu-btn-secondary {
  min-height: 40px;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  background: #162231;
  border: 1px solid #334155;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  margin-right: auto;
}

.eu-btn-secondary:hover {
  background: #1e2e42;
}

@media (max-width: 639px) {
  .eu-consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .eu-btn-secondary {
    grid-column: 1 / -1;
    margin-right: 0;
  }
}
