:root.palion-manifestation-mode .chat-header { display: none !important; }
:root.palion-manifestation-mode #palionWorkspaceSphereOverlay,
:root.palion-manifestation-mode #workspaceSwitcher { display: none !important; }
:root.palion-manifestation-mode #chatHistory { opacity: 0; pointer-events: none; max-height: 1px; overflow: hidden; }
:root.palion-manifestation-mode #chatSpatialSurface { display: none !important; }
:root.palion-manifestation-mode #palionWorkspaceLayer:not(:has(> .settings-workspace:not(.hidden), > .tasks-workspace:not(.hidden), > .help-workspace:not(.hidden), > .todays-flow-workspace:not(.hidden), > .calendar-workspace:not(.hidden), > .email-workspace:not(.hidden), > .vitality-workspace:not(.hidden), > .planner-workspace:not(.hidden), > .palion-web-workspace:not(.hidden), > .coding-workspace-modal:not(.hidden))) { display: none !important; visibility: hidden !important; pointer-events: none !important; flex: 0 0 0 !important; width: 0 !important; height: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
:root.palion-manifestation-mode #palionWorkspacesContainer { display: block !important; min-height: 0 !important; height: 100% !important; overflow: hidden !important; background: transparent !important; border: 0 !important; }
:root.palion-manifestation-mode #avatarStage { border-inline: 0 !important; background: transparent !important; }
:root.palion-manifestation-mode #palionHomeScene { display: flex !important; flex-direction: column !important; width: min(100%, 1120px) !important; min-height: 0 !important; margin: 0 auto !important; padding: clamp(8px, 2vh, 18px) clamp(12px, 3vw, 36px) max(10px, env(safe-area-inset-bottom)) !important; box-sizing: border-box !important; }
:root.palion-manifestation-mode #homeContextRail,
:root.palion-manifestation-mode #chatCanvasPanel { display: none !important; }
:root.palion-manifestation-mode { --palion-presence-left: clamp(24px, 5vw, 88px); --palion-presence-footprint: clamp(236px, 22vw, 320px); --palion-presence-gap: clamp(20px, 3vw, 48px); --palion-response-safe-start: calc(var(--palion-presence-left) + var(--palion-presence-footprint) + var(--palion-presence-gap)); }
:root.palion-manifestation-mode #homeIdentityBlock { position: fixed !important; z-index: 940 !important; left: var(--palion-presence-left) !important; top: max(96px, 22vh) !important; display: flex !important; flex: 0 0 auto !important; width: var(--palion-presence-footprint) !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; pointer-events: none !important; }
:root.palion-manifestation-mode #homeIdentityBlock[data-palion-presence-placement="top"] { top: 18px !important; width: auto !important; }
:root.palion-manifestation-mode #homeIdentityBlock.palion-presence-surface[data-palion-presence-placement="top"] #homeIdentityAvatarSlot { width: clamp(160px, 16vw, 208px) !important; height: clamp(160px, 16vw, 208px) !important; min-width: clamp(160px, 16vw, 208px) !important; min-height: clamp(160px, 16vw, 208px) !important; flex-basis: clamp(160px, 16vw, 208px) !important; }
:root.palion-manifestation-mode #homeIdentityBlock[data-palion-presence-placement="yield"] { width: clamp(180px, 16vw, 224px) !important; }
:root.palion-manifestation-mode #homeIdentityBlock.palion-presence-surface[data-palion-presence-placement="yield"] #homeIdentityAvatarSlot { width: clamp(156px, 14vw, 196px) !important; height: clamp(156px, 14vw, 196px) !important; min-width: clamp(156px, 14vw, 196px) !important; min-height: clamp(156px, 14vw, 196px) !important; flex-basis: clamp(156px, 14vw, 196px) !important; }
:root.palion-manifestation-mode #homeIdentityBlock[data-palion-presence-placement="top"] #homeIdentityGreeting,
:root.palion-manifestation-mode #homeIdentityBlock[data-palion-presence-placement="top"] #homeIdentityState { display: none !important; }
:root.palion-manifestation-mode #homeIdentityBlock[data-palion-presence-placement="hidden"] { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; transform: scale(.84) !important; }
:root.palion-manifestation-mode #homeIdentityAvatarSlot { width: clamp(208px, 18vw, 272px) !important; height: clamp(208px, 18vw, 272px) !important; min-width: 0 !important; min-height: 0 !important; flex: 0 0 auto !important; }
:root.palion-manifestation-mode #homeThoughtCards,
:root.palion-manifestation-mode #homePresenceBlock,
:root.palion-manifestation-mode #focusAvatarOverlay { display: none !important; }
:root.palion-manifestation-mode .home-command-dock { margin-top: auto !important; flex: 0 0 auto !important; }
#palionManifestationLayer { position: fixed; inset: 0; z-index: 950; pointer-events: none; overflow: clip; }
.palion-manifestation { position: absolute; pointer-events: auto; width: min(480px, var(--palion-content-safe-width, calc(100vw - 48px))); max-width:var(--palion-content-safe-width, calc(100vw - 48px)); max-height:var(--palion-content-safe-height, 100vh); overflow:auto; overscroll-behavior:contain; touch-action:pan-y; color: #edf7f0; padding: 8px 0; box-sizing:border-box; min-width:0; animation: palion-manifest-in .22s ease-out; transition: opacity .18s ease, transform .18s ease, filter .18s ease, translate .18s ease; }
.palion-manifestation--grouped { padding: 14px 16px; background: rgba(5, 13, 10, .52); backdrop-filter: blur(12px); border: 1px solid rgba(92, 255, 164, .16); border-radius: 16px; box-shadow: 0 18px 54px rgba(0,0,0,.24); }
.palion-manifestation[data-placement="left"] { left: max(7vw, 56px); top: 22vh; }
.palion-manifestation[data-placement="right"] { left:var(--palion-response-safe-start, max(7vw, 56px)); right: max(7vw, 56px); top: 22vh; width:auto; max-width:min(480px, calc(100vw - var(--palion-response-safe-start, 0px) - max(7vw, 56px))); }
.palion-manifestation[data-placement="center"] { left: 50%; top: 14vh; transform: translateX(-50%); width: min(720px, calc(100vw - 48px)); }
.palion-manifestation[data-placement="bottom"] { left: 50%; bottom: 88px; transform: translateX(-50%); }
.palion-manifestation[data-composition-role="focus"] { z-index: 2; }
.palion-manifestation--selected { outline:1px solid rgba(146,255,196,.5); outline-offset:6px; }
.palion-manifestation--referent-resolved { outline:1px solid rgba(184,251,212,.82); outline-offset:7px; filter:drop-shadow(0 0 12px rgba(92,255,164,.22)); }
.palion-compare { min-width:0; }.palion-compare__source { border-top:1px solid rgba(255,255,255,.09); padding:10px 0; }.palion-compare__source h3 { margin:0 0 6px; font-size:13px; color:#b8fbd4; }.palion-compare dl { margin:0; display:grid; gap:4px; }.palion-compare dl div { display:grid; grid-template-columns:minmax(88px,auto) 1fr; gap:10px; }.palion-compare dt { color:rgba(235,255,244,.55); text-transform:capitalize; }.palion-compare dd { margin:0; overflow-wrap:anywhere; }
.palion-manifestation--moving { opacity:.88; filter:drop-shadow(0 14px 24px rgba(0,0,0,.3)); transition:none; cursor:grabbing; }
.palion-manifestation--expanded { width:min(720px, var(--palion-content-safe-width, calc(100vw - 48px))); max-height:var(--palion-content-safe-height, 640px); }
#palionDiscardTarget { position:fixed; z-index:3; left:50%; bottom:max(100px, env(safe-area-inset-bottom) + 84px); translate:-50% 0; padding:8px 14px; border:1px solid rgba(255,130,110,.52); border-radius:999px; color:#ffb0a0; background:rgba(42,8,6,.64); font-size:12px; letter-spacing:.06em; text-transform:uppercase; pointer-events:none; animation:palion-manifest-in .14s ease-out; }
.palion-manifestation--yielding { z-index: 1; opacity: .64; filter: saturate(.72); }
.palion-manifestation[data-palion-scene-geometry] { position:fixed; left:var(--palion-scene-left) !important; top:var(--palion-scene-top) !important; right:auto !important; bottom:auto !important; width:var(--palion-scene-width) !important; max-width:var(--palion-scene-width) !important; height:var(--palion-scene-height) !important; max-height:var(--palion-scene-height) !important; display:grid; grid-template-rows:0 minmax(0,1fr) auto auto; transform:none !important; translate:none !important; overflow:hidden; }
.palion-manifestation--scene-yielded { visibility:hidden; opacity:0 !important; pointer-events:none !important; }
.palion-manifestation[data-content="media"] { width:min(720px, var(--palion-content-safe-width, calc(100vw - 48px))); max-height:var(--palion-content-safe-height, min(58vh, 640px)); overflow:auto; }
.palion-manifestation[data-content="media"] img, .palion-manifestation[data-content="media"] video, .palion-manifestation[data-content="media"] canvas { display:block; width:auto; max-width:100%; height:auto; max-height:calc(var(--palion-content-safe-height, 58vh) - 16px); object-fit:contain; border:0; background:transparent; }
.palion-manifestation[data-palion-scene-geometry][data-content="media"] { overflow:hidden; }
.palion-manifestation[data-palion-scene-geometry][data-content="media"] img, .palion-manifestation[data-palion-scene-geometry][data-content="media"] video, .palion-manifestation[data-palion-scene-geometry][data-content="media"] canvas { width:100%; max-height:calc(var(--palion-scene-height) - 16px); object-fit:contain; }
.palion-manifestation__head { display:flex; justify-content:flex-end; align-items:center; height:0; position:relative; z-index:1; }
.palion-manifestation button { border: 0; background: transparent; color: #b8fbd4; cursor:pointer; padding:6px; }
.palion-manifestation__dismiss { width:32px; height:32px; display:grid; place-items:center; font-size:20px; line-height:1; opacity:0; transform:translateY(-4px); transition:opacity .16s ease, transform .16s ease; }
.palion-manifestation:hover .palion-manifestation__dismiss, .palion-manifestation:focus-within .palion-manifestation__dismiss { opacity:.72; transform:translateY(0); }
.palion-manifestation__body { max-width:68ch; min-height:0; line-height:1.62; color:#edf7f0; }
.palion-manifestation[data-palion-scene-geometry] .palion-manifestation__body { min-height:0; min-block-size:0; align-self:stretch; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; padding-right:4px; }
.palion-manifestation[data-intent="conversation"] .palion-manifestation__body { font-size:clamp(16px, 1.35vw, 20px); }
.palion-conversation { overflow-wrap:anywhere; }.palion-conversation > :first-child { margin-top:0; }.palion-conversation > :last-child { margin-bottom:0; }.palion-conversation p { margin:0 0 1em; }.palion-conversation h1,.palion-conversation h2,.palion-conversation h3 { color:#dfffe9; line-height:1.25; margin:1.25em 0 .5em; }.palion-conversation h1 { font-size:1.35em; }.palion-conversation h2 { font-size:1.18em; }.palion-conversation h3 { font-size:1.05em; }.palion-conversation ul,.palion-conversation ol { margin:.35em 0 1em; padding-left:1.35em; }.palion-conversation li { margin:.28em 0; padding-left:.12em; }.palion-conversation strong { color:#b8fbd4; font-weight:650; }.palion-conversation em { color:#dfffe9; }.palion-conversation code { font: .88em/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; color:#b8fbd4; background:rgba(92,255,164,.08); padding:.1em .32em; border-radius:4px; }.palion-conversation pre { max-width:100%; max-height:calc(var(--palion-content-safe-height, 58vh) - 84px); overflow:auto; margin:0 0 1em; padding:12px; box-sizing:border-box; background:rgba(0,0,0,.28); border-left:1px solid rgba(92,255,164,.28); }.palion-conversation pre code { padding:0; background:transparent; white-space:pre; }.palion-conversation a { color:#92ffc4; text-decoration-thickness:1px; text-underline-offset:3px; }.palion-conversation__table { max-width:100%; overflow:auto; overflow-y:visible; margin:0 0 1em; }.palion-conversation table { width:max-content; min-width:100%; border-collapse:collapse; font-size:.84em; }.palion-conversation th,.palion-conversation td { max-width:32ch; padding:.45em .55em; text-align:left; border-bottom:1px solid rgba(255,255,255,.1); white-space:normal; overflow-wrap:anywhere; }.palion-conversation th { color:#b8fbd4; font-weight:650; }
.palion-manifestation[data-content="numeric"] .palion-manifestation__body { max-width:100%; font-size:clamp(24px, min(8vw, 9vh), 96px); line-height:1; overflow-wrap:anywhere; }
.palion-manifestation__provenance { margin-top:12px; color:rgba(235,255,244,.55); font-size:11px; }
.palion-manifestation__actions { display:flex; gap:8px; margin-top:10px; }.palion-manifestation__actions:empty { display:none; }
.palion-manifestation__actions button { border:1px solid rgba(92,255,164,.3); border-radius:999px; }
/* Contextual choices use the same manifestation and action callbacks. */
html.palion-manifestation-mode .palion-manifestation[data-content="choices"] { display:grid !important; grid-template-rows:0 auto auto minmax(0,1fr); align-items:stretch; justify-items:stretch; }
.palion-manifestation[data-content="choices"] .palion-manifestation__body { padding-right:44px; }
.palion-manifestation[data-content="choices"] .palion-manifestation__body p { margin:0 0 6px; font-size:clamp(17px,1.4vw,21px); }
.palion-manifestation[data-content="choices"] .palion-manifestation__actions { grid-row:4; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr)); gap:8px; align-content:start; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
.palion-manifestation[data-content="choices"] .palion-manifestation__actions button { min-height:44px; padding:9px 12px; border-color:rgba(235,255,244,.16); border-radius:10px; color:#edf7f0; background:rgba(255,255,255,.025); font:inherit; text-align:left; overflow-wrap:anywhere; }
.palion-manifestation[data-content="choices"] .palion-manifestation__actions button:hover { border-color:rgba(146,255,196,.5); background:rgba(92,255,164,.06); }
.palion-manifestation[data-content="choices"] button:focus-visible { outline:2px solid #b8fbd4; outline-offset:-2px; }
.palion-manifestation[data-content="choices"] .palion-manifestation__dismiss { width:44px; height:44px; align-self:flex-start; opacity:.65; transform:none; }
.palion-history-item { border-top:1px solid rgba(255,255,255,.09); padding:10px 0; }.palion-history-item small { color:#92ffc4; }.palion-history-item[data-role="user"] small { color:rgba(235,255,244,.62); }.palion-history-item__text { margin-top:4px; }.palion-history-item__text .palion-conversation p { margin:.35em 0; }
.palion-manifestation[data-content="calendar"] .palion-manifestation__body { max-width:none; }
.palion-calendar-manifest h2 { margin: 0; font-size: 22px; }.palion-calendar-summary { color: rgba(235,255,244,.6); font-size: 12px; margin: 4px 0 12px; }.palion-calendar-event { display:grid; grid-template-columns:82px 1fr; gap:10px; padding:9px 0; border-top:1px solid rgba(255,255,255,.09); }.palion-calendar-event time { color:#92ffc4; font-size:12px; }.palion-calendar-empty { color:rgba(235,255,244,.64); padding:16px 0; }
.palion-calendar-week { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }.palion-calendar-week__day { min-height:116px; padding:8px; border:1px solid rgba(255,255,255,.10); border-radius:8px; background:rgba(255,255,255,.025); }.palion-calendar-week__heading { display:block; color:#92ffc4; font-size:11px; margin-bottom:7px; }.palion-calendar-month { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; min-width:580px; }.palion-calendar-month__weekday { color:rgba(235,255,244,.62); font-size:10px; font-weight:700; letter-spacing:.06em; padding:5px; text-align:center; text-transform:uppercase; }.palion-calendar-month__day { min-height:92px; padding:6px; border:1px solid rgba(255,255,255,.10); border-radius:7px; background:rgba(255,255,255,.025); overflow:hidden; }.palion-calendar-month__day--outside { opacity:.38; }.palion-calendar-month__date { display:block; color:#92ffc4; font-size:11px; font-weight:700; margin-bottom:5px; }.palion-calendar-month__event { display:block; overflow:hidden; color:rgba(245,255,250,.9); font-size:10px; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; }.palion-calendar-month__more { color:rgba(235,255,244,.55); font-size:10px; margin-top:3px; }
@media (min-width:768px) { .palion-manifestation[data-palion-layout="immersive"][data-content="calendar"] .palion-manifestation__body { display:flex; }.palion-manifestation[data-palion-layout="immersive"] .palion-calendar-manifest[data-calendar-view="month"] { display:grid; flex:1; min-height:100%; grid-template-rows:auto auto minmax(0,1fr); }.palion-manifestation[data-palion-layout="immersive"] .palion-calendar-month { height:100%; min-height:0; grid-template-rows:auto repeat(6,minmax(0,1fr)); }.palion-manifestation[data-palion-layout="immersive"] .palion-calendar-month__day { min-height:0; } }
.palion-document-manifest h2 { margin:0; font-size:20px; overflow-wrap:anywhere; }.palion-document-provenance { color:#92ffc4; font-size:11px; margin:5px 0 12px; }.palion-document-manifest pre { margin:0; max-height:calc(var(--palion-content-safe-height, 58vh) - 84px); overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; line-height:1.6; }.palion-document-note { color:rgba(235,255,244,.64); font-size:11px; margin:12px 0 0; }
.palion-code-manifest { min-width:0; max-width:100%; }.palion-code-manifest h2 { margin:0; font-size:17px; overflow-wrap:anywhere; }.palion-code-provenance { color:#92ffc4; font-size:11px; overflow-wrap:anywhere; }.palion-code-manifest pre { max-width:100%; max-height:calc(var(--palion-content-safe-height, 48vh) - 84px); overflow:auto; padding:10px; box-sizing:border-box; border-radius:10px; background:rgba(0,0,0,.34); }.palion-code-manifest code { font:12px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace; white-space:pre; }
.palion-semantic-result h2 { margin:0; font-size:20px; }.palion-semantic-result__summary,.palion-semantic-result__detail { margin:5px 0 12px; color:rgba(235,255,244,.64); font-size:12px; }.palion-semantic-result__primary { margin:14px 0 5px; color:#edf7f0; font-size:16px; font-weight:600; }.palion-semantic-result__item { display:grid; grid-template-columns:minmax(96px,auto) 1fr auto; gap:10px; align-items:baseline; padding:10px 0; border-top:1px solid rgba(255,255,255,.09); list-style:none; }.palion-semantic-result ol { margin:0; padding:0; }.palion-semantic-result__item time { color:#92ffc4; font-size:12px; }.palion-semantic-result__item small { color:rgba(235,255,244,.52); font-size:10px; text-transform:capitalize; }.palion-semantic-result__empty { color:rgba(235,255,244,.64); margin:16px 0 0; }
.palion-manifestation--leaving { animation: palion-manifest-out .16s ease-in forwards; }
@keyframes palion-manifest-in { from { opacity:0; transform:translateY(8px) scale(.985); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes palion-manifest-out { to { opacity:0; transform:translateY(8px); } }
@media (max-width:780px) { .palion-manifestation, .palion-manifestation[data-placement="left"], .palion-manifestation[data-placement="right"], .palion-manifestation[data-placement="center"] { left:16px; right:16px; top:auto; bottom:calc(var(--palion-mobile-keyboard, 0px) + 88px + env(safe-area-inset-bottom)); width:auto; max-height:min(58vh, calc(var(--palion-visible-height, 100vh) - 104px)); transform:none; } }
@media (prefers-reduced-motion: reduce) { .palion-manifestation, .palion-manifestation--leaving { animation:none; } .palion-manifestation--referent-resolved { filter:none; } }

/* Manifestation-mode mobile shell: browser chrome must never inherit desktop
   geometry. The transcript stays mounted for continuity but no longer owns
   the visible stage; the command dock is the one compact input surface. */
@media (max-width: 767px) {
  html.palion-manifestation-mode,
  html.palion-manifestation-mode body { width: 100%; max-width: 100%; overflow-x: hidden; }
  html.palion-manifestation-mode #mainContentStage,
  html.palion-manifestation-mode #avatarStage,
  html.palion-manifestation-mode #palionHomeScene { width: 100% !important; max-width: 100% !important; min-width: 0 !important; box-sizing: border-box; }
  html.palion-manifestation-mode #palionHomeScene { padding: 6px 12px max(8px, env(safe-area-inset-bottom)) !important; }
  html.palion-manifestation-mode .home-command-dock { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; min-width: 0 !important; box-sizing: border-box; }
  html.palion-manifestation-mode #chatComposerShell { width: 100% !important; max-width: 100% !important; min-width: 0 !important; box-sizing: border-box; padding: 7px !important; }
  html.palion-manifestation-mode .home-composer-row { width: 100%; min-width: 0; gap: 6px !important; }
  html.palion-manifestation-mode #command { flex: 1 1 0 !important; width: auto !important; min-width: 0 !important; max-width: 100% !important; }
  html.palion-manifestation-mode #chatComposerActions { flex: 0 0 auto; min-width: 0; gap: 5px !important; }
  html.palion-manifestation-mode .home-voice-wave-control { width: 42px; height: 42px; min-width: 42px; }
  html.palion-manifestation-mode #chatComposerActions button,
  html.palion-manifestation-mode #submitBtn { width: 40px !important; height: 40px !important; min-width: 40px !important; }
  html.palion-manifestation-mode .palion-manifestation { width: min(calc(100vw - 24px), var(--palion-content-safe-width, calc(100vw - 24px))); max-width: var(--palion-content-safe-width, calc(100vw - 24px)); left: 12px; right:12px; bottom: calc(var(--palion-mobile-keyboard, 0px) + 76px + env(safe-area-inset-bottom)); max-height:var(--palion-content-safe-height, calc(var(--palion-visible-height, 100vh) - 92px)); box-sizing: border-box; }
  html.palion-manifestation-mode .palion-manifestation__actions { flex-wrap: wrap; }
  html.palion-manifestation-mode #homeIdentityBlock,
  html.palion-manifestation-mode #homeIdentityBlock[data-palion-presence-placement="compact"],
  html.palion-manifestation-mode #homeIdentityBlock[data-palion-presence-placement="yield"] { left: max(16px, env(safe-area-inset-left)) !important; top: max(14px, env(safe-area-inset-top)) !important; width: auto !important; transform:none !important; translate:none !important; }
  html.palion-manifestation-mode #homeIdentityBlock #homeIdentityAvatarSlot { width: 72px !important; height: 72px !important; min-width: 72px !important; min-height: 72px !important; }
  html.palion-manifestation-mode #homeIdentityBlock[data-palion-presence-placement="yield"] #homeIdentityAvatarSlot { width: 96px !important; height: 96px !important; min-width: 96px !important; min-height: 96px !important; }
  html.palion-manifestation-mode #homeIdentityBlock[data-palion-presence-placement="hidden"] { visibility:hidden !important; }
  .palion-calendar-month { min-width:0; gap:3px; }.palion-calendar-month__weekday { font-size:9px; padding:3px 1px; }.palion-calendar-month__day { min-height:68px; padding:4px; }.palion-calendar-month__event { font-size:9px; }.palion-calendar-week { grid-template-columns:1fr; }.palion-calendar-week__day { min-height:0; }
  html.palion-manifestation-mode #homeIdentityBlock #homeIdentityGreeting,
  html.palion-manifestation-mode #homeIdentityBlock #homeIdentityState { display: none !important; }
  #palionDevBanner { left: 8px !important; right: 8px !important; width: auto !important; max-width: calc(100vw - 16px) !important; padding: 5px 8px !important; font-size: 11px !important; line-height: 1.3 !important; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
  #palionDevBanner [data-dev-session-label] { min-width: 0; overflow-wrap: anywhere; }
  #palionDevBanner #palionDevSignIn { margin-left: 0 !important; flex: 0 0 auto; }
}

@media (max-width: 780px) {
  /* native-spatial-repair.css used this shared class for a decorative legacy
     surface and hides it at this breakpoint. A semantic manifestation is a
     different renderer: reclaim its mobile presentation contract here. */
  html.palion-manifestation-mode #palionManifestationLayer { z-index: 950 !important; }
  html.palion-manifestation-mode .palion-manifestation {
    display: block !important;
    position: fixed !important;
    height: auto !important;
    pointer-events: auto !important;
    z-index: 1 !important;
  }
  /* The compositor supplies a concrete left and width for the compact reply.
     The base bottom placement centers with translateX(-50%); without this
     override that desktop placement transform shifts the entire reply (body
     and text included) left by half its allocated width. */
  html.palion-manifestation-mode .palion-manifestation[data-palion-scene-geometry][data-placement="bottom"] {
    transform: none !important;
    translate: none !important;
    margin-inline: 0 !important;
  }
  html.palion-manifestation-mode .palion-manifestation[data-intent="conversation"] .palion-manifestation__body,
  html.palion-manifestation-mode .palion-manifestation[data-intent="conversation"] .palion-conversation {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-inline: 0;
    box-sizing: border-box;
  }
  html.palion-manifestation-mode #homeIdentityBlock #homeIdentityAvatarSlot {
    display: grid !important;
  }
  html.palion-manifestation-mode #matrixCanvas,
  html.palion-manifestation-mode #matrixFallback { top: var(--palion-visible-offset-top, 0px) !important; bottom: auto !important; height: var(--palion-visible-height, 100vh) !important; }
  html.palion-manifestation-mode #palionGlobalCommandBar { bottom: calc(var(--palion-mobile-keyboard, 0px) + max(10px, env(safe-area-inset-bottom))) !important; }
  html.palion-manifestation-mode.palion-mobile-keyboard-open #homeIdentityBlock { opacity: .72; }
}

/* iOS may update innerHeight with the keyboard, making a keyboard-only rule
   unreliable. Portrait cards therefore always use the live visual viewport's
   upper safe region; the runtime measures the composer to bound their height.
   Landscape continues to use the established bottom-sheet composition. */
@media (max-width: 767px) and (orientation: portrait) {
  html.palion-manifestation-mode .palion-manifestation {
    position: fixed;
    top: calc(var(--palion-visible-offset-top, 0px) + max(72px, env(safe-area-inset-top) + 56px));
    left: 12px;
    right: 12px;
    bottom: auto;
    width: calc(100vw - 24px);
    max-height:min(var(--palion-portrait-manifestation-height, calc(var(--palion-visible-height, 100vh) - 156px)), var(--palion-content-safe-height, calc(var(--palion-visible-height, 100vh) - 156px)));
    overflow-y: auto;
  }
  /* The focus owns the full measured viewport. Supporting context yields
     before it can obscure the composer. */
  html.palion-manifestation-mode.palion-composition-has-focus .palion-manifestation[data-composition-role="context"]:not([data-palion-scene-geometry]) { opacity:0; pointer-events:none; transform:translateY(10px) scale(.98); }
  html.palion-manifestation-mode .palion-manifestation[data-composition-role="focus"] { max-height:var(--palion-portrait-manifestation-height, calc(var(--palion-visible-height, 100vh) - 156px)); }
}

@media (max-width: 480px) {
  html.palion-manifestation-mode #commandUploadBtn { display: none !important; }
}

/* Portrait keeps one input row with external voice and attachment lanes. */
@media (max-width: 767px) and (orientation: portrait) {
  html.palion-manifestation-mode #palionGlobalCommandBar #chatComposerShell {
    width: calc(100% - 100px) !important;
    margin-left: 50px !important;
  }
  html.palion-manifestation-mode #palionGlobalCommandBar .home-composer-row {
    position: relative;
    flex-wrap: nowrap !important;
  }
  html.palion-manifestation-mode #palionGlobalCommandBar #chatComposerActions {
    display: contents !important;
  }
  html.palion-manifestation-mode #palionGlobalCommandBar #command {
    padding-right: 50px !important;
  }
  html.palion-manifestation-mode #palionGlobalCommandBar #homeVoiceWaveBtn,
  html.palion-manifestation-mode #palionGlobalCommandBar #chatComposerActions button {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }
  html.palion-manifestation-mode #palionGlobalCommandBar #homeVoiceWaveBtn {
    position: absolute;
    left: -63px;
    bottom: 0;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    user-select: none;
  }
  html.palion-manifestation-mode #palionGlobalCommandBar #homeVoiceWaveBtn.voice-muted-passive {
    border-color: rgba(255, 92, 92, .65) !important;
    color: #ff8e8e !important;
  }
  html.palion-manifestation-mode #palionGlobalCommandBar #chatComposerShell #chatComposerActions #submitBtn {
    position: absolute;
    right: 0;
    bottom: 0;
  }
  html.palion-manifestation-mode #palionGlobalCommandBar #chatComposerShell #chatComposerActions #commandUploadBtn {
    display: inline-flex !important;
    position: absolute;
    right: -57px;
    bottom: 0;
  }
  /* Keep the existing mute action in the accessibility tree. Keyboard focus
     reveals it over the voice control without adding a permanent button. */
  html.palion-manifestation-mode #palionGlobalCommandBar #chatComposerShell #chatComposerActions #palVoiceMuteBtn {
    display: inline-flex !important;
    position: absolute;
    left: -63px;
    bottom: 0;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    border: 0 !important;
    transition: none !important;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  html.palion-manifestation-mode #palionGlobalCommandBar #chatComposerShell #chatComposerActions #palVoiceMuteBtn:focus-visible {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    clip-path: none;
    z-index: 1;
    background: #02160f !important;
    outline: 2px solid #b8fbd4;
    outline-offset: 2px;
  }
}
