/* DPS Consent — front styles. Neutral by design: inherits the theme font. */
.dpsc {
  --dpsc-accent: #1f2937;
  --dpsc-accent-text: #ffffff;
  --dpsc-surface: #ffffff;
  --dpsc-ink: #1f2937;
  --dpsc-muted: #4b5563;
  --dpsc-line: #e5e7eb;
  --dpsc-radius: 10px;
  --dpsc-focus: #2563eb;
  font-size: 15px;
  line-height: 1.5;
  color: var(--dpsc-ink);
}
.dpsc *, .dpsc *::before, .dpsc *::after { box-sizing: border-box; }
.dpsc [hidden] { display: none !important; }

/* ---------- banner ---------- */
.dpsc-banner {
  position: fixed;
  z-index: 2147483000;
  left: 0; right: 0; bottom: 0;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.dpsc-banner__inner {
  position: relative;
  pointer-events: auto;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px 32px;
  padding: 20px 56px 20px 24px;
  background: var(--dpsc-surface);
  border: 1px solid var(--dpsc-line);
  border-radius: var(--dpsc-radius);
  box-shadow: 0 12px 32px rgba(17, 24, 39, .14), 0 2px 6px rgba(17, 24, 39, .06);
  animation: dpsc-rise .22s ease-out both;
}
.dpsc--box .dpsc-banner { right: auto; max-width: 440px; }
.dpsc--box .dpsc-banner__inner { flex-direction: column; align-items: stretch; }

.dpsc-banner__text { flex: 1 1 auto; min-width: 0; }
.dpsc-title {
  margin: 0 0 4px;
  font-size: 1.07em;
  font-weight: 700;
  line-height: 1.3;
  color: var(--dpsc-ink);
  text-transform: none;
  letter-spacing: 0;
}
.dpsc-msg { margin: 0; color: var(--dpsc-muted); max-width: 70ch; }
.dpsc-policy { color: var(--dpsc-ink); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.dpsc-policy:hover { text-decoration-thickness: 2px; }

/* ---------- buttons ---------- */
.dpsc-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; }
.dpsc-btn {
  appearance: none;
  min-height: 44px;
  min-width: 120px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 2px solid var(--dpsc-accent);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  text-transform: none;
  transition: filter .15s ease, background-color .15s ease;
}
/* Accept and Reject are deliberately identical (no nudging). */
.dpsc-btn--main { background: var(--dpsc-accent); color: var(--dpsc-accent-text); }
.dpsc-btn--main:hover { filter: brightness(1.12); }
.dpsc-btn--quiet { background: transparent; color: var(--dpsc-ink); border-color: var(--dpsc-line); }
.dpsc-btn--quiet:hover { border-color: var(--dpsc-muted); }
.dpsc-btn:active { transform: translateY(1px); }

.dpsc-x {
  position: absolute;
  top: 8px; right: 8px;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--dpsc-muted);
  cursor: pointer;
}
.dpsc-x:hover { background: #f3f4f6; color: var(--dpsc-ink); }
.dpsc-x--static { position: static; flex: 0 0 auto; }

.dpsc button:focus-visible,
.dpsc a:focus-visible,
.dpsc-linkbtn:focus-visible,
.dpsc-switch:focus-visible {
  outline: 2px solid var(--dpsc-focus);
  outline-offset: 2px;
}

/* ---------- dialog ---------- */
.dpsc-overlay {
  position: fixed;
  z-index: 2147483001;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 24, 39, .55);
  animation: dpsc-fade .18s ease-out both;
}
.dpsc-dialog {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--dpsc-surface);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(17, 24, 39, .3);
  outline: none;
  animation: dpsc-rise .22s ease-out both;
}
.dpsc-dialog__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 16px 8px 24px;
}
.dpsc-dialog__head .dpsc-title { margin: 0; font-size: 1.2em; }
.dpsc-dialog__body { padding: 0 24px 8px; overflow-y: auto; overscroll-behavior: contain; }
.dpsc-dialog__foot {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--dpsc-line);
}
.dpsc-dialog__foot .dpsc-btn { flex: 1 1 140px; }

.dpsc-cats { list-style: none; margin: 16px 0 0; padding: 0; }
.dpsc-cat { padding: 14px 0; border-top: 1px solid var(--dpsc-line); }
.dpsc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dpsc-cat__name { margin: 0; font-weight: 600; color: var(--dpsc-ink); cursor: pointer; }
.dpsc-cat__desc { margin: 4px 0 0; color: var(--dpsc-muted); font-size: .93em; }

/* switch built on a native checkbox: keyboard and screen readers work as-is */
.dpsc-switch {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  position: relative;
  width: 46px; height: 26px;
  margin: 0;
  border-radius: 999px;
  background: #9ca3af;
  cursor: pointer;
  transition: background-color .15s ease;
}
.dpsc-switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .15s ease;
}
.dpsc-switch:checked { background: var(--dpsc-accent); }
.dpsc-switch:checked::after { transform: translateX(20px); }
.dpsc-switch:disabled { cursor: not-allowed; opacity: .55; }

/* ---------- reopen controls ---------- */
.dpsc-float {
  position: fixed;
  z-index: 2147482999;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  border: 1px solid var(--dpsc-line);
  border-radius: 50%;
  background: var(--dpsc-surface);
  color: var(--dpsc-ink);
  box-shadow: 0 4px 14px rgba(17, 24, 39, .16);
  cursor: pointer;
}
.dpsc-float:hover { color: var(--dpsc-accent); }
.dpsc-footer-link { text-align: center; padding: 8px 0; }
.dpsc-linkbtn {
  appearance: none;
  background: none; border: 0; padding: 4px 2px;
  font: inherit; color: inherit;
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}

html.dpsc-lock, html.dpsc-lock body { overflow: hidden; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .dpsc-banner__inner { flex-direction: column; align-items: stretch; padding: 18px 18px 18px; }
  .dpsc-banner__text { padding-right: 36px; }
  .dpsc-actions .dpsc-btn { flex: 1 1 140px; }
}
@media (max-width: 420px) {
  .dpsc-banner { padding: 0 0 env(safe-area-inset-bottom, 0px); }
  .dpsc-banner__inner { border-radius: 0; border-left: 0; border-right: 0; }
  .dpsc-actions .dpsc-btn { flex-basis: 100%; }
  .dpsc-overlay { padding: 0; align-items: flex-end; }
  .dpsc-dialog { border-radius: 14px 14px 0 0; max-height: 92vh; max-height: 92dvh; }
}

@keyframes dpsc-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes dpsc-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .dpsc-banner__inner, .dpsc-overlay, .dpsc-dialog { animation: none; }
  .dpsc-btn, .dpsc-switch, .dpsc-switch::after { transition: none; }
}
@media (forced-colors: active) {
  .dpsc-switch { border: 1px solid CanvasText; }
  .dpsc-switch:checked { background: Highlight; }
}
