/* Shared presentation palette: edit --theme-primary to recolor the shared brand.
   Semantic success/warning/danger values are preserved separately below. */
:root{
  --theme-primary-base:#00777C;
  --theme-primary-hover-base:#006368;
  --theme-primary:var(--theme-primary-base);
  --theme-action-primary:var(--theme-primary-base);
  --theme-action-hover:var(--theme-primary-hover-base);
  --theme-action-ink:#ffffff;
  --theme-open-chat:var(--theme-action-primary);
  --theme-open-chat-hover:var(--theme-action-hover);
  --theme-open-chat-ink:var(--theme-action-ink);
  --theme-chart:var(--theme-primary);
  --theme-on-hover:#ffffff;
  --theme-primary-hover:var(--theme-primary-hover-base);
  --theme-primary-soft:#E0F4F4;
  --theme-brand-text:var(--theme-primary-hover);
  --theme-page:#EBF7F7;
  --theme-surface:#ffffff;
  --surface:var(--theme-surface);
  --theme-surface-2:#F3FAFA;
  --theme-line:#C9DEDE;
  --theme-line-2:#DDECEC;
  --theme-ink:#123638;
  --theme-ink-2:#35585A;
  --theme-ink-3:#526C6E;
  --theme-rail:#004C50;
  --theme-rail-hover:#006064;
  --theme-rail-ink:#F1FFFF;
  --theme-rail-ink-2:#B5D8DA;
  --theme-avatar:#004C50;
  --theme-stat-2:#0E6E70;
  --theme-stat-3:#0F766E;
  --theme-focus:var(--theme-primary);
  --theme-on-primary:#ffffff;
  --theme-shadow-rgb:4,35,38;
  --theme-glass:rgba(255,255,255,.92);
  --theme-glass-edge:rgba(255,255,255,.85);
  --theme-violet:var(--theme-stat-3);
  --theme-violet-soft:var(--theme-primary-soft);
  --theme-toast-bg:#004C50;
  --theme-toast-ink:#ffffff;
}
html[data-theme="night"]{
  --theme-primary:#2FB5B9;
  --theme-on-primary:#000000;
  --theme-brand-text:var(--theme-primary);
  --theme-chart:#71D8D8;
  --theme-primary-soft:#173E41;
  --theme-page:#0B1F21;
  --theme-surface:#10292C;
  --theme-surface-2:#153438;
  --theme-line:#40676A;
  --theme-line-2:#26494C;
  --theme-ink:#EDF9F9;
  --theme-ink-2:#BCD6D8;
  --theme-ink-3:#A0BFC2;
  --theme-avatar:#004C50;
  --theme-focus:var(--theme-primary);
  --theme-glass:rgba(16,41,44,.96);
  --theme-glass-edge:rgba(132,194,198,.3);
}

/* Original non-brand colors, including semantic statuses and neutral overlays. */
:root{
  --color-001:#c62828;
  --color-002:rgba(255,255,255,.36);
  --color-003:rgba(255,255,255,.66);
  --color-004:rgba(255,255,255,.8);
  --color-005:rgba(255,255,255,.95);
  --color-006:rgba(255,255,255,.6);
  --color-007:rgba(var(--theme-shadow-rgb),.6);
  --color-008:rgba(var(--theme-shadow-rgb),.4);
  --color-009:#ff8a8a;
  --color-010:rgba(var(--theme-shadow-rgb),.34);
  --color-011:rgba(255,255,255,.07);
  --color-012:rgba(255,255,255,.12);
  --color-013:rgba(255,255,255,.16);
  --color-014:rgba(var(--theme-shadow-rgb),.28);
  --color-015:rgba(0,0,8,.75);
  --color-016:rgba(0,0,8,.55);
  --color-017:rgba(255,255,255,0);
  --color-018:rgba(var(--theme-shadow-rgb),.22);
  --color-019:rgba(255,255,255,.9);
  --color-020:#000;
  --color-021:rgba(var(--theme-shadow-rgb),.55);
  --color-022:rgba(var(--theme-shadow-rgb),.30);
  --color-023:rgba(var(--theme-shadow-rgb),.5);
  --color-024:rgba(198,40,40,.12);
  --color-025:#fff;
  --color-026:rgba(255,255,255,.32);
  --color-027:rgba(255,255,255,.4);
  --color-028:rgba(var(--theme-shadow-rgb),.94);
  --color-029:rgba(0,0,8,.6);
  --color-030:#0f7a45;
  --color-031:#e8f6ee;
  --color-032:#9a6400;
  --color-033:#fff4e0;
  --color-034:#fdecec;
  --color-035:rgba(var(--theme-shadow-rgb),.18);
  --color-036:#37d39a;
  --color-037:rgba(55,211,154,.14);
  --color-038:#f0b429;
  --color-039:rgba(240,180,41,.14);
  --color-040:rgba(255,138,138,.13);
  --color-041:rgba(0,0,8,.5);
  --color-042:rgba(0,0,8,.7);
  --color-043:rgba(0,0,8,.8);
  --color-044:rgba(255,255,255,.06);
  --color-045:rgba(255,255,255,.18);
  --color-046:rgba(255,255,255,.34);
  --color-047:rgba(255,255,255,.1);
  --color-048:rgba(255,90,90,.16);
  --color-049:rgba(255,120,120,.42);
  --color-050:#1faa59;
  --color-051:#e0a020;
  --color-052:rgba(224,160,32,.22);
  --color-053:#dc2626;
  --color-054:rgba(0,0,0,.25);
  --color-055:rgba(192,57,43,.1);
  --color-056:#c0392b;
  --color-057:rgba(192,57,43,.4);
  --color-058:rgba(230,160,20,.5);
  --color-059:rgba(230,160,20,.09);
  --color-060:rgba(230,160,20,.1);
  --color-061:#e5484d;
  --color-062:rgba(229,72,77,.2);
  --color-063:#12864d;
  --color-064:#3a2a00;
  --color-065:rgba(var(--theme-shadow-rgb),.32);
  --color-066:rgba(255,255,255,.45);
  --color-067:rgba(255,255,255,.10);
  --color-068:#586577;
  --color-069:rgba(0,0,0,.5);
  --color-070:rgba(240,180,41,.42);
  --color-071:rgba(214,148,18,.85);
  --color-072:rgba(220,38,38,.12);
  --color-073:rgba(234,179,8,.14);
  --color-074:rgba(234,179,8,.5);
  --color-075:#b8860b;
  --color-076:rgba(220,38,38,.14);
  --color-077:rgba(255,255,255,.08);
  --color-078:rgba(var(--theme-shadow-rgb),.7);
  --color-079:rgba(255,255,255,.22);
  --color-080:rgba(255,255,255,.2);
  --color-081:rgba(255,90,90,.2);
  --color-082:#ff9b9b;
  --color-083:rgba(var(--theme-shadow-rgb),.9);
  --color-084:rgba(var(--theme-shadow-rgb),.07);
  --color-085:#e3e6ea;
  --color-086:rgba(255,213,0,.38);
  --color-087:rgba(226,158,0,.72);
  --color-088:rgba(255,221,60,.30);
  --color-089:rgba(255,221,60,.6);
  --color-090:rgba(var(--theme-shadow-rgb),.20);
  --color-091:rgba(240,180,41,.7);
  --color-092:rgba(var(--theme-shadow-rgb),.42);
  --color-093:#b42318;
  --color-094:rgba(198,40,40,.5);
  --color-095:#fff7ed;
  --color-096:#fed7aa;
  --color-097:#9a3412;
  --color-098:rgba(0,0,0,.04);
  --color-099:#d4d8de;
  --color-100:rgba(8,12,20,.86);
  --color-101:rgba(0,0,0,.55);
  --color-102:#cdd6e4;
  --color-103:rgba(0,0,0,.4);
  --color-104:#b04318;
  --color-105:#6b7280;
}

/* Shared interaction rules; selectors cover inline provider forms and native controls. */
input,textarea,select{color:var(--ink);accent-color:var(--theme-primary)}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]),textarea,select{background-color:var(--surface,var(--theme-surface))}
:where(button,a,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--theme-focus);outline-offset:3px}
input:focus,textarea:focus,select:focus{border-color:var(--theme-focus)}
.btn-primary,.mbtn-primary,.fab,.prov-tab.on,.send-btn,.nav-add{background:var(--theme-primary);color:var(--theme-on-primary)}
.btn-primary:hover,.mbtn-primary:hover,.fab:hover,.prov-tab.on:hover,.send-btn:hover,.nav-add:hover{background:var(--theme-primary-hover);color:var(--theme-on-hover);filter:none}
.sidebar .nav-item:hover{background:var(--theme-rail-hover)}
.sidebar .nav-item.active{background:var(--theme-primary);color:var(--theme-on-primary)}
.toast{background:var(--theme-toast-bg);color:var(--theme-toast-ink)}
.track>i{background:var(--theme-primary)}
/* Teal actions use AA foregrounds; links use a lighter foreground at night. */
html[data-theme="night"] .msg.user .bubble{background:var(--theme-primary);color:var(--theme-on-primary)}
body:has(.remember) .btn{background:var(--theme-action-primary);color:var(--theme-action-ink)}
body:has(.remember) .btn:hover{background:var(--theme-action-hover)}

/* Light actions use white text; brighter night accents use dark text. */
.msg.user .bubble,.cpv-thumb.cpv-ph,.cite:hover,.cite-badge:hover,.wiz-dot.on{color:var(--theme-on-primary)}
.sidebar .nav-item.active svg{stroke:currentColor}
body:has(.remember) .btn:hover{color:var(--theme-action-ink)}
.cap-item input{accent-color:var(--theme-primary)}

/* Solid login panel keeps text contrast independent of the background video. */
body:has(.remember) .panel{background:var(--theme-surface)}

input::placeholder,textarea::placeholder{color:var(--theme-ink-3);opacity:1}
input:focus::placeholder,textarea:focus::placeholder{color:transparent}

/* AA foregrounds for controls affected by the brighter night primary. */
html[data-theme="night"] .toast{background:var(--theme-toast-bg);color:var(--theme-toast-ink)}
html[data-theme="night"] .switch.on::after{background:var(--theme-on-primary)}
html[data-theme="night"] .remember input:checked::after{border-color:var(--theme-on-primary)}

/* Shared AA action colors: Sign in, Open Chat and the floating plus. */
.fab,body:has(.remember) #loginForm .btn{background:var(--theme-action-primary);color:var(--theme-action-ink)}
.fab:hover,body:has(.remember) #loginForm .btn:hover{background:var(--theme-action-hover);color:var(--theme-action-ink)}

/* Sidebar history search belongs to the dark rail in both themes. */
#sidebar .hist-search input{background:transparent;border:0;box-shadow:none;color:var(--rail-ink)}
.sidebar .hist-search input::placeholder{color:var(--rail-ink-2);opacity:1}
.sidebar .hist-search input:focus::placeholder{color:transparent}

#sidebar .hist-search:focus-within{border-color:var(--rail-ink-2);box-shadow:0 0 0 2px color-mix(in srgb,var(--rail-ink-2) 24%,transparent)}
