/* =========================================================
   Baner zgód — style samodzielne.
   Każdy kolor ma fallback: jeśli motyw definiuje własne zmienne
   (--accent, --text, --border…), baner je przejmie; jeśli nie,
   użyje wartości neutralnych. Dzięki temu wtyczka wygląda sensownie
   od razu po wgraniu na dowolną stronę.
   ========================================================= */

.dmc {
    --dmc-accent:  var(--accent, #2563eb);
    --dmc-bg:      var(--bg-card, #ffffff);
    --dmc-soft:    var(--bg-soft, #f7f8fa);
    --dmc-text:    var(--text, #1a1a2e);
    --dmc-text-2:  var(--text-secondary, #4a4a5e);
    --dmc-text-3:  var(--text-tertiary, #6e6e88);
    --dmc-border:  var(--border, #e8e8ec);
    --dmc-radius:  var(--radius-lg, 12px);
    --dmc-font:    var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}
.dmc[hidden] { display: none; }
.dmc * { box-sizing: border-box; }

/* ---------- pasek ---------- */
.dmc__bar {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 40px);
    /* min() zamiast samego max-width — przy left+right przegladarka potrafi
       rozwiazac szerokosc z tresci i pasek wystaje poza ekran. */
    max-width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(18px, 2.4vw, 26px) clamp(20px, 2.6vw, 30px);
    background: var(--dmc-bg);
    border: 1px solid var(--dmc-border);
    border-radius: var(--dmc-radius);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.3);
    font-family: var(--dmc-font);
    animation: dmc-in 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.dmc__bar[hidden] { display: none; }
.dmc--center .dmc__bar { top: 50%; bottom: auto; transform: translateY(-50%); max-width: min(560px, calc(100% - 32px)); flex-direction: column; align-items: stretch; }

@keyframes dmc-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.dmc__title { margin: 0 0 6px; font-size: 1rem; font-weight: 700; color: var(--dmc-text); line-height: 1.3; }
.dmc__text p { margin: 0; font-size: 0.875rem; line-height: 1.65; color: var(--dmc-text-2); max-width: 68ch; }
.dmc__text a { color: var(--dmc-accent); }

.dmc__actions { display: flex; align-items: center; gap: 10px; flex: none; flex-wrap: wrap; }

/* Przyciski maja wlasne style — nie zakladamy, ze motyw ma klase .btn. */
.dmc__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;              /* wygodny cel dotyku */
    padding: 11px 20px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    border-radius: 100px;
    border: 1.5px solid transparent;
    cursor: pointer;
    white-space: normal;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.dmc__btn--primary { background: var(--dmc-accent); color: #fff; }
.dmc__btn--primary:hover { filter: brightness(0.92); }
/* „Odrzuc” ma te sama wage wizualna co „Akceptuj” — inaczej zgoda nie jest
   dobrowolna w rozumieniu RODO (motyw ciemnego wzorca). */
.dmc__btn--ghost { background: transparent; color: var(--dmc-text); border-color: var(--dmc-border); }
.dmc__btn--ghost:hover { border-color: var(--dmc-accent); color: var(--dmc-accent); }

.dmc__more {
    background: none; border: 0; padding: 8px 2px;
    font-family: inherit; font-size: 0.8125rem; font-weight: 500;
    color: var(--dmc-text-3); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.dmc__more:hover { color: var(--dmc-accent); }

/* ---------- panel ---------- */
.dmc__overlay {
    position: fixed; inset: 0; z-index: 2147483001;
    display: grid; place-items: center; padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    font-family: var(--dmc-font);
}
.dmc__overlay[hidden] { display: none; }

.dmc__panel {
    width: min(620px, 100%);
    max-height: min(86vh, 760px);
    display: flex; flex-direction: column;
    background: var(--dmc-bg);
    border-radius: var(--dmc-radius);
    box-shadow: 0 32px 80px -30px rgba(0, 0, 0, 0.55);
    animation: dmc-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.dmc__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--dmc-border); }
.dmc__head h2 { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--dmc-text); }
.dmc__close { flex: none; width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 1px solid var(--dmc-border); border-radius: 50%; color: var(--dmc-text-3); cursor: pointer; }
.dmc__close:hover { color: var(--dmc-text); }

.dmc__body { padding: 22px 24px; overflow-y: auto; }
.dmc__intro { margin: 0 0 20px; font-size: 0.875rem; line-height: 1.65; color: var(--dmc-text-2); }

.dmc__cat { padding: 16px 0; border-top: 1px solid var(--dmc-border); }
.dmc__cat p { margin: 10px 0 0; font-size: 0.8125rem; line-height: 1.68; color: var(--dmc-text-2); }
.dmc__cat-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dmc__cat-name { font-size: 0.9375rem; font-weight: 600; color: var(--dmc-text); }
.dmc__always { font-size: 0.75rem; font-weight: 600; color: var(--dmc-accent); background: color-mix(in srgb, var(--dmc-accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--dmc-accent) 25%, transparent); padding: 3px 10px; border-radius: 100px; }

.dmc__switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; cursor: pointer; }
.dmc__switch input { position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer; }
.dmc__slider { position: relative; flex: none; width: 44px; height: 24px; border-radius: 100px; background: var(--dmc-border); transition: background 0.2s ease; }
.dmc__slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform 0.2s ease; }
.dmc__switch input:checked ~ .dmc__slider { background: var(--dmc-accent); }
.dmc__switch input:checked ~ .dmc__slider::after { transform: translateX(20px); }
.dmc__switch input:focus-visible ~ .dmc__slider { outline: 2px solid var(--dmc-accent); outline-offset: 3px; }

.dmc__note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--dmc-border); font-size: 0.75rem; line-height: 1.6; color: var(--dmc-text-3); }
.dmc__note code { font-size: 0.6875rem; word-break: break-all; }

.dmc__foot { display: flex; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--dmc-border); background: var(--dmc-soft); border-radius: 0 0 var(--dmc-radius) var(--dmc-radius); }
.dmc__foot .dmc__btn { flex: 1; }

@media (max-width: 860px) {
    .dmc__bar { left: 10px; right: 10px; bottom: 10px; max-width: calc(100% - 20px); flex-direction: column; align-items: stretch; gap: 18px; }
    .dmc__actions { flex-direction: column; align-items: stretch; }
    .dmc__more { align-self: center; }
    .dmc__foot { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .dmc__bar, .dmc__panel { animation: none; } }
