/* Responsive layout. Phone <= 600px, tablet 601-1024px (or a touch screen up to 1366px), desktop above.
   html gets device-phone / device-tablet / device-desktop and "touch" from the inline script in <head>. */
img, video, iframe, canvas, svg { max-width: 100%; }
.progress-scroll, .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
html.touch button, html.touch .btn, html.touch .folders button { min-height: 44px; }
html.touch select, html.touch input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; }
html.touch input[type="checkbox"], html.touch input[type="radio"] { width: 1.2rem; height: 1.2rem; }

/* Tablet */
@media (min-width: 601px) and (max-width: 1024px) {
  .wrap, body.work .wrap { width: calc(100% - 24px); margin: 12px auto 28px; }
  .folders { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .folders::-webkit-scrollbar { display: none; }
  .folders button { flex: 1 0 auto; min-height: 44px; padding: 10px 14px; }
  .mascot-pick { grid-template-columns: repeat(4, 1fr); }
  table { display: block; overflow-x: auto; }
}

/* Phone */
@media (max-width: 600px) {
  html, body { max-width: 100%; }
  .wrap, body.work .wrap { width: calc(100% - 12px); margin: 6px auto 20px; }
  .sheet, body.work .sheet { padding: 10px 10px 16px; }
  .brand-logo, body.work .brand-logo { height: auto; max-height: 40px; max-width: 62vw; }
  .sheet > header .brand-logo, .door .brand-logo { max-height: 56px; }
  header.top { flex-wrap: wrap; gap: 6px; padding-bottom: 8px; }
  header.top .who { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; gap: 6px; font-size: 0.875rem; }
  header.top .who .muted { white-space: normal; }
  .mark, .domain { max-width: 100%; overflow-wrap: anywhere; }
  h1 { font-size: 1.5rem; overflow-wrap: anywhere; }
  h2 { font-size: 1.15rem; }
  /* Tabs: one scrollable strip with big tap targets */
  .folders { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding: 0 2px; gap: 4px; scrollbar-width: none; }
  .folders::-webkit-scrollbar { display: none; }
  .folders button { flex: 0 0 auto; min-height: 44px; padding: 10px 14px; scroll-snap-align: start; }
  /* Forms: one column, 16px inputs (no iOS zoom), full-width buttons */
  .grid, .form-row2, .apply .grid { grid-template-columns: 1fr !important; }
  input, select, textarea { font-size: max(1rem, 16px) !important; }
  form button[type="submit"], form button.primary, .apply button.primary { width: 100%; min-height: 48px; }
  .form-section { padding: 0.3rem 0.7rem 0.7rem; }
  label.jt-card { width: 100%; box-sizing: border-box; }
  .rowline, .staff-line, .seat-row, .account-head { flex-wrap: wrap; }
  .staff-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .staff-actions button { flex: 1 1 auto; }
  .mascot-pick { grid-template-columns: repeat(3, 1fr); }
  .mascot-pick img { width: 56px; height: 56px; }
  .pay-range { flex-wrap: wrap; }
  /* Wide content scrolls inside its own box */
  table { display: block; overflow-x: auto; max-width: 100%; }
  pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .cal-wrap { gap: 12px; }
  .month-cal { width: 100%; }
  /* Dialogs full screen */
  .plan-pop { padding: 0; align-items: stretch; }
  .plan-sheet { width: 100%; min-height: 100%; border-radius: 0; padding: 12px; box-sizing: border-box; }
  .vc-toasts { left: 8px; right: 8px; }
  .vc-toast { max-width: none; }
  p, li, span, strong, a { overflow-wrap: anywhere; }
}
