/* v2.4.0 – Calendar layers (Subscriptions, Network repairs), the Calendar tick boxes and the Settings "Calendar colours" cards.
   Every rule is scoped under a .cl-* class, so the rest of the Calendar and Settings keep today's look; style.css is not changed.
   The colours are the fixed list in web/calendar_rules.js (COLOURS; tests/test_web.py checks the two agree). No red: red stays for Delete and errors.
   A colour class (cl-sub-<colour> / cl-rep-<colour>) sets three shades; a palette class (cl-subp-<palette> / cl-repp-<palette>) decides how they are used. */
.cl-sub-purple{--cl-sub-dk:#6d28d9;--cl-sub-md:#8b5cf6;--cl-sub-lt:#ede9fe} .cl-rep-purple{--cl-rep-dk:#6d28d9;--cl-rep-md:#8b5cf6;--cl-rep-lt:#ede9fe}
.cl-sub-teal{--cl-sub-dk:#0f766e;--cl-sub-md:#14b8a6;--cl-sub-lt:#ccfbf1} .cl-rep-teal{--cl-rep-dk:#0f766e;--cl-rep-md:#14b8a6;--cl-rep-lt:#ccfbf1}
.cl-sub-blue{--cl-sub-dk:#1d4ed8;--cl-sub-md:#3b82f6;--cl-sub-lt:#dbeafe} .cl-rep-blue{--cl-rep-dk:#1d4ed8;--cl-rep-md:#3b82f6;--cl-rep-lt:#dbeafe}
.cl-sub-indigo{--cl-sub-dk:#4338ca;--cl-sub-md:#6366f1;--cl-sub-lt:#e0e7ff} .cl-rep-indigo{--cl-rep-dk:#4338ca;--cl-rep-md:#6366f1;--cl-rep-lt:#e0e7ff}
.cl-sub-green{--cl-sub-dk:#15803d;--cl-sub-md:#22c55e;--cl-sub-lt:#dcfce7} .cl-rep-green{--cl-rep-dk:#15803d;--cl-rep-md:#22c55e;--cl-rep-lt:#dcfce7}
.cl-sub-cyan{--cl-sub-dk:#0e7490;--cl-sub-md:#06b6d4;--cl-sub-lt:#cffafe} .cl-rep-cyan{--cl-rep-dk:#0e7490;--cl-rep-md:#06b6d4;--cl-rep-lt:#cffafe}
.cl-sub-amber{--cl-sub-dk:#92400e;--cl-sub-md:#f59e0b;--cl-sub-lt:#fef3c7} .cl-rep-amber{--cl-rep-dk:#92400e;--cl-rep-md:#f59e0b;--cl-rep-lt:#fef3c7}
.cl-sub-slate{--cl-sub-dk:#334155;--cl-sub-md:#64748b;--cl-sub-lt:#e2e8f0} .cl-rep-slate{--cl-rep-dk:#334155;--cl-rep-md:#64748b;--cl-rep-lt:#e2e8f0}
.cl-subp-soft .ci.sub{background:var(--cl-sub-lt);border-left-color:var(--cl-sub-md);color:var(--c-text)}
.cl-subp-line .ci.sub{background:transparent;border-left-color:var(--cl-sub-dk);color:var(--cl-sub-dk)}
.cl-subp-strong .ci.sub{background:var(--cl-sub-dk);border-left-color:var(--cl-sub-dk);color:var(--c-white)}
.cl-repp-soft .ci.rep{background:var(--cl-rep-lt);border-left-color:var(--cl-rep-md);color:var(--c-text)}
.cl-repp-line .ci.rep{background:transparent;border-left-color:var(--cl-rep-dk);color:var(--cl-rep-dk)}
.cl-repp-strong .ci.rep{background:var(--cl-rep-dk);border-left-color:var(--cl-rep-dk);color:var(--c-white)}
.cl-cal .ci:is(.sub,.rep) .ct,.cl-cal table.cal tr.open .ci:is(.sub,.rep) .cna,.cl-set .ci:is(.sub,.rep) .cna{color:inherit;opacity:.85}
.cl-cal .ci.rep.cl-done,.cl-set .ci.rep.cl-done{opacity:.55}
.cl-cal .ci.rep.cl-done .cn{text-decoration:none}
.cl-cal .calkey .ci:is(.sub,.rep),.cl-set .ci:is(.sub,.rep){display:inline-flex}

/* the tick boxes at the top of the Calendar (in the calbar) */
.cl-ticks{display:inline-flex;align-items:center;gap:0.25rem 0.75rem;flex-wrap:wrap;font-size:0.8125rem;color:var(--c-text);background:var(--c-white);border:var(--card-bw) solid var(--card-bc);
  border-radius:0.5rem;padding:0.25rem 0.625rem}
.cl-ticks .cl-tlabel{color:var(--c-muted)}
.cl-ticks .cl-tick{display:inline-flex;flex-direction:row;align-items:center;color:var(--c-text);font-size:0.8125rem;gap:0.3125rem;cursor:pointer;white-space:nowrap}
.cl-ticks .cl-tick input{margin:0;width:auto;accent-color:var(--c-brand)}
.cl-ticks .cl-sublist{display:inline-flex;gap:0.625rem;padding-left:0.625rem;border-left:1px solid var(--c-line)}
.cl-ticks .cl-tick.cl-off{color:var(--c-muted);cursor:default}
.cl-ticks .cl-dot{display:inline-block;width:0.625rem;height:0.625rem;border-radius:0.1875rem;border:1px solid var(--c-line);background:var(--st-active-bg)}
.cl-ticks .cl-dot.sub{background:var(--cl-sub-md);border-color:var(--cl-sub-dk)} .cl-ticks .cl-dot.rep{background:var(--cl-rep-md);border-color:var(--cl-rep-dk)}
.cl-ticks .cl-dot.rep.cl-done{opacity:.55}

/* Settings: one card per module with the colour and the palette */
.cl-set .cl-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(20rem,1fr));gap:0.75rem}
.cl-set .cl-card{margin:0}
.cl-set .cl-swatches{border:0;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:0.375rem}
.cl-set .cl-swatches legend{font-size:0.8125rem;color:var(--c-muted);padding:0;margin:0 0 0.25rem}
.cl-set .cl-swatch{display:inline-flex;flex-direction:row;align-items:center;color:var(--c-text);gap:0.3125rem;font-size:0.8125rem;border:1px solid var(--c-line);border-radius:0.5rem;padding:0.25rem 0.5rem;cursor:pointer}
.cl-set .cl-swatch:has(input:checked){border-color:var(--c-brand);box-shadow:0 0 0 1px var(--c-brand)}
.cl-set .cl-swatch input{margin:0;width:auto}
.cl-set .cl-sw{display:inline-block;width:0.875rem;height:0.875rem;border-radius:0.25rem}
.cl-set .cl-form{display:flex;flex-direction:column;gap:0.75rem;margin:0}
.cl-set .cl-preview{display:flex;flex-direction:column;gap:0.25rem;font-size:0.8125rem;color:var(--c-muted);margin:0}
.cl-set .cl-preview .ci{max-width:100%}
.cl-set .cl-sw-purple{background:#8b5cf6;border:1px solid #6d28d9}
.cl-set .cl-sw-teal{background:#14b8a6;border:1px solid #0f766e}
.cl-set .cl-sw-blue{background:#3b82f6;border:1px solid #1d4ed8}
.cl-set .cl-sw-indigo{background:#6366f1;border:1px solid #4338ca}
.cl-set .cl-sw-green{background:#22c55e;border:1px solid #15803d}
.cl-set .cl-sw-cyan{background:#06b6d4;border:1px solid #0e7490}
.cl-set .cl-sw-amber{background:#f59e0b;border:1px solid #92400e}
.cl-set .cl-sw-slate{background:#64748b;border:1px solid #334155}
@media print{.cl-ticks{display:none!important}}
