/* Mobile ergonomics shared by the public site, account and manager pages. */
html {-webkit-text-size-adjust:100%; text-size-adjust:100%;}
@media (max-width:800px) {
  /* Four destinations remain visible: no hidden settings off the right edge. */
  .app-shell>.sidebar {width:100%; min-width:0; height:auto; position:static; padding:16px max(12px,env(safe-area-inset-right)) 12px max(12px,env(safe-area-inset-left));}
  .app-shell>.sidebar nav {display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; overflow:visible; margin-top:14px;}
  .app-shell>.sidebar .nav-item {position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; width:100%; min-width:0; min-height:70px; gap:6px; padding:8px 3px; border-radius:10px; white-space:normal; text-align:center; font-size:12px; line-height:1.25;}
  .app-shell>.sidebar .nav-item .icon {width:21px; height:21px;}
  .app-shell>.sidebar .request-badge {position:absolute; top:4px; right:5px; min-width:18px; height:18px; margin:0; padding:0 4px; font-size:10px; box-shadow:0 0 0 2px #182433;}
  .app-shell>.sidebar .sidebar-bottom,.app-shell>.sidebar .workspace-label,.app-shell>.sidebar .nav-caption {display:none;}
  #page-settings .settings-tabs {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; overflow:visible; border:0; margin-bottom:24px;}
  #page-settings .settings-tabs button {min-width:0; min-height:54px; justify-content:center; padding:10px; white-space:normal; text-align:center; line-height:1.4; border:1px solid #dce4e0; border-radius:10px; background:#fff; font-size:13px;}
  #page-settings .settings-tabs button[aria-selected=true] {background:#e6f1eb; border-color:#6a9d83; color:#173e35; box-shadow:inset 0 0 0 1px #6a9d83;}
  #page-settings .settings-tabs button svg {flex-shrink:0;}
  /* 16px prevents focus zoom on iOS. Do not resize radios/checkboxes/sliders. */
  body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),
  body select,body textarea {font-size:16px!important; min-width:0; max-width:100%;}
  input[type=date],input[type=time],input[type=datetime-local] {display:block; width:100%; min-height:46px; box-sizing:border-box;}
  input::-webkit-date-and-time-value {text-align:left; min-height:1.4em;}
  .tabler-dashboard .btn,.tabler-dashboard .btn-sm,.feed-view-tab,.af-contact-link,
  .activity-feed-card .af-task-status select,.activity-feed-card .af-note-toggle,
  .contact-route-switch {min-height:44px;}
  .activity-feed-card .af-task-status {min-width:0; max-width:100%; flex-wrap:wrap;}
  .activity-feed-card .af-task-status select {flex:1;}
  .activity-feed-card .af-task-footer {flex-wrap:wrap;}
  .activity-feed-card .af-task-footer>* {min-width:0;}
  .tabler-dashboard #dashboard-period {max-width:100%; min-height:44px;}
  .tabler-dashboard .business-header {flex-wrap:wrap; gap:12px;}
  .app-shell .topbar {padding-left:max(16px,env(safe-area-inset-left)); padding-right:max(16px,env(safe-area-inset-right));}
  .main-shell main {padding-left:max(16px,env(safe-area-inset-left)); padding-right:max(16px,env(safe-area-inset-right));}
  .account-dialog {max-height:calc(100dvh - 32px); overflow-y:auto;}
  dialog {overscroll-behavior:contain;}
  #call-dialog.contact-dialog {height:100dvh; max-height:100dvh;}
  #call-dialog .contact-savebar {padding-bottom:max(12px,env(safe-area-inset-bottom));}
  .auth-content {padding-left:max(22px,env(safe-area-inset-left)); padding-right:max(22px,env(safe-area-inset-right));}
}
@media (max-width:380px) {
  .app-shell>.sidebar .nav-item {font-size:11px;}
  .activity-feed-card .af-task-status {width:100%;}
  .activity-feed-card .feed-view-tab {font-size:12px;}
}

@media(max-width:800px){
  .activity-feed-card .af-journal-location,.activity-feed-card .af-journal-phone,.activity-feed-card .af-read-more {min-height:44px; display:inline-flex; align-items:center;}
  .activity-feed-card .af-mini-action {min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; opacity:1;}
  .activity-feed-card .af-task-card .af-task-footer .af-actions {grid-template-columns:minmax(0,1fr) 44px 44px;}
  .activity-feed-card .af-task-card .af-task-footer .af-icon-button {width:44px; min-height:44px;}
  #call-dialog .contact-route-switch {min-height:44px;}
}
@media(max-width:420px){
  .business-period-control {width:100%;}
  .tabler-dashboard .business-card #dashboard-period {width:100%;}
}

/* Keep the anti-bot field out of the interface without inline styles (CSP). */
.signup-honeypot {position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); clip-path:inset(50%); white-space:nowrap; border:0; pointer-events:none;}

/* Keep primary navigation reachable while the artisan scrolls on their phone. */
@media(max-width:800px){
 .app-shell>.sidebar{position:sticky;top:0;z-index:45;padding-top:max(10px,env(safe-area-inset-top));padding-bottom:8px;box-shadow:0 3px 12px #14233318}
 .app-shell>.sidebar .brand{font-size:24px;line-height:30px}
 .app-shell>.sidebar .brand img{width:27px;height:27px}
 .app-shell>.sidebar nav{margin-top:8px}
 .app-shell>.sidebar .nav-item{min-height:60px;padding:6px 3px;gap:4px}
 .app-shell .main-shell{overflow:visible}
 .app-shell main :is(button,a,input,select,textarea,[tabindex]){scroll-margin-top:150px}
}

/* Account actions share the mobile brand row instead of taking a second header. */
.sidebar-brand-row{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}
.account-tools{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-height:44px;margin:12px 30px 0}
.account-menu-trigger{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-width:44px;min-height:44px;padding:10px 13px;border:1px solid #e2e7eb;border-radius:11px;background:white;color:#53616e;font-size:12px;font-weight:550;cursor:pointer}
.account-menu-trigger svg{width:20px;height:20px;flex:none}
.account-dialog .manager-switch{display:flex;justify-content:space-between;gap:24px;width:100%;margin:0 0 14px}
@media(max-width:800px){
 .sidebar-brand-row .account-tools{margin:0;gap:6px;flex:none}
 .sidebar-brand-row .account-menu-label{display:none}
 .sidebar-brand-row .account-menu-trigger,.sidebar-brand-row .urgent-notification-button{width:44px;height:44px;min-width:44px;padding:10px;background:#ffffff0a;border:1px solid #ffffff14;color:#dbe3ed;border-radius:11px}
 .sidebar-brand-row .urgent-notification-count{box-shadow:0 0 0 2px #182433}
 .sidebar-brand-row .account-menu-trigger:focus-visible,.sidebar-brand-row .urgent-notification-button:focus-visible{outline:3px solid #9bc2e7;outline-offset:2px}
 .app-shell>.sidebar .brand{font-size:23px;letter-spacing:-1px;gap:7px}
}
@media(max-width:350px){.app-shell>.sidebar .brand{font-size:21px;gap:5px}.app-shell>.sidebar .brand img{width:25px;height:25px}.sidebar-brand-row{gap:5px}.sidebar-brand-row .account-tools{gap:4px}}
