/* Look follows the client's Thryv app: Montserrat headings / Open Sans text, orange actions, navy accents,
   neutral #FAFAFA page, borderless white cards, white sidebar with gray active pill. Not a copy. */
:root {
  --bg: #edeff2; --panel: #ffffff; --ink: #231f20; --text: #4d4d4d; --muted: #808080; --line: #eceef1; --line-strong: #cccccc;
  --brand: #ff5000; --brand-hover: #e64800; --brand-ink: #ffffff; --brand-soft: #fff0e8;
  --navy: #232a52; --blue: #3d5199; --blue-soft: #eceff8; --link: #057aff;
  --pill: #e3e6e8; --warn: #b45309; --warn-soft: #fef3c7; --bad: #e02500; --bad-soft: #fde7e6; --ok: #1f8a4c; --ok-soft: #e3f6ea;
  --avatar: #f19b6f; --avatar-ink: #ffffff;
  --radius: 10px; --btn-radius: 4px; --header-h: 64px; --nav-h: 62px; --side-w: 236px; --side-mini: 80px;
  --shadow: 0 1px 3px rgba(35, 31, 32, .08), 0 1px 2px rgba(35, 31, 32, .04);
  --head-font: Montserrat, Inter, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #131417; --panel: #1d1e22; --ink: #f2f2f3; --text: #c8c9cc; --muted: #8c8e94; --line: #2b2d32; --line-strong: #3a3d43;
    --brand: #ff6a26; --brand-hover: #ff7f45; --brand-ink: #ffffff; --brand-soft: #3a2418;
    --navy: #1b2040; --blue: #93a6ea; --blue-soft: #232842; --link: #5aa6ff;
    --pill: #2c2e33; --warn: #f5b04a; --warn-soft: #3a2e14; --bad: #f87171; --bad-soft: #3d1c1c; --ok: #4ccf86; --ok-soft: #163322;
    --avatar: #c0714a; --avatar-ink: #ffffff;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="grey"] {          /* a softer slate grey */
  --bg: #2a2c31; --panel: #34373d; --ink: #f1f2f4; --text: #d0d2d6; --muted: #9a9da4; --line: #42454c; --line-strong: #50545c;
  --brand: #ff6a26; --brand-hover: #ff7f45; --brand-ink: #ffffff; --brand-soft: #4a3226;
  --navy: #262c4f; --blue: #a3b3ee; --blue-soft: #353a52; --link: #74b4ff;
  --pill: #43464d; --warn: #f5b04a; --warn-soft: #4a3c20; --bad: #fb8585; --bad-soft: #4d2a2a; --ok: #5bd894; --ok-soft: #22432f;
  --avatar: #c0714a; --avatar-ink: #ffffff;
  --shadow: none;
  color-scheme: dark;
}
:root[data-theme="dark"] {
  --bg: #131417; --panel: #1d1e22; --ink: #f2f2f3; --text: #c8c9cc; --muted: #8c8e94; --line: #2b2d32; --line-strong: #3a3d43;
  --brand: #ff6a26; --brand-hover: #ff7f45; --brand-ink: #ffffff; --brand-soft: #3a2418;
  --navy: #1b2040; --blue: #93a6ea; --blue-soft: #232842; --link: #5aa6ff;
  --pill: #2c2e33; --warn: #f5b04a; --warn-soft: #3a2e14; --bad: #f87171; --bad-soft: #3d1c1c; --ok: #4ccf86; --ok-soft: #163322;
  --avatar: #c0714a; --avatar-ink: #ffffff;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
h1, h2, h3, .brand, #nav a, .tile b, th, .field > span { font-family: var(--head-font); }
h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); margin: 0 0 .25rem; }
h2 { font-size: 1.08rem; font-weight: 600; color: var(--ink); margin: 0 0 .6rem; }
h1 small, h2 small { font-weight: 500; }
small, .muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
header#top svg, #nav svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ shell */
header#top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--header-h); display: flex; align-items: center;
  gap: 1rem; padding: 0 20px 0 0; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.35rem; color: var(--ink); letter-spacing: -.01em;
  height: 100%; padding: 0 20px; border-right: 1px solid var(--line); }
.brand .mark { width: 40px; height: 40px; display: block; }
.gracebanner { position: fixed; top: calc(var(--header-h) + env(safe-area-inset-top)); left: 0; right: 0; z-index: 14; display: flex; align-items: center;
  justify-content: center; height: 38px; min-height: 0; padding: 0 12px; border: 0; border-radius: 0; background: #c0261a; color: #fff;
  font-weight: 600; font-size: .9rem; cursor: pointer; text-align: center; }
.gracebanner:hover { filter: brightness(1.08); }
body.graced main { padding-top: calc(var(--header-h) + 38px + 20px); }
@media (min-width: 900px) {
  .gracebanner { left: var(--side-w); }
  body.navmini .gracebanner { left: var(--side-mini); }
  body.authed.graced main { padding-top: calc(var(--header-h) + 38px + 32px); }
}
.storeover b, .storeover .grow { color: var(--bad); }
.storeover .dot { background: var(--bad); }
.itemlink { margin: .45rem 0 0; }
.itemlink a { color: var(--link); font-weight: 600; text-decoration: none; }
.itemlink a:hover { text-decoration: underline; }
.supgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 1rem; }   /* cards share the full width */
.supgrid > .card { margin: 0; }
.supcard { display: flex; flex-direction: column; gap: .3rem; margin: 0; padding: 1.1rem 1.1rem .9rem; min-height: 170px; color: var(--ink); text-decoration: none; font-size: .9rem; cursor: pointer; }
.supcard:hover { border-color: var(--line-strong); }
.supext { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); color: var(--link); }
.supext:hover { background: var(--pill); }
.supext svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.suptop { display: flex; align-items: center; gap: .6rem; margin-bottom: .2rem; }
.suplogo { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--hue, 20) 55% 52%), hsl(calc(var(--hue, 20) + 25) 50% 40%)); color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.suplogopick { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.suplogopick .actions { margin: 0; flex-wrap: wrap; }
.suplogo.md { width: 64px; height: 64px; border-radius: 14px; font-size: 1.05rem; }
.supbody { display: flex; align-items: flex-start; gap: 1rem; }
.supinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.suplogo.lg { width: 48px; height: 48px; border-radius: 12px; font-size: .95rem; }
.suplogo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #fff; }
.suph1 { display: flex; align-items: center; gap: .7rem; }
.suppick { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .4rem; }
.suppick:empty { display: none; }
.supchip button { min-height: 0; padding: 0 .35rem; border: 0; background: none; color: var(--muted); font-size: 1rem; line-height: 1; }
label.check.blockcheck { display: flex; margin-top: .4rem; }
.formopts { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.2rem; padding: 1.1rem 1.1rem 1.15rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.formopts label.check { display: flex; margin: 0; }
.formopts #linkFields { margin: .1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.formopts #linkFields .field { margin-bottom: 0; }
.suptop b { flex: 1; min-width: 0; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.homesub { margin: 1.4rem 0 .8rem; font-size: 1.05rem; }
.recapon { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.1rem; }
.daysseg label span { padding-left: .55rem; padding-right: .55rem; }
.recappeople label.check { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem 0; margin: 0; }
.pricesum { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.pricechip { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.pricechip.best { border-color: var(--ok); }
.pricechip b { flex-basis: 100%; font-size: .85rem; color: var(--muted); font-weight: 600; }
.pricechip .money { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.pricechip small { color: var(--muted); }
.pchange { font-size: .8rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pchange.up { color: var(--bad); }
.pchange.down { color: var(--ok); }
.recentsearch h2 { margin-bottom: .7rem; }
.recentsearch .chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.recentsearch .chip { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; }
.recentsearch .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recentsearch .chip svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; opacity: .7; }
.supcard.short { min-height: 0; padding: .9rem 1rem; justify-content: center; }
.supcard.short .supbody { align-items: center; }
.supcard.short .suptop { margin: 0; }
.staffcard { cursor: default; }
.vehpic svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vehpic img { object-fit: cover; padding: 0; }
.supcard.short .supinfo .muted { font-size: .85rem; }
.searching { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: 1.2rem 1rem; text-align: center; }
.searching .spin { flex: none; width: 30px; height: 30px; }
/* Every loading spinner is Crewtility's mark (the hex nut and C, no orange tile) turning: a quick turn of one flat at a time,
   like a nut being wrenched. spin.svg; the sign-in lookup uses it on ::before so its check and X can take over. */
.searching .spin, .frostcard .spin, .minispin, .lookup .spin::before {
  background: url("/static/spin.svg") center / contain no-repeat; animation: markspin 2.4s linear infinite; }
@keyframes markspin {   /* wrenched: a quick 60° turn (one flat of the nut), a slight give back, a pause; six to go round */
  0.00% { transform: rotate(0deg); animation-timing-function: cubic-bezier(.5, 0, .3, 1); }
  8.33% { transform: rotate(64deg); animation-timing-function: ease-out; }
  11.33% { transform: rotate(60deg); }
  16.67% { transform: rotate(60deg); animation-timing-function: cubic-bezier(.5, 0, .3, 1); }
  25.00% { transform: rotate(124deg); animation-timing-function: ease-out; }
  28.00% { transform: rotate(120deg); }
  33.33% { transform: rotate(120deg); animation-timing-function: cubic-bezier(.5, 0, .3, 1); }
  41.67% { transform: rotate(184deg); animation-timing-function: ease-out; }
  44.67% { transform: rotate(180deg); }
  50.00% { transform: rotate(180deg); animation-timing-function: cubic-bezier(.5, 0, .3, 1); }
  58.33% { transform: rotate(244deg); animation-timing-function: ease-out; }
  61.33% { transform: rotate(240deg); }
  66.67% { transform: rotate(240deg); animation-timing-function: cubic-bezier(.5, 0, .3, 1); }
  75.00% { transform: rotate(304deg); animation-timing-function: ease-out; }
  78.00% { transform: rotate(300deg); }
  83.33% { transform: rotate(300deg); animation-timing-function: cubic-bezier(.5, 0, .3, 1); }
  91.67% { transform: rotate(364deg); animation-timing-function: ease-out; }
  94.67% { transform: rotate(360deg); }
  100% { transform: rotate(360deg); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.srsec { margin-bottom: 1rem; }
html.anim .srsec { animation: srin calc(.35s * var(--motion)) cubic-bezier(.2, .7, .3, 1); }
html.anim .srsec :is(.supgrid > *, .list > li, .chips > *) { animation: srin calc(.4s * var(--motion)) cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms * var(--motion)); }
@keyframes srin { from { opacity: 0; transform: translateY(14px); } }
.avatar.staffav { width: 64px; height: 64px; font-size: 1.3rem; flex: none; }
.supext.off { color: var(--muted); opacity: .45; cursor: not-allowed; }
.supext.off:hover { background: none; }
.supcount { font-weight: 700; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: auto; padding-top: .9rem; }   /* centered along the bottom */
.countbox { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line-strong);
  background: var(--bg); font-variant-numeric: tabular-nums; transition: background .3s, border-color .3s; }
.countbox.bump { animation: countbump .9s ease; }
@keyframes countbump { 0% { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.12); } 100% { transform: none; } }
.supinfo > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suplink { color: var(--link); }
.suprows { list-style: none; margin: 0; padding: 0; }
.suprows li { display: grid; grid-template-columns: 110px 1fr; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.suprows li:last-child { border-bottom: 0; }
.undotoast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1000; display: flex; align-items: center;
  gap: .7rem; max-width: calc(100vw - 24px); padding: .5rem .55rem .5rem .8rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); font-size: .9rem; animation: undoin .2s ease; }
.undotoast.out { opacity: 0; transition: opacity .25s; }
.undotoast .grow { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.undotoast button { min-height: 0; padding: .4rem .9rem; flex: none; }
.undoring { width: 22px; height: 22px; flex: none; transform: rotate(-90deg); }
.undoring circle { fill: none; stroke: var(--line-strong); stroke-width: 3; }
.undoring .left { stroke: var(--brand); stroke-dasharray: 56.55; stroke-dashoffset: 0; animation: undocount 10s linear forwards; }
@keyframes undocount { to { stroke-dashoffset: 56.55; } }
@keyframes undoin { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (max-width: 899px) { .undotoast { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); } }
.who { display: flex; align-items: center; gap: .4rem; margin-left: auto; height: 100%; padding-left: 20px; border-left: 1px solid var(--line); }   /* the same divider as after the logo */
.adminlink { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.adminlink svg { width: 22px; height: 22px; }
.adminlink.on { color: var(--brand); background: var(--brand-soft); }
button.me { border: 0; background: none; padding: .2rem; min-height: 0; border-radius: 50%; }
button.me:hover:not(:disabled) { box-shadow: 0 0 0 3px var(--brand-soft); }
#meName { display: none; }       /* gone from the page; kept so a page left open across an update (new styles, old markup) doesn't show it */
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; margin-right: .3rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.clock b { font-size: .95rem; font-weight: 600; color: var(--ink); }
.clock span { font-size: .78rem; color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--avatar); color: var(--avatar-ink);
  display: grid; place-items: center; font-size: .9rem; font-weight: 600; font-family: var(--head-font); letter-spacing: .02em; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; flex: none; }
.avpick { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.avpick .actions { margin: 0; flex-wrap: wrap; }
.pfold { border-top: 1px solid var(--line); }
.pfold:first-of-type { margin-top: 1.2rem; }
.pfold:last-of-type { border-bottom: 1px solid var(--line); }
.pfold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: .85rem 0; font-weight: 600; color: var(--ink); }
.pfold > summary::-webkit-details-marker { display: none; }
.pfold > summary::after { content: ''; width: 7px; height: 7px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.pfold[open] > summary::after { transform: rotate(-135deg); }
.pfold[open] { padding-bottom: .9rem; }
.avcenter { flex: 1; display: flex; justify-content: center; }
.avhover { position: relative; padding-bottom: .5rem; margin-bottom: -.5rem; flex: none; }
.avhover #avPrev { cursor: pointer; }
.avhover .actions { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); z-index: 5; flex-direction: column; flex-wrap: nowrap; align-items: stretch;
  gap: .3rem; padding: .4rem; white-space: nowrap; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); opacity: 0; visibility: hidden; transition: opacity .12s, visibility .12s; }
.avhover:hover .actions, .avhover.open .actions, .avhover:focus-within .actions, .avhover:has(#avUndo:not([hidden])) .actions { opacity: 1; visibility: visible; }
.avinv { display: flex; align-items: center; gap: 1rem; width: 100%; margin-bottom: .8rem; }
.invcol { flex: 0 1 330px; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.invcol > .muted { font-size: .85rem; }
.invmock { min-width: 0; border-radius: 8px; background: #fff; color: #1d2333; box-shadow: var(--shadow); overflow: hidden; border-top: 3px solid var(--brand); }
.invtop { display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; border-bottom: 1px solid #e5e7eb; font-size: .85rem; }
.invtop img { height: 22px; width: auto; }
.invtop b { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invtop span { margin-left: auto; color: #9ca3af; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.invtech { display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; }
.invtech small { color: #6b7280; font-weight: 600; }
.invtech .avatar.sm { width: 30px; height: 30px; }
.invside { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }

#nav a { position: relative; display: flex; align-items: center; gap: .75rem; color: var(--ink); font-weight: 500; border-radius: 8px; white-space: nowrap; }
#nav a svg { width: 21px; height: 21px; color: var(--text); flex: none; }
#nav a.on { background: var(--pill); color: var(--ink); font-weight: 600; }
#nav a.on svg { color: var(--ink); }
.navtoggle { display: none; }

main { padding: calc(var(--header-h) + 20px) 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }
body:not(.authed) header#top, body:not(.authed) #nav { display: none; }

@media (min-width: 900px) {
  #nav { position: fixed; top: var(--header-h); left: 0; bottom: 0; width: var(--side-w); z-index: 15; padding: 44px 14px 14px;
    background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; transition: width .15s; overflow-y: auto; }
  #nav a { padding: .62rem .8rem; font-size: .92rem; }
  #nav a:hover:not(.on) { background: var(--bg); }
  .navtoggle { display: grid; place-items: center; position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; min-height: 0;
    padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); }
  .navtoggle svg { width: 14px; height: 14px; transition: transform .15s; }
  body.navmini #nav { width: var(--side-mini); }
  body.navmini #nav a span { display: none; }
  body.navmini #nav a { justify-content: center; padding: .62rem 0; }
  /* open sidebar: the collapse button sits at the right end of the Home row instead of taking a row of its own */
  body:not(.navmini) #nav { padding-top: 14px; }
  body:not(.navmini) .navtoggle { top: 21px; right: 24px; z-index: 2; }
  body.navmini .navtoggle { right: 26px; }
  body.navmini .navtoggle svg { transform: rotate(180deg); }
  /* open menu: the Notifications count is a circle like the collapse button, lined up under it */
  body:not(.navmini) :is(#noteCount, #reqCount) { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: auto; min-width: 28px; height: 28px;
    padding: 0 6px; margin: 0; border-radius: 999px; border: 1px solid var(--bad); background: var(--bad); color: #fff; font-size: .75rem; }
  body:not(.navmini) :is(#noteCount, #reqCount).zero { border-color: var(--line-strong); background: var(--panel); color: var(--text); }
  body.navmini :is(#noteCount, #reqCount).zero { display: none; }
  body.navmini :is(#noteCount, #reqCount) { top: 1px; left: calc(50% + 1px); right: auto; min-width: 18px; height: 18px; padding: 0 4px; font-size: .64rem; }   /* collapsed: on the bell's corner */
  .adminlink { display: none; }
  body.authed main { margin-left: var(--side-w); padding: calc(var(--header-h) + 32px) 40px 48px; max-width: calc(1240px + var(--side-w)); transition: margin-left .15s; }
  body.authed.navmini main { margin-left: var(--side-mini); max-width: calc(1240px + 2 * var(--side-w) - var(--side-mini)); }   /* same right edge as the open menu: no empty strip */
  #toast { bottom: 28px !important; }
}
@media (max-width: 899px) {
  #nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding: 0 4px env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--line);
    display: flex; justify-content: space-around; align-items: stretch; }
  #nav a { flex: 1; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; font-size: .62rem; letter-spacing: -.01em; border-radius: 0; }
  #nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #nav a.on { background: none; color: var(--brand); }
  #nav a.deskonly, #nav a.inmore { display: none; }
  .clock { margin-right: 0; }
  .clock b { font-size: .85rem; }
  .clock span { font-size: .7rem; }
}

/* ------------------------------------------------------------ controls */
button, .btn { font: inherit; font-family: var(--head-font); font-weight: 500; font-size: .9rem; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  padding: .5rem 1rem; border-radius: var(--btn-radius); cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: .35rem; min-height: 40px; transition: background .12s, border-color .12s, color .12s; }
button:hover:not(:disabled), .btn:hover { border-color: var(--muted); }
button:disabled { opacity: .55; cursor: default; }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
/* Thryv's secondary action: orange outline */
.actions.fill > button:not(.primary), button.use, button.addnew:not(.primary) {
  background: var(--panel); border-color: var(--brand); color: var(--brand); }
.actions.fill > button:not(.primary):hover, button.use:hover, button.addnew:not(.primary):hover { background: var(--brand-soft); border-color: var(--brand); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.danger { color: var(--bad); }
button.big { font-size: 1.1rem; padding: .9rem 1.4rem; min-height: 54px; width: 100%; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 6px; padding: .5rem .7rem; min-height: 42px; width: 100%; }
/* Safari draws native selects shorter than inputs; draw our own so every field lines up */
select { -webkit-appearance: none; appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5' fill='none' stroke='%238c8e94' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { min-height: 72px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
.field { display: block; margin-bottom: .8rem; }
.field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--ink); margin-bottom: .25rem; }
.field .hint { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); margin-top: .25rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.withbtn { display: flex; gap: .4rem; }
.withbtn input { flex: 1; }
.check { display: inline-flex; align-items: flex-start; gap: .55rem; color: var(--ink); font-weight: 500; line-height: 1.4; }
.check input { flex: none; margin: .1rem 0 0; }
.bar .check { white-space: nowrap; align-items: center; }
.bar .check input { margin: 0; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.bar > .grow { flex: 1 1 200px; }
.bar select { width: auto; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions.fill > * { flex: 1 1 0; }

.card { background: var(--panel); border: 1px solid transparent; border-radius: var(--radius); padding: 1.25rem 1.4rem;
  margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.card > h2:first-child { margin-top: 0; }
.empty { color: var(--muted); padding: 1rem 0; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue); vertical-align: middle; letter-spacing: .01em; white-space: nowrap; }
.badge.low { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.super { background: var(--navy); color: #fff; }
.badge.dim { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; color: var(--muted); font-size: .88rem; }

/* ------------------------------------------------------------ lists + tables */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list a.rowlink, .list .row { display: flex; align-items: center; gap: .75rem; padding: .75rem .1rem; color: inherit; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.list .sub { color: var(--muted); font-size: .84rem; }
.qty { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); text-align: right; white-space: nowrap; }
.qty small { font-weight: 500; }

.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid transparent; border-radius: var(--radius); box-shadow: var(--shadow); }
.card .tablewrap { box-shadow: none; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .65rem .85rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: var(--panel); }
.card th { background: transparent; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { color: var(--ink); font-weight: 600; }
td.low { color: var(--warn); font-weight: 800; }
td.zero { color: var(--muted); font-weight: 500; }
td.name { white-space: normal; min-width: 170px; }
td.name a { color: var(--ink); font-weight: 600; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--bg); }
.minbtn { border: 0; background: none; color: var(--blue); min-height: 0; padding: 0; font-weight: 600; }

.mv { list-style: none; margin: 0; padding: 0; }
.mv li { padding: .6rem 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.mv li:last-child { border-bottom: 0; }
.mv-meta { color: var(--muted); font-size: .82rem; }

/* ------------------------------------------------------------ home */
.welcome { margin-bottom: 1.4rem; }
.welcome h1 { font-size: 2rem; margin: 0; }
.searchcard { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 1.1rem; }
.searchbar { display: flex; gap: .5rem; }
.searchbar input { flex: 1; min-height: 48px; font-size: 1.02rem; }
.searchbar button { min-height: 48px; padding: 0 1.4rem; }
.chips { display: flex; gap: .4rem; overflow-x: auto; margin-top: .75rem; scrollbar-width: none; }
.chips:empty { display: none; }
.chipsep { flex: none; width: 1px; margin: .2rem .25rem; background: var(--line-strong); }      /* Home: stock categories | tool categories */
.chip { flex: none; min-height: 32px; padding: .25rem .85rem; border-radius: 999px; font-size: .84rem; font-weight: 500;
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--text); }
@media (max-width: 640px) { .welcome h1 { font-size: 1.5rem; } }
.qrow { display: flex; align-items: center; gap: .6rem; }
.qrow > .rowlink { min-width: 0; }
button.use { flex: none; min-width: 66px; }
button.addnew { width: 100%; margin-top: .7rem; }
.card > .empty:first-child { margin: 0; padding: 0 0 .1rem; }
.qty.lowq { color: var(--warn); }
.star { color: var(--brand); }

/* ------------------------------------------------------------ vehicles */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr)); gap: 1rem; }   /* wide enough for 6-digit miles */
.vcard { cursor: pointer; margin: 0; display: flex; flex-direction: column; gap: .8rem; }
.vcard:hover { border-color: var(--line-strong); }
.vcard h2 { margin: 0; }
.vcard .sub { color: var(--muted); font-size: .85rem; }
.vcard .actions { margin-top: auto; }
.vtop { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tiles.small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.tile { background: var(--panel); border: 1px solid transparent; border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.tiles.small .tile { background: var(--bg); box-shadow: none; border: 0; padding: .55rem .65rem; }
.tile span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tile b { font-size: 1.5rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles.small .tile b { font-size: 1.02rem; }
.tile small { font-size: .78rem; }
.duelist { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .9rem; color: var(--ink); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; border-radius: 0; min-height: 34px; padding: .3rem .8rem; font-size: .85rem; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--pill); color: var(--ink); }
:is(.themeseg, .speedseg, .daysseg) { display: flex; }
:is(.themeseg, .speedseg, .daysseg) label { flex: 1; min-width: 0; margin: 0; position: relative; }
:is(.themeseg, .speedseg, .daysseg) label + label span { border-left: 1px solid var(--line-strong); }
:is(.themeseg, .speedseg, .daysseg) input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; pointer-events: none; }   /* kept inside its button: a full-width hidden radio made the dialog scroll sideways */
:is(.themeseg, .speedseg, .daysseg) span { display: block; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: .5rem .6rem; cursor: pointer; font-family: var(--head-font); font-size: .88rem; color: var(--text); }
:is(.themeseg, .speedseg, .daysseg) input:checked + span { background: var(--pill); color: var(--ink); font-weight: 600; }
:is(.themeseg, .speedseg, .daysseg) input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
/* Theme: each button in its own theme's colors (Auto half light, half dark); the picked one gets an orange ring */
.themeseg input[value="light"] + span { background: #edeff2; color: #231f20; }
.themeseg input[value="dark"] + span { background: #1d1e22; color: #f2f2f3; }
.themeseg input[value="grey"] + span { background: #34373d; color: #f1f2f4; }
.themeseg input[value="system"] + span { background: linear-gradient(135deg, #edeff2 50%, #1d1e22 50%); color: #8a8c91; font-weight: 700; }
.themeseg input:checked + span { box-shadow: inset 0 0 0 3px var(--brand); font-weight: 700; }
.vicon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.vicon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vicon.fuel { background: var(--blue-soft); color: var(--blue); }
.vicon.service { background: var(--brand-soft); color: var(--brand); }
.mpg { color: var(--blue); font-weight: 700; }
.remrow .grow { min-width: 50%; }
.remrow .qty { white-space: normal; font-weight: 600; }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------------------ restock */
.ordergrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
.ordergrid .card { margin: 0; border-top: 3px solid transparent; }
.ordergrid > * { min-width: 0; }
.ordergrid td.name { min-width: 120px; }
.ordercard.now { border-top-color: var(--bad); }
.ordercard.soon { border-top-color: #efbb06; }
.ordercard.req { border-top-color: var(--brand); }
.truckpart + .truckpart { margin-top: 1rem; }
.truckpart > h2 { font-size: .95rem; margin: .4rem 0 .3rem; }
.ordercard h2 { display: flex; align-items: center; gap: .5rem; }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; font-size: .78rem;
  border: 1.5px solid var(--brand); color: var(--brand); font-weight: 600; }
.ordercard.soon .count { border-color: #d9a500; color: #a67c00; }
td.bad { color: var(--bad); font-weight: 700; }
@media (max-width: 1350px) { .ordergrid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ reports */
.rgroup { margin: 1.2rem 0 .4rem; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.rgroup h3 { margin: 0; font-size: .98rem; color: var(--ink); }
.dates { display: flex; gap: .5rem; align-items: center; }
.dates input { width: auto; }
.chips.light { margin-bottom: .8rem; }

/* ------------------------------------------------------------ audit log */
.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; color: var(--ink); word-break: break-word; }
.auditbody { background: var(--bg); border-radius: 6px; padding: .8rem; font-size: .8rem; white-space: pre-wrap; max-height: 40vh; overflow: auto; margin: 0; }

/* ------------------------------------------------------------ database view */
.dbgrid td { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: var(--ink); max-width: 320px;
  overflow: hidden; text-overflow: ellipsis; }
.dbgrid th[data-sort] { cursor: pointer; }
.dbgrid th { text-transform: none; letter-spacing: 0; font-family: ui-monospace, Menlo, monospace; }
.null { color: var(--muted); font-style: italic; }
.nullbtn { min-width: 64px; font-size: .75rem; color: var(--muted); }
.nullbtn.on { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.sqlbox { min-height: 140px; font-size: .9rem; }
.sqlerr { color: var(--bad); font-weight: 600; }

/* ------------------------------------------------------------ modal */
dialog.modal { border: 0; border-radius: 12px; padding: 0; width: min(540px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  background: var(--panel); color: var(--text); box-shadow: 0 24px 64px rgba(18, 24, 51, .28); }
dialog.modal:has(.storesplit) { width: min(940px, calc(100vw - 24px)); }
dialog.modal:has(.avinv) { width: min(760px, calc(100vw - 24px)); }
.avinv .avatar.lg { width: 106px; height: 106px; font-size: 2rem; }
.storesplit { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .storesplit { grid-template-columns: 1fr; gap: 1rem; } }
.statlist b { font-variant-numeric: tabular-nums; }
dialog.onboard header { display: flex; align-items: center; justify-content: space-between; }
.obdots { display: flex; gap: 6px; }
.obdots i { width: 26px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.obdots i.on { background: var(--brand); }
.invbanner { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem; margin-top: 1rem; padding: .9rem 1rem; border-radius: 10px;
  background: var(--blue-soft); border: 1px solid var(--line); }
.invbanner .grow { flex: 1 1 200px; display: flex; flex-direction: column; gap: .15rem; }
.invprev { display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; border-radius: 8px; background: #fff; color: #1d2333; box-shadow: var(--shadow); }
.invprev small { color: #6b7280; font-weight: 600; }
dialog.modal::backdrop { background: rgba(18, 24, 51, .5); }
dialog.modal form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
dialog.modal header { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); }
dialog.modal header h2 { margin: 0; font-size: 1.08rem; }
dialog.modal .body { padding: 1.1rem 1.2rem; overflow-y: auto; }
dialog.modal .err { color: var(--bad); margin: 0 1.2rem; font-weight: 600; }
dialog.modal .err:empty { display: none; }
dialog.modal footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.2rem; border-top: 1px solid var(--line); background: var(--bg); border-radius: 0 0 12px 12px; }
dialog.modal .x { min-height: 32px; padding: 0 .5rem; font-size: 1.4rem; border: 0; background: none; color: var(--muted); }

/* ------------------------------------------------------------ sign in */
/* The sign-in screen matches go.crewtility.app: Crewtility navy darkening toward the edges, the tools-and-parts grid
   (static/grid.js, a copy of the hub's) on a canvas above it. The backdrop is a fixed layer reaching well past the top
   and bottom, so it also fills behind the iPhone status bar, Safari's toolbar and any rubber-band. */
html.signin { background-color: #1b2142; overscroll-behavior: none; }
html.signin::before { content: ""; position: fixed; left: 0; right: 0; top: -30vh; bottom: -30vh; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 75% 60% at 50% 45%, #1e2549 0%, #1b2142 55%, #11152c 100%); }
#grid { display: none; }
html.signin #grid { display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
body.signin { background: transparent; }
/* the card sits dead center at its first-line height (--card-h, set by app.js), the logo above it */
body.signin main { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: 1fr var(--card-h, auto) 1fr;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(16px + env(safe-area-inset-bottom)); }
body.signin main > .authbrand { align-self: end; }
body.signin main > .auth { align-self: start; width: 100%; }
.auth .field > span:not(.hint) { margin-bottom: .65rem; }
.auth h1:has(+ .authlede) { margin-bottom: .2rem; }
.auth h1.firstrun { font-size: clamp(1.15rem, 5.6vw, 1.6rem); white-space: nowrap; }   /* one line, even on a phone */
/* first run: three short pages on the card, sliding sideways, with progress dots and Back / Next */
.setup h1, .auth h1.firstrun { font-size: clamp(1.05rem, 5.2vw, 1.35rem); white-space: nowrap; }   /* each heading on one line */
/* first run: a left/right split on wide screens (the logo and name large on the left, the setup card on the right),
   both sitting high on the screen; stacked on phones with a small logo row on top */
html.setupmode body.signin main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 430px); grid-template-rows: none;
  column-gap: clamp(2rem, 6vw, 5rem); align-items: start; max-width: 1040px; margin: 0 auto; min-height: 100vh; min-height: 100svh;
  padding: clamp(24px, 9vh, 110px) 24px 32px; }
html.setupmode body.signin main > .authbrand { align-self: start; justify-self: center; margin: clamp(0px, 7vh, 90px) 0 0; font-size: 2.8rem; gap: 1rem; }
html.setupmode .authbrand img { width: 220px; height: 220px; }
html.setupmode body.signin main > .auth { margin: 0; }
@media (max-width: 860px) {
  html.setupmode body.signin main { grid-template-columns: minmax(0, 1fr); padding-top: calc(env(safe-area-inset-top) + 16px); }
  html.setupmode body.signin main > .authbrand { flex-direction: row; margin: 0 0 1rem; font-size: 1.8rem; gap: .6rem; }
  html.setupmode .authbrand img { width: 56px; height: 56px; }
  html.setupmode body.signin main > .auth { justify-self: center; width: 100%; }
  html.handoff.setupmode body.signin main > .authbrand { animation: signfade .5s ease-out both; }   /* from go: the small logo row fades in */
}
@keyframes signfade { from { opacity: 0; } to { opacity: 1; } }
.auth.setup { max-width: 430px; }                        /* a little roomier than sign-in: headings never touch the edge */
.setupeyebrow { margin: 0 0 .3rem; font: 700 .7rem var(--head-font); letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.setuplogo { display: flex; align-items: center; gap: .8rem; }
.setuplogoprev { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; border: 1.5px dashed var(--line-strong);
  font-size: .7rem; color: var(--muted); overflow: hidden; }
.setuplogoprev.has { border-style: solid; background: #fff; }
.setuplogoprev img { width: 100%; height: 100%; object-fit: contain; }
.setupnote { margin: -.4rem 0 1rem; font-size: .78rem; color: var(--muted); }
.setupdots { display: flex; gap: .35rem; margin-bottom: 1.1rem; }
.setupdots i { width: 22px; height: 4px; border-radius: 2px; background: var(--line-strong); transition: background .3s, width .3s; }
.setupdots i.on { background: var(--brand); width: 30px; }
.setuppage.fromright { animation: pagefromright .4s cubic-bezier(.2, .8, .3, 1); }
.setuppage.fromleft { animation: pagefromleft .4s cubic-bezier(.2, .8, .3, 1); }
@keyframes pagefromright { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes pagefromleft { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.setupnav { display: flex; gap: .6rem; align-items: stretch; margin-top: .4rem; }
.setupnav .big { flex: 1; }
.setupnav .ghost { min-height: 54px; padding: 0 1rem; }
.placetiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .55rem; margin-bottom: 1rem; }
.placetile { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .85rem .5rem .7rem; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); font: 600 .9rem var(--head-font); text-align: center;
  transition: border-color .15s, background .15s, color .15s, transform .15s; }
.placetile:hover { border-color: var(--muted); }
.placetile input { position: absolute; opacity: 0; pointer-events: none; }
.placetile svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.placetile:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); transform: translateY(-1px); }
.placetile:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--brand-soft); }
@media (prefers-reduced-motion: reduce) { .setuppage.fromright, .setuppage.fromleft { animation: none; } }
/* first run, industry page: an even two-column grid of tiles; pick any number (a check marks each); Other opens a box */
.industries { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-bottom: 1rem; }
.industry { position: relative; cursor: pointer; }
.industry input { position: absolute; opacity: 0; pointer-events: none; }
.industry span { display: flex; align-items: center; gap: .45rem; min-height: 40px; padding: .4rem .5rem; border: 1px solid var(--line-strong);
  border-radius: 8px; font: 600 clamp(.72rem, 3.4vw, .82rem)/1.2 var(--head-font); white-space: nowrap; color: var(--text); transition: border-color .15s, background .15s, color .15s; }
.industry span::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-strong);
  background: center / 12px no-repeat; transition: background-color .15s, border-color .15s; }
.industry:hover span { border-color: var(--muted); }
.industry input:checked + span { border-color: var(--brand); color: var(--ink); }
.industry input:checked + span::before { border-color: var(--brand); background-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.industry input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }
/* first run, modules page: the same two-column tiles as the industry page, each with its menu icon; on = checked */
.modpicks { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-bottom: 1rem; }
.modpick { position: relative; cursor: pointer; }
.modpick input { position: absolute; opacity: 0; pointer-events: none; }
.modpick span { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem .55rem; border: 1px solid var(--line-strong); border-radius: 8px;
  font: 600 clamp(.72rem, 3.4vw, .82rem)/1.2 var(--head-font); color: var(--muted); white-space: nowrap; transition: border-color .15s, color .15s, opacity .15s; }
.modpick svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.modpick:hover span { border-color: var(--muted); }
.modpick input:checked + span { border-color: var(--brand); color: var(--ink); }
.modpick input:checked + span svg { color: var(--brand); }
.modpick input:disabled + span { cursor: default; }
.modpick input:disabled:not(:checked) + span { opacity: .4; }
.modpick input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }
/* first run, locations page: the company's offices/shops and trucks, each a renamable row */
.loclists { max-height: min(46vh, 420px); overflow-y: auto; margin: 0 -4px 1rem; padding: 0 4px; }
.locsub { margin: -.3rem 0 .5rem; font-size: .78rem; color: var(--muted); }
.loclist.empty { display: none; }
.locgroup { margin: .2rem 0 .45rem; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.loclist { display: grid; gap: .4rem; }
.locrow { display: flex; align-items: center; gap: .55rem; }
.locrow svg { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.locrow .locname { flex: 1; min-height: 40px; }
.locrow .locdel { flex: none; min-height: 40px; width: 40px; padding: 0; font-size: 1.3rem; color: var(--muted); }
.locadd { margin: .35rem 0 .9rem; padding: .3rem .2rem; min-height: 32px; color: var(--brand); font-weight: 600; }
.locadd:hover:not(:disabled) { border-color: transparent; text-decoration: underline; }
/* browsers' autofill paints fields yellow: keep them the card's own colors */
input:-webkit-autofill, input:-webkit-autofill:hover { -webkit-box-shadow: 0 0 0 100px var(--panel) inset; -webkit-text-fill-color: var(--ink); caret-color: var(--ink); }
input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 100px var(--panel) inset, 0 0 0 3px var(--brand-soft); }
.authlede { margin: 0 0 1.1rem; color: var(--muted); font-weight: 600; }
.authbrand span { display: block; }
/* arriving: the logo drops in and settles, the name rises, the card slides up */
.authbrand img { animation: signlogoin 1s cubic-bezier(.2, .9, .3, 1.15) .1s both; }
.authbrand span { animation: signrisein .7s cubic-bezier(.2, .8, .3, 1) .45s both; }
.auth { animation: signcardin .8s cubic-bezier(.2, .85, .25, 1) .6s both; }
@keyframes signlogoin { 0% { opacity: 0; transform: translateY(-28px) scale(.55) rotate(-14deg); }
  60% { opacity: 1; transform: translateY(3px) scale(1.05) rotate(3deg); } 100% { transform: none; } }
@keyframes signrisein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes signcardin { from { opacity: 0; transform: translateY(48px) scale(.96); } to { opacity: 1; transform: none; } }
/* handed off from go.crewtility.app: the logo and name are already there; only the card arrives, dropping in */
html.handoff body { background: transparent; }         /* navy from the first paint, before the sign-in screen is built */
html.handoff .authbrand img, html.handoff .authbrand span { animation: none; }
html.handoff .auth { animation: signdropin .7s cubic-bezier(.2, .85, .25, 1) .05s both; }
html.handoff.setupmode .auth { animation-delay: .5s; }                  /* first run: after the logo has glided over */
@keyframes signdropin { from { opacity: 0; transform: translateY(-34px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .authbrand img, .authbrand span, .auth { animation: none; } }
.auth { max-width: 380px; margin: 0 auto; padding: 1.6rem; border: 0; box-shadow: 0 24px 64px rgba(0, 0, 0, .3); }
.auth h1 { margin-bottom: 1rem; }
.authbrand { display: flex; flex-direction: column; align-items: center; gap: .8rem; margin-bottom: 1.8rem; color: #fff; font-weight: 800;
  font-size: 2.4rem; letter-spacing: -.01em; font-family: var(--head-font); text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.authbrand img { width: 168px; height: 168px; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .45)); }
@media (max-width: 640px) { .authbrand { font-size: 2rem; } .authbrand img { width: 128px; height: 128px; } }
@media (max-height: 760px) {           /* short phones: smaller logo, so every line still fits without scrolling */
  .authbrand { font-size: 1.7rem; gap: .5rem; margin-bottom: 1.1rem; } .authbrand img { width: 88px; height: 88px; }
  .auth { padding: 1.2rem 1.3rem; }
}
@media (max-height: 620px) {           /* SE-size: logo beside the name instead of above it */
  .authbrand { flex-direction: row; justify-content: center; gap: .6rem; margin-bottom: .9rem; font-size: 1.6rem; }
  .authbrand img { width: 48px; height: 48px; }
  .auth h1 { margin-bottom: .6rem; }
}

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  background: var(--navy); color: #fff; padding: .65rem 1.1rem; border-radius: 10px; max-width: calc(100vw - 32px); font-weight: 600;
  box-shadow: 0 8px 24px rgba(18, 24, 51, .25); opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
#toast.bad { background: var(--bad); }

/* ------------------------------------------------------------ labels */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.label { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 8px;
  background: #fff; color: #000; break-inside: avoid; page-break-inside: avoid; }
.label svg { width: 84px; height: 84px; flex: none; }
.label b { display: block; font-size: 13px; line-height: 1.2; }
.label small { color: #333; font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
@media print {
  header#top, #nav, .noprint, #toast { display: none !important; }
  body, main, body.authed main { background: #fff; padding: 0; margin: 0; max-width: none; }
  .labels { grid-template-columns: repeat(3, 1fr); gap: 0; }
  .label { border: 1px dotted #bbb; border-radius: 0; height: 1in; }
}

/* ------------------------------------------------------------ touch + phones
   Techs use this on phones in the field: no iOS zoom on focus, 44px targets, no sideways tables, bottom-sheet dialogs. */
input, select, textarea { font-size: 16px; }
button, a, label, .chip, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
header#top { padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); }
main { padding-top: calc(var(--header-h) + env(safe-area-inset-top) + 20px); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.stepper { display: flex; align-items: stretch; }
.stepper input { text-align: center; border-radius: 0; flex: 1; min-width: 0; font-size: 1.15rem; font-weight: 600; padding-left: .3rem; padding-right: .3rem; -moz-appearance: textfield; appearance: textfield; }   /* − and + do the stepping: no browser arrows eating the digits */
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button { width: 52px; flex: none; font-size: 1.4rem; font-weight: 500; padding: 0; color: var(--ink); }
.stepper button:first-child { border-radius: 6px 0 0 6px; border-right: 0; }
.stepper button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.frost { position: fixed; inset: 0; z-index: 10000; width: auto; height: auto; max-width: none; max-height: none; margin: 0; border: 0; color: inherit; display: grid; place-items: center; padding: 16px; background: rgba(18, 19, 22, .35);
  -webkit-backdrop-filter: blur(7px) saturate(.7); backdrop-filter: blur(7px) saturate(.7); animation: fadein .3s ease-out; }
.frostcard { width: min(360px, 100%); padding: 1.6rem 1.5rem 1.4rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35); text-align: center; }
.frostcard h2 { margin: .9rem 0 .3rem; font-size: 1.15rem; color: var(--ink); }
.frostcard p { margin: 0; color: var(--muted); font-size: .92rem; }
.frostcard .spin { display: inline-block; width: 34px; height: 34px; }

@media (pointer: coarse) {
  button, .btn { min-height: 44px; }
  input, select { min-height: 46px; }
  .chip { min-height: 40px; padding: .3rem 1rem; }
  .seg button { min-height: 42px; padding: .3rem 1rem; }
  .minbtn { min-height: 40px; min-width: 44px; }
  dialog.modal .x { min-width: 44px; min-height: 44px; }
  .check input[type=checkbox] { width: 22px; height: 22px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 1.5rem; }
  .card { padding: 1rem 1.05rem; }
  .actions.fill { display: grid; grid-template-columns: 1fr 1fr; }
  .actions.fill > * { min-height: 52px; font-size: 1rem; }
  #nav a svg { width: 24px; height: 24px; }
  #nav a { font-size: .74rem; }
  /* dialogs become bottom sheets */
  dialog.modal { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 94vh; max-height: 94dvh; }
  dialog.modal form { max-height: 94vh; max-height: 94dvh; }
  dialog.modal footer { padding-bottom: calc(.8rem + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  dialog.modal footer .primary, dialog.modal footer .cancel { flex: 1; min-height: 50px; font-size: 1rem; }
  dialog.modal footer .cancel { border: 1px solid var(--line-strong); color: var(--ink); background: var(--panel); }
  dialog.modal footer .danger { flex-basis: 100%; order: 3; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .bar select { flex: 1 1 140px; }
  #toast { left: 16px; right: 16px; transform: none; text-align: center; }
}

/* ------------------------------------------------------------ version link + changelog */
/* Bottom-left of the sidebar: Admin and the version as two little blocks, side by side (the nav highlight stays above). */
.navfoot { display: flex; align-items: stretch; justify-content: flex-start; gap: 6px; }       /* Admin | Edit List, then version | storage */
#nav .navfoot a, .navfoot .verlink { flex: none; display: inline-flex; align-items: center; gap: .35rem; height: 30px; min-height: 0;
  padding: 0 .6rem; border: 0; border-radius: 6px; background: var(--pill); color: var(--ink); font-size: .76rem; font-weight: 600; }
#nav .navfoot a svg { width: 15px; height: 15px; color: currentColor; }
#nav .navfoot #adminNav { flex: 1 1 0; justify-content: center; font-weight: 800; gap: .45rem; }
#nav .navfoot #adminNav svg { width: 19px; height: 19px; stroke-width: 1.9; }
.navfoot .storemeter { flex: 1 1 auto; width: auto; height: 30px; margin: 0; padding: 0 10px; gap: 4px; }       /* storage fills the row beside the version */
.navfoot .navedit-btn { flex: 1 1 0; width: auto; height: 30px; margin: 0; }
.navfoot .storemeter .smtext span { display: none; }
button.sidever { margin: 0; white-space: nowrap; }
#nav .navfoot a:hover:not(.on), .navfoot .verlink:hover:not(:disabled) { background: var(--line-strong); color: var(--ink); }
#nav .navfoot a.on { background: var(--brand); color: #fff; }
@media (min-width: 900px) {      /* collapsed sidebar only: a saved collapse never touches phones and tablets */
  body.navmini .navfoot { flex-direction: column; align-items: center; }
  body.navmini #nav .navfoot a, body.navmini #nav .navfoot #adminNav, body.navmini .navfoot .verlink, body.navmini .navfoot .navedit-btn { flex: none; justify-content: center; width: 100%; padding: 0; }   /* stacked: each a full 30px box */
  body.navmini .sidever { font-size: .6rem; padding: 0; line-height: 1.15; }
  body.navmini .navfoot .storemeter { width: 100%; flex: none; height: 30px; padding: 0 7px; }
}
@media (max-width: 899px) { .navfoot { display: none; } }
.verlink { border: 0; background: none; min-height: 0; font-size: .74rem; color: var(--muted); }
.morelist + .verlink { display: block; width: 100%; text-align: center; padding: 1rem 0 .2rem; cursor: pointer; }
.changelog section + section { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.changelog h3 { margin: 0 0 .4rem; font-size: 1rem; }
.changelog h3 span { margin-left: .4rem; font-size: .8rem; font-weight: 500; color: var(--muted); }
.changelog ul { margin: 0; padding-left: 1.2rem; }
.changelog li { margin: .2rem 0; line-height: 1.45; }

/* ------------------------------------------------------------ customers */
.custgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.custgrid .card { margin-bottom: 1rem; }
.addr { margin: 0 0 .4rem; line-height: 1.5; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .7rem; }
.locthumb { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex: none; }
.row2b { display: grid; grid-template-columns: 3fr 1fr; gap: .7rem; }
.formsec { font-size: .95rem; margin: 1rem 0 .5rem; }
.linkbtn { border: 0; background: none; min-height: 0; padding: 0; color: var(--link); font: inherit; font-size: inherit; cursor: pointer; }
.linkbtn:hover:not(:disabled) { background: none; text-decoration: underline; }
.custphotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.cph { margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.cph .vcardph { width: 100%; }
.cph figcaption { font-size: .78rem; color: var(--muted); }
.cphpreview { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.cphpreview img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
@media (max-width: 640px) {
  .custgrid, .row3, .row2b { grid-template-columns: 1fr; gap: 0; }
  .custphotos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* a customer's one-line important note */
.custbanner { display: flex; align-items: center; gap: .7rem; margin: .2rem 0 1rem; padding: .8rem 1rem; border-radius: 10px;
  background: var(--brand); color: #fff; font-family: var(--head-font); font-weight: 600; font-size: 1rem; line-height: 1.35; }
.custbanner svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* New customer: pick a type from a small menu under the button */
.dropwrap { position: relative; }
.dropmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 190px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 30px rgba(18, 24, 51, .18); }
.dropmenu button { display: flex; align-items: center; gap: .65rem; justify-content: flex-start; width: 100%; border: 0; background: none;
  padding: .55rem .7rem; min-height: 40px; border-radius: 7px; color: var(--ink); font-weight: 600; text-align: left; }
.dropmenu button:hover:not(:disabled) { background: var(--bg); }
.dropmenu svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
html.anim .dropmenu:not([hidden]) { animation: rise calc(.2s * var(--motion)) cubic-bezier(.2, .7, .3, 1); }
.avatar.sq { border-radius: 9px; }

/* a new person, one section at a time */
.wizsteps { list-style: none; margin: 0 0 1.1rem; padding: 0; display: flex; gap: .4rem; }
.wizsteps li { flex: 1; display: flex; align-items: center; gap: .4rem; padding-top: .55rem; border-top: 3px solid var(--line); color: var(--muted);
  font-size: .78rem; font-weight: 600; font-family: var(--head-font); min-width: 0; }
.wizsteps li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wizsteps b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--muted); font-size: .7rem; flex: none; }
.wizsteps li.on, .wizsteps li.done { border-top-color: var(--brand); color: var(--ink); }
.wizsteps li.on b, .wizsteps li.done b { background: var(--brand); color: #fff; }
html.anim .wizsteps li { transition: border-color calc(.25s * var(--motion)), color calc(.25s * var(--motion)); }
html.anim .wizsec:not([hidden]) { animation: rise calc(.3s * var(--motion)) cubic-bezier(.2, .7, .3, 1); }
.setrow.toggle { padding: .3rem 0 .9rem; }
@media (max-width: 640px) { .wizsteps li span { display: none; } .wizsteps li.on span { display: inline; } }

/* notifications */
.notehead { flex-wrap: wrap; gap: .8rem 1rem; }
.noteright { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.silencechip { display: inline-flex; align-items: center; gap: .55rem; margin: 0; padding: .45rem .8rem; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.silenceopts { display: grid; gap: .5rem; }
.mute { display: none; }
#nav a.silenced .mute { display: inline; stroke-width: 2.2; }
#nav a.silenced svg { color: var(--bad); stroke: var(--bad); }       /* red, struck-through bell: hard to miss */
.silencehead { margin: 0 0 .6rem; font-size: .95rem; }
.silencehours { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.silencehours button { justify-content: center; padding-left: 0; padding-right: 0; white-space: nowrap; }
.silenceor { margin: 1rem 0 .7rem; font-weight: 700; color: var(--muted); font-size: .85rem; }
@media (max-width: 480px) { .silencehours { grid-template-columns: repeat(3, 1fr); } }
.silenceopts button { justify-content: flex-start; text-align: left; }
.noteright > .silencechip, .noteright > #noteSettings, .noteright > #noteHistory {           /* the two header boxes match */
  box-sizing: border-box; height: 46px; min-height: 0; margin: 0; padding: 0 .95rem; display: inline-flex; align-items: center; gap: .55rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none;
  font-family: inherit; font-size: .85rem; font-weight: 500; color: var(--ink); white-space: nowrap; cursor: pointer; }
.noteright > .silencechip:hover, .noteright > #noteSettings:hover, .noteright > #noteHistory:hover { border-color: var(--line-strong); background: var(--panel); }
.notehead #noteSettings svg, .notehead #noteHistory svg { color: var(--brand); width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.notifycard { display: flex; align-items: center; gap: .8rem; margin: 0 0 1rem; padding: .7rem .6rem .7rem 1rem; }
.notifycard .grow { flex: 1; min-width: 0; }
.notifycard .sub { margin-top: .1rem; font-size: .85rem; }
.notifycard .ncbtns { display: flex; gap: .5rem; flex: none; }
.notifycard .ncclose { flex: none; min-height: 0; padding: .1rem .5rem; font-size: 1.2rem; line-height: 1; color: var(--muted); align-self: flex-start; }
.notifyopts { list-style: none; margin: 0; padding: 0; }
.notifyopts li label { display: flex; align-items: center; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.notifyopts .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.notifyopts .badge { margin-left: .35rem; font-size: .68rem; vertical-align: middle; }
.aicon.note-overdue { background: var(--bad-soft); color: var(--bad); }
.aicon.note-soon { background: var(--warn-soft); color: var(--warn); }

/* built but held back on this instance: a frosted sample behind the note */
.frostwrap { position: relative; width: 100%; max-width: 100%; min-width: 0; height: calc(100dvh - var(--header-h) - 32px); min-height: 280px;
  overflow: hidden; contain: layout paint; }
.frosted { width: 100%; max-width: 100%; overflow: hidden; filter: blur(6px) saturate(.8); opacity: .55; pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.frosted .head h1 { visibility: hidden; }             /* the sharp copy below sits exactly here */
.frosttitle { position: absolute; top: 0; left: 0; z-index: 1; margin: 0; }
html.lockedview, html.lockedview body { overflow: hidden; overscroll-behavior: none; }
/* the note itself stays sharp, on top, and centred in whatever is visible */
.frostnote { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1rem; text-align: center; }
.frostnote h1 { margin: 1rem 0 .4rem; }
.frostnote p { margin: 0; color: var(--muted); max-width: 340px; line-height: 1.5; }

/* ------------------------------------------------------------ calendar */
.calbar { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.calbar h2 { margin: 0 .4rem; min-width: 11rem; text-align: center; font-size: 1.15rem; }
.calbar button { min-width: 40px; padding: 0 .7rem; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.calwd { background: var(--panel); padding: .45rem .5rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.calcell { all: unset; box-sizing: border-box; background: var(--panel); min-height: 104px; padding: .35rem .4rem; display: flex; flex-direction: column; gap: 3px;
  cursor: pointer; min-width: 0; }
.calcell:hover { background: var(--bg); }
.calcell.other { background: var(--bg); }
.calcell.other .calnum { opacity: .45; }
.calcell.sel { box-shadow: inset 0 0 0 2px var(--brand); }
.calnum { font-size: .8rem; font-weight: 600; color: var(--text); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.calcell.today .calnum { background: var(--brand); color: #fff; }
.calchip { display: block; font-size: .72rem; line-height: 1.3; padding: 2px 5px; border-radius: 4px; background: var(--brand-soft); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calchip b { font-weight: 700; }
.calchip.renewal { background: var(--warn-soft); }
.calchip.done { opacity: .55; }
.calchip.cancelled { opacity: .45; text-decoration: line-through; }
.calmore { font-size: .7rem; color: var(--muted); padding-left: 4px; }
.caldots { display: none; }
.caltime { width: 7.5rem; flex: none; font-size: .85rem; font-weight: 600; color: var(--text); }
.rowbtn { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; }
@media (max-width: 640px) {
  .calcell { min-height: 54px; align-items: center; padding: .3rem .1rem; }
  .calchip, .calmore { display: none; }
  .caldots { display: flex; gap: 2px; }
  .caldots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
  .caltime { width: 5.5rem; }
  .calbar h2 { min-width: 0; flex: 1; }
}

/* ------------------------------------------------------------ invoicing */
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.invamt { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.invlines td.num, .invlines th.num { text-align: right; white-space: nowrap; }
.invtotals { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1.5rem; max-width: 300px; margin: 1rem 0 0 auto; }
.invtotals dt { color: var(--muted); }
.invtotals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.invtotals .grand { font-weight: 700; font-size: 1.1rem; color: var(--ink); padding-top: .35rem; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ coming-soon modules */
#nav a.soon, .morelist a.soon { color: var(--muted); opacity: .6; }
#nav a.soon svg, .morelist a.soon svg { color: var(--muted); }
#nav a.soon:hover, #nav a.soon.on { opacity: 1; }
.soonicon { display: inline-grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.soonicon svg { width: 52px; height: 52px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ remove a location that isn't empty */
.warnbox { margin: 0 0 .9rem; padding: .75rem .9rem; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand-soft);
  color: var(--ink); line-height: 1.45; }
.warnbox b { display: block; }
.movelist { list-style: none; margin: 0 0 1rem; padding: 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.movelist li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .75rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.movelist li:last-child { border-bottom: 0; }
.movelist small { color: var(--muted); margin-left: .3rem; }
.movelist b { white-space: nowrap; font-weight: 600; }

/* ------------------------------------------------------------ vehicle photos */
.vphotos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.vph { margin: 0; display: flex; flex-direction: column; gap: .3rem; text-align: center; }
.vph figcaption { font-size: .78rem; color: var(--muted); }
.vphbtn { aspect-ratio: 4 / 3; width: 100%; min-height: 0; padding: 0; overflow: hidden; display: grid; place-items: center;
  border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 1.5rem; }
.vphbtn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vphdel { min-height: 0; padding: 0; border: 0; background: none; color: var(--bad); font-size: .75rem; }
/* photo cards across the top of a vehicle's page */
.vstrip { display: flex; gap: .7rem; overflow-x: auto; margin: 0 0 1rem; padding-bottom: 2px; scrollbar-width: thin; }
.vcardph { flex: none; width: 150px; padding: 0; min-height: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  overflow: hidden; text-align: left;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: zoom-in; }
.vcardph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--bg); }
.vcardph span { display: block; min-width: 0; padding: .4rem .6rem; font-size: .78rem; font-weight: 600; color: var(--text); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcardph:hover:not(:disabled) { border-color: var(--brand); background: var(--panel); }
@media (max-width: 640px) { .vcardph { width: 124px; } }

/* full-screen photo viewer */
html.lbopen { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 9, 12, .94); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: calc(56px + env(safe-area-inset-top)) 12px calc(56px + env(safe-area-inset-bottom)); }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; }
.lbcap { position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); margin: 0; text-align: center; color: #e6e7ea;
  font-family: var(--head-font); font-weight: 600; font-size: .9rem; white-space: pre; }
.lightbox button { position: absolute; min-height: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff;
  display: grid; place-items: center; padding: 0; }
.lightbox button:hover:not(:disabled) { background: rgba(255, 255, 255, .24); }
.lbx { top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; font-size: 1.7rem; }
.lbnav { top: 50%; width: 48px; height: 48px; margin-top: -24px; font-size: 2rem; line-height: 1; }
.lbnav.prev { left: 12px; }
.lbnav.next { right: 12px; }
html.anim .lightbox { animation: fadein calc(.25s * var(--motion)) ease-out; }
html.anim .lightbox img { animation: pop calc(.3s * var(--motion)) cubic-bezier(.2, .7, .3, 1); }

/* ------------------------------------------------------------ requests, photos, More menu */
.navcount { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .72rem;
  font-weight: 700; display: inline-grid; place-items: center; margin-left: auto; font-family: var(--head-font); }
#nav a.mobileonly { display: none; }
@media (max-width: 899px) {
  :is(#noteCount, #reqCount).zero { display: none; }
  #nav a.mobileonly { display: flex; }
  .navcount { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }
}
@media (min-width: 900px) { body.navmini .navcount { position: absolute; top: 4px; right: 8px; } }   /* collapsed sidebar only, not the phone bar or More */
.morelist { list-style: none; margin: 0; padding: 0; }
.morelist a { display: flex; align-items: center; gap: .9rem; padding: .9rem .4rem; color: var(--ink); font-weight: 600; font-family: var(--head-font);
  border-bottom: 1px solid var(--line); }
.morelist li:last-child a { border-bottom: 0; }
.morelist .navcount { position: static; margin-left: auto; }
.morelist svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--text); }
.reqstatus { display: inline-block; font-size: .72rem; font-weight: 700; padding: .14rem .55rem; border-radius: 999px; white-space: nowrap; }
.reqstatus.open { background: var(--blue-soft); color: var(--blue); }
.reqstatus.ordered { background: var(--warn-soft); color: var(--warn); }
.reqstatus.arrived { background: #e3f6e8; color: #1e7a3a; }
.reqstatus.done, .reqstatus.cancelled { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.urgent { color: var(--bad); font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: .55rem 0 .55rem 1.1rem; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .9rem; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.timeline li:last-child::before { background: var(--brand); }
.itemhead { display: flex; gap: 1rem; align-items: flex-start; }
.photopair { display: flex; align-items: flex-end; gap: .5rem; flex: none; }
.photobtn.sm img { width: 56px; height: 56px; }
.formopts + .field { margin-top: 1.2rem; }
dialog.itemwiz { width: min(600px, calc(100vw - 24px)); }
@media (min-width: 700px) { dialog.modal.wide { width: min(680px, calc(100vw - 24px)); } }
dialog.itemwiz .body { min-height: 300px; }
dialog.itemwiz .err:not(:empty), dialog.modal .err:not(:empty) { display: flex; align-items: flex-start; gap: .6rem; margin: .8rem 0 0; padding: .75rem .9rem; border-radius: 8px;   /* like the orange notice, in red */
  border: 1px solid var(--bad); background: var(--bad-soft); color: var(--ink); font-weight: 500; line-height: 1.45; text-align: left; }
dialog.itemwiz .err:not(:empty)::before, dialog.modal .err:not(:empty)::before { content: ''; flex: none; width: 20px; height: 20px; margin-top: .1rem; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 21 19.5H3z'/%3E%3Cpath d='M12 10v4.5M12 17.2v.3'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 21 19.5H3z'/%3E%3Cpath d='M12 10v4.5M12 17.2v.3'/%3E%3C/svg%3E") center / contain no-repeat; }
#levelWarn { display: flex; align-items: flex-start; gap: .6rem; margin-top: .4rem; }
#levelWarn b { display: inline; }
.stopbox { display: flex; align-items: flex-start; gap: .6rem; margin-top: .4rem; padding: .8rem 1rem; border-radius: 8px; border: 1px solid var(--bad);
  background: var(--bad-soft); color: var(--bad); font-weight: 700; line-height: 1.45; }
.stopbox svg { flex: none; width: 20px; height: 20px; margin-top: .1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#levelWarn span { line-height: 1.45; }
#levelWarn svg { flex: none; width: 20px; height: 20px; margin-top: .1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.distcalc { display: flex; flex-direction: column; gap: .8rem; }
.disttop { display: grid; grid-template-columns: 1fr 1fr; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }   /* Total Available | Needs Distributed */
.disttop > div { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; padding: .8rem 1rem; min-width: 0; }
.disttop > div + div { border-left: 1px solid var(--line); }
.disttop b { font-size: 1.4rem; color: var(--ink); white-space: nowrap; }
.disttop b.ok { color: var(--ok); }
.disttop b.over { color: var(--bad); }
@media (max-width: 560px) { .disttop > div { flex-direction: column; gap: .1rem; } }
.disttop small { font-size: .8rem; color: var(--muted); font-weight: 500; }
.distlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.distlist li { display: flex; align-items: center; gap: .8rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.distlist li .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.distlist li small { color: var(--muted); font-size: .8rem; }
.distlist .stepper { flex: none; width: 190px; }
.distall { flex: none; min-height: 0; height: 40px; padding: 0 .9rem; font-weight: 600; }
.distall + .distall { margin-left: -.4rem; }          /* All and Half sit together */
.distall[data-all] { width: 10.5rem; }                /* All / Remaining (n): one width, so every line lines up */
.distall:disabled { opacity: .45; }
.diststatus { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.6rem; padding: .6rem 1rem; border-radius: 10px;
  background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.diststatus.ok { background: var(--ok-soft); color: var(--ok); }
.diststatus.over { background: var(--bad-soft); color: var(--bad); }
.diststatus svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.partphotos { display: flex; flex-direction: column; gap: .8rem; }
.partthumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.partphoto { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.partphoto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.partphotoadd { width: 100%; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--muted); font-size: .9rem; }
.partphotoadd:hover { color: var(--ink); border-color: var(--brand); }
.partphotoadd svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.partphotodel { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.1rem; line-height: 1; }
.photobtn { padding: 0; border: 0; background: none; min-height: 0; border-radius: 10px; overflow: hidden; flex: none; box-shadow: var(--shadow); }
.photobtn img, .photo-empty { width: 96px; height: 96px; object-fit: cover; display: block; border-radius: 10px; }
.photo-empty { display: grid; place-items: center; border: 1.5px dashed var(--line-strong); color: var(--muted); font-size: .78rem; text-align: center;
  background: var(--panel); font-family: var(--head-font); line-height: 1.2; padding: 6px; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; background: var(--bg); }
.bigphoto { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; background: var(--bg); }
.money { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .photobtn img, .photo-empty { width: 76px; height: 76px; } }
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.photogrid:empty { display: none; }
.pic { position: relative; padding: 0; border: 0; background: none; min-height: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 1; display: block; }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picx { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; border: 0; font-size: 1.1rem; line-height: 1; }
.modrow { display: flex; align-items: center; gap: 1rem; padding: .8rem .1rem; cursor: pointer; }
.modrow .title { display: block; }
.modrow .sub { display: block; }
.modrow.child { padding-left: 1.6rem; }
.setrow { padding: .1rem 0 1rem; }
.setrow .grow { flex: 1; }
.setrow .title { font-weight: 600; color: var(--ink); }
.setrow .sub { color: var(--muted); font-size: .84rem; }
.switch { appearance: none; -webkit-appearance: none; width: 48px !important; height: 28px !important; min-height: 0; border-radius: 999px; flex: none;
  background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; border: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .45; cursor: default; }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ------------------------------------------------------------ admin hub */
.crumb { display: inline-block; margin-bottom: .5rem; font-weight: 600; font-family: var(--head-font); font-size: .9rem; }
.agroup { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.5rem 0 .6rem; }
.agroup:first-of-type { margin-top: .4rem; }
.agrouphead { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; margin: 1.5rem 0 .6rem; }    /* a section title with its own button at the far right */
.agrouphead .agroup { margin: 0 0 .15rem; }
.head + .agrouphead { margin-top: .4rem; }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .8rem; }
.atile { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid transparent; color: inherit; transition: border-color .12s, transform .12s; }
.atile:hover { border-color: var(--line-strong); }
.atile:active { transform: scale(.99); }
/* dark themes: a hairline round cards and tiles. Kept as weak as .card (:where) and after the base rules, so urgency bars and hovers still win */
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme])) :is(.card, .tablewrap, .tile, .atile) { border-color: var(--line); } }
:where(:root:is([data-theme="dark"], [data-theme="grey"])) :is(.card, .tablewrap, .tile, .atile) { border-color: var(--line); }
.aicon { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.aicon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aicon.sm { width: 36px; height: 36px; border-radius: 9px; }
.aicon.sm svg { width: 19px; height: 19px; }
.atitle { display: block; font-family: var(--head-font); font-weight: 600; color: var(--ink); }
.asub { display: block; font-size: .86rem; color: var(--muted); }
.astatus { display: inline-block; margin-top: .35rem; font-size: .78rem; font-weight: 600; color: var(--text); background: var(--bg);
  border-radius: 999px; padding: .1rem .55rem; }
.avatar.sm { width: 36px; height: 36px; font-size: .78rem; flex: none; }
@media (max-width: 640px) { .agrid { grid-template-columns: 1fr; gap: .6rem; } .atile { padding: .85rem .95rem; } }

.licensee { display: flex; align-items: center; gap: .7rem; min-width: 0; padding-left: .2rem; }
.liclogo { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; flex: none; }
.lictext { display: flex; flex-direction: column; justify-content: center; line-height: 1.25; min-width: 0; }
.logoprev { width: 96px; height: 96px; object-fit: contain; border-radius: 10px; background: var(--bg); }
.licensee b, .licdays b { font-family: var(--head-font); font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.lictext > span { font-family: var(--head-font); font-size: 1rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.licdays { padding-left: 1rem; border-left: 1px solid var(--line); }
.licdays.warn > span { color: var(--brand); }
.licdays.over b, .licdays.over > span { color: var(--bad); }
@media (max-width: 899px) {            /* phones and tablets: just the company logo, centred in the header */
  .lictext { display: none; }
  .licensee { position: absolute; left: 50%; transform: translateX(-50%); padding-left: 0; }
  .liclogo { width: 38px; height: 38px; }
}

:root { --motion-screen: 1; --motion-speed: 1; --motion: calc(var(--motion-screen) * var(--motion-speed)); }
@media (min-width: 900px) { :root { --motion-screen: 1.8; } }      /* wide screens move slower: Ev's "normal" */
html.anim-fast { --motion-speed: .6; }
html.anim-slow { --motion-speed: 1.5; }

/* ------------------------------------------------------------ motion
   Only with html.anim: on for the shop (Admin → Appearance) and not turned off by the person. Pages ease in when you
   open them (not when they refresh after a save), lists and tiles follow in a short stagger, dialogs rise. */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes sheet { from { transform: translateY(100%); } }
html.anim main.enter > * { animation: rise calc(.425s * var(--motion)) cubic-bezier(.2, .7, .3, 1) both; }
html.anim main.enter > :nth-child(2) { animation-delay: calc(.05s * var(--motion)); }
html.anim main.enter > :nth-child(3) { animation-delay: calc(.1s * var(--motion)); }
html.anim main.enter > :nth-child(4) { animation-delay: calc(.15s * var(--motion)); }
html.anim main.enter > :nth-child(n+5) { animation-delay: calc(.2s * var(--motion)); }
html.anim main.enter > .holds-stagger:not(.stagger) { animation: none; }       /* its cards come in one by one instead */
html.anim main.enter .card.stagger { animation: rise calc(.4s * var(--motion)) cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: calc(var(--cd) * var(--motion)); }
html.anim main.enter :is(.list, .agrid, .tiles) > :nth-child(-n+100) { animation: rise calc(.4s * var(--motion)) cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(.275s * var(--motion)); }   /* past the first screenfuls, rows just appear: a long list never starts thousands of animations */
html.anim main.enter :is(.list, .agrid, .tiles) > :nth-child(1) { animation-delay: calc(.1s * var(--motion)); }
html.anim main.enter :is(.list, .agrid, .tiles) > :nth-child(2) { animation-delay: calc(.138s * var(--motion)); }
html.anim main.enter :is(.list, .agrid, .tiles) > :nth-child(3) { animation-delay: calc(.175s * var(--motion)); }
html.anim main.enter :is(.list, .agrid, .tiles) > :nth-child(4) { animation-delay: calc(.213s * var(--motion)); }
html.anim main.enter :is(.list, .agrid, .tiles) > :nth-child(5) { animation-delay: calc(.25s * var(--motion)); }
html.anim main.enter tbody tr:nth-child(-n+100) { animation: fadein calc(.5s * var(--motion)) ease-out both; animation-delay: calc(.125s * var(--motion)); }
html.anim dialog.modal[open] { animation: pop calc(.3s * var(--motion)) cubic-bezier(.2, .7, .3, 1); }
html.anim dialog.modal[open]::backdrop { animation: fadein calc(.3s * var(--motion)) ease-out; }
html.anim #licensee:not([hidden]), html.anim .avatar img, html.anim img.thumb, html.anim .bigphoto { animation: fadein calc(.5s * var(--motion)) ease-out; }
html.anim #toast { translate: 0 12px; transition: opacity calc(.25s * var(--motion)), translate calc(.35s * var(--motion)) cubic-bezier(.2, .7, .3, 1); }
html.anim #toast.show { translate: 0 0; }
html.anim #nav a, html.anim :is(button, .btn, .tile, .chip) { transition: background-color calc(.188s * var(--motion)), border-color calc(.188s * var(--motion)), color calc(.188s * var(--motion)), box-shadow calc(.188s * var(--motion)), transform calc(.15s * var(--motion)); }
html.anim :is(button, .btn):active:not(:disabled) { transform: scale(.97); }
html.anim .switch::after { transition: transform calc(.225s * var(--motion)) cubic-bezier(.2, .7, .3, 1); }
@media (max-width: 640px) {
  html.anim dialog.modal[open] { animation: sheet calc(.375s * var(--motion)) cubic-bezier(.2, .8, .3, 1); }
}
/* Nav highlight: one pill that glides to the selected section, and follows the mouse on desktop. */
.navpill { display: none; }
html.anim .navpill { display: block; position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; opacity: 0;
  border-radius: 8px; background: var(--pill); }
html.anim .navpill.glide { transition: transform calc(.45s * var(--motion)) cubic-bezier(.3, .8, .25, 1), width calc(.45s * var(--motion)) cubic-bezier(.3, .8, .25, 1),
  height calc(.45s * var(--motion)) cubic-bezier(.3, .8, .25, 1), opacity calc(.25s * var(--motion)); }
html.anim #nav a { z-index: 1; }
@media (min-width: 900px) {
  html.anim #nav > a.on, html.anim #nav > a:hover:not(.on) { background: transparent; }
}
@media (max-width: 899px) {             /* bottom bar: a short orange bar along the top edge */
  html.anim .navpill { border-radius: 0 0 3px 3px; background: var(--brand); }
}
@media (prefers-reduced-motion: reduce) {         /* the device asked for less motion: honour it */
  html.anim *, html.anim *::before, html.anim *::after, html.anim ::backdrop { animation: none !important; transition: none !important; }
}

/* phones (up to the big Pro Max / Plus sizes): the longer product name, the company logo, clock and initials all fit across the top */
@media (max-width: 480px) {
  .brand { padding: 0 10px; gap: .4rem; font-size: 1rem; }
  .brand .mark { width: 28px; height: 28px; }
  header#top { gap: .6rem; padding-right: 12px; }
  .who { padding-left: 10px; }
  .adminlink { display: none !important; }          /* Admin is in More on phones */
}

/* sign-in screen: "Crewtility Suite | v1.3.3 | Self-Hosted Edition" under the button */
.authedition { margin: 1rem 0 0; text-align: center; font-size: .78rem; color: var(--muted); letter-spacing: .01em; }
.fixedcode { background: var(--bg) !important; color: var(--muted) !important; cursor: not-allowed; letter-spacing: .04em; }

/* sign-in: each line slides down from behind the one above once that one is filled in */
.authstep { display: grid; grid-template-rows: 0fr; opacity: 0; transform: translateY(-18px); position: relative; z-index: 0;
  transition: grid-template-rows .5s cubic-bezier(.2, .8, .3, 1), opacity .35s ease-out .08s, transform .5s cubic-bezier(.2, .8, .3, 1); }
.authstep > div { overflow: hidden; min-height: 0; padding: 3px; margin: -3px; }
.authstep.show { grid-template-rows: 1fr; opacity: 1; transform: none; }
.authstep .field { padding-bottom: .1rem; }
@media (prefers-reduced-motion: reduce) { .authstep { transition: none; } }
/* sign-in: the pretend company lookup under the code field (spinner -> drawn check) */
.lookup { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .4s cubic-bezier(.2, .8, .3, 1), opacity .3s; }
.lookup > div { overflow: hidden; min-height: 0; display: flex; align-items: center; gap: .65rem; }
.lookup.busy { grid-template-rows: 1fr; opacity: 1; }
.lookup .spin { position: relative; flex: none; width: 26px; height: 26px; margin: .55rem 0 .35rem .1rem; }
.lookup .spin::before { content: ''; position: absolute; inset: 0; transition: opacity .2s, scale .3s; }
.lookup .spin svg { opacity: 0;  position: absolute; inset: -2px; fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 22; stroke-dashoffset: 22; }
.lookup.done .spin::before, .lookup.bad .spin::before { opacity: 0; scale: 1.6; }
.lookup.done .spin .ck, .lookup.bad .spin .x { opacity: 1; animation: lookcheck .35s cubic-bezier(.3, 1.4, .5, 1) forwards, lookpop .45s cubic-bezier(.3, 1.6, .5, 1); }
.lookup .looktext { font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; transition: opacity .25s;
  background: linear-gradient(90deg, var(--muted) 30%, var(--ink) 50%, var(--muted) 70%) 0 0 / 250% 100%; -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; animation: lookshine 1.4s linear infinite; }
.lookup.done .looktext { opacity: 0; }
.lookup .spin .x { stroke: var(--bad); stroke-dasharray: 15; stroke-dashoffset: 15; }
.lookup.bad .looktext { animation: none; background: none; -webkit-text-fill-color: var(--bad); color: var(--bad); }
input.notfound { border-color: var(--bad) !important; box-shadow: 0 0 0 4px var(--bad-soft) !important; animation: lookshake .45s; }
@keyframes lookshake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
/* ...and once the check lands, Username slides out to the right from that spot */
.authstep.fromlook { transform: none; transition: grid-template-rows .35s cubic-bezier(.2, .8, .3, 1), opacity .2s; }
.authstep.fromlook > div { clip-path: inset(0 100% 0 0); transition: clip-path .65s cubic-bezier(.25, .9, .3, 1) .12s; }
.authstep.fromlook .field { transform: translateX(-40px); transition: transform .65s cubic-bezier(.25, .9, .3, 1) .12s; }
.authstep.fromlook.show > div { clip-path: inset(0); }
.authstep.fromlook.show .field { transform: none; }
input.looking { border-color: var(--brand) !important; animation: lookglow 1.1s ease-in-out infinite; }
input.found { border-color: var(--ok) !important; box-shadow: 0 0 0 4px var(--ok-soft) !important; transition: border-color .3s, box-shadow .6s; }
@keyframes lookcheck { to { stroke-dashoffset: 0; } }
@keyframes lookpop { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } }
@keyframes lookshine { to { background-position: -250% 0; } }
@keyframes lookglow { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 22%, transparent); } }
/* the sign-in screen isn't a document: no selecting its text or dragging its images (fields still select normally) */
body.signin, body.signin img { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
body.signin input { -webkit-user-select: text; user-select: text; }

/* audit log: live -- a pulsing dot by the title, and new rows glow in */
.livedot { display: inline-block; width: 9px; height: 9px; margin-left: .35rem; vertical-align: middle; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok); animation: livepulse 2s ease-out infinite; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
tr.fresh > td, li.fresh { animation: freshrow 3s ease-out; }
@keyframes freshrow { from { background: var(--brand-soft); } }

/* vehicle problems: a flag on the card, a section on the vehicle page, a red-ish badge on Vehicles in the menu */
.issueflag { display: flex; align-items: center; gap: .45rem; padding: .45rem .65rem; border-radius: 8px; background: var(--warn-soft); color: var(--warn);
  font-size: .85rem; font-weight: 600; }
.issueflag.urgent { background: var(--bad-soft); color: var(--bad); }
.issueflag svg, .vicon.issue svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vicon.issue { color: var(--warn); background: var(--warn-soft); }
.vicon.issue.urgent { color: var(--bad); background: var(--bad-soft); }
.fixedissues { margin-top: .6rem; }
.fixedissues summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.navcount.urgent { background: var(--bad); color: #fff; }

/* Vehicles: a pointer to Admin -> Locations (the office and trucks are managed there) */
.locbanner { display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem; padding: .6rem .9rem; border-radius: var(--radius);
  background: var(--blue-soft); color: var(--text); font-size: .9rem; text-decoration: none; }
.locbanner:hover { background: var(--pill); }
.locbanner b { color: var(--link); font-weight: 600; }
.locbanner svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* vehicle page: Report a problem sits with Log gas / Log service, filled red so it stands apart */
.actions.fill > button.problembtn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  background: #d92d20; border-color: #d92d20; color: #fff; font-weight: 600; }   /* one deep red in every theme, so white text reads */
.actions.fill > button.problembtn:hover { background: #b42318; border-color: #b42318; }
.problembtn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Storage meter: bottom left, under Admin and the version (admins). Click for what it's spent on. */
.storemeter { flex: none; display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 6px; width: 100%;
  margin-top: 8px; padding: 9px 10px; min-height: 0; border: 0; border-radius: 6px; background: var(--pill); color: var(--muted);
  font-size: .72rem; line-height: 1.2; text-align: center; cursor: pointer; }
.storemeter:hover { background: var(--line-strong); }
.storemeter .smtext { display: flex; justify-content: center; align-items: baseline; gap: .45rem; }
.storemeter .smtext b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.smbar, .storestack { display: flex; height: 5px; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--ink) 14%, transparent); }
.smbar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.smbar.high i { background: var(--warn); }
.smbar.full i { background: var(--bad); }
@media (min-width: 900px) {      /* collapsed sidebar only: More on a phone keeps the text */
  body.navmini .storemeter { padding: 6px 5px; }
  body.navmini .storemeter .smtext { display: none; }             /* collapsed: just the bar */
}
.storemeter.inmore { margin: .8rem 0 0; }
.storebig { margin: 0 0 .7rem; color: var(--muted); }
.storebig b { font-size: 1.5rem; color: var(--ink); margin-right: .2rem; }
.storestack { height: 10px; margin-bottom: 1rem; }
.storestack i { display: block; height: 100%; }
.storelist { list-style: none; margin: 0; padding: 0; }
.storelist li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.storelist li:first-child { border-top: 0; }
.storelist .grow { flex: 1; }
.storelist .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.storelist .storefree .dot { border: 1px solid var(--line-strong); }
.storelist small { color: var(--muted); }

/* storage window: backups' own allocation; Backups page: the schedule and its storage estimate */
.storehead { margin: 1.4rem 0 .5rem; font-size: 1rem; }
.dayseg { display: flex; flex-wrap: wrap; }
.dayseg label { flex: 1; min-width: 0; margin: 0; position: relative; }
.dayseg label + label span { border-left: 1px solid var(--line-strong); }
.dayseg input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.dayseg span { display: block; text-align: center; padding: .5rem .2rem; font-size: .85rem; color: var(--muted); }
.dayseg input:checked + span { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.schedcalc { margin: .9rem 0; padding: .8rem .9rem; border-radius: 8px; background: var(--bg); display: grid; gap: .3rem; font-size: .9rem; }
.schedcalc.over { background: var(--warn-soft); }
.schedcalc b { color: var(--ink); }

/* Deleted / Removed pages: the 30-day note */
.purgenote { margin: -.4rem 0 1rem; color: var(--muted); font-size: .88rem; }

/* vehicle page: Dealership / Mechanic, Roadside Assistance, Warranty Information -- numbers are tap-to-call links */
.contactkv { margin: .2rem 0 0; grid-template-columns: 7.5rem 1fr; row-gap: .55rem; }
.tellink { display: inline-flex; align-items: center; gap: .4rem; color: var(--link); font-weight: 600; text-decoration: none; }
.tellink:hover { text-decoration: underline; }
.tellink svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* Files: browser on the left, viewer on the right (stacked on phones) */
.filespane { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 1rem; align-items: stretch; }   /* files big, preview beside */
@media (max-width: 899px) { .filespane { grid-template-columns: 1fr; } }
.fbrowser { position: relative; margin: 0; min-height: calc(100dvh - var(--header-h) - 150px); }
.ftabs { display: flex; max-width: 460px; margin-bottom: .8rem; }
.ftabs button { flex: 1; white-space: nowrap; padding: .3rem .45rem; font-size: .82rem; }
.fbar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; font-size: .88rem; }
.fbar .actions { margin: 0; }
.fcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; min-width: 0; }
.fcrumbs a { color: var(--link); text-decoration: none; }
.fcrumbs span { color: var(--muted); }
.flist { list-style: none; margin: 0; padding: 0; }
.flist li { display: flex; align-items: center; gap: .65rem; padding: .55rem .5rem; border-radius: 8px; cursor: pointer; }
.flist li:hover { background: var(--bg); }
.flist li.on { background: var(--brand-soft); }
.flist .grow { min-width: 0; }
.flist .fname { display: block; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flist small { color: var(--muted); font-size: .78rem; }
.ficon svg, .fnopreview svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; }
.ficon.folder svg { stroke: var(--brand); fill: var(--brand-soft); }
.fmore { min-height: 0; padding: .1rem .5rem; font-size: 1.1rem; }
.fdrophint { display: none; position: absolute; inset: 0; border: 2px dashed var(--brand); border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 85%, transparent); align-items: center; justify-content: center; font-weight: 600; color: var(--brand); }
.fbrowser.dragging .fdrophint { display: flex; }
.fviewer { margin: 0; min-height: calc(100dvh - var(--header-h) - 150px); display: flex; flex-direction: column; }
@media (max-width: 899px) { .fbrowser, .fviewer { min-height: 0; } }
.fvhead h2 { margin: 0; word-break: break-word; }
.fvhead .sub { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.fvactions { margin: .8rem 0 1rem; flex-wrap: wrap; }
.fframe { width: 100%; flex: 1; min-height: 60vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.fimg { max-width: 100%; max-height: 70vh; border-radius: 8px; display: block; }
.ftext { max-height: 70vh; overflow: auto; padding: .8rem; border-radius: 8px; background: var(--bg); font-size: .82rem; white-space: pre-wrap; word-break: break-word; }
.fnopreview { display: grid; place-items: center; gap: .4rem; padding: 3rem 1rem; color: var(--muted); text-align: center; }
.fnopreview svg { width: 48px; height: 48px; }
.fpick { padding: 3rem 1rem; text-align: center; }

/* Edit menu: drag handle, arrows, show/hide; a line where the phone's bottom bar ends */
#nav a.userhidden { display: none !important; }
/* Edit List (the menu): the button beside Admin at the bottom of the sidebar; .navfoot sizes it */
.navedit-btn { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 0;
  padding: 0 .6rem; border: 0; border-radius: 6px; background: var(--pill); color: var(--ink); font-size: .78rem; font-weight: 600;
  font-family: var(--head-font); cursor: pointer; }
.navedit-btn:hover { background: var(--line-strong); }
.navedit-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
/* the bottom of the menu (Edit, Admin, storage, version) stays put; a long menu scrolls above it */
.navbottom { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
@media (min-width: 900px) {
  #nav { padding-bottom: var(--navbottom-h, 170px); overscroll-behavior: contain; scrollbar-width: none; }
  #nav::-webkit-scrollbar { display: none; }
  .navbottom { position: fixed; left: 0; bottom: 0; z-index: 16; width: var(--side-w); padding: 8px 14px 14px; background: var(--panel);
    border-right: 1px solid var(--line); transition: width .15s; }
  body.navmini .navbottom { width: var(--side-mini); }
}
@media (max-width: 899px) { .navbottom { display: contents; } }
body.navmini .navedit-btn span { display: none; }
.navedit { list-style: none; margin: 0; padding: 0; }
.navedit li { display: flex; align-items: center; gap: .55rem; padding: .45rem .3rem; border-bottom: 1px solid var(--line); background: var(--panel); touch-action: none; }
.navedit li.fixed { color: var(--muted); }
.navedit li.fixed .handle { visibility: hidden; }
.navedit .swspace { flex: none; width: 48px; margin: 0 3px 0 4px; }          /* lines Home and Notifications up with the switches */
.navedit li.morehead { padding: .9rem .3rem .4rem; border-bottom: 1px solid var(--line-strong); font-weight: 700; font-size: .85rem; color: var(--ink); touch-action: auto; }
.navedit li.morehead small { font-weight: 400; color: var(--muted); margin-left: .4rem; }
.navedit li.morehead:last-child { flex-wrap: wrap; padding-bottom: .6rem; }            /* More is empty: room to drop into it */
.navedit li.morehead:last-child::after { content: "Drag items here"; flex-basis: 100%; margin-top: .5rem; padding: .9rem; border: 1px dashed var(--line-strong);
  border-radius: 8px; text-align: center; font-weight: 400; color: var(--muted); }
.navedit li.tucked .grow, .navedit li.tucked .ni { opacity: .7; }
.navedit li.off .grow, .navedit li.off .ni, .navedit li.off .tomore { opacity: .35; }
.navedit .tomore { min-height: 0; padding: .2rem .6rem; font-size: .75rem; white-space: nowrap; border: 1px solid var(--line-strong); border-radius: 999px; }
.navedit li.barend { position: relative; border-bottom: 2px solid var(--brand); }
.navedit li.barend::after { content: "phone bar ends"; position: absolute; right: .4rem; bottom: -.62rem; padding: 0 .35rem; background: var(--panel);
  font-size: .66rem; color: var(--brand); white-space: nowrap; }
.navedit li.dragging { background: var(--brand-soft); box-shadow: var(--shadow); }
.navedit .grow { flex: 1; min-width: 0; }
.navedit .handle { cursor: grab; color: var(--muted); font-size: 1.1rem; padding: .2rem .35rem; touch-action: none; user-select: none; }
.navedit .ni svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.navedit .mv { min-height: 0; padding: .15rem .45rem; font-size: .7rem; color: var(--muted); }

/* Filter bars: search on its own line, chips under it (scroll sideways on phones) */
.filters { display: grid; gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 900px) { .filters { grid-template-columns: minmax(260px, 1fr) auto; align-items: center; } }
.searchbox { position: relative; display: block; margin: 0; }
.searchbox svg { position: absolute; left: .8rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted);
  stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.searchbox input { width: 100%; padding-left: 2.4rem; }
.chiprow { display: flex; gap: .45rem; align-items: center; }
@media (max-width: 899px) {
  .chiprow { overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; -webkit-overflow-scrolling: touch; }
  .chiprow::-webkit-scrollbar { display: none; }
}
.chip.chipsel, .chip.chiptog { position: relative; flex: none; display: inline-flex; align-items: center; margin: 0; height: 38px; min-height: 38px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel); color: var(--text); font-size: .88rem; white-space: nowrap; }
.chip.chipsel { padding: 0; }
.chipsel select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; height: 100%; min-height: 0; width: auto;
  padding: 0 1.9rem 0 .9rem; color: inherit; font: inherit; cursor: pointer; }
.chipsel::after { content: ""; position: absolute; right: .8rem; top: 50%; width: 6px; height: 6px; margin-top: -5px; border: solid currentColor;
  border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); opacity: .6; pointer-events: none; }
.chiptog { padding: 0 .95rem; cursor: pointer; }
.chiptog input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; margin: 0; }
.chiptog span { display: inline-flex; align-items: center; gap: .3rem; }
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.chiptog input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 4px; }

/* the sidebar's More dropdown: items tucked away by Edit, closed until opened */
.navmore-btn { flex: none; display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 0; padding: .62rem .8rem; font-size: .92rem !important; border: 0; border-radius: 8px;
  background: none; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.navmore-btn:hover { background: var(--pill); color: var(--ink); }
.navmore-btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.navmore-btn .caret { width: 16px; height: 16px; margin-left: auto; transition: transform .2s; }
#nav.moreopen .navmore-btn .caret { transform: rotate(180deg); }
@media (min-width: 900px) { #nav:not(.moreopen) > a.inmoregroup { display: none; } }
@media (max-width: 899px) { .navmore-btn { display: none !important; } }
body.navmini .navmore-btn span, body.navmini .navmore-btn .caret { display: none; }
body.navmini .navmore-btn { justify-content: center; padding: .55rem 0; }


/* Notifications: a strip of counts (tap one to jump to it), then the sections by urgency; two columns on a wide screen */
.notesum { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.2rem; }
.notetile { display: flex; align-items: baseline; gap: .5rem; min-height: 0; padding: .6rem .9rem; border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: var(--radius); background: var(--panel); color: var(--ink); font-weight: 600; cursor: pointer; }
.notetile:hover { border-color: var(--line-strong); }
.notetile b { font-size: 1.25rem; font-family: var(--head-font); }
.notetile.now { border-left-color: var(--bad); }
.notetile.now b { color: var(--bad); }
.notetile.soon { border-left-color: #efbb06; }
.notetile.soon b { color: #d9a500; }
.notesecs { display: flex; flex-direction: column; gap: 1.1rem; }       /* one column, most urgent first: tables get the full width */
.notesecs > .card { margin: 0; scroll-margin-top: calc(var(--header-h) + 16px); }
.notesecs > .ordercard { border-top-width: 3px; border-top-style: solid; }
.ordercard.now .count { border-color: var(--bad); color: var(--bad); }
.notesecs > .card.flash { animation: noteflash 1.2s ease; }
@keyframes noteflash { 0%, 40% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent); } 100% { box-shadow: none; } }
.vfacts { display: grid; grid-template-columns: auto 1fr; gap: .25rem .7rem; margin: .7rem 0 0; font-size: .85rem; }
.vfacts dt { color: var(--muted); }
.vfacts dd { margin: 0; }
.vfacts dd small { color: var(--muted); }
.loadcell { width: 1%; white-space: nowrap; text-align: right; }
.loadcell button { min-width: 7rem; }
.trucktable tr.truckrow th { padding-top: 1.1rem; font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--ink); background: none; }
.trucktable tr.truckrow:first-child th { padding-top: .5rem; }
.trucktable tr.truckrow th small { margin-left: .4rem; color: var(--muted); font-weight: 500; }
@media (max-width: 560px) {          /* phones: the name on its own line, the buttons and count under it */
  .distlist li { flex-wrap: wrap; }
  .distlist li .grow { flex-basis: 100%; }
  .distlist .stepper { flex: 1; width: auto; }
  .distall[data-all] { width: auto; }
}
.marginbox { margin-top: .4rem; }
.minispin { display: inline-block; width: 18px; height: 18px; vertical-align: middle; }
/* item page: a short subtitle, suppliers as chips, then price / cost / margin / levels as dark tiles */
.itemsub { margin-top: .15rem; }
.supchips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.supchip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .7rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel);
  color: var(--link); font-size: .85rem; font-weight: 600; text-decoration: none; }
a.supchip:hover { border-color: var(--link); }
span.supchip { color: var(--ink); }
.itemfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; margin: 0 0 1rem; }
.itemfacts > div { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .9rem; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }   /* cards, like the table below */
.itemfacts .facthead { display: flex; align-items: center; justify-content: space-between; gap: .4rem; min-height: 22px; font-size: .95rem; color: var(--muted); }
.itemfacts b { font-size: 1.6rem; color: var(--ink); white-space: nowrap; }
.factvals { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem .8rem; }
.factvals i { width: 1px; height: 1.5rem; background: var(--line-strong); }      /* cost | margin */
.itemfacts b.ok { color: var(--ok); }
.itemfacts b.over { color: var(--bad); }
.itemfacts small { font-size: .85rem; color: var(--muted); }
.thumbcol { width: 1%; padding-top: .35rem !important; padding-bottom: .35rem !important; }
.stockthumb { display: block; width: 52px; height: 52px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--bg); }
.itemfacts b.masked { letter-spacing: .12em; color: var(--muted); }
.eyebtn { display: grid; place-items: center; width: 36px; height: 30px; margin: -4px -6px -4px 0; min-height: 0; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.eyebtn:hover, .eyebtn[aria-pressed="true"] { color: var(--ink); }
.eyebtn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* the eye on Our Cost & Margin: a real button (orange outline, fills while showing) */
.eyebtn[data-eye] { width: 44px; height: 34px; margin: -6px -6px -6px 0; border: 1.5px solid var(--brand); color: var(--brand); background: var(--brand-soft); }
.eyebtn[data-eye]:hover { background: var(--brand); color: #fff; }
.eyebtn[data-eye][aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.eyebtn[data-eye] svg { width: 24px; height: 24px; }
.recvmargin { margin: .2rem 0 .9rem; }
.thumbslot { flex: none; width: 52px; }
.thumbslot:empty { display: block; height: 1px; }
.edsec { margin: 1.2rem 0 .7rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); font-size: 1rem; }      /* a section heading inside a form */
.edsec:first-child { margin-top: 0; }
.edsec small { color: var(--muted); font-weight: 500; }
dialog.modal > form > .err:not(:empty) { margin: 0 1.2rem 1rem; }      /* a dialog's error sits between its fields and its buttons */
.trashbtn { display: grid; place-items: center; width: 44px; padding: 0; margin-left: .5rem; }     /* the delete-for-good can beside Restore */
.trashbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.serialgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem .8rem; max-height: 40vh; overflow: auto; padding: .1rem; }
.serialrow { display: flex; align-items: center; gap: .5rem; margin: 0; }
.serialrow > b { flex: none; width: 1.6rem; text-align: right; color: var(--muted); font-size: .85rem; }
.serialrow > input, .serialrow > .withbtn { flex: 1; min-width: 0; }
.noteright > #noteHistory { text-decoration: none; }

/* Use: Defective / Loss / Damaged, red, on the left of the footer */
dialog.modal footer .writeoffs { display: flex; gap: .4rem; margin-right: auto; }
.badbtn { background: #dc2626; border-color: #dc2626; color: #fff; font-weight: 600; }       /* a true red, in light and dark */
.badbtn:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
@media (max-width: 899px) { dialog.modal footer .writeoffs { flex-basis: 100%; order: 3; margin: 0; } dialog.modal footer .writeoffs .badbtn { flex: 1; min-height: 44px; } }
/* an item's history: the trash can on the right of a row */
.mv li.mvdel { display: flex; align-items: center; gap: .5rem; }
.mv li.mvdel > .grow { flex: 1 1 auto; min-width: 0; }
.mv li.mvdel .trashbtn { flex: none; height: 36px; width: 36px; margin-left: auto; }   /* far right of the line */
/* Home: a part's card (trial) -- the total on the right of its name */
.stockcard .stocktotal { flex: none; font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.stockcard .stocktotal small { color: var(--muted); font-weight: 500; }
.stockcard .stocktotal.lowq { color: var(--warn); }
.stockcard .stocktotal.bad { color: var(--bad); }
.stocksplit { display: grid; grid-template-columns: 1fr 1fr auto; gap: .4rem; margin-top: .45rem; }
.stocksplit .use { align-self: stretch; min-height: 0; padding: 0 1rem; }
.stocksplit > div { display: flex; flex-direction: column; padding: .3rem .55rem; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); min-width: 0; }
.stocksplit span { font-size: .72rem; color: var(--muted); }
.stocksplit b { font-size: .95rem; color: var(--ink); }
.stocksku { margin-top: .1rem; font-size: .8rem; }
/* history pages: Previous · Page 2 · Next */
.histpager { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-top: .6rem; }
.histpager span { color: var(--muted); font-size: .85rem; min-width: 4.5rem; text-align: center; }
.pickfile { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; opacity: 0; }   /* pickFiles(): in the page, out of sight */
