/* One coordinate system for the classic shell and its moving cutouts at 9:21. */
[data-mode=mob] .lever{top:calc(var(--yh)*1cqh);height:calc(var(--hh)*1cqh)}

/* Warm metal and gold lamps, with a restrained blue instrument screen. */
[data-mode=mob][data-cockpit=new]{--lamp:#edb86c;--lamp-hot:#ffe2ac;--sonar:#9cbfca;--ice:#f1eee3;--mist:#b3c5c8;--line:#b4b69b4a;--cb-ink:#d1cbb6;--cb-ink-hot:#fff0cf;--cb-glass:linear-gradient(180deg,#302c25f5,#18252cf5 58%,#101a20f7)}
[data-mode=mob][data-cockpit=new] .hull{filter:sepia(.72) saturate(.9)}
[data-mode=mob][data-cockpit=new] .lights{filter:sepia(.85) saturate(1.45)}
[data-mode=mob][data-cockpit=new] .cb .cb-edge::after{background:linear-gradient(90deg,transparent,#ecc17da0,transparent)}
[data-mode=mob][data-cockpit=new] .cb .cb-ic{filter:drop-shadow(0 0 3px #efb76544)}

/* Every content panel belongs to the large physical screen. Its DOM hosts stay
   stable across cockpit switches, preserving input, selection and voice state. */
#stage.lower-console :is(#holo,#beam,#ruler,#scrL,#scrR){display:none!important}
#stage.lower-console #uiMain{padding:0;overflow:hidden}
#stage.lower-console #scrMain>.bg{background:linear-gradient(180deg,#102832f5,#071923f7);box-shadow:inset 0 0 0 1px #e5b97260}
#stage.lower-console #scrMain>.scan{opacity:.2;pointer-events:none}
#stage.lower-console #scrMain{container:cockpit-console / size}
#stage.lower-console #uiMain>.console-content{display:flex;flex-direction:column;order:1;flex:1;min-height:0;min-width:0;overflow:hidden;padding:4px 10px;outline-offset:-2px;box-sizing:border-box}
.console-content[hidden]{display:none!important}
#stage.lower-console #bodyMain{display:flex;position:relative;flex:1;min-height:0;min-width:0;height:auto;overflow:hidden}
#stage.lower-console #bodyMain>.view{position:relative;inset:auto;display:flex;flex:1;flex-direction:column;gap:4px;min-height:0;min-width:0;height:auto;overflow:hidden}
#stage.lower-console #deepi-surface[aria-hidden=true],#stage.lower-console.registration-open #bodyMain{display:none!important}
#stage.lower-console #deepi-choices,#stage.lower-console #deepi-intake{flex:1;gap:4px;min-height:0;min-width:0}
#stage.lower-console #deepi-review{height:auto;min-height:120px}
#stage.lower-console .reference-intake{flex:1;min-height:0;min-width:0;gap:4px;overflow:hidden}
/* Only a long document/list may scroll; the question and actions never do. */
#stage.lower-console .intake-content{flex:1;min-height:0;min-width:0;gap:4px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#stage.lower-console .q{flex:none;font-size:12px;line-height:1.3;margin:0}
#stage.lower-console .intake-help{display:none}
#stage.lower-console .tiles{flex:1;gap:6px;min-height:52px;grid-template-columns:repeat(3,minmax(0,1fr))}
#stage.lower-console .tile{min-width:0;min-height:52px;padding:4px;gap:4px;box-sizing:border-box}
#stage.lower-console .tile .ic{width:20px;height:20px}
#stage.lower-console .tile .tl{font-size:12px}
#stage.lower-console .tile .ts{display:none}
#stage.lower-console .other-establishment{min-height:32px;padding:5px;font-size:10px}
#stage.lower-console .intake-actions{position:static;flex:none;display:flex;flex-wrap:nowrap;gap:6px;margin:0;padding:0;background:none;z-index:auto}
#stage.lower-console .intake-actions .btn{flex:1;min-width:0;height:38px;padding:4px 7px;gap:5px;font-size:12px;line-height:1.15;letter-spacing:.02em;box-sizing:border-box}
#stage.lower-console .intake-actions .btn svg{flex:none;width:15px;height:15px}
#stage.lower-console .intake-content input,#stage.lower-console .intake-content textarea{font-size:16px}
#stage.lower-console .intake-content .field{flex:1;gap:4px;justify-content:center}
#stage.lower-console .intake-content input{height:40px;padding:7px 10px;box-sizing:border-box}
#stage.lower-console .intake-content>.inp{flex:1;min-height:44px;overflow:hidden}
#stage.lower-console .intake-content textarea{height:100%;min-height:0;padding:6px 10px;box-sizing:border-box}
#stage.lower-console .intake-content .sum{margin:0;gap:3px 8px;font-size:12px;line-height:1.3}
#stage.lower-console .intake-content .sum dt{font-size:9px;letter-spacing:.04em}
#stage.lower-console .lookup-status{font-size:11px}
#stage.lower-console .lookup-sources{gap:6px}
#stage.lower-console .lookup-sources a{font-size:10px}
#stage.lower-console.console-navigation #uiMain>.route{order:0;margin:3px 10px 0;gap:4px;min-height:24px;--sd:18px}
#stage.lower-console.console-navigation #uiMain>.route .st{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:4px;min-height:24px}
#stage.lower-console.console-navigation #uiMain>.route .sd{width:19px;height:19px;font-size:10px}
#stage.lower-console.console-navigation #uiMain>.route .sl{font-size:8px;margin:0;white-space:normal}
#stage.lower-console.console-navigation #uiMain>.route .trk{display:none}
#stage.lower-console.console-navigation #uiMain>.head{order:2;flex:none;margin-top:0;padding:2px 36px 2px 10px;min-height:24px;gap:7px;border-top:1px solid #a9b6b02e;box-sizing:border-box}
#stage.lower-console.console-navigation #uiMain>.head .av{width:18px;height:18px;font-size:14px}
#stage.lower-console.console-navigation #uiMain>.head .av svg{inset:-2px;width:26px;height:26px}
#stage.lower-console.console-navigation #uiMain>.head .who{display:flex;flex-direction:row;align-items:center;gap:6px}
#stage.lower-console.console-navigation #uiMain>.head .who b{font-size:9px;flex:none}
#stage.lower-console.console-navigation #uiMain>.head .who small{min-width:0;font-size:9px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#stage.lower-console.console-navigation #uiMain>.head .wave{display:none}
#stage.lower-console .cb-mini{width:24px;height:24px;bottom:0;right:7px}
#stage.lower-console #uiMain>.marine-route{order:0;flex:none;padding:3px 12px 0;gap:4px}
#stage.lower-console .marine-route button{min-height:32px;display:flex;align-items:center;justify-content:center;gap:4px;padding:3px}
#stage.lower-console .marine-route b{font-size:12px}#stage.lower-console .marine-route span{font-size:9px}
#stage.lower-console #explorationHud{position:relative;inset:auto;transform:none;width:100%;max-width:none;margin:0;padding:0;text-align:left;pointer-events:auto}
#stage.lower-console #explorationHud .marine-kicker{font-size:8px;letter-spacing:.1em;margin:1px 0 4px}
#stage.lower-console #explorationHud h2{font-size:19px;line-height:1.2;margin:0 0 3px}
#stage.lower-console #marineDepth{font-size:11px;margin:3px 0}
#stage.lower-console #marineVoice{display:block;font-size:10px;line-height:1.35;margin:5px 0}
#stage.lower-console #bFullscreen{min-height:30px;font-size:10px;padding:5px 10px;margin:2px 0}
#stage.lower-console .journey-prompt,#stage.lower-console .journey-prompt.is-exploring{position:relative;inset:auto!important;transform:none;width:100%;max-width:none;margin:4px 0 7px;padding:7px 28px 7px 9px;gap:7px;font-size:11px;border-radius:8px;box-shadow:none}
#stage.lower-console .journey-prompt.is-exploring{padding-right:9px}
#stage.lower-console .journey-action{min-height:34px;font-size:10px;padding:6px;max-width:45%;background:#f0d49f;border-color:#f0d49f;color:#302114}
#stage.lower-console :is(.voice-notice,.deepi-voice-error){position:relative;inset:auto;transform:none;display:block;width:100%;max-width:none;box-sizing:border-box;padding:7px 9px;margin:3px 0 6px;font-size:11px;text-align:left;border-color:#d9ad685c;background:#2f291de8}
#stage.lower-console .voice-notice[hidden]{display:none}
#stage.lower-console .toast{display:none;position:relative;inset:auto;transform:none;width:100%;margin:4px 0;padding:7px;font-size:11px;opacity:1}
#stage.lower-console .toast.on{display:block}
#stage.lower-console .cockpit-enrollment-panel{position:relative;inset:auto;transform:none;width:100%;height:auto;max-height:none;margin:0;padding:4px 1px 7px;border:0;border-radius:0;background:none;box-shadow:none;backdrop-filter:none;animation:none}
#stage.lower-console .cockpit-enrollment-panel[hidden]{display:none}
#stage.lower-console .cockpit-enrollment-panel::before,#stage.lower-console .cockpit-enrollment-panel::after{display:none}
#stage.lower-console .ce-form{height:auto;gap:8px}#stage.lower-console .ce-content{flex:none;overflow:visible}
#stage.lower-console .ce-header{display:none}#stage.lower-console .ce-progress button{min-height:32px;flex-direction:row}
#stage.lower-console .ce-form h1{font-size:20px}#stage.lower-console .ce-footer{position:sticky;bottom:-5px;background:#091d27f5;z-index:2;padding-block:6px}
#stage.lower-console.registration-open #uiMain>.route{display:none}
/* Compact labels retain their complete accessible name. */
.intake-label-short{display:none}
[data-mode=mob] .intake-label-full{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
[data-mode=mob] .intake-label-short{display:inline}
#stage.lower-console .tiles.four{grid-template-columns:repeat(4,minmax(0,1fr))}
#stage.lower-console .tiles.four .tile{min-height:44px}
#stage.lower-console .intake-content .read{grid-template-columns:48px minmax(0,1fr);gap:8px;min-height:0;padding:0}
#stage.lower-console .intake-content .ring{width:48px;height:48px}
#stage.lower-console .intake-content .ring b{font-size:18px}
#stage.lower-console .intake-content .ring small{display:none}
#stage.lower-console .reading-status{font-size:12px}
#stage.lower-console .reading-status p{font-size:10px;margin:3px 0}
#stage.lower-console .done-big{padding:0;min-height:0}
#stage.lower-console .done-big b{font-size:14px}
#stage.lower-console .done-big p{font-size:11px;margin:4px 0}
#stage.lower-console .intake-error{flex:none;font-size:11px;line-height:1.2;padding:3px 6px;max-height:30px}
#stage.lower-console .rb-menu-import[data-compact=true]{display:grid;grid-template-columns:1fr 1fr;align-content:center;gap:4px;flex:1;min-width:0}
#stage.lower-console .rb-menu-import[data-compact=true] .rb-upload{padding:4px;min-height:42px;gap:3px;flex-direction:row;border-radius:9px}
#stage.lower-console .rb-menu-import[data-compact=true] .rb-upload>svg{width:18px;height:18px;flex:none}
#stage.lower-console .rb-menu-import[data-compact=true] .rb-upload strong{font-size:12px}
#stage.lower-console .rb-menu-import[data-compact=true] .rb-upload>span{display:none}
#stage.lower-console .rb-menu-import[data-compact=true] .rb-camera-import{min-height:42px;font-size:11px;gap:4px;border:1px solid var(--line);border-radius:9px}
#stage.lower-console .rb-menu-import[data-compact=true] .rb-note{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;height:22px;font-size:10px}
#stage.lower-console .rb-menu-import[data-compact=true] .rb-note button{display:grid;place-items:center;width:44px;height:24px}
#stage.lower-console .rb-menu-pages{grid-column:1/-1;margin:0;max-height:none;overflow:visible}
#stage.lower-console .rb-menu-pages li{height:42px;padding:2px 4px;gap:5px;box-sizing:border-box}
#stage.lower-console .rb-menu-pages li>img,#stage.lower-console .rb-menu-pages li>svg{width:26px;height:26px;flex:none}
#stage.lower-console .rb-menu-pages strong{font-size:11px}
#stage.lower-console .rb-menu-pages small{font-size:9px}
#stage.lower-console .rb-menu-pages button{width:28px;height:36px}
#stage.lower-console .reference-intake[data-step=menu][data-menu-method=files]>.intake-question{display:none}
/* Preserve a bounded content area for account forms too. */
#stage.lower-console.registration-open #deepi-enrollment{display:flex;flex:1;min-height:0}
#stage.lower-console .cockpit-enrollment-panel{display:flex;flex:1;min-height:0;overflow:hidden}
#stage.lower-console .ce-form{height:100%;min-height:0;flex:1}
#stage.lower-console .ce-content{flex:1;min-height:0;overflow:auto}
#stage.lower-console .ce-footer{position:static;flex:none}
#stage.lower-console #deepi-notices,#stage.lower-console #deepi-journey{flex:none;max-height:44px;overflow:auto}
/* Dense steps get the space otherwise reserved for the decorative voice strip. */
#stage.lower-console:has(.reference-intake[data-step=lookup],.reference-intake[data-step=confirm],.reference-intake[data-menu-method=files]) #uiMain>.head{display:none}
#stage.lower-console:has(.reference-intake[data-step=lookup],.reference-intake[data-step=confirm],.reference-intake[data-menu-method=files]) #bPauseMobile{display:none}
@container cockpit-console (max-height:180px){
 #stage.lower-console #uiMain>.head,#stage.lower-console #bPauseMobile{display:none}
 #stage.lower-console .intake-question{font-size:11px}
 #stage.lower-console .tile .tl{font-size:11px}
}
/* All three phone shells share a full-size, unprojected typing surface.
   Apply on focus, not only after the viewport shrinks (Safari auto-zoom). */
#stage.lower-console[data-mode=mob].editing #cp{left:0!important;top:0!important;width:100%!important;height:100%!important}
#stage.lower-console[data-mode=mob].editing #scrMain{left:12px!important;top:64px!important;width:calc(100% - 24px)!important;height:calc(100% - 76px)!important;transform:none!important;clip-path:none!important;z-index:20}
#stage.lower-console[data-mode=mob].editing :is(#consoleBar,#scrTop,#cockpitVersion,.expedition-robot){visibility:hidden;pointer-events:none}
#stage.lower-console[data-mode=mob].editing #topbar{display:flex!important;top:8px!important;left:12px;right:12px}
#stage.lower-console[data-mode=mob].editing #uiMain>.route,#stage.lower-console[data-mode=mob].editing #uiMain>.head,#stage.lower-console[data-mode=mob].editing #bPauseMobile{display:none}
#stage.lower-console[data-mode=mob].editing .console-content{padding:10px 12px}
#stage.lower-console[data-mode=mob].editing .intake-question{font-size:14px;line-height:1.35}
#stage.lower-console[data-mode=mob].editing .intake-content .field{flex:0 0 auto;justify-content:flex-start;margin-block:8px}
#stage.lower-console[data-mode=mob].editing .intake-content :is(input,textarea){font-size:16px;scroll-margin-block:12px}
#stage.lower-console[data-mode=mob].editing .intake-actions .btn{height:44px;min-height:44px}

/* Exploration is a clear windshield in every shell. Keep the live portal hosts
   mounted in the physical lower display, including warnings and return actions. */
#stage.exploring.lower-console #uiMain>.head,#stage.exploring.lower-console #bPauseMobile{display:none}
#stage.exploring.lower-console[data-mode=mob]:not([data-cockpit=new]) :is(#scrL,#scrR),#stage.exploring.lower-console[data-mode=desk] #scrR{display:block!important}
#stage.exploring.lower-console #uiMain>.console-content{overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:2px 8px}
#stage.exploring.lower-console #explorationHud{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 6px;align-items:center;flex:none}
#stage.exploring.lower-console #explorationHud .marine-kicker,#stage.exploring.lower-console #marineVoice{display:none}
#stage.exploring.lower-console #explorationHud h2{font:500 13px/1.2 var(--f-display);margin:0}
#stage.exploring.lower-console #marineDepth{font-size:9px;line-height:1.2;margin:0;grid-column:1}
#stage.exploring.lower-console #bFullscreen{grid-column:2;grid-row:1 / 3;min-height:32px;height:auto;margin:0;padding:4px 6px;font-size:9px}
#stage.exploring.lower-console .journey-prompt.is-exploring{grid-column:1 / -1;margin:2px 0 0;padding:0;border:0;background:none;display:block}
#stage.exploring.lower-console .journey-prompt.is-exploring .journey-copy{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#stage.exploring.lower-console .journey-prompt.is-exploring .journey-action{width:100%;max-width:none;min-height:36px;font-size:11px;padding:4px 8px}
#stage.exploring.lower-console #uiMain>.marine-route{padding:2px 8px 0;gap:3px}
#stage.exploring.lower-console .marine-route button{min-height:25px;padding:2px;gap:3px}
#stage.exploring.lower-console .marine-route b{font-size:10px}
#stage.exploring.lower-console .marine-route span{font-size:8px}
/* Raise the classic navigation to the roof, below the variant selector. */
#stage[data-mode=mob][data-cockpit=classic]:not(.editing) #topbar{top:max(64px,7cqh);gap:4px}
#stage[data-mode=desk].exploring #topbar{top:8px}
#stage[data-mode=mob][data-cockpit=classic] #topbar .tbr{gap:4px}
#stage[data-mode=mob][data-cockpit=classic] #bView{padding-inline:8px;font-size:11px}
/* Sleeping Deepi sits directly above the ocean (0), below the HUD (3) and
   physical cockpit/panels (4). Keep the same GLB and voice session mounted. */
#stage>.expedition-robot[data-layer=background]{z-index:1}
#stage>.expedition-robot[data-layer=background] .expedition-robot-button{opacity:.68}
#stage>.expedition-robot[data-layer=foreground]{z-index:6}
#stage>.expedition-robot .expedition-robot-button{transition:opacity .5s ease}
#stage>.expedition-robot[data-materializing=true] .expedition-robot-button{animation:deepi-materialize .85s ease-out both}
@keyframes deepi-materialize{0%{opacity:0;filter:blur(5px) brightness(1.8) saturate(.2)}35%{opacity:.35;filter:blur(1px) brightness(1.6) saturate(.4)}65%{opacity:.8;filter:blur(0) brightness(1.2)}100%{opacity:1;filter:none}}
/* A small, persistent wake control stays above panels when the robot is behind
   them. The new and 3D shells already have their physical Deepi control. */
#stage[data-mode=mob][data-cockpit=classic]:has(>.expedition-robot[data-layer=background]) #bDeepi{display:flex;align-items:center;justify-content:center}
#stage #bDeepi .dp-wake-mark{font:700 12px/1 var(--f-inst);letter-spacing:.03em;color:var(--sonar)}
#stage .rb.deepi:has(.dp-wake-mark){min-width:36px}
#stage[data-mode=mob][data-cockpit=classic] #topbar .rb{width:34px;min-width:34px}
#stage.hull-loading #bDeepi{visibility:hidden}
@media(prefers-reduced-motion:reduce){#stage>.expedition-robot .expedition-robot-button{animation:none!important;transition:none}}

#stage #bDeepi:has(.dp-wake-mark){padding:0;gap:0}
#stage #bDeepi:has(.dp-wake-mark) .pulse{display:none}

/* Vertical panel avoidance is independent from the continuous horizontal
   patrol: opening/closing a panel cannot restart or snap its route. */
#stage>.expedition-robot{transition:translate 1.25s cubic-bezier(.22,.7,.2,1)}
#stage>.expedition-robot[data-avoiding-panel=true] .expedition-robot-button{pointer-events:none}
#stage>.expedition-robot[data-avoiding-panel=true] .expedition-robot-button::after{content:'';position:absolute;inset:22%;pointer-events:auto}
@media(prefers-reduced-motion:reduce){#stage>.expedition-robot{transition:none!important}}
/* Deepi réveillé par sa voix ElevenLabs : il reste à sa place, en pleine lumière. */
#stage>.expedition-robot[data-tts=awake] .expedition-robot-button{opacity:1}
#stage>.expedition-robot[data-tts=awake]{z-index:4}
/* Deepi qui s'écarte d'un cadre passe devant le tableau de bord (jamais devant le cadre lui-même). */
#stage>.expedition-robot[data-avoiding-panel=true]{z-index:6}
/* Garé à côté d'un cadre : il ne bloque aucun bouton du tableau de bord, et reste lumineux sur le fond sombre. */
#stage>.expedition-robot[data-avoiding-panel=true] .expedition-robot-button::after{display:none}
#stage>.expedition-robot[data-avoiding-panel=true] canvas{filter:brightness(1.35) saturate(1.1) drop-shadow(0 0 10px #a6f3fb55)}
#stage>.expedition-robot[data-avoiding-panel=true]::before{content:'';position:absolute;inset:20%;border-radius:50%;background:radial-gradient(circle,#bff4ff40 0%,#73e4f122 45%,transparent 72%);z-index:-1;pointer-events:none}
