/* ========================================
   Mobile responsive fixes — all pages
   ======================================== */

/* LOGIN / REGISTER — enable scroll, stack panels */
@media(max-width:430px){
  .auth-body{overflow:auto;overflow-y:scroll}
  .auth-shell{height:auto;min-height:100vh;grid-template-columns:1fr}
  .auth-visual{display:none}
  .auth-form-panel{padding:22px 18px;min-height:100vh;display:flex;align-items:center}
  .auth-form-wrap{width:100%;max-width:380px;margin:0 auto}
  .auth-mobile-brand{display:flex;align-items:center;gap:9px;margin-bottom:30px;font-weight:600;font-size:18px;justify-content:center}
  .auth-form-wrap>.kicker{display:none}
  .auth-form-wrap>h2{font-size:22px}
  .auth-form-wrap>.auth-sub{margin-bottom:22px}
  form input{height:44px;font-size:15px!important}
  form .btn-primary{height:46px;font-size:14px}
  .auth-note{margin-top:20px}
}

/* SIDEBAR — slide-in drawer with backdrop */
@media(max-width:860px){
  .sidebar-backdrop{position:fixed;inset:0;z-index:299;background:rgba(0,0,0,.55);backdrop-filter:blur(2px);opacity:0;pointer-events:none;transition:opacity .25s}
  .sidebar-backdrop.show{opacity:1;pointer-events:auto}
  .sidebar{position:fixed;top:0;left:0;width:280px;height:100vh;transform:translateX(-100%);transition:transform .25s cubic-bezier(.4,0,.2,1);z-index:300;overflow-y:auto;box-shadow:4px 0 40px rgba(0,0,0,.3)}
  .sidebar.open{transform:translateX(0)}
  .main-area{width:100%;margin-left:0}
  .mobile-bar{height:58px;padding:0 14px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:var(--side);position:sticky;top:0;z-index:200}
  .mobile-bar .wordmark{height:auto;padding:0}
  .mobile-menu{font-size:22px;padding:8px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);color:var(--text);cursor:pointer;-webkit-tap-highlight-color:transparent}
  .mobile-menu:active{background:var(--surface-3)}
  .content{padding:18px 14px 80px}
}

@media(max-width:600px){
  /* Page header stacks */
  .page-header{flex-direction:column;gap:14px;margin-bottom:22px}
  .page-header h1{font-size:22px;margin:5px 0 4px;letter-spacing:-.5px}
  .event-date-line{font-size:11px!important;margin-bottom:6px!important}
  .event-brand-artwork{width:64px;height:40px;margin-bottom:4px}
  .header-actions{width:100%;flex-wrap:wrap;gap:7px}
  .header-actions .btn{font-size:11px;padding:0 10px;min-height:34px}
  .header-actions .btn span{display:none}
  .live-pill{font-size:10px;padding:0 8px;height:28px}
  .breadcrumb{font-size:10px}

  /* Metrics — 2 per row, compact */
  .metric-grid{grid-template-columns:1fr 1fr;gap:8px;margin-bottom:16px}
  .metric{min-height:80px;padding:12px;gap:10px}
  .metric-icon{width:30px;height:30px;font-size:13px;border-radius:8px}
  .metric b{font-size:18px}
  .metric span{font-size:10px}
  .metric small{font-size:9.5px}
  .metric.accent{display:none}

  /* Studio — stack, full width */
  .studio-grid{grid-template-columns:1fr;min-height:0}
  .settings-pane{padding:14px;border-right:0;border-bottom:1px solid var(--line);overflow-y:visible}
  .event-details-block{margin-bottom:12px;padding:12px}
  .event-details-block .control-head{margin-bottom:10px}
  .event-details-block .control-head b{font-size:12px}
  .event-details-block .control-head span{font-size:10px}
  .form-row{grid-template-columns:1fr;gap:8px}
  .canvas-pane{min-height:320px}
  .canvas-stage{min-height:280px;padding:12px}
  #preview-img{max-height:260px}
  .section-title{padding:16px 14px 13px}
  .section-title h2{font-size:14px}
  .section-title p{font-size:11px}

  /* Upload */
  .upload-drop{height:88px}
  .upload-drop b{font-size:12px}
  .upload-drop span{font-size:10px}
  .upload-drop .upload-symbol{font-size:20px;width:40px;height:40px}

  /* Two-col guest area */
  .two-col{grid-template-columns:1fr;gap:14px}
  .compact-card{min-height:auto}
  .compact-card>:not(.section-title){margin-left:14px;margin-right:14px}
  .inline-add{flex-direction:row}
  .inline-add input{flex:1}
  .inline-list{padding:10px 14px 14px;max-height:180px}

  /* Generate card */
  .generate-card{display:block;padding:18px;text-align:center}
  .generate-card h2{font-size:16px}
  .generate-card>p{font-size:11px}
  .generate-actions{margin-top:14px}
  .generate-actions .btn{width:100%;margin-bottom:6px}

  /* Gallery cards */
  .gallery{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px;margin-top:14px}
  .gcard img{height:150px}
  .gcard .cap b{font-size:10.5px}
  .gcard .cap code{font-size:8.5px}

  /* Guests grid */
  .guests-grid{grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:10px;padding:12px}

  /* Table toolbar */
  .table-toolbar{flex-direction:column;gap:10px;padding:12px}
  .search-box{width:100%}
  .search-box input{padding-left:33px;font-size:15px;height:42px}
  .toolbar-actions{width:100%;display:flex;gap:8px}
  .toolbar-actions select{flex:1;width:auto;height:42px;font-size:13px}
  .icon-button{height:42px;width:42px}

  /* Guest card meta */
  .guest-card-name{font-size:11px}
  .guest-card-status{font-size:8.5px}
  .guest-card-meta{padding:38px 9px 9px}

  /* Scanner — fix scroll and layout */
  .scanner-content{padding-bottom:calc(90px + env(safe-area-inset-bottom))}
  .scanner-grid{grid-template-columns:1fr;gap:12px}
  .scanner-frame{padding:6px}
  .scanner-corners{height:min(60%,200px)}
  .scanner{aspect-ratio:1;min-height:240px}
  .camera-status{left:12px;top:12px;font-size:10px;padding:5px 8px}
  .scan-actions{padding:10px 12px;flex-direction:column;gap:7px}
  .scan-actions .btn{width:100%;height:46px;font-size:13px}
  .camera-tip{padding:0 12px 12px;font-size:11px}
  .manual-panel{padding:16px}
  .manual-panel>h2{font-size:15px}
  .manual-panel>p{font-size:11px;margin-bottom:14px}
  .code-input input{height:52px;font-size:22px;text-align:center;letter-spacing:.25em}
  .manual-panel .btn-block{height:46px;font-size:13px}
  .scan-rule{padding:12px 0}
  .scan-rule small{font-size:10px}

  /* Profile panel — full width mobile drawer */
  .profile-panel{right:8px;top:8px;left:8px;width:auto;max-width:none;max-height:calc(100vh - 16px);border-radius:12px}
  .profile-trigger-copy,.profile-chevron{display:none}
  .profile-trigger{padding:4px;border-radius:9px}
  .profile-panel-head{padding:16px}
  .profile-panel-head h2{font-size:16px}
  .profile-photo-editor{padding:16px;gap:12px}
  .profile-photo-editor b{font-size:11.5px}
  .profile-photo-editor small{font-size:10px}
  .profile-form{padding:16px}
  .profile-form input{height:44px;font-size:14px}
  .profile-form .form-row{grid-template-columns:1fr;gap:10px}
  .profile-panel-foot{padding:0 16px 16px}

  /* Events page */
  .events-topbar{padding:0 14px;height:60px}
  .events-shell{padding:28px 14px 80px}
  .events-hero{flex-direction:column;align-items:flex-start;gap:12px;margin-bottom:22px}
  .events-hero h1{font-size:24px;letter-spacing:-.5px}
  .events-hero p{font-size:12px}
  .events-hero .btn{width:100%;font-size:13px;height:44px}
  .events-grid{grid-template-columns:1fr;gap:12px}
  .event-create-form{grid-template-columns:1fr;gap:8px;padding:16px}
  .event-create-form .btn{width:100%}
  .event-card{padding:16px}
  .event-card h2{font-size:16px;margin:14px 0 4px}
  .event-card p{font-size:10.5px}
  .event-card-foot{gap:6px;margin-top:18px}
  .event-card-foot .btn{font-size:11px;padding:0 10px;min-height:36px}
  .event-card-foot .btn span{display:none}
  .event-settings,.event-delete{width:36px;height:36px}
  .events-account>.profile-menu-root{display:block}
  .event-settings-dialog{left:8px;right:8px;width:auto;transform:none;top:50%;translate:0 -50%}
  .event-settings-dialog>header{padding:16px}
  .event-settings-dialog h2{font-size:18px}
  .event-settings-dialog form{padding:16px}
  .event-settings-dialog input{height:44px;font-size:14px}
  .event-settings-dialog .btn-block{height:46px}

  /* Toasts — full width bottom */
  .toasts{right:8px;bottom:calc(72px + env(safe-area-inset-bottom));left:8px}
  .toast{width:100%;font-size:12px;padding:12px 14px}

  /* Lightbox */
  .lightbox{padding:14px}
  .lightbox img{max-height:75vh;max-width:94vw}
  .lightbox-close{right:14px;top:12px;width:34px;height:34px;font-size:19px}

  /* Inputs — bigger touch targets, prevent iOS zoom */
  input,textarea,select{font-size:16px!important}
  input{height:44px}
  .field>span{font-size:11px}
  .upload-drop{font-size:12px}

  /* Section cards tighter */
  .section-card{border-radius:10px;margin-bottom:12px}
  .section-card{border-radius:10px;margin-bottom:12px}
  .section-title{padding:16px 16px 13px}
  .section-title h2{font-size:14px}
  .section-title p{font-size:11px}
  .section-title .section-badge,.section-title .count-badge{font-size:9px}

  /* Checkbox / slider touch targets */
  .switch-row{padding:12px 16px}
  .switch-row span{font-size:11.5px}
  .switch-row small{font-size:10px}

  /* Sidebar content on mobile */
  .sidebar .workspace{margin:16px 0 14px}
  .sidebar .side-nav a,.sidebar .side-action{height:42px;font-size:13px}
  .sidebar .profile-sidebar-button{padding:8px 10px;min-height:48px}
  .sidebar .profile-sidebar-button b{font-size:12px}
  .sidebar .profile-sidebar-button small{font-size:10px}
  .sidebar .profile-avatar{width:34px;height:34px;font-size:12px}
}

@media(max-width:380px){
  .metric-grid{grid-template-columns:1fr 1fr;gap:6px}
  .metric{padding:10px;gap:8px;min-height:72px}
  .metric b{font-size:16px}
  .page-header h1{font-size:20px}
  .gallery{grid-template-columns:1fr 1fr;gap:6px}
  .guests-grid{grid-template-columns:1fr 1fr;gap:8px;padding:10px}
  .gcard img{height:130px}
  .content{padding:14px 10px 70px}
  .mobile-bar{padding:0 10px}
  .events-shell{padding:20px 10px 70px}
}