/* GameChanger OTT — responsive Master Admin + Operator console
   Phone/tablet-only presentation overrides. No permissions, data, stream,
   activation, payment, or server logic is modified. 2026-11-09. */

body.dashboard-page .app-shell,
body.dashboard-page .workspace,
body.dashboard-page .content,
body.dashboard-page .page-section,
body.dashboard-page .platform-pane {min-width:0;max-width:100%}
body.dashboard-page .content img,body.dashboard-page .platform-pane img,
body.dashboard-page .page-section video {max-width:100%;height:auto}
body.dashboard-page .page-section pre,
body.dashboard-page .page-section code {overflow-wrap:anywhere;word-break:break-word}

/* Tablets and phones: always use the existing off-canvas navigation rather
   than an obsolete horizontal strip. In particular the open-state selector
   must match gc-nav-open ON BODY (as the existing console.js sets it). */
@media(max-width:980px) {
  body.dashboard-page {overflow-x:hidden}
  body.dashboard-page .app-shell {min-width:0;width:100%}
  body.dashboard-page .workspace {margin-left:0!important;width:100%!important;min-width:0!important}
  body.dashboard-page .sidebar {
    position:fixed!important;inset:0 auto 0 0!important;
    width:min(290px,86vw)!important;max-width:86vw!important;
    height:100vh!important;height:100dvh!important;
    z-index:1002!important;display:flex!important;flex-direction:column!important;
    transform:translate3d(-105%,0,0)!important;
    transition:transform .2s ease!important;overflow:hidden!important;
    visibility:hidden;pointer-events:none;
  }
  body.dashboard-page.gc-nav-open .sidebar {
    transform:translate3d(0,0,0)!important;
    visibility:visible;pointer-events:auto;
  }
  body.dashboard-page .sidebar .brand-lockup {flex:0 0 auto}
  body.dashboard-page .sidebar-navigation {
    display:block!important;min-height:0!important;flex:1 1 auto!important;
    overflow-y:auto!important;overflow-x:hidden!important;
    overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
    padding-bottom:max(20px,env(safe-area-inset-bottom))!important;
  }
  body.dashboard-page .sidebar .nav-list {display:flex!important;flex-direction:column!important;min-width:0!important}
  body.dashboard-page .sidebar .nav-group-label,
  body.dashboard-page .sidebar .sidebar-label {display:block!important}
  body.dashboard-page .sidebar .nav-link {display:flex!important;min-height:44px!important;height:auto!important;white-space:normal!important;padding-block:8px!important}
  body.dashboard-page .gc-mobile-scrim:not([hidden]) {
    display:block!important;position:fixed!important;inset:0!important;
    height:100vh!important;height:100dvh!important;width:100%!important;
    border:0!important;z-index:1001!important;
    background:rgba(17,5,25,.66)!important;
  }
  body.dashboard-page .gc-nav-toggle {
    display:inline-flex!important;justify-content:center!important;align-items:center!important;
    min-width:44px!important;width:44px!important;min-height:44px!important;height:44px!important;
    flex:0 0 44px!important;touch-action:manipulation;z-index:1
  }
  body.dashboard-page .topbar {width:100%!important;min-width:0!important;box-sizing:border-box!important;z-index:1000!important}
  body.dashboard-page .content {width:100%!important;min-width:0!important;padding:22px 18px 36px!important}
  body.dashboard-page .page-section {min-width:0!important}
  body.dashboard-page .platform-pane .panel,body.dashboard-page .panel {max-width:100%;min-width:0}
  body.dashboard-page .page-intro,body.dashboard-page .section-heading,
  body.dashboard-page .platform-pane .panel-head {flex-wrap:wrap;min-width:0;gap:12px}
  body.dashboard-page .gc-dashboard-layout,
  body.dashboard-page .gc-device-layout,
  body.dashboard-page .gc-source-publish-grid {min-width:0}
  body.dashboard-page .gc-device-layout {grid-template-columns:minmax(0,1fr)!important}
  body.dashboard-page .gc-device-inspector {position:static!important;max-width:100%}
  body.dashboard-page .platform-pane .split,
  body.dashboard-page .platform-pane .form-grid {grid-template-columns:minmax(0,1fr)!important}
  body.dashboard-page .platform-pane .stats,
  body.dashboard-page .stat-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  /* Keep all tabular data and actions: swipe the table, never cut its columns. */
  body.dashboard-page .table-wrap,
  body.dashboard-page .gc-dash-table-wrap,
  body.dashboard-page .gc-device-table-wrap,
  body.dashboard-page .gc-tool-table-wrap,
  body.dashboard-page .gc-table-scroll,
  body.dashboard-page .gc-mobile-table-scroll {
    display:block;max-width:100%!important;width:100%;min-width:0!important;
    overflow-x:auto!important;overflow-y:visible;
    -webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;
    scrollbar-width:thin;
  }
  body.dashboard-page .table-wrap table,
  body.dashboard-page .gc-dash-table-wrap table,
  body.dashboard-page .gc-device-table-wrap table,
  body.dashboard-page .gc-tool-table-wrap table,
  body.dashboard-page .gc-mobile-table-scroll table {width:max-content;min-width:100%;max-width:none}
  body.dashboard-page .page-section input[type=file] {max-width:100%!important;min-width:0!important}
  body.dashboard-page .page-section textarea {max-width:100%!important;min-width:0!important}
  body.dashboard-page .page-section .gc-source-sql-access {min-width:0}
  body.dashboard-page .page-section .gc-source-sql-access form {min-width:0!important;max-width:100%!important}
}

@media(min-width:601px) and (max-width:980px) {
  body.dashboard-page .topbar {padding:10px 18px!important;gap:10px!important}
  body.dashboard-page .content {padding:24px 20px 40px!important}
  body.dashboard-page .gc-device-metrics {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.dashboard-page .gc-dashboard-layout {grid-template-columns:minmax(0,1fr)!important}
  body.dashboard-page .gc-dashboard-layout>* {grid-column:1/-1!important;min-width:0}
  body.dashboard-page .gc-source-publish-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:600px) {
  html {scroll-padding-top:75px}
  body.dashboard-page .topbar {
    display:grid!important;grid-template-columns:44px minmax(0,1fr) auto!important;
    padding:10px 12px!important;gap:8px!important;min-height:68px!important;
  }
  body.dashboard-page .gc-nav-toggle {grid-column:1!important;order:0!important}
  body.dashboard-page .topbar-heading {
    display:grid!important;grid-column:2!important;min-width:0!important;
    max-width:100%!important;overflow:hidden;
  }
  body.dashboard-page .topbar-heading .breadcrumbs {min-width:0;white-space:normal!important;line-height:1.25}
  body.dashboard-page .topbar-heading .breadcrumbs strong {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
  body.dashboard-page .topbar-context {display:none!important}
  body.dashboard-page .topbar-actions {grid-column:3!important;display:flex!important;gap:6px!important;min-width:0!important}
  body.dashboard-page .admin-pill,body.dashboard-page .topbar-health {display:none!important}
  body.dashboard-page .gc-quick-search {width:44px!important;min-width:44px!important;max-width:44px!important;flex:0 0 44px!important}
  body.dashboard-page .gc-quick-search:focus-within {
    position:absolute!important;left:62px!important;right:10px!important;top:11px!important;
    width:auto!important;min-width:0!important;max-width:none!important;z-index:1003!important;
  }
  body.dashboard-page .gc-quick-search input {font-size:16px!important}
  body.dashboard-page .gc-quick-search:not(:focus-within) input[type=search] {
    width:100%!important;min-width:0!important;max-width:100%!important;
    padding:0!important;text-indent:-999px!important;
  }
  body.dashboard-page .logout-form .btn {
    width:44px!important;min-width:44px!important;min-height:44px!important;
    padding:0!important;justify-content:center!important;
  }
  body.dashboard-page .logout-form .btn span {display:none!important}
  body.dashboard-page .content {padding:16px 12px 32px!important}
  body.dashboard-page .page-section {scroll-margin-top:76px}
  body.dashboard-page .page-intro h1,
  body.dashboard-page .section-heading h2 {font-size:clamp(22px,6.5vw,29px)!important}
  body.dashboard-page .platform-pane .panel {padding:15px!important}
  body.dashboard-page .gc-dash-card {padding:15px!important;min-width:0}
  body.dashboard-page .gc-dashboard-layout {display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
  body.dashboard-page .gc-dashboard-layout>.gc-dash-card {grid-column:1/-1!important;min-width:0!important}
  body.dashboard-page .gc-action-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  body.dashboard-page .gc-action-grid>* {min-width:0!important}
  body.dashboard-page .gc-device-metrics {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.dashboard-page .gc-device-filters,body.dashboard-page .gc-device-panel-head {flex-wrap:wrap!important}
  body.dashboard-page .gc-device-search {min-width:0!important;flex:1 1 100%!important}
  body.dashboard-page .gc-device-filters select {min-width:0!important;flex:1 1 135px}
  body.dashboard-page .platform-pane .stats,
  body.dashboard-page .stat-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
  body.dashboard-page .platform-pane .inline-form {display:flex!important;flex-wrap:wrap!important;align-items:stretch!important}
  body.dashboard-page .platform-pane .inline-form > label {flex:1 1 100%;min-width:0}
  body.dashboard-page .platform-pane .inline-form input:not([type=checkbox]),
  body.dashboard-page .platform-pane .inline-form select {max-width:100%!important;min-width:0!important}
  body.dashboard-page .platform-pane .split {padding:12px 0}
  body.dashboard-page .page-section :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
    font-size:16px!important;max-width:100%!important;
  }
  body.dashboard-page .page-section :is(button,.btn,input[type=submit],select) {min-height:44px;touch-action:manipulation}
  body.dashboard-page .page-section :is(.btn,button) {max-width:100%;white-space:normal;overflow-wrap:anywhere}
  body.dashboard-page .page-section .gc-source-sql-access {flex-direction:column;align-items:stretch!important}
  body.dashboard-page #source-downloads .gc-source-publish-grid {grid-template-columns:minmax(0,1fr)!important}
  body.dashboard-page .gc2fa-recovery-overlay .gc2fa-recovery-box {width:calc(100vw - 24px);max-width:100%;max-height:calc(100dvh - 30px);overflow-y:auto}
}

@media(max-width:380px) {
  body.dashboard-page .content {padding-inline:9px!important}
  body.dashboard-page .gc-action-grid {grid-template-columns:1fr!important}
  body.dashboard-page .gc-device-metrics {grid-template-columns:1fr!important}
  body.dashboard-page .platform-pane .stats,
  body.dashboard-page .stat-grid {grid-template-columns:1fr 1fr!important}
}

/* Sign-in is shared by Master Admin and Operator. On small phones, the
   guardian artwork previously pushed the password form far below the fold. */
@media(max-width:680px) {
  body.login-page .guardian-login {display:block!important;width:100%;overflow-x:hidden}
  body.login-page .guardian-stage {min-height:0!important;padding:0 16px!important}
  body.login-page .guardian-masthead {min-height:74px!important}
  body.login-page .guardian-hero,
  body.login-page .guardian-stage-body,
  body.login-page .guardian-feature-grid,
  body.login-page .guardian-stage-footer {display:none!important}
  body.login-page .guardian-auth {padding-inline:12px!important;min-width:0}
  body.login-page .guardian-auth-top {min-height:45px!important}
  body.login-page .guardian-auth-center {padding:12px 0 24px!important}
  body.login-page .guardian-card {padding:21px 16px!important;border-radius:14px!important}
  body.login-page .guardian-card-brand {gap:10px!important;padding-bottom:17px!important}
  body.login-page .guardian-card-intro {padding:18px 0!important}
  body.login-page .guardian-card-intro h2 {font-size:clamp(24px,7vw,30px)!important}
  body.login-page .guardian-form {gap:15px!important}
  body.login-page .guardian-control input,
  body.login-page .guardian-control select {font-size:16px!important}
  body.login-page .guardian-auth-footer {flex-wrap:wrap;gap:6px;padding-block:12px;text-align:center;justify-content:center}
}
@media(prefers-reduced-motion:reduce) {
  body.dashboard-page .sidebar {transition:none!important}
}
