:root {
  color-scheme: light dark;
  --page: #f3f0e8;
  --raised: #f8f6f0;
  --surface: #fffefa;
  --surface-variant: #ece8de;
  --text: #18212c;
  --text-secondary: #626b75;
  --outline: #c8c2b6;
  --outline-soft: #ddd7cb;
  --accent: #315bd9;
  --accent-strong: #294fc2;
  --accent-soft: #e7ebfb;
  --secondary: #49677e;
  --tertiary: #a7602a;
  --error: #b42318;
  --hero-start: #17284a;
  --hero-end: #254cb3;
  --on-hero: #fffefa;
  --radius-panel: 20px;
  --radius-compact: 16px;
  --radius-control: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--outline);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
  padding: 24px 0 64px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 19px;
  letter-spacing: 0;
}

.site-header-link {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 650;
}

.hero {
  overflow: hidden;
  padding: clamp(28px, 6vw, 58px);
  border: 1px solid #315895;
  border-radius: var(--radius-panel);
  background: linear-gradient(135deg, var(--hero-start), var(--hero-end));
  color: var(--on-hero);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 790px;
  margin: 0;
  font-size: clamp(34px, 7vw, 62px);
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.hero-copy {
  max-width: 720px;
  margin: 18px 0 0;
  color: #e4e9f6;
  font-size: clamp(16px, 2.3vw, 20px);
  line-height: 1.55;
}

.meta {
  color: var(--text-secondary);
}

.hero .meta {
  color: #d3daeb;
}

.language-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 30px;
  padding: 10px;
  border: 1px solid var(--outline);
  border-radius: var(--radius-compact);
  background: var(--raised);
}

.language-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.language-button {
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.language-button:hover {
  background: var(--surface-variant);
  color: var(--text);
}

.language-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.utility-link {
  padding: 9px 11px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.locale-panel[hidden] {
  display: none !important;
}

.section-heading {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-intro {
  max-width: 760px;
  margin: -7px 0 24px;
  color: var(--text-secondary);
  font-size: 17px;
}

.contact-card,
.summary-card,
.notice-card {
  padding: 22px;
  border: 1px solid var(--outline);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 28px;
  border-left: 4px solid var(--accent);
}

.contact-card h2,
.contact-card h3,
.summary-card h3,
.notice-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.35;
}

.contact-card p,
.summary-card p,
.notice-card p {
  margin: 0;
}

.contact-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  background: var(--accent-strong);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.contact-action:hover {
  background: var(--accent);
}

.security-note {
  margin: 0 0 28px;
  padding: 16px 18px;
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-compact);
  background: var(--surface-variant);
  color: var(--text-secondary);
  font-size: 14px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius-compact);
  background: var(--surface);
}

.faq-item[open] {
  border-color: var(--outline);
}

.faq-item summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 18px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 750;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  width: 24px;
  flex: 0 0 24px;
  color: var(--accent);
  content: "+";
  font-size: 24px;
  font-weight: 450;
  line-height: 1;
  text-align: center;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 18px 18px;
  color: var(--text-secondary);
}

.faq-answer p {
  margin: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

.summary-card {
  min-height: 100%;
  padding: 18px;
}

.summary-card strong {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
}

.summary-card span {
  display: block;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.policy-toc {
  margin: 0 0 28px;
  padding: 18px 20px;
  border: 1px solid var(--outline);
  border-radius: var(--radius-panel);
  background: var(--raised);
}

.policy-toc strong {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
}

.policy-toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 28px;
  margin: 0;
  padding-left: 22px;
}

.policy-toc a {
  color: var(--text-secondary);
  font-size: 14px;
}

.policy-section,
.policy-article > section {
  padding: 25px 0;
  border-top: 1px solid var(--outline-soft);
}

.policy-section:first-of-type,
.policy-article > section:first-of-type {
  border-top: 0;
}

.policy-section h3,
.policy-article > section h3 {
  max-width: 760px;
  margin: 0 0 12px;
  font-size: clamp(21px, 3vw, 27px);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.policy-section p,
.policy-section li,
.policy-article > section p,
.policy-article > section li {
  max-width: 820px;
}

.policy-section p:last-child,
.policy-section ul:last-child,
.policy-article > section p:last-child,
.policy-article > section ul:last-child {
  margin-bottom: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--outline);
  border-radius: var(--radius-compact);
  background: var(--surface);
}

.policy-article > section > table {
  overflow: hidden;
  border: 1px solid var(--outline);
  border-radius: var(--radius-compact);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--outline-soft);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-variant);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.02em;
}

td {
  min-width: 180px;
  color: var(--text-secondary);
  font-size: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

td:first-child {
  color: var(--text);
  font-weight: 700;
}

td::before {
  display: none;
}

code {
  padding: 0.08em 0.35em;
  border-radius: 6px;
  background: var(--surface-variant);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.page-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--outline);
  color: var(--text-secondary);
  font-size: 14px;
}

.page-footer p {
  margin: 4px 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: flex-end;
}

.back-to-top {
  font-weight: 700;
}

.noscript-note {
  margin: 14px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 22px, 1040px);
    padding-top: 14px;
  }

  .site-header {
    margin-inline: 3px;
  }

  .site-header-link {
    display: none;
  }

  .hero {
    padding: 28px 22px;
  }

  .language-bar,
  .contact-card,
  .page-footer {
    grid-template-columns: 1fr;
  }

  .language-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .utility-link {
    align-self: flex-start;
  }

  .contact-card {
    display: grid;
  }

  .contact-action {
    width: 100%;
  }

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

  .policy-toc ol {
    grid-template-columns: 1fr;
  }

  .page-footer {
    align-items: start;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .policy-article > section > table {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
  }

  tr {
    margin-bottom: 10px;
    border: 1px solid var(--outline);
    border-radius: var(--radius-compact);
    background: var(--surface);
    overflow: hidden;
  }

  td {
    min-width: 0;
    padding: 13px 14px;
    border-bottom: 1px solid var(--outline-soft);
  }

  td::before {
    display: block;
    margin-bottom: 3px;
    color: var(--text-secondary);
    content: var(--column-label);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .locale-en td:nth-child(1) { --column-label: "Data"; }
  .locale-en td:nth-child(2) { --column-label: "Examples and source"; }
  .locale-en td:nth-child(3) { --column-label: "Purpose"; }
  .locale-uk td:nth-child(1) { --column-label: "Дані"; }
  .locale-uk td:nth-child(2) { --column-label: "Приклади та джерело"; }
  .locale-uk td:nth-child(3) { --column-label: "Мета"; }
  .locale-ru td:nth-child(1) { --column-label: "Данные"; }
  .locale-ru td:nth-child(2) { --column-label: "Примеры и источник"; }
  .locale-ru td:nth-child(3) { --column-label: "Цель"; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #080f1b;
    --raised: #0b1422;
    --surface: #111c2b;
    --surface-variant: #1a2738;
    --text: #f5f2ea;
    --text-secondary: #b8c1cd;
    --outline: #455368;
    --outline-soft: #2b394d;
    --accent: #89a2ff;
    --accent-strong: #89a2ff;
    --accent-soft: #1b2f5e;
    --secondary: #9ab8cc;
    --tertiary: #e7a46d;
    --error: #ffb4ac;
    --hero-start: #182846;
    --hero-end: #294da6;
    --on-hero: #f5f2ea;
  }

  .hero {
    border-color: #455d91;
  }

  .contact-action {
    background: #3d5fcb;
  }
}

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

@media print {
  :root {
    color-scheme: light;
    --page: #fff;
    --surface: #fff;
    --raised: #fff;
    --surface-variant: #f4f4f4;
    --text: #111;
    --text-secondary: #333;
    --outline: #aaa;
    --outline-soft: #ccc;
  }

  .language-bar,
  .site-header,
  .back-to-top {
    display: none;
  }

  .hero {
    border-color: #777;
    background: #fff;
    color: #111;
  }

  .hero .meta,
  .hero-copy {
    color: #333;
  }
}
