/* Brand colour presets (Platform → Settings → Branding). Each passes WCAG AA for text on its surfaces. */
:root[data-brand=blue],:root[data-brand=blue][data-theme=dark]{--accent:#86b8ff;--button:#6aa6ff;--button-ink:#04203f;--selected:#13294a;--selected-line:#6aa6ff;--message:#17325a;--message-ink:#eaf2ff;--outline:#86b8ff}
:root[data-brand=blue][data-theme=light]{--accent:#1256c2;--button:#1d64d8;--button-ink:#ffffff;--selected:#e6efff;--selected-line:#1d64d8;--message:#dfeafe;--message-ink:#13305e;--outline:#1256c2}
:root[data-brand=violet],:root[data-brand=violet][data-theme=dark]{--accent:#bba3ff;--button:#a98aff;--button-ink:#1d0d45;--selected:#2a1f4a;--selected-line:#a98aff;--message:#2d2350;--message-ink:#f3eeff;--outline:#bba3ff}
:root[data-brand=violet][data-theme=light]{--accent:#6334bd;--button:#6d3fd3;--button-ink:#ffffff;--selected:#f1eaff;--selected-line:#6d3fd3;--message:#ece3ff;--message-ink:#2e1a5c;--outline:#6334bd}
:root[data-brand=teal],:root[data-brand=teal][data-theme=dark]{--accent:#5ee4ed;--button:#2fd0db;--button-ink:#032a2e;--selected:#123b40;--selected-line:#2fd0db;--message:#164248;--message-ink:#e8fdff;--outline:#5ee4ed}
:root[data-brand=teal][data-theme=light]{--accent:#0a6870;--button:#14b8c4;--button-ink:#032a2e;--selected:#e0f8fa;--selected-line:#0e98a3;--message:#d6f5f7;--message-ink:#0d3a3e;--outline:#0a6870}
:root[data-brand=orange],:root[data-brand=orange][data-theme=dark]{--accent:#ffb36b;--button:#ffa14a;--button-ink:#2b1300;--selected:#3d2714;--selected-line:#ffa14a;--message:#44301c;--message-ink:#fff3e6;--outline:#ffb36b}
:root[data-brand=orange][data-theme=light]{--accent:#a04606;--button:#f28c28;--button-ink:#2b1300;--selected:#fff1e4;--selected-line:#d9700d;--message:#ffe9d5;--message-ink:#4a2508;--outline:#a04606}
:root[data-brand=rose],:root[data-brand=rose][data-theme=dark]{--accent:#ff93ad;--button:#ff7598;--button-ink:#3a0614;--selected:#3d1822;--selected-line:#ff7598;--message:#46202b;--message-ink:#ffeef2;--outline:#ff93ad}
:root[data-brand=rose][data-theme=light]{--accent:#ad1238;--button:#d41f4c;--button-ink:#ffffff;--selected:#ffe9ee;--selected-line:#d41f4c;--message:#ffe3ea;--message-ink:#4f0a1d;--outline:#ad1238}
:root[data-brand=slate],:root[data-brand=slate][data-theme=dark]{--accent:#cbd5e1;--button:#e2e8f0;--button-ink:#0f172a;--selected:#253142;--selected-line:#94a3b8;--message:#263244;--message-ink:#f1f5f9;--outline:#cbd5e1}
:root[data-brand=slate][data-theme=light]{--accent:#334155;--button:#1f2937;--button-ink:#ffffff;--selected:#eef1f5;--selected-line:#475569;--message:#e8ecf2;--message-ink:#1e293b;--outline:#334155}

/* Logo image in the header and the colour choice in settings. */
.brandmark.brand-logo{width:auto;max-width:160px}
.brandmark.brand-logo img{display:block;max-height:32px;max-width:160px;width:auto;height:auto;object-fit:contain}
.brand-swatches{display:flex;flex-wrap:wrap;gap:8px}
.brand-swatch{position:relative;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:6px 14px 6px 8px;border:1px solid var(--line);border-radius:22px;background:var(--panel);font-size:13px;cursor:pointer}
.brand-swatch input{position:absolute;opacity:0;width:1px;height:1px}
.brand-swatch:has(input:checked){border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink);font-weight:600}
.brand-swatch:has(input:focus-visible){outline:3px solid var(--outline);outline-offset:2px}
.brand-dot{width:22px;height:22px;border-radius:50%;flex-shrink:0;border:2px solid var(--panel);box-shadow:0 0 0 1px var(--line)}
.brand-swatch[data-swatch=green] .brand-dot{background:#10b876}
.brand-swatch[data-swatch=blue] .brand-dot{background:#1d64d8}
.brand-swatch[data-swatch=violet] .brand-dot{background:#6d3fd3}
.brand-swatch[data-swatch=teal] .brand-dot{background:#14b8c4}
.brand-swatch[data-swatch=orange] .brand-dot{background:#f28c28}
.brand-swatch[data-swatch=rose] .brand-dot{background:#d41f4c}
.brand-swatch[data-swatch=slate] .brand-dot{background:#334155}
.brand-logo-field{display:flex;gap:16px;align-items:flex-start;flex-wrap:wrap}
.brand-logo-field>div{display:flex;flex-wrap:wrap;gap:8px;align-items:center;flex:1;min-width:220px}
.brand-logo-field small{flex-basis:100%}
.brand-logo-field label.btn{cursor:pointer;position:relative}
.brand-logo-field label.btn:has(input:focus-visible){outline:3px solid var(--outline);outline-offset:2px}
.brand-logo-preview{display:grid;place-items:center;width:160px;height:64px;border:1px dashed var(--line);border-radius:8px;background:var(--inset);overflow:hidden;flex-shrink:0}
.brand-logo-preview img{max-width:144px;max-height:48px;object-fit:contain}
.brand-logo-preview.empty{color:var(--muted)}
