/* Final responsive layer: preserve the CAU palette and desktop composition. */
html { min-width:0; -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body { min-width:0; }
.app-shell,.workspace,.content,.scene-main,.scene-canvas-panel,.scene-agent-panel { min-width:0; }
button,a,input,select,textarea,summary { -webkit-tap-highlight-color:transparent; }
button,a,summary { touch-action:manipulation; }
dialog { max-width:calc(100vw - 24px); max-height:calc(var(--visible-height,100dvh) - 24px); overflow:auto; overscroll-behavior:contain; }
.table-wrap { max-width:100%; overflow:auto; overscroll-behavior-x:contain; }
@media(max-width:760px), (max-width:960px) and (max-height:500px) {
 .sidebar,body[data-experience="simple"] .sidebar { padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right)); }
 .sidebar .brand { min-width:0;max-width:100%; }
 .sidebar nav { min-width:0;max-width:100%;overflow-x:auto;justify-content:flex-start;overscroll-behavior-x:contain;scrollbar-width:thin;scroll-padding:12px;padding-bottom:5px; }
 .sidebar nav .nav-item { flex:0 0 auto;min-height:44px; }
 .topbar,body[data-experience="simple"] .topbar { gap:10px;flex-wrap:wrap;padding:10px max(14px,env(safe-area-inset-right)) 10px max(14px,env(safe-area-inset-left)); }
 .topbar .breadcrumb { min-width:0;flex:1;max-width:none;overflow-wrap:anywhere; }
 .topbar .toolbar { flex-shrink:0;flex-wrap:wrap; }
 .topbar .toolbar .icon-btn { min-width:44px;min-height:44px; }
 .content,body[data-experience="simple"] .content { padding:18px max(14px,env(safe-area-inset-right)) 28px max(14px,env(safe-area-inset-left)); }
 input:not([type=range]):not([type=checkbox]):not([type=radio]),select,textarea,
 .field input,.field select,.field textarea,#assistant-input,.scene-agent-panel #assistant-input { font-size:16px!important; }
 input,select,textarea { max-width:100%; }
 .btn,.icon-btn,.chart-tabs button,.model-controls button,.record-actions button { min-height:44px; }
 .row,.panel-head,.record-main,.record-actions { flex-wrap:wrap;min-width:0; }
 .page-title,.page-subtitle,.brand-hero h1,.scene-topline strong,.launch-heading h1 { overflow-wrap:anywhere; }
 .brand-hero-copy,.hero-credits,.lab-brand-band,.lab-brand-info { min-width:0;max-width:100%; }
 html[lang=en] .brand-hero h1 { font-size:clamp(30px,8vw,48px);line-height:1.15; }
 .scene-topline { flex-wrap:wrap;padding:12px;gap:8px; }
 .scene-topline button { min-height:44px; }
 .scene-main,.command-workspace.is-expanded .scene-main { grid-template-columns:1fr; }
 .scene-canvas-panel { padding:12px; }
 .scene-agent-panel { padding:16px 12px; }
 .scene-cell-picker { gap:7px; }
 .scene-cell-picker button { min-height:52px; }
 .scene-cell-picker span { overflow-wrap:anywhere; }
 .command-workspace { --scene-stage-height:clamp(250px,55svh,370px); }
 .command-workspace.is-expanded { --scene-stage-height:clamp(220px,50svh,370px);padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom); }
 .scene-agent-panel .assistant-examples { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .scene-experiments .launch-console { padding:16px!important; }
 .footer-note,.workspace>.footer-note { padding-bottom:calc(105px + env(safe-area-inset-bottom)); }
 .toast { left:14px!important;right:14px;bottom:calc(92px + env(safe-area-inset-bottom));max-width:calc(100vw - 28px);transform:none;overflow-wrap:anywhere; }
 #opening.energy-opening { padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right));padding-top:max(18px,env(safe-area-inset-top));padding-bottom:max(24px,env(safe-area-inset-bottom)); }
 .opening-institution { min-width:0;max-width:100%;flex-wrap:wrap; }
 .campus-destinations button { min-height:48px;overflow-wrap:anywhere; }
 /* The visible viewport follows the keyboard, including iOS's offset viewport. */
 #mem-site-guide>.site-guide-panel[data-placement=floating] {
  position:fixed;left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));
  top:calc(var(--visible-top,0px) + max(8px,env(safe-area-inset-top)));bottom:auto;width:auto;
  height:min(680px,calc(var(--visible-height,100dvh) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  max-height:calc(var(--visible-height,100dvh) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height:0;border-radius:22px;transform:none;
 }
 .site-guide-body { min-height:0; }
 .site-guide-input-row textarea { font-size:16px!important;resize:none; }
 .site-guide-icon-button { width:44px;min-height:44px; }
 .site-guide-send { width:44px;height:44px; }
 .site-guide-chip,.site-guide-start,.site-guide-live-controls button { min-height:44px; }
 .site-guide-settings { flex-wrap:wrap;gap:6px; }
 .site-guide-language-label select { min-height:36px;max-width:150px; }
 .site-guide-launcher-caption { display:none; }
 #mem-site-guide:has(>.site-guide-panel:not([hidden]))>.site-guide-launcher { visibility:hidden; }
 .site-guide-heading p { display:none; }
 html[data-keyboard-open=true] .site-guide-panel .site-guide-settings { display:none; }
 html[data-keyboard-open=true] .site-guide-panel .site-guide-header { padding-top:7px;padding-bottom:7px; }
 html[data-keyboard-open=true] .site-guide-panel .site-guide-composer { padding:8px 10px; }
 html[data-keyboard-open=true] .site-guide-panel .site-guide-voice-row { margin-top:3px; }
}
@media(max-width:480px) {
 .content>.stepper { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 8px; }
 .step { min-width:0;white-space:normal;overflow-wrap:anywhere; }
 .scene-cell-picker { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .scene-cell-picker button { display:flex;text-align:left;gap:9px;padding:8px 12px; }
 .scene-cell-picker span { font-size:12px; }
 .scene-cell-picker img { width:24px;height:30px; }
 .scene-agent-panel .assistant-engine { flex-wrap:wrap; }
 .site-guide-header { padding:10px; }
 .site-guide-heading h2 { font-size:15px; }
 .site-guide-brand { gap:7px; }
 .site-guide-mark { width:32px;height:36px; }
 .site-guide-settings { padding:7px 12px; }
 .site-guide-body { padding:12px; }
 .site-guide-composer { padding:9px 10px; }
 .site-guide-language-label>span { display:none; }
 .site-guide-provider { max-width:105px; }
 .launch-heading,.page-header { min-width:0; }
 .hero-credits { overflow-wrap:anywhere; }
}
@media(max-height:500px) and (max-width:960px) {
 .site-guide-header { padding-top:5px;padding-bottom:5px; }
 .site-guide-heading p { display:none; }
 .site-guide-body { min-height:0; }
 .scene-topline { padding-top:5px;padding-bottom:5px; }
}

@media(pointer:coarse) and (min-width:761px) {
 #mem-site-guide>.site-guide-panel[data-placement=floating]{position:fixed;right:max(12px,env(safe-area-inset-right));left:auto;top:calc(var(--visible-top,0px) + max(8px,env(safe-area-inset-top)));bottom:auto;width:min(440px,calc(100vw - 24px));height:min(680px,calc(var(--visible-height,100dvh) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));max-height:calc(var(--visible-height,100dvh) - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:0;}
 .site-guide-body{min-height:0}.site-guide-input-row textarea,.site-guide select{font-size:16px!important}
 #mem-site-guide:has(>.site-guide-panel:not([hidden]))>.site-guide-launcher{visibility:hidden}
 html[data-keyboard-open=true] .site-guide-panel .site-guide-settings{display:none}
}
