/* KADABRA consent banner, DMC skin.
   Brand colors only: navy #283565, blue #087CF5, light blue #EAF6FF.
   Font is inherited from the site (Polin). */
:root {
  --kc-bg: #FFFFFF;
  --kc-fg: #1A1A2E;
  --kc-muted: #283565;
  --kc-accent: #087CF5;
  --kc-link: #283565;
  --kc-pill: #EAF6FF;
  --kc-pill-border: #C7E2FD;
  --kc-pill-fg: #283565;
  --kc-line: #C7E2FD;
  --kc-radius: 16px;
  --kc-shadow: 0 8px 28px rgba(26, 26, 46, .18);
}

/* Banner: small card. Desktop bottom corner, mobile full width at the bottom. */
.kc-banner {
  position: fixed;
  z-index: 9990;
  inset-inline: 16px;
  bottom: 16px;
  max-width: 400px;
  margin-inline-start: auto;
  box-sizing: border-box;
  background: var(--kc-bg);
  color: var(--kc-fg);
  border-radius: var(--kc-radius);
  box-shadow: var(--kc-shadow);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  direction: rtl;
  text-align: right;
}
.kc-banner[hidden] { display: none; }
.kc-text { margin: 0; }
.kc-text a {
  color: var(--kc-link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.kc-actions { display: flex; gap: 8px; }
.kc-btn {
  flex: 1 1 0;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--kc-pill-border);
  background: var(--kc-pill);
  color: var(--kc-pill-fg);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease;
}
.kc-btn:hover { border-color: var(--kc-accent); }
.kc-btn:focus-visible,
.kc-switch:focus-visible,
.kc-text a:focus-visible,
.kc-close:focus-visible {
  outline: 2px solid var(--kc-accent);
  outline-offset: 2px;
}

/* Settings dialog */
.kc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9991;
  background: rgba(26, 26, 46, .45);
  display: grid;
  place-items: center;
  padding: 16px;
}
.kc-overlay[hidden] { display: none; }
.kc-dialog {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  box-sizing: border-box;
  background: var(--kc-bg);
  color: var(--kc-fg);
  border-radius: var(--kc-radius);
  padding: 18px;
  display: grid;
  gap: 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  direction: rtl;
  text-align: right;
}
.kc-dialog h2 { margin: 0; font-size: 16px; font-weight: 600; padding-inline-end: 36px; }
.kc-dialog > p { margin: 0; color: var(--kc-muted); }
.kc-close {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--kc-fg);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.kc-cat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--kc-line);
  align-items: center;
}
.kc-cat strong { font-size: 13.5px; font-weight: 600; }
.kc-cat span { grid-column: 1; color: var(--kc-muted); font-size: 12.5px; }
.kc-switch {
  grid-row: 1 / span 2;
  grid-column: 2;
  position: relative;
  width: 40px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--kc-pill-border);
  background: #C7E2FD;
  cursor: pointer;
}
.kc-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: inset-inline-start .18s ease;
}
.kc-switch[aria-checked="true"] { background: var(--kc-accent); border-color: var(--kc-accent); }
.kc-switch[aria-checked="true"]::after { inset-inline-start: 20px; }
.kc-switch[disabled] { opacity: .55; cursor: not-allowed; }
.kc-dialog .kc-actions { padding-top: 12px; border-top: 1px solid var(--kc-line); }

/* Mobile: same small card, full width, 44px tap targets per the KADABRA checklist */
@media (max-width: 600px) {
  .kc-banner { inset-inline: 10px; bottom: 10px; max-width: none; padding: 12px 14px; }
  .kc-btn { min-height: 44px; padding: 6px 8px; }
  .kc-dialog .kc-actions { flex-wrap: wrap; }
  .kc-switch { width: 44px; height: 26px; }
  .kc-switch::after { width: 20px; height: 20px; }
  .kc-switch[aria-checked="true"]::after { inset-inline-start: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .kc-btn, .kc-switch::after { transition: none; }
}
