/* Mobile experience - shared final overrides for landing, authentication and app. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
@media(max-width:840px){
  input,select,textarea{font-size:16px!important}
  button,a{touch-action:manipulation}
}

/* Landing --------------------------------------------------------------- */
@media(max-width:640px){
  body.landing-page{overflow-x:hidden}
  .landing-page .wrap,.landing-page .nav-inner{width:min(100% - 28px,var(--wrap))}
  .landing-page .nav{padding-top:env(safe-area-inset-top)}
  .landing-page .nav-inner{height:62px}
  .landing-page .brand{font-size:.94rem}.landing-page .brand img{width:30px;height:30px}
  .landing-page .nav-drawer{max-height:calc(100dvh - 62px - env(safe-area-inset-top));overflow:auto;padding:8px 14px calc(18px + env(safe-area-inset-bottom))}
  .landing-page .nav-drawer>a{min-height:48px;display:flex;align-items:center;padding:11px 6px}
  .landing-page .nav-drawer-cta{grid-template-columns:1fr}.landing-page .nav-drawer-cta .btn{min-height:50px}
  .landing-page .hero{padding-top:38px}.landing-page .hero-grid{gap:34px}
  .landing-page .hero-copy{text-align:left}.landing-page .hero-copy h1{margin:15px 0 17px;font-size:clamp(2.15rem,11vw,3rem);line-height:1.01}
  .landing-page .lead{font-size:1rem;line-height:1.62}
  .landing-page .hero-positioning{margin-top:18px;padding:13px}
  .landing-page .hero-actions{width:100%;display:grid;justify-content:stretch;margin:23px 0 18px}.landing-page .hero-actions .btn{width:100%;min-height:52px}
  .landing-page .assur{gap:8px 16px}.landing-page .assur li{font-size:.78rem}
  .landing-page .hero-visual{width:calc(100% + 4px)}.landing-page .chip-float{display:none}.landing-page .app-window{border-radius:17px}
  .landing-page .aw-body{padding:11px}.landing-page .aw-task{padding:8px;font-size:.72rem}.landing-page .aw-legend{gap:8px;font-size:.57rem}
  .landing-page .statband{margin-top:38px;padding:18px 14px;gap:0}.landing-page .stat{padding:14px 8px}.landing-page .stat strong{font-size:1.25rem}.landing-page .stat span{font-size:.68rem}
  .landing-page .section{padding-block:60px}.landing-page .sec-head{text-align:left}.landing-page .sec-head h2{font-size:2rem}.landing-page .sec-sub{font-size:.95rem}
  .landing-page .feat,.landing-page .adv{padding:22px 19px}
  .landing-page .product-demo-heading{margin-bottom:20px}.landing-page .product-demo-heading .btn{width:100%;min-height:49px}
  .landing-page .product-demo-shell{width:calc(100% - 20px)}.landing-page .product-demo-stage{min-height:720px}
  .landing-page .demo-week{overflow:hidden}.landing-page .demo-user-message{max-width:88%;font-size:.78rem}
  .landing-page .cmp{margin-inline:-14px;padding-inline:14px;overflow-x:auto;-webkit-overflow-scrolling:touch}.landing-page .cmp table{min-width:620px}
  .landing-page .cta{padding:34px 18px}.landing-page .cta h2{font-size:2rem}.landing-page .cta-actions{display:grid}.landing-page .cta-actions .btn{width:100%;min-height:52px}
  .landing-page .foot{padding-bottom:calc(28px + env(safe-area-inset-bottom))}.landing-page .foot-inner{align-items:flex-start;flex-direction:column}.landing-page .foot-links{margin-left:0;gap:10px 18px}.landing-page .foot-links a{min-height:38px;display:flex;align-items:center}
}

/* Authentication -------------------------------------------------------- */
@media(max-width:560px){
  body.auth-page{min-height:100dvh;background:#eef4ff}
  .auth-page .aurora-bg .orb{filter:blur(72px);opacity:.35}
  .auth-page .auth-stage{min-height:100dvh;display:block;padding:calc(14px + env(safe-area-inset-top)) 10px calc(18px + env(safe-area-inset-bottom))}
  .auth-page .card{width:100%;min-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:22px 18px 18px;border-radius:22px}
  .auth-page .brand{min-height:44px}.auth-page .brand img{width:36px;height:36px}
  .auth-page .card-head{margin:14px 0 16px}.auth-page .card-head h2{margin-top:10px;font-size:1.65rem}.auth-page .card-head p{font-size:.84rem}
  .auth-page .tabs{margin-bottom:16px}.auth-page .tabs button{min-height:46px;height:auto}
  .auth-page .field{margin-bottom:12px}.auth-page .field input,.auth-page .field select,.auth-page .aurora-select-trigger{min-height:52px;height:52px}
  .auth-page .password button{min-width:72px;min-height:44px}
  .auth-page .row{align-items:flex-start;gap:12px}.auth-page .row label{line-height:1.4}
  .auth-page .btn{min-height:50px}.auth-page .oauth-btn{min-height:50px}
  .auth-page .card-trust{align-items:flex-start;font-size:.7rem;line-height:1.4}.auth-page .foot{flex-wrap:wrap;line-height:1.6}
  .auth-page .email-confirmation{margin:16px 0 0;padding:18px 4px 4px}.auth-page .email-confirmation-icon{width:72px;height:72px;margin-bottom:17px;border-radius:23px}.auth-page .email-confirmation h2{font-size:1.62rem}.auth-page .email-confirmation>strong{font-size:.78rem;white-space:normal;overflow-wrap:anywhere}.auth-page .email-confirmation-note{margin:17px 0 15px}
  .auth-page .aurora-select-menu{bottom:calc(10px + env(safe-area-inset-bottom));max-height:72dvh}
}

/* Application ----------------------------------------------------------- */
@media(max-width:840px){
  body.app-page{min-width:0;overscroll-behavior-y:none}
  .app-page .shell{display:block!important;min-height:100dvh;height:auto!important}
  .app-page .sidebar{position:fixed!important;top:0;bottom:auto;left:0;width:min(92vw,370px);height:100dvh;margin:0;padding:0!important;display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden!important;border-radius:0 24px 24px 0;transform:translateX(calc(-100% - 24px));visibility:hidden;z-index:80;transition:transform .25s cubic-bezier(.22,1,.36,1),visibility 0s linear .25s}
  .app-page .sidebar.open{left:0}
  .app-page .main{display:block!important;min-width:0;min-height:100dvh;margin:0}
  .app-page .topbar{position:sticky;top:0;height:calc(62px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 10px 0;gap:8px}
  .app-page .topbar .icon-button{width:44px;height:44px;flex:none}.app-page .search-trigger{height:44px;min-width:0;padding:0 10px}
  .app-page .search-trigger>span:nth-child(2){font-size:.72rem}.app-page .top-actions{gap:5px}
  .app-page #logoutButton{display:none}
  .app-page .content{padding:12px 12px calc(92px + env(safe-area-inset-bottom));overflow-x:hidden}
  .app-page .page{width:100%;min-width:0}.app-page .page-heading{gap:14px;margin-bottom:16px;padding-bottom:14px}.app-page .page-heading h1{font-size:1.75rem}.app-page .page-heading p{font-size:.78rem;line-height:1.5}
  .app-page .page-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.app-page .page-actions .button{width:100%;min-width:0;min-height:46px;padding-inline:10px;white-space:normal;text-align:center}
  .app-page .card{max-width:100%;border-radius:16px}.app-page .padded{padding:16px}.app-page .card-head{align-items:flex-start}.app-page .card-head p{line-height:1.45}
  .app-page .button,.app-page .icon-button,.app-page .nav-link{min-height:44px}
  .app-page .sidebar.open{transform:translateX(0);visibility:visible;transition-delay:0s}
  .app-page .sidebar .brand{min-height:calc(72px + env(safe-area-inset-top));margin:0;padding:calc(12px + env(safe-area-inset-top)) 58px 12px 18px;border-bottom:1px solid var(--line)}
  .app-page .sidebar-mobile-close{position:absolute;top:calc(14px + env(safe-area-inset-top));right:12px;width:44px;height:44px;display:grid;place-items:center;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--text);z-index:3}
  .app-page .sidebar-mobile-close svg{width:19px;height:19px}
  .app-page .sidebar .side-nav{min-height:0;margin:0;padding:10px 12px 18px;overflow-x:hidden;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
  .app-page .sidebar .nav-caption{margin-top:17px}
  .app-page .sidebar .nav-caption:first-child{margin-top:5px}
  .app-page .sidebar .nav-link{min-height:48px}
  .app-page .sidebar .side-footer{margin:0;padding:10px 12px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--surface);z-index:2}
  .app-page .sidebar .sidebar-copyright{display:none}
  .app-page .sidebar-mobile-backdrop{position:fixed;inset:0;width:100%;height:100%;padding:0;border:0;background:rgba(17,25,44,.42);backdrop-filter:blur(4px);z-index:70}
  .app-page .sidebar-mobile-backdrop[hidden]{display:none}
  .app-page.mobile-menu-open{overflow:hidden;touch-action:none}
  .app-page.mobile-menu-open .mobile-nav{opacity:0;visibility:hidden;transform:translateY(18px);pointer-events:none}
  .app-page .mobile-nav{left:8px;right:8px;bottom:calc(7px + env(safe-area-inset-bottom));min-height:64px;padding:6px;border-radius:18px}.app-page .mobile-nav button{min-width:0;min-height:50px}.app-page .mobile-nav button small{font-size:.59rem;white-space:nowrap}
  .app-page .notification-center{top:calc(58px + env(safe-area-inset-top));max-height:calc(100dvh - 145px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
  .app-page .modal-backdrop{align-items:end;padding:0}.app-page .modal{width:100%;max-height:92dvh;border-radius:24px 24px 0 0;border-bottom:0}.app-page .modal-head{position:sticky;top:0;z-index:3;background:var(--surface)}.app-page .modal-body{padding:16px}.app-page .modal-actions{position:sticky;bottom:0;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:var(--surface)}
  .app-page .drawer{width:100%;border-left:0}.app-page .drawer-content{padding:16px calc(14px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left))}
  .app-page .calendar-page-actions{grid-template-columns:1fr 1fr}.app-page .calendar-page-actions #calendarFullscreenButton{display:none}.app-page .calendar-page-actions #calendarDownloadButton{grid-column:1/-1}
  .app-page .calendar-toolbar{align-items:center;flex-wrap:wrap;padding:10px}.app-page .calendar-toolbar>strong{min-width:0;flex:1;font-size:.78rem}.app-page .calendar-views{order:5;width:100%;display:grid;grid-template-columns:repeat(4,1fr);overflow:visible}.app-page .calendar-views button{min-width:0;padding-inline:5px}.app-page .calendar-plan-item{display:none}
  .app-page .calendar-hint{padding:9px 11px;font-size:.64rem}.app-page .calendar-scroll{max-width:100%;-webkit-overflow-scrolling:touch;scrollbar-width:thin}.app-page .week-calendar{grid-template-columns:44px repeat(7,112px);min-width:828px}.app-page .calendar-day-head{position:sticky;top:0;z-index:2}.app-page .time-label{font-size:.58rem}
  .app-page .view-list,.app-page .view-agenda,.app-page .month-grid{min-width:0!important}.app-page .agenda-day header{align-items:flex-start;gap:6px;flex-direction:column}
  .app-page .settings-nav{margin-inline:-4px;padding:6px}.app-page .setting-row{align-items:flex-start;flex-direction:column;gap:12px}.app-page .setting-row>.button{width:100%}
  .app-page .data-table-wrap,.app-page .table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .app-page .toast{bottom:calc(82px + env(safe-area-inset-bottom))}
}

/* The mobile dashboard is an action screen, not a compressed desktop grid. */
@media(max-width:720px){
  .app-page #page-dashboard .dashboard-final-head{min-height:0;margin:0 2px 10px;padding:0;gap:2px}
  .app-page #page-dashboard .dashboard-final-head>div:first-child{gap:2px 8px}
  .app-page #page-dashboard .dashboard-final-head .section-eyebrow{font-size:.51rem}
  .app-page #page-dashboard .dashboard-final-head h1{margin:2px 0;font-size:1.55rem;line-height:1.05;letter-spacing:-.05em}
  .app-page #page-dashboard .dashboard-final-head p{font-size:.58rem}
  .app-page #page-dashboard .dashboard-overview{display:flex!important;flex-direction:column;min-height:0;height:auto;margin-bottom:9px;border-radius:19px}
  .app-page #page-dashboard .dashboard-overview-status{min-height:0!important;padding:17px 17px 15px!important;gap:8px!important;border-bottom:1px solid var(--line)}
  .app-page #page-dashboard .dashboard-overview-status .brief-kicker{margin:0;font-size:.53rem}
  .app-page #page-dashboard .dashboard-overview-copy{grid-row:auto}
  .app-page #page-dashboard .dashboard-overview-copy>span{display:none}
  .app-page #page-dashboard .dashboard-overview-copy h2{margin:5px 0 6px;font-size:1.42rem;line-height:1.06}
  .app-page #page-dashboard .dashboard-overview-copy .dashboard-status-line{font-size:.64rem!important;line-height:1.42!important}
  .app-page #page-dashboard .dashboard-next-action{min-height:0;margin:0;padding:15px 17px 17px;border:0;border-radius:0;background:transparent;box-shadow:none}
  .app-page #page-dashboard .dashboard-next-action header{min-height:0}
  .app-page #page-dashboard .dashboard-next-action .brief-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:12px 0 10px}
  .app-page #page-dashboard .dashboard-next-action .brief-chip{min-height:42px;padding:7px 9px}
  .app-page #page-dashboard .dashboard-next-action .brief-chip.priority{grid-column:1/-1;min-height:36px}
  .app-page #page-dashboard .dashboard-next-action .brief-primary{width:100%;min-height:48px}
  .app-page .dashboard-quick-summary{display:flex;gap:8px;margin:0 -12px 10px;padding:0 12px;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none}
  .app-page .dashboard-quick-summary::-webkit-scrollbar{display:none}
  .app-page .dashboard-quick-summary article,.app-page .dashboard-quick-summary button{flex:0 0 76%;min-height:68px;padding:11px 13px;scroll-snap-align:start}
  .app-page #page-dashboard .dashboard-timeline-card{padding:16px;border-radius:18px}
  .app-page #page-dashboard .dashboard-timeline-card .card-head h2{font-size:1rem}
  .app-page .dashboard-landmarks{padding:15px;border-radius:18px}
  .app-page .dashboard-more>summary{min-height:62px;padding:11px 14px}

  .app-page #page-calendar.active{display:flex;flex-direction:column}
  .app-page #page-calendar>.page-heading{order:1}
  .app-page #page-calendar>.calendar-layout{order:2}
  .app-page #page-calendar>.planning-quick-host{order:3;margin-top:12px}
  .app-page #page-calendar>.page-heading{margin-bottom:12px;padding-bottom:0;border-bottom:0}
  .app-page #page-calendar>.page-heading>div:first-child h1{font-size:1.6rem}
  .app-page #page-calendar>.page-heading>div:first-child p{margin-top:3px}
  .app-page #page-calendar .calendar-page-actions{grid-template-columns:1fr 1fr}
  .app-page #page-calendar .calendar-page-actions .button{min-height:42px;font-size:.64rem}
  .app-page #page-calendar .agenda-card{display:none}
  .app-page #page-calendar .calendar-card{border-radius:18px}
  .app-page #page-calendar .calendar-toolbar{padding:9px;gap:7px}
  .app-page #page-calendar .calendar-scroll{min-height:430px;max-height:58dvh}
  .app-page #page-calendar .planning-quick-host>*{border-radius:18px}
}

@media(max-width:430px){
  .app-page .search-trigger>span:nth-child(2){display:none}.app-page .search-trigger{flex:0 0 44px;justify-content:center}.app-page .page-heading h1{font-size:1.6rem}
  .app-page .metric-grid,.app-page .metric-grid.compact{grid-template-columns:1fr}.app-page .metric-card{min-height:108px}
  .app-page .page-actions{display:flex;width:calc(100% + 12px);margin-right:-12px;padding-right:12px;gap:8px;overflow-x:auto;scrollbar-width:none}.app-page .page-actions::-webkit-scrollbar{display:none}.app-page .page-actions .button{width:auto;flex:0 0 auto;min-height:44px;white-space:nowrap}
  .app-page .calendar-page-actions{display:grid;width:100%;margin-right:0;padding-right:0;grid-template-columns:1fr 1fr;overflow:visible}.app-page .calendar-page-actions .button{width:100%;white-space:normal}
  .app-page .modal-actions{display:grid;grid-template-columns:1fr}.app-page .modal-actions .button{width:100%}
  .app-page .mobile-nav{left:5px;right:5px}.app-page .mobile-nav button small{font-size:.54rem}
}
