/* Omvia Cloud v2.0.11.4-R79 — Clean Runtime + Locked Visual Authority
   Clean consolidated authority. Historical R70/R73/R76/R77 files are archived and inactive.
   No legacy dock or hover rules are carried forward.
*/
/* Omvia Cloud v2.0.11.4-R70 — Mobile/PWA Full Geometry Authority
   Final mobile geometry authority on the R68 cumulative baseline.
   Scope: authenticated mobile/PWA presentation only. No feature behavior, APIs,
   storage, sharing, Gallery logic, Scanner logic, Audio/Smart Lyrics, payments,
   updater behavior, public Landing/Auth, or desktop geometry changes. */

@media (max-width:900px){
  body[data-omvia-auth="1"][data-omvia-route]{
    --m70-edge:14px;
    --m70-edge-tight:10px;
    --m70-gap:12px;
    --m70-gap-sm:8px;
    --m70-control:36px;
    --m70-control-lg:40px;
    --m70-row:58px;
    --m70-radius:12px;
    --m70-radius-sm:9px;
    --m70-card-radius:13px;
    --m70-header-h:58px;
    --m70-header-control:34px;
    --m70-header-pill:40px;
    --m70-nav-h:58px;
    --m70-nav-item:42px;
    --m70-nav-radius:29px;
    --m70-bottom-clear:calc(82px + env(safe-area-inset-bottom));
    overflow-x:hidden!important;
  }

  body[data-omvia-auth="1"][data-omvia-route],
  body[data-omvia-auth="1"][data-omvia-route] *{box-sizing:border-box}

  /* ================================================================
     UNIVERSAL MOBILE SHELL / CLEARSPACE
     ================================================================ */
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-shell,.files-ref-shell,.gallery-experience-shell,.account-shell,.page-shell,.admin-shell){
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin:0!important;overflow-x:hidden!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-sidebar,.gallery-sidebar,.admin-sidebar){display:none!important}
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-main,.files-ref-main,.gallery-workspace,.gallery-main,.page-main,.account-main,.admin-main){
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin:0!important;overflow-x:hidden!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-main,.files-ref-main,.gallery-main,.account-main,.admin-main){
    padding-bottom:var(--m70-bottom-clear)!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not([data-omvia-route="view.php"]):not([data-omvia-route="document-scanner.php"]) .page-main{
    padding-bottom:var(--m70-bottom-clear)!important;
  }

  /* All ordinary page blocks share one horizontal axis. */
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-heading,.files-heading,.page-heading,.account-hero,.admin-heading,.admin-hero){
    width:100%!important;min-width:0!important;min-height:0!important;height:auto!important;
    margin:0!important;padding:16px var(--m70-edge) 12px!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-heading h1,.files-heading h1,.page-heading h1,.account-hero h1,.admin-heading h1,.admin-hero h1){
    margin:0!important;line-height:1.12!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-heading p,.files-heading p,.page-heading p,.account-hero p,.admin-heading p,.admin-hero p){
    margin:5px 0 0!important;max-width:100%!important;line-height:1.45!important;
  }

  /* ================================================================
     PERSISTENT HEADER — applies to mobile browser and installed PWA.
     R65-R68 were standalone-gated; R70 intentionally is not.
     ================================================================ */
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-topbar,.gallery-topbar){
    position:relative!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-auto-rows:auto!important;
    align-items:center!important;
    width:100%!important;min-width:0!important;
    min-height:calc(var(--m70-header-h) + env(safe-area-inset-top))!important;
    height:auto!important;
    margin:0!important;
    padding:max(8px,env(safe-area-inset-top)) max(var(--m70-edge),env(safe-area-inset-right)) 8px max(var(--m70-edge),env(safe-area-inset-left))!important;
    column-gap:8px!important;row-gap:8px!important;
    border-bottom:1px solid var(--drive-line)!important;
    background:color-mix(in srgb,var(--drive-bg) 96%,transparent)!important;
    box-shadow:none!important;
    overflow:visible!important;
    z-index:40!important;
  }

  /* Full Omvia identity without ellipsis or squeezed square logos. */
  body[data-omvia-auth="1"][data-omvia-route] .ref-mobile-brand{
    grid-column:1!important;
    display:flex!important;align-items:center!important;justify-content:flex-start!important;
    width:auto!important;max-width:132px!important;min-width:0!important;
    height:34px!important;margin:0!important;padding:0!important;overflow:hidden!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] .ref-mobile-brand img{
    display:block!important;width:128px!important;max-width:100%!important;height:27px!important;max-height:27px!important;
    object-fit:contain!important;object-position:left center!important;margin:0!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] .gallery-mobile-brand{
    grid-column:1!important;
    display:flex!important;align-items:center!important;justify-content:flex-start!important;
    width:auto!important;max-width:136px!important;min-width:0!important;height:34px!important;
    margin:0!important;padding:0!important;gap:8px!important;overflow:hidden!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] .gallery-mobile-brand img{
    flex:0 0 30px!important;width:30px!important;height:30px!important;min-width:30px!important;max-width:30px!important;
    object-fit:contain!important;margin:0!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] .gallery-mobile-brand strong{
    display:block!important;flex:1 1 auto!important;min-width:0!important;max-width:none!important;
    margin:0!important;padding:0!important;
    font-size:15px!important;line-height:1!important;font-weight:700!important;letter-spacing:-.012em!important;
    white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important;
  }

  /* One quiet utility capsule; never several outlined circles inside another pill. */
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-top-actions,.gallery-top-actions){
    grid-column:2!important;justify-self:end!important;
    display:flex!important;align-items:center!important;justify-content:flex-end!important;flex-wrap:nowrap!important;
    width:auto!important;max-width:218px!important;min-width:0!important;
    height:var(--m70-header-pill)!important;min-height:var(--m70-header-pill)!important;max-height:var(--m70-header-pill)!important;
    margin:0!important;padding:2px 4px!important;gap:1px!important;
    border:1px solid var(--drive-line)!important;
    border-radius:20px!important;
    background:var(--drive-panel)!important;
    box-shadow:0 5px 16px color-mix(in srgb,#000 10%,transparent)!important;
    -webkit-backdrop-filter:blur(16px) saturate(1.06)!important;backdrop-filter:blur(16px) saturate(1.06)!important;
    overflow:hidden!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-top-actions,.gallery-top-actions)>:where(a,button){
    flex:0 0 var(--m70-header-control)!important;
    display:grid!important;place-items:center!important;
    width:var(--m70-header-control)!important;height:var(--m70-header-control)!important;
    min-width:var(--m70-header-control)!important;min-height:var(--m70-header-control)!important;
    max-width:var(--m70-header-control)!important;max-height:var(--m70-header-control)!important;
    margin:0!important;padding:0!important;
    border:0!important;border-radius:50%!important;
    outline:0!important;background:transparent!important;color:var(--drive-text)!important;
    box-shadow:none!important;filter:none!important;transform:none!important;text-decoration:none!important;
    overflow:hidden!important;-webkit-tap-highlight-color:transparent!important;
  }
  
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-top-actions,.gallery-top-actions)>:where(a,button):active{
    background:var(--drive-active)!important;transform:scale(.94)!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-top-actions,.gallery-top-actions)>:where(a,button) :where(svg,.svg,img:not(.avatar-glyph)){
    width:19px!important;height:19px!important;max-width:19px!important;max-height:19px!important;margin:0!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-top-actions,.gallery-top-actions) .lang-toggle .lang-code{
    margin:0!important;padding:0!important;font-size:10.5px!important;line-height:1!important;font-weight:760!important;letter-spacing:.04em!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] .gallery-top-actions .gallery-account>span:not(.avatar):not(.gallery-avatar),
  body[data-omvia-auth="1"][data-omvia-route] .gallery-top-actions .gallery-account>.svg,
  body[data-omvia-auth="1"][data-omvia-route] .gallery-top-actions .gallery-account>svg{display:none!important}
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-avatar-button,.gallery-account) :where(.avatar,.ref-avatar,.gallery-avatar){
    width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;max-width:28px!important;max-height:28px!important;
    margin:0!important;border-radius:50%!important;border:1px solid var(--drive-line)!important;box-shadow:none!important;
  }

  /* Search geometry moved to R71. */

  /* Generic authenticated topbars (Account, Activity, Admin, Storage, etc.). */
  body[data-omvia-auth="1"][data-omvia-route] :where(.page-topbar,.topbar,.account-top,.admin-top,.gallery-settings-topbar,.scanner-app-topbar){
    width:100%!important;min-width:0!important;min-height:calc(56px + env(safe-area-inset-top))!important;height:auto!important;
    margin:0!important;padding:max(8px,env(safe-area-inset-top)) var(--m70-edge) 8px!important;
    display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;
    border-bottom:1px solid var(--drive-line)!important;box-shadow:none!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.topbar-actions,.page-header-actions,.account-top-actions,.admin-top-actions,.scanner-top-actions){
    display:flex!important;align-items:center!important;justify-content:flex-end!important;flex-wrap:nowrap!important;
    min-width:0!important;margin:0!important;padding:0!important;gap:5px!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.topbar-actions,.page-header-actions,.account-top-actions,.admin-top-actions,.scanner-top-actions)>:where(a,button){
    width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;max-width:36px!important;max-height:36px!important;
    margin:0!important;padding:0!important;display:grid!important;place-items:center!important;
    border-radius:10px!important;box-shadow:none!important;transform:none!important;
  }

  /* Bottom navigation geometry moved to R71. */

  /* New menu: anchored and compact; does not alter behavior. */
  body[data-omvia-auth="1"][data-omvia-route] .mobile-create-popover{
    width:min(252px,calc(100vw - 28px))!important;max-width:252px!important;
    margin:0!important;padding:7px!important;gap:2px!important;
    border-radius:14px!important;border:1px solid var(--drive-line)!important;background:var(--drive-panel)!important;box-shadow:0 14px 34px color-mix(in srgb,#000 18%,transparent)!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] .mobile-create-popover .mobile-create-choice{
    min-height:44px!important;height:44px!important;margin:0!important;padding:0 10px!important;gap:10px!important;border-radius:9px!important;
  }

  /* ================================================================
     UNIVERSAL CARD / GRID / FORM RHYTHM
     ================================================================ */
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-card,.section-card,.file-browser-card,.photo-library-card,.stat,.admin-kpi-card,.platform-form-card,.insight-card){
    min-width:0!important;max-width:100%!important;border-radius:var(--m70-card-radius)!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.section-head,.ref-section-title){
    width:100%!important;min-width:0!important;min-height:50px!important;height:auto!important;
    margin:0!important;padding:10px 12px!important;gap:10px!important;align-items:center!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.section-head-copy,.ref-section-title>div){min-width:0!important}
  body[data-omvia-auth="1"][data-omvia-route] :where(.section-head h2,.ref-section-title h2){margin:0!important;line-height:1.2!important}
  body[data-omvia-auth="1"][data-omvia-route] :where(.section-head p,.ref-section-title p){margin:3px 0 0!important;line-height:1.35!important}
  body[data-omvia-auth="1"][data-omvia-route] :where(.section-actions,.hero-actions,.account-photo-actions,.account-plan-actions,.platform-action-row,.scanner-capture-actions,.scanner-pages-actions){
    display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:8px!important;min-width:0!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.platform-two-col,.platform-form-grid,.field-grid,.r20-form-two,.companion-form-grid,.scanner-r27-toggle-grid,.scanner-r27-optics-grid,.account-layout,.admin-grid,.admin-dashboard-grid,.content-grid,.insights-grid,.platform-metric-grid,.v242-metric-grid,.share-analytics-grid,.entitlement-grid){
    grid-template-columns:minmax(0,1fr)!important;gap:var(--m70-gap)!important;align-items:stretch!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.platform-two-col,.platform-form-grid,.field-grid,.r20-form-two,.companion-form-grid,.scanner-r27-toggle-grid,.scanner-r27-optics-grid,.account-layout,.admin-grid,.admin-dashboard-grid,.content-grid,.insights-grid,.platform-metric-grid,.v242-metric-grid,.share-analytics-grid,.entitlement-grid)>*{
    min-width:0!important;max-width:100%!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea,.form-control){
    width:100%!important;max-width:100%!important;min-width:0!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.btn,.files-action-button,.account-action,.platform-action-row>a,.platform-action-row>button){
    min-height:38px!important;height:auto!important;padding:8px 12px!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.admin-table-scroll,.table-wrap,.oc17-table-wrap){max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}

  /* ================================================================
     HOME / MY CLOUD
     ================================================================ */
  body[data-omvia-route="app.php"] .ref-content-grid{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;margin:0!important;padding:0 var(--m70-edge) var(--m70-bottom-clear)!important;gap:var(--m70-gap)!important;
  }
  body[data-omvia-route="app.php"] .ref-content-primary{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;min-width:0!important;gap:var(--m70-gap)!important;
  }
  body[data-omvia-route="app.php"] :where(.ref-storage-card,.ref-quick-card,.ref-recent-card,.ref-activity-card){
    width:100%!important;min-width:0!important;margin:0!important;height:auto!important;min-height:0!important;
  }
  body[data-omvia-route="app.php"] .ref-storage-card{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;padding:14px!important;
  }
  body[data-omvia-route="app.php"] .ref-storage-ring{display:none!important}
  body[data-omvia-route="app.php"] .ref-storage-copy{min-width:0!important;margin:0!important;padding:0!important}
  body[data-omvia-route="app.php"] .ref-storage-legend{display:none!important}
  body[data-omvia-route="app.php"] .ref-storage-legend-mobile{
    display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px 12px!important;width:100%!important;margin:10px 0 0!important;padding:0!important;
  }
  body[data-omvia-route="app.php"] .ref-storage-progress-mobile{display:block!important;width:100%!important;margin:0!important;padding:0!important}
  body[data-omvia-route="app.php"] .ref-storage-bar{width:100%!important;margin:9px 0 0!important}
  body[data-omvia-route="app.php"] .ref-quick-grid{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;width:100%!important;padding:0 12px 12px!important;
  }
  body[data-omvia-route="app.php"] .ref-quick-grid>:is(a,button){
    width:100%!important;min-width:0!important;height:74px!important;min-height:74px!important;max-height:74px!important;
    margin:0!important;padding:10px!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;gap:7px!important;
    border-radius:10px!important;transform:none!important;
  }
  
  body[data-omvia-route="app.php"] .ref-action-icon{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;border-radius:8px!important}
  body[data-omvia-route="app.php"] .ref-desktop-table{display:none!important}
  body[data-omvia-route="app.php"] .ref-mobile-files{display:block!important;width:100%!important;padding:0 10px 8px!important}
  body[data-omvia-route="app.php"] .ref-mobile-file,
  body[data-omvia-route="app.php"] .ref-activity-row{
    width:100%!important;min-width:0!important;min-height:54px!important;height:auto!important;margin:0!important;padding:8px!important;gap:9px!important;border-radius:8px!important;
  }
  body[data-omvia-route="app.php"] .ref-card-footer,
  body[data-omvia-route="app.php"] .ref-activity-footer{min-height:42px!important;height:42px!important;padding:0 12px!important}
  body[data-omvia-route="app.php"] .ref-activity-list{padding:0 10px 8px!important}

  /* ================================================================
     FILES
     ================================================================ */
  body[data-omvia-route="files.php"] .files-action-card{
    width:100%!important;margin:0!important;padding:8px var(--m70-edge) 10px!important;gap:8px!important;border-left:0!important;border-right:0!important;border-radius:0!important;
  }
  body[data-omvia-route="files.php"] .files-primary-actions{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;gap:8px!important;
  }
  body[data-omvia-route="files.php"] .files-primary-actions>.files-action-button:only-child{grid-column:1/-1!important}
  body[data-omvia-route="files.php"] .files-action-button{
    width:100%!important;min-width:0!important;min-height:40px!important;height:40px!important;margin:0!important;padding:0 10px!important;justify-content:center!important;
  }
  body[data-omvia-route="files.php"] .files-filter-strip{
    display:flex!important;align-items:center!important;flex-wrap:nowrap!important;width:100%!important;max-width:100%!important;gap:5px!important;margin:0!important;padding:2px 0!important;
    overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;
  }
  body[data-omvia-route="files.php"] .files-filter-strip::-webkit-scrollbar{display:none!important}
  body[data-omvia-route="files.php"] .files-filter-strip a{
    flex:0 0 auto!important;min-height:34px!important;height:34px!important;margin:0!important;padding:0 9px!important;border-radius:8px!important;gap:6px!important;
  }
  body[data-omvia-route="files.php"] .breadcrumbs{width:100%!important;margin:0!important;padding:8px var(--m70-edge) 0!important;gap:5px!important;overflow-x:auto!important}
  body[data-omvia-route="files.php"] :where(.file-browser-card,.photo-library-card){
    width:auto!important;max-width:none!important;margin:10px var(--m70-edge) var(--m70-bottom-clear)!important;padding:0!important;
  }
  body[data-omvia-route="files.php"] :where(.file-browser-card,.photo-library-card)>.section-head{
    min-height:50px!important;padding:9px 10px!important;gap:8px!important;
  }
  body[data-omvia-route="files.php"] .file-table-head{display:none!important}
  body[data-omvia-route="files.php"] .file-table:not(.grid-view){display:block!important;width:100%!important;padding:0!important;margin:0!important}
  body[data-omvia-route="files.php"] .file-table:not(.grid-view)>.file-row{
    display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;
    width:100%!important;min-width:0!important;height:var(--m70-row)!important;min-height:var(--m70-row)!important;max-height:var(--m70-row)!important;
    margin:0!important;padding:6px 8px!important;column-gap:8px!important;border-radius:0!important;
  }
  body[data-omvia-route="files.php"] .file-table:not(.grid-view)>.file-row :where(.desktop-cell,.sharing-cell.desktop-cell){display:none!important}
  body[data-omvia-route="files.php"] .file-table:not(.grid-view) .file-open,
  body[data-omvia-route="files.php"] .file-table:not(.grid-view) .folder-open{
    min-width:0!important;width:100%!important;height:100%!important;margin:0!important;padding:0!important;display:flex!important;align-items:center!important;gap:9px!important;
  }
  body[data-omvia-route="files.php"] .file-table:not(.grid-view) .file-copy{min-width:0!important;display:grid!important;gap:2px!important}
  body[data-omvia-route="files.php"] .file-table:not(.grid-view) .file-name{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  body[data-omvia-route="files.php"] .file-table:not(.grid-view) .file-type{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  body[data-omvia-route="files.php"] .file-table:not(.grid-view) .file-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:4px!important;width:auto!important;min-width:36px!important;margin:0!important;padding:0!important}
  body[data-omvia-route="files.php"] .file-table:not(.grid-view) .grid-only-action{display:none!important}
  body[data-omvia-route="files.php"] .file-table:not(.grid-view) :where(.row-menu,.grid-action-btn){width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;margin:0!important;padding:0!important}
  
  
  
  
  
  
  body[data-omvia-route="files.php"] .files-pagination{width:100%!important;max-width:100%!important;margin:0!important;padding:8px var(--m70-edge) var(--m70-bottom-clear)!important;gap:5px!important}

  /* ================================================================
     GALLERY / PHOTOS
     ================================================================ */
  body[data-omvia-auth="1"][data-omvia-route] .gallery-main{padding:0 0 var(--m70-bottom-clear)!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-heading-row{
    display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;
    width:100%!important;min-width:0!important;min-height:0!important;height:auto!important;
    margin:0!important;padding:16px var(--m70-edge) 12px!important;gap:10px!important;
    border:0!important;border-bottom:1px solid var(--drive-line)!important;background:transparent!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-heading-row>div:first-child{width:100%!important;min-width:0!important;margin:0!important;padding:0!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-heading-row .eyebrow{display:none!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-heading-row h1{margin:0!important;padding:0!important;font-size:21px!important;line-height:1.12!important;font-weight:720!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-heading-row p{display:none!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-view-controls{
    display:flex!important;align-items:center!important;justify-content:flex-start!important;width:auto!important;max-width:100%!important;
    min-height:36px!important;height:36px!important;margin:0!important;padding:0!important;gap:6px!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-view-controls .gallery-sort{display:none!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-square-btn{
    width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;max-width:36px!important;max-height:36px!important;
    margin:0!important;padding:0!important;display:grid!important;place-items:center!important;border-radius:9px!important;box-shadow:none!important;transform:none!important;
  }

  /* Horizontal album rail with identical cards — no slivers / collapsed widths. */
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-albums{
    display:flex!important;flex-wrap:nowrap!important;align-items:stretch!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin:0!important;padding:12px var(--m70-edge) 14px!important;gap:9px!important;
    overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x proximity!important;scroll-padding-inline:var(--m70-edge)!important;
    scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-albums::-webkit-scrollbar{display:none!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-album-card{
    flex:0 0 112px!important;width:112px!important;min-width:112px!important;max-width:112px!important;
    height:136px!important;min-height:136px!important;max-height:136px!important;
    margin:0!important;padding:0!important;display:grid!important;grid-template-rows:76px 30px 30px!important;align-content:start!important;
    border-radius:11px!important;overflow:hidden!important;scroll-snap-align:start!important;transform:none!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-album-cover{
    width:100%!important;height:76px!important;min-height:76px!important;max-height:76px!important;margin:0!important;border-radius:0!important;background-size:cover!important;background-position:center!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-album-card>strong{
    width:100%!important;min-width:0!important;margin:0!important;padding:8px 9px 0!important;font-size:12px!important;line-height:1.1!important;font-weight:690!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-album-card>small{
    width:100%!important;min-width:0!important;margin:0!important;padding:3px 9px 8px!important;font-size:10px!important;line-height:1.1!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  }

  /* Select / Filters row: balanced controls, no full-width monster select pill. */
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-toolbar{
    display:flex!important;align-items:center!important;justify-content:flex-start!important;flex-wrap:nowrap!important;
    width:auto!important;min-width:0!important;min-height:52px!important;height:52px!important;
    margin:0 var(--m70-edge)!important;padding:7px 0!important;gap:7px!important;
    border-top:1px solid var(--drive-line)!important;border-bottom:1px solid var(--drive-line)!important;background:transparent!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-select-toggle{
    flex:0 0 auto!important;width:auto!important;min-width:94px!important;max-width:116px!important;height:36px!important;min-height:36px!important;max-height:36px!important;
    margin:0!important;padding:0 10px!important;gap:7px!important;border-radius:9px!important;overflow:hidden!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-select-toggle>input[type="checkbox"]{
    flex:0 0 17px!important;width:17px!important;height:17px!important;min-width:17px!important;min-height:17px!important;max-width:17px!important;max-height:17px!important;margin:0!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-select-toggle>[data-gallery-select-label]{font-size:12.5px!important;line-height:1!important;font-weight:630!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main :where(.gallery-filter-btn,.gallery-mobile-sync-btn){
    flex:0 0 36px!important;width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;max-width:36px!important;max-height:36px!important;
    margin:0!important;padding:0!important;display:grid!important;place-items:center!important;border-radius:9px!important;box-shadow:none!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-filter-btn{margin-left:auto!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main :where(.gallery-filter-btn,.gallery-mobile-sync-btn)>span{display:none!important}

  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-photo-stream{
    width:100%!important;max-width:100%!important;margin:0!important;padding:0 var(--m70-edge) var(--m70-bottom-clear)!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-stream-caption{display:none!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .photo-month{width:100%!important;margin:0 0 14px!important;padding:0!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .photo-month-head{
    width:100%!important;min-height:44px!important;height:44px!important;margin:0!important;padding:10px 2px 8px!important;
    display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;border:0!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .photo-month-head strong{font-size:13.5px!important;line-height:1.15!important;font-weight:700!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .photo-month-head span{font-size:11px!important;line-height:1.15!important;color:var(--drive-muted)!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .photo-native-grid{
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;gap:4px!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main :where(.photo-native-wrap,.photo-native-item){
    width:100%!important;min-width:0!important;max-width:100%!important;aspect-ratio:1/1!important;margin:0!important;padding:0!important;border-radius:7px!important;overflow:hidden!important;
  }
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .photo-native-wrap img,
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .photo-native-item img{width:100%!important;height:100%!important;object-fit:cover!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .photo-native-fav{top:4px!important;right:4px!important;width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;border-radius:8px!important}

  /* ================================================================
     ACCOUNT / GENERIC PAGES / ADMIN
     ================================================================ */
  body[data-omvia-route="account.php"] .account-main{padding:12px var(--m70-edge) var(--m70-bottom-clear)!important}
  body[data-omvia-route="account.php"] .page-return-row{margin:0 0 10px!important;padding:0!important}
  body[data-omvia-route="account.php"] .account-hero{
    display:grid!important;grid-template-columns:56px minmax(0,1fr)!important;align-items:center!important;gap:12px!important;padding:12px 0!important;margin:0 0 12px!important;
  }
  body[data-omvia-route="account.php"] .account-avatar-xl{width:56px!important;height:56px!important;min-width:56px!important;min-height:56px!important}
  body[data-omvia-route="account.php"] .account-layout{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;width:100%!important}
  body[data-omvia-route="account.php"] :where(.account-profile-card,.account-plan-card,.account-action-stack){width:100%!important;min-width:0!important;margin:0!important}
  body[data-omvia-route="account.php"] .account-photo-manager{display:grid!important;grid-template-columns:64px minmax(0,1fr)!important;gap:12px!important;padding:12px!important}
  body[data-omvia-route="account.php"] .account-photo-actions{align-items:flex-start!important}
  body[data-omvia-route="account.php"] .account-photo-upload-form{display:flex!important;flex-wrap:wrap!important;gap:7px!important;min-width:0!important}
  body[data-omvia-route="account.php"] .account-action-stack{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:7px!important}
  body[data-omvia-route="account.php"] .account-action{width:100%!important;justify-content:flex-start!important}

  body[data-omvia-auth="1"][data-omvia-route]:not([data-omvia-route="view.php"]):not([data-omvia-route="document-scanner.php"]) .page-main{padding:14px var(--m70-edge) var(--m70-bottom-clear)!important}
  body[data-omvia-auth="1"][data-omvia-route] .page-main>.section-card{width:100%!important;min-width:0!important;margin:0 0 12px!important}
  body[data-omvia-auth="1"][data-omvia-route] .page-main>.section-card:last-child{margin-bottom:0!important}

  body[data-omvia-auth="1"][data-omvia-route] .admin-main{padding:14px var(--m70-edge) var(--m70-bottom-clear)!important}
  body[data-omvia-auth="1"][data-omvia-route] .admin-main>.admin-heading{margin:0 0 12px!important;padding:0 0 12px!important}
  body[data-omvia-auth="1"][data-omvia-route] :where(.admin-stats,.premium-admin-stats,.r24-kpi-grid){
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;align-items:stretch!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.stat,.admin-kpi-card,.r24-kpi-card){
    width:100%!important;min-width:0!important;min-height:96px!important;height:100%!important;margin:0!important;padding:12px!important;border-radius:11px!important;
  }
  body[data-omvia-auth="1"][data-omvia-route] .admin-readiness-row{min-height:44px!important;height:auto!important;padding:8px 0!important;gap:10px!important}

  /* Hover/focus never changes dimensions or alignment on touch layouts. */
  
}

/* Narrow phones: preserve the same geometry without squeezing brand or cards. */
@media (max-width:390px){
  body[data-omvia-auth="1"][data-omvia-route]{
    --m70-edge:12px;
    --m70-gap:10px;
    --m70-header-control:32px;
    --m70-header-pill:38px;
    --m70-nav-item:40px;
  }
  body[data-omvia-auth="1"][data-omvia-route] .ref-mobile-brand{max-width:116px!important}
  body[data-omvia-auth="1"][data-omvia-route] .ref-mobile-brand img{width:112px!important;height:25px!important}
  body[data-omvia-auth="1"][data-omvia-route] .gallery-mobile-brand{max-width:122px!important;gap:7px!important}
  body[data-omvia-auth="1"][data-omvia-route] .gallery-mobile-brand img{width:28px!important;height:28px!important;min-width:28px!important;max-width:28px!important;flex-basis:28px!important}
  body[data-omvia-auth="1"][data-omvia-route] .gallery-mobile-brand strong{font-size:14px!important}
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-top-actions,.gallery-top-actions){max-width:202px!important;padding-inline:3px!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-album-card{flex-basis:108px!important;width:108px!important;min-width:108px!important;max-width:108px!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-photo-stream{padding-inline:8px!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .photo-native-grid{gap:3px!important}
  body[data-omvia-route="files.php"] :where(.file-browser-card,.photo-library-card){margin-inline:8px!important}
}

@media (max-width:340px){
  body[data-omvia-auth="1"][data-omvia-route]{
    --m70-edge:10px;
    --m70-header-control:30px;
    --m70-nav-item:38px;
  }
  body[data-omvia-auth="1"][data-omvia-route] .ref-mobile-brand{max-width:100px!important}
  body[data-omvia-auth="1"][data-omvia-route] .ref-mobile-brand img{width:96px!important}
  body[data-omvia-auth="1"][data-omvia-route] .gallery-mobile-brand{max-width:106px!important}
  body[data-omvia-auth="1"][data-omvia-route] .gallery-mobile-brand strong{font-size:13px!important}
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-top-actions,.gallery-top-actions){max-width:188px!important}
  body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .photo-native-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* Installed tablet PWA: use the same spacing logic through 1180px without touching desktop browser. */
@media (min-width:901px) and (max-width:1180px){
  body[data-omvia-auth="1"][data-omvia-route]{
    --drive-page-x:18px;
  }
  body[data-omvia-auth="1"][data-omvia-route] :where(.ref-main,.gallery-main,.page-main,.account-main,.admin-main){padding-bottom:calc(88px + env(safe-area-inset-bottom))!important}
}

@media(prefers-reduced-motion:reduce){
  body[data-omvia-auth="1"][data-omvia-route] *{scroll-behavior:auto!important}
}

/* R70 hard-final mobile overrides: higher specificity than historical R17/R37/R59/R67/R68 locks. */
@media (max-width:900px){
  html body[data-omvia-auth="1"][data-omvia-route] .ref-topbar .ref-top-actions,
  html body[data-omvia-auth="1"][data-omvia-route] .gallery-experience-shell .gallery-topbar .gallery-top-actions{
    height:var(--m70-header-pill)!important;min-height:var(--m70-header-pill)!important;max-height:var(--m70-header-pill)!important;
    padding:2px 3px!important;gap:1px!important;border-radius:calc(var(--m70-header-pill)/2)!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route] .ref-topbar .ref-top-actions>:where(a,button),
  html body[data-omvia-auth="1"][data-omvia-route] .gallery-experience-shell .gallery-topbar .gallery-top-actions>:where(a,button){
    width:var(--m70-header-control)!important;height:var(--m70-header-control)!important;
    min-width:var(--m70-header-control)!important;min-height:var(--m70-header-control)!important;
    max-width:var(--m70-header-control)!important;max-height:var(--m70-header-control)!important;
    padding:0!important;margin:0!important;border:0!important;border-radius:50%!important;box-shadow:none!important;background:transparent!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route] .ref-topbar .ref-mobile-brand,
  html body[data-omvia-auth="1"][data-omvia-route] .gallery-experience-shell .gallery-topbar .gallery-mobile-brand{
    min-width:0!important;overflow:hidden!important;
  }
  /* R70 nav geometry retired; R71 is sole dock authority. */
  html body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-toolbar{
    display:flex!important;grid-template-columns:none!important;width:auto!important;min-width:0!important;height:52px!important;min-height:52px!important;max-height:52px!important;
    margin:0 var(--m70-edge)!important;padding:7px 0!important;gap:7px!important;align-items:center!important;justify-content:flex-start!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route]:not(.media-immersive-page) .gallery-experience-shell .gallery-main .gallery-select-toggle{
    display:flex!important;flex:0 0 auto!important;width:auto!important;min-width:94px!important;max-width:116px!important;
    height:36px!important;min-height:36px!important;max-height:36px!important;padding:0 10px!important;margin:0!important;gap:7px!important;
  }
}

@media (max-width:900px){
  /* Hard-final Files action density. */
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] .files-action-card{
    padding:8px 0 10px!important;margin:0 var(--m70-edge)!important;width:auto!important;max-width:none!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] .files-action-card .files-primary-actions{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;margin:0!important;gap:8px!important;padding:0!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] .files-action-card .files-primary-actions>.files-action-button{
    width:100%!important;min-width:0!important;height:40px!important;min-height:40px!important;max-height:40px!important;margin:0!important;padding:0 10px!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] .files-action-card .files-filter-strip{
    margin:0!important;padding:2px 0!important;gap:5px!important;
  }
}

/* R70 Files hard-final section header: defeats historical mobile column stacking and eliminates dead vertical space. */
@media (max-width:900px){
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] :is(.file-browser-card,.photo-library-card){
    width:auto!important;max-width:none!important;min-width:0!important;
    margin:10px var(--m70-edge) var(--m70-bottom-clear)!important;
    padding:0!important;overflow:hidden!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] :is(.file-browser-card,.photo-library-card) > .section-head{
    box-sizing:border-box!important;
    display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;flex-wrap:nowrap!important;
    width:100%!important;min-width:0!important;height:52px!important;min-height:52px!important;max-height:52px!important;
    margin:0!important;padding:8px 10px!important;gap:8px!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] :is(.file-browser-card,.photo-library-card) > .section-head > div:first-child{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-content:center!important;gap:2px!important;
    flex:1 1 auto!important;width:auto!important;min-width:0!important;max-width:none!important;margin:0!important;padding:0!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] :is(.file-browser-card,.photo-library-card) > .section-head :is(h1,h2,h3,p){
    margin:0!important;padding:0!important;min-width:0!important;max-width:100%!important;
    overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] :is(.file-browser-card,.photo-library-card) > .section-head h2{
    font-size:14px!important;line-height:1.15!important;font-weight:700!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] :is(.file-browser-card,.photo-library-card) > .section-head p{
    font-size:10.5px!important;line-height:1.15!important;color:var(--drive-muted)!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] :is(.file-browser-card,.photo-library-card) > .section-head > .section-actions{
    display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-end!important;flex-wrap:nowrap!important;
    flex:0 0 auto!important;width:auto!important;min-width:0!important;max-width:none!important;height:34px!important;min-height:34px!important;max-height:34px!important;
    margin:0!important;padding:0!important;gap:5px!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] :is(.file-browser-card,.photo-library-card) > .section-head > .section-actions > :where(button,a,.icon-btn){
    box-sizing:border-box!important;display:grid!important;place-items:center!important;
    width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;max-width:34px!important;max-height:34px!important;
    margin:0!important;padding:0!important;border-radius:9px!important;transform:none!important;box-shadow:none!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] :is(.file-browser-card,.photo-library-card) > .file-table-head{
    margin:0!important;padding:0 10px!important;min-height:34px!important;height:34px!important;align-items:center!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route="files.php"] :is(.file-browser-card,.photo-library-card) > :is(.file-table,.photo-library){
    width:100%!important;min-width:0!important;margin:0!important;padding:0!important;
  }
}


/* ============================================================================
   R70 CLEAN-RUNTIME HARD FINAL
   No historical PWA control authority is active before this sheet on authenticated
   pages. These rules intentionally own header + bottom navigation at <= 900px.
   ============================================================================ */
@media (max-width:900px){
  body[data-omvia-auth="1"]{
    --m70-edge:14px;
    --m70-header-height:58px;
    --m70-utility-h:42px;
    --m70-utility-control:34px;
    --m70-nav-height:56px;
    --m70-nav-control:40px;
    --m70-bottom-clear:calc(78px + env(safe-area-inset-bottom));
  }

  /* Header = flexible brand + one fixed clean utility capsule. */
  html body[data-omvia-auth="1"] :is(.ref-topbar,.gallery-topbar){
    grid-template-columns:minmax(0,1fr) 150px!important;
    grid-template-rows:auto auto!important;
    align-items:center!important;
    min-height:calc(var(--m70-header-height) + env(safe-area-inset-top))!important;
    padding:max(8px,env(safe-area-inset-top)) max(var(--m70-edge),env(safe-area-inset-right)) 8px max(var(--m70-edge),env(safe-area-inset-left))!important;
    column-gap:10px!important;row-gap:8px!important;
    overflow:visible!important;
  }
  html body[data-omvia-auth="1"] :is(.ref-mobile-brand,.gallery-mobile-brand){
    grid-column:1!important;grid-row:1!important;justify-self:start!important;
    width:auto!important;min-width:0!important;max-width:150px!important;height:34px!important;
    margin:0!important;padding:0!important;overflow:hidden!important;
  }
  html body[data-omvia-auth="1"] .ref-mobile-brand img{
    width:136px!important;max-width:136px!important;height:28px!important;max-height:28px!important;
    object-fit:contain!important;object-position:left center!important;margin:0!important;
  }
  html body[data-omvia-auth="1"] .gallery-mobile-brand{
    display:flex!important;align-items:center!important;gap:8px!important;
  }
  html body[data-omvia-auth="1"] .gallery-mobile-brand img{
    flex:0 0 30px!important;width:30px!important;height:30px!important;min-width:30px!important;max-width:30px!important;
    object-fit:contain!important;margin:0!important;
  }
  html body[data-omvia-auth="1"] .gallery-mobile-brand strong{
    display:block!important;min-width:0!important;max-width:108px!important;
    margin:0!important;padding:0!important;font-size:16px!important;line-height:1!important;font-weight:690!important;
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  }

  html body[data-omvia-auth="1"] :is(.ref-top-actions,.gallery-top-actions){
    grid-column:2!important;grid-row:1!important;justify-self:end!important;
    display:flex!important;align-items:center!important;justify-content:center!important;flex-wrap:nowrap!important;
    box-sizing:border-box!important;width:150px!important;min-width:150px!important;max-width:150px!important;
    height:var(--m70-utility-h)!important;min-height:var(--m70-utility-h)!important;max-height:var(--m70-utility-h)!important;
    margin:0!important;padding:3px 4px!important;gap:2px!important;
    border:1px solid var(--drive-line)!important;border-radius:21px!important;
    background:color-mix(in srgb,var(--drive-panel) 97%,transparent)!important;
    box-shadow:0 5px 16px color-mix(in srgb,#000 9%,transparent)!important;
    overflow:hidden!important;
  }
  html body[data-omvia-auth="1"] :is(.ref-top-actions,.gallery-top-actions)>.omvia-display-controls{
    display:contents!important;width:auto!important;height:auto!important;min-width:0!important;max-width:none!important;
    margin:0!important;padding:0!important;gap:0!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;
  }
  html body[data-omvia-auth="1"] :is(.ref-top-actions,.gallery-top-actions) :is(
    .ref-icon-button,.gallery-icon-btn,.icon-btn,.lang-toggle,[data-theme-toggle],.ref-avatar-button,.gallery-account,.omvia-header-notifications,.omvia-header-account
  ){
    position:relative!important;box-sizing:border-box!important;display:grid!important;place-items:center!important;
    flex:0 0 var(--m70-utility-control)!important;
    width:var(--m70-utility-control)!important;height:var(--m70-utility-control)!important;
    min-width:var(--m70-utility-control)!important;min-height:var(--m70-utility-control)!important;
    max-width:var(--m70-utility-control)!important;max-height:var(--m70-utility-control)!important;
    margin:0!important;padding:0!important;border:0!important;border-radius:50%!important;
    outline:0!important;background:transparent!important;color:var(--drive-text)!important;
    box-shadow:none!important;filter:none!important;transform:none!important;text-decoration:none!important;overflow:hidden!important;
  }
  
  html body[data-omvia-auth="1"] :is(.ref-top-actions,.gallery-top-actions) :is(
    .ref-icon-button,.gallery-icon-btn,.icon-btn,.lang-toggle,[data-theme-toggle],.ref-avatar-button,.gallery-account,.omvia-header-notifications,.omvia-header-account
  ):active{background:var(--drive-active)!important;transform:scale(.96)!important;}
  html body[data-omvia-auth="1"] :is(.ref-top-actions,.gallery-top-actions) :is(svg,.svg,img){
    width:19px!important;height:19px!important;max-width:19px!important;max-height:19px!important;margin:0!important;
  }
  html body[data-omvia-auth="1"] :is(.ref-top-actions,.gallery-top-actions) .lang-toggle .lang-code{
    display:block!important;margin:0!important;padding:0!important;font-size:11px!important;line-height:1!important;font-weight:760!important;letter-spacing:.045em!important;
  }
  html body[data-omvia-auth="1"] :is(.ref-top-actions,.gallery-top-actions) :is(.avatar,.ref-avatar,.gallery-avatar,.omvia-header-avatar){
    display:grid!important;place-items:center!important;width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;max-width:28px!important;max-height:28px!important;
    margin:0!important;border-radius:50%!important;border:1px solid var(--drive-line)!important;box-shadow:none!important;background-size:cover!important;background-position:center!important;
  }
  /* Remove mobile-only duplicated/secondary header actions, without deleting their routes. */
  html body[data-omvia-auth="1"] .ref-top-actions :is(.ref-help,.home-mode-button){display:none!important;}
  html body[data-omvia-auth="1"] .gallery-top-actions>.gallery-icon-btn:nth-child(1),
  html body[data-omvia-auth="1"] .gallery-top-actions>.gallery-icon-btn:nth-child(2),
  html body[data-omvia-auth="1"] .gallery-top-actions>.gallery-icon-btn:nth-child(3){display:none!important;}
  html body[data-omvia-auth="1"] .gallery-top-actions .gallery-account>span:not(.avatar):not(.gallery-avatar),
  html body[data-omvia-auth="1"] .gallery-top-actions .gallery-account>svg,
  html body[data-omvia-auth="1"] .gallery-top-actions .gallery-account>.svg{display:none!important;}
  /* Search and dock geometry retired from R70; R71 is sole authority. */

  /* Make sure every primary mobile surface clears the fixed nav. */
  html body[data-omvia-auth="1"] :is(.ref-main,.files-ref-main,.gallery-main,.page-main,.account-main,.admin-main){padding-bottom:var(--m70-bottom-clear)!important;}
  html body[data-omvia-auth="1"] .gallery-photo-stream{padding-bottom:var(--m70-bottom-clear)!important;}

  /* Compact canonical create menu after retiring historical R11/R47/R48 CSS. */
  html body[data-omvia-auth="1"] :is(.mobile-create-popover,.mobile-create-modal){
    box-sizing:border-box!important;position:fixed!important;left:50%!important;right:auto!important;bottom:calc(var(--m70-nav-height) + max(18px,env(safe-area-inset-bottom)))!important;
    width:min(260px,calc(100vw - 28px))!important;max-width:260px!important;height:auto!important;max-height:none!important;
    margin:0!important;padding:7px!important;transform:translateX(-50%)!important;
    border:1px solid var(--drive-line)!important;border-radius:14px!important;background:var(--drive-panel)!important;box-shadow:0 14px 34px color-mix(in srgb,#000 18%,transparent)!important;
    overflow:hidden!important;z-index:180!important;
  }
  html body[data-omvia-auth="1"] :is(.mobile-create-popover,.mobile-create-modal) .mobile-create-choice{
    box-sizing:border-box!important;display:grid!important;grid-template-columns:34px minmax(0,1fr)!important;align-items:center!important;
    width:100%!important;min-height:44px!important;margin:0!important;padding:5px 8px!important;gap:9px!important;
    border:0!important;border-radius:9px!important;background:transparent!important;color:var(--drive-text)!important;box-shadow:none!important;text-align:left!important;
  }
  
  html body[data-omvia-auth="1"] :is(.mobile-create-popover,.mobile-create-modal) .mobile-create-choice :is(svg,.svg){width:20px!important;height:20px!important;}
}

@media(max-width:360px){
  html body[data-omvia-auth="1"] :is(.ref-topbar,.gallery-topbar){grid-template-columns:minmax(0,1fr) 142px!important;column-gap:7px!important;}
  html body[data-omvia-auth="1"] :is(.ref-top-actions,.gallery-top-actions){width:142px!important;min-width:142px!important;max-width:142px!important;padding-inline:2px!important;gap:1px!important;}
  html body[data-omvia-auth="1"] :is(.ref-mobile-brand,.gallery-mobile-brand){max-width:126px!important;}
  html body[data-omvia-auth="1"] .ref-mobile-brand img{width:118px!important;max-width:118px!important;}
  html body[data-omvia-auth="1"] .gallery-mobile-brand strong{max-width:88px!important;font-size:14.5px!important;}
}

/* R70 specificity seal: defeats the last historical selector shapes that were
   carried forward only as broad page geometry reference inside this consolidated file. */
@media (max-width:900px){
  html body[data-omvia-auth="1"][data-omvia-route] .ref-topbar .ref-top-actions,
  html body[data-omvia-auth="1"][data-omvia-route] .gallery-experience-shell .gallery-topbar .gallery-top-actions{
    box-sizing:border-box!important;width:150px!important;min-width:150px!important;max-width:150px!important;
    height:42px!important;min-height:42px!important;max-height:42px!important;
    margin:0!important;padding:3px 4px!important;gap:2px!important;border:1px solid var(--drive-line)!important;border-radius:21px!important;
    background:color-mix(in srgb,var(--drive-panel) 97%,transparent)!important;box-shadow:0 5px 16px color-mix(in srgb,#000 9%,transparent)!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route] .ref-topbar .ref-top-actions>.omvia-display-controls,
  html body[data-omvia-auth="1"][data-omvia-route] .gallery-experience-shell .gallery-topbar .gallery-top-actions>.omvia-display-controls{
    display:contents!important;margin:0!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important;
  }
  html body[data-omvia-auth="1"][data-omvia-route] .ref-topbar .ref-top-actions :is(.ref-icon-button,.icon-btn,.lang-toggle,[data-theme-toggle],.ref-avatar-button,.omvia-header-notifications,.omvia-header-account),
  html body[data-omvia-auth="1"][data-omvia-route] .gallery-experience-shell .gallery-topbar .gallery-top-actions :is(.gallery-icon-btn,.icon-btn,.lang-toggle,[data-theme-toggle],.gallery-account,.omvia-header-notifications,.omvia-header-account){
    box-sizing:border-box!important;flex:0 0 34px!important;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;max-width:34px!important;max-height:34px!important;
    margin:0!important;padding:0!important;border:0!important;border-radius:50%!important;background:transparent!important;box-shadow:none!important;transform:none!important;
  }
  /* R71 owns the mobile/PWA dock. */
}

/* R79 Files grid geometry (sanitized, no legacy hover authority). */
/* Omvia Cloud v2.0.11.4-R77 — Files Grid Card Refinement + Fluidity Authority
   Sole active Mobile/PWA Files grid geometry authority.
   R74 is retired from the active runtime and archived under legacy/grid-pre-r77/.
   Functional markup, actions, upload, sharing, preview and navigation are untouched. */

@media (max-width:900px){
  body[data-omvia-auth="1"][data-omvia-route="files.php"]{
    --r77-grid-edge:12px;
    --r77-grid-gap:12px;
    --r77-card-radius:16px;
    --r77-card-pad-x:12px;
    --r77-card-pad-top:14px;
    --r77-card-pad-bottom:10px;
    --r77-card-height:190px;
    --r77-action-size:32px;
    --r77-action-gap:4px;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .premium-files-browser:has(.file-table.grid-view) .file-table-head{
    display:none!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view{
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-items:stretch!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:var(--r77-grid-edge)!important;
    gap:var(--r77-grid-gap)!important;
    background:transparent!important;
    overflow:visible!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view>.file-row{
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:minmax(0,1fr) auto!important;
    align-items:stretch!important;
    align-content:stretch!important;
    width:100%!important;
    min-width:0!important;
    height:var(--r77-card-height)!important;
    min-height:var(--r77-card-height)!important;
    max-height:var(--r77-card-height)!important;
    margin:0!important;
    padding:var(--r77-card-pad-top) var(--r77-card-pad-x) var(--r77-card-pad-bottom)!important;
    gap:8px!important;
    border:1px solid var(--drive-line)!important;
    border-radius:var(--r77-card-radius)!important;
    background:var(--drive-panel)!important;
    box-shadow:none!important;
    overflow:hidden!important;
    transform:none!important;
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
    contain:layout paint!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view :where(.file-open,.folder-open){
    box-sizing:border-box!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    padding:4px 5px 3px!important;
    gap:10px!important;
    text-align:center!important;
    text-decoration:none!important;
    overflow:hidden!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view :where(.file-icon,.folder-premium-icon,.omvia-filetype){
    display:grid!important;
    place-items:center!important;
    flex:0 0 54px!important;
    width:54px!important;
    height:54px!important;
    min-width:54px!important;
    min-height:54px!important;
    max-width:54px!important;
    max-height:54px!important;
    margin:0!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .omvia-filetype img{
    width:38px!important;
    height:38px!important;
    max-width:38px!important;
    max-height:38px!important;
    object-fit:contain!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .file-copy{
    box-sizing:border-box!important;
    display:grid!important;
    align-content:center!important;
    justify-items:center!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    padding:0 2px!important;
    gap:6px!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .file-name{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    color:var(--drive-text)!important;
    font-size:12.5px!important;
    font-weight:720!important;
    line-height:1.28!important;
    text-align:center!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .file-type{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    color:var(--drive-muted)!important;
    font-size:10.5px!important;
    font-weight:500!important;
    line-height:1.25!important;
    text-align:center!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view :where(.desktop-cell,.sharing-cell){
    display:none!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .file-actions{
    position:relative!important;
    box-sizing:border-box!important;
    grid-column:1!important;
    grid-row:2!important;
    align-self:end!important;
    justify-self:stretch!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    min-height:42px!important;
    margin:0!important;
    padding:10px 0 0!important;
    gap:var(--r77-action-gap)!important;
    border:0!important;
    background:transparent!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .file-actions::before{
    content:"";
    position:absolute;
    top:0;
    left:4px;
    right:4px;
    height:1px;
    background:var(--drive-line);
    opacity:.82;
    pointer-events:none;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .file-actions :where(.grid-action-btn,.row-menu){
    box-sizing:border-box!important;
    display:grid!important;
    place-items:center!important;
    flex:0 0 var(--r77-action-size)!important;
    width:var(--r77-action-size)!important;
    height:var(--r77-action-size)!important;
    min-width:var(--r77-action-size)!important;
    min-height:var(--r77-action-size)!important;
    max-width:var(--r77-action-size)!important;
    max-height:var(--r77-action-size)!important;
    margin:0!important;
    padding:0!important;
    border:1px solid var(--omvia-ui-line-soft,var(--drive-line))!important;
    border-radius:50%!important;
    background:transparent!important;
    color:var(--drive-muted)!important;
    box-shadow:none!important;
    transform:none!important;
    -webkit-tap-highlight-color:transparent!important;
    touch-action:manipulation!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .file-actions :where(.grid-action-btn,.row-menu) :where(svg,.svg){
    width:16px!important;
    height:16px!important;
    min-width:16px!important;
    min-height:16px!important;
    margin:0!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .grid-only-action>span{
    display:none!important;
  }

  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view>.empty-state{
    grid-column:1/-1!important;
  }

  /* Fluidity: keep paint work local to each card and avoid transform/filter churn. */
  body[data-omvia-auth="1"] :where(button,a,.btn,.file-row,.gallery-album-card){
    -webkit-tap-highlight-color:transparent;
  }
  body[data-omvia-auth="1"] :where(.file-table,.photo-library,.gallery-stream,.gallery-shell){
    -webkit-overflow-scrolling:touch;
  }
}

@media (max-width:380px){
  body[data-omvia-auth="1"][data-omvia-route="files.php"]{
    --r77-grid-edge:10px;
    --r77-grid-gap:9px;
    --r77-card-pad-x:10px;
    --r77-card-height:184px;
    --r77-action-size:30px;
    --r77-action-gap:4px;
  }
  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view :where(.file-icon,.folder-premium-icon,.omvia-filetype){
    width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important;max-width:50px!important;max-height:50px!important;flex-basis:50px!important;
  }
  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .omvia-filetype img{width:36px!important;height:36px!important;max-width:36px!important;max-height:36px!important}
}

@media (prefers-reduced-motion:no-preference){
  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view>.file-row{
    transition:border-color .14s ease,background-color .14s ease!important;
  }
  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .file-actions :where(.grid-action-btn,.row-menu){
    transition:background-color .13s ease,color .13s ease,border-color .13s ease,opacity .13s ease!important;
  }
}

@media (prefers-reduced-motion:reduce){
  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view>.file-row,
  body[data-omvia-auth="1"][data-omvia-route="files.php"] .file-table.grid-view .file-actions :where(.grid-action-btn,.row-menu){transition:none!important}
}


/* R79 preserved search authority: one surface only. */
body[data-omvia-auth="1"] :where(.ref-search,.gallery-search){
  box-sizing:border-box!important;display:flex!important;align-items:center!important;width:100%!important;min-width:0!important;max-width:none!important;
  height:40px!important;min-height:40px!important;max-height:40px!important;padding:0 12px!important;gap:9px!important;
  border:1px solid var(--r79-line-soft)!important;border-radius:12px!important;background:transparent!important;background-image:none!important;box-shadow:none!important;overflow:hidden!important;
}
body[data-omvia-auth="1"] :where(.ref-search,.gallery-search)::before,
body[data-omvia-auth="1"] :where(.ref-search,.gallery-search)::after{content:none!important;display:none!important}
body[data-omvia-auth="1"] :where(.ref-search,.gallery-search) input{
  box-sizing:border-box!important;flex:1 1 auto!important;width:100%!important;min-width:0!important;height:100%!important;margin:0!important;padding:0!important;
  border:0!important;border-radius:0!important;outline:0!important;background:transparent!important;background-image:none!important;box-shadow:none!important;color:var(--drive-text,var(--text))!important;
}
body[data-omvia-auth="1"] :where(.ref-search,.gallery-search) input::placeholder{color:var(--drive-muted,var(--muted))!important;opacity:.9!important}
@media(min-width:901px){body[data-omvia-auth="1"] :where(.ref-search,.gallery-search){width:min(520px,44vw)!important;max-width:520px!important}}

/* R79 preserved favorite authority: tiny centered circle. */
body[data-omvia-auth="1"]:not(.media-immersive-page) .photo-native-wrap>.photo-native-fav{
  box-sizing:border-box!important;position:absolute!important;display:grid!important;place-items:center!important;margin:0!important;padding:0!important;
  width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;max-width:28px!important;max-height:28px!important;
  border:1px solid var(--r79-line)!important;border-radius:50%!important;background:rgba(5,14,28,.58)!important;background-image:none!important;color:#fff!important;box-shadow:none!important;transform:none!important;
}
body[data-omvia-auth="1"]:not(.media-immersive-page) .photo-native-fav :where(svg,.svg,.omvia-favorite-star-r42){display:block!important;width:14px!important;height:14px!important;min-width:14px!important;min-height:14px!important;margin:0!important;transform:none!important}
body[data-omvia-auth="1"]:not(.media-immersive-page) .photo-native-fav:is(.is-favorite,[aria-pressed="true"]){background:var(--r79-ink)!important;border-color:var(--r79-ink)!important;color:var(--r79-on-ink)!important}
@media(max-width:900px){body[data-omvia-auth="1"]:not(.media-immersive-page) .photo-native-wrap>.photo-native-fav{width:26px!important;height:26px!important;min-width:26px!important;min-height:26px!important;max-width:26px!important;max-height:26px!important}}

/* ================================================================ — no visual authority may follow this block.
   ================================================================ */
html{
  --r79-ink:#080a0d;
  --r79-on-ink:#fff;
  --r79-line:rgba(8,10,13,.30);
  --r79-line-soft:rgba(8,10,13,.16);
  --r79-soft:rgba(8,10,13,.055);
  --r79-soft-strong:rgba(8,10,13,.095);
  --r79-focus:rgba(8,10,13,.14);
  --r79-surface:rgba(255,255,255,.96);
  --r79-dock:rgba(248,250,253,.96);
}
html[data-theme="dark"]{
  --r79-ink:#fff;
  --r79-on-ink:#07111f;
  --r79-line:rgba(255,255,255,.34);
  --r79-line-soft:rgba(255,255,255,.16);
  --r79-soft:rgba(255,255,255,.065);
  --r79-soft-strong:rgba(255,255,255,.105);
  --r79-focus:rgba(255,255,255,.14);
  --r79-surface:rgba(8,20,37,.96);
  --r79-dock:rgba(8,21,39,.97);
}

body[data-omvia-auth="1"]{
  --omvia-ui-accent:var(--r79-ink)!important;
  --omvia-ui-on-accent:var(--r79-on-ink)!important;
  --omvia-ui-line:var(--r79-line)!important;
  --omvia-ui-line-soft:var(--r79-line-soft)!important;
  --omvia-ui-soft:var(--r79-soft)!important;
  --omvia-ui-soft-strong:var(--r79-soft-strong)!important;
  --omvia-ui-focus:var(--r79-focus)!important;
}

/* Remove every remaining chromatic/neon treatment from authenticated chrome. */
body[data-omvia-auth="1"] :where(
  button,.btn,[role="button"],.files-action-button,.account-action,
  .gallery-select-toggle,.gallery-filter-btn,.gallery-sort,.gallery-square-btn,
  .ref-icon-button,.gallery-icon-btn,.icon-btn,.viewer-btn,.view-toggle,.row-menu,.grid-action-btn,
  .files-pagination button,.photo-native-fav,.gallery-sync-btn,.omvia-audio-top-action,.omvia-audio-control,
  .ref-nav-link,.gallery-side-nav a,.gallery-quick-access a,.admin-side-link,
  .file-options-menu a,.file-options-menu button,.context-menu a,.context-menu button,
  .dropdown-menu a,.dropdown-menu button,.omvia-popover a,.omvia-popover button,
  .home-mode-segment a,.home-mode-segment button,.gallery-home-mode-badge
){
  border-image:none!important;
  background-image:none!important;
  text-shadow:none!important;
  filter:none!important;
  box-shadow:none!important;
}

/* Resting controls use quiet monochrome lines, never cyan/violet gradients. */
body[data-omvia-auth="1"] :where(
  .btn.soft,.btn.ghost,.files-action-button:not(.primary),.account-action,
  .gallery-select-toggle,.gallery-filter-btn,.gallery-sort,.gallery-square-btn,
  .ref-icon-button,.gallery-icon-btn,.icon-btn,.viewer-btn,.view-toggle,.row-menu,.grid-action-btn,
  .files-pagination button,.gallery-sync-btn,.omvia-audio-top-action,.omvia-audio-control,
  .home-mode-segment a,.home-mode-segment button
){
  border-color:var(--r79-line-soft)!important;
  color:var(--drive-text,var(--text))!important;
}

/* Active selection is monochrome as well. */
body[data-omvia-auth="1"] :where(
  .btn.active,.home-mode-segment .active,.ref-nav-link.active,.gallery-side-nav a.active,
  .admin-side-link.active,.gallery-square-btn.active,.view-toggle.active,
  .files-pagination button.active,.files-pagination button[aria-current="page"],
  [aria-selected="true"].gallery-filter-btn
){
  border-color:var(--r79-line)!important;
  background:var(--r79-soft-strong)!important;
  color:var(--r79-ink)!important;
  -webkit-text-fill-color:currentColor!important;
  background-image:none!important;
  box-shadow:none!important;
}

/* R85: the generic authenticated hover/focus paint authority that lived here is retired.
   R79 retains geometry and field-focus support only; terminal interaction paint is owned by
   omvia-instagram-unified-authority-v2.0.11.4-r86.css. */
body[data-omvia-auth="1"] :focus-visible{outline-color:var(--r79-ink)!important;outline-offset:2px!important}
body[data-omvia-auth="1"] :where(input,select,textarea):focus{
  border-color:var(--r79-ink)!important;
  box-shadow:0 0 0 2px var(--r79-focus)!important;
  outline:0!important;
}
body[data-omvia-auth="1"] :where(.ref-search,.gallery-search,.v210-search,.search-input,.admin-search,.searchbar,.search-shell,.toolbar-search){
  background-image:none!important;
  transition:border-color .16s ease,box-shadow .16s ease!important;
}
body[data-omvia-auth="1"] :where(.ref-search,.gallery-search,.v210-search,.search-input,.admin-search,.searchbar,.search-shell,.toolbar-search):hover{
  box-shadow:none!important;
}
body[data-omvia-auth="1"] :where(.ref-search,.gallery-search,.v210-search,.search-input,.admin-search,.searchbar,.search-shell,.toolbar-search):focus-within{
  border-color:var(--r79-ink)!important;
  box-shadow:0 0 0 2px var(--r79-focus)!important;
  outline:0!important;
}
body[data-omvia-auth="1"] :where(.ref-search,.gallery-search,.v210-search,.search-input,.admin-search,.searchbar,.search-shell,.toolbar-search) :where(input,select,textarea),
body[data-omvia-auth="1"] :where(.ref-search,.gallery-search,.v210-search,.search-input,.admin-search,.searchbar,.search-shell,.toolbar-search) :where(input,select,textarea):focus{
  border-color:transparent!important;
  box-shadow:none!important;
  outline:0!important;
}
body[data-omvia-auth="1"] :where(input[type="checkbox"],input[type="radio"],input[type="range"]){accent-color:var(--r79-ink)!important}

/* Home experience: compact segmented control, no giant gradient pills. */
body[data-omvia-auth="1"] .home-mode-segment{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  width:max-content!important;
  max-width:100%!important;
  padding:6px!important;
  margin:0!important;
  border:1px solid var(--r79-line-soft)!important;
  border-radius:18px!important;
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}
body[data-omvia-auth="1"] .home-mode-segment :where(button,a,.btn){
  flex:0 0 auto!important;
  width:auto!important;
  min-width:92px!important;
  max-width:none!important;
  height:38px!important;
  min-height:38px!important;
  padding:0 18px!important;
  margin:0!important;
  border:1px solid transparent!important;
  border-radius:999px!important;
  background:transparent!important;
  background-image:none!important;
  color:var(--drive-text,var(--text))!important;
}
body[data-omvia-auth="1"] .home-mode-segment .active{
  border-color:var(--r79-line)!important;
  background:var(--r79-soft-strong)!important;
  color:var(--r79-ink)!important;
}

/* Button geometry: compact curved controls, no accidental edge-to-edge stretch. */
body[data-omvia-auth="1"] :where(.btn,.files-action-button,.account-action,.gallery-select-toggle,.gallery-filter-btn,.gallery-sort){
  width:auto!important;
  min-width:0!important;
  max-width:max-content!important;
  min-height:36px!important;
  height:36px!important;
  padding-inline:14px!important;
  border-radius:999px!important;
}
body[data-omvia-auth="1"] :where(.files-primary-actions,.account-plan-actions,.platform-action-row,.page-header-actions){
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-wrap:wrap!important;
  gap:10px!important;
}
body[data-omvia-auth="1"] .files-primary-actions>.files-action-button:only-child{grid-column:auto!important;width:auto!important}

/* Global clearspace: consistent card/header/body rhythm without changing behavior. */
body[data-omvia-auth="1"] :where(.section-card,.ref-card,.admin-card,.account-plan-card,.settings-card,.platform-card){
  box-sizing:border-box!important;
}
body[data-omvia-auth="1"] :where(.section-head,.ref-section-title,.admin-section-head){
  box-sizing:border-box!important;
  gap:12px!important;
}
body[data-omvia-auth="1"] :where(.account-plan-body,.section-body,.settings-body,.platform-card-body){
  box-sizing:border-box!important;
  min-width:0!important;
}
body[data-omvia-auth="1"] :where(.account-plan-body,.section-head-copy,.file-copy,.folder-copy,.ref-file-copy,.ref-activity-copy,.card-copy){
  min-width:0!important;
}
body[data-omvia-auth="1"] :where(.small.muted,.account-plan-body>p,.section-head-copy>p){
  margin-top:0!important;
  margin-bottom:0!important;
  line-height:1.5!important;
}


/* ================================================================
   R79 PROTECTED DOCK + MONOCHROME INTERACTION LOCK
   This is the sole active geometry for Mobile/PWA dock and the sole terminal
   hover/active authority for authenticated product chrome.
   ================================================================ */

/* Exact monochrome selected states: Dark = white, Light = black. */
body[data-omvia-auth="1"] :where(
  .btn.active,.home-mode-segment .active,.ref-nav-link.active,.gallery-side-nav a.active,
  .admin-side-link.active,.gallery-square-btn.active,.view-toggle.active,
  .files-pagination button.active,.files-pagination button[aria-current="page"],
  [aria-selected="true"], [aria-current="page"]
){
  border-color:var(--r79-ink)!important;
  background:var(--r79-ink)!important;
  background-image:none!important;
  color:var(--r79-on-ink)!important;
  -webkit-text-fill-color:currentColor!important;
  box-shadow:none!important;
  filter:none!important;
}

/* R85: legacy generic button/card interaction paint retired. Component geometry remains in R79. */

/* R80: dock geometry removed from R79. The protected dock authority is now
   assets/css/omvia-r72-dock-restore-v2.0.11.4-r80.css. */

/* Desktop/web uses the same identity without importing mobile dimensions. */
@media(min-width:901px){
  body[data-omvia-auth="1"] :where(.btn,.files-action-button,.account-action,.gallery-select-toggle,.gallery-filter-btn,.gallery-sort){min-height:38px!important;height:38px!important;padding-inline:16px!important}
  body[data-omvia-auth="1"] :where(.section-head,.ref-section-title,.admin-section-head){padding:18px 20px!important}
  body[data-omvia-auth="1"] :where(.account-plan-body,.section-body,.settings-body,.platform-card-body){padding:20px!important;gap:16px!important}
  body[data-omvia-auth="1"] .home-mode-segment :where(button,a,.btn){height:40px!important;min-height:40px!important;padding-inline:20px!important}
}

/* Gallery viewer chrome remains purely white over immersive media. */
.media-immersive-page .gallery-v24426 :where(.viewer-close-btn,.viewer-more-btn,.viewer-counter){
  border-color:rgba(255,255,255,.72)!important;color:#fff!important;background:rgba(5,13,25,.74)!important;background-image:none!important;box-shadow:0 4px 14px rgba(0,0,0,.18)!important;filter:none!important;
}
.media-immersive-page .gallery-v24426 :where(.viewer-close-btn,.viewer-more-btn):is(:hover,:focus-visible,:active){
  border-color:#fff!important;background:#fff!important;color:#07111f!important;box-shadow:none!important;
}

@media(prefers-reduced-motion:reduce){
  body[data-omvia-auth="1"] :where(a,button,.btn,.file-row,.gallery-album-card,.ref-mobile-nav,.mobile-nav,.gallery-mobile-nav,.scanner-mobile-nav){transition:none!important}
}
