/* Master navigation only: desktop keeps its existing layout and hover menus. */
.app-header .ce-mobile-menu-toggle { display:none; }
@media (max-width:900px) {
    .app-header { width:calc(100% - 16px); margin:8px auto 0; border-radius:14px; }
    .app-header .app-header-inner { box-sizing:border-box; width:100%; grid-template-columns:minmax(0,1fr) auto; padding:10px 12px; gap:8px; text-align:left; }
    .app-header .brand { min-width:0; justify-self:start; }
    .app-header .brand-logo { width:180px!important; height:auto!important; max-width:100%; }
    .app-header .stretched-text,.app-header .devby { display:none; }
    .app-header .user-area { min-width:0; max-width:125px; justify-self:end; align-items:flex-end; text-align:right; gap:3px; }
    .app-header .welcome { font-size:12px; line-height:1.2; overflow-wrap:anywhere; }
    .app-header .pill-link { display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; min-height:36px; padding:5px 12px; font-size:12px; line-height:1.2; }
    .app-header .app-nav-mega { border-radius:0 0 14px 14px; box-shadow:none; background:#fff; }
    .app-header .app-nav-mega>.app-container { box-sizing:border-box; width:100%; padding:0 8px 8px; }
    /* Closed is the safe default: never show the full menu before a user opens it. */
    .app-header .ce-mobile-menu-toggle { display:flex; align-items:center; justify-content:center; width:44px; height:44px; min-height:44px; margin:0 4px; padding:10px; border:0; border-radius:8px; background:transparent; color:#18324d; cursor:pointer; }
    .app-header #ceMobileMenuLabel { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
    .app-header .ce-mobile-hamburger { display:flex; flex-direction:column; gap:5px; width:22px; }
    .app-header .ce-mobile-hamburger>span { display:block; width:22px; height:2px; border-radius:1px; background:currentColor; }
    .app-header:not(.ce-mobile-menu-open) #ceMobileMenuContent { display:none; }
    .app-header .mega-bar { display:flex; flex-direction:column; align-items:stretch; gap:0; min-height:0; }
    .app-header .mega-item,.app-header .mega-right { box-sizing:border-box; width:100%; margin:0; }
    .app-header .mega-top { box-sizing:border-box; display:flex; width:100%; min-height:44px; padding:10px 12px; font-size:13px; line-height:1.3; border-right:0; border-bottom:1px solid rgba(36,50,74,.1); white-space:normal; }
    .app-header .mega-panel { box-sizing:border-box; width:100%; min-width:0; max-width:none; padding:0 0 4px 12px; margin:0; border:0; border-radius:0; background:#fff; box-shadow:none; }
    .app-header.ce-mobile-nav-ready .mega-item>.mega-panel { display:none!important; }
    .app-header.ce-mobile-nav-ready .mega-item.ce-mobile-section-open>.mega-panel { display:block!important; }
    .app-header .mega-top-dd::after { content:"+"; font-size:18px; margin-left:8px; }
    .app-header .ce-mobile-section-open>.mega-top-dd::after { content:"−"; }
    .app-header .mega-links { grid-template-columns:minmax(0,1fr); gap:0; }
    .app-header .mega-link-item { display:flex!important; min-height:44px; padding:10px 12px; box-sizing:border-box; align-items:center; border:0; border-bottom:1px solid #edf1f5; border-radius:0; background:transparent; box-shadow:none; transform:none; text-decoration:none; }
    .app-header .mega-link-item:hover { background:#f1f6fb; box-shadow:none; transform:none; }
    .app-header .mega-icon { display:none; }
    .app-header .mega-copy strong { font-size:13px; font-weight:500; line-height:1.3; white-space:normal; }
    .app-header .mega-copy small,.app-header .mega-feature { display:none; }
    .app-header .mega-search-wrap { box-sizing:border-box; display:grid; grid-template-columns:minmax(0,1fr) 76px 60px; width:100%; padding:8px 0; gap:4px; margin:0; }
    .app-header .mega-search-input { grid-column:auto; padding:6px 8px; }
    .app-header .mega-search-input,.app-header .mega-search-by,.app-header .mega-search-btn { box-sizing:border-box; width:100%; min-width:0; height:36px; min-height:36px; margin:0; font-family:inherit; font-size:13px; font-weight:600; border-radius:7px; }
    .app-header .mega-search-by { padding:4px; }
    .app-header .mega-search-btn { padding:0 7px; font-size:13px; font-weight:600; background:#e8eff7; }
    .app-header .ce-mobile-menu-toggle:focus-visible,.app-header .mega-top:focus-visible { outline:3px solid #146bad; outline-offset:-3px; }
}

/* Search results alone; do not change other CRM tables on content pages. */
.global-search-panel .global-search-profile-link { color:#16518a; text-decoration:underline; text-underline-offset:2px; }
.global-search-panel .global-search-reference { -webkit-user-select:all; user-select:all; cursor:text; font-weight:700; }
.global-search-panel .ce-search-mobile-contact { display:none; }
.global-search-panel .ce-search-mobile-dob { display:none; }
.global-search-panel .global-search-grid-wrap>.global-search-count { display:block; margin:0 0 8px; overflow-wrap:anywhere; }
@media (max-width:900px) {
    .global-search-panel { box-sizing:border-box; width:100%; min-width:0; margin-top:10px; padding:10px; border-radius:12px; }
    .global-search-panel .global-search-head { flex-direction:row; align-items:center; gap:8px; margin-bottom:8px; }
    .global-search-panel .global-search-head-left { gap:5px; min-width:0; }
    .global-search-panel .global-search-head-right { margin-left:auto; flex-shrink:0; }
    .global-search-panel .global-search-title { padding:7px 12px; border-radius:999px; background:linear-gradient(110deg,#124b72,#00988d); color:white; font-size:13px; line-height:1.2; }
    .global-search-panel .global-search-count { font-size:11px; }
    .global-search-panel .global-search-close { padding:8px 10px; font-size:12px; border-radius:7px; }
    .global-search-panel .global-search-grid-wrap { overflow:visible; min-width:0; }
    .global-search-panel table.crm-grid { display:block; width:100%; min-width:0; border:0; background:transparent; box-shadow:none; border-radius:0; overflow:visible; }
    .global-search-panel .crm-grid>tbody { display:block; }
    .global-search-panel .crm-grid .crm-grid-header { display:none; }
    .global-search-panel .crm-grid tr.crm-grid-row,
    .global-search-panel .crm-grid tr.crm-grid-alt-row { display:block; margin:0 0 10px; padding:6px 10px; border:1px solid #c4dbe9; border-left:5px solid #5753d8; border-radius:10px; background:#fff; cursor:default; }
    .global-search-panel .crm-grid tr.crm-grid-alt-row { background:#edf6fb; border-left-color:#009caf; }
    .global-search-panel .crm-grid td[data-label] { display:grid; grid-template-columns:88px minmax(0,1fr); align-items:baseline; gap:8px; padding:7px 0; font-size:13px; border-bottom:1px solid #edf1f6; background:transparent; white-space:normal; overflow-wrap:anywhere; }
    .global-search-panel .crm-grid td[data-label]:before { content:attr(data-label); justify-self:start; padding:4px 7px; border-radius:999px; background:#e5edf7; font-size:10px; font-weight:700; color:#31547a; }
    .global-search-panel .crm-grid td[data-label="Student ID"],
    .global-search-panel .crm-grid td[data-label="School Year"],
    .global-search-panel .crm-grid td[data-label="Phone"] { display:none; }
    .global-search-panel .crm-grid td[data-label="Mobile"]:before { content:"Contact"; }
    .global-search-panel .crm-grid td[data-label="Mobile"] { border-bottom:0; }
    .global-search-panel .ce-search-desktop-contact { display:none; }
    .global-search-panel .ce-search-mobile-contact { display:block; min-width:0; }
    .global-search-panel .ce-search-desktop-dob { display:none; }
    .global-search-panel .ce-search-mobile-dob { display:block; min-width:0; }
    .global-search-panel .crm-grid td[data-label="DOB"]:before { content:"DOB/Year"; }
    .global-search-panel .crm-grid td[data-label="Ref"] { margin:0 -4px 2px; padding:5px 6px; border:0; border-radius:7px; background:linear-gradient(110deg,#124b72,#00988d); }
    .global-search-panel .crm-grid td[data-label="Ref"] .global-search-profile-link { color:white; }
    .global-search-panel .crm-grid td[data-label="Ref"] .global-search-reference { color:white; }
    .global-search-panel .crm-grid td[data-label="Ref"]:before { background:rgba(255,255,255,.18); color:white; }
    .global-search-panel .crm-grid td[data-label]:last-child { border-bottom:0; }
    .global-search-panel .crm-grid tr:hover td:not([data-label="Ref"]) { background:transparent; }
    .global-search-panel .crm-grid-empty { display:block; padding:8px; white-space:normal; }
    .global-search-panel .global-search-profile-link { display:inline-block; padding:3px 0; font-weight:600; }
}
