/* The shared character stage keeps the existing video element and poster fallback. */
#consult[data-video-visible=true] .portrait-background{background-image:radial-gradient(ellipse at 50% 35%,#2b3a3b,#0c1b22 75%)!important;filter:none}
#consult[data-oracle] .portrait-main{top:64px;left:0;transform:none;width:100%;height:calc(100% - 100px);object-fit:contain;mask-image:linear-gradient(#000 90%,transparent)}
#consult[data-has-reply=true] .conversation-dock{display:contents}
#consult #chat-panel{display:contents}
.conversation-mode{position:absolute;z-index:3;top:103px;right:36px;display:flex;gap:3px;padding:4px;border:1px solid var(--line);border-radius:30px;background:#102126cc;backdrop-filter:blur(15px)}
.conversation-mode button{padding:11px 20px;border-radius:25px;font-size:12px;color:#e1ded0}
.conversation-mode button[aria-pressed=true]{background:#edddbc;color:#172b2e}
.bubble-view{position:absolute;inset:170px 0 222px;pointer-events:none}
.bubble-card{position:absolute;left:5%;top:10%;width:clamp(255px,25vw,355px);pointer-events:auto;outline-offset:8px;max-height:calc(100% - 100px);display:flex;flex-direction:column}
.bubble-card:empty{display:none}
.bubble-card[data-side=right]{left:auto;right:5%;top:35%}
.speech-bubble{margin:0;background:rgb(8 25 29 / 20%);color:#fff8e9;border:1px solid #f7dba366;border-radius:24px 24px 24px 8px;box-shadow:0 12px 40px #00141620;text-shadow:0 1px 4px #001416,0 0 12px #00141699;padding:22px 25px;animation:bubble-arrive .35s ease both;min-height:0;display:flex;flex-direction:column}
.speech-bubble::after{content:'';position:absolute;right:-21px;top:30px;width:24px;height:29px;background:rgb(8 25 29 / 20%);clip-path:polygon(0 0,100% 4%,0 100%)}
.bubble-card[data-side=right] .speech-bubble{border-radius:24px 24px 8px 24px}
.bubble-card[data-side=right] .speech-bubble::after{left:-21px;right:auto;transform:scaleX(-1)}
.speech-bubble strong{display:block;color:#f5d49a;font-size:10px;letter-spacing:.15em;text-transform:uppercase;margin-bottom:9px;flex-shrink:0}
.speech-bubble p{font:17px/1.58 var(--serif);white-space:pre-wrap;overflow-wrap:anywhere;max-height:36vh;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#ac8d52 transparent}
.bubble-controls{position:absolute;bottom:0;right:5%;display:flex;align-items:center;gap:7px;max-width:calc(100% - 32px);padding:6px 9px 6px 14px;border:1px solid var(--line);border-radius:30px;background:#102126d9;backdrop-filter:blur(15px);pointer-events:auto}
.bubble-controls button{width:34px;height:34px;flex-shrink:0;border-radius:50%;font-size:21px;background:#e7c58b14;color:#f3debb}
.bubble-controls button:disabled{cursor:default;opacity:.35}
.bubble-controls #bubble-full{width:auto;border-radius:0;background:none;font-size:11px;padding:0 8px 0 0;border-right:1px solid var(--line)}
.bubble-controls #bubble-auto{font-size:14px}
#bubble-progress{font-size:11px;font-variant-numeric:tabular-nums;min-width:36px;text-align:center;color:#e9d4a9}
.speed-choice select{max-width:94px;border:0;border-radius:15px;background:#ffffff09;color:#f4e3c2;font-size:12px;padding:7px 3px 7px 9px;cursor:pointer;min-height:34px}
.reply-controls{position:absolute;bottom:22px;left:50%;transform:translateX(-50%);width:min(640px,calc(100% - 48px));z-index:2}
.reply-controls .conversation-toolbar{margin:0;border:0;gap:18px;justify-content:flex-start}
.reply-controls .conversation-toolbar .text-button{padding:9px 0;text-shadow:0 1px 5px #000}
.reply-controls .topic-buttons{margin:6px 0 12px}
.reply-controls .topic-buttons button{background:#102126b8;backdrop-filter:blur(10px)}
.reply-controls .composer{background:#10272ded;border-radius:17px;padding:7px 9px 7px 17px;box-shadow:0 8px 28px #00101545;backdrop-filter:blur(20px)}
.reply-controls .composer button{border-radius:10px;width:44px;height:44px}
.reply-controls .composer textarea{padding:11px 0;font-size:15px;line-height:1.5}
/* A diffuse amber invitation after the final bubble; only its opacity breathes. */
#chat-form{position:relative;isolation:isolate;transition:border-color .4s,box-shadow .4s}
#chat-form::before{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;opacity:0;box-shadow:0 0 22px 9px #f4cc895a,-22px 0 45px 13px #e0ad583d,24px 7px 60px 16px #f2d2a043,0 10px 36px 8px #e9b96f33;transition:opacity .65s ease}
#chat-form[data-turn-ready=true]{border-color:#ffe4aa;box-shadow:0 0 0 1px #ffe5aeb3,0 0 18px 3px #f6cf8e53,inset 0 0 15px #e9c48611,0 8px 28px #00101545}
#chat-form[data-turn-ready=true]::before{opacity:1;animation:turn-invitation 5.4s ease-in-out infinite}
.turn-hint{position:absolute;top:-8px;left:16px;padding:0 7px;border-radius:7px;background:#10272d;color:#fff2d5;font:10px/1.4 var(--sans);letter-spacing:.025em;pointer-events:none;text-shadow:0 0 10px #edc57399}
.turn-hint:empty{display:none}
@keyframes turn-invitation{0%,100%{opacity:.89}50%{opacity:1}}
@media(prefers-reduced-motion:reduce){#chat-form[data-turn-ready=true]::before{animation:none;opacity:.9}#chat-form,#chat-form::before{transition:none}}
.reply-controls .session-note{font-size:10px;text-align:center;margin-top:9px;text-shadow:0 1px 4px #000}
.reply-controls .thinking{padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:#102126e8}
.chat-view{position:absolute;top:172px;bottom:222px;right:4%;width:min(530px,44%);background:#102126e5;border:1px solid var(--line);border-radius:22px;backdrop-filter:blur(22px);overflow:hidden;display:flex;flex-direction:column}
.chat-view h2{font-size:25px;padding:18px 24px;border-bottom:1px solid var(--line);flex-shrink:0}
.chat-log{overflow:auto;min-height:0;padding:22px 24px;display:flex;flex-direction:column;gap:24px;scrollbar-width:thin;scrollbar-color:var(--gold) transparent;overscroll-behavior:contain}
.chat-log .history-item{font-size:14px;overflow-wrap:anywhere}
.chat-log .history-item .speaker{font:11px var(--sans);letter-spacing:.08em;text-transform:uppercase}
.chat-log .history-item.user{border:1px solid #d4be8d33;border-radius:14px 14px 3px 14px;background:#cfb77d18;align-self:flex-end;max-width:92%}
#consult[data-view=chat][data-has-reply=true] .portrait-main{left:0;transform:none;width:55%;height:100%;top:0;object-fit:cover;mask-image:linear-gradient(90deg,#000 85%,transparent)}
#consult[data-view=chat] .reply-controls{left:auto;right:4%;transform:none;width:min(530px,44%)}
@keyframes bubble-arrive{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
@media(max-width:850px){
 .conversation-mode{top:85px;right:18px;padding:3px}.conversation-mode button{padding:9px 16px;font-size:11px}
 #consult[data-has-reply=true] .oracle-heading{right:160px;gap:8px}#consult[data-has-reply=true] .oracle-heading h1{white-space:nowrap;font-size:23px}#consult[data-has-reply=true] .oracle-heading #open-options{margin-left:0}
 #consult[data-has-reply=true] .oracle-heading p{display:none}
 #app[data-screen=consult] .preview-mark{display:none}
 #consult .oracle-heading #open-options{position:fixed;top:20px;right:112px;margin:0;width:33px;height:33px}
 #consult[data-oracle] .portrait-main{top:0;left:0;transform:none;width:100%;height:calc(100% - 244px);object-fit:cover;mask-image:linear-gradient(#000 87%,transparent)}
 .bubble-view{inset:195px 0 190px}
 .bubble-card,.bubble-card[data-side=right]{top:auto;bottom:54px;left:50%;right:auto;transform:translateX(-50%);width:min(500px,calc(100% - 36px));max-height:calc(100% - 54px)}
 .speech-bubble,.bubble-card[data-side=right] .speech-bubble{padding:17px 20px;border-radius:22px 22px 22px 7px}
 .speech-bubble::after,.bubble-card[data-side=right] .speech-bubble::after{left:32px;right:auto;top:-17px;width:24px;height:22px;transform:none;clip-path:polygon(0 100%,50% 0,100% 100%)}
 .speech-bubble p{font-size:16px;line-height:1.5;max-height:min(25vh,190px)}
 .bubble-controls{bottom:0;right:18px;padding:4px 6px 4px 11px;gap:4px}.bubble-controls button{width:32px;height:32px}.speed-choice select{font-size:11px;max-width:85px;padding-left:5px}#bubble-progress{font-size:10px;min-width:33px}
 .reply-controls,#consult[data-view=chat] .reply-controls{width:min(600px,calc(100% - 24px));left:50%;right:auto;transform:translateX(-50%);bottom:max(14px,env(safe-area-inset-bottom))}
 .reply-controls .conversation-toolbar{justify-content:space-between;gap:10px}.reply-controls .conversation-toolbar .text-button{font-size:10px;padding:7px 0}
 .reply-controls .topic-buttons{margin:6px 0 9px;gap:6px}.reply-controls .topic-buttons button{font-size:9px;padding:6px 9px}
 .reply-controls .composer textarea{font-size:16px}.reply-controls .session-note{font-size:9px;line-height:1.5}
 .chat-view{left:18px;right:18px;width:auto;max-width:540px;margin:auto;top:clamp(265px,37vh,330px);bottom:190px;border-radius:20px}
 .chat-view h2{font-size:22px;padding:14px 18px}.chat-log{padding:17px 18px;gap:20px}.chat-log .history-item{font-size:13px}
 #consult[data-view=chat][data-has-reply=true] .portrait-main{width:100%;height:calc(100% - 244px);top:0;object-fit:cover;mask-image:linear-gradient(#000 87%,transparent)}
}
@media(min-width:601px) and (max-width:850px){#consult[data-oracle] .portrait-main,#consult[data-view=chat][data-has-reply=true][data-oracle] .portrait-main{object-fit:contain}#consult[data-oracle] #oracle-loop{object-fit:cover}.bubble-view{bottom:190px}}
@media(max-height:700px){
 .reply-controls{bottom:10px}.reply-controls .topic-buttons{display:none}.bubble-view{bottom:156px}.chat-view{bottom:156px}
 .bubble-card,.bubble-card[data-side=right]{top:auto;bottom:52px}.speech-bubble p{max-height:25vh}
}
@media(max-height:700px) and (max-width:850px){.chat-view{top:230px}.speech-bubble p{font-size:14px}.speech-bubble{padding:13px 18px}}
@media(max-width:370px){#consult[data-has-reply=true] .oracle-heading h1 span{display:none}.conversation-mode{right:14px}.conversation-mode button{padding:9px 13px}.bubble-controls{gap:2px;padding-left:8px;right:16px}.bubble-controls button{width:29px}.bubble-controls #bubble-full{font-size:10px}.speed-choice select{max-width:75px}}
@media(max-height:480px){
 #app[data-screen=consult] .topbar{display:none}
 #consult .oracle-heading,#consult .conversation-mode{top:10px}.conversation-mode{right:18px}.oracle-heading{left:18px}
 #consult .oracle-heading #open-options{top:10px;right:150px}
 .bubble-view{top:60px;bottom:136px}.chat-view{top:60px;bottom:136px}.chat-view h2{display:none}.chat-log{padding:10px 16px}
 .speech-bubble p{max-height:18vh;font-size:13px}.speech-bubble{padding:8px 16px}.speech-bubble strong{display:none}
 .reply-controls .session-note{font-size:8px}.reply-controls .conversation-toolbar .text-button{padding:4px 0}
}
.bubble-view,.chat-view{bottom:var(--conversation-bottom,222px)}
#app.keyboard-open .bubble-view{top:15px}
#app.keyboard-open .conversation-mode{display:none}
#app.keyboard-open .chat-view{top:15px}
#app.keyboard-open .topbar,#app.keyboard-open .oracle-heading,#app.keyboard-open .topic-buttons{display:none}

/* Arrival and choice share one video: no cut to separate portrait cards. */
#arrival-stage{position:absolute;inset:0;overflow:hidden;background:#102126}
#arrival-fallback{position:absolute;width:100%;height:100%;object-fit:cover}
#arrival-stage #arrival-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
#journey{background:transparent}
#choice{background:linear-gradient(#06131775,transparent 25%,transparent 55%,#061317e8)}
#choice .choice-content{max-width:none;padding:112px 7% 24px;justify-content:flex-start}
#choice .choice-content h1{font-size:clamp(28px,3vw,43px);text-shadow:0 2px 15px #061317}
#choice .choice-content>p{text-shadow:0 1px 5px #000}
#choice .oracle-choices{margin-top:auto;flex:0 0 auto;min-height:0;max-height:none;gap:24%;align-items:end}
#choice .oracle-choice{background:none;border:0;overflow:visible;border-radius:10px;text-align:center;transition:transform .2s}
#choice .oracle-choice:hover{transform:translateY(-3px)}
#choice .choice-caption{position:static;background:none;padding:20px 0;gap:8px;align-items:center;text-shadow:0 2px 8px #00131c}
#choice .choice-caption strong{font-size:38px}
#choice .choose-label{background:#0b2429db;border:1px solid #e4ca90a1;border-radius:30px;padding:13px 24px;backdrop-filter:blur(12px);font-size:13px;color:#fff0ce}
#choice #replay{color:#eee4cf;font-size:11px;text-shadow:0 1px 5px #000}

/* The intake is the composer's current state, not a separate modal. */
#profile-form{background:#10272ded;border:1px solid var(--line);border-radius:19px;padding:16px 20px;box-shadow:0 8px 28px #00101545;backdrop-filter:blur(20px)}
#profile-form fieldset{border:0;margin:0;padding:0;min-width:0}
#profile-form label{margin:0;min-width:0;font-size:12px}
#profile-form input:not([type=checkbox]),#profile-form select{min-width:0;width:100%;margin-top:7px;padding:12px;border-radius:8px;background:#071a20;border:1px solid #e2c88f55;color:var(--paper);font-size:16px;height:46px}
#profile-form input[type=checkbox]{accent-color:var(--gold);width:18px;height:18px;flex-shrink:0}
#profile-form .checkbox{display:flex;align-items:flex-start;gap:10px;line-height:1.5;margin:10px 0 0}
#profile-form .checkbox input{margin:1px 0 0}
.intake-progress{font-size:10px;color:#e5cd9f;letter-spacing:.08em;margin-bottom:11px}
.intake-location{display:grid;grid-template-columns:1fr 1fr;gap:14px}
#birthplace-picker:not([data-multiple=true]) .intake-location{grid-template-columns:1fr}
.place-field{position:relative;min-width:0}
.place-options{position:absolute;bottom:calc(100% + 6px);left:0;width:100%;min-width:190px;max-height:min(250px,35dvh);overflow:auto;overscroll-behavior:contain;z-index:20;border:1px solid #d4bb8580;border-radius:10px;background:#10272d;box-shadow:0 8px 28px #0008;scrollbar-width:thin;scrollbar-color:#bca777 #10272d;text-shadow:none}
.place-options [role=option]{padding:10px 12px;min-height:40px;color:#f0e9d9;cursor:pointer;font-size:13px;line-height:1.35}
.place-options [role=option]:hover,.place-options [aria-selected=true]{background:#d8bc802b}
.place-options small{display:block;color:#b7c8c6;font-size:11px;margin-top:3px}
.place-no-results{padding:12px;color:#c3d0cd;font-size:12px}
#birthplace-picker input[aria-expanded=true]{border-color:#d4bb85}
@media(max-width:500px){#birthplace-picker[data-multiple=true] .intake-location{grid-template-columns:1fr}.place-options{min-width:0;max-height:min(220px,30dvh)}}
.intake-time{display:grid;grid-template-columns:1fr 1fr 1.1fr;gap:12px}
.intake-time select:disabled{opacity:.45}
.intake-time input:disabled{opacity:.45}
.birth-date-group{min-width:0}
.birth-date-group>span{font-size:12px}
.birth-date-parts{display:flex;align-items:center;gap:7px;min-width:0}
.birth-date-parts>label{flex:1;min-width:0}
.birth-date-parts>label:last-child{flex:1.55}
#profile-form .birth-date-parts input{text-align:center}
.birth-date-calendar{position:relative;order:1;flex:0 0 38px;align-self:stretch;margin-top:7px}
.birth-date-calendar button{height:100%;width:100%;min-height:38px;border:1px solid #e2c88f55;border-radius:8px;background:#071a20;color:var(--paper);font-size:23px}
#profile-form .birth-date-calendar input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;pointer-events:none}
#profile-form .birth-date-calendar input.calendar-fallback{opacity:1;pointer-events:auto;width:180px;left:auto;right:0;z-index:2;font-size:14px}
@media(min-width:851px){#consult[data-view=oracle] .birth-date-group{display:flex;align-items:center;gap:12px}#consult[data-view=oracle] .birth-date-group>span{flex-shrink:0}.birth-date-parts{flex:1}.birth-date-calendar{margin-top:5px}#consult[data-view=oracle] .birth-date-calendar{margin-top:0}}
@media(prefers-reduced-motion:reduce){.speech-bubble{animation:none}}
#profile-form .field-note{font-size:11px;line-height:1.5;margin:10px 0 0;color:#bbc9c8}
.intake-actions{display:flex;align-items:center;justify-content:flex-end;gap:18px;margin-top:12px}
.intake-actions .primary{padding:10px 20px;min-height:42px;font-size:12px;border-radius:8px}
.intake-actions #intake-back{margin-right:auto}
.intake-actions .text-button{font-size:11px;padding:8px 0}
#profile-error:empty{display:none}
#profile-form .form-error{margin:10px 0 0}
#intake-privacy{margin-top:11px;font-size:11px;color:#c6d0cb}
#intake-privacy summary{cursor:pointer;text-decoration:underline;text-underline-offset:3px}
#intake-privacy .intake-privacy-copy{margin-top:7px;max-height:92px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--gold) transparent}
#intake-privacy p{margin:0 0 7px;font-size:inherit;line-height:1.55;white-space:pre-wrap}
#intake-privacy p:last-child{margin-bottom:0}
#consult[data-intake=true] .reply-controls{width:min(640px,calc(100% - 48px))}
#consult[data-intake=true][data-view=chat] .reply-controls{width:min(530px,44%)}
@media(max-width:850px){
 #arrival-fallback{filter:blur(22px) brightness(.45);transform:scale(1.08)}
 #arrival-stage #arrival-video{object-fit:contain}
 #app[data-screen=choice] #arrival-video{top:22%;height:50%;object-fit:cover;object-position:50% 35%}
 #choice{background:linear-gradient(#06131733,transparent 40%,#061317c0)}
 #choice .choice-content{padding:105px 18px 18px}
 #choice .choice-content>p{font-size:12px;margin-top:9px}
 #choice .oracle-choices{gap:14px;width:100%}
 #choice .choice-caption{padding:12px 0;gap:7px}
 #choice .choice-caption strong{font-size:29px}#choice .choice-caption small{font-size:14px}
 #choice .choice-caption>span{font-size:11px}
 #choice .choose-label{padding:11px 14px;font-size:11px;margin-top:6px}
 #consult[data-intake=true] .reply-controls,#consult[data-intake=true][data-view=chat] .reply-controls{width:calc(100% - 36px)}
 #profile-form{padding:14px 16px}.intake-location{gap:10px}
 #profile-form label{font-size:11px}#profile-form .field-note{font-size:10px}
 .intake-actions{gap:12px}.intake-actions .text-button{font-size:10px}.intake-actions .primary{padding:10px 14px;font-size:11px}
 #consult[data-intake=true] .chat-view{top:190px}
}
@media(max-width:370px){#choice .choice-caption strong{font-size:25px}#choice .choose-label{padding:10px}#profile-form{padding:12px}.intake-progress{font-size:9px}.intake-actions{gap:8px}.intake-actions .primary{font-size:10px}}
@media(max-height:600px){
 #choice .choice-content{padding:84px 6% 8px}#choice .choice-content h1{font-size:26px}#choice .choice-content>p{display:none}#choice .choice-caption strong{font-size:27px}#choice .choice-caption{padding:7px 0}#choice .choice-caption>span:not(.choose-label){display:none}#choice #replay{padding:4px 0}
 #profile-form{padding:10px 14px}.intake-progress{margin-bottom:6px}.intake-actions{margin-top:7px}#profile-form .field-note{margin-top:5px}
 #consult[data-intake=true] .bubble-view{top:145px}
 #consult[data-intake=true] .chat-view{top:145px}
}
@media(max-height:480px){#consult[data-intake=true] .bubble-view,#consult[data-intake=true] .chat-view{top:60px}#profile-form .intake-progress{display:none}#profile-form .field-note{display:none}#profile-form{padding:8px 12px}}
#app.keyboard-open #consult[data-intake=true] .bubble-view,#app.keyboard-open #consult[data-intake=true] .chat-view{top:15px}

/* Wide Oracle view: keep the crystal above the centered input dock. */
@media(min-width:851px){
 #consult[data-view=oracle] #oracle-loop{inset:auto;bottom:var(--video-bottom,76px);left:50%;transform:translateX(-50%);width:min(100%,calc((100dvh - var(--video-bottom,76px)) * 16 / 9));height:auto;aspect-ratio:16 / 9;object-fit:contain;mask-image:linear-gradient(#000 calc(100% - 6px),transparent)}
 .reply-controls{bottom:14px}
 #profile-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 14px;padding:0;border:0;background:none;box-shadow:none;backdrop-filter:none;border-radius:0;text-shadow:0 1px 4px #001416}
 #profile-form .intake-progress{grid-column:1 / -1;grid-row:1;margin:0}
 #profile-form fieldset{grid-column:1;grid-row:2}
 #profile-form input:not([type=checkbox]),#profile-form select{height:38px;margin-top:5px;padding:7px 10px}
 #profile-form .intake-actions{grid-column:2;grid-row:2;align-self:end;margin:0;max-width:210px;gap:10px;flex-wrap:wrap}
 #profile-form .intake-actions .primary{min-height:38px;padding:8px 15px}
 #profile-form #intake-cancel:not([hidden]){flex-basis:100%;order:2;padding:0;text-align:right}
 #profile-form .form-error{grid-column:1 / -1;grid-row:3;margin:0}
 #consult[data-view=oracle][data-intake=true] .reply-controls{width:min(920px,calc(100% - 64px))}
 #consult[data-view=oracle] #profile-form{grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px 16px}
 #consult[data-view=oracle] #profile-form .intake-progress{grid-column:1;grid-row:1;white-space:nowrap}
 #consult[data-view=oracle] #profile-form fieldset{grid-column:2;grid-row:1}
 #consult[data-view=oracle] #profile-form .intake-actions{grid-column:3;grid-row:1;align-self:center}
 #consult[data-view=oracle] #profile-form .form-error{grid-row:2}
 #consult[data-view=oracle] #profile-form:has(fieldset[data-step=consent]:not([hidden])){align-items:baseline}
 #consult[data-view=oracle] #profile-form:has(fieldset[data-step=consent]:not([hidden])) .intake-actions{align-self:baseline}
 #consult[data-view=oracle] #intake-privacy{margin-top:0}
 #consult[data-view=oracle] #profile-form fieldset:is([data-step=name],[data-step=date])>label{display:flex;align-items:center;gap:12px}
 #consult[data-view=oracle] #profile-form fieldset:is([data-step=name],[data-step=date])>label>span{flex-shrink:0}
 #consult[data-view=oracle] #profile-form fieldset:is([data-step=name],[data-step=date]) input{margin-top:0}
 .reply-controls .conversation-toolbar .text-button{padding:5px 0}
 .reply-controls .topic-buttons{margin:3px 0 7px;gap:7px}
 .reply-controls .topic-buttons button{padding:5px 10px}
 .reply-controls .composer{padding:3px 5px 3px 13px;border-radius:13px}
 .reply-controls .composer textarea{padding:7px 0;min-height:36px;line-height:1.4}
 .reply-controls .composer button{width:36px;height:36px;border-radius:8px}
 .reply-controls .session-note{margin-top:5px}
}
@media(max-width:850px){
 #profile-form{padding:10px 14px}
 #profile-form .intake-progress{margin-bottom:7px}
 #profile-form input:not([type=checkbox]),#profile-form select{height:42px;padding:9px 10px;margin-top:5px}
 #profile-form .intake-actions{margin-top:8px}
}

/* Let the empty sides borrow the hall's light, without a second portrait. */
.dream-mist{display:none;pointer-events:none}
@media(min-width:851px){
 #consult[data-view=oracle]{--stage-video-width:min(100vw,calc((100dvh - var(--video-bottom,76px)) * 16 / 9))}
 #consult[data-view=oracle] .portrait-background{inset:0;filter:none;background-image:radial-gradient(ellipse 21% 76% at calc(50% - var(--stage-video-width) / 2) 42%,#38787988,transparent 85%),radial-gradient(ellipse 21% 76% at calc(50% + var(--stage-video-width) / 2) 42%,#38787988,transparent 85%),radial-gradient(ellipse 20% 55% at 12% 16%,#c2a36738,transparent 80%),radial-gradient(ellipse 20% 55% at 88% 16%,#c2a36738,transparent 80%),linear-gradient(110deg,#0a1a20,#163139 50%,#0a1a20)!important}
 #consult[data-view=oracle] #oracle-loop{mask-image:url('./dream-edge-mask.svg'),linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent),linear-gradient(#000 calc(100% - 6px),transparent);mask-size:100% 100%;mask-repeat:no-repeat;mask-composite:intersect}
 #consult[data-view=oracle] .dream-mist{display:block;position:absolute;bottom:var(--video-bottom,76px);left:50%;transform:translateX(-50%);width:var(--stage-video-width);aspect-ratio:16 / 9}
 .dream-mist::before,.dream-mist::after{content:'';position:absolute;top:-6%;height:112%;width:24%;background:radial-gradient(ellipse 53% 21% at 33% 18%,#628e8966,transparent 100%),radial-gradient(ellipse 62% 30% at 42% 62%,#397b7b88,transparent 100%),radial-gradient(ellipse 41% 24% at 62% 39%,#80aaa14a,transparent 100%),radial-gradient(ellipse 52% 17% at 37% 88%,#1c535ccc,transparent 100%),radial-gradient(ellipse 38% 13% at 45% 30%,#d0b37b30,transparent 100%);mask-image:radial-gradient(ellipse closest-side,#000 48%,#000000c9 65%,transparent 100%);opacity:.65;animation:dream-drift-left 27s ease-in-out infinite alternate paused;will-change:transform,opacity}
 .dream-mist::before{left:-6.75%}
 .dream-mist::after{right:-6.75%;background:radial-gradient(ellipse 52% 25% at 64% 29%,#6d96945c,transparent 100%),radial-gradient(ellipse 66% 27% at 56% 77%,#397b7b88,transparent 100%),radial-gradient(ellipse 43% 19% at 37% 51%,#80aaa14a,transparent 100%),radial-gradient(ellipse 38% 16% at 59% 13%,#d0b37b30,transparent 100%);animation-name:dream-drift-right;animation-duration:35s;animation-delay:-11s}
 #consult[data-mist-moving=true] .dream-mist::before,#consult[data-mist-moving=true] .dream-mist::after{animation-play-state:running}
}
@keyframes dream-drift-left{0%{transform:translate3d(-2%,-1.5%,0) scale(.98);opacity:.55}50%{transform:translate3d(3%,1%,0) scale(1.035);opacity:.78}100%{transform:translate3d(0,2%,0) scale(1.015);opacity:.64}}
@keyframes dream-drift-right{0%{transform:translate3d(2%,2%,0) scale(1.025);opacity:.72}50%{transform:translate3d(-3%,-1%,0) scale(.98);opacity:.53}100%{transform:translate3d(1%,-2%,0) scale(1.04);opacity:.8}}

/* A generous screen puts each bubble beside the face, not at the window edge. */
@media(min-width:1200px) and (min-height:651px){
 #consult[data-view=oracle]{--face-clearance:clamp(135px,calc(var(--stage-video-width) * .12),225px);--head-bubble-width:clamp(280px,23vw,405px)}
 #consult[data-view=oracle] .bubble-view{top:0}
 #consult[data-view=oracle] .bubble-card{left:calc(50% - var(--face-clearance) - var(--head-bubble-width));right:auto;top:clamp(165px,calc((100dvh - var(--video-bottom,76px)) * .225),245px);bottom:auto;width:var(--head-bubble-width);transform:none;max-height:calc(100% - 180px)}
 #consult[data-view=oracle] .bubble-card[data-side=right]{left:calc(50% + var(--face-clearance));right:auto;top:clamp(165px,calc((100dvh - var(--video-bottom,76px)) * .225),245px)}
 #consult[data-view=oracle] .speech-bubble p{max-height:min(29vh,260px)}
}

/* Below laptop width (or in a short window), use the familiar lower bubble. */
@media(min-width:851px) and (max-width:1199px), (min-width:1200px) and (max-height:650px){
 #consult[data-view=oracle] .bubble-card,#consult[data-view=oracle] .bubble-card[data-side=right]{top:auto;bottom:54px;left:50%;right:auto;transform:translateX(-50%);width:min(540px,calc(100% - 36px));max-height:calc(100% - 54px)}
 #consult[data-view=oracle] .speech-bubble,#consult[data-view=oracle] .bubble-card[data-side=right] .speech-bubble{padding:17px 20px;border-radius:22px 22px 22px 7px}
 #consult[data-view=oracle] .speech-bubble::after,#consult[data-view=oracle] .bubble-card[data-side=right] .speech-bubble::after{left:32px;right:auto;top:-17px;width:24px;height:22px;transform:none;clip-path:polygon(0 100%,50% 0,100% 100%)}
 #consult[data-view=oracle] .speech-bubble p{font-size:16px;line-height:1.5;max-height:min(25vh,190px)}
}

/* Keep playback controls beside the suggested questions, attached to the input. */
.reply-controls{display:flex;flex-direction:column}
.composer-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 10px;margin:3px 0 7px;min-width:0}
.reply-controls .composer-tools .topic-buttons{margin:0;gap:7px;min-width:0}
.composer-tools .bubble-controls{position:static;flex:0 0 auto;margin-left:auto;max-width:100%;padding:0 5px 0 8px;gap:3px;border-radius:16px}
.composer-tools .bubble-controls button{width:22px;height:22px;font-size:16px}
.composer-tools .bubble-controls #bubble-full{font-size:10px;padding-right:6px}
.composer-tools .bubble-controls #bubble-auto{font-size:11px}
.composer-tools .speed-choice select{font-size:10px;min-height:22px;height:22px;max-width:76px;padding:2px 3px 2px 5px}
.composer-tools #bubble-progress{font-size:9px;min-width:26px}
#consult[data-view=chat] .bubble-controls{display:none}
#consult[data-intake=true] .composer-tools{order:-1;margin:0 0 7px;justify-content:flex-end}
@media(max-width:1199px), (max-height:650px){
 #consult[data-view=oracle] .bubble-card,#consult[data-view=oracle] .bubble-card[data-side=right]{bottom:4px;max-height:calc(100% - 4px)}
}
@media(max-width:850px){
 .composer-tools .bubble-controls button{width:28px;height:28px}
 .composer-tools .speed-choice select{min-height:28px;height:28px}
 .composer-tools .bubble-controls #bubble-full{width:auto}
}

/* Give the centred desktop composer room for one quiet row of tools. */
@media(min-width:851px){
 #consult[data-view=oracle]:not([data-intake=true]) .reply-controls{width:min(1040px,calc(100% - 64px))}
 #consult[data-view=oracle] .composer-tools{flex-wrap:nowrap}
 #consult[data-view=oracle] .composer-tools .topic-buttons{flex-wrap:nowrap}
 #consult[data-view=oracle] .composer-tools .topic-buttons button{white-space:nowrap}
}

/* Keep the reader's viewport at its normal scale when a phone opens its keyboard. */
@media (pointer:coarse){
 #profile-form input:not([type=checkbox]),#profile-form select,.reply-controls .composer textarea{font-size:16px}
}
@media (pointer:coarse) and (orientation:portrait) and (max-width:850px){
 #app:not(.keyboard-open) #consult[data-view=oracle][data-has-reply=true] .portrait-main{
  height:calc(100% - var(--portrait-bottom,244px));
 }
}
/* The visitor's chart is a symbolic portrait; calculation stays in the engine. */
#chart-dialog{max-width:700px;border-radius:22px;background:radial-gradient(ellipse at 80% 0,#37574b48,transparent 50%),#102126}
#chart-dialog .dialog-top{margin-bottom:12px}
#chart-content{line-height:1.6}
.chart-intro{font:18px/1.55 var(--serif);color:#e3dfce;max-width:40em}
.chart-birth-moment{font-size:11px;color:#b8c6c0;margin:12px 0 22px}
.chart-identities{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.chart-identity{padding:20px;border:1px solid #d7bd8542;border-radius:16px;background:linear-gradient(135deg,#e5c9910c,transparent)}
#chart-content h3{font:11px/1.5 var(--sans);letter-spacing:.055em;color:#d6c69f;margin:0}
.chart-identity-value{font:30px/1.2 var(--serif);color:#f5e4bd;margin:12px 0}
#chart-content .chart-reflection-note{font-size:12px;line-height:1.65;color:#bac9c2;margin-top:9px}
.chart-open-spaces{margin:17px 0 0;padding:12px 16px 12px 29px;border-left:2px solid #c9b68166;background:#e5c99106;border-radius:0 10px 10px 0;color:#c9d2c8;font-size:12px}
.chart-open-spaces li+li{margin-top:6px}
.chart-theme-section,.chart-annual,.chart-invitation{margin-top:24px}
.chart-theme-list{list-style:none;padding:0;margin:13px 0;display:grid;grid-template-columns:1fr 1fr;gap:14px 20px}
.chart-theme-list li{display:flex;align-items:center;gap:11px;min-width:0}
.chart-theme-list strong{display:block;font-size:13px;font-weight:500;color:#e4dfce}
.chart-theme-list li div>span{display:block;font-size:11px;color:#bac9c2}
.chart-element-mark{width:24px;height:24px;flex:0 0 24px;border:1px solid var(--element-colour);border-radius:50%;background:radial-gradient(circle,var(--element-colour) 0 3px,transparent 4px);box-shadow:inset 0 0 10px color-mix(in srgb,var(--element-colour) 12%,transparent)}
[data-element=wood]{--element-colour:#a3c195}[data-element=fire]{--element-colour:#dda182}[data-element=earth]{--element-colour:#cfbd83}[data-element=metal]{--element-colour:#cad6d4}[data-element=water]{--element-colour:#91bfc9}
.chart-annual{padding:20px;border-radius:14px;border:1px solid #d7bd8529;background:#e5c99106}
.chart-annual-value{font:25px/1.35 var(--serif);color:#ead7ae;margin:9px 0}
.chart-annual>p:not([class]){font-size:13px;color:#d9ddd0}
.chart-invitation{border-top:1px solid #d7bd8529;padding-top:20px}
.chart-invitation>p{font:21px/1.5 var(--serif);color:#eee0bd;margin-top:8px}
@media(max-width:500px){
 #chart-dialog{padding:22px 20px}
 #chart-dialog .dialog-top h2{font-size:28px}
 .chart-identities{grid-template-columns:1fr;gap:10px}
 .chart-identity{padding:16px}
 .chart-identity-value{font-size:28px;margin:8px 0}
 .chart-theme-list{gap:12px}
 .chart-intro{font-size:17px}
}
