:root{
  /* canyonreo.com brand palette (pulled from the live site 2026-08-11):
     brown #ab7149 (topbar/detail buttons) · deep canyon green #40585b (nav) ·
     teal #82b0ac (links/CTAs; #5d8d89 deepened for small text) · sage #91a267 */
  --ink:#242621; --paper:#f2f3f5; --card:#ffffff; --line:#dcdfe2;
  --river:#ab7149; --river2:#5d8d89; --teal:#82b0ac; --pine:#40585b;
  --sun:#91a267; --amber:#f4ecd4; --amberln:#d9cba0;
  --green:#e2ecdb; --greenln:#a8c294; --yellow:#f6efd3; --red:#eed3cd;
  --muted:#6f7377;
}
*{box-sizing:border-box}
body{margin:0;font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  color:var(--ink);background:var(--paper)}
body{display:flex;flex-direction:column;height:100vh}
header{display:flex;align-items:center;gap:26px;flex:0 0 auto;
  padding:10px 18px;background:var(--river);color:#fff}
header .head-right{margin-left:auto}

/* sub-header shown to staff while inside a client's menu */
.client-bar{flex:0 0 auto;display:flex;align-items:center;gap:12px;
  background:#ece4db;border-bottom:1px solid var(--line);
  padding:7px 18px;font-size:13px;color:var(--ink)}
.client-bar b{color:var(--river)}
.cb-owner{color:var(--muted);font-size:12px}
.cb-back{margin-left:auto;border:1px solid var(--river2);border-radius:14px;background:none;
  color:var(--river2);font-weight:600;font-size:12px;padding:4px 12px}
.cb-back:hover{background:var(--river2);color:#fff}
body[data-view="admin"] .client-bar{display:none}
/* header identity: product name on top, whose trip this is right below */
.brand{display:flex;align-items:center;gap:14px;letter-spacing:.3px}
.brand-logo{height:34px;width:auto;display:block}
.brand-txt{display:flex;flex-direction:column;line-height:1.25;padding-left:14px;
  border-left:1px solid rgba(255,255,255,.35)}
.brand-line1{font-size:15px;font-weight:700}
.head-trip{border:none;background:none;color:#fff;opacity:.85;font-size:12px;font-weight:600;
  text-align:left;padding:0;letter-spacing:.4px}
button.head-trip.editable{cursor:pointer}
button.head-trip.editable:hover{opacity:1;text-decoration:underline}
.status{font-size:12px;opacity:.9}
.layout{display:flex;align-items:flex-start;gap:0;flex:1;min-height:0}

/* controls rail — navigation only */
.controls{width:250px;flex:0 0 250px;padding:16px;height:100%;overflow:hidden auto;
  background:var(--card);border-right:1px solid var(--line);position:relative;
  transition:flex-basis .22s ease, width .22s ease, padding .22s ease}
/* collapsed = icon rail: the width eases while the two states crossfade */
body.rail-collapsed .controls{width:54px;flex-basis:54px;padding:12px 8px}
.rail-full{width:218px;opacity:1;visibility:visible;transition:opacity .14s ease}
body.rail-collapsed .rail-full{opacity:0;visibility:hidden;position:absolute;pointer-events:none}
.rail-min{position:absolute;top:12px;left:0;right:0;display:flex;flex-direction:column;
  align-items:center;gap:6px;opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .16s ease .1s}
body.rail-collapsed .rail-min{opacity:1;visibility:visible;pointer-events:auto;position:static}
.rail-btn{width:36px;height:36px;border-radius:9px;border:none;background:none;cursor:pointer;
  color:var(--muted);display:flex;align-items:center;justify-content:center;padding:0}
.rail-btn:hover{background:var(--paper);color:var(--ink)}
.rail-head{display:flex;justify-content:flex-end;margin:-8px -8px 2px 0}
.rail-ghost{border:none;background:none;color:var(--muted);cursor:pointer;padding:5px 7px;
  border-radius:8px;display:flex;align-items:center}
.rail-ghost:hover{background:var(--paper);color:var(--ink)}
.new-menu{margin:0 0 16px}
.menus-nav{margin-bottom:18px}
.fld{display:block;font-size:12px;color:var(--muted);margin-bottom:12px}
.fld select,.fld input{display:block;width:100%;margin-top:4px;padding:7px 8px;
  border:1px solid var(--line);border-radius:6px;background:#fff;font-size:14px;color:var(--ink)}
.row2{display:flex;gap:10px}.row2 .fld{flex:1}
.subhead{font-weight:600;margin:6px 0 8px}.subhead small{font-weight:400;color:var(--muted)}
.sub-card{border:1px solid var(--line);border-radius:9px;padding:10px 12px;margin-bottom:10px;background:#fff}
.sub-top{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.sub-top input[type=number]{width:56px;padding:6px;border:1px solid var(--line);border-radius:6px;
  font-size:15px;font-weight:600;text-align:center}
.sub-top span{color:var(--muted);font-size:12px;flex:1}
.sub-top .x{cursor:pointer;color:var(--muted);padding:2px 7px;border:none;background:none;font-size:17px;line-height:1}
.sub-top .x:hover{color:#a12626}
.sub-fld{display:block;font-size:11px;color:var(--muted);margin-bottom:8px}
.sub-fld select{display:block;width:100%;margin-top:3px;padding:7px 8px;border:1px solid var(--line);
  border-radius:6px;font-size:13px;background:#fff;color:var(--ink)}
.sub-df{display:block;font-size:12px;color:var(--ink);margin-top:2px}
.sub-extra{margin-top:8px}
/* which half of the trip a group is on (Ben, 2026-10-14): a select, and the exchange camp box
   that appears for a half-trip group */
.sub-span{margin-top:8px}
.sub-span select{display:block;width:100%;margin-top:3px;padding:7px 8px;border:1px solid var(--line);
  border-radius:6px;background:#fff;font-size:12.5px}
.sub-xc{display:flex;align-items:center;gap:6px;margin-top:6px;font-size:11px;color:var(--muted)}
.sub-xc input[type=number]{width:56px;padding:6px;border:1px solid var(--line);border-radius:6px;font-size:13px}
.sub-xc.hidden{display:none}
.sub-xc-hint{display:block;font-size:10.5px;color:var(--muted);margin-top:3px;line-height:1.35}
.sub-extra input[type=text]{display:block;width:100%;margin-top:3px;padding:7px 8px;border:1px solid var(--line);
  border-radius:6px;font-size:16px}
.sub-df input{margin-right:5px}
button{cursor:pointer;font:inherit}
.primary{width:100%;margin-top:14px;padding:10px;border:none;border-radius:7px;
  background:var(--teal);color:#fff;font-weight:600;font-size:15px}
.primary:hover{background:var(--river2)}
.ghost{width:100%;margin-top:6px;padding:6px;border:1px dashed var(--line);border-radius:6px;
  background:none;color:var(--muted)}
.ghost:hover{border-color:var(--river2);color:var(--river2)}
.summary{margin-top:14px;font-size:12px;color:var(--muted);line-height:1.6}
.summary b{color:var(--ink)}
.summary .ok{color:var(--river2);font-weight:600}
.summary .bad{color:#a12626;font-weight:600}

/* main + header-integrated tabs */
main{flex:1;min-width:0;height:100%;display:flex;flex-direction:column}
.tabs{display:flex;gap:24px}
.tabs button,.tabs a.tab-a{padding:9px 1px;border:none;border-radius:0;background:none;
  color:#fff;opacity:.78;font-weight:600;font-size:13.5px;text-decoration:none;
  display:inline-block;border-bottom:2.5px solid transparent}
.tabs button:hover,.tabs a.tab-a:hover{opacity:1}
.tabs button.active{opacity:1;border-bottom-color:#fff}
.head-link{color:#fff;opacity:.85;font-weight:600;font-size:13px;text-decoration:none;
  border:1px solid rgba(255,255,255,.4);border-radius:14px;padding:5px 12px}
.head-link:hover{opacity:1;background:rgba(255,255,255,.13)}
/* camp-rhythm hint above the plan grid */
.camp-hint{font-size:12.5px;color:var(--muted);padding:0 2px 8px}
.camp-hint a{color:var(--river2);font-weight:600;text-decoration:none}
.camp-hint a:hover{text-decoration:underline}
.picker-guide{color:var(--river2);font-weight:600}
/* perishability markers: fresh = quiet green dot; amber triangle only at the freshness edge */
.early{color:#6f9d5c;font-size:9px;vertical-align:2px;margin-left:5px}
.early.warn{color:#c07f10;font-size:10px}
/* the final camp's lunch note (take-out lunch replaces it) */
.cell.to-note{color:var(--muted);font-style:normal;font-size:12px}
/* choice rows read as actions, not warnings */
.choose-note{color:var(--river2);font-weight:600;font-style:normal}
.tab{display:none;flex:1;min-height:0;overflow:auto;padding:14px 18px;background:var(--card)}
.tab.active{display:block}
.hidden{display:none !important}

/* the menu pane owns no top padding — its sticky table header must pin flush to the top */
#tab-menu{padding-top:0}

/* doc-style header: the menu's title + settings live WITH the menu, like a Google Doc */
.doc-head{margin-bottom:12px;padding-top:14px}
.doc-title-row{display:flex;align-items:center;gap:14px;margin-bottom:8px}
/* Google-Docs-style title: quiet at rest, obvious outline on hover so it reads as editable */
.doc-title{flex:1;min-width:0;font:700 26px/1.35 inherit;color:var(--ink);
  border:1.5px solid transparent;background:none;padding:8px 12px;margin-left:-12px;
  border-radius:8px;transition:border-color .12s}
.doc-title:hover{border-color:#b9b09d;cursor:text}
.doc-title:focus{border-color:var(--river2);background:#fff;outline:none;
  box-shadow:0 0 0 3px rgba(184,92,56,.15)}
.doc-meta{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.dm{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px}
.dm select,.dm input{padding:6px 8px;border:1px solid var(--line);border-radius:6px;
  background:#fff;font-size:13px;color:var(--ink)}
.dm input[type=number]{width:58px}
.dm-leader input{width:170px}   /* this plan's permit holder (2026-10-20) */
/* the mid-trip resupply control (2026-10-28) */
.dm-resupply{gap:8px}
.dm-check{display:inline-flex;align-items:center;gap:5px;cursor:pointer;color:var(--muted)}
.dm-check input{margin:0;width:15px;height:15px;accent-color:var(--river2)}
#resupplyFields{display:inline-flex;align-items:center;gap:5px}
#resupplyFields select{padding:5px 6px}
.link-btn{background:none;border:0;padding:0;margin:0;font:inherit;font-size:12px;color:var(--river2);
  text-decoration:underline;cursor:pointer}
.load-sel select{max-width:260px}
.load-note{font-size:12px;color:var(--muted);margin:0 0 10px}
.dm-build{width:auto;margin:0;padding:7px 18px;font-size:13px}
.dm-reset{width:auto;margin:0;padding:6px 12px}
.picker-hint{font-size:12.5px;color:var(--muted)}
.build-status{font-size:12px;color:var(--river2);font-weight:600}
.doc-meta .dp-add{padding:8px 14px;font-size:12.5px}
.dp-head #dietHide{margin-left:10px}
.doc-summary{font-size:11.5px;color:var(--muted);line-height:1.5;flex-basis:100%}
.doc-summary b{color:var(--ink)}
.doc-head.picker .only-built{display:none !important}
.doc-head:not(.picker) .only-picker{display:none}

/* special diets panel — edited next to the menu it changes */
.diet-panel{border:1px solid var(--line);border-radius:10px;background:var(--paper);
  padding:10px 14px 12px;margin-bottom:14px}
.dp-head{font-weight:700;font-size:13px;margin-bottom:8px}
.dp-head small{font-weight:400;color:var(--muted)}
.dp-row{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap}
.dp-cards{display:flex;gap:10px;flex-wrap:wrap}
.dp-cards .sub-card{width:225px;margin-bottom:0}
.dp-add{width:auto;margin:0;padding:10px 18px;align-self:flex-start;border:none;
  border-radius:8px;background:var(--river2);color:#fff;font-weight:600;font-size:13.5px}
.dp-add:hover{background:var(--river)}
.back-btn{margin-right:10px}

/* superadmin dashboard — full-width home page; the nav rail belongs to the editor */
body[data-view="admin"] .controls{display:none}
.adm-sec-h{display:flex;align-items:center;gap:10px;font-weight:700;font-size:15px;
  color:var(--river);margin:4px 0 8px;border-bottom:2px solid var(--line);padding-bottom:5px}
.adm-filters{margin-left:auto;display:flex;gap:8px}
.adm-filters select{padding:5px 8px;border:1px solid var(--line);border-radius:6px;
  background:#fff;font-size:12px;font-weight:400;color:var(--ink)}
.adm-hint{color:var(--muted);font-size:13px;margin:8px 0 0}
.lead-edit{border:none;background:none;padding:0;font:inherit;color:var(--ink);cursor:pointer;
  border-bottom:1px dashed var(--line)}
.lead-edit:hover{color:var(--river2);border-bottom-color:var(--river2)}
.admin-table td{vertical-align:middle}
.admin-table tr.arch{opacity:.55}
.admin-table .pill{padding:4px 10px;font-size:11px;margin-left:4px}
.pill.danger{border-color:#a12626;color:#a12626}
.pill.danger:hover{background:#a12626;color:#fff}
.admin-empty{max-width:520px;margin:60px auto;text-align:center;color:var(--muted)}
.admin-empty h3{color:var(--ink);font-size:17px;margin:0 0 8px}
.admin-empty p{font-size:13.5px;line-height:1.6}

/* menu grid */
.menu-wrap{display:flex;gap:14px;align-items:flex-start}
.grid-hint{color:var(--muted);padding:30px}
table.menu{border-collapse:collapse;width:100%;font-size:12.5px}
table.menu th,table.menu td{border:1px solid var(--line);padding:5px 7px;vertical-align:top;text-align:left}
table.menu th{background:var(--river);color:#fff;position:sticky;top:0;font-weight:600}
table.menu td.camp{background:#efe9dc;font-weight:600;white-space:nowrap}
table.menu td.cook{color:var(--muted);font-size:11px;white-space:nowrap}
.cell{min-height:20px}
.cell.sub{background:var(--yellow)}
.cell.drop{outline:2px dashed var(--river2);outline-offset:-2px}
.cell .early{display:inline-block}
.badge{display:inline-block;font-size:10px;background:var(--sun);color:#fff;border-radius:8px;
  padding:0 5px;margin-left:4px}
.badge.ad{background:var(--river2)}

/* palette */
.palette{width:250px;flex:0 0 250px;border:1px solid var(--line);border-radius:8px;background:var(--paper);
  position:sticky;top:0;max-height:78vh;display:flex;flex-direction:column}
.palette-head{display:flex;justify-content:space-between;align-items:center;gap:6px;padding:8px;
  border-bottom:1px solid var(--line);font-weight:600}
.palette-head select{padding:4px;border:1px solid var(--line);border-radius:5px;background:#fff}
#palSearch{margin:8px;padding:6px;border:1px solid var(--line);border-radius:6px}
.pal-list{overflow:auto;padding:0 8px;flex:1}
.pal-item{padding:5px 7px;margin-bottom:4px;background:#fff;border:1px solid var(--line);
  border-radius:6px;cursor:grab;font-size:12px}
.pal-item:hover{border-color:var(--river2)}
.pal-item .meta{color:var(--muted);font-size:10.5px}
.pal-note{font-size:11px;color:var(--muted);padding:8px}

/* substitutions log */
.subs-log{margin-top:16px}
.subs-log h3{margin:0 0 6px;font-size:13px}
.subs-log table{border-collapse:collapse;width:100%;font-size:12px}
.subs-log td,.subs-log th{border:1px solid var(--line);padding:4px 7px;text-align:left}
.subs-log th{background:#efe9dc}

/* shopping */
.list-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
/* freeze the view/print bar while the list scrolls (menu tab keeps its own sticky table header) */
#tab-shopping,#tab-bagging{padding-top:0}
#tab-shopping .list-head,#tab-bagging .list-head{position:sticky;top:0;z-index:6;
  background:var(--card);margin:0 -18px 12px;padding:10px 18px;
  border-bottom:1px solid var(--line);flex-wrap:wrap}

/* quick-scope filter chips (pinned bar, shopping + bagging) */
.chips{display:flex;flex-wrap:wrap;gap:6px;width:100%;padding-top:9px}
.chip-btn{padding:3px 11px;border:1px solid var(--line);border-radius:14px;background:#fff;
  font-size:11.5px;color:var(--ink)}
.chip-btn em{font-style:normal;color:var(--muted);font-size:10px;margin-left:2px}
.chip-btn:hover{border-color:var(--river2)}
.chip-btn.on{background:var(--river2);border-color:var(--river2);color:#fff}
.chip-btn.on em{color:#f7e4d8}
.totals{font-size:14px}.totals b{font-size:17px;color:var(--river)}
.chk{font-size:12px;color:var(--muted)}
.sec-h{margin:14px 0 4px;font-weight:700;color:var(--river);border-bottom:2px solid var(--line);padding-bottom:2px}
table.shop{border-collapse:collapse;width:100%;font-size:12.5px}
table.shop td,table.shop th{border-bottom:1px solid var(--line);padding:4px 8px;text-align:left}
table.shop th{color:var(--muted);font-weight:600}
table.shop td.q{white-space:nowrap;color:var(--muted)}
table.shop td.c{text-align:right;white-space:nowrap}
.foot-note,.pal-note,.foot-note{color:var(--muted);font-size:11px}
.vendor{color:var(--sun);font-weight:700}

/* bagging: camp-code legend popover */
.legend-wrap{position:relative}
.info-i{display:inline-block;width:14px;height:14px;line-height:14px;border-radius:50%;
  background:var(--river2);color:#fff;font-size:10px;font-weight:700;text-align:center;
  font-style:normal;margin-left:2px}
#legendBtn:hover .info-i{background:#fff;color:var(--river2)}
.legend-card{position:absolute;left:0;top:calc(100% + 8px);width:300px;z-index:20;
  background:var(--card);border:1px solid var(--amberln);border-radius:10px;
  box-shadow:0 8px 24px rgba(0,0,0,.16);padding:12px 14px;font-size:12.5px}
.legend-card b{color:var(--river)}
.legend-card p{margin:6px 0}
.legend-card table{border-collapse:collapse;margin:4px 0}
.legend-card td{padding:2px 10px 2px 0}
.legend-foot{color:var(--muted);font-size:11px}
.bag-cols{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
.bag-group h3{margin:0 0 8px;font-size:14px;text-transform:uppercase;letter-spacing:.5px}
.bag-group.fresh h3{color:var(--river)}
.bag-group.dry h3{color:#9a6a1e}
.cont{border:1px solid var(--line);border-radius:8px;margin-bottom:10px;background:var(--card)}
.cont.fresh{border-left:4px solid var(--river2)}
.cont.dry{border-left:4px solid var(--sun)}
.cont.gear{border-left:4px solid #999}
.cont>summary{cursor:pointer;padding:7px 10px;font-weight:600;list-style:none}
.cont>summary::-webkit-details-marker{display:none}
.cont>summary .n{color:var(--muted);font-weight:400;font-size:11px}
.cont ul{margin:0;padding:2px 10px 10px 24px;font-size:12px;columns:1}
.cont li{margin:1px 0}
.cont li .q{color:var(--muted)}
.cont li .cp{color:var(--sun);font-size:10px}
@media(max-width:900px){.bag-cols{grid-template-columns:1fr}.menu-wrap{flex-direction:column;align-items:stretch}}

/* ---------- mobile ---------- */
@media(max-width:840px){
  /* page scrolls as one column: rail stacks on top of the content. align-items:stretch matters:
     the desktop's flex-start let the widest child (the 760px grid, the plans table) set the
     width of the whole column, so the page ran 780-1,000px wide on a phone and every sideways
     scroller below had nothing to scroll inside of */
  .layout{flex-direction:column;height:auto;overflow:visible;align-items:stretch}
  .controls{width:100%;flex:none;height:auto;border-right:none;
    border-bottom:1px solid var(--line);padding:12px 14px}
  .menus-nav,.history{margin-bottom:10px}
  main{height:auto;display:block}
  .tab{overflow:visible;padding:12px 12px;min-height:0}
  .tabs{overflow-x:auto;padding:8px 8px 0}
  header{padding:8px 12px;gap:8px;flex-wrap:wrap}
  .head-right{gap:10px;flex-wrap:wrap}
  .status{display:none}                      /* engine stats are dev chrome — not worth phone px */
  /* editor header wraps cleanly */
  .doc-title{font-size:20px;padding:6px 8px;margin-left:-8px}
  .doc-title-row{flex-wrap:wrap;gap:8px}
  .doc-meta{gap:10px}
  .head-actions{flex-wrap:wrap;gap:6px}
  /* wide tables scroll sideways instead of exploding the page */
  #menuGrid,#shopList,#freshPack,#bagList,#adminTable,#subsLog{overflow-x:auto;
    -webkit-overflow-scrolling:touch}
  table.menu{min-width:760px}
  .admin-table{min-width:820px}
  /* the tap-to-swap sheet replaces the drag palette on phones */
  .palette{display:none}
  /* pinned bars: keep them but let them wrap */
  #tab-shopping .list-head,#tab-bagging .list-head{margin:0 -12px 12px;padding:8px 12px}
  .picker{margin-top:6px}
  .pk-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
  .dp-cards .sub-card{width:100%}
  .adm-sec-h{flex-wrap:wrap}
  .adm-filters{margin-left:0;width:100%}
  .modal{max-width:92vw;margin:0 4vw}
  .legend-card{width:min(300px,86vw)}
}

/* fresh pack bagging list (REO camp-code form) */
.sec-sub{font-weight:400;font-size:11px;color:var(--muted)}
.code{display:inline-block;background:var(--amber);border:1px solid var(--amberln);
  border-radius:4px;padding:0 4px;margin:1px 1px;font-size:11px;font-weight:600;cursor:default}
.code em{font-style:normal;font-weight:400;color:#8a6a24;margin-left:4px;font-size:10px}
.camp-block{margin-bottom:14px;break-inside:avoid}
.head-actions{display:flex;gap:10px;align-items:center}
.pill{padding:6px 14px;border:1px solid var(--river2);border-radius:16px;background:none;
  color:var(--river2);font-weight:600;font-size:12px}
.pill:hover{background:var(--river2);color:#fff}
/* The finalize print set is six links of very different lengths: without this they wrap to two
   lines at six different widths and read as six different buttons. One row, one size. */
#finPrint{gap:8px;flex-wrap:wrap;justify-content:flex-end}
#finPrint .pill{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
  flex:0 0 126px;width:126px;height:32px;padding:0 12px;white-space:nowrap;line-height:1;
  text-decoration:none;margin:0}   /* .primary carries margin-top:14px, which dropped it 7px below the row */

/* Trip Menu (read-only, client-facing) */
.trip-menu{max-width:860px}
.tm-head h1{margin:4px 0 0;font-size:24px;color:var(--river);font-weight:700}
.tm-head p{margin:2px 0 16px;color:var(--muted)}
.tm-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.tm-card{border:1px solid var(--line);border-radius:10px;padding:12px 16px;background:var(--paper)}
.tm-camp{font-weight:700;font-size:15px;color:var(--river);margin-bottom:6px}
.tm-cook{font-weight:400;font-size:11px;color:var(--muted)}
.tm-slot{display:inline-block;width:92px;color:var(--muted);font-size:10px;
  text-transform:uppercase;letter-spacing:.4px}
.tm-line{margin:3px 0;font-size:13px}
.tm-sub{font-size:10.5px;color:#a86a12}
@media(max-width:900px){.tm-grid{grid-template-columns:1fr}}
.fp-item{font-weight:600;white-space:nowrap}
table.fp td.codes{line-height:1.8}
table.shop td.rec{color:var(--muted);font-size:11px;max-width:260px;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.chk select{margin-left:6px;padding:4px;border:1px solid var(--line);border-radius:5px;background:#fff}

/* dietary gap alerts */
.alert-banner{background:#f9e2dd;border:1px solid #dfa298;border-radius:8px;padding:9px 13px;
  margin:16px 0 8px;font-size:13px}
.alert-table{border-collapse:collapse;width:100%;font-size:12px;margin-bottom:14px}
.alert-table td,.alert-table th{border:1px solid #dfa298;padding:4px 7px;text-align:left}
.alert-table th{background:#f9e2dd}

/* empty-state preset picker (central area) */
.picker-wrap{width:100%}
.picker{max-width:880px;margin:24px auto 0;padding:0 8px}
.picker h2{margin:0 0 4px;font-size:22px;color:var(--river)}
.picker-sub{margin:0 0 18px;color:var(--muted);font-size:13.5px}
.pk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(196px,1fr));gap:12px}
.pk-card{position:relative;display:flex;flex-direction:column;gap:5px;text-align:left;
  padding:14px 14px 12px;border:1px solid var(--line);border-radius:10px;background:var(--paper);
  transition:border-color .12s,box-shadow .12s,transform .12s}
.pk-card:hover{border-color:var(--river2);box-shadow:0 3px 10px rgba(163,74,44,.14);
  transform:translateY(-1px)}
.pk-card.busy{border-color:var(--river2);background:var(--green)}
.pk-name{font-weight:700;font-size:14.5px;color:var(--ink)}
.pk-tag{font-size:12px;color:var(--muted);line-height:1.4}
.pk-badge{position:absolute;top:-8px;right:10px;background:var(--sun);color:#fff;font-size:10px;
  font-weight:700;border-radius:8px;padding:1px 8px;letter-spacing:.3px}

/* roles — Food Captain (client) never sees the internal ops surfaces */
body[data-role="captain"] .admin-only{display:none !important}
.head-right{display:flex;align-items:center;gap:16px}
.role-pick{font-size:12px;opacity:.92}
.role-pick select{margin-left:6px;padding:3px 6px;border:none;border-radius:5px;
  background:rgba(255,255,255,.16);color:#fff;font-size:12px}
.role-pick select option{color:var(--ink)}
.logout{color:#fff;opacity:.85;font-size:12px;text-decoration:underline}
.logout:hover{opacity:1}
.head-btn{padding:5px 12px;border:1px solid rgba(255,255,255,.45);border-radius:14px;
  background:none;color:#fff;font-size:12px;font-weight:600}
.head-btn:hover{background:rgba(255,255,255,.14)}
.fld-hint{font-weight:400;color:var(--muted)}

/* version history */
.history{margin-top:16px;border-top:1px solid var(--line);padding-top:10px}
.history .subhead small{font-weight:400;color:var(--muted)}
.hist-item{display:flex;gap:7px;align-items:baseline;padding:5px 7px;margin-bottom:3px;
  border:1px solid var(--line);border-radius:7px;background:#fff;cursor:pointer;font-size:11.5px}
.hist-item:hover{border-color:var(--river2)}
.hist-v{font-weight:700;color:var(--river);flex:0 0 auto}
.hist-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hist-ts{color:var(--muted);font-size:10px;flex:0 0 auto}
.menu-item.on{border-color:var(--river2);background:var(--green)}
.menu-item.on .hist-label{font-weight:700}
.menu-item{flex-wrap:wrap}
.menu-item.arch{opacity:.55}
.hist-owner{flex-basis:100%;color:var(--muted);font-size:10px}
.arch-btn{border:none;background:none;cursor:pointer;font-size:12px;padding:0 2px;flex:0 0 auto}
.link-btn{border:none;background:none;color:var(--river2);font-size:11.5px;padding:2px 0;
  cursor:pointer;text-decoration:underline}

/* confirm modal */
.modal-overlay{position:fixed;inset:0;background:rgba(33,32,28,.45);z-index:100;
  display:flex;align-items:center;justify-content:center}
.modal{background:var(--card);border-radius:12px;box-shadow:0 14px 44px rgba(0,0,0,.3);
  max-width:430px;padding:18px 22px}
/* every modal scrolls inside the screen, at EVERY width. This rule lived in the phone block only,
   so on a laptop the submit dialog (permit holder, name, the food team's dietary questions, the
   estimates, notes, the checkbox) ran off the bottom of a short window with no way to scroll to
   the Submit button (David Lea and Don Shepler, via Ben, 2026-10-14). */
.modal:not(.sheet){max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow-y:auto;
  overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.modal h3{margin:0 0 8px;font-size:16px;color:var(--ink)}
.modal p{margin:0 0 16px;font-size:13.5px;line-height:1.55;color:var(--ink)}
.modal .m-input{width:100%;box-sizing:border-box;padding:10px;border:1px solid var(--line);
  border-radius:8px;font-size:15px;margin-bottom:16px}
.modal .m-input:focus{outline:2px solid var(--river2)}
.modal-btns{display:flex;gap:10px;justify-content:flex-end}
.modal-btns button{padding:8px 16px;border-radius:7px;font-weight:600;font-size:13px}
.m-cancel{border:1px solid var(--line);background:#fff;color:var(--ink)}
.m-cancel:hover{border-color:var(--muted)}
.m-confirm{border:none;background:#a12626;color:#fff}
.m-confirm:hover{background:#8a2020}
.m-alt{border:none;background:var(--river2);color:#fff}
.m-alt:hover{background:var(--river)}

/* tap-to-swap sheet */
.sheet{width:440px;max-width:92vw;display:flex;flex-direction:column;max-height:78vh}
.sheet .sheet-search{margin-bottom:8px}
.sheet-chips{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:0 0 8px}
.sheet-chips .chip-btn{flex:none}
@media(max-width:840px){
  .sheet-chips{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:4px}
}
.sheet-list{overflow-y:auto;flex:1;min-height:0;margin-bottom:12px}
.sheet-item{display:block;width:100%;text-align:left;padding:9px 11px;margin-bottom:5px;
  background:var(--paper);border:1px solid var(--line);border-radius:8px;font-size:13.5px;
  color:var(--ink);cursor:pointer}
.sheet-item:hover{border-color:var(--river2)}
.sheet-item .meta{display:block;color:var(--muted);font-size:11px;margin-top:1px}
.sheet-item.unsafe{opacity:.5}
.sheet-item.unsafe .meta{color:#a12626}
.cell{cursor:pointer}
@media(max-width:840px){
  .sheet-overlay{align-items:flex-end}
  .sheet{width:100%;max-width:100%;margin:0;border-radius:14px 14px 0 0;max-height:82vh}
}

/* error toast */
#toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%) translateY(20px);
  background:#a12626;color:#fff;padding:11px 18px;border-radius:9px;max-width:520px;
  box-shadow:0 6px 20px rgba(0,0,0,.25);font-size:13px;opacity:0;pointer-events:none;
  transition:opacity .18s,transform .18s;z-index:50}
#toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* ---------- Ben round-3 feedback (2026-07-24) ---------- */

/* recipe info popout */
.info-btn{border:none;background:none;color:var(--muted);font-size:12px;line-height:1;
  padding:2px 4px;margin-left:4px;cursor:pointer;border-radius:50%;opacity:0;vertical-align:1px}
.cell:hover .info-btn,.pal-item:hover .info-btn,.sheet-item:hover .info-btn,
.info-btn:focus{opacity:1}
.info-btn:hover{color:var(--river2)}
.pal-item{position:relative}
.pal-item .info-btn{position:absolute;top:6px;right:6px;margin:0}
.sheet-item{position:relative}
.sheet-item .info-btn{position:absolute;top:8px;right:8px;margin:0}
.recipe-card{width:520px;max-width:92vw;max-height:80vh;overflow-y:auto}
.recipe-card h3{margin-right:20px}
.rc-meta{color:var(--muted);font-size:12.5px;margin:2px 0 10px}
.rc-contains{font-size:12px;color:var(--muted);margin-bottom:10px}
.rc-chip{display:inline-block;border:1px solid var(--amberln);background:var(--amber);
  color:#7a5a17;border-radius:4px;padding:0 6px;font-size:11px;font-weight:600;margin:1px}
.recipe-card h4{margin:12px 0 5px;font-size:13px}
.recipe-card h4 small{font-weight:400;color:var(--muted)}
.rc-ings{margin:0;padding-left:18px;font-size:13px;columns:2;column-gap:26px}
.rc-ings li{margin:1.5px 0;break-inside:avoid}
.rc-dir{font-size:13px;line-height:1.55;margin:4px 0 0;white-space:pre-line}
.sheet-cur .link-btn{font-size:12px}
@media(max-width:840px){ .rc-ings{columns:1} }
/* hover version of the recipe card: anchored popover, sits above modals (z 100) */
.hover-card{position:fixed;z-index:120;background:var(--card);border:1px solid var(--line);
  border-radius:12px;box-shadow:0 14px 38px rgba(0,0,0,.20);padding:14px 16px;
  max-height:56vh;overflow-y:auto;font-size:13px}
.hover-card h3{margin:0 0 2px;font-size:15px}

/* empty / removed cells — a real "Add +" affordance, subtle at rest, a button on hover */
.cell.empty{color:var(--muted);min-height:22px;display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.add-btn{display:inline-block;border:1px solid var(--river2);color:var(--river2);border-radius:13px;
  padding:1px 11px;font-size:11.5px;font-weight:600;line-height:1.6;opacity:.28;
  transition:opacity .12s,background .12s,color .12s;white-space:nowrap}
td:hover .cell.empty .add-btn{opacity:1}
td:hover .cell.empty .add-btn:hover{background:var(--river2);color:#fff}
.removed-note{font-size:11px;color:var(--muted);font-style:italic}
.m-remove{border:1px solid #a12626;background:none;color:#a12626}
.m-remove:hover{background:#a12626;color:#fff}

/* plan-type badge + summary warnings */
.plan-badge{font-size:11px;font-weight:600;border:1px solid var(--greenln);background:var(--green);
  color:#2c5222;border-radius:12px;padding:2px 10px;white-space:nowrap}
.plan-badge.custom{border-color:var(--amberln);background:var(--amber);color:#7a5a17}
.summary .warn{color:#a06a10;font-weight:600}

/* add-ons panel */
.addon-cards{align-items:stretch}
.addon-card{width:230px}
.addon-card.on{border-color:var(--river2);box-shadow:0 0 0 1px var(--river2) inset}
.ao-top{font-size:13.5px}
.ao-price{display:block;color:#3c7a2e;font-weight:700;font-size:13px;margin-top:2px}
.ao-price small{color:var(--muted);font-weight:400}
.ao-blurb{font-size:11.5px;color:var(--muted);margin:4px 0 8px;line-height:1.45}
.ao-qty{display:flex;align-items:center;gap:8px}
.ao-qty button{width:26px;height:26px;border:1px solid var(--line);border-radius:6px;background:#fff;
  font-size:15px;line-height:1;cursor:pointer;color:var(--ink)}
.ao-qty button:hover:not(:disabled){border-color:var(--river2);color:var(--river2)}
.ao-qty button:disabled{opacity:.35;cursor:default}
.ao-n{min-width:16px;text-align:center;font-weight:700}
.ao-line{margin-left:auto;font-weight:700;color:var(--river2);font-size:13px}

/* food-team notes */
.notes-row{margin-top:12px}
.notes-row label{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
.notes-row textarea{width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid var(--line);
  border-radius:8px;font:inherit;font-size:13px;background:#fff;color:var(--ink);resize:vertical}
.notes-row textarea:focus{border-color:var(--river2);outline:none}

/* sidebar meal-plan delete */
.menu-item{position:relative;padding-right:22px}
.mi-del{position:absolute;top:6px;right:4px;border:none;background:none;color:var(--muted);
  font-size:15px;line-height:1;padding:2px 6px;cursor:pointer;opacity:0;border-radius:6px}
.menu-item:hover .mi-del{opacity:.8}
.mi-del:hover{color:#a12626;opacity:1}

/* custom chip + notes flag on the dashboard */
.badge.cu{background:var(--amber);border:1px solid var(--amberln);color:#7a5a17}
.note-flag{cursor:help;font-size:12px}

/* build-your-own picker card */
.pk-card.pk-blank{border-style:dashed;background:none}
.pk-card.pk-blank:hover{border-color:var(--river2)}
.pk-badge.cu{background:var(--amber);color:#7a5a17}

/* trip-menu extras strip */
.tm-extras{font-size:12.5px;color:var(--ink);margin:6px 0 0}
.tm-notes{font-size:12.5px;color:var(--muted);margin:4px 0 0}

/* ---------- Ben+Eric round-4 (2026-07-31) ---------- */

/* roles: captain-only controls (Submit) hide from staff; admin-only already hides from captains */
body[data-role="admin"] .captain-only{display:none !important}

/* neutral info toast (cost notes) vs the red error toast */
#toast.info{background:#3f5d3a}

/* the always-visible extras running total */
.extras-strip{margin-top:10px;padding:8px 14px;border:1px solid var(--amberln);background:var(--amber);
  border-radius:9px;font-size:12.5px;color:#5c440f}
.extras-strip .ex-total{font-size:14px;color:#7a5a17}
.extras-strip .ex-note{color:#8a6a24;font-size:11px;margin-left:8px}

/* option-picker modal (rig dinner, take-out lunch, treat pre-fill) */
.choice-btns{display:flex;flex-direction:column;gap:8px;margin-bottom:14px}
.choice-btn{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;
  padding:10px 14px;border:1px solid var(--line);border-radius:9px;background:var(--paper);font-size:14px}
.choice-btn:hover{border-color:var(--river2);background:#fff}
.choice-btn span{font-size:11.5px;color:var(--muted)}

/* fixed trip-meal rows: rig night, put-in, take-out */
tr.fixed-row td{background:#f4efe4}
tr.fixed-row td.camp{background:#e8dfc9}
.cell.fixed{cursor:default;color:var(--ink)}
.cell.fx-na{cursor:default;min-height:20px}
.choice-cell{cursor:pointer;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.choice-cell .fx-label{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.4px}
.choice-cell .choose-note{color:var(--river2);font-weight:600;font-style:normal}
tr.fixed-row td:hover .add-btn{opacity:1}
tr.fixed-row .add-btn{opacity:.35}

/* onboarding / submit modals */
.m-label{display:block;font-size:12px;color:var(--muted);margin-bottom:10px}
.m-label .m-input{margin:4px 0 0}
.sb-auth{margin:4px 0 14px;font-size:13px}
.opt-chips{display:flex;flex-wrap:wrap;gap:6px;margin:-6px 0 14px}
.opt-chip{padding:3px 12px;border:1px solid var(--line);border-radius:14px;background:var(--paper);
  font-size:12.5px;color:var(--ink)}
.opt-chip:hover{border-color:var(--river2);color:var(--river2)}

/* submit button + submitted badge + lock screen */
.submit-pill{background:var(--river2);color:#fff;border-color:var(--river2)}
.submit-pill:hover{background:var(--river)}
.badge.sub-badge{background:var(--green);border:1px solid var(--greenln);color:#2c5222}
.adm-sec-h.subm{color:#2c5222;border-bottom-color:var(--greenln)}
.title-open{border:none;background:none;padding:0;font:inherit;color:var(--ink);cursor:pointer;text-align:left}
.title-open:hover b{color:var(--river2);text-decoration:underline}
#lockPanel .lock-card{max-width:560px;margin:10px 0 16px;padding:14px 18px;border:1px solid var(--greenln);
  background:var(--green);border-radius:10px;font-size:13.5px}
#lockPanel h3{margin:0 0 6px;color:#2c5222}
#lockPanel p{margin:0 0 8px}
body[data-role="captain"] .locked-hide{display:none !important}

/* sortable dashboard columns */
.admin-table th.sortable{cursor:pointer;white-space:nowrap;user-select:none}
.admin-table th.sortable:hover{color:var(--river2)}
.admin-table th.sortable.on{color:var(--river)}

/* shopping facet chips */
.chip-lbl{font-size:10.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;
  align-self:center;margin:0 2px 0 10px}
.chip-lbl:first-child{margin-left:0}

/* prep-form pencil edits */
.bag-edit{border:none;background:none;color:var(--muted);font-size:12px;padding:1px 4px;
  cursor:pointer;opacity:0;border-radius:5px}
tr:hover .bag-edit{opacity:.85}
.bag-edit:hover{color:var(--river2);opacity:1}
.bag-note{font-size:11.5px;color:#7a5a17;font-style:italic}
tr.edited .fp-item{background:var(--yellow)}

/* palette perishability filter */
.pal-camp{display:block;font-size:11.5px;color:var(--muted);margin:0 8px 6px}
.pal-camp input{width:52px;padding:3px 6px;border:1px solid var(--line);border-radius:5px;margin:0 3px}
.pal-item.unsafe{opacity:.5}
.pal-item.unsafe .meta{color:#a12626}

/* recipe card: per-ingredient container tags + plan adaptations */
.bin-chip{display:inline-block;border:1px solid var(--line);background:var(--paper);color:var(--muted);
  border-radius:4px;padding:0 5px;font-size:10px;font-weight:600;margin-left:4px;vertical-align:1px}
.rc-adapt{margin:0;padding-left:18px;font-size:12.5px}
.rc-adapt li{margin:2px 0}

/* trip menu: river-order note + treat boxes with EAT BY CAMP */
.tm-order-note{font-size:12px;color:var(--muted);max-width:640px;margin:2px 0 10px}
.tm-boxes{margin-top:18px}
.tm-boxes-note{font-size:12.5px;color:var(--muted);max-width:640px}
.tm-box{border:1px solid var(--line);border-radius:10px;background:var(--paper);
  padding:10px 16px;margin-bottom:12px}
.tm-box-h{font-weight:700;color:var(--river);margin-bottom:6px}
.tm-box ul{margin:0;padding-left:18px;font-size:13px;columns:2;column-gap:30px}
.tm-box li{margin:2.5px 0;break-inside:avoid}
.eat-by{color:#7a1d1d;background:var(--red);border-radius:4px;padding:0 5px;font-size:11px;white-space:nowrap}
.tm-card.tm-fixed{background:#f4efe4}
@media(max-width:840px){ .tm-box ul{columns:1} }
.ao-price.ao-market{color:var(--river);font-weight:700;font-size:12.5px}

/* ---- boot (Ben, 9/3): nothing role- or state-dependent paints until init has chosen the
   real state, then the page fades in once. Before this the default markup flashed (admin
   nav on a captain's screen, the editor before the dashboard, the rail snapping shut). ---- */
.layout{transition:opacity .22s ease}
body.booting .layout{opacity:0}
body.booting .controls,body.booting .rail-full,body.booting .rail-min{transition:none}
body.booting .admin-only,body.booting .captain-only,
body:not([data-role]) .admin-only,body:not([data-role]) .captain-only{display:none !important}
.boot-msg{position:fixed;left:0;right:0;top:130px;text-align:center;color:var(--muted);
  font-size:13px;pointer-events:none;animation:bootfade .4s ease .35s both}
@keyframes bootfade{from{opacity:0}to{opacity:1}}
/* round 9: submit-time dietary prompts + notes to the REO team */
.sb-diet{margin:.8em 0;padding:.7em .9em;background:#f5f2ea;border-radius:8px}
.sb-diet h4{margin:0 0 .3em;font-size:14px}
.sb-group{margin:.5em 0}
.sb-group b{display:block;margin-bottom:.2em}
.sb-est ul{margin:.3em 0 .2em 1.1em;padding:0}
.sb-est li{margin:.15em 0}
.m-note{font-size:12px;color:#666;margin:.2em 0}
.sb-err{color:#b3261e;font-weight:600;font-size:13px;margin:.4em 0 0;min-height:1em}
.sb-err:empty{display:none}
textarea.m-input{font:inherit;resize:vertical}
.modal textarea.m-para{min-height:84px;line-height:1.45;resize:vertical;display:block}

/* round 9: Finalize (staff) + Office access */
.fin-body{padding:6px 2px 30px}
/* cards size to their content: the tweaks card used to span three rows to hold the entry
   form, and once the form came off (2026-09-17) it was a tall empty box */
.fin-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
@media (max-width:1000px){.fin-grid{grid-template-columns:1fr}}
.fin-card{background:#fff;border:1px solid #e3ded4;border-radius:10px;padding:14px 16px}
.fin-card h3{margin:0 0 .5em;font-size:15px}
.fin-card h3 .sec-sub{font-weight:normal;margin-left:.5em}
.fin-flag{background:#fff3cd;border-left:3px solid #b8860b;padding:.35em .6em;margin:.3em 0;border-radius:4px;font-size:13px}
.fin-notes{margin-top:.6em;padding:.6em .8em;background:#f7f4ee;border-radius:6px;font-size:13px}
.fin-quote{margin:.3em 0;font-style:italic}
.fin-answers{margin-top:.5em}
.fin-answers ul{margin:.2em 0 0;padding-left:1.2em}
.fin-answers li{margin:.1em 0}
.fin-list{margin:.4em 0 .8em}
.fin-ov{display:flex;gap:10px;align-items:center;padding:.45em .2em;border-bottom:1px dotted #ddd}
/* the manifest editor on the finalize page: a real table Eric types into */
.fin-man{width:100%;border-collapse:collapse;margin:.2em 0 .6em}
.fin-man th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.7px;
  color:var(--muted);border-bottom:1px solid var(--line);padding:2px 4px}
.fin-man td{padding:2px 4px;border-bottom:1px dotted var(--line);vertical-align:middle}
.fin-man input{width:100%;padding:4px 6px;border:1px solid var(--line);border-radius:5px;font:inherit}
.fin-man tr.gap td{color:var(--muted);padding:6px 4px}
.fin-man-btns{white-space:nowrap;text-align:right}
.pill.xs{padding:2px 7px;font-size:12px;line-height:1.1;margin-left:3px}
.pill.xs[disabled]{opacity:.35}
.fin-man-card{grid-column:1/-1}

.fin-ov.miss .fin-ov-main b{color:#9a3412}
.fin-ov-main{flex:1;min-width:0}
.fin-err{background:#fde2e2;border-radius:6px;padding:.4em .6em;font-size:13px;margin:.3em 0}
.fin-form{margin-top:.6em;padding-top:.6em;border-top:1px solid #eee}
.fin-row{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end;margin:.35em 0}
.fin-row label{display:flex;flex-direction:column;font-size:12px;color:#555;gap:3px;min-width:120px}
.fin-row label.grow{flex:1}
.fin-row input,.fin-row select,#finBoxItems{font:inherit;padding:5px 7px;border:1px solid #ccc;border-radius:6px;background:#fff}
#finBoxItems{width:100%;box-sizing:border-box;margin:.3em 0}
.fin-rules{display:grid;grid-template-columns:1fr 1fr;gap:4px 14px}
.fin-rule{font-size:13px;display:flex;gap:6px;align-items:center}
@media (max-width:700px){.fin-rules{grid-template-columns:1fr}}
.off-modal{max-width:640px}
.off-table td{padding:5px 8px;font-size:13px}
.off-key{margin:.6em 0;padding:.7em .9em;background:#f3f7f3;border:1px solid #cfe3cf;border-radius:8px}
.off-key code{display:block;margin:.4em 0;padding:.4em .6em;background:#fff;border:1px solid #ddd;border-radius:6px;word-break:break-all;font-size:13px}

/* =============================================================================================
   PHONES (≤840px, the same breakpoint as the "mobile" block above) — the 2026-09-29 mobile pass.
   Nothing here reaches a wider screen. Fixes, in order: the rail and header fit a phone; form
   fields are 16px (iOS zooms the page into anything smaller); tap targets are finger-sized; the
   meal grid keeps its camp column in view while it scrolls sideways; pinned list headers that
   covered half the screen are released; the staff Finalize page stops overflowing; modals scroll
   inside the screen.
   ============================================================================================= */
@media(max-width:840px){
  /* the rail: full width when open; collapsed, a single row of its icon buttons */
  .rail-full{width:auto}
  body.rail-collapsed .controls{width:100%;flex-basis:auto;padding:4px 10px}
  body.rail-collapsed .rail-min{flex-direction:row;justify-content:flex-start}
  #railCollapse svg,#railExpand svg{transform:rotate(90deg)}   /* the rail folds up, not sideways */
  .rail-btn,.rail-ghost{min-width:44px;min-height:44px;justify-content:center}
  .rail-head{margin:-6px -6px 2px 0}
  .hist-item{padding:10px;font-size:12.5px}
  .menu-item{padding-right:46px}      /* room for the delete ✕, which is always shown on a touch screen */
  .mi-del{top:50%;right:2px;transform:translateY(-50%);min-width:40px;min-height:40px}

  /* header: the staff tabs keep to one row that scrolls sideways instead of wrapping each tab */
  .tabs{flex-wrap:nowrap;width:100%;gap:20px;padding:0 2px;scrollbar-width:none}
  .tabs::-webkit-scrollbar{display:none}
  .tabs button,.tabs a.tab-a{flex:none;white-space:nowrap;min-height:44px}
  .head-link,.head-btn,.logout{min-height:40px;display:inline-flex;align-items:center}

  /* !important on purpose: component rules set 12-15px on their fields, and any field under
     16px makes iOS zoom the page when it is tapped. The plan title keeps its own large size. */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not(.doc-title),select,textarea{font-size:16px !important}
  .dm select,.dm input{min-height:44px}
  .adm-filters select{flex:1 1 0;min-width:0;min-height:44px}   /* two 16px selects no longer fit side by side untrimmed */

  /* tap targets */
  .pill,.dp-add,.modal-btns button{min-height:44px}
  .chip-btn{min-height:36px;padding:4px 12px;font-size:12.5px}
  .ao-qty button{width:40px;height:40px}
  .sub-top .x{min-width:44px;min-height:44px}
  .link-btn{position:relative}                              /* "Hide", "recipe": small words, bigger hit area */
  .link-btn::after{content:"";position:absolute;inset:-11px -6px}

  /* the meal grid scrolls sideways inside its box; the camp column stays put */
  table.menu th:first-child,table.menu td.camp{position:sticky;left:0;z-index:2;box-shadow:1px 0 0 var(--line)}
  table.menu th:first-child{z-index:3}

  /* the shopping and bagging headers are 190-390px tall on a phone: pinned, they covered half
     the list they belong to */
  #tab-shopping .list-head,#tab-bagging .list-head{position:static}
  table.fp td.codes{min-width:200px}   /* the camp codes squeezed to a sliver and every row went 100px tall */

  /* the recipe ⓘ sits on a tappable dish: give it a finger-sized hit area of its own, or a
     missed tap swaps the dish instead of showing its recipe */
  .info-btn{position:relative}
  .info-btn::after{content:"";position:absolute;inset:-9px -7px}
  .sheet-item{padding-right:38px}

  /* the swap sheet's freshness chips: a scrolling row may not be squeezed to nothing */
  .sheet-chips{flex:none}
  .chip-lbl{white-space:nowrap;flex:none}
  .sheet{max-height:82vh;max-height:82dvh}

  /* (modals scroll inside the screen at every width -- the rule sits with .modal above) */
  #toast{max-width:calc(100vw - 24px)}

  /* staff Finalize: one column that fits, the manifest editor scrolls sideways, the print set
     is a 2-up grid under the title */
  .list-head{flex-wrap:wrap;gap:8px}
  .back-btn{white-space:nowrap}
  .fin-grid{grid-template-columns:minmax(0,1fr)}
  #finManWrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .fin-man{min-width:560px}
  .fin-man input,.fin-row input,.fin-row select{min-height:40px}
  #finPrint{width:100%;justify-content:flex-start}
  #finPrint .pill{flex:1 1 calc(50% - 4px);width:auto;height:44px}
}

/* touch screens have no hover: controls that only appear on hover must show at rest */
@media(hover:none){
  .info-btn{opacity:.75}
  .add-btn,tr.fixed-row .add-btn{opacity:1}
  .mi-del{opacity:.8}
  .bag-edit{opacity:.85}
}

/* "View as client" (actas.css holds the banner and the search box): a thin staff row under the
   header, the same place the Trip Portal keeps it */
.staff-bar{flex:0 0 auto;display:flex;align-items:center;gap:10px;padding:6px 18px;background:#efe9db;
  border-bottom:1px solid var(--line);font-size:13px;position:relative;z-index:30}
.staff-bar .lbl{font-weight:700;color:var(--river);font-size:11px;text-transform:uppercase;letter-spacing:1px}
@media(max-width:840px){ .staff-bar{padding:6px 12px;flex-wrap:wrap} }

.fin-warn{margin-top:4px;font-size:12px;color:#8a4b00;background:#fff4e0;border-radius:6px;padding:4px 8px}
/* a plan opening from a list: the list stays up until the plan is built (openMenuIn) */
body.plan-opening{cursor:progress}
body.plan-opening::after{content:"Opening meal plan…";position:fixed;top:14px;left:50%;transform:translateX(-50%);
  background:#2b2620;color:#fff;padding:7px 16px;border-radius:999px;font-size:13px;z-index:9999;
  box-shadow:0 4px 14px rgba(0,0,0,.25)}
