/* ds_cookies — okno zgód. Kolory z panelu (CSS-vars na #dscc), trzy układy: box, cloud, bar.
   Warstwy: okno pod bramką wieku ds_agegate (2000), żeby najpierw padła odpowiedź o wiek. */
.dscc {
  --dscc-accent: #7a1f3d;
  --dscc-bg: #ffffff;
  --dscc-text: #222222;
  --dscc-muted: rgba(0, 0, 0, .62);
  --dscc-line: rgba(0, 0, 0, .12);
  --dscc-radius: 10px;
  --dscc-shadow: 0 10px 40px rgba(0, 0, 0, .18);
  font-size: 14px;
  line-height: 1.5;
}
.dscc[hidden], .dscc [hidden] { display: none !important; }
.dscc--dark { --dscc-muted: rgba(255, 255, 255, .7); --dscc-line: rgba(255, 255, 255, .16); }
.dscc--dark .dscc__banner, .dscc--dark .dscc__panel { background: #1d1d1f; color: #f1f1f1; }
html.dscc-locked, html.dscc-locked body { overflow: hidden; }

.dscc__overlay { position: fixed; inset: 0; z-index: 1990; background: rgba(20, 16, 18, .55); }

/* Pierwsza warstwa */
.dscc__banner {
  position: fixed;
  z-index: 1991;
  box-sizing: border-box;
  max-width: calc(100vw - 32px);
  padding: 20px;
  border-radius: var(--dscc-radius);
  background: var(--dscc-bg);
  color: var(--dscc-text);
  box-shadow: var(--dscc-shadow);
  animation: dscc-in .25s ease-out;
}
.dscc--box .dscc__banner { width: 400px; }
.dscc--cloud .dscc__banner { width: 860px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title actions" "text actions"; column-gap: 24px; align-items: center; }
.dscc--cloud .dscc__title { grid-area: title; }
.dscc--cloud .dscc__text { grid-area: text; margin-bottom: 0; }
.dscc--cloud .dscc__actions { grid-area: actions; flex-direction: column; min-width: 200px; }
.dscc--bar .dscc__banner { left: 0 !important; right: 0 !important; width: 100%; max-width: none; border-radius: 0; transform: none !important; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 16px max(16px, calc((100vw - 1200px) / 2)); }
.dscc--bar .dscc__title { flex: 1 0 100%; margin-bottom: 0; }
.dscc--bar .dscc__text { flex: 1 1 520px; margin-bottom: 0; }

.dscc--bottom-left .dscc__banner { left: 16px; bottom: 16px; }
.dscc--bottom-right .dscc__banner { right: 16px; bottom: 16px; }
.dscc--bottom-center .dscc__banner { left: 50%; bottom: 16px; transform: translateX(-50%); }
.dscc--top-left .dscc__banner { left: 16px; top: 16px; }
.dscc--top-right .dscc__banner { right: 16px; top: 16px; }
.dscc--top-center .dscc__banner { left: 50%; top: 16px; transform: translateX(-50%); }
.dscc--middle-center .dscc__banner { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.dscc--bar.dscc--bottom-left .dscc__banner, .dscc--bar.dscc--bottom-right .dscc__banner, .dscc--bar.dscc--bottom-center .dscc__banner, .dscc--bar.dscc--middle-center .dscc__banner { bottom: 0; top: auto; }
.dscc--bar.dscc--top-left .dscc__banner, .dscc--bar.dscc--top-right .dscc__banner, .dscc--bar.dscc--top-center .dscc__banner { top: 0; bottom: auto; }

.dscc__title { margin: 0 0 8px; font-size: 17px; font-weight: 700; line-height: 1.3; color: inherit; }
.dscc__text { margin: 0 0 16px; color: inherit; }
.dscc__text p { margin: 0 0 8px; }
.dscc__link, .dscc__text a { color: var(--dscc-accent); text-decoration: underline; }
.dscc--dark .dscc__link, .dscc--dark .dscc__text a { color: inherit; }

.dscc__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dscc--box .dscc__actions .dscc__btn { flex: 1 1 calc(50% - 4px); }
.dscc--box .dscc__actions .dscc__btn--outline { flex-basis: 100%; }

.dscc__btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid var(--dscc-accent);
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: filter .15s, background-color .15s;
}
.dscc__btn--primary { background: var(--dscc-accent); color: #fff; }
.dscc__btn--primary:hover { filter: brightness(1.1); }
.dscc__btn--outline { background: transparent; color: var(--dscc-accent); }
.dscc--dark .dscc__btn--outline { color: #fff; border-color: rgba(255, 255, 255, .6); }
.dscc__btn--outline:hover { background: rgba(0, 0, 0, .04); }
.dscc__btn:focus-visible, .dscc__close:focus-visible, .dscc__float:focus-visible, .dscc__switch input:focus-visible + .dscc__slider { outline: 3px solid var(--dscc-accent); outline-offset: 2px; }

/* Ustawienia */
.dscc__modal { position: fixed; inset: 0; z-index: 1995; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; pointer-events: none; }
.dscc__panel {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: 640px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  border-radius: var(--dscc-radius);
  background: var(--dscc-bg);
  color: var(--dscc-text);
  box-shadow: var(--dscc-shadow);
  animation: dscc-in .2s ease-out;
}
.dscc__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--dscc-line); }
.dscc__head .dscc__title { margin: 0; }
.dscc__close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.dscc__close:hover { background: rgba(0, 0, 0, .06); }
.dscc__body { overflow-y: auto; padding: 16px 20px; -webkit-overflow-scrolling: touch; }
.dscc__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--dscc-line); }

.dscc__cat { padding: 14px 0; border-top: 1px solid var(--dscc-line); }
.dscc__cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dscc__cat-name { font-weight: 700; }
.dscc__cat-desc { margin: 6px 0 0 56px; color: var(--dscc-muted); font-size: 13px; }
.dscc__always { font-size: 12px; font-weight: 600; color: var(--dscc-accent); white-space: nowrap; }
.dscc--dark .dscc__always { color: inherit; }

.dscc__switch { position: relative; display: inline-flex; align-items: center; gap: 12px; margin: 0; cursor: pointer; font-weight: 400; }
.dscc__switch input { position: absolute; width: 44px; height: 24px; margin: 0; opacity: 0; cursor: pointer; }
.dscc__slider { position: relative; flex: 0 0 44px; width: 44px; height: 24px; border-radius: 12px; background: #b9b9b9; transition: background-color .15s; }
.dscc__slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.dscc__switch input:checked + .dscc__slider { background: var(--dscc-accent); }
.dscc__switch input:checked + .dscc__slider::after { transform: translateX(20px); }
.dscc__switch input:disabled + .dscc__slider { opacity: .55; cursor: not-allowed; }

.dscc__details { margin: 8px 0 0 56px; font-size: 13px; }
.dscc__details summary { cursor: pointer; color: var(--dscc-accent); font-weight: 600; }
.dscc--dark .dscc__details summary { color: inherit; }
.dscc__table-wrap { overflow-x: auto; margin-top: 8px; }
.dscc__table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dscc__table th, .dscc__table td { padding: 6px 8px; border-bottom: 1px solid var(--dscc-line); text-align: left; vertical-align: top; }
.dscc__table code { font-size: 12px; white-space: nowrap; background: none; color: inherit; padding: 0; }

/* Przycisk zmiany zgód */
.dscc__float {
  position: fixed;
  bottom: 16px;
  z-index: 1980;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--dscc-bg);
  color: var(--dscc-accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .2);
  cursor: pointer;
}
.dscc__float--left { left: 16px; }
.dscc__float--right { right: 16px; }
.dscc--dark .dscc__float { background: #1d1d1f; color: #fff; }

/* Ramka zablokowana do zgody */
.dscc__blocked { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 180px; padding: 20px; border: 1px dashed rgba(0, 0, 0, .25); border-radius: 8px; background: rgba(0, 0, 0, .03); text-align: center; }
.dscc__blocked p { margin: 0; }

.dscc-footer { margin: 0; }
.dscc-footer__link { cursor: pointer; }

@keyframes dscc-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 575px) {
  /* !important: szerokość układu box/cloud (.dscc--box .dscc__banner) ma wyższą specyficzność. */
  .dscc .dscc__banner { left: 8px !important; right: 8px !important; bottom: 8px; top: auto !important; width: auto !important; max-width: none !important; transform: none !important; padding: 16px; display: block; }
  .dscc--bar .dscc__banner { left: 0 !important; right: 0 !important; bottom: 0; }
  .dscc__actions, .dscc--cloud .dscc__actions { flex-direction: column; }
  .dscc__actions .dscc__btn, .dscc__foot .dscc__btn { width: 100%; flex-basis: auto !important; }
  .dscc__foot { flex-direction: column-reverse; }
  .dscc__modal { padding: 0; align-items: flex-end; }
  .dscc__panel { max-height: 92vh; border-radius: var(--dscc-radius) var(--dscc-radius) 0 0; }
  .dscc__cat-desc, .dscc__details { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dscc__banner, .dscc__panel { animation: none; }
  .dscc__slider, .dscc__slider::after, .dscc__btn { transition: none; }
}
