/* PHIL 2.0 real-app additions on top of the prototype kit (phil2.css). Tokens only, so dark mode follows. */
.loading{display:flex;gap:6px;justify-content:center;padding:60px 0}
.loading span{width:9px;height:9px;border-radius:50%;background:var(--bolt);animation:ld 1s infinite ease-in-out}
.loading span:nth-child(2){animation-delay:.15s}.loading span:nth-child(3){animation-delay:.3s}
@keyframes ld{0%,80%,100%{transform:scale(.5);opacity:.4}40%{transform:scale(1);opacity:1}}

.login-wrap{position:fixed;inset:0;display:grid;place-items:center;background:var(--surface);padding:16px;z-index:100}
.login{width:100%;max-width:400px}
.login .field{display:block;margin:12px 0}
.login .field span{display:block;font-size:13px;font-weight:600;margin-bottom:5px;color:var(--muted)}
.login .input{width:100%}
.pin-dots{display:flex;gap:14px;justify-content:center;margin:6px 0 18px}
.pin-dots span{width:16px;height:16px;border-radius:50%;border:2px solid var(--line2)}
.pin-dots span.on{background:var(--bolt);border-color:var(--bolt)}
.pinpad{display:grid;grid-template-columns:repeat(3,72px);gap:10px;justify-content:center}
.pinpad .btn{height:60px;font-size:22px;justify-content:center}
.proto{background:var(--stop);color:#fff}

/* Phones: every modal is full screen, with its footer buttons pinned to the bottom (production request) */
@media (max-width:720px){
  .modal{left:0;right:0;top:0;width:auto;height:100dvh;max-height:none;border-radius:0;transform:translateY(16px)}
  .modal.on{transform:none}
  .modal .mf{position:sticky;bottom:0;background:var(--card);border-top:1px solid var(--line);padding:12px 16px calc(12px + env(safe-area-inset-bottom))}
  .modal .mf .btn{flex:1;justify-content:center}
}

/* A hidden toast must never catch taps (quality request) */
.toast:not(.on){pointer-events:none}

/* The role switch is for managers only: [hidden] must win over the kit's display rule */
#role[hidden]{display:none!important}

/* Phones: drawers and the Ask panel fit the screen exactly (100vw counts the scrollbar on desktop browsers) */
@media (max-width:720px){ .drawer{width:100%} .askp{width:calc(100% - 16px)} }
/* Touch screens: every shared button, chip and icon button is at least 44px tall (QA) */
@media (pointer:coarse){ .btn,.chip,.iconbtn,.seg button,.tabs a{min-height:44px} .btn.sm{min-height:40px} }

/* Dylan 16 Nov: no dividing lines on the shell (top banner, left rail, above the user) */
.p-rail{border-right:0}
.p-brand{border-bottom:0}
.p-top{border-bottom:0}
.p-me{border-top:0}

/* Dylan 16 Nov, phones: no sideways scrolling; a menu button left of the logo slides the left rail out
   instead of the bottom tab bar (markup patched in by tools/sync_kit.py step 6) */
.p-menu,.p-phone-only{display:none!important}
@media (max-width:720px){
  html,body{overflow-x:hidden;overflow-x:clip}
  .p-menu{display:grid!important;flex:none}
  .p-tabbar{display:none!important}
  .p-main{padding-bottom:calc(30px + env(safe-area-inset-bottom))}
  .proto{bottom:calc(8px + env(safe-area-inset-bottom))}
  .p-rail{display:flex;width:min(300px,86vw);z-index:85;transform:translateX(-102%);transition:transform .22s ease}
  .p-rail.on{transform:none;box-shadow:var(--sh-3)}
  .p-brand{justify-content:flex-start;padding:0 18px}
  .p-brand .word{display:flex!important}
  .p-nav .grp{display:block}
  .p-nav a{flex-direction:row;gap:11px;font-size:14.5px;padding:11px 10px;text-align:left}
  .p-nav a span.lb{display:inline}
  .p-nav a .ct{display:inline}
  .p-nav a span.lbs{display:none!important}
  .p-nav a.p-phone-only{display:flex!important}
  .p-nav a.p-railscan{display:flex!important;justify-content:center;gap:10px;height:50px;margin:2px 0 8px;border-radius:14px;background:var(--bolt);color:var(--thunder-900);font-weight:700}
  .p-me{justify-content:flex-start;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  .p-me .who{display:block}
  .tabs{flex-wrap:wrap;overflow-x:visible}
  .kanban{grid-auto-flow:row;grid-auto-columns:auto;overflow-x:visible}
  .chips .chip{max-width:100%;white-space:normal;height:auto!important;min-height:34px;padding-top:6px;padding-bottom:6px;line-height:1.3}
  .p-top{gap:8px}
  .ask .bolt{display:none}
  .ask{padding:0 12px}
}

/* Notifications card (16 Nov, Dylan): orders (pick screen + order page) and buying (PO page) share it. Wide and short:
   compact rows, small padding, a [+] at the top right where a card takes notes. */
.ncard{border-color:var(--bolt-line);background:var(--bolt-50);padding:10px 14px}
.ncard-hd{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:30px;margin-bottom:2px}
.ncard-hd h3{display:flex;align-items:center;gap:6px;margin:0;font-size:15px}
.ncard-plus{flex:none;width:30px;height:30px;display:grid;place-items:center;border-radius:8px;border:1px solid var(--bolt-line);background:var(--card);color:var(--ink);cursor:pointer;padding:0}
.ncard-plus:hover,.ncard-plus.on{background:var(--bolt);border-color:var(--bolt);color:var(--thunder-900)}
.ncard-row{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 8px;padding:5px 0;border-top:1px solid var(--bolt-line);font-size:14px;line-height:1.35}
.ncard-row .grow{flex:1 1 200px;min-width:0;overflow-wrap:anywhere}
.ncard-row .ic{flex:none;align-self:center}
@media (pointer:coarse){ .ncard-plus{width:44px;height:44px} }

/* 17 Nov (Dylan): print preview pop-up */
.modal.pv{width:min(900px,96vw);max-height:94dvh}
.modal.pv .pv-body{padding:0 16px}
.modal.pv .pv-frame{width:100%;height:min(72dvh,1000px);border:1px solid var(--line);border-radius:10px;background:#fff;display:block}
@media (max-width:720px){.modal.pv{width:auto}.modal.pv .pv-frame{height:calc(100dvh - 170px)}}

/* 20 Nov 2026 (Dylan): PHIL logo = collapse / open the left menu (api.js, html.rail-off, remembered per device).
   Desktop: collapsed = icons only (like the tablet rail), the PHIL name stays where it is. Tablet: the icon rail hides,
   only the logo square stays. Phones: unchanged. Pick & pack gets the room + bigger text either way. */
.p-rail .p-brand{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}
.p-rail .p-brand:hover svg{filter:brightness(1.15)}
/* Desktop, 20 Nov (Dylan): collapsing slides the menu right-to-left; every icon stays exactly where it was,
   the words are clipped away, WORK / STOCK / RECORDS become tiny dividing lines in the same space. PHIL name stays. */
@media (min-width:1181px){
  html.rail-off{--rail:60px}
  .p-nav a{max-width:212px;white-space:nowrap;overflow:hidden}
  .p-nav a>*{flex:none}
  .p-nav .grp{position:relative;white-space:nowrap;overflow:hidden}
  .p-nav .grp::after{content:'';position:absolute;left:10px;width:20px;top:calc(50% + 4px);height:1px;background:var(--line);opacity:0}
  .p-me{overflow:hidden;white-space:nowrap}
  .p-me>*{flex:none}
  html.rail-off .p-nav a{max-width:40px}
  html.rail-off .p-nav .grp{color:transparent}
  html.rail-off .p-nav .grp::after{opacity:1}
  html.rail-off .p-nav{overflow-x:hidden;scrollbar-width:none}
  html.rail-off .p-nav::-webkit-scrollbar{display:none}
  html.rail-off .p-brand{width:232px;flex:none;background:var(--card);position:relative;z-index:1}
  html.rail-off .p-top{left:232px}
  html.rail-off .p-main{max-width:none}
  html.rail-anim .p-rail{transition:width .28s ease}
  html.rail-anim .p-main{transition:margin-left .28s ease}
  html.rail-anim .p-nav a{transition:max-width .28s ease}
  html.rail-anim .p-nav .grp{transition:color .18s ease}
  html.rail-anim .p-nav .grp::after{transition:opacity .28s ease}
}
@media (min-width:721px) and (max-width:1180px){
  html.rail-off .p-rail{bottom:auto;height:var(--top);border-bottom:0}
  html.rail-off .p-rail .p-nav,html.rail-off .p-rail .p-me{display:none!important}
  html.rail-off .p-main{margin-left:0;max-width:none}
}
@media (min-width:721px){
  /* Pick & pack with the menu collapsed: product tiles take the freed width, all text bigger */
  html.rail-off .p-main:has(.o-pksplit){zoom:1.2}
}

/* 20 Nov 2026 (Dylan): Packing / Production / Buying / Manager only on Today; screens can put their own switch in the
   top bar (P.topSlot, e.g. Pick & pack's Tablet / Pick list) */
html:not([data-route="today"]) #role{display:none!important}
.p-topslot{display:flex;align-items:center}
.p-topslot:empty{display:none}
/* 20 Nov 2026: 'N not in PHIL 1' pill (api.js) */
.p-p1pill{display:inline-flex;align-items:center;height:36px;padding:0 14px;border-radius:999px;background:var(--stop);color:#fff;font-weight:700;font-size:13px;text-decoration:none;white-space:nowrap;margin-right:8px}
.p-p1pill:hover{filter:brightness(1.08)}

/* 23 Nov 2026 (Dylan): print helper stopped: red bar above every page (api.js printBar) */
.p-printbar{margin:calc(var(--top) + 12px) 28px 0 calc(var(--rail) + 28px);padding:12px 18px;border-radius:14px;background:#c81e1e;color:#fff;font-size:15px;line-height:1.45;max-width:1444px;overflow-wrap:anywhere}
.p-printbar.calm{font-size:13.5px;padding:8px 18px}
.p-printbar + .p-main{padding-top:18px}
@media (max-width:860px){.p-printbar{margin-left:14px;margin-right:14px}}

/* 24 Nov 2026 (Dylan): 24-hour clock in the top bar (api.js) */
.p-clock{font:700 20px/1 var(--fd);font-variant-numeric:tabular-nums;letter-spacing:.02em;color:var(--ink);white-space:nowrap;padding:0 6px}
@media (max-width:720px){.p-clock{display:none}}
