/* SOHBERA COLOR PRO — stronger palettes, consistent contrast and editable accents.
   Loaded after the original theme styles. No IRC nick/mIRC message colors are overwritten. */
html[data-theme] { --theme-border: var(--theme-line); --theme-soft: var(--theme-surface-2);
  --theme-on-brand: #fff; --sohbera-active-share: 17%; --sohbera-hover-share: 9%; --sohbera-panel-tint: 12%; }
html[data-color-intensity="balanced"] { --sohbera-active-share: 10%; --sohbera-hover-share: 6%; --sohbera-panel-tint: 7%; }
html[data-color-intensity="vivid"] { --sohbera-active-share: 17%; --sohbera-hover-share: 9%; --sohbera-panel-tint: 12%; }
html[data-color-intensity="bold"] { --sohbera-active-share: 27%; --sohbera-hover-share: 15%; --sohbera-panel-tint: 18%; }

html[data-theme="light"] {
  --theme-bg: #EAF0F7;
  --theme-surface: #FFFFFF;
  --theme-surface-2: #F0F5FB;
  --theme-input: #F5F9FE;
  --theme-hover: #E5F0FC;
  --theme-rail: #E8F1FB;
  --theme-chat: #FFFFFF;
  --theme-topic: #EDF6FF;
  --theme-line: #C7D5E5;
  --theme-line-2: #DBE5F1;
  --theme-text: #12233B;
  --theme-message: #1E314B;
  --theme-muted: #536782;
  --theme-faint: #7185A0;
  --theme-brand: #0A3F8F;
  --theme-accent: #008E9A;
  --theme-brand-soft: #D9E9FD;
  --theme-avatar: #DCEBFC;
  --theme-avatar-text: #124A8A;
  --theme-panel-copy: #EFF5FC;
  --theme-scroll: #9DAFC4;
  --theme-elevated: var(--theme-surface);
  --theme-bot: var(--theme-surface-2); --theme-bot-line: var(--theme-accent);
  --theme-shadow: rgba(23,47,76,.16); --theme-overlay: color-mix(in srgb,var(--theme-bg) 96%,transparent);
}

html[data-theme="dark"] {
  --theme-bg: #101B29;
  --theme-surface: #172638;
  --theme-surface-2: #1D3147;
  --theme-input: #1E3349;
  --theme-hover: #26435A;
  --theme-rail: #132638;
  --theme-chat: #172638;
  --theme-topic: #1B3044;
  --theme-line: #365269;
  --theme-line-2: #2B455C;
  --theme-text: #F0F6FF;
  --theme-message: #E1ECF8;
  --theme-muted: #BDD0E0;
  --theme-faint: #91A9BF;
  --theme-brand: #4DD9CE;
  --theme-accent: #69D6A7;
  --theme-brand-soft: #214E57;
  --theme-avatar: #29465C;
  --theme-avatar-text: #E9F6FF;
  --theme-panel-copy: #223A50;
  --theme-scroll: #587087;
  --theme-elevated: var(--theme-surface);
  --theme-bot: var(--theme-surface-2); --theme-bot-line: var(--theme-accent);
  --theme-shadow: rgba(23,47,76,.16); --theme-overlay: color-mix(in srgb,var(--theme-bg) 96%,transparent);
}

html[data-theme="ocean"] {
  --theme-bg: #DBEFF9;
  --theme-surface: #FFFFFF;
  --theme-surface-2: #E9F5FC;
  --theme-input: #F0F9FE;
  --theme-hover: #D7EFFB;
  --theme-rail: #DFEFF8;
  --theme-chat: #FFFFFF;
  --theme-topic: #E2F5FF;
  --theme-line: #B3D6E7;
  --theme-line-2: #D0E6F1;
  --theme-text: #12334A;
  --theme-message: #21485D;
  --theme-muted: #4B6C80;
  --theme-faint: #6D91A4;
  --theme-brand: #086B96;
  --theme-accent: #0A88BD;
  --theme-brand-soft: #CDECFA;
  --theme-avatar: #D0ECF9;
  --theme-avatar-text: #165777;
  --theme-panel-copy: #E6F4FB;
  --theme-scroll: #95C1D7;
  --theme-elevated: var(--theme-surface);
  --theme-bot: var(--theme-surface-2); --theme-bot-line: var(--theme-accent);
  --theme-shadow: rgba(23,47,76,.16); --theme-overlay: color-mix(in srgb,var(--theme-bg) 96%,transparent);
}

html[data-theme="forest"] {
  --theme-bg: #E0EFE3;
  --theme-surface: #FFFFFF;
  --theme-surface-2: #EAF5ED;
  --theme-input: #F3FAF5;
  --theme-hover: #DAF0E0;
  --theme-rail: #E1F0E6;
  --theme-chat: #FFFFFF;
  --theme-topic: #E6F5EA;
  --theme-line: #BDD8C5;
  --theme-line-2: #D7EADD;
  --theme-text: #183827;
  --theme-message: #244836;
  --theme-muted: #536F5F;
  --theme-faint: #78917F;
  --theme-brand: #18663D;
  --theme-accent: #16936C;
  --theme-brand-soft: #D3EDDD;
  --theme-avatar: #D9EFDF;
  --theme-avatar-text: #1E6341;
  --theme-panel-copy: #EAF6ED;
  --theme-scroll: #A0C2AA;
  --theme-elevated: var(--theme-surface);
  --theme-bot: var(--theme-surface-2); --theme-bot-line: var(--theme-accent);
  --theme-shadow: rgba(23,47,76,.16); --theme-overlay: color-mix(in srgb,var(--theme-bg) 96%,transparent);
}

html[data-theme="sunset"] {
  --theme-bg: #FAE8DC;
  --theme-surface: #FFFCF8;
  --theme-surface-2: #FFF0E7;
  --theme-input: #FFF7F1;
  --theme-hover: #FCE3D4;
  --theme-rail: #FBE9DE;
  --theme-chat: #FFFCF9;
  --theme-topic: #FFF0E5;
  --theme-line: #EBC7B4;
  --theme-line-2: #F2DDCF;
  --theme-text: #482B20;
  --theme-message: #603A2B;
  --theme-muted: #855A48;
  --theme-faint: #A77C69;
  --theme-brand: #AD431D;
  --theme-accent: #D76826;
  --theme-brand-soft: #F9DED0;
  --theme-avatar: #F6DFD1;
  --theme-avatar-text: #8D421F;
  --theme-panel-copy: #FFF0E8;
  --theme-scroll: #D6AF9B;
  --theme-elevated: var(--theme-surface);
  --theme-bot: var(--theme-surface-2); --theme-bot-line: var(--theme-accent);
  --theme-shadow: rgba(23,47,76,.16); --theme-overlay: color-mix(in srgb,var(--theme-bg) 96%,transparent);
}

html[data-theme="violet"] {
  --theme-bg: #ECE4FA;
  --theme-surface: #FFFFFF;
  --theme-surface-2: #F3EDFC;
  --theme-input: #F8F4FF;
  --theme-hover: #EADFFA;
  --theme-rail: #EDE7FA;
  --theme-chat: #FFFFFF;
  --theme-topic: #F1EAFD;
  --theme-line: #D5C6EB;
  --theme-line-2: #E8DCF7;
  --theme-text: #2E2347;
  --theme-message: #43365E;
  --theme-muted: #6F5B89;
  --theme-faint: #957EB0;
  --theme-brand: #6335B4;
  --theme-accent: #8856DD;
  --theme-brand-soft: #E8DDFB;
  --theme-avatar: #E8DDF8;
  --theme-avatar-text: #5C398B;
  --theme-panel-copy: #F3EDFC;
  --theme-scroll: #BDABD8;
  --theme-elevated: var(--theme-surface);
  --theme-bot: var(--theme-surface-2); --theme-bot-line: var(--theme-accent);
  --theme-shadow: rgba(23,47,76,.16); --theme-overlay: color-mix(in srgb,var(--theme-bg) 96%,transparent);
}

html[data-theme="rose"] {
  --theme-bg: #FAE5EF;
  --theme-surface: #FFFFFF;
  --theme-surface-2: #FFF0F6;
  --theme-input: #FFF7FA;
  --theme-hover: #FCDFEB;
  --theme-rail: #F9E8F0;
  --theme-chat: #FFFFFF;
  --theme-topic: #FFEDF5;
  --theme-line: #EAC0D1;
  --theme-line-2: #F4D9E5;
  --theme-text: #4B2237;
  --theme-message: #623347;
  --theme-muted: #8C526D;
  --theme-faint: #AD7991;
  --theme-brand: #B12C64;
  --theme-accent: #DA4B8A;
  --theme-brand-soft: #F8D8E7;
  --theme-avatar: #F5DCE7;
  --theme-avatar-text: #96335B;
  --theme-panel-copy: #FFF0F6;
  --theme-scroll: #D7A7BB;
  --theme-elevated: var(--theme-surface);
  --theme-bot: var(--theme-surface-2); --theme-bot-line: var(--theme-accent);
  --theme-shadow: rgba(23,47,76,.16); --theme-overlay: color-mix(in srgb,var(--theme-bg) 96%,transparent);
}

html[data-theme="whatsapp"] {
  --theme-bg: #DEEFE6;
  --theme-surface: #FFFFFF;
  --theme-surface-2: #EAF6EF;
  --theme-input: #F2FAF5;
  --theme-hover: #D8F0E2;
  --theme-rail: #DFEFE5;
  --theme-chat: #FFFFFF;
  --theme-topic: #E4F5EA;
  --theme-line: #BBD9C9;
  --theme-line-2: #D4E9DD;
  --theme-text: #193B2A;
  --theme-message: #284C3B;
  --theme-muted: #527560;
  --theme-faint: #739887;
  --theme-brand: #08734B;
  --theme-accent: #159C6B;
  --theme-brand-soft: #D3F0DF;
  --theme-avatar: #D8F0E2;
  --theme-avatar-text: #125E3F;
  --theme-panel-copy: #E9F7EE;
  --theme-scroll: #9DC9AD;
  --theme-elevated: var(--theme-surface);
  --theme-bot: var(--theme-surface-2); --theme-bot-line: var(--theme-accent);
  --theme-shadow: rgba(23,47,76,.16); --theme-overlay: color-mix(in srgb,var(--theme-bg) 96%,transparent);
}

html[data-theme="dark"] { --theme-shadow: rgba(0,0,0,.34); --theme-on-brand: #07343B; }
/* Stronger selected states, without overriding individual nick colours. */
html[data-theme] .rail-btn.active {
  background: color-mix(in srgb,var(--theme-brand) var(--sohbera-active-share),var(--theme-rail));
  color:var(--theme-brand);
  box-shadow:inset 3px 0 0 var(--theme-accent);
}
html[data-theme] .rail-btn:hover:not(.active) {
  background:color-mix(in srgb,var(--theme-brand) var(--sohbera-hover-share),var(--theme-rail));
  color:var(--theme-brand);
}
html[data-theme] .room.active,html[data-theme] .dm.active {
  background:color-mix(in srgb,var(--theme-brand) var(--sohbera-active-share),var(--theme-surface-2));
  box-shadow:inset 3px 0 0 var(--theme-accent);
}
html[data-theme] .room:hover:not(.active),html[data-theme] .dm:hover:not(.active) {
  background:color-mix(in srgb,var(--theme-brand) var(--sohbera-hover-share),var(--theme-surface-2));
}
html[data-theme] .room.active .room-copy b,html[data-theme] .dm.active b {color:var(--theme-brand)}
html[data-theme] .room.active .room-mark {
  background:color-mix(in srgb,var(--theme-brand) 20%,var(--theme-surface));color:var(--theme-brand);
}
html[data-theme] .people-btn.active,html[data-theme] .theme-card.active {
  background:color-mix(in srgb,var(--theme-brand) var(--sohbera-panel-tint),var(--theme-surface));
  color:var(--theme-brand);border-color:color-mix(in srgb,var(--theme-brand) 48%,var(--theme-line));
}
html[data-theme] .person:hover,html[data-theme] .icon-btn:hover,html[data-theme] .reactions button:hover,
html[data-theme] .message:hover {background:color-mix(in srgb,var(--theme-accent) var(--sohbera-hover-share),var(--theme-surface))}
html[data-theme] .send,html[data-theme] .profile-primary,html[data-theme] .theme-editor-primary {
  background:var(--theme-brand);color:var(--theme-on-brand);
}
html[data-theme] .send:hover,html[data-theme] .profile-primary:hover:not(:disabled) {
  filter:brightness(1.07);
}
html[data-theme] .composer-box:focus-within,html[data-theme] .quick-search:focus-within,
html[data-theme] .people-search:focus-within {
  border-color:var(--theme-accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-accent) 15%,transparent);
}
html[data-theme] .topic-bar {border-left:3px solid var(--theme-accent)}
html[data-theme] .channel-icon {
  background:color-mix(in srgb,var(--theme-brand) 15%,var(--theme-surface));
  color:var(--theme-brand);
}
html[data-theme] .moment-ring {border-color:var(--theme-accent)}
html[data-theme] .theme-card.active>em {background:var(--theme-brand);color:var(--theme-on-brand)}
html[data-theme] .theme-panel-copy {border-left:3px solid var(--theme-accent)}
html[data-theme] .theme-editor-live .tel-chat:after {
  content:"";position:absolute;right:10px;bottom:9px;width:38px;height:10px;
  border-radius:6px;background:var(--theme-accent);opacity:.8;
}
/* Palette previews match the real theme more closely */
.tp-light i:nth-child(1) {background:#E8F1FB}
.tp-light i:nth-child(2) {background:#F0F5FB}
.tp-light i:nth-child(3) {background:#FFFFFF}
.tp-light {box-shadow:inset 0 4px 0 #0A3F8F}
.tp-dark i:nth-child(1) {background:#132638}
.tp-dark i:nth-child(2) {background:#1D3147}
.tp-dark i:nth-child(3) {background:#172638}
.tp-dark {box-shadow:inset 0 4px 0 #4DD9CE}
.tp-ocean i:nth-child(1) {background:#DFEFF8}
.tp-ocean i:nth-child(2) {background:#E9F5FC}
.tp-ocean i:nth-child(3) {background:#FFFFFF}
.tp-ocean {box-shadow:inset 0 4px 0 #086B96}
.tp-forest i:nth-child(1) {background:#E1F0E6}
.tp-forest i:nth-child(2) {background:#EAF5ED}
.tp-forest i:nth-child(3) {background:#FFFFFF}
.tp-forest {box-shadow:inset 0 4px 0 #18663D}
.tp-sunset i:nth-child(1) {background:#FBE9DE}
.tp-sunset i:nth-child(2) {background:#FFF0E7}
.tp-sunset i:nth-child(3) {background:#FFFCF9}
.tp-sunset {box-shadow:inset 0 4px 0 #AD431D}
.tp-violet i:nth-child(1) {background:#EDE7FA}
.tp-violet i:nth-child(2) {background:#F3EDFC}
.tp-violet i:nth-child(3) {background:#FFFFFF}
.tp-violet {box-shadow:inset 0 4px 0 #6335B4}
.tp-rose i:nth-child(1) {background:#F9E8F0}
.tp-rose i:nth-child(2) {background:#FFF0F6}
.tp-rose i:nth-child(3) {background:#FFFFFF}
.tp-rose {box-shadow:inset 0 4px 0 #B12C64}
.tp-whatsapp i:nth-child(1) {background:#DFEFE5}
.tp-whatsapp i:nth-child(2) {background:#EAF6EF}
.tp-whatsapp i:nth-child(3) {background:#FFFFFF}
.tp-whatsapp {box-shadow:inset 0 4px 0 #08734B}
/* Custom theme editor: vividness + reusable brand/accent pairs. */
.sohbera-color-modes{margin:8px 12px 4px;padding:10px;border:1px solid var(--theme-line);background:var(--theme-surface-2);border-radius:10px}
.sohbera-color-modes>div:first-child{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}
.sohbera-color-modes b{font-size:11px;color:var(--theme-text)}
.sohbera-color-modes small{font-size:9px;color:var(--theme-muted)}
.sohbera-color-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.sohbera-color-options button{min-height:36px;border:1px solid var(--theme-line);border-radius:8px;background:var(--theme-surface);color:var(--theme-text);font-size:11px;font-weight:700;cursor:pointer}
.sohbera-color-options button[aria-pressed="true"]{border-color:var(--theme-brand);color:var(--theme-brand);background:var(--theme-brand-soft);box-shadow:0 0 0 1px var(--theme-brand)}
.sohbera-color-options button:focus-visible,.sohbera-brand-presets button:focus-visible{outline:2px solid var(--theme-accent);outline-offset:2px}
.sohbera-preset-header{margin:10px 0 7px;display:flex;align-items:center;justify-content:space-between;gap:7px;color:var(--theme-text)}
.sohbera-preset-header b{font-size:11px}.sohbera-preset-header small{color:var(--theme-muted);font-size:9px}
.sohbera-brand-presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.sohbera-brand-presets button{min-height:51px;padding:7px 6px;border-radius:9px;border:1px solid var(--theme-line);background:var(--theme-surface);color:var(--theme-text);cursor:pointer;font-size:10px;font-weight:750;display:flex;align-items:center;justify-content:center;gap:5px;flex-direction:column}
.sohbera-brand-presets button:hover{border-color:var(--theme-brand);background:var(--theme-hover)}
.sohbera-brand-presets i{display:block;width:54px;height:12px;border-radius:10px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}
.theme-editor-colors label,.theme-editor-field{color:var(--theme-text)}
@media(max-width:390px){.sohbera-brand-presets{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){html[data-theme] .rail-btn,html[data-theme] .room{transition:none}}
