/* Shared Gatekeeper phone/foldable layout, loaded after the desktop themes. */
.gk-menu-toggle,.gk-menu-close,.gk-navigation-heading,.gk-mobile-brand,.gk-status-toggle{display:none}
.gk-navigation-backdrop[hidden],.gk-table-hint[hidden]{display:none!important}
.gk-table-scroll{min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.gk-table-scroll:focus-visible{outline:2px solid var(--ui-link,#38bdf8);outline-offset:3px}
.gk-table-hint{font-size:12px;line-height:1.5;color:var(--ui-muted,#94a3b8);margin:8px 0}

@media(max-width:1024px){
  html{scroll-padding-top:80px}
  .gk-responsive-shell{min-width:0;padding-bottom:0!important}
  .gk-responsive-shell>header,.gk-responsive-shell .shell>.topbar{position:sticky!important;top:0;z-index:40;height:auto!important;min-height:64px!important;padding:8px max(12px,env(safe-area-inset-left))!important;display:flex;align-items:center;flex-wrap:wrap;gap:8px!important;background:var(--ui-surface,#101f32);color:var(--ui-text,#e7f0fa);border-bottom:1px solid var(--ui-border,#34506b)}
  .gk-responsive-shell>header .brand,.gk-responsive-shell .topbar>.brand{display:flex;flex:1;min-width:0;gap:8px;color:inherit;text-decoration:none}
  .gk-responsive-shell>header .brand svg,.gk-responsive-shell .topbar>.brand svg{width:28px!important;height:30px!important;flex:none}
  .gk-responsive-shell>header .brand span,.gk-responsive-shell .topbar>.brand span{font-size:16px!important;line-height:1.2}
  .gk-responsive-shell>header .brand small,.gk-responsive-shell .topbar>.brand small{font-size:10px;letter-spacing:.05em}
  .gk-responsive-shell .topbar>.breadcrumb,.gk-responsive-shell>header #identity,.gk-responsive-shell>header #admin-presence,.gk-responsive-shell .topbar .profile,.gk-responsive-shell .topbar #system-health{display:none!important}
  .gk-responsive-shell .header-identity,.gk-responsive-shell .top-right{margin:0!important;gap:6px!important;flex:none;width:auto!important;min-width:0}
  .gk-menu-toggle,.gk-menu-close,.gk-status-toggle{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;margin:0!important;padding:8px!important;color:inherit;background:transparent;border:1px solid var(--ui-border,#34506b);border-radius:10px;font:inherit;font-size:13px;cursor:pointer}
  .gk-menu-toggle[hidden],.gk-status-toggle[hidden]{display:none!important}
  .gk-menu-toggle svg,.gk-menu-close svg{width:22px;height:22px;display:block;flex:none}
  .gk-navigation-heading .gk-menu-close{flex:0 0 44px;width:44px;max-width:44px;height:44px}
  .gk-responsive-shell .header-notification-bell{min-width:44px;min-height:44px;display:flex;align-items:center;justify-content:center;margin:0}
  .gk-responsive-shell>header .operator-health{display:none!important;order:10;flex:1 0 100%!important;max-width:100%;margin:0!important;padding:8px 0;gap:8px;flex-wrap:wrap;overflow:visible}
  .gk-responsive-shell>header.gk-status-open .operator-health:not([hidden]){display:flex!important}
  .gk-responsive-shell>header .health-chip{min-height:44px;font-size:13px!important;white-space:normal;text-align:left}

  /* The same drawer serves all existing navigation variants and routes. */
  .gk-responsive-shell .gk-navigation{position:fixed!important;inset:0 auto 0 0!important;top:0!important;bottom:0!important;width:min(352px,calc(100vw - 32px))!important;height:100dvh;max-height:100dvh;margin:0!important;padding:max(12px,env(safe-area-inset-top)) 14px max(12px,env(safe-area-inset-bottom))!important;display:flex!important;flex-direction:column;flex-wrap:nowrap;gap:12px;overflow:hidden!important;z-index:1001;transform:translateX(-105%);visibility:hidden;border:0!important;border-right:1px solid var(--ui-border,#34506b)!important;border-radius:0!important;background:var(--ui-surface,#101f32)!important;color:var(--ui-text,#e7f0fa);box-shadow:12px 0 40px #0005;transition:transform .18s ease,visibility .18s}
  .gk-navigation-open .gk-navigation{transform:translateX(0);visibility:visible}
  .gk-navigation-open{overflow:hidden!important}
  .gk-navigation-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:0 0 10px;border-bottom:1px solid var(--ui-border,#34506b);font-size:18px}
  .gk-navigation-backdrop{position:fixed;inset:0;z-index:1000;background:#04101bc4}
  .gk-navigation .nav-primary{flex:1 1 0;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain;padding:0 2px 12px}
  .gk-navigation .bento-nav{display:flex;flex-direction:column;flex:1 1 0;min-height:0;max-height:none!important;margin:0!important;overflow:hidden}
  .gk-navigation :is(a,button,summary){min-height:44px;font-size:15px!important;line-height:1.4}
  .gk-navigation a{display:flex;align-items:center;gap:12px;padding:12px!important;white-space:normal;overflow-wrap:anywhere}
  .gk-navigation .nav-icon{width:20px;height:20px;flex:none}
  .gk-navigation .nav-group>summary{display:flex;align-items:center;padding:12px 8px;letter-spacing:.06em;font-size:12px!important}
  .gk-navigation .nav-bottom{position:static!important;inset:auto!important;flex:none;margin:0!important;padding:12px 0 0!important;background:transparent!important;border-top:1px solid var(--ui-border,#34506b)}
  .gk-navigation .nav-bottom button{width:100%;justify-content:center;padding:10px}
  .gk-navigation>.brand{display:none}
  .gk-responsive-shell .shell{margin-left:0!important}
  body.gk-responsive-shell:has(#workspace:not([hidden]))>main,body.gk-responsive-shell:has(#workspace:not([hidden]) [data-page="dashboard"]:not([hidden]))>main{margin:0!important;max-width:100%;padding:20px 16px 28px!important;min-width:0}
  .gk-responsive-shell>.shell>main{padding:20px 16px 28px!important;max-width:100%;min-width:0}
  body.gk-responsive-shell>footer{margin-left:0!important}

  :root #workspace,:root #workspace [data-page],:root #workspace :is(.card,.profile-section,fieldset),:root dialog .sb-dialog-body{min-width:0;max-width:100%}
  :root #workspace>.heading,.gk-responsive-shell main>.heading{gap:12px;flex-wrap:wrap;align-items:center!important;margin-bottom:20px}
  :root #workspace h1,.gk-responsive-shell main h1{font-size:26px;line-height:1.25;letter-spacing:-.4px}
  :root #workspace .heading h2{line-height:1.35}
  :root #workspace :is(.heading,.profile-actions,.dashboard-actions,.table-pagination,.dashboard-topology-action){flex-wrap:wrap;gap:10px}
  :root #workspace button,:root dialog button,.gk-responsive-shell .button{min-height:44px;font-size:14px}
  .gk-responsive-shell .shell main button{min-width:44px;min-height:44px}
  .gk-responsive-shell .shell main .card-foot :is(a,button){display:inline-flex;align-items:center;min-height:44px}
  .gk-responsive-shell #attention [data-attention-row]{line-height:1.6;padding:10px 0;border-bottom:1px solid #ffffff18}
  .gk-responsive-shell #attention [data-attention-row]:last-child{border-bottom:0}
  .gk-responsive-shell #attention [data-attention-row] a{display:inline-flex;align-items:center;min-height:44px;margin-right:12px}
  .gk-responsive-shell #attention button:not(.button){padding:8px 12px;border:1px solid var(--border,#34506b);border-radius:8px;background:transparent;color:inherit}
  :root .login-access :is(input,button),:root #password-recovery :is(input,button){min-height:44px;font-size:16px;max-width:100%}
  :root #workspace input:not([type=checkbox]):not([type=radio]),:root #workspace select,:root #workspace textarea,:root dialog input:not([type=checkbox]):not([type=radio]),:root dialog select,:root dialog textarea{min-width:0;max-width:100%;font-size:16px;min-height:44px}
  :root #workspace input[type=checkbox],:root #workspace input[type=radio],:root dialog input[type=checkbox],:root dialog input[type=radio]{width:20px;height:20px;min-height:20px;flex:none}
  :root #workspace :is(pre,code,output){max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}
  :root #workspace :is(p,dd,li){overflow-wrap:anywhere}
  :root #workspace .gk-table-scroll,:root dialog .gk-table-scroll{max-width:100%;overflow-x:auto!important}
  :root #workspace table,:root dialog table{font-size:14px}
  :root #workspace .gk-wide-table,:root dialog .gk-wide-table{min-width:680px}
  :root #workspace table :is(th,td),:root dialog table :is(th,td){font-size:13px;line-height:1.45;padding:12px}
  :root dialog.sb-dialog-layout[open],:root #workspace dialog[open],:root dialog[open]{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important;box-sizing:border-box;padding:16px}
  :root .sb-dialog-header{gap:12px;min-width:0}
  :root .sb-dialog-header h2{font-size:20px!important;overflow-wrap:anywhere}
  :root .sb-dialog-footer{gap:8px;padding-top:12px;margin-top:12px}
  :root .sb-dialog-footer button{min-height:44px}
}

@media(min-width:601px) and (max-width:1024px){
  :root #workspace [data-page="dashboard"] .performance-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important;overflow:visible}
  :root #workspace .control-center-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:600px){
  :root #workspace .card,.gk-responsive-shell .shell main .card{padding:16px}
  :root #workspace :is(.grid,.pair,.profile-overview-grid,.configuration-profile-grid,.notification-layout,.notification-condition-row,.license-generator-fields,.license-filters,.appliance-filters,.activity-filters,.enrollment-history-filters,.relay-filters,.online-user-filters,.directory-toolbar,.relay-overview-grid,.relay-overview-summary),:root #workspace #router-enrollment-panel,:root #workspace #dns-search-form{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:none!important;gap:14px;min-width:0}
  :root #workspace :is(.grid,.pair,.profile-overview-grid,.configuration-profile-grid,.notification-layout,.notification-condition-row,.license-generator-fields,.license-filters,.appliance-filters,.activity-filters,.enrollment-history-filters,.relay-filters,.online-user-filters,.directory-toolbar,.relay-overview-grid,.relay-overview-summary)>*, :root #workspace #router-enrollment-panel>*, :root #workspace #dns-search-form>*{grid-column:auto!important;grid-row:auto!important;min-width:0}
  :root #workspace :is(.online-user-filters,.directory-toolbar) label{display:flex;flex-direction:column;margin:0;gap:6px}
  :root #workspace .directory-filter-picker{width:100%;margin:0!important}
  :root #workspace .directory-filter-picker>summary{min-height:44px;justify-content:center}
  :root #workspace .directory-filter-popover{left:0;right:auto;width:min(320px,calc(100vw - 64px));max-width:100%}
  :root #workspace [data-page="dashboard"] .performance-cards{grid-template-columns:minmax(0,1fr)!important;overflow:visible!important}
  :root #workspace [data-page="dashboard"] .performance-cards article{width:auto!important;min-width:0!important;min-height:180px}
  :root #workspace .control-center-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px}
  :root #workspace .control-center-cards h3{font-size:14px;line-height:1.4}
  :root #workspace .control-center-cards .cc-count{font-size:28px}
  :root #workspace .control-center-cards :is(a,button){min-height:44px;font-size:13px;display:inline-flex;align-items:center}
  :root #workspace #dashboard-service-health{grid-template-columns:minmax(0,1fr)!important}
  :root #workspace .live-map-node,:root #workspace #live-map-root .live-map-node{min-width:0!important;max-width:100%;overflow-wrap:anywhere}
  :root #workspace .live-map-leaves{margin-left:8px;padding-left:10px}
  :root #workspace .performance-specs,:root dialog .performance-specs,:root dialog .profile-summary,:root #directory-technical-fields{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr)!important;gap:6px 12px}
  :root dialog :is(.grid,.pair,.admin-account-profile,.admin-server-groups,.administrator-dialog-grid,.server-access-grid,.relay-overview-grid,.relay-sync-details,.relay-client-metrics),:root dialog #admin-account-form,:root dialog #relay-overview-summary{grid-template-columns:minmax(0,1fr)!important}
  :root dialog #relay-control-bar{flex-direction:column;align-items:stretch}
  :root .sb-dialog-footer{flex-wrap:wrap}
  :root .sb-dialog-footer>button{flex:1 1 auto}
  .gk-responsive-shell .bento{grid-template-columns:minmax(0,1fr)!important}
  .gk-responsive-shell .bento>.card{grid-column:1/-1!important}
  .gk-responsive-shell .shell .card :is(p,.caption,.card-foot,.detail-label,.service-name){font-size:13px}
  .gk-responsive-shell .shell .service-grid{grid-template-columns:minmax(0,1fr)}
  .gk-responsive-shell .shell .actions{flex-wrap:wrap}
  :root .login.control-login{width:100%;max-width:100%;margin:16px auto;padding:0}
  :root .login-access{padding:24px 18px}
  body:has(#role-form)>main{margin:16px auto;padding:0 12px;min-width:0}
  body:has(#role-form) section{padding:16px;min-width:0}
  body:has(#role-form) form{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
  body:has(#role-form) :is(label,input,select,fieldset){min-width:0;max-width:100%}
  body:has(#role-form) fieldset{flex-wrap:wrap}
}
@media(max-width:359px){
  :root #workspace .control-center-cards{grid-template-columns:minmax(0,1fr)!important}
  .gk-responsive-shell>header .brand span{font-size:14px!important}
}
@media(prefers-reduced-motion:reduce){.gk-responsive-shell .gk-navigation{transition:none}}
