:root {
  --bg: #f7f7fb;
  --card: #ffffff;
  --ink: #202124;
  --muted: #626779;
  --brand: #1d1458;
  --line: #e6e6ef;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

main {
  max-width: 920px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.legal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.brand {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.language-picker {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

.legal-section[hidden] { display: none; }

[dir="rtl"] .legal-top {
  direction: rtl;
}

[dir="rtl"] ol,
[dir="rtl"] ul {
  padding-left: 0;
  padding-right: 1.25rem;
}

h1,
h2 {
  color: var(--brand);
  line-height: 1.2;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
  margin-top: 28px;
  font-size: 1.35rem;
}

p,
li {
  font-size: 1rem;
}

.date {
  color: var(--muted);
  font-style: italic;
  margin-top: 0;
}

a { color: #3b4bd8; }

nav.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding-top: 18px;
}

.analytics-consent {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  width: min(720px, calc(100% - 40px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
}

.analytics-consent strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
  line-height: 1.2;
}

.analytics-consent p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.analytics-consent-actions {
  display: flex;
  gap: 8px;
}

.analytics-consent button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #1d1458;
  border-radius: 8px;
  color: #fff;
  background: #1d1458;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.analytics-consent button[data-analytics-reject] {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

@media (max-width: 640px) {
  body { padding: 12px; }
  main { padding: 20px; }
  .legal-top { display: block; }
  .language-picker { width: 100%; margin-top: 14px; }
  select { width: 100%; }
  .analytics-consent {
    right: 12px;
    bottom: 12px;
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
    padding: 12px;
  }
  .analytics-consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .analytics-consent button { width: 100%; }
}
