/* Miss Chaos experience layer. All selectors are confined to her own full chat or dock. */
body.chaos-page:not(.samantha-chaos-page){--mc-ex-ink:#f7f0fb;--mc-ex-muted:#c4b7d0;--mc-ex-accent:var(--mc-realm-accent,#ff85c5);--mc-ex-bg:#100d18;--mc-ex-panel:#191322;--mc-ex-edge:color-mix(in srgb,var(--mc-ex-accent),transparent 69%);color:var(--mc-ex-ink)}
body.chaos-page:not(.samantha-chaos-page) .chaos-shell{width:min(1440px,100%);box-sizing:border-box;grid-template-columns:minmax(228px,280px) minmax(0,1fr);gap:1rem;padding:clamp(.5rem,2vw,1.4rem);align-items:start}
body.chaos-page:not(.samantha-chaos-page) .chaos-sidebar,body.chaos-page:not(.samantha-chaos-page) .chat-panel{min-width:0;min-height:0;border:1px solid var(--mc-ex-edge);border-radius:24px;background-color:var(--mc-ex-bg);box-shadow:0 14px 40px #0005}
body.chaos-page:not(.samantha-chaos-page) .chaos-sidebar{height:calc(100dvh - var(--kf-header-height,72px) - 3rem);max-height:900px;overflow:auto;padding:1rem;scrollbar-width:thin}
body.chaos-page:not(.samantha-chaos-page) .sidebar-title{margin:1rem 0 .65rem}
body.chaos-page:not(.samantha-chaos-page) .chat-panel{display:flex;flex-direction:column;height:calc(100dvh - var(--kf-header-height,72px) - 3rem);min-height:480px;max-height:none;overflow:hidden;background-image:linear-gradient(150deg,#100d18ed,#100d18f5),var(--mc-realm-art,none);background-size:cover}
body.chaos-page:not(.samantha-chaos-page) .chat-topbar{flex:0 0 auto;padding:.9rem 1.2rem;gap:.8rem;background:linear-gradient(110deg,color-mix(in srgb,var(--mc-ex-accent),transparent 89%),transparent);border-color:var(--mc-ex-edge)}
body.chaos-page:not(.samantha-chaos-page) .chaos-identity{min-width:0;gap:.75rem}body.chaos-page:not(.samantha-chaos-page) .chaos-identity h1{font-size:1.4rem;margin:0;line-height:1.15}body.chaos-page:not(.samantha-chaos-page) .chaos-identity .eyebrow{color:var(--mc-ex-accent)!important;font-size:.63rem;letter-spacing:.12em}body.chaos-page:not(.samantha-chaos-page) .presence{color:var(--mc-ex-muted);margin:.22rem 0 0}
body.chaos-page:not(.samantha-chaos-page) .chaos-avatar{width:56px;height:56px;flex:0 0 56px;border-radius:20px;border-color:var(--mc-ex-accent)!important;background:var(--mc-ex-panel)!important;box-shadow:0 0 20px var(--mc-ex-edge)}body.chaos-page:not(.samantha-chaos-page) .chaos-avatar img{width:100%;height:100%;object-fit:cover;display:block}
body.chaos-page:not(.samantha-chaos-page) .chat-topbar .mood-control{margin:0;font-size:.64rem;color:var(--mc-ex-muted)}body.chaos-page:not(.samantha-chaos-page) .mood-control select{min-height:40px;max-width:130px;border-color:var(--mc-ex-edge)!important;background:var(--mc-ex-panel)!important}
body.chaos-page:not(.samantha-chaos-page) .mc-chat-extras{flex:0 0 auto;display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.4rem .9rem;border-bottom:1px solid var(--mc-ex-edge)}body.chaos-page:not(.samantha-chaos-page) .mc-chat-extras a,body.chaos-page:not(.samantha-chaos-page) .mc-chat-extras button{font:inherit;font-size:.78rem;color:var(--mc-ex-accent);background:transparent;border:1px solid var(--mc-ex-edge);padding:.45rem .65rem;border-radius:999px;text-decoration:none;min-height:36px;cursor:pointer}
body.chaos-page:not(.samantha-chaos-page) .chat-messages{flex:1 1 0;min-height:0;height:0;max-height:none;padding:clamp(.75rem,2.5vw,1.75rem);gap:.9rem;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--mc-ex-edge) transparent}
body.chaos-page:not(.samantha-chaos-page) .welcome-card{width:min(100%,630px);box-sizing:border-box;margin:auto;flex-shrink:0;position:relative;padding:clamp(1.1rem,3vw,2.2rem);border:1px solid var(--mc-ex-edge);border-radius:26px;background:radial-gradient(ellipse at 82% 5%,color-mix(in srgb,var(--mc-ex-accent),transparent 83%),transparent 55%),var(--mc-ex-panel);box-shadow:0 15px 40px #0003}
body.chaos-page:not(.samantha-chaos-page) .mc-welcome-portrait{width:84px;height:84px;border-radius:24px;object-fit:cover;border:1px solid var(--mc-ex-accent);float:right;margin:0 0 .7rem .75rem}body.chaos-page:not(.samantha-chaos-page) .welcome-card h2{font-size:clamp(1.6rem,4vw,2.5rem);line-height:1.12;letter-spacing:-.045em;margin:.6rem 0}body.chaos-page:not(.samantha-chaos-page) .welcome-card .eyebrow{color:var(--mc-ex-accent)!important}body.chaos-page:not(.samantha-chaos-page) .welcome-card>p:not(.eyebrow){color:var(--mc-ex-muted);line-height:1.55}body.chaos-page:not(.samantha-chaos-page) .mc-welcome-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem;margin-top:1rem;clear:both}body.chaos-page:not(.samantha-chaos-page) .mc-welcome-actions button{min-height:48px;border-radius:14px;border:1px solid var(--mc-ex-edge);background:color-mix(in srgb,var(--mc-ex-accent) 8%,var(--mc-ex-bg));color:var(--mc-ex-ink);font:inherit;text-align:left;padding:.7rem;cursor:pointer}body.chaos-page:not(.samantha-chaos-page) .mc-welcome-actions button:hover{border-color:var(--mc-ex-accent)}
body.chaos-page:not(.samantha-chaos-page) .message{flex-shrink:0;max-width:min(760px,91%);padding:.8rem 1rem;border-radius:19px;line-height:1.62;font-size:1rem;box-shadow:none!important;min-width:0}body.chaos-page:not(.samantha-chaos-page) .message.assistant{align-self:flex-start;border:1px solid var(--mc-ex-edge)!important;background:var(--mc-ex-panel)!important;border-bottom-left-radius:6px}body.chaos-page:not(.samantha-chaos-page) .message.user{border:1px solid var(--mc-ex-edge)!important;background:color-mix(in srgb,var(--mc-ex-accent) 19%,var(--mc-ex-bg))!important;border-bottom-right-radius:6px}body.chaos-page:not(.samantha-chaos-page) .message-label,body.chaos-page:not(.samantha-chaos-page) .message.assistant .message-label{display:flex;align-items:center;gap:.45rem;font-size:.72rem;letter-spacing:.025em;color:var(--mc-ex-accent)!important;text-transform:none}body.chaos-page:not(.samantha-chaos-page) .mc-reply-avatar{width:26px;height:26px;object-fit:cover;border-radius:50%;flex:none}body.chaos-page:not(.samantha-chaos-page) .message-copy{min-height:32px;border-radius:999px;color:var(--mc-ex-muted);border-color:var(--mc-ex-edge);background:transparent}
body.chaos-page:not(.samantha-chaos-page) .composer{flex:0 0 auto;position:relative;inset:auto;margin:.4rem .8rem .2rem;padding:.65rem .8rem;border:1px solid var(--mc-ex-edge)!important;border-radius:20px;background:var(--mc-ex-panel)!important;box-shadow:none!important}body.chaos-page:not(.samantha-chaos-page) .composer:focus-within{border-color:var(--mc-ex-accent)!important;box-shadow:0 0 0 2px var(--mc-ex-edge)!important}body.chaos-page:not(.samantha-chaos-page) #message-input{font-size:16px;min-height:44px;max-height:124px;color:var(--mc-ex-ink)}body.chaos-page:not(.samantha-chaos-page) .composer textarea::placeholder{color:var(--mc-ex-muted)!important}body.chaos-page:not(.samantha-chaos-page) .composer-bottom{gap:.35rem;color:var(--mc-ex-muted);flex-wrap:wrap}body.chaos-page:not(.samantha-chaos-page) .composer-actions{gap:.35rem;flex-wrap:wrap;margin-left:auto}body.chaos-page:not(.samantha-chaos-page) .composer-actions button{min-width:40px;min-height:40px;border-radius:13px}body.chaos-page:not(.samantha-chaos-page) .icon-button{border-color:var(--mc-ex-edge)!important;background:var(--mc-ex-bg)!important}body.chaos-page:not(.samantha-chaos-page) .send-button,body.chaos-page:not(.samantha-chaos-page) .new-chat{background:var(--mc-ex-accent)!important;color:#17101c!important;border-color:var(--mc-ex-accent)!important;box-shadow:none}
body.chaos-page:not(.samantha-chaos-page) .mc-tool-drawer{flex:0 0 auto;margin:0 .85rem;max-height:26dvh;overflow:auto;border-bottom:1px solid var(--mc-ex-edge);scrollbar-width:thin}body.chaos-page:not(.samantha-chaos-page) .mc-tool-drawer summary{cursor:pointer;color:var(--mc-ex-muted);font-size:.78rem;padding:.5rem 0}body.chaos-page:not(.samantha-chaos-page) .mc-tool-drawer .chaos-task-starters{padding:.25rem 0 .5rem!important}body.chaos-page:not(.samantha-chaos-page) .mc-tool-drawer button{min-height:36px}body.chaos-page:not(.samantha-chaos-page) .astrology-tools:not([hidden]){max-height:29dvh;overflow:auto;flex:0 0 auto}body.chaos-page:not(.samantha-chaos-page) .mc-privacy-disclosure{flex:0 0 auto;margin:0 .85rem .4rem;max-height:22dvh;overflow:auto;color:var(--mc-ex-muted);font-size:.72rem}body.chaos-page:not(.samantha-chaos-page) .mc-privacy-disclosure summary{cursor:pointer;padding:.35rem 0}body.chaos-page:not(.samantha-chaos-page) .privacy-note{color:var(--mc-ex-muted)!important;text-align:left;line-height:1.5;padding:.3rem 0;margin:0}
body.chaos-page:not(.samantha-chaos-page) #mc-history-toggle{display:none}body.chaos-page:not(.samantha-chaos-page) .chaos-shell :is(button,a,input,textarea,select,summary):focus-visible{outline:2px solid var(--mc-ex-accent);outline-offset:3px}
@media(max-width:760px){body.chaos-page:not(.samantha-chaos-page) .chaos-shell{display:flex;flex-direction:column;gap:.5rem;padding:.4rem;align-items:stretch}body.chaos-page:not(.samantha-chaos-page) .chat-panel{height:calc(100dvh - var(--kf-header-height,72px) - 1rem);min-height:350px;order:0;border-radius:20px}body.chaos-page:not(.samantha-chaos-page) .chaos-sidebar{order:1;height:auto;max-height:none;display:none}body.chaos-page:not(.samantha-chaos-page) .chaos-shell[data-history-open="true"] .chaos-sidebar{display:flex}body.chaos-page:not(.samantha-chaos-page) #mc-history-toggle{display:inline-flex;align-items:center;min-height:44px}body.chaos-page:not(.samantha-chaos-page) .chat-topbar{padding:.65rem;gap:.4rem;flex-wrap:nowrap;align-items:center}body.chaos-page:not(.samantha-chaos-page) .chaos-avatar{width:44px;height:44px;flex-basis:44px;border-radius:14px}body.chaos-page:not(.samantha-chaos-page) .chaos-identity{gap:.45rem}body.chaos-page:not(.samantha-chaos-page) .chaos-identity h1{font-size:1.15rem}body.chaos-page:not(.samantha-chaos-page) .chaos-identity .eyebrow{font-size:.53rem}body.chaos-page:not(.samantha-chaos-page) .presence{font-size:.67rem}body.chaos-page:not(.samantha-chaos-page) .mood-control select{max-width:105px;font-size:.75rem}body.chaos-page:not(.samantha-chaos-page) .mc-chat-extras{padding:.3rem .55rem;gap:.3rem}body.chaos-page:not(.samantha-chaos-page) .mc-chat-extras a,body.chaos-page:not(.samantha-chaos-page) .mc-chat-extras button{font-size:.72rem;padding:.35rem .55rem}body.chaos-page:not(.samantha-chaos-page) .message{max-width:96%;font-size:.95rem;padding:.65rem .8rem}body.chaos-page:not(.samantha-chaos-page) .composer{margin:.25rem .45rem .15rem;padding:.4rem .55rem}body.chaos-page:not(.samantha-chaos-page) .mc-welcome-portrait{width:64px;height:64px;border-radius:18px}body.chaos-page:not(.samantha-chaos-page) .mc-welcome-actions button{font-size:.84rem;padding:.55rem}body.chaos-page:not(.samantha-chaos-page) .mc-tool-drawer{margin-inline:.55rem}body.chaos-page:not(.samantha-chaos-page) .mc-privacy-disclosure{margin-inline:.55rem;margin-bottom:calc(.3rem + env(safe-area-inset-bottom,0px))}}
@media(max-width:350px){body.chaos-page:not(.samantha-chaos-page) .chaos-identity .eyebrow{display:none}body.chaos-page:not(.samantha-chaos-page) .mc-welcome-actions{grid-template-columns:1fr}body.chaos-page:not(.samantha-chaos-page) .composer-actions button{min-width:36px}}
/* Floating companion: same visual language, existing positioning/authorization stays intact. */
#miss-chaos-presence{--mc-ex-accent:var(--mc-realm-accent,#ff85c5);--mc-ex-edge:color-mix(in srgb,var(--mc-ex-accent),transparent 64%);--mc-ex-panel:#1c1527}
#miss-chaos-presence #miss-chaos-window{border-radius:25px;border-color:var(--mc-ex-edge);background-color:#100d18}
#miss-chaos-presence .mc-head{padding:.75rem;gap:.55rem;flex:0 0 auto;border-color:var(--mc-ex-edge)}
#miss-chaos-presence .mc-head-copy strong{font-size:1.03rem;letter-spacing:0}#miss-chaos-presence .mc-head-copy small{font-size:.73rem;color:#c8bbd4}
#miss-chaos-presence .mc-head-actions{gap:.2rem}#miss-chaos-presence .mc-head-actions button{width:36px;height:36px;border-color:var(--mc-ex-edge);border-radius:11px}
#miss-chaos-presence #mc-messages{min-height:0;gap:.65rem;padding:.75rem;scrollbar-width:thin}#miss-chaos-presence .mc-bubble{font-size:.94rem;line-height:1.55;border:1px solid var(--mc-ex-edge);border-radius:17px;background:var(--mc-ex-panel);padding:.7rem .85rem;flex-shrink:0}
#miss-chaos-presence .mc-bubble.user{border-bottom-right-radius:5px;background:color-mix(in srgb,var(--mc-ex-accent) 19%,#100d18)}#miss-chaos-presence .mc-bubble.assistant{border-bottom-left-radius:5px}#miss-chaos-presence .mc-bubble.system{font-size:.86rem;color:#d9cee5}
#miss-chaos-presence #mc-form{padding:.5rem;gap:.35rem;flex:0 0 auto;align-items:flex-end;background:#100d18;border-color:var(--mc-ex-edge);flex-wrap:wrap}
#miss-chaos-presence #mc-input{font-size:16px;min-height:44px;min-width:105px;border-color:var(--mc-ex-edge);border-radius:15px;background:var(--mc-ex-panel)}
#miss-chaos-presence #mc-send{background:var(--mc-ex-accent);color:#17101c;min-height:44px;border-radius:14px;font-size:.85rem}
#miss-chaos-presence #mc-settings{flex:0 0 auto;max-height:32dvh;overflow:auto;border-color:var(--mc-ex-edge)}#miss-chaos-presence #mc-settings summary{padding:.5rem .75rem;cursor:pointer;color:#d9cee5;font-size:.78rem}
#miss-chaos-presence .mc-footer{font-size:.7rem;color:#c4b7d0;flex:0 0 auto}#miss-chaos-presence #mc-dock{border-color:var(--mc-ex-edge)}
@media(max-width:480px){#miss-chaos-presence .mc-head{padding:.5rem;gap:.4rem}#miss-chaos-presence .mc-head-actions button{width:32px;height:36px}#miss-chaos-presence .mc-head-copy small{font-size:.65rem}#miss-chaos-presence #mc-messages{padding:.55rem}#miss-chaos-presence .mc-bubble{max-width:94%}}
@media(prefers-reduced-motion:reduce){body.chaos-page:not(.samantha-chaos-page) .typing,body.chaos-page:not(.samantha-chaos-page) .chaos-avatar,#miss-chaos-presence .mc-head img{animation:none!important;transition:none!important}}

/* Shared renderer also runs on the private partner page; retain its layout. */
body.samantha-chaos-page .mc-reply-avatar{width:26px;height:26px;max-width:26px;object-fit:cover;border-radius:50%;vertical-align:middle;margin-inline-end:.35rem}

body.samantha-chaos-page .mc-welcome-portrait{width:70px;height:70px;max-width:70px;border-radius:18px;object-fit:cover;float:right;margin:0 0 .5rem .7rem}body.samantha-chaos-page .mc-welcome-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:.4rem;clear:both;margin:1rem 0}body.samantha-chaos-page .mc-welcome-actions button{min-height:44px;padding:.5rem;border-radius:12px;border:1px solid #9b6d9b;background:#201628;color:#f7eff9;cursor:pointer}

/* Reading quality, expression art and focus controls. */
body.chaos-page .message-content{white-space:normal}body.chaos-page .message.user .message-content{white-space:pre-wrap}body.chaos-page .message-content p{margin:.35em 0;white-space:pre-wrap}body.chaos-page .message-content h3{font-size:1.04em;margin:.8em 0 .3em;color:var(--mc-ex-accent,#ef9ed1)}body.chaos-page .message-content :is(ul,ol){padding-inline-start:1.4em;margin:.5em 0}body.chaos-page .message-content li{margin:.2em 0}body.chaos-page .message-content pre{overflow:auto;max-width:100%;white-space:pre;padding:.8rem;border-radius:12px;background:#0d0b14;border:1px solid #615069;font-size:.85em}body.chaos-page .message-content code{font-family:ui-monospace,monospace;overflow-wrap:anywhere}body.chaos-page .message-content :not(pre)>code{background:#0d0b14;padding:.1em .3em;border-radius:.3em}body.chaos-page .message-content a{text-decoration:underline;color:var(--mc-ex-accent,#ff91ce)}body.chaos-page .mc-jump-row{display:flex;justify-content:flex-end;gap:.45rem;margin:.15rem .85rem;flex:0 0 auto}body.chaos-page .mc-jump-row button{font:inherit;font-size:.73rem;color:var(--mc-ex-accent);border:1px solid var(--mc-ex-edge);border-radius:999px;padding:.35rem .7rem;background:var(--mc-ex-panel);cursor:pointer;min-height:34px}body.chaos-page .mc-jump-row button[hidden]{display:none}body.chaos-page .mc-focus-mode :is(.mc-chat-extras,.mc-tool-drawer,.mc-privacy-disclosure){display:none}body.chaos-page .typing{display:flex;align-items:center;gap:.65rem}body.chaos-page .typing img{width:32px;height:32px;border-radius:10px;flex:none}body.chaos-page .chaos-avatar[data-mc-expression="thinking"]{box-shadow:0 0 0 3px var(--mc-ex-edge),0 0 18px var(--mc-ex-edge)}body.chaos-page .mc-welcome-portrait{object-fit:contain;background:#20152c}body.chaos-page .mc-focus-mode .chat-messages{padding-block:1rem}
@media(max-width:480px){body.chaos-page .mc-jump-row{margin-inline:.55rem}body.chaos-page .mc-jump-row button{min-height:36px}body.chaos-page .message-content pre{max-width:calc(100vw - 80px)}}

.mc-realm-shell .mc-realm-character{float:right;width:clamp(84px,15vw,132px);height:auto;border-radius:25px;margin:0 0 .75rem 1rem;max-width:40%}

body.chaos-page .message-actions{flex-wrap:wrap;justify-content:flex-start}body.chaos-page .message.user .message-actions{justify-content:flex-end}body.chaos-page .message-copy{padding:.35rem .65rem;min-height:36px}body.chaos-page .mc-follow-up:hover{color:var(--mc-ex-accent,#ff91ce)}body.chaos-page .chat-error button{margin:.35rem;min-height:40px}body.chaos-page .mc-focus-mode .astrology-tools:not([hidden]){max-height:17dvh}
