
/* =========================================================
   v1.34 — iOS/WebKit foundation hardening
   Baseline visuals must not depend on runtime theme JS.
   ========================================================= */
.mobile-app-title-v131{display:none}
@media(max-width:780px){
  :root{
    --v131-safe-top:0px!important;
    --v131-appbar:56px!important;
    --v131-tabbar:64px!important;
    --top:56px!important;
    --mobile-nav:64px!important;
    --mobile-edge:16px!important;
  }
  html{
    width:100%!important;height:100%!important;background:#0b0e12!important;
    -webkit-text-size-adjust:100%;text-size-adjust:100%;
  }
  body{
    width:100%!important;height:100%!important;min-height:100%!important;
    padding:0!important;margin:0!important;overflow:hidden!important;
    background:var(--bg,#0b0e12)!important;color:var(--text,#edf2f7)!important;
  }
  .app{
    width:100%!important;height:100vh!important;height:100svh!important;height:100dvh!important;
    min-height:0!important;overflow:hidden!important;
    display:grid!important;grid-template-rows:56px minmax(0,1fr)!important;
    background:var(--bg,#0b0e12)!important;
  }
  .topbar{
    position:relative!important;inset:auto!important;
    width:100%!important;height:56px!important;min-height:56px!important;max-height:56px!important;
    padding:0 10px!important;margin:0!important;
    display:grid!important;grid-template-columns:minmax(0,1fr) 40px 40px!important;
    grid-template-rows:56px!important;align-items:center!important;gap:4px!important;
    background:var(--surface-nav,#0c1015)!important;color:var(--text,#edf2f7)!important;
    border-bottom:1px solid var(--line,#25303c)!important;
    transform:none!important;contain:layout paint;
  }
  .mobile-app-title-v131{
    display:flex!important;grid-column:1!important;grid-row:1!important;
    min-width:0!important;height:44px!important;margin:0!important;padding:0 8px!important;
    align-items:center!important;gap:9px!important;border:0!important;border-radius:12px!important;
    background:transparent!important;color:var(--text,#edf2f7)!important;text-align:left!important;
  }
  .mobile-app-title-v131 strong{color:var(--text,#edf2f7)!important}
  .mobile-app-title-v131 small,.mobile-title-chevron-v131{color:var(--muted,#8f9bab)!important}
  .search-trigger{
    grid-column:2!important;grid-row:1!important;justify-self:center!important;
    width:40px!important;height:40px!important;min-width:40px!important;margin:0!important;padding:0!important;
    color:var(--soft,#b7c0cc)!important;background:transparent!important;border:0!important;
  }
  .top-actions{display:contents!important}
  #avatarBtn{
    grid-column:3!important;grid-row:1!important;justify-self:end!important;
    width:40px!important;height:40px!important;min-width:40px!important;margin:0!important;
    color:#eef7ff!important;
  }
  .shell{width:100%!important;height:100%!important;min-height:0!important;overflow:hidden!important;display:grid!important;grid-template-columns:1fr!important}
  .main{
    width:100%!important;height:100%!important;min-height:0!important;overflow-x:hidden!important;overflow-y:auto!important;
    -webkit-overflow-scrolling:touch;overscroll-behavior-y:contain;
    background:var(--surface-canvas,var(--bg,#0b0e12))!important;color:var(--text,#edf2f7)!important;
  }
  .page{
    width:100%!important;min-height:100%!important;
    padding:12px var(--mobile-edge) calc(78px + env(safe-area-inset-bottom,0px))!important;
    color:var(--text,#edf2f7)!important;
  }
  .page.active{display:block!important}
  .page h1,.page h2,.page h3,.page h4,.page b,.page strong{color:var(--text,#edf2f7)}
  .page p,.page span,.page small{color:inherit}
  .panel,.metric,.account-card,.workbench,.studio-project-head,.channel-hero,.comm-list,.comm-thread,.comm-context,.asset-inspector,
  .settings-menu,.settings-card,.state-card,.asset-card,.can-main,.can-rail,.can-side,.dossier-card{
    background-color:var(--panel,#10151b)!important;color:var(--text,#edf2f7)!important;border-color:var(--line,#25303c)!important;
  }
  /* No global dimming on mobile. A sheet must never make the whole app unreadable. */
  .mobile-sheet-scrim-v131,body.mobile-sheet-open-v131 .mobile-sheet-scrim-v131{display:none!important;opacity:0!important;pointer-events:none!important}
  body.drawer-open-v117 .app:after,.app:after{content:none!important;display:none!important}
  .drawer,.drawer.left{
    background:var(--surface-float,var(--panel,#10151b))!important;color:var(--text,#edf2f7)!important;
    -webkit-backdrop-filter:none!important;backdrop-filter:none!important;
  }
  .mobile-nav{
    left:0!important;right:0!important;bottom:0!important;
    width:100%!important;height:calc(70px + env(safe-area-inset-bottom,0px))!important;
    min-height:70px!important;padding:5px 6px calc(8px + env(safe-area-inset-bottom,0px))!important;
    background:var(--surface-nav,#0c1015)!important;color:var(--soft,#b7c0cc)!important;
    border-top:1px solid var(--line,#25303c)!important;border-radius:0!important;
    transform:none;box-shadow:0 -8px 28px rgba(0,0,0,.18)!important;
  }
  body.mobile-sheet-open-v131 .mobile-nav{transform:translateY(calc(100% + 8px))!important}
  .mobile-nav button{min-height:52px!important;color:var(--muted,#8f9bab)!important}
  .mobile-nav button.active{color:var(--accent,#7dd3fc)!important}
  .mobile-nav button span{line-height:1.15!important}
}
@media(display-mode:standalone) and (max-width:780px){
  :root{--v131-safe-top:env(safe-area-inset-top,0px)!important;--top:calc(56px + env(safe-area-inset-top,0px))!important}
  .app{grid-template-rows:calc(56px + env(safe-area-inset-top,0px)) minmax(0,1fr)!important}
  .topbar{height:calc(56px + env(safe-area-inset-top,0px))!important;max-height:none!important;padding-top:env(safe-area-inset-top,0px)!important;grid-template-rows:56px!important}
}
