/* =========================================================
   GOURAV STUDY ZONE 2.0 — RESPONSIVE / MOBILE SAFETY LAYER

   Loaded after page-specific CSS so this file can correct
   older small-screen rules without changing page functionality.
========================================================= */

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  overflow-x:hidden;
}

body{
  min-width:0;
  overflow-x:hidden;
}

.gsz-self-registration-link-hidden{
  display:none !important;
}

img,
video,
canvas,
svg,
iframe{
  max-width:100%;
}

img,
video{
  height:auto;
}

button,
a,
input,
select,
textarea{
  -webkit-tap-highlight-color:transparent;
}

button,
[role="button"],
.btn,
.auth-submit-btn,
.auth-secondary-btn,
.login-btn,
.menu-btn,
.icon-btn{
  touch-action:manipulation;
}

input,
select,
textarea{
  max-width:100%;
}

:where(h1,h2,h3,h4,p,small,strong,span,a,button,label,td,th){
  overflow-wrap:anywhere;
}

:where(button,a,input,select,textarea):focus-visible{
  outline:3px solid rgba(79,70,229,.22);
  outline-offset:2px;
}

.admin-table-wrap,
.exam-pattern-table-wrap,
.table-wrap,
[class*="table-wrap"]{
  overscroll-behavior-inline:contain;
  scrollbar-width:thin;
}

@media(max-width:900px){
  .shell{
    width:min(94%,760px) !important;
  }

  .admin-dashboard-page .admin-main,
  .admin-dashboard-page .admin-content,
  .admin-dashboard-page .admin-page-content{
    min-width:0 !important;
  }

  .admin-dashboard-page :is(
    .admin-table-actions,
    .admin-resource-actions,
    .quick-access-actions,
    .admin-management-actions,
    .premium-actions
  ) button{
    min-height:40px !important;
    font-size:12px !important;
    line-height:1.25 !important;
  }

  .admin-modal-card,
  .admin-dialog,
  [class*="admin-modal-card"],
  [class*="modal-card"]{
    max-width:calc(100vw - 24px) !important;
    max-height:calc(100dvh - 24px) !important;
  }
}

@media(max-width:650px){
  body{
    padding-bottom:0 !important;
    font-size:15px !important;
  }

  body.has-bottom-nav{
    padding-bottom:calc(72px + env(safe-area-inset-bottom,0px)) !important;
  }

  body.admin-dashboard-page{
    padding-bottom:0 !important;
  }

  .shell{
    width:min(94%,560px) !important;
  }

  .section{
    padding:48px 0 !important;
  }

  .nav-wrap{
    min-height:66px !important;
    gap:10px !important;
  }

  .brand{
    min-width:0;
  }

  .brand strong{
    font-size:15px !important;
  }

  .brand small{
    font-size:10px !important;
    letter-spacing:.45px !important;
  }

  .icon-btn,
  .menu-btn{
    width:44px !important;
    height:44px !important;
    min-width:44px !important;
    min-height:44px !important;
  }

  .mobile-menu{
    max-height:calc(100dvh - 86px);
    overflow-y:auto;
    overscroll-behavior:contain;
  }

  .mobile-menu a{
    min-height:44px !important;
    display:flex !important;
    align-items:center !important;
    padding:11px 14px !important;
    font-size:14px !important;
  }

  .hero h1,
  .auth-info-panel h1{
    font-size:clamp(31px,9vw,39px) !important;
    line-height:1.12 !important;
  }

  .hero-copy > p,
  .auth-info-panel > p,
  .section-note,
  .section-head p{
    font-size:14px !important;
    line-height:1.7 !important;
  }

  .section-kicker,
  .eyebrow{
    font-size:11px !important;
  }

  .btn,
  .auth-submit-btn,
  .auth-secondary-btn,
  .premium-plan-button,
  .resource-filter-reset{
    min-height:44px !important;
    padding:11px 14px !important;
    font-size:13px !important;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea{
    min-height:44px !important;
    font-size:16px !important;
    line-height:1.35 !important;
  }

  textarea{
    min-height:110px !important;
  }

  .auth-input-wrap{
    min-height:46px !important;
  }

  .auth-input-wrap input{
    font-size:16px !important;
  }

  .auth-field label,
  .auth-label-row label{
    font-size:13px !important;
  }

  .auth-field-error,
  .auth-status,
  .auth-divider span,
  .register-terms span,
  #loginRegistrationDisabledNotice{
    font-size:12px !important;
  }

  .auth-demo-box strong,
  .auth-security-note strong{
    font-size:12px !important;
  }

  .auth-demo-box p,
  .auth-security-note p{
    font-size:12px !important;
    line-height:1.6 !important;
  }

  .auth-select-wrap select{
    font-size:16px !important;
  }

  .register-terms input{
    width:18px !important;
    height:18px !important;
    margin-top:1px !important;
  }

  .finder-grid,
  .register-academic-grid,
  .career-filter-grid,
  .course-filter-grid,
  .quiz-filter-grid,
  .live-filter-grid{
    min-width:0;
  }

  .finder-grid label span,
  .finder-grid select{
    font-size:13px !important;
  }

  .quick-card p,
  .feature-grid article p,
  .source-grid article p,
  .notice-item p,
  .footer p,
  .footer-grid > div:first-child p,
  .footer-grid > div:not(:first-child) a{
    font-size:13px !important;
    line-height:1.6 !important;
  }

  .footer-bottom{
    font-size:12px !important;
  }

  .bottom-nav{
    height:calc(68px + env(safe-area-inset-bottom,0px)) !important;
    padding-bottom:env(safe-area-inset-bottom,0px) !important;
  }

  .bottom-nav a{
    min-width:0 !important;
    min-height:54px !important;
    padding:4px 2px !important;
    font-size:10.5px !important;
    line-height:1.15 !important;
  }

  .bottom-nav a span{
    font-size:18px !important;
    line-height:1 !important;
  }

  .resource-library-count,
  .course-result-count,
  .career-result-count{
    font-size:12px !important;
  }

  .admin-table-wrap,
  .exam-pattern-table-wrap,
  .table-wrap,
  [class*="table-wrap"]{
    width:100% !important;
    max-width:100% !important;
    overflow-x:auto !important;
    overflow-y:visible;
    -webkit-overflow-scrolling:touch;
  }

  .admin-dashboard-page :is(
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea
  ){
    font-size:16px !important;
  }

  .admin-dashboard-page :is(
    button,
    .admin-table-action-btn,
    .resource-filter-reset
  ){
    min-height:40px;
  }

  .admin-dashboard-page :is(
    .admin-table-actions,
    .admin-resource-actions,
    .quick-access-actions,
    .admin-management-actions,
    .premium-actions
  ) button{
    min-height:40px !important;
    padding:8px 11px !important;
    font-size:12px !important;
  }

  .admin-sidebar-nav a,
  .admin-sidebar-bottom a,
  .admin-sidebar-bottom button{
    min-height:44px !important;
  }

  .admin-modal,
  [class*="modal"]{
    overscroll-behavior:contain;
  }
}

@media(max-width:480px){
  .shell{
    width:calc(100% - 28px) !important;
  }

  .finder-grid,
  .register-academic-grid{
    grid-template-columns:1fr !important;
  }

  .quick-grid,
  .feature-grid{
    grid-template-columns:1fr !important;
  }

  .source-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .footer-grid{
    grid-template-columns:1fr !important;
  }

  .footer-grid > div:first-child{
    grid-column:auto !important;
  }

  .auth-card,
  .register-card{
    padding:20px 16px !important;
  }

  .cta,
  .live-banner,
  .finder-card{
    padding:22px 17px !important;
  }

  .admin-dashboard-page .admin-content,
  .admin-dashboard-page .admin-page-content{
    padding-left:12px !important;
    padding-right:12px !important;
  }
}

@media(max-width:360px){
  .shell{
    width:calc(100% - 22px) !important;
  }

  .bottom-nav a{
    font-size:9.5px !important;
  }
}

/* =========================================================
   MOBILE READABILITY + FUNCTIONAL GRID HARDENING
========================================================= */
@media(max-width:650px){
  p,
  li{
    font-size:max(13px, .82rem) !important;
  }

  small{
    font-size:12px !important;
    line-height:1.5 !important;
  }

  label{
    font-size:12.5px !important;
    line-height:1.4 !important;
  }

  button:not(.icon-btn):not(.menu-btn):not(.password-toggle-btn){
    min-height:40px !important;
    font-size:max(12px, .75rem) !important;
  }

  .password-toggle-btn{
    min-width:40px !important;
    min-height:40px !important;
  }

  [class*="filter-grid"],
  [class*="form-grid"],
  [class*="academic-grid"]{
    grid-template-columns:1fr !important;
  }

  :is(
    .course-summary-grid,
    .course-context-summary-grid,
    .quiz-summary-grid,
    .live-summary-grid,
    .career-summary-grid,
    .admin-stats-grid
  ){
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  :is(
    .courses-hero-card,
    .quiz-hero-card,
    .live-hero-card,
    .career-hero-card
  ){
    grid-template-columns:1fr !important;
    padding:24px 18px !important;
  }

  :is(
    .courses-hero-visual,
    .quiz-hero-visual,
    .live-hero-visual,
    .career-hero-visual
  ){
    min-height:150px !important;
  }

  .career-technical-generic-grid{
    grid-template-columns:1fr !important;
  }

  .admin-topbar{
    min-height:62px !important;
    gap:8px !important;
  }

  .admin-sidebar-toggle{
    width:44px !important;
    height:44px !important;
  }

  .admin-content{
    min-width:0 !important;
  }

  .admin-data-table{
    font-size:12px !important;
  }

  .admin-data-table th,
  .admin-data-table td{
    padding-top:10px !important;
    padding-bottom:10px !important;
  }

  .live-recording-modal-card,
  .resource-viewer-modal-card,
  .first-login-card{
    width:calc(100vw - 24px) !important;
    max-width:calc(100vw - 24px) !important;
    max-height:calc(100dvh - 24px) !important;
    overflow-y:auto !important;
  }
}

@media(max-width:420px){
  :is(
    .course-summary-grid,
    .course-context-summary-grid,
    .quiz-summary-grid,
    .live-summary-grid,
    .career-summary-grid,
    .admin-stats-grid
  ){
    grid-template-columns:1fr !important;
  }
}


/* =========================================================
   GSZ HEADER CONTROL CLICK / TOUCH HOTFIX

   Keeps Dark Mode and Mobile Menu controls above page layers
   and clickable on desktop, tablet and real mobile devices.
========================================================= */

.topbar{
  isolation:isolate;
}

.topbar .nav-wrap{
  position:relative;
  z-index:1202;
}

.topbar .nav-actions{
  position:relative;
  z-index:1204;
  pointer-events:auto !important;
}

.topbar #themeToggle,
.topbar #menuToggle{
  position:relative;
  z-index:1205;
  pointer-events:auto !important;
  cursor:pointer !important;
  user-select:none;
  -webkit-user-select:none;
  touch-action:manipulation !important;
}

.topbar .brand,
.topbar .desktop-nav{
  position:relative;
  z-index:1203;
}

.topbar .mobile-menu{
  z-index:1201 !important;
  pointer-events:auto;
}

.topbar .mobile-menu.show{
  pointer-events:auto !important;
}

@media(max-width:1180px){
  .topbar #themeToggle,
  .topbar #menuToggle{
    display:grid;
    place-items:center;
  }
}
