/* Phone layout for the staff display page: one location at a time, big text, search results list. */
.m-only { display: none; }
.m-full-btn { display: none; }

@media (max-width: 768px) {
  html, body { height: auto !important; max-height: none !important; overflow: visible !important; }
  body { display: block; }

  .top-header { display: flex; height: auto; flex-wrap: wrap; gap: 6px; padding: 8px 10px; position: sticky; top: 0; z-index: 30; }
  .header-center { width: 100%; }
  .header-left { width: 100%; justify-content: space-between; }
  .site-title { font-size: 15px; }
  .date-badge { font-size: 13px; flex: 1; justify-content: center; }
  .header-actions { width: 100%; flex-wrap: wrap; gap: 6px; }
  .header-actions .btn-primary { display: none; }
  .m-full-btn { display: inline-flex; }
  .header-actions .btn { padding: 7px 10px; font-size: 13px; }
  /* search = the most visible control: big pill, stays pinned at the top while scrolling */
  .title-banner { position: sticky; top: 0; z-index: 40; display: block; min-height: 0; padding: 4px 10px 6px; }
  .top-header { top: var(--banner-h, 0px); }
  .title-banner .name-search { position: static; transform: none; margin: 4px 0 0; width: 100%; height: 40px; padding: 0 13px; }
  .name-search { order: -1; flex: 1 1 100%; }
  .title-banner .name-search input { font-size: 16px; width: 100%; }           /* 16px+ stops iOS zooming on focus */
  .title-banner .name-search-icon { font-size: 16px; }
  .title-banner .name-search-count { font-size: 12px; }

  .m-only { display: block; width: 100%; }
  #m-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  #m-tabs::-webkit-scrollbar { display: none; }
  .m-chip { flex: 0 0 auto; border: 0; border-radius: 16px; padding: 7px 13px; font-size: 13px; font-weight: 700;
            background: rgba(255,255,255,.14); color: #fff; position: relative; }
  .m-chip.active { background: #fff; color: #0f172a; }
  .m-chip.has-hit::after { content: ""; position: absolute; top: 3px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #fb923c; }

  #m-results { background: #fff7ed; border-bottom: 2px solid #fb923c; padding: 8px 10px; max-height: 38vh; overflow-y: auto; }
  #m-results[hidden] { display: none; }
  .m-res-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #7c2d12; margin-bottom: 6px; }
  .m-res-head button { border: 0; background: #fed7aa; border-radius: 12px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: #7c2d12; }
  .m-res-item { display: block; width: 100%; text-align: left; border: 1px solid #fdba74; background: #fff; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 15px; color: #0f172a; }
  .m-res-item b { display: block; font-size: 12px; color: #9a3412; text-transform: uppercase; letter-spacing: .4px; }
  .m-res-empty { font-size: 14px; color: #7c2d12; }

  .sheet-container { height: auto; max-height: none; overflow: visible; padding: 8px; display: block; }
  .board-grid { display: block; height: auto; }
  .board-column { display: block; overflow: visible; border: 0; box-shadow: none; background: transparent; margin: 0; }
  body.m-mode .m-hidden { display: none !important; }

  /* Full View: the four board columns side by side as on the wall display, shrunk to the screen width (pinch to zoom) */
  body.m-full #m-tabs { display: none; }
  body.m-full .sheet-container { overflow-x: auto; padding: 6px; }
  body.m-full .board-grid { display: grid; grid-template-columns: repeat(4, 280px); gap: 8px; width: 1160px; zoom: var(--m-zoom, .33); align-items: start; }
  body.m-full .board-column { display: block; }
  body.m-full .col-header, body.m-full .sub-header { font-size: 15px; padding: 6px; }
  body.m-full .roster-table td { font-size: 13px; padding: 5px 6px; }

  .col-header, .sub-header { font-size: 17px; padding: 10px; background: #fff; border: 1.5px solid #000; border-radius: 6px 6px 0 0; }
  .roster-table { margin-bottom: 8px; background: #fff; table-layout: fixed; }
  .roster-table th { height: auto; font-size: 13px; padding: 6px 6px; }
  .roster-table td { height: auto; min-height: 40px; font-size: 15px; padding: 9px 8px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
  .roster-table td.cell-room { font-size: 14px; white-space: normal; }
  .roster-table td.cell-staff { white-space: normal; text-overflow: clip; }
  td.search-hit { font-size: 16px; }
  td.search-flash { animation: m-flash 1.3s ease-out 1; }
  @keyframes m-flash { 0%, 60% { box-shadow: 0 0 0 5px rgba(251,146,60,.8); } 100% { box-shadow: 0 0 0 0 rgba(251,146,60,0); } }
}

@media print { body.m-mode .m-hidden { display: block !important; } }

/* ---- Phone toolbar spacing and date navigation (owner, 2026-11-10): bigger tap targets, evenly spaced ---- */
@media (max-width: 768px) {
  .top-header { gap: 8px; padding: 8px 12px 10px; }
  .header-left { justify-content: center; }
  .header-center { gap: 8px; }
  .header-center .btn { height: 42px; min-width: 46px; }
  .header-center .nav-arrow { width: 50px; font-size: 26px; }
  .header-date { flex: 1; min-width: 0; font-size: 16px; }
  .header-actions { gap: 8px; }
  .header-actions .btn, .header-actions .mm-btn { height: 40px; }
}
@media (max-width: 768px) { .header-center .header-date { font-size: 16px; } }
