.consent-banner[hidden],
.consent-modal[hidden] {
  display: none !important;
}

.consent-banner {
  position: fixed;
  z-index: 120;
  right: 0;
  bottom: 0;
  left: 0;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 96%, transparent);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .12);
  backdrop-filter: blur(12px);
}

.consent-banner__inner {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.consent-banner__copy {
  display: grid;
  gap: 4px;
  max-width: 720px;
  line-height: 1.4;
}

.consent-banner__copy strong {
  font-size: 15px;
}

.consent-banner__copy span {
  color: var(--muted);
  font-size: 13px;
}

.consent-banner__actions,
.consent-modal__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.consent-button {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.consent-button--primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.consent-button--text {
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent-footer-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.consent-modal {
  position: fixed;
  z-index: 130;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .58);
}

.consent-modal__dialog {
  width: min(520px, 100%);
  max-height: min(620px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.consent-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.consent-modal__head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.consent-modal__close {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.consent-modal__body {
  padding: 18px;
}

.consent-modal__body > p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.consent-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.consent-toggle span {
  display: grid;
  gap: 4px;
}

.consent-toggle small {
  color: var(--muted);
  line-height: 1.4;
}

.consent-toggle input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.consent-modal__actions {
  justify-content: flex-end;
  padding: 0 18px 18px;
}

@media (max-width: 900px) {
  .consent-banner {
    bottom: 74px;
  }

  .consent-banner__inner {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    max-height: 48vh;
    overflow: auto;
  }

  .consent-banner__actions .consent-button {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .consent-banner__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .consent-banner__actions .consent-button--text {
    grid-column: 1 / -1;
  }

  .consent-modal__actions .consent-button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .consent-button {
    transition: none;
  }
}
