/* Chaosphere user-selectable themes: scoped palette overrides. */
.messages-shell[data-cs-theme="hellfire"]{--cs-own-a:#ec4a16;--cs-own-b:#8c1718;--cs-recv-a:#392126;--cs-recv-b:#211b24;--cs-glow:#ff6b22;--cs-back:#180d12;--cs-side:#24131a}
.messages-shell[data-cs-theme="egypt"]{--cs-own-a:#aa7b32;--cs-own-b:#58402d;--cs-recv-a:#24383b;--cs-recv-b:#16252d;--cs-glow:#e6c176;--cs-back:#101d25;--cs-side:#162c32}
.messages-shell[data-cs-theme="mustafar"]{--cs-own-a:#ba341b;--cs-own-b:#571c1a;--cs-recv-a:#302529;--cs-recv-b:#181a20;--cs-glow:#ff5634;--cs-back:#100f15;--cs-side:#20171c}
.messages-shell[data-cs-theme="korriban"]{--cs-own-a:#9d3c45;--cs-own-b:#502334;--cs-recv-a:#2e2834;--cs-recv-b:#1a1723;--cs-glow:#dd8790;--cs-back:#14121d;--cs-side:#231b28}
.messages-shell[data-cs-theme="vader"]{--cs-own-a:#a52d3c;--cs-own-b:#461722;--cs-recv-a:#262b34;--cs-recv-b:#15171d;--cs-glow:#ff4354;--cs-back:#0b0c10;--cs-side:#17191f}
.messages-shell[data-cs-theme="obsidian"]{--cs-own-a:#a348a2;--cs-own-b:#51428d;--cs-recv-a:#29283e;--cs-recv-b:#202438;--cs-glow:#ff8ed0;--cs-back:#10121f;--cs-side:#19172c}
.messages-shell[data-cs-theme] .message.mine{background:linear-gradient(125deg,var(--cs-own-a),var(--cs-own-b))!important;border-color:var(--cs-glow)!important}
.messages-shell[data-cs-theme] .message:not(.mine){background:linear-gradient(145deg,var(--cs-recv-a),var(--cs-recv-b))!important}
.messages-shell[data-cs-theme] .messages-list{background:radial-gradient(ellipse at 80% 110%,color-mix(in srgb,var(--cs-glow) 12%,transparent),transparent 60%),var(--cs-back)!important}
.messages-shell[data-cs-theme] .conversation-panel{background:linear-gradient(160deg,var(--cs-side),var(--cs-back))!important}
.messages-shell[data-cs-theme] .conversation.active{border-color:var(--cs-glow)!important}
.messages-shell[data-cs-theme] .composer button.primary{background:linear-gradient(110deg,var(--cs-own-a),var(--cs-own-b))!important}
.cs-theme-control{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;font-size:.76rem;color:#ddd}
.cs-theme-control select{min-height:39px;border-radius:999px;padding:.35rem .8rem;background:#161726;color:#fff;border:1px solid #a6a0c366;max-width:170px}
.cs-theme-control select:focus-visible{outline:2px solid #ffb1d4;outline-offset:2px}
.cs-roaming-imp{position:fixed;z-index:55;bottom:clamp(85px,13vh,135px);left:0;transform:translateX(var(--imp-x,25px)) scaleX(var(--imp-face,1));width:92px;height:100px;pointer-events:none;filter:drop-shadow(0 12px 12px #0009)}
.cs-roaming-imp button{display:block;width:100%;height:100%;padding:0;background:transparent;border:0;cursor:pointer;pointer-events:auto;animation:cs-imp-bob 1.1s ease-in-out infinite alternate}
.cs-roaming-imp img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 0 10px #ff582888)}
.cs-roaming-imp .cs-imp-voice{position:absolute;bottom:100%;left:15px;min-width:150px;max-width:min(250px,70vw);padding:.7rem .85rem;border-radius:17px 17px 17px 4px;background:#211729;color:#fff4e8;border:1px solid #f36b5f;font-size:.75rem;font-weight:750;box-shadow:0 12px 30px #0009;transform:scaleX(var(--imp-face,1));pointer-events:none}
.cs-roaming-imp .cs-imp-voice[hidden]{display:none}
@keyframes cs-imp-bob{to{translate:0 -7px;rotate:3deg}}
@media(max-width:700px){.cs-roaming-imp{width:65px;height:75px;bottom:90px}.cs-roaming-imp .cs-imp-voice{min-width:120px}}
@media(prefers-reduced-motion:reduce){.cs-roaming-imp button{animation:none}}

/* Registered vector scene artwork for each theme, clipped inside the message viewport. */
.messages-shell[data-cs-theme="obsidian"] .messages-list{background-image:linear-gradient(#0c0d19c9,#0c0d19dd),url("/assets/knightfall/chaosphere/obsidian-chat.svg")!important;background-position:center!important;background-size:cover!important;background-repeat:no-repeat!important}
.messages-shell[data-cs-theme="hellfire"] .messages-list{background-image:linear-gradient(#0c0d19c9,#0c0d19dd),url("/assets/knightfall/chaosphere/hellfire-chat.svg")!important;background-position:center!important;background-size:cover!important;background-repeat:no-repeat!important}
.messages-shell[data-cs-theme="egypt"] .messages-list{background-image:linear-gradient(#0c0d19c9,#0c0d19dd),url("/assets/knightfall/chaosphere/egypt-chat.svg")!important;background-position:center!important;background-size:cover!important;background-repeat:no-repeat!important}
.messages-shell[data-cs-theme="mustafar"] .messages-list{background-image:linear-gradient(#0c0d19c9,#0c0d19dd),url("/assets/knightfall/chaosphere/mustafar-chat.svg")!important;background-position:center!important;background-size:cover!important;background-repeat:no-repeat!important}
.messages-shell[data-cs-theme="korriban"] .messages-list{background-image:linear-gradient(#0c0d19c9,#0c0d19dd),url("/assets/knightfall/chaosphere/korriban-chat.svg")!important;background-position:center!important;background-size:cover!important;background-repeat:no-repeat!important}
.messages-shell[data-cs-theme="vader"] .messages-list{background-image:linear-gradient(#0c0d19c9,#0c0d19dd),url("/assets/knightfall/chaosphere/vader-chat.svg")!important;background-position:center!important;background-size:cover!important;background-repeat:no-repeat!important}

/* Single swappable styling layer: settings, ornamental panels, buttons and cards. */
.messages-shell .cs-settings{margin:.4rem 0 .9rem;border:1px solid #a28ab74f;border-radius:22px;background:linear-gradient(130deg,#21192f,#141827);color:#f5edff;overflow:hidden}
.messages-shell .cs-settings>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:.75rem 1.1rem;font-weight:800;letter-spacing:.015em}
.messages-shell .cs-settings>summary::-webkit-details-marker{display:none}
.messages-shell .cs-settings[open]>summary{border-bottom:1px solid #ffffff1c}
.messages-shell .cs-settings-content{display:flex;gap:1rem 1.5rem;align-items:center;flex-wrap:wrap;padding:1rem 1.2rem}
.messages-shell .cs-settings-content>div:first-child{flex:1 1 220px}
.messages-shell .cs-settings-content p{margin:.2rem 0;color:#c5bdd1;font-size:.8rem}
.messages-shell .cs-imp-setting{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.84rem}
.messages-shell .cs-imp-setting input{accent-color:#ef79b3;width:18px;height:18px}
.cs-roaming-imp[hidden]{display:none!important}
.messages-shell[data-cs-theme] .cs-settings{border-color:var(--cs-glow)!important;background:linear-gradient(130deg,var(--cs-side),var(--cs-back))!important}
.messages-shell[data-cs-theme] .chat-head{border-bottom:1px solid var(--cs-glow)!important;background:linear-gradient(125deg,var(--cs-side),var(--cs-back))!important}
.messages-shell[data-cs-theme] .composer{border-top:1px solid var(--cs-glow)!important;background:linear-gradient(125deg,var(--cs-side),var(--cs-back))!important}
.messages-shell[data-cs-theme] .conversation.active{box-shadow:inset 3px 0 var(--cs-glow)!important}
.messages-shell[data-cs-theme] :is(.compose-dialog,.history-search-dialog){border-color:var(--cs-glow)!important}
.messages-shell[data-cs-theme] :is(.inbox-filter.active,.message-actions button:hover){border-color:var(--cs-glow)!important}
.messages-shell[data-cs-theme] .panel-title{border-bottom:1px solid var(--cs-glow)}
.messages-shell[data-cs-theme] .chat-panel{background:var(--cs-back)!important}
.messages-shell[data-cs-theme] .cs-imp-voice{border-color:var(--cs-glow)}
@media(max-width:700px){.messages-shell .cs-settings-content{align-items:stretch;flex-direction:column}.messages-shell .cs-settings-content>div:first-child{flex:auto}}

/* Theme ornaments share the same asset contract, not six separate stylesheets. */
.messages-shell[data-cs-theme="obsidian"]{--cs-panel-art:url("/assets/knightfall/chaosphere/obsidian-panel.svg")}
.messages-shell[data-cs-theme="hellfire"]{--cs-panel-art:url("/assets/knightfall/chaosphere/hellfire-panel.svg")}
.messages-shell[data-cs-theme="egypt"]{--cs-panel-art:url("/assets/knightfall/chaosphere/egypt-panel.svg")}
.messages-shell[data-cs-theme="mustafar"]{--cs-panel-art:url("/assets/knightfall/chaosphere/mustafar-panel.svg")}
.messages-shell[data-cs-theme="korriban"]{--cs-panel-art:url("/assets/knightfall/chaosphere/korriban-panel.svg")}
.messages-shell[data-cs-theme="vader"]{--cs-panel-art:url("/assets/knightfall/chaosphere/vader-panel.svg")}
.messages-shell[data-cs-theme] .chat-head,.messages-shell[data-cs-theme] .panel-title,.messages-shell[data-cs-theme] .cs-settings>summary{background-image:var(--cs-panel-art)!important;background-position:top center!important;background-size:100% 100%!important;background-repeat:no-repeat!important}
.cs-roaming-imp[data-mood="cackling"] img{animation:cs-imp-cackle .34s ease-in-out 3}
.cs-roaming-imp[data-mood="turning"] img{filter:drop-shadow(0 0 16px #ff9e44)}
@keyframes cs-imp-cackle{25%{transform:rotate(-12deg) scale(1.06)}75%{transform:rotate(12deg) scale(.98)}}
@media(prefers-reduced-motion:reduce){.cs-roaming-imp[data-mood] img{animation:none}}

/* Type families are theme tokens, not per-theme stylesheets. */
.messages-shell[data-cs-theme="egypt"]{--cs-display:Georgia,"Palatino Linotype",serif;--cs-body:"Trebuchet MS",system-ui,sans-serif}
.messages-shell[data-cs-theme="hellfire"],.messages-shell[data-cs-theme="mustafar"]{--cs-display:Impact,"Arial Narrow",sans-serif;--cs-body:"Trebuchet MS",system-ui,sans-serif}
.messages-shell[data-cs-theme="vader"],.messages-shell[data-cs-theme="korriban"]{--cs-display:"Arial Black",system-ui,sans-serif;--cs-body:"Segoe UI",system-ui,sans-serif}
.messages-shell[data-cs-theme="obsidian"]{--cs-display:"Trebuchet MS",system-ui,sans-serif;--cs-body:"Segoe UI",system-ui,sans-serif}
.messages-shell[data-cs-theme]{font-family:var(--cs-body,system-ui,sans-serif)}
.messages-shell[data-cs-theme] :is(.messages-hero h1,.panel-title strong,.chat-identity strong){font-family:var(--cs-display,system-ui,sans-serif);letter-spacing:-.03em}
.messages-shell[data-cs-theme] :is(.conversation-panel,.chat-panel,.chat-head,.composer){border-radius:clamp(16px,2vw,28px)}
.messages-shell[data-cs-theme] :is(.conversation,.message,.compose-dialog,.cs-settings){border-radius:clamp(18px,2vw,26px)}
.messages-shell[data-cs-theme] .message.mine{border-bottom-right-radius:8px}
.messages-shell[data-cs-theme] .message:not(.mine){border-bottom-left-radius:8px}
