/* BCC Service: phones and tablets. Loaded after app.css. */

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; color: var(--ink); padding: 10px 14px; border-radius: 10px; font-weight: 800; }
.skip:focus { left: 8px; }
.side-top { display: contents; }
.menu-btn { display: none; }
img, svg, video { max-width: 100%; }
input, select, textarea { font-size: 16px; } /* 16px stops phones zooming in when a field is tapped */
.btn { min-height: 44px; }                    /* comfortable touch target */
.btn.small-btn { min-height: 34px; font-size: 13px; }
:focus-visible { outline: 3px solid var(--brand-hi); outline-offset: 2px; }

/* Tables that turn into cards on small screens. Each td carries data-label. */
@media (max-width: 720px) {
  table.list.stack-sm, table.list.stack-sm tbody, table.list.stack-sm tr, table.list.stack-sm td { display: block; width: 100%; }
  table.list.stack-sm thead { display: none; }
  table.list.stack-sm tr { background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; margin-bottom: 10px; }
  table.list.stack-sm td { border: 0; padding: 6px 0; white-space: normal !important; display: flex; gap: 12px; align-items: center; justify-content: space-between; text-align: right; min-width: 0 !important; }
  table.list.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-align: left; flex: 0 0 auto; }
  table.list.stack-sm td:not([data-label])::before { display: none; }
  table.list.stack-sm td.full { display: block; text-align: left; }
  table.list.stack-sm td.full::before { display: block; margin-bottom: 6px; }
  table.list.stack-sm td input:not([type=checkbox]):not([type=radio]):not([type=color]), table.list.stack-sm td select { min-width: 0 !important; width: 100%; }
  table.list.stack-sm td.full input, table.list.stack-sm td.full select { width: 100%; }
  table.list.stack-sm td input[type=checkbox], table.list.stack-sm td input[type=radio] { width: 22px; height: 22px; }
  table.list.stack-sm td.actions { justify-content: flex-end; flex-wrap: wrap; text-align: right; }
  table.list.stack-sm td.actions form.inline { flex-wrap: wrap; justify-content: flex-end; }
  .table-wrap:has(> table.stack-sm) { overflow: visible; }
  table.list.stack-sm .due-cell { flex-wrap: wrap; justify-content: flex-end; }
  table.list.stack-sm .due-cell select, table.list.stack-sm .due-cell input { width: auto !important; flex: 1 1 100px; }
  table.list.stack-sm tr.off { opacity: .6; }
  table.list.stack-sm .person { justify-content: flex-start; text-align: left; }
}

/* Tablet portrait and below: the menu moves into a top bar with a Menu button */
@media (max-width: 900px) {
  body.admin { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; height: auto; flex-direction: column; gap: 0; padding: 0; background: rgba(20,21,46,.92); border-right: 0; border-bottom: 1px solid var(--line); z-index: 30; }
  .side-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; }
  .brand { flex-direction: row; align-items: center; padding: 0; gap: 10px; }
  .brand img { width: 120px; }
  .brand span { display: none; }
  .menu-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-2); color: var(--text); font: 700 15px var(--head); cursor: pointer; }
  .menu-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .side nav, .side .who { display: none; }
  .nav-open .side nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; padding: 4px 12px 12px; max-height: calc(100dvh - 150px); overflow: auto; animation: rise .25s both; }
  .nav-open .side nav a { padding: 12px; background: rgba(255,255,255,.04); }
  .nav-open .side .who { display: flex; margin: 0 12px 12px; }
  .main { padding: 18px 16px 48px; }
  .live { grid-template-columns: minmax(0, 1fr); }
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .card-head { align-items: flex-start; }
  .card-head > .row, .card-head > form.row { width: 100%; }
}

/* Phones */
@media (max-width: 600px) {
  :root { --gap: 14px; --gap-in: 12px; }
  .card { padding: 16px; border-radius: 16px; }
  .top h1 { font-size: 24px; }
  .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px; }
  .row > .field { flex: 1 1 100%; }
  .row > .btn { flex: 1 1 auto; }
  .card-head h2 small { display: block; margin: 4px 0 0; }
  .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs a { white-space: nowrap; flex: 0 0 auto; }
  .status-row .pill { flex: 1 1 100%; justify-content: center; }
  .presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ctrls .btn.big { padding: 16px 10px; font-size: 16px; }
  .mini-dial { max-width: 240px; }
  .qr-box { flex-basis: 100%; width: 100%; max-width: 280px; margin: 0 auto; }
  .pager { flex-wrap: wrap; justify-content: center; }
  .bars { gap: 6px; height: 150px; }
  .bars .b small { font-size: 10px; }
  .login .card { padding: 26px 18px; }
  .flash { font-size: 15px; }
}

/* Screens (pulpit, kids, green room) on phones */
@media (max-width: 600px) {
  .s-top { padding: max(10px, env(safe-area-inset-top)) 14px 6px; }
  .s-logo { height: 26px; }
  .s-clock { font-size: 18px; }
  .dial { width: min(88vw, 70vh); }
  .sheet-card { border-radius: 22px 22px 16px 16px; padding: 22px 18px; }
  .sheet-text { font-size: clamp(26px, 8vw, 40px); }
  .bigbtn { padding: 14px 40px; font-size: 22px; }
  .room { padding: 12px 18px 30px; }
}
/* Phones on their side */
@media (orientation: landscape) and (max-height: 500px) {
  .dial { width: min(62vh, 55vw); }
  .dial-wrap { padding-bottom: 8px; }
  .s-top { padding-top: 6px; }
  .sheet-card { padding: 12px 18px; }
  .sheet-text { margin: 6px 0 10px; font-size: clamp(22px, 5vh, 34px); }
  .mic-anim { display: none !important; }
}

/* Tech desk on tablets in portrait and on phones */
@media (max-width: 1000px) {
  .d-top { gap: 10px; }
  .d-pills { order: 5; width: 100%; margin: 0; }
  .d-pills .pill { flex: 1 1 auto; justify-content: center; }
  .d-main { padding: 0 10px max(10px, env(safe-area-inset-bottom)); }
  .d-dialrow, .mode-checks .d-dialrow { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .d-dialrow .mini-dial { max-width: 220px; }
  .d-ctrls { width: 100%; }
}
@media (max-width: 600px) {
  .d-top .s-logo { height: 24px; }
  .d-svc { flex: 1; }
  .d-mode { order: 6; width: 100%; }
  .d-mode button { flex: 1; min-height: 44px; }
  .d-top .s-right { margin-left: auto; }
  .pos-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checks.big li { padding: 10px; gap: 10px; }
  .checks.big .ck-title { font-size: 16px; }
  .d-foot { position: sticky; bottom: 0; background: var(--ink-2); margin: 0 -16px -16px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-radius: 0 0 var(--radius) var(--radius); z-index: 2; }
  .d-foot .btn { flex: 1 1 40%; padding: 10px; font-size: 15px; }
  .d-foot .grow { display: none; }
  .d-foot #readybtn { flex-basis: 100%; }
  .d-modal { padding: 0; align-items: end; }
  .d-modal-card { border-radius: 22px 22px 0 0; max-height: 92dvh; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); }
  .pinpad { max-width: none; }
  .d-start { flex-wrap: wrap; }
  .d-start select, .d-start .btn { flex: 1 1 100%; }
  .d-msgs .row { flex-wrap: wrap; }
  .d-msgs .row input { flex-basis: 100%; }
}

/* Anything wider than the screen should scroll inside its box, never the page */
.main > *, .card, .d-card { max-width: 100%; }

code { overflow-wrap: anywhere; }
.secret { overflow-wrap: anywhere; }

.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.codes code { padding: 10px; border-radius: 10px; background: rgba(0,0,0,.3); text-align: center; font-size: 16px; letter-spacing: .06em; }
