html.cookie-open { overflow: hidden; }

.cookie-bar,
.cookie-dialog {
  font-family: var(--font);
  color: var(--ink);
}

.cookie-bar {
  position: fixed;
  z-index: 1400;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 32px));
  padding: 18px 18px 16px;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(17, 24, 39, 0.16);
}

.cookie-bar[hidden],
.cookie-layer[hidden] { display: none !important; }

.cookie-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cookie-bar > p:last-of-type,
.cookie-dialog > p {
  margin: 0;
  color: #374151;
  font-size: 0.92rem;
  line-height: 1.5;
}

.cookie-bar a {
  color: var(--navy);
  font-weight: 700;
}

.cookie-actions,
.cookie-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.cookie-actions { flex-direction: column; align-items: stretch; }
.cookie-actions .is-line,
.cookie-actions .is-solid { width: 100%; }
.cookie-actions .is-text { align-self: center; }

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.cookie-btn.is-solid {
  background: var(--navy);
  color: #fff;
}

.cookie-btn.is-solid:hover { background: #08244f; }

.cookie-btn.is-line {
  background: #fff;
  color: var(--ink);
  border-color: #d5d9e2;
}

.cookie-btn.is-line:hover { border-color: var(--navy); color: var(--navy); }

.cookie-btn.is-text {
  background: transparent;
  color: var(--navy);
  padding-inline: 10px;
}

.cookie-btn:focus-visible,
.cookie-x:focus-visible,
.cookie-switch:focus-visible,
.footer-legal a:focus-visible,
.footer-legal button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.cookie-layer {
  position: fixed;
  inset: 0;
  z-index: 1410;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(17, 24, 39, 0.46);
}

.cookie-dialog {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  padding: 20px;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.22);
}

.cookie-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.cookie-dialog-head h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.cookie-x {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.cookie-cats {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cookie-cats li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #eef0f4;
  border-radius: 18px;
  background: #fbfcfe;
}

.cookie-cats strong { display: block; font-size: 0.95rem; }
.cookie-cats li > div span { display: block; color: var(--muted); font-size: 0.84rem; line-height: 1.4; }

.cookie-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 28px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: #d8dee8;
  cursor: pointer;
}

.cookie-switch .cookie-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.18);
  transition: transform 0.2s ease;
}

.cookie-switch[aria-checked="true"] { background: var(--navy); }
.cookie-switch[aria-checked="true"] .cookie-knob { transform: translateX(18px); }

.cookie-switch.is-locked span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--navy);
}

.cookie-switch.is-locked {
  width: auto;
  height: auto;
  background: transparent;
  cursor: default;
}

.cookie-switch.is-locked input { display: none; }

.cookie-switch.is-locked span {
  position: static;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.cookie-switch.is-locked span::after { display: none; }

.cookie-dialog-actions {
  position: sticky;
  bottom: 0;
  justify-content: flex-end;
  margin: 14px -20px -20px;
  padding: 12px 20px 16px;
  background: #fff;
  border-top: 1px solid #eef0f4;
}

.cookie-policy { max-width: 860px; }
.cookie-policy h2 { margin: 28px 0 8px; font-size: 1.25rem; letter-spacing: -0.02em; }
.cookie-policy p { color: #374151; }
.cookie-policy a,
.cookie-inline { color: var(--navy); font-weight: 700; }

.cookie-inline {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid #eef0f4;
  border-radius: 20px;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.9rem;
}

.cookie-table th,
.cookie-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #f0f1f4;
}

.cookie-table th {
  background: #f8fafc;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4b5563;
}

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

html[data-theme="dark"] .cookie-bar,
html[data-theme="dark"] .cookie-dialog {
  background: #141c2b;
  color: #e8edf5;
  border-color: #2c3b54;
}

html[data-theme="dark"] .cookie-bar > p,
html[data-theme="dark"] .cookie-dialog > p,
html[data-theme="dark"] .cookie-policy p { color: #c5d0e2; }

html[data-theme="dark"] .cookie-kicker,
html[data-theme="dark"] .cookie-bar a,
html[data-theme="dark"] .cookie-btn.is-text,
html[data-theme="dark"] .cookie-policy a,
html[data-theme="dark"] .cookie-inline { color: #e4c56a; }

html[data-theme="dark"] .cookie-btn.is-line {
  background: #101826;
  color: #e8edf5;
  border-color: #3a4c68;
}

html[data-theme="dark"] .cookie-cats li {
  background: #101826;
  border-color: #2c3b54;
}

html[data-theme="dark"] .cookie-cats li > div span { color: #8b97ab; }

html[data-theme="dark"] .cookie-x { background: #1c2740; color: #e8edf5; }

html[data-theme="dark"] .cookie-dialog-actions {
  background: #141c2b;
  border-top-color: #2c3b54;
}

html[data-theme="dark"] .cookie-table-wrap { border-color: #2c3b54; }
html[data-theme="dark"] .cookie-table th { background: #1c2740; color: #c5d0e2; }
html[data-theme="dark"] .cookie-table th,
html[data-theme="dark"] .cookie-table td { border-bottom-color: #2c3b54; color: #e8edf5; }

html[data-theme="dark"] .page-cookies .page-hero { color: #e8edf5; }

@media (max-width: 639.98px) {
  .cookie-bar {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .cookie-actions,
  .cookie-dialog-actions { flex-direction: column; }

  .cookie-btn { width: 100%; }

  .cookie-layer { place-items: end stretch; padding: 0; }

  .cookie-dialog {
    width: 100%;
    max-height: min(92vh, 760px);
    border-radius: 24px 24px 0 0;
  }

  html:has(.cookie-bar:not([hidden])) .to-top { bottom: 250px; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-switch .cookie-knob { transition: none; }
}

@media print {
  .cookie-bar,
  .cookie-layer { display: none !important; }
}
