/* 615 HQ on a phone (App 1.1.0, Build Session 27; Gabe, 2026-11-30: "a phone app as well on the internal side to
   manage shows"). Loaded only for a phone: index.html links it with
   media="(max-width: 640px), (pointer: coarse) and (max-height: 520px)", the same test as isPhone() in js/mobile.js.
   A computer (and the installed Mac and Windows app) never reads these rules, so the desktop stays as it was.
   The tablet rules in app.css (820 px and under) still apply under these.

   What it does: a bottom bar (Home, Shows, Calendar, Crew, Contacts, Search) and a short top bar; room for the notch
   and the home bar; no side scrolling (the show tabs wrap, tables are stacked cards, the big grids have phone views
   drawn by the scripts); pop-ups as full-screen sheets with their buttons kept on screen; menus and the time picker
   as sheets from the bottom; touch-sized buttons and boxes (44 px), and 16 px text in boxes so the phone doesn't
   zoom in when you type. */

:root { --pad: 14px; --pn-h: 58px; }
html, body { overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
.app { height: 100vh; height: 100dvh; }
.main { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* ---------- top bar: menu, Back, where you are, live dot, feedback, settings ---------- */
.topbar { height: auto; min-height: 52px; padding: env(safe-area-inset-top) 6px 0; gap: 4px; }
.topbar .icon-btn, .topbar .feedback-btn { min-width: 44px; min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; }
.topbar .feedback-btn { border: 0; background: transparent; border-radius: 8px; }
.back-btn { min-height: 40px; }
.crumbs { font-size: 0; padding-left: 2px; }   /* only the last part ("NFL Draft"), not "Shows / " */
.crumbs b { font-size: 15px; }
.live-pill { padding: 0; width: 22px; height: 22px; justify-content: center; border-radius: 50%; }
.live-pill #liveText { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar .viewas { display: none; }
.menu { position: fixed; left: 8px; right: 8px; top: calc(env(safe-area-inset-top) + 54px); min-width: 0; max-height: calc(100dvh - 140px); overflow-y: auto; }
.menu button, .menu a { min-height: 44px; font-size: 15px; }

/* ---------- bottom bar ---------- */
.phone-nav { display: flex; flex: none; border-top: 1px solid var(--line); background: var(--side); padding: 0 4px env(safe-area-inset-bottom); }
.pn-item { flex: 1 1 0; min-width: 0; min-height: var(--pn-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-2); font-size: 11px; font-weight: 600; border-radius: 10px; text-decoration: none; }
.pn-item:hover { text-decoration: none; }
.pn-ic { font-size: 20px; line-height: 1; }
.pn-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pn-item.on { color: var(--accent); }
.pn-item.on .pn-ic { background: var(--accent-soft); border-radius: 12px; padding: 2px 14px; }
.toast { bottom: calc(var(--pn-h) + env(safe-area-inset-bottom) + 10px); }

/* ---------- the menu (sidebar) as a drawer, with room for the notch ---------- */
.sidebar { padding-top: calc(env(safe-area-inset-top) + 12px); padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
.sidebar .nav-item { min-height: 44px; font-size: 15px; }
.sidebar .icon-btn { min-width: 44px; min-height: 44px; }
.sidebar .viewas { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 4px 0; border-top: 1px solid var(--line-2); }
.sidebar .viewas > span { display: block; }
.sidebar .viewas select { max-width: none; min-height: 44px; }

/* ---------- touch sizes, and 16 px text in boxes (no zoom when typing) ---------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea { font-size: 16px !important; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]), select, .notes-box { min-height: 44px; }
input[type="date"], input[type="time"], input.time-input { min-height: 44px; }
.btn { min-height: 44px; padding: 8px 14px; font-size: 14px; }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: 13px; }
.icon-btn { min-width: 40px; min-height: 40px; }
.row-btn { min-width: 44px; min-height: 44px; }
.link-btn { min-height: 40px; min-width: 44px; font-size: 14px; }
.seg-btn { min-height: 44px; }
.pill-btn, button.pill { min-height: 34px; padding: 6px 12px; }
.kv-edit { min-height: 36px; }
input[type="checkbox"], input[type="radio"] { width: 26px !important; height: 26px !important; min-width: 26px; min-height: 26px; border-radius: 6px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::before { width: 14px; height: 14px; }
input[type="radio"]::before { width: 11px; height: 11px; }
.check, .checks label, .toggle { min-height: 40px; }
.checks { max-height: none; }
.key-chip, .dchip { min-height: 36px; }
.tab, .copy-btn { min-height: 40px; }
/* Links and small buttons in lists get room for a finger. */
.contact-link, a.person, .content td a:not(.btn):not(.pill) { display: inline-block; padding-top: 8px; padding-bottom: 8px; }
.crew-table .contact-link { max-width: 100%; }
.person { min-height: 36px; }
td.cell-edit { padding-top: 10px !important; padding-bottom: 10px !important; }
.vis-toggle, .chip-btn, button.chip { min-height: 36px; padding: 6px 12px; }
.switch { min-height: 40px; padding: 4px; }
.switch .sw-knob { width: 44px; height: 26px; border-radius: 13px; }
.switch .sw-knob::after { width: 22px; height: 22px; }
.switch.on .sw-knob::after { left: 20px; }
.fold-btn { width: 44px; height: 44px; }
.drag-handle { min-width: 44px; min-height: 44px; }
a.pill { min-height: 36px; }
.ph-head { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; }
.ph-head .ph-cam { width: 30px; height: 30px; }
.off-note { padding: 8px 0; }
summary { min-height: 36px; display: list-item; padding: 8px 0; }

/* ---------- pages ---------- */
.content { padding: 12px var(--pad) 28px; scroll-padding-bottom: 80px; }
.page-title { font-size: 28px; }
.page-sub { font-size: 13px; margin-bottom: 12px; }
.card { padding: 12px; }
.grid, .g2, .g3, .home-top, .home-grid { grid-template-columns: minmax(0, 1fr) !important; }
.home-top { display: grid; gap: 12px; }
.list-tools { gap: 8px; }
.list-tools > * { flex: 1 1 100%; min-width: 0; max-width: none; }
.list-tools > .toggle, .list-tools > .link-btn { flex: 0 1 auto; }
.list-tools select { flex: 1 1 calc(50% - 4px); }
pre, .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.content img, .modal img { max-width: 100%; height: auto; }
.content table, .modal table { max-width: 100%; }
.content, .modal-body { overflow-wrap: anywhere; }
.kv { grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); }

/* ---------- show page: compact header, tabs that wrap (no side scrolling) ---------- */
.show-head { gap: 10px; }
.show-title { font-size: 26px; }
.head-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 8px; }
.head-actions .btn:only-child { grid-column: 1 / -1; }
.tabs { flex-wrap: wrap; gap: 6px; border-bottom: 0; margin: 12px 0 14px; overflow: visible; }
.tab { border: 1px solid var(--line); border-radius: 20px; padding: 8px 13px; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; background: var(--panel); color: var(--ink-2); }
.tab.active { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.tab.tab-internal.active { background: var(--danger); border-color: var(--danger); color: var(--bg); }
.sched-aside .sa-list { max-height: 30vh; }

/* ---------- tables: stacked cards, one row per card, the first cell as its title ---------- */
.table-wrap { overflow-x: visible; border: 0; background: transparent; }
table.stack { border-collapse: separate; }
table.stack tbody { display: flex !important; flex-direction: column; gap: 8px; }
table.stack tr { border: 1px solid var(--line) !important; border-radius: 12px; background: var(--panel); padding: 8px 2px !important; }
table.stack tr:last-child { border-bottom: 1px solid var(--line) !important; }
table.stack td { padding: 4px 12px; min-height: 0; }
table.stack td:first-child { font-size: 15px; font-weight: 600; }
table.stack td:first-child[data-l]::before { display: none; }
table.stack td[data-l]::before { min-width: 92px; margin-right: 8px; }
table.stack td:empty { display: none !important; }
table.stack td.actions { display: flex !important; gap: 8px; flex-wrap: wrap; justify-content: flex-start; padding-top: 6px; }
table.stack tr.grp-row, table.stack tr.group-row { background: var(--soft); }
/* Wide tables the scripts couldn't stack (no labels): let cells wrap instead of pushing sideways. */
.content table:not(.stack) th, .content table:not(.stack) td, .modal table:not(.stack) th, .modal table:not(.stack) td { white-space: normal; overflow-wrap: anywhere; }

/* ---------- pop-ups: full-screen sheets ---------- */
.modal-wrap { padding: 0; align-items: stretch; overscroll-behavior: contain; }
.modal, .modal.wide { max-width: none; width: 100%; min-height: 100%; border-radius: 0; border: 0; display: flex; flex-direction: column; box-shadow: none; }
.modal-head { position: sticky; top: 0; z-index: 3; background: var(--panel); padding: calc(env(safe-area-inset-top) + 6px) 8px 6px 16px; gap: 8px; }
.modal-head h2 { font-size: 22px; min-width: 0; overflow-wrap: anywhere; }
.modal-head .icon-btn { min-width: 44px; min-height: 44px; font-size: 26px; flex: none; }
.modal-body { flex: 1; padding: 14px 16px calc(env(safe-area-inset-bottom) + 20px); }
.modal-actions { position: sticky; bottom: 0; z-index: 2; background: var(--panel); margin: 16px -16px calc(-20px - env(safe-area-inset-bottom)); padding: 10px 16px calc(env(safe-area-inset-bottom) + 10px); border-top: 1px solid var(--line); }
.modal-actions .btn { flex: 1 1 auto; }
.modal-actions .left { margin-right: 0; }
.form-row, .form-row.wrap3, .pub-cols { grid-template-columns: minmax(0, 1fr) !important; }
.pick-wrap, .bigcal-wrap { padding: 0; align-items: stretch; }
.pick-win, .bigcal { width: 100% !important; max-width: none !important; max-height: none !important; height: 100%; border-radius: 0; border: 0; overflow-y: auto;
  padding: calc(env(safe-area-inset-top) + 12px) 14px calc(env(safe-area-inset-bottom) + 16px); }
.bigcal-day { height: 46px; }
.bigcal-nav .btn, .bigcal-head .btn, .bigcal-head .icon-btn { min-height: 44px; min-width: 44px; }

/* ---------- menus (email, cell, grid days): a sheet from the bottom ---------- */
.pop-menu { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: auto !important; max-height: 70dvh; overflow-y: auto;
  border-radius: 16px 16px 0 0; padding: 8px 8px calc(env(safe-area-inset-bottom) + 10px); box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3); }
.pop-menu button { min-height: 48px; font-size: 16px; padding: 10px 14px; }
.pop-menu .pm-html { padding: 8px 14px; }
body.pm-open::after { content: ""; position: fixed; inset: 0; background: var(--scrim); z-index: 119; }

/* ---------- time picker: wheels in a sheet from the bottom, bigger rows ---------- */
.time-pick { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: auto !important; border-radius: 16px 16px 0 0;
  padding: 8px 12px calc(env(safe-area-inset-bottom) + 10px); box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3); }
.tw-wheels { height: 264px; }
.tw-btn { min-height: 44px; min-width: 88px; font-size: 16px; }

/* ---------- phone views drawn by the scripts (js/mobile.js and the views that ask isPhone()) ---------- */
.phone-only { display: block; }
.desk-only { display: none !important; }
.phone-search { display: flex; gap: 8px; margin: 4px 0 12px; }
.phone-search .search { flex: 1; }

/* Calendar month on a phone: dots, tap a day for its list. */
.cal .cell.cell-tap { min-height: 52px; border: 0; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: inherit; text-align: left; padding: 3px 3px 4px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.cal .cell.cell-tap:nth-child(7n) { border-right: 0; }
.cal .cell.cell-tap.other { background: var(--other-month); }
.cal .cell.cell-tap:disabled { cursor: default; opacity: 1; }
.cal.cal-small .cell.cell-tap { min-height: 44px; }
.cell-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.cell-dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.cell-dots b { font-size: 10px; color: var(--ink-3); line-height: 8px; }

/* Crew schedule grid on a phone: one day at a time. */
.gd-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; align-items: center; margin: 6px 0 10px; }
.gd-nav .btn { padding: 0; }
.gd-nav select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--field); font-weight: 600; }
.gd-sched { border: 1px solid var(--line); border-radius: 12px; background: var(--soft); padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.gd-sched div { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.gd-sched b { min-width: 0; }
.gd-group { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); border-left: 4px solid var(--dc); padding: 4px 8px; margin: 12px 0 6px; }
.gd-list { display: flex; flex-direction: column; gap: 6px; }
.gd-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--dc); border-radius: 10px; background: var(--panel); color: var(--ink); padding: 8px 12px; min-height: 52px; font: inherit; cursor: pointer; }
.gd-line .gd-who { font-weight: 600; }
.gd-line .gd-pos { font-size: 12px; color: var(--ink-3); grid-column: 1; }
.gd-line .gd-what { grid-column: 2; grid-row: 1 / span 2; font-size: 13px; font-weight: 600; text-align: right; max-width: 42vw; }
.gd-line.k-off { background: var(--soft); }
.gd-line.k-off .gd-what { color: var(--ink-3); }
.gd-line.k-none { opacity: 0.75; }
.gd-line .gd-call { font-size: 12px; color: var(--accent-ink); grid-column: 1 / -1; }

/* Crew Availability on a phone: a week at a time. */
.avail-wrap { overflow-x: visible; }
.avail { table-layout: fixed; width: 100%; }
.avail th.name, .avail td.name { width: 34%; min-width: 0 !important; max-width: none !important; }
.avail th.d { padding: 4px 0; font-size: 11px; text-align: center; }
.avail td.c { padding: 1px 0; }
.avail .blk { font-size: 10px; }
.cal-nav .btn { min-width: 44px; }

/* Home: Needs attention rows keep Dismiss under the item, not squeezed beside it. */
.attention { max-height: none; }
.att-row { flex-direction: column; gap: 0; }
.att-row .link-row { border-bottom-left-radius: 0; border-bottom-right-radius: 0; flex-wrap: wrap; }
.att-row .att-x { min-height: 40px; border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; text-align: right; padding: 0 12px; }

/* Card and section headings with buttons beside them wrap under the title instead of squeezing it. */
.card h3, .sec-label { flex-wrap: wrap; }
.card h3 > .muted, .card h3 > .small { flex-basis: 100%; order: 3; }
.sec-label .h3-links, .card h3 .h3-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-sel { white-space: nowrap; }
.cal-title { font-size: 18px !important; }
.order-row { flex-wrap: wrap; }
.order-row .ds-name { flex: 1 1 60%; min-width: 0; }
.kv a { display: inline-block; padding: 8px 0; }
.link-btn { display: inline-flex; align-items: center; justify-content: center; }
.link-btn { padding: 0 8px; }

/* App 1.3.0: the update bar sits under the notch on a phone. */
.update-bar { padding-top: max(6px, env(safe-area-inset-top)); }
.update-bar .ub-sub { display: none; }
.update-bar .btn { min-height: 36px; }
