/* iPhone & iPad layer (Tyler, 2026-11-04: "make the website iPad and iPhone friendly").
   Loaded after each page's own styles. Desktop (mouse, wide screen) is unchanged except the two harmless lines at the top. */

html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
.twrap{overscroll-behavior-x:contain}
.twrap table{overflow:visible}           /* table's overflow:hidden stopped the pinned first column from sticking; the .twrap box already rounds the corners */   /* swiping a wide table sideways doesn't trigger Safari's back/forward */

/* ---------- Touch screens (iPhone, iPad): finger-sized targets, no zoom-on-focus, header scrolls away ---------- */
@media (pointer:coarse){
  header.top{position:static}           /* the tall sticky header ate a quarter of an iPad screen */
  /* iOS Safari zooms the whole page when a field under 16px gets focus */
  input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important}
  nav.tabs a{padding:10px 14px}
  .period button,.period select{min-height:42px}
  .period button{min-width:42px}
  .seg button{min-height:40px}
  .gmbar button{padding:8px 13px}
  .btn{min-height:40px}
  .btn.small{min-height:34px}
  .user a,.user button{padding:8px 2px}
  .tabs button{padding:10px 13px}
  .ctl select,.ctl input:not([type=checkbox]):not([type=radio]),.ctl button{min-height:40px}
  input[type=checkbox],input[type=radio]{width:20px;height:20px;vertical-align:middle}
  .crumb a{display:inline-block;padding:8px 0}
  th{cursor:default}
  .rows button.del{min-width:40px;min-height:40px}
  /* wide tables scroll sideways inside their box; keep the first column (salon / stylist name) pinned while they do */
  .twrap table:not(.rows):not(.items) th:first-child,.twrap table:not(.rows):not(.items) td:first-child{position:sticky;left:0;z-index:1;background:var(--surface);box-shadow:1px 0 0 var(--grid)}
  .twrap table:not(.rows):not(.items) th:first-child{z-index:2;background:var(--bg)}
  .twrap table tr.own td:first-child{background:color-mix(in srgb,var(--s1) 9%,var(--surface))}
  .twrap table tr.sec td:first-child{background:var(--bg)}
}

/* ---------- iPad: GM filter as one row you swipe sideways (it wrapped to two rows) ---------- */
@media (pointer:coarse) and (max-width:1100px){
  .gmbar{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;max-width:100%}
  .gmbar::-webkit-scrollbar{display:none}
  .gmbar button{white-space:nowrap;flex:none}
}

/* ---------- Phones ---------- */
@media (max-width:700px){
  /* header: logo + sign-out on row 1, tabs on row 2 (swipe sideways), period picker on row 3 */
  .topbar{padding:8px 12px;gap:8px 10px}
  .brand img{height:40px}
  nav.tabs{order:5;flex:1 0 100%;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent)}
  nav.tabs::-webkit-scrollbar{display:none}
  nav.tabs a{white-space:nowrap;flex:none}
  /* period picker: Month / Week / Year across the full width, then ‹ [period] › on its own row so the period name isn't cut to "Nov 2…" (2026-11-21) */
  .period{order:6;flex:1 0 100%;flex-wrap:wrap;gap:6px;min-width:0;max-width:100%}
  .period select{flex:1;min-width:0}
  header.top .seg{flex-wrap:nowrap;flex:1 0 100%}
  header.top .seg button{flex:1}
  .user{flex-wrap:wrap;justify-content:flex-end}
  .crumb{font-size:13px;flex:1;min-width:0}
  .topbar .crumb{order:5;flex:1 0 100%}   /* sub-pages: "People › Leadership development" on its own row instead of squeezed between logo and sign-out */
  .subbar{padding:0 12px 8px;gap:6px 10px}
  /* GM filter: one row you swipe sideways instead of six stacked rows */
  .gmbar{flex:1 0 100%;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
  .gmbar::-webkit-scrollbar{display:none}
  .gmbar button{white-space:nowrap;flex:none}
  .status{font-size:11px;line-height:1.4}
  /* page body */
  main{padding:12px 12px 48px}
  h1{font-size:20px}
  .tile .v{font-size:20px}
  .cards,.homegrid,.hubgrid,.cols{grid-template-columns:minmax(0,1fr)}
  .ctl select,.ctl input:not([type=checkbox]):not([type=radio]){max-width:100%;min-width:0}
  .ctl label:has(select){display:flex;align-items:center;gap:6px;max-width:100%;min-width:0} .ctl label select{flex:1}
  .card,.tile{padding:12px}
  .kv{grid-template-columns:minmax(90px,38%) 1fr}
  .hits{min-width:0;width:calc(100vw - 24px);max-width:calc(100vw - 24px)}
  .drawer{padding:14px 14px 40px}
  .login{margin:6vh 12px}
}
