/* S&R Auto — shared mobile polish */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
html,body{max-width:100%;overflow-x:hidden}
img,video{max-width:100%}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}

@media screen and (max-width: 800px){
  html{scroll-padding-top:8px}
  body{padding-bottom:max(8px,env(safe-area-inset-bottom));overflow-x:hidden!important}
  .wrap{width:calc(100% - 16px)!important;max-width:none!important;margin-left:auto!important;margin-right:auto!important;padding-left:0!important;padding-right:0!important}

  /* Shared app navigation: large enough to tap, never crushed into tiny buttons. */
  .topbar{position:static!important;top:auto!important;width:calc(100% - 16px)!important;max-width:none!important;margin:8px auto 0!important;padding:10px!important;border-radius:17px!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:9px!important;align-items:center!important}
  .topbar .brand{min-width:0!important;width:100%!important;gap:10px!important}
  .topbar .brand-logo-wrap{flex:0 0 44px!important;width:44px!important;height:40px!important}
  .topbar .brand-logo{max-width:44px!important;max-height:40px!important}
  .topbar .brand-mark,.topbar .brand-fallback{width:40px!important;height:40px!important;border-radius:12px!important;font-size:16px!important}
  .topbar .brand-copy{min-width:0!important}
  .topbar .brand-copy strong{font-size:14px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar .brand-copy span{font-size:10px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

  .nav-tabs,.top-actions,.topbar .actions{width:100%!important;max-width:100%!important;display:flex!important;justify-content:flex-start!important;align-items:center!important;gap:7px!important;overflow-x:auto!important;overflow-y:hidden!important;flex-wrap:nowrap!important;padding:1px 1px 3px!important;scrollbar-width:none!important;-webkit-overflow-scrolling:touch}
  .nav-tabs::-webkit-scrollbar,.top-actions::-webkit-scrollbar,.topbar .actions::-webkit-scrollbar{display:none!important}
  .nav-tab,.top-actions .btn,.top-actions a,.topbar .actions .btn,.topbar .actions a{flex:0 0 auto!important;white-space:nowrap!important;min-height:42px!important;padding:10px 13px!important}

  /* Layout + cards */
  .hero{border-radius:18px!important;padding:17px!important;margin-bottom:12px!important;gap:12px!important}
  .hero h1,.hero h2{line-height:1.05!important}
  .hero p{line-height:1.45!important}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin-bottom:12px!important}
  .stat{min-width:0!important;padding:13px!important;border-radius:16px!important;min-height:auto!important}
  .stat-value{font-size:22px!important;overflow-wrap:anywhere}
  .stat-note{font-size:10px!important;line-height:1.35!important}
  .panel,.card{border-radius:17px!important}

  /* Inputs should not trigger iOS zoom. */
  input,select,textarea,.field{font-size:16px!important;max-width:100%!important}
  textarea{min-height:88px}
  .form-grid,.settings-grid,.summary-grid{grid-template-columns:1fr!important}
  .form-group.wide,.settings-grid .wide{grid-column:auto!important}

  /* Buttons and action rows. */
  .btn,.button{min-height:42px}
  .toolbar,.panel-title-row,.builder-top,.workflow-section-head{min-width:0}

  /* Dialogs become comfortable phone sheets. */
  .modal{padding:0!important;align-items:end!important;place-items:end center!important}
  .modal-card{width:100%!important;max-width:none!important;max-height:94dvh!important;border-radius:22px 22px 0 0!important;padding:16px!important;padding-bottom:max(16px,env(safe-area-inset-bottom))!important;overscroll-behavior:contain}
  .modal-head{position:sticky;top:-16px;z-index:4;background:inherit;padding-top:4px}
  .modal-footer{gap:8px!important;flex-wrap:wrap!important}
  .modal-footer .btn,.modal-footer .button{min-height:44px}

  /* Tables / wide content stay contained to their own scroll area. */
  .table-wrap,.table-scroll,.line-table-wrap,.list-wrap{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  table{max-width:100%}

  /* Schedule page */
  .wrap>.hero,.wrap>.toolbar,.wrap>.calendar,.wrap>.side-section{grid-column:1/-1!important;grid-row:auto!important}
  .wrap>.side-section{position:static!important;display:grid!important;grid-template-columns:1fr!important}
  .summary-strip{width:100%!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important}
  .summary-stat{min-width:0!important;padding:8px!important}
  .legend{justify-content:flex-start!important;overflow-x:auto!important;flex-wrap:nowrap!important;width:100%!important;scrollbar-width:none!important;padding-bottom:2px}
  .legend::-webkit-scrollbar{display:none}
  .legend span{white-space:nowrap!important;flex:0 0 auto!important}
  .toolbar{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;padding:9px 10px!important}
  .month-control{min-width:0!important;flex:1 1 auto!important}
  .month-title{min-width:0!important;font-size:15px!important}
  .toolbar-actions{flex:0 0 auto!important}
  .toolbar-actions .sync-note,.toolbar-actions #syncBtn{display:none!important}
  .calendar{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  .calendar-head,.days-grid{min-width:700px!important}
  .calendar:after{content:"Swipe horizontally to view the full month";display:block;position:sticky;left:0;width:100vw;max-width:calc(100vw - 16px);padding:7px 10px;text-align:center;color:#6f8eac;font-size:9px;font-weight:750;background:#081726;border-top:1px solid rgba(136,184,232,.10)}
  .side-section .panel:first-child{min-height:0!important}

  /* Invoice list/dashboard */
  #dashboardView{padding-top:2px}
  #dashboardView>.stats:first-of-type{margin-top:0!important}
  .invoice-row{border-radius:15px!important}
  .search-row{gap:8px!important}

  /* Time clock / traffic / other utility pages */
  .top-actions{max-width:100%}
  .google-card{max-width:100%}
}

@media screen and (max-width: 480px){
  .wrap,.topbar{width:calc(100% - 12px)!important}
  .stats{gap:6px!important}
  .stat{padding:11px!important}
  .stat-label{font-size:9px!important}
  .stat-value{font-size:20px!important}
  .stat-note{display:none!important}
  .summary-strip{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .summary-stat b{font-size:15px!important}
  .summary-stat span{font-size:7px!important;letter-spacing:.04em!important}
  .modal-card{padding:14px!important;padding-bottom:max(14px,env(safe-area-inset-bottom))!important}
  .topbar .brand-copy span{display:none!important}
  .topbar .actions .btn,.topbar .actions a,.top-actions .btn,.top-actions a,.nav-tab{font-size:11px!important;padding:9px 11px!important}
}


/* v9.5.22 — intentional phone layouts */
.mobile-day-agenda{display:none}
.day-agenda-list{display:grid;gap:8px}.day-agenda-item{width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:12px;border:1px solid rgba(132,190,248,.12);border-radius:13px;background:rgba(5,16,29,.58);color:#eef7ff;text-align:left;cursor:pointer}.day-agenda-copy{min-width:0}.day-agenda-copy strong{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.day-agenda-copy small{display:block;margin-top:3px;color:#83a2bf;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.day-agenda-dot{width:9px;height:9px;border-radius:50%;background:#4da3ff}.day-agenda-item.misc .day-agenda-dot{background:#a98cff}.day-agenda-item.timeoff .day-agenda-dot{background:#ffad5b}.day-agenda-item.google .day-agenda-dot{background:#54d7a0}.day-agenda-arrow{font-size:22px;color:#6f96bc}

@media screen and (max-width:800px){
  /* Stop page-level mobile rules from forcing every action to full width. */
  .topbar .actions .btn,.topbar .actions a,.top-actions .btn,.top-actions a{width:auto!important}

  /* Invoicing: compact, balanced mobile app header. */
  .invoices-page .topbar{padding:10px!important;gap:8px!important;border-radius:18px!important}
  .invoices-page .brand{padding:1px 2px!important}
  .invoices-page .brand-copy span{display:none!important}
  .invoices-page .nav-tabs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;overflow:visible!important;padding:0!important}
  .invoices-page .nav-tab{width:100%!important;min-height:40px!important;padding:7px 4px!important;font-size:12px!important;text-align:center!important;border-radius:13px!important}
  .invoices-page .nav-count{display:inline!important;margin-left:4px!important;font-size:9px!important}
  .invoices-page .top-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;overflow:visible!important;padding:0!important}
  .invoices-page .top-actions .admin-link{display:none!important}
  .invoices-page .top-actions .btn{width:100%!important;min-height:42px!important;padding:9px 8px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;border-radius:13px!important;font-size:12px!important}
  .invoices-page .top-actions .btn:last-child{grid-column:1/-1!important;justify-self:stretch!important;max-width:none!important}
  .invoices-page #dashboardView>h1{display:none!important}
  .invoices-page #dashboardView{padding-top:2px!important}
  .invoices-page .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .invoices-page .stats .stat:nth-child(4){grid-column:auto!important;min-height:0!important}
  .invoices-page .stat{padding:12px!important;min-height:94px!important;display:flex!important;flex-direction:column!important;justify-content:flex-start!important}
  .invoices-page .stat-value{font-size:23px!important;line-height:1.05!important;margin-top:5px!important}
  .invoices-page .stats .stat:nth-child(4) .stat-value{font-size:clamp(18px,5.6vw,23px)!important}
  .invoices-page .stat-note{display:none!important}
  .invoices-page .period-inline{margin-top:auto!important;display:block!important}
  .invoices-page .period-select{min-height:36px!important;padding:7px 9px!important;font-size:12px!important;border-radius:10px!important}
  .invoices-page .search-panel{padding:10px!important}
  .invoices-page .search-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:7px!important}
  .invoices-page .search-row>.btn{width:auto!important;min-width:72px!important;padding:9px 11px!important}
  .invoices-page .search-input{min-height:44px!important;padding-top:10px!important;padding-bottom:10px!important}

  /* Schedule: compact navbar with centered two-column actions. */
  .schedule-page .topbar{padding:10px!important;gap:9px!important;border-radius:18px!important}
  .schedule-page .topbar .brand{padding:1px 2px!important;align-items:center!important}
  .schedule-page .brand-copy strong{font-size:14px!important}
  .schedule-page .brand-copy span{display:block!important;font-size:9px!important;line-height:1.25!important;white-space:normal!important}
  .schedule-page .topbar .actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;overflow:visible!important;padding:0!important}
  .schedule-page .topbar .actions .hide-mobile{display:flex!important}
  .schedule-page .topbar .actions .btn,.schedule-page .topbar .actions a{width:100%!important;min-height:41px!important;padding:8px 6px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;white-space:normal!important;border-radius:13px!important;font-size:11px!important;line-height:1.15!important}
  .schedule-page .hero{padding:12px!important;gap:9px!important;border-radius:17px!important}
  .schedule-page .hero .eyebrow{display:none!important}
  .schedule-page .hero h1{font-size:27px!important}
  .schedule-page .hero p{display:none!important}
  .schedule-page .hero-meta{gap:8px!important}
  .schedule-page .summary-strip{gap:6px!important}
  .schedule-page .summary-stat{padding:8px 7px!important;border-radius:12px!important;text-align:center!important}
  .schedule-page .summary-stat b{font-size:18px!important}
  .schedule-page .summary-stat span{font-size:7px!important}
  .schedule-page .legend{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;overflow:visible!important;padding:0!important}
  .schedule-page .legend span{justify-content:center!important;min-width:0!important;padding:6px 5px!important;font-size:8px!important}
  .schedule-page .toolbar{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:7px!important;padding:8px!important;border-radius:15px!important}
  .schedule-page .month-control{display:grid!important;grid-template-columns:38px minmax(0,1fr) 38px!important;gap:5px!important;width:100%!important;align-items:center!important}
  .schedule-page .month-control .btn.icon{width:38px!important;height:38px!important;min-height:38px!important}
  .schedule-page .month-title{min-width:0!important;font-size:15px!important;text-align:center!important;white-space:nowrap!important}
  .schedule-page .toolbar-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:5px!important}
  .schedule-page .toolbar-actions .btn{min-height:38px!important;padding:8px 10px!important}
  .schedule-page .calendar{overflow:hidden!important;border-radius:16px!important}
  .schedule-page .calendar-head,.schedule-page .days-grid{min-width:0!important;width:100%!important}
  .schedule-page .calendar:after{display:none!important;content:none!important}
  .schedule-page .weekday{font-size:0!important;text-align:center!important;padding:7px 1px!important;letter-spacing:0!important}
  .schedule-page .weekday:after{font-size:8px!important;font-weight:900!important;color:#7799ba!important}
  .schedule-page .weekday:nth-child(1):after{content:"S"}.schedule-page .weekday:nth-child(2):after{content:"M"}.schedule-page .weekday:nth-child(3):after{content:"T"}.schedule-page .weekday:nth-child(4):after{content:"W"}.schedule-page .weekday:nth-child(5):after{content:"T"}.schedule-page .weekday:nth-child(6):after{content:"F"}.schedule-page .weekday:nth-child(7):after{content:"S"}
  .schedule-page .days-grid{grid-auto-rows:72px!important}
  .schedule-page .day{height:72px!important;padding:4px!important;min-width:0!important}
  .schedule-page .day-head{min-height:20px!important;margin-bottom:1px!important;justify-content:center!important}
  .schedule-page .day-number{width:21px!important;height:21px!important;font-size:9px!important;border-radius:7px!important}
  .schedule-page .day-add{display:none!important}
  .schedule-page .events{display:flex!important;align-items:flex-end!important;justify-content:center!important;overflow:visible!important;min-height:0!important;flex:1!important}
  .schedule-page .events>.event,.schedule-page .events>.more-events{display:none!important}
  .schedule-page .mobile-day-agenda{display:flex!important;align-items:center!important;justify-content:center!important;width:22px!important;height:22px!important;min-height:22px!important;padding:0!important;border-radius:999px!important;border:1px solid rgba(78,163,255,.28)!important;background:rgba(77,163,255,.16)!important;color:#a9d5ff!important;font-size:9px!important;font-weight:900!important;cursor:pointer!important}
  .schedule-page .day.today .mobile-day-agenda{background:#2d92f5!important;color:white!important;border-color:#58aaff!important}
  .schedule-page .side-section{gap:9px!important;margin-top:9px!important}
  .schedule-page .side-section .panel{padding:12px!important;border-radius:16px!important}
  .schedule-page .panel-title-row{align-items:center!important}
  .schedule-page .upcoming-row{grid-template-columns:62px minmax(0,1fr)!important}
  .schedule-page .day-agenda-card{max-height:82dvh!important}
}

@media screen and (max-width:430px){
  .invoices-page .topbar,.schedule-page .topbar{width:calc(100% - 12px)!important}
  .invoices-page .brand-logo-wrap,.schedule-page .brand-logo-wrap{width:40px!important;height:36px!important;flex-basis:40px!important}
  .invoices-page .brand-logo,.schedule-page .brand-logo{max-width:40px!important;max-height:36px!important}
  .invoices-page .nav-tab{font-size:11px!important}
  .invoices-page .top-actions .btn{font-size:11px!important}
  .schedule-page .topbar .actions .btn,.schedule-page .topbar .actions a{font-size:10.5px!important}
  .schedule-page .hero h1{font-size:25px!important}
  .schedule-page .summary-stat{padding:7px 4px!important}
  .schedule-page .summary-stat span{font-size:6.5px!important}
  .schedule-page .month-title{font-size:14px!important}
  .schedule-page .days-grid{grid-auto-rows:66px!important}
  .schedule-page .day{height:66px!important}
}
