/* AutoScan responsive R1. Shared tokens; no changes to the ECU hero or business logic. */
:is(.portal-layout,.public-layout,.entry-page) { -webkit-text-size-adjust:100%; }
:is(.app-content,.entry-shell) :is(fieldset,.grow,.stack,.field,.combo) { min-width:0; }
:is(.app-content,.entry-shell) :is(input,select,textarea) { max-width:100%; }
:is(.app-content,.entry-shell) :is(h1,h2,h3,p,dd,.file-name,.file-picker-name) { overflow-wrap:anywhere; }
:is(.app-content,.entry-shell) :is(img,video) { max-width:100%; height:auto; }
:is(.portal-layout,.public-layout,.entry-page) :is(button,a,input,select,textarea,summary) { touch-action:manipulation; }
.portal-layout .table-wrap { max-width:100%; overscroll-behavior-x:contain; }
.portal-layout .button-row { flex-wrap:wrap; }
.portal-layout :is(.btn,.table-btn) { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.portal-layout :is(.file-row,.document-row,.session-row) > .grow { min-width:0; }
.public-layout .site-footer a { overflow-wrap:anywhere; }
.portal-layout .workspace-tabs { scrollbar-width:thin; scroll-padding-inline:8px; }
.portal-layout :is(.conversation-file,.file-row strong) { overflow-wrap:anywhere; min-width:0; }
.portal-layout .conversation-file > span { min-width:0; }
.portal-layout .conversation-file svg { flex-shrink:0; }
:is(.portal-layout,.public-layout) dialog { max-width:calc(100vw - 24px); max-height:calc(var(--as-viewport-height,100dvh) - 24px); overflow:auto; overscroll-behavior:contain; }
:is(.portal-layout,.public-layout) dialog::backdrop { background:#060c2180; }
.as-menu-close { display:none; }
html.as-menu-open { overflow:hidden; }
html.as-menu-open body { overflow:hidden; }
@media screen and (max-width:1200px) {
 .portal-layout :is(.layout-2,.admin-grid-main,.admin-editor-grid,.admin-delivery-grid,.conversation-grid,.pgc-workspace) { grid-template-columns:minmax(0,1fr); }
 .portal-layout .request-grid-wide { grid-template-columns:minmax(0,1fr); }
 .portal-layout .pgc-context { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media screen and (max-width:1050px) {
 .public-layout .site-navigation { max-height:calc(var(--as-viewport-height,100dvh) - 100px); overflow-y:auto; overscroll-behavior:contain; }
}
@media screen and (max-width:900px) {
 :is(.portal-layout,.public-layout,.entry-page) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) { font-size:16px; }

 .portal-layout .sidebar { width:min(300px,calc(100vw - 48px)); height:100dvh; height:var(--as-viewport-height,100dvh); padding-bottom:max(20px,env(safe-area-inset-bottom)); overscroll-behavior:contain; }
 .portal-layout .sidebar .brand { margin-right:36px; }
 .portal-layout .sidebar .as-menu-close { display:grid; place-items:center; position:absolute; right:8px; top:18px; width:44px; height:44px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--text); font-size:24px; }
 .portal-layout .sidebar:not(.open) { visibility:hidden; }
 .portal-layout .sidebar.open { visibility:visible; }
 .portal-layout .topbar { padding-top:max(10px,env(safe-area-inset-top)); }
 .portal-layout :is(.request-grid,.request-simple .request-grid) { grid-template-columns:minmax(0,1fr); }
 .portal-layout .request-simple { padding-bottom:calc(var(--as-summary-height,100px) + 28px + env(safe-area-inset-bottom)); }
 .portal-layout .request-simple .request-summary-sticky { left:max(12px,env(safe-area-inset-left)); right:max(12px,env(safe-area-inset-right)); bottom:max(10px,env(safe-area-inset-bottom)); }
 .portal-layout .request-simple .request-summary-sticky .panel-body { gap:12px; flex-wrap:wrap; }
 .portal-layout.as-has-summary .chat-launch { bottom:calc(var(--as-summary-height,100px) + 22px + env(safe-area-inset-bottom)); }
 .portal-layout.as-keyboard-open .request-summary-sticky { visibility:hidden; pointer-events:none; }
 .portal-layout.as-keyboard-open .chat-launch { display:none; }
 .portal-layout .order-facts { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .entry-page .entry-selectors { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media screen and (max-width:700px) {
 /* Header keeps every control, wrapping preferences instead of clipping them. */
 .portal-layout .topbar { gap:8px; flex-wrap:wrap; padding-inline:max(12px,env(safe-area-inset-left)); }
 .portal-layout .topbar > .mobile-menu { flex:0 0 44px; width:44px; height:44px; min-height:44px; }
 .portal-layout .top-actions { flex:1 1 calc(100% - 60px); flex-wrap:wrap; justify-content:flex-end; gap:8px; }
 .portal-layout .top-actions .preferences { flex:1 1 100%; order:2; justify-content:flex-end; gap:8px; }
 .portal-layout .top-actions .preferences .combo-compact { min-width:100px; max-width:150px; }
 .portal-layout .top-actions .preferences .combo-trigger { font-size:14px; min-height:44px; padding:8px 12px; }
 .portal-layout .top-actions :is(.notification-link,.admin-inbox-sound) { width:44px; height:44px; min-height:44px; flex-shrink:0; }
 .portal-layout .top-actions .header-balance { display:flex; font-size:13px; min-height:44px; white-space:normal; }
 .portal-layout .top-actions .user-copy { display:none; }
 .portal-layout .top-actions .avatar { width:40px; height:40px; }
 .portal-layout .searchbox { flex:1 1 100%; order:3; max-width:none; }
 .portal-layout .app-content { padding:22px max(12px,env(safe-area-inset-right)) 24px max(12px,env(safe-area-inset-left)); }
 .portal-layout :is(.panel-head,.panel-body,.toolbar) { padding:18px; }
 .portal-layout .panel-head { flex-wrap:wrap; }
 .portal-layout :is(.form-grid,.auth-layout .form-grid,.delivery-grid,.order-bottom,.admin-delivery-files,.pgc-fields) { grid-template-columns:minmax(0,1fr); }
 .portal-layout :is(.order-filters,.ticket-filters,.inbox-filters,.admin-filters) { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; }
 .portal-layout :is(.order-filters,.ticket-filters,.inbox-filters) .field { min-width:0; margin:0; }
 .portal-layout .filter-actions { display:flex; flex-wrap:wrap; gap:10px; }
 .portal-layout .filter-actions > * { flex:1; }
 .portal-layout :is(.ops-search,.directory-search,.document-search,.pgc-search,.admin-performance-search) { flex-wrap:wrap; }
 .portal-layout :is(.ops-search,.directory-search,.document-search,.pgc-search) .field { flex-basis:100%; min-width:0; }
 .portal-layout :is(.admin-command,.account-overview,.pgc-toolbar,.order-hero-meta) { flex-wrap:wrap; }
 .portal-layout .data-table { min-width:0; }
 .portal-layout .data-table tr { padding:18px; min-width:0; }
 .portal-layout .data-table td { white-space:normal; }
 .portal-layout .data-table td[colspan] { grid-column:1/-1; text-align:start; justify-self:stretch; }
 .portal-layout :is(.file-row,.document-row,.session-row,.work-item) { flex-wrap:wrap; }
 .portal-layout :is(.file-row,.document-row) > .grow { flex:1 1 150px; min-width:0; }
 .portal-layout :is(.file-row,.document-row) > .btn { min-height:44px; }
 .portal-layout .inbox-workspace .notification-row { grid-template-columns:32px minmax(0,1fr); }
 .portal-layout .inbox-workspace .notification-row > form { grid-column:2; margin:0; }
 .portal-layout .conversation { height:clamp(460px,75dvh,720px); min-height:0; }
 .portal-layout .conversation .conversation-messages { min-height:100px; padding:12px; }
 .portal-layout .conversation .message { max-width:94%; padding:12px; }
 .portal-layout .conversation .message .split { flex-wrap:wrap; }
 .portal-layout .conversation .conversation-compose { grid-template-columns:minmax(0,1fr); max-height:55%; padding:12px; overflow:auto; }
 .portal-layout .conversation-compose > * { min-width:0; }
 .portal-layout .conversation-compose .button-row { grid-column:1/-1; }
 .portal-layout .conversation-compose .btn { min-height:44px; }
 .portal-layout .conversation-compose textarea { min-height:72px; }
 .portal-layout :is(.pg-intro,.pg-result-head,.pg-ecu,.pg-foot) { flex-wrap:wrap; gap:14px; }
 .portal-layout .pg-selector { grid-template-columns:minmax(0,1fr); }
 .portal-layout .pg-ecu strong { overflow-wrap:anywhere; }
 .portal-layout .pg-metrics { grid-template-columns:minmax(0,1fr); }
 .portal-layout .pgc-context { grid-template-columns:minmax(0,1fr); }
 .portal-layout .pgc-steps { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .portal-layout .plans-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .portal-layout .plans-card { min-width:0; }
 .portal-layout .plans-hero { flex-wrap:wrap; }
 .portal-layout :is(.plans-checkout,.plans-methods) { grid-template-columns:minmax(0,1fr); }
 :is(.portal-layout,.public-layout) :is(.checkout-dialog,#chat-dialog) { width:calc(100vw - 24px); max-width:560px; max-height:calc(var(--as-viewport-height,100dvh) - 24px); }
 :is(.portal-layout,.public-layout) dialog[open] { position:fixed; top:calc(var(--as-viewport-top,0px) + 12px); bottom:auto; margin:0 auto; }
 :is(.portal-layout,.public-layout) dialog .panel-body { padding:16px; }
 :is(.portal-layout,.public-layout) .chat-launch { bottom:max(16px,env(safe-area-inset-bottom)); right:max(12px,env(safe-area-inset-right)); }
 :is(.portal-layout,.public-layout) .combo-popup { min-width:0; }
 :is(.portal-layout,.public-layout) :is(.combo-trigger,.btn,.icon-btn,.table-btn,.workspace-tabs a) { min-height:44px; }
 .portal-layout .footer { padding-bottom:calc(84px + env(safe-area-inset-bottom)); }
 /* Public navigation and content only: the existing ECU scene is untouched. */
 .public-layout .site-header { flex-wrap:wrap; gap:10px; padding-inline:16px; }
 .public-layout .site-tools { flex-wrap:wrap; gap:8px; }
 .public-layout .site-navigation { top:var(--as-public-header-height,86px); }
 .public-layout .site-tools .preferences .combo-trigger { min-height:44px; font-size:12px!important; }
 .public-layout .public-content:not(.home-content) :is(.form-grid,.layout-2,.service-grid) { grid-template-columns:minmax(0,1fr); }
 .public-layout .public-content:not(.home-content) { overflow-wrap:anywhere; }
 .public-layout .public-content:not(.home-content) .btn { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
 :is(.portal-layout,.public-layout) .check { min-height:44px; align-items:flex-start; }
 .public-layout .site-footer { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .public-layout .footer-bottom { flex-wrap:wrap; }
 .entry-page .entry-shell { padding:20px max(12px,env(safe-area-inset-right)) 36px max(12px,env(safe-area-inset-left)); }
 .entry-page .entry-card { padding:16px; }
 .entry-page :is(.entry-selectors,.entry-engine-grid,.entry-pair) { grid-template-columns:minmax(0,1fr); }
 .entry-page :is(.entry-path-save,.entry-submit) { flex-direction:column; align-items:stretch; }
 .entry-page .entry-picker-panel { width:100%; max-width:100%; left:0; right:auto; }
 .entry-page .entry-picker-list { max-height:min(300px,40dvh); overflow:auto; overscroll-behavior:contain; }
 .entry-page .entry-picker-toggle { white-space:normal; overflow-wrap:anywhere; }
 .entry-page .entry-picker-choice { min-width:0; overflow-wrap:anywhere; }
 .entry-page .entry-card .entry-picker-cross { width:44px; min-width:44px; min-height:44px; padding:8px; flex:none; }
}
@media screen and (max-width:380px) {
 .portal-layout :is(.stats-grid,.plans-grid,.queue-lanes,.admin-shortcuts) { grid-template-columns:minmax(0,1fr); }
 .portal-layout .data-table tr { grid-template-columns:minmax(0,1fr); }
 .portal-layout .data-table td:last-child { justify-self:stretch; text-align:start; }
 .public-layout .site-tools { flex:1 1 100%; justify-content:space-between; }
 .public-layout .site-tools .preferences .combo-compact { min-width:90px; max-width:120px; }
}
@media (hover:none) {
 .portal-layout :is(.stat-card,.plans-card,.admin-shortcut):hover { transform:none; }
}
@media screen and (prefers-reduced-motion:reduce) {
 .portal-layout :is(.sidebar,.stat-card,.plans-card,.pg,.pgc) { scroll-behavior:auto; transition:none; }
}
