/* The notice sits above page content but under Toastr and the confirmation layer, so a dialog raised from it is never covered. */
.ck-notice { position: fixed; left: 20px; bottom: 20px; z-index: 1250; width: min(440px, calc(100vw - 40px)); padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-elev, var(--navy-950)); box-shadow: 0 18px 48px rgba(0, 0, 0, .4); }
.ck-notice-text { margin: 0 0 14px; font-size: 13.5px; line-height: 1.65; color: var(--ink-dim); }
.ck-notice-text b { color: var(--ink); font-weight: 600; }
.ck-notice-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.ck-notice-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.ck-prefs-overlay { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(4, 12, 24, .68); }
.ck-prefs { display: flex; flex-direction: column; width: min(640px, 100%); max-height: min(84vh, 760px); border: 1px solid var(--line); border-radius: 16px; background: var(--bg-elev, var(--navy-950)); overflow: hidden; }

.ck-prefs-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.ck-prefs-head h2 { margin: 0; font-size: 17px; color: var(--ink); }
.ck-prefs-close { border: 0; background: none; color: var(--ink-faint); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.ck-prefs-close:hover { color: var(--ink); }

.ck-prefs-body { padding: 20px 22px; overflow-y: auto; font-size: 13.5px; line-height: 1.7; color: var(--ink-dim); }
.ck-prefs-body > p { margin: 0 0 18px; }

.ck-cat { padding: 16px 0; border-top: 1px solid var(--line); }
.ck-cat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ck-cat-name { color: var(--ink); font-weight: 600; }
.ck-cat-status { margin-left: auto; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.ck-cat-desc { margin: 8px 0 0; }
.ck-cat.is-empty .ck-cat-name { color: var(--ink-dim); }

.ck-state { width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line); flex: none; }
.ck-state.on { background: var(--accent); border-color: var(--accent); }
/* An empty category has nothing to switch, so it must not look like a box waiting to be ticked. */
.ck-none { width: 16px; text-align: center; color: var(--ink-faint); flex: none; }

.ck-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-input); color: var(--ink-dim); font-size: 11.5px; font-weight: 600; }

.ck-details { margin-top: 12px; }
.ck-details summary { cursor: pointer; color: var(--accent); font-size: 12.5px; }
.ck-cookie-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.ck-cookie-list li { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-input); }
.ck-cookie-list code { color: var(--ink); font-size: 12.5px; }
.ck-cookie-by { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.ck-cookie-what { font-size: 13px; }
.ck-cookie-meta { font-size: 12px; color: var(--ink-faint); }

.ck-prefs-note { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; }
.ck-prefs-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.ck-prefs-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--bg-input); }

@media (max-width: 560px) {
    .ck-notice { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 16px; }
    .ck-notice-actions .lc-btn { flex: 1; }
    .ck-prefs-overlay { padding: 0; align-items: flex-end; }
    .ck-prefs { max-height: 90vh; border-radius: 16px 16px 0 0; }
    .ck-cat-status { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
    .ck-notice { animation: ck-rise .28s var(--ease, ease-out) both; }
    @keyframes ck-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

.ck-config { display: none; }

/* The toggle is a real checkbox under a drawn track, so it stays keyboard-operable and follows the theme. */
.ck-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.ck-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ck-switch-track { position: relative; width: 38px; height: 21px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-input); transition: background .16s var(--ease, ease), border-color .16s var(--ease, ease); flex: none; }
.ck-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--ink-faint); transition: transform .16s var(--ease, ease), background .16s var(--ease, ease); }
.ck-switch input:checked + .ck-switch-track { background: var(--accent); border-color: var(--accent); }
.ck-switch input:checked + .ck-switch-track::after { transform: translateX(17px); background: var(--navy-950); }
.ck-switch input:focus-visible + .ck-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .ck-switch-track, .ck-switch-track::after { transition: none; }
}
