/* Mobile is a reading surface, with portrait artwork and touch-sized controls.
   Desktop rules stay in editorial.css; no billing or report state lives here. */
@media(max-width:700px){
  :root{-webkit-text-size-adjust:100%;text-size-adjust:100%}
  .scene-background-image{object-position:center}
  body::after{background:linear-gradient(180deg,#101c2baa,transparent 150px),linear-gradient(90deg,#11212c8a,#11212c10),linear-gradient(0deg,#11212ca8,transparent 78%)}
  .topbar{height:64px;padding-inline:max(12px,env(safe-area-inset-left));gap:5px}
  .topbar .mobile-menu{width:44px;height:44px}
  .header-preference{font-size:12px;min-height:44px;padding-inline:7px}
  .topbar-right .workspace-toggle{font-size:11px;min-height:44px;padding:10px}
  #app[data-composer=home] .main-panel{overflow-y:auto;overscroll-behavior-y:contain}
  #app[data-composer=home] .topbar{position:sticky;top:0;z-index:10;background:#152733b3;backdrop-filter:blur(14px)}
  #app[data-composer=home] .chat-scroll{flex:none;overflow:visible;padding:8px 24px 12px}
  #app[data-composer=home] .welcome{height:auto;min-height:clamp(280px,43svh,410px)}
  .arena-hero{min-height:0}
  .hero-copy{max-width:100%;padding:28px 0}
  .hero-copy h1{font-size:clamp(42px,12vw,60px);line-height:1.02;letter-spacing:-2.2px}
  .welcome-description{font-size:12px;line-height:1.8;margin-top:20px}
  .sport-switch{gap:26px;margin-top:18px}
  .sport-switch button{min-height:44px;font-size:14px;padding:10px 2px;gap:8px}
  .sport-switch .icon{width:17px;height:17px}
  .composer-dock,body:has(#welcome[hidden]) .composer-dock{width:calc(100% - 32px);margin:0 16px max(18px,env(safe-area-inset-bottom));padding:14px;border-radius:16px;background:linear-gradient(135deg,#78919b36,#1b303de8);backdrop-filter:blur(18px)}
  #app[data-composer=home] .composer-dock{margin-top:auto}
  .report-modes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-bottom:10px}
  .report-mode{min-width:0;min-height:58px;padding:8px 3px;flex-direction:column;justify-content:center;gap:5px;text-align:center}
  .report-mode-copy strong{font-size:12px;line-height:1.4}
  .mode-price{font-size:11px}.mode-price small{display:inline;font-size:9px}
  .composer{padding:0 0 12px}
  .composer textarea{font-size:16px;line-height:1.5;min-height:52px;height:52px;max-height:120px;padding:8px 2px;scroll-margin-block:85px 24px}
  .composer-controls{margin-top:8px}
  .composer-options{width:100%;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
  .composer-options label{height:44px;font-size:12px;border:1px solid #d2e4ed1a;padding-inline:10px;min-width:0}
  .composer-options select{width:100%;height:100%;font-size:16px;padding:8px 18px 8px 0}
  .budget-control{justify-content:space-between;gap:3px}
  .budget-control input{width:65px;max-width:65%;height:100%;font-size:16px}
  .builder-bottom{display:grid;grid-template-columns:1fr;gap:10px}
  .builder-bottom>div{display:block;min-width:0}
  .quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  .quick-card{min-height:44px;padding:10px 5px;justify-content:center;font-size:13px}
  .generate-report{width:100%;min-height:46px;justify-content:center;gap:18px;font-size:14px;border-radius:8px}
  .generate-report .icon{width:17px;height:17px}
  .generation-note{align-items:flex-start;font-size:10px;line-height:1.65;margin-top:12px;gap:6px}
  .generation-note .icon{margin-top:2px;flex:none}
  .composer-disclaimer{font-size:10px;line-height:1.7;margin-top:6px;text-align:left}
  .composer-collapse{font-size:12px}.composer-collapse button{min-height:44px}
  .sidebar{width:min(300px,calc(100vw - 44px));overflow-y:auto;overscroll-behavior:contain;padding:max(28px,env(safe-area-inset-top)) 22px max(22px,env(safe-area-inset-bottom))}
  .sidebar>.brand,.sidebar>.new-chat,.sidebar>.primary-nav,.sidebar-bottom{flex-shrink:0}
  .sidebar .brand{margin-bottom:26px}.sidebar .primary-nav{margin:20px 0}
  .sidebar .nav-item{min-height:48px;font-size:14px}.sidebar .nav-state{font-size:10px}
  .sidebar .new-chat{min-height:46px;font-size:13px}
  .sidebar-poster{margin-block:14px auto;padding-top:20px}.sidebar-poster p{font-size:23px}
  .sidebar-bottom{margin-top:24px}.demo-account strong{font-size:12px}.demo-account small{font-size:10px}
  .account-details{font-size:12px;min-height:44px;padding-block:12px}.balance-button{min-height:44px}
  .page-navigation{margin-inline:16px}.page-return-actions{gap:6px}.page-back{min-height:44px;font-size:12px;padding:9px 11px}
  .chat-scroll{padding-inline:16px}.messages{margin-top:12px}
  .report-heading{padding:20px 16px;align-items:flex-start;gap:12px;flex-wrap:wrap}
  .report-heading>div{min-width:0;flex:1 1 210px}
  .report-heading h3{display:block;font-size:23px;line-height:1.4}
  .report-heading h3 small{display:block;margin:8px 0 0;font-size:12px;white-space:nowrap}
  .report-saved-stamp{flex:none;white-space:nowrap;font-size:10px;text-align:left}
  .report-cost{padding:12px 16px;font-size:10px;flex-wrap:wrap}
  .match-result{padding:20px 16px}.match-result-meta{font-size:10px}
  .duel-team strong{font-size:13px;line-height:1.5}.match-duel{gap:8px}
  .report-boundary{padding-inline:16px!important;font-size:11px;line-height:1.8}
  .report-actions{padding:16px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .report-actions button{min-height:44px;padding:10px 6px;font-size:12px;justify-content:center}
  .research-section{padding:23px 16px}.research-heading p{font-size:11px}
  .research-factor-content p,.research-review li>p{font-size:13px;line-height:1.8}
  .research-factor-content>small{font-size:11px}.research-equation{font-size:12px;overflow-wrap:anywhere}
  .research-factor-label>strong{font-size:13px}.research-factor-label small{font-size:10px}
  .research-table-scroll,.capital-table-scroll{overscroll-behavior-x:contain}
  .research-table-scroll th,.research-table-scroll td{font-size:12px}
  .return-estimate{padding:20px 16px}
  .composer-reopen{margin:0 16px max(12px,env(safe-area-inset-bottom));font-size:11px;gap:8px}
  .composer-reopen button{min-height:44px;font-size:12px}
  #modal{width:calc(100vw - 24px);max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));border-radius:16px}
  #modal .modal-heading{padding:14px 16px;gap:12px}.modal-heading h2{font-size:16px;line-height:1.5}
  .modal-close-button{min-height:44px;min-width:70px;font-size:12px}
  #modal .modal-body{padding-inline:16px;-webkit-overflow-scrolling:touch}
  #modal .modal-actions{padding:12px 16px;gap:8px;flex-wrap:wrap}
  #modal .modal-actions button{min-height:44px;font-size:12px}
  #modal .modal-body :is(input:not([type=checkbox]),select,textarea){font-size:16px;min-height:44px;max-width:100%}
  .credit-account p{font-size:12px}.credit-account-actions{flex-wrap:wrap;gap:4px 16px}
  .credit-account-actions button{min-height:44px;font-size:12px}.credit-account .credit-balance{min-width:76px}
  .credit-tier-caption,.credit-scope,.credit-checkout span{font-size:11px!important}
  .credit-entitlements li{font-size:13px}.credit-explainer summary{min-height:44px;display:flex;align-items:center}
  .invite-code-row{flex-wrap:wrap}.invite-code-row #my-invite-code{flex:1;min-width:120px}
  .invite-counts{gap:12px}.invite-counts div+div{padding-left:12px}.invite-counts div{flex-wrap:wrap;gap:5px 10px}
  .invite-intro,.invite-binding p{font-size:12px}.invite-bind-row button{min-height:44px}
  .history-card{flex-wrap:wrap;padding:16px}.history-card h3{font-size:14px}.history-card small{font-size:11px;line-height:1.8}
  .history-card .outline-button{min-height:44px;font-size:12px}.generated-archive>button{min-height:44px;font-size:12px}
  .receipt-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:10px 0}
  .receipt-toolbar button{min-height:44px;padding:7px;font-size:12px}.receipt-toolbar>span{display:none}
  .ticket-card.receipt-paper{padding:18px 14px}.receipt-paper .receipt-header p{font-size:12px}
  .receipt-paper .receipt-summary{gap:6px}.receipt-mark{gap:8px}.receipt-mark strong{font-size:22px}
  .receipt-paper .ticket-expand summary{font-size:12px;min-height:44px;padding-block:10px}
  .capital-heading{margin-bottom:18px}.capital-heading p{font-size:12px}
  .capital-layout{grid-template-columns:minmax(0,1fr)}
  .capital-form{display:flex;flex-direction:column;gap:8px;padding:20px 16px}
  .capital-form>label{font-size:13px;margin:10px 0 0}.capital-form input:not([type=file]),.capital-form select{min-height:44px;font-size:16px}
  .capital-form .primary-button,.capital-presets button{min-height:44px;font-size:13px}
  .capital-method{font-size:12px;line-height:1.8}.capital-headline{flex-wrap:wrap}
  .capital-metrics{gap:22px 14px}.capital-metrics span{font-size:11px}
  .capital-table-scroll table{min-width:520px}
  .capital-table-scroll th,.capital-table-scroll td{font-size:12px;padding:12px 8px}
  .capital-table-scroll summary{font-size:11px;min-height:36px;padding-block:8px}
  .capital-table-scroll .round-id{font-size:11px;max-width:150px}
  .capital-pagination{gap:12px}.capital-page-meta,.capital-page-nav{font-size:12px}
  .capital-page-nav{width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
  .capital-page-nav button,.capital-pagination select,.capital-pagination input{height:44px;min-width:38px}
  .capital-page-meta select,.capital-pagination input{font-size:16px}
  .capital-page-jump{grid-column:1/-1;grid-row:2;justify-content:center;gap:6px;margin:0}.capital-page-jump input{width:46px}
  .capital-page-note,.capital-bottom-note{font-size:11px}
  .lab-heading h3{font-size:17px}.lab-mode{font-size:9px}.lab-heading>div>span{font-size:10px}
  .lab-telemetry>span{font-size:10px}.lab-telemetry b{font-size:26px}
  .console-detail{font-size:12px;line-height:1.8}.console-footer{font-size:10px}
  .lab-timeline button{font-size:10px;min-height:48px}.trace-replay button{min-height:44px;font-size:12px}
  .trace-replay>span,.trace-notice{font-size:11px;line-height:1.7}.trace-factor-details>summary{font-size:12px;min-height:44px}
  .workspace{top:68px;bottom:max(10px,env(safe-area-inset-bottom))}
}
@media(max-width:360px){
  .topbar{padding-inline:8px}.header-preference{padding-inline:5px;font-size:11px;gap:5px}
  .topbar-right .workspace-toggle{width:44px;justify-content:center;padding:10px}
  .topbar-right .workspace-toggle>span:last-child{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0)}
  .composer-dock,body:has(#welcome[hidden]) .composer-dock{padding:12px}
  .report-mode-copy strong{font-size:11px}.composer-options{gap:6px}.composer-options label{padding-inline:7px}
  .hero-copy h1{font-size:42px}.credit-account{grid-template-columns:1fr}.credit-account .credit-balance{align-items:flex-start;text-align:left}
}
@media(max-width:700px) and (max-height:650px){
  #app[data-composer=home] .welcome{min-height:250px}.sidebar-poster{display:none}
}
