/* Amino Club Inventory: iPad-first styles in the Amino Club brand.
   Navy lettering on the pale yellow-to-blue gradient from the logo, white
   cards, and one accent per activity (blue receiving, green labeling, amber
   low / adjustments, red out / removals). */

:root {
  --bg-top: #fdfdc9;
  --bg-mid: #e9f4ec;
  --bg-bot: #cbe6fb;
  --card: #ffffff;
  --text: #071425;          /* Amino Club navy, all lettering */
  --muted: #4a5a70;
  --faint: #8d9aad;
  --line: #dde5ee;
  --soft: #eef3f8;

  --brand: #071425;         /* buttons and active states use the navy */
  --brand-dark: #0f2447;
  --brand-soft: #e2ebf6;
  --brand-ink: #071425;

  --blue: #2563eb;   --blue-soft: #e5edff;
  --green: #178a4b;  --green-soft: #e3f5ea;
  --amber: #b26a0f;  --amber-soft: #fff1dc;
  --red: #c42b1c;    --red-soft: #fde6e4;
  --violet: #6d4de6; --violet-soft: #eee9ff;
  --slate: #475569;  --slate-soft: #e9edf3;

  --danger: var(--red);
  --ok: var(--green);
  --warn: var(--amber);

  --radius: 18px;
  --radius-sm: 12px;
  --tap: 56px;
  --shadow: 0 1px 2px rgba(7, 20, 37, .05), 0 8px 24px -14px rgba(7, 20, 37, .25);
  --tabbar-h: 74px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bot) 100%) fixed;
  background-color: var(--bg-mid);
  color: var(--text);
  padding-bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
body.locked { padding-bottom: 24px; }
body.locked .tabbar { display: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
b, strong { font-weight: 650; }
small { font-size: 13px; }
svg { display: inline-block; vertical-align: middle; }
a { color: var(--text); }

/* ---------------------------------------------------------------- top bar with the logo */

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 8px;
  background: rgba(253, 253, 215, .78);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid rgba(7, 20, 37, .07);
  min-height: 58px;
}
.topbar > a { grid-column: 2; justify-self: center; display: block; }
.topbar .logo { height: 30px; width: auto; display: block; }
#backBtn { grid-column: 1; }
.topbar-right { grid-column: 3; display: flex; align-items: center; gap: 4px; justify-self: end; }
.topbar-btn.iconbtn { position: relative; width: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.topbar-btn.iconbtn.on { background: rgba(7, 20, 37, .08); }
.topbar-btn .badge {
  position: absolute; top: 1px; right: 1px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; border: 2px solid rgba(253, 253, 215, .95);
}
@media (max-width: 430px) { #whoBtn .who-name { display: none; } #whoBtn { padding: 0 6px; } }
.topbar h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
.topbar-btn {
  min-height: 40px; border: 0; border-radius: 12px; background: transparent;
  color: var(--text); padding: 0 10px; font-size: 16px; font-weight: 600;
}
.topbar-btn:active { background: rgba(7, 20, 37, .08); }
#backBtn, #menuBtn { width: 44px; justify-self: start; display: inline-flex; align-items: center; justify-content: center; }
/* Home: the menu button sits where the other screens have Back */
#menuBtn { grid-column: 1; position: relative; padding: 0; }
#menuBtn.on { background: rgba(7, 20, 37, .08); }
#menuBtn.dot::after { content: ''; position: absolute; top: 6px; right: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--red); border: 2px solid rgba(253, 253, 215, .95); }
.menu-wrap { position: fixed; inset: 0; z-index: 20; }
.menu {
  position: absolute; left: max(10px, env(safe-area-inset-left)); width: clamp(236px, 34vw, 460px); max-height: calc(100% - 150px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--card); border-radius: 18px; padding: 8px; box-shadow: 0 2px 6px rgba(7, 20, 37, .08), 0 26px 60px -18px rgba(7, 20, 37, .5);
  transform-origin: 22px 0; animation: menuin .16s ease-out;
}
@keyframes menuin { from { opacity: 0; transform: scale(.94) translateY(-6px); } }
.menu a { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 6px 8px; border-radius: 12px; text-decoration: none; color: var(--text); font-size: 16px; font-weight: 600; }
.menu a:active { background: var(--soft); }
@media (hover: hover) { .menu a:hover { background: var(--soft); } }
.menu-h { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; margin-top: 6px; padding: 12px 10px 4px; border-top: 1px solid var(--line); }
.menu-n { margin-left: auto; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; background: var(--amber-soft); color: var(--amber); }
.menu-n.red { background: var(--red-soft); color: var(--red); }
@media (prefers-reduced-motion: reduce) { .menu { animation: none; } }
#whoBtn { background: var(--card); box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 6px; color: var(--text); }
#whoBtn:empty { visibility: hidden; }
#whoBtn .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- banners and toast */

.banner { padding: 10px 16px; font-size: 14px; text-align: center; background: var(--amber-soft); color: #6b4300; }
.banner.offline { background: var(--red-soft); color: #7a1f1a; }
.banner.demo { background: rgba(7, 20, 37, .08); color: var(--text); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 16px; font-weight: 500; z-index: 9;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 90vw;
}
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }

/* ---------------------------------------------------------------- layout */

.view { max-width: 700px; margin: 0 auto; padding: 16px 16px 8px; position: relative; z-index: 1; }

/* ---------------------------------------------------------------- product vials floating behind the content */
.vials { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
/* the span moves (cheap, compositor only); the shadowed image inside it is drawn once */
.vials span {
  position: absolute; display: block; height: var(--h, 140px);
  animation: hover var(--d, 8s) ease-in-out var(--dl, 0s) infinite alternate;
  will-change: transform;
}
.vials img {
  display: block; height: 100%; width: auto;
  filter: drop-shadow(0 22px 24px rgba(7,20,37,.26)) drop-shadow(0 4px 6px rgba(7,20,37,.10));
}
@keyframes hover {
  from { transform: translateY(-10px) rotate(calc(var(--r, 0deg) - 1.5deg)); }
  to { transform: translateY(10px) rotate(calc(var(--r, 0deg) + 1.5deg)); }
}
@media (max-width: 760px) { .vials span { height: calc(var(--h, 140px) * .62); } .vials span:nth-child(n+5) { display: none; } }
@media (prefers-reduced-motion: reduce) { .vials span, .wvial { animation: none; } }

/* the Amino H2O vial with its liquid level */
.wvial { position: relative; display: inline-block; flex: none; animation: hover 9s ease-in-out infinite alternate; will-change: transform; }
.wvial img { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 18px rgba(7,20,37,.22)); }
.wliq {
  position: absolute; inset: 0; mix-blend-mode: multiply; opacity: .85;
  -webkit-mask: url(brand/vials/h2o-mask.png) center / 100% 100% no-repeat; mask: url(brand/vials/h2o-mask.png) center / 100% 100% no-repeat;
}
.wstage { display: flex; align-items: flex-end; gap: 14px; flex: none; padding: 6px 4px 10px; }
.wgauge { position: relative; width: 12px; height: 240px; border-radius: 999px; background: rgba(7,20,37,.08); margin-bottom: 8px; }
.wgauge i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 999px; transition: height .6s ease; }
.wgauge b { position: absolute; left: -4px; right: -4px; height: 2px; background: rgba(7,20,37,.35); }
.wgauge span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.page-title { margin: 6px 0 14px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.page-title small { display: block; font-size: 15px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.section { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; margin: 22px 2px 10px; }
.section:first-child { margin-top: 4px; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 14px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.card h2 .sub { font-size: 13px; font-weight: 500; color: var(--muted); }
.card h3 { margin: 18px 0 10px; font-size: 15px; font-weight: 650; }
.card.hint { color: var(--muted); font-size: 14px; background: rgba(255,255,255,.55); box-shadow: none; padding: 10px 14px; }
.card.hint b { color: var(--text); }
.card.err { color: var(--danger); }
.list-card { padding: 4px 18px; }
.hint { color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- icon chip */

.chip-ico { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.chip-ico svg { width: 22px; height: 22px; }
.chip-ico.brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip-ico.blue { background: var(--blue-soft); color: var(--blue); }
.chip-ico.green { background: var(--green-soft); color: var(--green); }
.chip-ico.amber { background: var(--amber-soft); color: var(--amber); }
.chip-ico.red { background: var(--red-soft); color: var(--red); }
.chip-ico.violet { background: var(--violet-soft); color: var(--violet); }
.chip-ico.slate { background: var(--slate-soft); color: var(--slate); }
.chip-ico.sm { width: 36px; height: 36px; border-radius: 11px; }
.chip-ico.sm svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- home */

.hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 16px; }
/* my rank beside the greeting: emblem, title and a thin bar; a tap opens My Profile */
.herorank { display: flex; align-items: center; gap: 10px; flex: none; text-decoration: none; color: var(--text); background: var(--card); border-radius: 999px; padding: 5px 16px 5px 7px; box-shadow: var(--shadow); }
.herorank b { display: block; font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.herorank .xpbar { height: 6px; margin-top: 5px; min-width: 96px; }
.herorank.master b { color: #9a6b00; }
.herorank:active { background: var(--soft); }
@media (max-width: 560px) { .herorank { padding: 4px; background: none; box-shadow: none; } .herorank > span:last-child { display: none; } }
.hero h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.hero .date { color: var(--muted); font-size: 15px; margin-top: 4px; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.kpi { background: var(--card); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow); min-width: 0; }
.kpi .n { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi.warn .n { color: var(--amber); }
.kpi.accent { background: var(--brand); color: #fff; }
.kpi.accent .l { color: rgba(255,255,255,.78); }
.kpi.live { background: var(--green-soft); }
.kpi.live .n { color: var(--green); }
.num.dim { color: var(--muted); }
.list .num.low { color: var(--amber); }
.list .num small.lot { color: var(--text); font-weight: 600; }
.countpair { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.countbox.lot { width: 110px; text-align: left; font-weight: 500; font-size: 15px; }
.kpi.urgent .n { color: var(--red); }

/* Receive: one block per SKU in the box. The heading, the Remove button and the panel only show with two or more. */
.skuline-head { display: none; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.skuline-n { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
#lines.multi .skuline { background: var(--soft); border-radius: 14px; padding: 14px 14px 2px; margin-bottom: 12px; }
#lines.multi .skuline-head { display: flex; }
#lines.multi .seg.test button { background: var(--card); }
.btn.addline { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; }
@media (max-width: 420px) { .kpis.three { grid-template-columns: 1fr 1fr; } .kpis.three .kpi:first-child { grid-column: 1 / -1; } }

/* Home: Receive / Label / Fold Boxes on a wheel. --cw is the size of the one in front; the script places each
   card on the ring (transform, z-index). Everything inside a card is sized in em from --cw, and the two tiles
   under the wheel are the same card at 80%. */
.home { --cw: clamp(148px, min(40vw, 24vh), 230px); } /* 24vh: all of Home fits an iPad held sideways without scrolling */
.home .kpis { margin-bottom: 6px; }
.wheel { position: relative; height: calc(var(--cw) + 30px); margin: 0; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wcard { position: absolute; left: 50%; top: 16px; width: var(--cw); height: var(--cw); margin-left: calc(var(--cw) / -2); text-decoration: none; color: var(--text); will-change: transform; -webkit-user-drag: none; outline: none; cursor: pointer; }
.wcard-in, .stile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; width: 100%; height: 100%;
  font-size: calc(var(--cw) / 10); padding: 1em; border-radius: 1.15em; border: 2px solid transparent; background: var(--card);
  box-shadow: 0 1px 2px rgba(7, 20, 37, .06), 0 16px 30px -16px rgba(7, 20, 37, .4);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.wcard-in { animation: bob 5.5s ease-in-out infinite alternate; } /* the slight hover */
.wcard:nth-child(2) .wcard-in { animation-delay: -1.8s; }
.wcard:nth-child(3) .wcard-in { animation-delay: -3.6s; }
@keyframes bob { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
.wcard.blue .wcard-in { background: linear-gradient(165deg, var(--blue-soft), #fff 58%); }
.wcard.green .wcard-in { background: linear-gradient(165deg, var(--green-soft), #fff 58%); }
.wcard.amber .wcard-in { background: linear-gradient(165deg, var(--amber-soft), #fff 58%); }
.wcard-in .chip-ico, .stile .chip-ico { position: absolute; left: 1em; top: 1em; width: 2.5em; height: 2.5em; border-radius: .8em; color: #fff; }
.wcard-in .chip-ico svg, .stile .chip-ico svg { width: 1.3em; height: 1.3em; }
.wcard.blue .chip-ico { background: linear-gradient(145deg, #2d6cf0, #1d4fc4); }
.wcard.green .chip-ico { background: linear-gradient(145deg, #1f9a56, #157a43); }
.wcard.amber .chip-ico { background: linear-gradient(145deg, #f2a93b, #d9822b); }
.wcard-in .t, .stile .t { font-size: max(15px, 1.12em); font-weight: 700; letter-spacing: -.015em; line-height: 1.15; }
.wcard-in .s, .stile .s { font-size: max(11.5px, .62em); color: var(--muted); line-height: 1.25; margin-top: .25em; }
.wgo { position: absolute; right: 1em; top: 1.15em; display: inline-flex; align-items: center; gap: 2px; font-size: max(11.5px, .58em); font-weight: 700; color: var(--green); background: var(--green-soft); border-radius: 999px; padding: .3em .5em .3em .8em; opacity: 0; transition: opacity .3s ease; }
/* the selected one: a slight green hue around the edge */
.wcard.sel .wcard-in { border-color: rgba(34, 197, 94, .6); box-shadow: 0 0 0 4px rgba(34, 197, 94, .13), 0 0 30px rgba(34, 197, 94, .4), 0 18px 32px -18px rgba(7, 20, 37, .45); }
.wcard.sel .wgo { opacity: 1; }
.wcard:focus-visible .wcard-in { border-color: var(--brand); }
.wcard:active .wcard-in { filter: brightness(.97); }
@media (hover: hover) { .wcard:not(.sel):hover .wcard-in { box-shadow: 0 1px 2px rgba(7, 20, 37, .06), 0 22px 34px -14px rgba(7, 20, 37, .5); } }
@media (prefers-reduced-motion: reduce) { .wcard-in { animation: none; } }

.subtiles { display: flex; justify-content: center; gap: 14px; margin: 4px 0 8px; }
.stile { width: calc(var(--cw) * .8); height: calc(var(--cw) * .8); font-size: calc(var(--cw) * .08); text-decoration: none; color: var(--text); flex: none; }
.stile:active { background: var(--soft); }
.stile.water { background: linear-gradient(165deg, #dff3ff, #fff 62%); }
.stile.water:active { filter: brightness(.97); }
.stile .chip-ico { background: var(--brand); }
.stile .wvial { position: absolute; left: 1em; top: .8em; width: 2.1em; animation: none; }
.stile .wvial img { filter: drop-shadow(0 6px 8px rgba(7, 20, 37, .2)); }
.water-card { display: flex; gap: 22px; align-items: center; }
.water-card .big { font-size: 40px; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.water-card .big .unit { display: block; font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.water-word { display: inline-block; margin: 10px 0 6px; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.water-word.blue { background: #dff3ff; color: #0b6fa8; }
.water-word.amber { background: var(--amber-soft); color: var(--amber); }
.water-word.red { background: var(--red-soft); color: var(--red); }
.water-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 520px) { .water-card { flex-direction: column; text-align: center; } .water-card .actions { justify-content: center; } }
.tag { display: inline-flex; align-items: center; gap: 6px; }
.tag-x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 999px; border: 0; background: rgba(7,20,37,.1); color: var(--text); padding: 0; cursor: pointer; }
.testrow { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.list li.flagged { background: var(--red-soft); margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-radius: 12px; }
.linkbtn.danger { color: var(--red); }
.banner.alert { background: var(--red-soft); color: #7a1f1a; }
.banner a { color: inherit; font-weight: 700; text-decoration: underline; }
.notice-wrap { position: fixed; inset: 0; z-index: 30; background: rgba(7,20,37,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.notice { background: var(--card); border-radius: var(--radius); padding: 22px 22px 18px; max-width: 440px; width: 100%; box-shadow: 0 24px 60px rgba(7,20,37,.3); text-align: center; }
.notice-ico { width: 54px; height: 54px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.notice h2 { margin: 0 0 8px; font-size: 20px; }
.notice p { margin: 0 0 18px; font-size: 16px; line-height: 1.45; color: var(--text); }
.notice .btn { width: 100%; }
.scanner-actions { display: inline-flex; gap: 8px; align-items: center; }
.scanner-photo { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.seg.test { display: inline-flex; gap: 6px; background: none; padding: 0; }
.seg.test button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid transparent; background: var(--soft); color: var(--muted); font-weight: 700; }
.seg.test button.good.on { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.seg.test button.poor.on { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.testrow.seg.test button { min-height: 34px; padding: 0 14px; font-size: 13px; }
.num.dim s { text-decoration-color: var(--red); }
.linkbtn { background: none; border: 0; padding: 0 2px; color: var(--brand); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
/* ---------------------------------------------------------------- ranks: XP bar, emblems, profile, level pop-up */
.emblem { display: block; flex: none; filter: drop-shadow(0 3px 5px rgba(7,20,37,.22)); }
img.emblem { object-fit: contain; -webkit-user-drag: none; user-select: none; }
.xpbar { height: 12px; border-radius: 999px; background: rgba(7,20,37,.10); overflow: hidden; }
.xpbar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2d6cf0, #19b36b); transition: width .9s cubic-bezier(.2,.8,.2,1); min-width: 0; }
.xpbar.full i { background: linear-gradient(90deg, #f0c13c, #f5a524); }
.xp-scale { display: flex; justify-content: space-between; font-size: 12px; font-weight: 650; color: var(--muted); margin: 8px 0 5px; letter-spacing: .01em; }
.xp-count { margin: 7px 0 0; font-size: 14px; color: var(--muted); }
.xp-count b { color: var(--text); font-variant-numeric: tabular-nums; }
.rankcard { display: flex; align-items: center; gap: 18px; text-decoration: none; color: var(--text); }
.rankcard .rank-main { flex: 1; min-width: 0; }
.rankcard .rank-name { font-size: 15px; font-weight: 600; color: var(--muted); }
.rankcard .rank-title { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; }
.rankcard.small .rank-title { font-size: 20px; margin-bottom: 8px; }
.rankcard.small p { margin: 6px 0 0; font-size: 15px; line-height: 1.45; }
.rankcard.master { background: linear-gradient(150deg, #151b26, #0b0f17); color: #fff; }
.rankcard.master .rank-name, .rankcard.master .xp-scale, .rankcard.master .xp-count { color: rgba(255,255,255,.72); }
.rankcard.master .xp-count b { color: #f6d365; }
.rankcard.master .rank-title { color: #f6d365; }
.rankcard.master .xpbar { background: rgba(255,255,255,.16); }
.rankcard.master .xpbar i { background: linear-gradient(90deg, #f6d365, #f5a524); }
@media (max-width: 430px) { .rankcard:not(.small) { flex-direction: column; text-align: center; } .rankcard:not(.small) .rank-main { width: 100%; } }
.prestige-card { background: linear-gradient(150deg, #fff7dc, #ffe9b0); }
.prestige-card p { margin: 0 0 12px; font-size: 15px; line-height: 1.45; }
.prestige-card .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.emblem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.emblem-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; border-radius: 14px; border: 2px solid transparent; background: var(--soft); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; }
button.emblem-pick { cursor: pointer; }
button.emblem-pick:active { background: var(--brand-soft); }
.emblem-pick.on { border-color: var(--brand); background: #fff; box-shadow: var(--shadow); }
.emblem-pick span { text-align: center; line-height: 1.2; }
.linkcard { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; color: var(--text); }
.linkcard svg:last-child { margin-left: auto; }
table.lvl { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; font-variant-numeric: tabular-nums; }
table.lvl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 650; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.lvl td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.lvl tr.me td { background: var(--green-soft); font-weight: 700; }
details summary { cursor: pointer; font-weight: 650; padding: 6px 0; }
.card > p:not([class]) { margin: 0 0 12px; font-size: 15px; line-height: 1.5; }
.notice.xpcard { padding-top: 20px; }
.xp-emblem { display: flex; justify-content: center; margin-bottom: 6px; }
.xp-kicker { font-size: 13px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.xp-lines { margin: 6px 0 4px; font-size: 16px; line-height: 1.45; }
.xp-lines small { color: var(--muted); font-size: 13.5px; }
.xp-gain { display: inline-block; font-weight: 800; color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 1px 10px; margin-right: 4px; font-variant-numeric: tabular-nums; }
.xp-gain.none { color: var(--slate); background: var(--slate-soft); }
.notice.xpcard .xp-count { margin: 8px 0 16px; }
.notice.xpcard .btn.secondary { margin-bottom: 8px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.notice-wrap.levelup .notice { background: linear-gradient(170deg, #fffdf2, #fff3c9); animation: pop .45s cubic-bezier(.2,1.3,.4,1); }
.notice-wrap.levelup .xp-kicker { color: #a36a00; }
.notice-wrap.levelup h2 { font-size: 26px; letter-spacing: -.02em; }
.notice-wrap.levelup .xp-emblem .emblem { animation: shine 1.6s ease-in-out 2; }
@keyframes pop { from { transform: scale(.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shine { 50% { filter: drop-shadow(0 0 16px rgba(245,165,36,.85)); transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .notice-wrap.levelup .notice, .notice-wrap.levelup .xp-emblem .emblem { animation: none; } .xpbar i { transition: none; } }

/* Team levels on the Stats page */
.list.levels li { grid-template-columns: 48px 1fr auto; }
.list.levels li .emblem { justify-self: center; }
.list.levels .xpbar { height: 7px; margin-top: 7px; max-width: 320px; }
.list.levels li.me { background: var(--soft); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 12px; border-top-color: transparent; }
.list.levels li.me + li { border-top-color: transparent; }
.lvltag { display: inline-block; font-size: 11.5px; font-weight: 650; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: 1px; white-space: nowrap; }
.list.levels li.me .lvltag { background: #fff; }
.linkrow { display: flex; align-items: center; gap: 4px; margin-top: 10px; text-decoration: none; }

/* The one-day labeling record: the card at the top of Stats, and the holder's crown */
.crown { flex: 0 0 auto; filter: drop-shadow(0 1px 1.5px rgba(90,55,0,.35)); }
.crowned { position: relative; display: inline-block; line-height: 0; flex: 0 0 auto; }
.crowned .crown { position: absolute; left: 50%; top: 0; transform: translate(-50%, -56%); z-index: 1; pointer-events: none; }
.list.levels li .crowned { justify-self: center; }
.main .crown { vertical-align: -3px; margin-right: 2px; }
.recordcard { background: linear-gradient(170deg, #fffdf2, #fff3c9); }
.recordcard h2 { color: #8a5a00; font-size: 13px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.rec-body { display: flex; align-items: center; gap: 16px; }
.rec-emblem { flex: 0 0 auto; padding-top: 14px; line-height: 0; }
.rec-main { flex: 1; min-width: 0; }
.rec-name { font-size: 22px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.rec-name .lvltag { background: #fff; }
.rec-meta { font-size: 14px; color: var(--muted); margin-top: 3px; }
.rec-num { font-size: 36px; font-weight: 800; letter-spacing: -.03em; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; color: #8a5a00; white-space: nowrap; }
.rec-num small { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0; margin-top: 4px; color: var(--muted); }
.rec-line { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 14.5px; line-height: 1.4; color: #8a5a00; }
.rankcard.master .rec-line { color: #f6d365; }
.rankcard .rank-emblem .crowned, .herorank .crowned { margin-top: 10px; }
@media (max-width: 430px) { .rec-body { gap: 12px; } .rec-name { font-size: 19px; } .rec-num { font-size: 28px; } .rankcard:not(.small) .rec-line { justify-content: center; } }

/* ---------------------------------------------------------------- Label Stock */
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cardhead h2 { margin: 0; }
.countbox { width: 120px; min-height: 44px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; font: inherit; font-size: 17px; font-weight: 650; text-align: right; background: #fff; color: var(--text); font-variant-numeric: tabular-nums; }
.countbox:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(7,20,37,.12); }

.rowacts { display: inline-flex; gap: 12px; margin-left: 6px; }
.rowacts .linkbtn { min-height: 28px; }
.muted { color: var(--muted); }
.coa-grid { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 640px) { .coa-grid { grid-template-columns: 1.4fr 1fr; } }
.coa-art { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px 16px; background: linear-gradient(160deg, #ffffff, #eef5fb); }
.vialart { display: block; filter: drop-shadow(0 16px 20px rgba(7,20,37,.18)); }
.cappill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.cappill i { width: 12px; height: 12px; border-radius: 999px; border: 1px solid rgba(7,20,37,.25); display: inline-block; }
.coa-facts b { font-size: 15px; }
.swatch { width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(7,20,37,.18); flex: none; margin-right: 12px; }
.list.colors li { align-items: center; }
.colorrow { display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer; }
.colorrow input[type=color] { width: 44px; height: 36px; border: 1px solid rgba(7,20,37,.18); border-radius: 10px; padding: 2px; background: #fff; flex: none; }
.colorrow .main { flex: 1; }
.colorrow .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 6px; }
.preset { display: inline-flex; align-items: center; gap: 7px; border: 2px solid transparent; border-radius: 999px; background: var(--soft); padding: 6px 12px 6px 7px; font-size: 13px; font-weight: 600; color: var(--text); }
.preset i { width: 18px; height: 18px; border-radius: 999px; border: 1px solid rgba(7,20,37,.2); }
.preset.on { border-color: var(--brand); background: #fff; }
.check { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
.chip.daypick { display: inline-flex; align-items: center; gap: 6px; position: relative; overflow: hidden; }
.chip.daypick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }


/* ---------------------------------------------------------------- forms */

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; letter-spacing: .01em; }
.field input, .field select, .field textarea, .search, .addrow input, .code-input {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border: 1.5px solid var(--line);
  border-radius: 14px; background: var(--card); font-size: 18px; -webkit-appearance: none; appearance: none; color: var(--text);
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234a5a70' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 44px; }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus, .addrow input:focus, .code-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(7,20,37,.12); }
.field input[disabled] { background: var(--soft); color: var(--muted); }
.field.scan input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row3 { grid-template-columns: 1fr; } }
select.inline { display: inline-block; width: auto; min-height: 36px; padding: 4px 32px 4px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5a70' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; font-size: 15px; font-weight: 600; -webkit-appearance: none; appearance: none; margin: 0 2px; }

.scanrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.scanbtn { margin: 0; min-height: var(--tap); width: auto; padding: 0 18px; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; border-radius: 14px; }

.qty { display: grid; grid-template-columns: var(--tap) 1fr var(--tap); gap: 8px; align-items: stretch; }
.qty button { min-height: var(--tap); border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); font-size: 26px; color: var(--text); font-weight: 500; }
.qty button:active { background: var(--brand-soft); }
.qty input { text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--soft); border-radius: 14px; padding: 4px; }
.seg button { min-height: 48px; border: 0; border-radius: 11px; background: transparent; font-size: 16px; font-weight: 650; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button.on.remove { color: var(--red); }

.btn {
  display: block; width: 100%; min-height: 58px; border: 0; border-radius: 16px;
  background: var(--brand); color: #fff; font-size: 18px; font-weight: 700; margin-top: 6px; letter-spacing: -.01em;
}
.btn:active { background: var(--brand-dark); }
.btn[disabled] { opacity: .55; }
.btn.secondary { background: var(--brand-soft); color: var(--text); }
.btn.secondary:active { background: #d2dfef; }
.btn.danger { background: var(--red); }
.btn.small { min-height: 44px; font-size: 15px; width: auto; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin: 0; border-radius: 12px; }
a.btn { text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.status { font-size: 14px; color: var(--muted); margin: -4px 0 12px; }
.status b { color: var(--text); font-variant-numeric: tabular-nums; }
.status.warnline { color: var(--amber); }
.status.warnline b { color: var(--amber); }
.err { color: var(--danger); font-size: 15px; margin-top: 8px; font-weight: 500; }
.err:empty { display: none; }

/* Confirmation after a save, holds the number to carry into Mission Control. */
.saved { background: var(--green-soft); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; display: flex; gap: 12px; align-items: flex-start; }
.saved .chip-ico { background: var(--green); color: #fff; }
.saved .t { font-weight: 650; color: #0f5a30; }
.saved .s { font-size: 14px; color: #2a5d3f; margin-top: 2px; }
.saved .big { font-size: 26px; font-weight: 700; color: #0f5a30; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.saved .big small { font-size: 14px; font-weight: 500; color: #2a5d3f; margin-left: 6px; }
.saved.amber { background: var(--amber-soft); }
.saved.amber .chip-ico { background: var(--amber); }
.saved.amber .t { color: #6b4300; }
.saved.amber .s { color: #7a5a1e; }

/* ---------------------------------------------------------------- lists */

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.list li.plain { grid-template-columns: 1fr auto; }
.list li:first-child { border-top: 0; }
/* A heading inside a SKU list: Peptides, Sprays, Other */
.list li.grouphead { display: flex; align-items: center; gap: 8px; padding: 18px 0 8px; border-top: 0; font-size: 12.5px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.list li.grouphead:first-child { padding-top: 12px; }
.list li.grouphead span { font-weight: 650; letter-spacing: 0; background: var(--soft); border-radius: 999px; padding: 1px 8px; }
.list li.grouphead + li { border-top: 2px solid var(--line); }
.list .main { font-weight: 600; line-height: 1.25; }
.list .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.list .meta .code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; color: var(--text); }
.list .num { font-weight: 700; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.list .num small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.list .num.worked { display: flex; gap: 10px; } /* Stats, Time Fulfilled: 1 Day 2 Hours 5 Minutes, each number over its word */
.list .num.worked span { text-align: center; }
.list .num.minus { color: var(--red); }
.list .num.plus { color: var(--green); }
.list li.tap { cursor: pointer; }
.list li.tap:active { background: var(--soft); margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.list.team li { align-items: center; }
.list.team .actions { justify-content: flex-end; }
.addperson { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }

.pill { display: inline-block; font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 999px; background: var(--slate-soft); color: var(--slate); vertical-align: middle; letter-spacing: .01em; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.stock { background: var(--amber-soft); color: var(--amber); }
.pill.remove { background: var(--red-soft); color: var(--red); }
.pill.receiving { background: var(--blue-soft); color: var(--blue); }
.pill.labeling { background: var(--green-soft); color: var(--green); }
.pill.admin { background: var(--brand); color: #fff; font-size: 11px; }
.pill.moderator { background: var(--violet-soft); color: var(--violet); font-size: 11px; }

.search { margin-bottom: 10px; padding-left: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238d9aad' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 14px center; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 38px; padding: 0 15px; border-radius: 999px; border: 0; background: var(--card); font-size: 15px; font-weight: 600; color: var(--muted); box-shadow: var(--shadow); }
.chip.on { background: var(--text); color: #fff; }

/* ---------------------------------------------------------------- SKU detail */

.detail .big { font-size: 44px; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.detail .big .unit { display: block; font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.detail .big.live { color: var(--green); }
.detail .head > div:last-child { margin-left: auto; }
.detail .meta { font-size: 14px; color: var(--muted); }
.detail .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.facts div { background: var(--soft); border-radius: 12px; padding: 10px 8px; text-align: center; min-width: 0; }
.facts b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.facts span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 420px) { .facts { grid-template-columns: repeat(2, 1fr); } }

.bars .bar { height: 8px; background: var(--soft); border-radius: 4px; margin-top: 7px; overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #3b5f8f); border-radius: 4px; }
.rank { width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.rank.gold { background: #fff1c2; color: #8a6100; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tag { background: var(--soft); border-radius: 999px; padding: 7px 13px; font-size: 15px; font-weight: 500; }
.addrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.addrow input { min-height: 48px; font-size: 17px; }
.chooser { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.chooser button { min-height: 64px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); font-size: 17px; font-weight: 650; }
.chooser button.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.empty { text-align: center; color: var(--muted); padding: 28px 8px; font-size: 15px; }
.empty .chip-ico { margin: 0 auto 10px; display: flex; }

/* ---------------------------------------------------------------- sign in */

.login { max-width: 440px; margin: 6vh auto 0; text-align: center; }
.login-logo { width: 220px; max-width: 70%; height: auto; margin: 0 auto 26px; display: block; }
.login-card { text-align: left; }
.login-card h2 { text-align: center; font-size: 20px; }
.code-input { text-align: center; font-size: 30px; letter-spacing: .35em; font-weight: 700; min-height: 68px; margin-bottom: 12px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.code-input::placeholder { letter-spacing: .35em; color: var(--faint); }
.login-card .hint { text-align: center; margin: 14px 0 0; }
.login-foot { margin: 18px 0 0; font-size: 15px; }
.login-foot a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.demo-codes { text-align: center; }

/* ---------------------------------------------------------------- camera scanner */

.scanner { position: fixed; inset: 0; z-index: 20; background: #000; display: flex; flex-direction: column; }
.scanner video { flex: 1; width: 100%; height: 100%; object-fit: cover; }
.scanner-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; color: #fff; font-weight: 600; background: linear-gradient(rgba(0,0,0,.6), transparent); z-index: 2; }
.scanner-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.scanner-frame { position: absolute; left: 50%; top: 50%; width: min(82vw, 560px); height: 160px; transform: translate(-50%, -50%); border: 3px solid rgba(255,255,255,.9); border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); pointer-events: none; }
.scanner-frame::after { content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 2px; background: #ff3b30; opacity: .85; }
.scanner-hint { position: absolute; left: 0; right: 0; bottom: calc(40px + env(safe-area-inset-bottom)); text-align: center; color: #fff; font-size: 15px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* ---------------------------------------------------------------- tab bar */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: rgba(255,255,255,.88);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid rgba(7, 20, 37, .08);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 14px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; letter-spacing: .01em; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--text); }
.tabbar a.on .ico { background: var(--brand-soft); }
.tabbar a .ico { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 30px; border-radius: 999px; }

/* ---------------------------------------------------------------- two-button windows, button rows */

.notice-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.notice-btns .btn { margin: 0; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.btnrow:last-child { margin-bottom: 0; }
.btnrow .btn { flex: 1 1 220px; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; }
.btnrow .btn.small { flex: 0 0 auto; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg.three button { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; padding: 6px 4px; }
.seg.three button small { font-size: 11px; font-weight: 750; opacity: .9; }

/* ---------------------------------------------------------------- seating chart */

/* One colour per task: Labeling green, Fulfilling gold, Other slate. --tc is the ink, --ts the tint. */
.t-lab { --tc: var(--green); --ts: var(--green-soft); }
.t-ful { --tc: #9a5b00; --ts: #fff0c2; }
.t-oth { --tc: var(--slate); --ts: var(--slate-soft); }

body.wide .view { max-width: 1120px; }
body.wide .vials { display: none; } /* the board needs a calm background */
.board-scroll { overflow-x: auto; margin: 0 -16px 10px; padding: 4px 16px 10px; -webkit-overflow-scrolling: touch; }
/* The room. --u is 1% of the board's width in px (set by fitBoards), --sw the seat's width (a circle's
   diameter) in those units, --f the seat scale (1 = medium). Everything inside is sized from them. */
.board {
  --u: 9px; --sw: 12.5; --f: 1;
  position: relative; width: 100%; min-width: 860px; aspect-ratio: 16 / 9; overflow: hidden;
  background: rgba(255,255,255,.78); border-radius: calc(var(--u) * 1.5);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(7,20,37,.07);
}
@supports not (aspect-ratio: 1) { .board::before { content: ""; display: block; padding-top: 56.25%; } }
.board.layout {
  background-color: rgba(255,255,255,.82);
  background-image: linear-gradient(rgba(7,20,37,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(7,20,37,.07) 1px, transparent 1px);
  background-size: 5% 8.8889%;
}
.seat, .blabel, .btable { position: absolute; transform: translate(-50%, -50%); }
/* A seat is a circle in its task's colour. The person's emblem, name and task sit inside it; the seat's own name
   is a tag on the top edge, and on the wall display the Check-In button sits on the bottom edge. */
.seat {
  --k: calc(var(--u) * var(--f));
  width: calc(var(--u) * var(--sw)); height: calc(var(--u) * var(--sw)); z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--k) * .14);
  padding: calc(var(--k) * 1.05) calc(var(--k) * .5) calc(var(--k) * .95); margin: 0;
  border: calc(var(--k) * .28) solid transparent; border-radius: 50%;
  background: var(--card); color: var(--text); text-align: center; overflow: visible; font: inherit; line-height: 1.2;
  box-shadow: 0 1px 2px rgba(7,20,37,.08), 0 calc(var(--k) * .6) calc(var(--k) * 1.5) calc(var(--k) * -.8) rgba(7,20,37,.4);
}
.seat.open { background: rgba(255,255,255,.6); border: calc(var(--k) * .18) dashed rgba(7,20,37,.26); box-shadow: none; color: var(--muted); gap: calc(var(--k) * .3); }
.seat.taken { border-color: var(--tc); background: radial-gradient(circle at 50% 30%, #fff 46%, var(--ts) 100%); cursor: pointer; }
.seat.taken:active { filter: brightness(.96); }
.seat.me { box-shadow: 0 0 0 calc(var(--k) * .22) #fff, 0 0 0 calc(var(--k) * .52) rgba(37,99,235,.55), 0 calc(var(--k) * .6) calc(var(--k) * 1.5) calc(var(--k) * -.8) rgba(7,20,37,.4); }
.board.view .seat.open { cursor: default; }
.seat-name { font-size: calc(var(--k) * .86); font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); max-width: 84%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
/* on a taken seat the seat's name becomes a tag across the top edge of the circle */
.seat.taken .seat-name { position: absolute; left: 50%; top: 0; transform: translate(-50%, -58%); max-width: 96%; padding: calc(var(--k) * .14) calc(var(--k) * .75); border-radius: 999px; background: var(--tc); color: #fff; box-shadow: 0 0 0 calc(var(--k) * .16) #fff; line-height: 1.25; }
.seat.open .seat-name { font-size: calc(var(--k) * 1.05); }
.seat-emblem { line-height: 0; flex: none; }
.seat-emblem .emblem { width: calc(var(--k) * 4.5); height: auto; }
.seat-emblem img.emblem { height: calc(var(--k) * 4.5); }
.seat-emblem .crown { width: calc(var(--k) * 2.8); height: auto; }
.avatar.big { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 17px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.seat-emblem .avatar.big { width: calc(var(--k) * 4); height: calc(var(--k) * 4); font-size: calc(var(--k) * 1.8); }
.seat-who { font-size: calc(var(--k) * 1.55); font-weight: 750; letter-spacing: -.01em; line-height: 1.15; max-width: 88%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.seat-task { display: inline-flex; align-items: center; gap: calc(var(--k) * .3); max-width: 74%; flex: none; font-size: calc(var(--k) * .98); font-weight: 750; color: var(--tc); background: var(--ts); border-radius: 999px; padding: calc(var(--k) * .14) calc(var(--k) * .65); }
.seat.taken .seat-task { background: rgba(255,255,255,.8); }
.seat-task svg { width: calc(var(--k) * 1.15); height: calc(var(--k) * 1.15); flex: none; }
.seat-task span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-xp { display: inline-block; font-size: 12px; font-weight: 800; color: #6b4300; background: linear-gradient(#ffe98a, #f7c948); border-radius: 999px; padding: 1px 9px; white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.board .seat-xp { font-size: calc(var(--k) * .85); padding: calc(var(--k) * .08) calc(var(--k) * .6); flex: none; }
.seat-open { display: inline-flex; align-items: center; gap: calc(var(--k) * .3); font-size: calc(var(--k) * 1.05); font-weight: 650; }
.seat-open svg { width: calc(var(--k) * 1.5); height: calc(var(--k) * 1.5); }
/* checked in: a green tick at the emblem's shoulder; on the wall display, a Check-In / Checkout button under the name */
.seat-emblem { position: relative; }
.seat-in { position: absolute; right: calc(var(--k) * -1.7); top: calc(var(--k) * -.1); width: calc(var(--k) * 2); height: calc(var(--k) * 2); border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 calc(var(--k) * .2) #fff; }
.seat-in svg { width: calc(var(--k) * 1.25); height: calc(var(--k) * 1.25); stroke-width: 3.2; }
.seat.clocks { padding-bottom: calc(var(--k) * 1.55); }
.seat.clocks .seat-emblem .emblem { width: calc(var(--k) * 4.1); }
.seat.clocks .seat-emblem img.emblem { height: calc(var(--k) * 4.1); }
.seat.clocks .seat-emblem .avatar.big { width: calc(var(--k) * 3.6); height: calc(var(--k) * 3.6); }
/* the button sits across the bottom edge of the circle */
.seat-clock { position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 52%); min-width: 76%; border: 0; border-radius: 999px; background: var(--green); color: #fff; font: inherit; font-size: calc(var(--k) * 1.12); font-weight: 800; line-height: 1.15; padding: calc(var(--k) * .42) calc(var(--k) * .9); display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--k) * .45); white-space: nowrap; cursor: pointer; box-shadow: 0 0 0 calc(var(--k) * .2) #fff, 0 calc(var(--k) * .3) calc(var(--k) * .7) calc(var(--k) * -.2) rgba(7,20,37,.45); }
.seat-clock:active { filter: brightness(.9); }
.seat-clock.out { background: #fff; color: var(--red); box-shadow: inset 0 0 0 calc(var(--k) * .16) var(--red), 0 0 0 calc(var(--k) * .2) #fff, 0 calc(var(--k) * .3) calc(var(--k) * .7) calc(var(--k) * -.2) rgba(7,20,37,.45); }
.seat-clock small { font-size: .88em; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--muted); }
.pc-in { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--green); }
.pc-in.off { color: var(--muted); }
.board.assign .seat { cursor: pointer; }
/* editing the seating: a person is dragged onto another seat (move) or another person (swap) */
.board.assign .seat.taken { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.board.assign .seat.lifted { opacity: .3; }
.board.assign .seat.ghost { pointer-events: none; z-index: 6; cursor: grabbing; transform: translate(-50%, -50%) rotate(-2deg) scale(1.04); box-shadow: 0 16px 34px -10px rgba(7,20,37,.6); }
.board.assign .seat.drop { box-shadow: 0 0 0 calc(var(--k) * .22) #fff, 0 0 0 calc(var(--k) * .6) var(--blue); }
.board.assign .seat.open { color: var(--blue); border-color: rgba(37,99,235,.5); background: rgba(229,237,255,.6); }
.blabel { font-size: calc(var(--u) * 1.1); font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: rgba(7,20,37,.45); white-space: nowrap; padding: calc(var(--u) * .3) calc(var(--u) * 1); border: calc(var(--u) * .12) dashed rgba(7,20,37,.2); border-radius: 999px; background: rgba(255,255,255,.55); }
.blabel { z-index: 1; }
/* a table: a shape under the seats that makes the room recognisable (nobody sits "in" it) */
.btable { z-index: 0; display: flex; align-items: center; justify-content: center; border-radius: calc(var(--u) * 1.1); background: linear-gradient(180deg, #eee2cd, #dfcdae); border: calc(var(--u) * .14) solid #c9b48f; box-shadow: inset 0 calc(var(--u) * .16) 0 rgba(255,255,255,.55), 0 calc(var(--u) * .35) calc(var(--u) * .9) calc(var(--u) * -.45) rgba(7,20,37,.4); color: #8a6f43; font-size: calc(var(--u) * 1.05); font-weight: 750; letter-spacing: .12em; text-transform: uppercase; pointer-events: none; overflow: hidden; }
.btable span { max-width: 92%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.board.layout .btable { pointer-events: auto; }
.btable-grip { position: absolute; right: 0; bottom: 0; width: calc(var(--u) * 2.8); height: calc(var(--u) * 2.8); min-width: 30px; min-height: 30px; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--muted); border-radius: calc(var(--u) * .9) 0 calc(var(--u) * .9) 0; box-shadow: 0 0 0 calc(var(--u) * .12) #c9b48f; cursor: nwse-resize; touch-action: none; }
.btable-grip svg { width: 60%; height: 60%; }
.board.layout [data-item] { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.board.layout .seat.open { background: #fff; border-style: solid; border-color: rgba(7,20,37,.3); color: var(--text); box-shadow: 0 1px 2px rgba(7,20,37,.08), 0 6px 14px -8px rgba(7,20,37,.4); }
.board.layout .blabel { background: #fff; color: var(--text); }
.board.layout .dragging { z-index: 4; cursor: grabbing; border-color: var(--blue); box-shadow: 0 14px 30px -10px rgba(7,20,37,.55); }

.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--tc); background: var(--ts); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.legend .lg b { font-weight: 800; }
.taskpill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--tc); background: var(--ts); border-radius: 999px; padding: 4px 11px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taskpill b { font-weight: 800; }
.seatlist li > .emblem, .seatlist li > .crowned, .seatlist li > .avatar { justify-self: center; }
.seatlist li.me .main { color: var(--blue); }

.chips.shifts { margin-top: -4px; }
.chips.shifts .chip small { font-size: 12px; font-weight: 500; opacity: .75; margin-left: 4px; }
/* The display's shift switch: Morning | Night, the one on show filled in */
.dsp-shift { display: inline-flex; gap: calc(var(--d) * .3); background: rgba(255,255,255,.7); border-radius: 999px; padding: calc(var(--d) * .3); box-shadow: var(--shadow); }
.dsp-shift button, .dsp-shift b { border: 0; background: transparent; color: var(--muted); border-radius: 999px; min-height: max(40px, calc(var(--d) * 2.6)); padding: 0 calc(var(--d) * 1.3); font-size: calc(var(--d) * 1.25); font-weight: 700; display: inline-flex; align-items: center; gap: calc(var(--d) * .4); white-space: nowrap; }
.dsp-shift .on { background: var(--text); color: #fff; }
.dsp-shift small { font-size: calc(var(--d) * .8); font-weight: 600; opacity: .75; }
/* Home: where I am today */
.seatstrip { display: flex; align-items: center; gap: 12px; background: var(--ts); color: var(--text); border-left: 5px solid var(--tc); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 14px; text-decoration: none; }
.seatstrip > svg:first-child { color: var(--tc); flex: none; }
.seatstrip > div { flex: 1; min-width: 0; }
.seatstrip .ss-t { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.seatstrip .ss-s { font-size: 13px; color: var(--muted); margin-top: 1px; }
.seatstrip .ss-s b { color: var(--tc); font-weight: 800; }
.seatstrip > svg:last-child { color: var(--muted); flex: none; }

/* Windows: one seat (admins), one person (everyone) */
.notice.seatdlg { text-align: left; max-width: 460px; }
.notice.seatdlg h2 { text-align: center; margin-bottom: 14px; }
.seatdlg .seg.three button { min-height: 54px; }
.seatdlg .seg.three button.on.t-lab { color: var(--green); }
.seatdlg .seg.three button.on.t-ful { color: #6b4300; background: linear-gradient(#fff6cf, #ffe38a); }
.notice.personcard { position: relative; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto; }
.pc-x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.pc-emblem { line-height: 0; margin: 16px 0 10px; display: flex; justify-content: center; }
.notice.personcard h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 2px; }
.pc-rank { font-weight: 650; color: var(--muted); }
.notice.personcard .xp-count { margin: 7px 0 14px; font-size: 14px; }
.pc-today { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--ts); border-left: 5px solid var(--tc); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.pc-today > svg { color: var(--tc); flex: none; }
.notice.personcard .rec-line { justify-content: center; margin: 0 0 14px; font-size: 14px; }
.notice.personcard .kpis { text-align: left; gap: 8px; margin-bottom: 14px; }
.notice.personcard .kpi { box-shadow: none; background: var(--soft); padding: 10px 12px; border-radius: 12px; }
.notice.personcard .kpi .n { font-size: 22px; }
.notice.personcard .kpi .l { font-size: 12px; margin-top: 2px; }
.notice.personcard .kpi.accent { grid-column: 1 / -1; background: var(--brand); display: flex; align-items: baseline; gap: 10px; }
.notice.personcard .kpi.accent .n { font-size: 28px; }
.notice.personcard .btn.secondary { margin: 0 0 8px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.notice.personcard.master { background: linear-gradient(170deg, #fffdf2, #fff3c9); }
/* the code pad on the wall display (check in / check out), and the short confirmation after it */
.notice.pincard { max-width: 400px; padding: 18px 22px; }
.notice.pincard h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 2px; }
.pincard .pc-emblem { margin: 2px 0 8px; }
.pin-kicker { font-weight: 650; font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.pin-dots { height: 48px; display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--soft); border-radius: 14px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--text); }
.pin-dots span { color: var(--muted); font-weight: 600; font-size: 15px; }
.pincard .err { margin: 8px 0 0; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 14px; }
.pin-pad button { min-height: 58px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center; }
.pin-pad button:active { background: var(--brand-soft); }
.pin-pad button.alt { background: var(--soft); color: var(--muted); }
.pin-pad button.go { background: var(--green); border-color: var(--green); color: #fff; }
.pincard.shake { animation: pinshake .35s; }
@keyframes pinshake { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.pin-ok { width: 84px; height: 84px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; margin: 8px 0 12px; animation: pop .4s cubic-bezier(.2,1.3,.4,1); }
.pincard.done.out .pin-ok { background: var(--text); }
.pin-xp { font-size: 36px; font-weight: 800; letter-spacing: -.02em; color: var(--green); line-height: 1.1; }
.notice.pincard .hint { margin: 2px 0 16px; font-size: 15px; color: var(--muted); }
select.chip.pick { -webkit-appearance: none; appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5a70' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

/* ---------------------------------------------------------------- the big-screen seating display */

body.display { padding-bottom: 0; overflow: hidden; }
body.display .topbar, body.display .tabbar, body.display .banner, body.display .vials { display: none !important; }
body.display .view { max-width: none; padding: 0; margin: 0; }
body.display .toast { bottom: 28px; }
/* --d grows with the screen: about 10px on an iPad, 20px on a 1080p wall display, 34px on 4K. */
.dsp { --d: clamp(10px, 1.05vw, 40px); height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: calc(var(--d) * .9); padding: calc(var(--d) * 1.1) calc(var(--d) * 1.6) calc(var(--d) * .8); }
/* one row: logo, title, the page button, then the numbers (which give way first when it gets tight) and the clock */
.dsp-head { flex: none; display: flex; align-items: center; gap: calc(var(--d) * 1.2); }
.dsp-logo { height: calc(var(--d) * 3.2); width: auto; display: block; flex: none; }
.dsp-title { flex: none; }
.dsp-title h1 { margin: 0; font-size: calc(var(--d) * 2.3); font-weight: 750; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.dsp-date { font-size: calc(var(--d) * 1.3); font-weight: 600; color: var(--muted); margin-top: calc(var(--d) * .35); white-space: nowrap; }
.dsp-stats { margin-left: auto; display: flex; gap: calc(var(--d) * .8); min-width: 0; }
.dsp-stat { display: flex; flex-direction: column; justify-content: center; min-width: 0; background: rgba(255,255,255,.82); border-radius: calc(var(--d) * 1.1); padding: calc(var(--d) * .5) calc(var(--d) * 1); box-shadow: var(--shadow); }
.dsp-stat b { font-size: calc(var(--d) * 1.85); font-weight: 750; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsp-stat span { font-size: calc(var(--d) * .9); font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsp-stat.rec { flex-direction: row; align-items: center; gap: calc(var(--d) * .7); background: linear-gradient(170deg, #fffdf2, #ffeeb5); }
.dsp-stat.rec .crown { width: calc(var(--d) * 2.7); height: auto; flex: none; }
.dsp-stat.rec div { display: flex; flex-direction: column; min-width: 0; }
.dsp-stat.rec b { font-size: calc(var(--d) * 1.5); }
.dsp-clock { flex: none; font-size: calc(var(--d) * 2.4); font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dsp-stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.dsp-stage .board { flex: none; min-width: 0; }
.dsp-note { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); background: var(--text); color: #fff; font-size: calc(var(--d) * 1.5); font-weight: 650; padding: calc(var(--d) * .6) calc(var(--d) * 1.6); border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.25); white-space: nowrap; }
.dsp-empty { font-size: calc(var(--d) * 1.8); font-weight: 600; color: var(--muted); text-align: center; max-width: 30em; padding: 0 1em; }
.dsp-foot { flex: none; display: flex; align-items: center; gap: calc(var(--d) * 1.1); font-size: calc(var(--d) * 1); color: var(--muted); }
.dsp-foot > * { flex: none; }
.dsp-foot .dsp-tip { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsp-foot .legend { margin: 0; gap: calc(var(--d) * .6); flex-wrap: nowrap; }
.dsp-foot .dsp-shift button, .dsp-foot .dsp-shift b { min-height: max(40px, calc(var(--d) * 2.3)); font-size: calc(var(--d) * 1.1); padding: 0 calc(var(--d) * 1.1); }
.dsp-foot .legend .lg { font-size: calc(var(--d) * 1); padding: calc(var(--d) * .3) calc(var(--d) * .95); gap: calc(var(--d) * .4); }
.dsp-foot .legend .lg svg { width: calc(var(--d) * 1.2); height: calc(var(--d) * 1.2); }
.dsp-tip { font-weight: 600; }
.dsp-upd { margin-left: auto; }
.dsp-upd.off { color: var(--red); font-weight: 700; }
.dsp-admin { border: 0; background: rgba(7,20,37,.07); color: var(--muted); border-radius: 999px; min-height: max(40px, calc(var(--d) * 2.3)); padding: 0 calc(var(--d) * 1.1); font-size: max(13px, calc(var(--d) * .95)); font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.dsp-admin:active { background: rgba(7,20,37,.14); }
/* the header button that switches between the seating chart and the leaderboards */
.dsp-go { flex: none; border: 0; background: var(--text); color: #fff; border-radius: 999px; min-height: max(44px, calc(var(--d) * 3)); padding: 0 calc(var(--d) * 1.35); font: inherit; font-size: calc(var(--d) * 1.25); font-weight: 750; display: inline-flex; align-items: center; gap: calc(var(--d) * .55); white-space: nowrap; cursor: pointer; box-shadow: var(--shadow); }
.dsp-go svg { width: calc(var(--d) * 1.5); height: calc(var(--d) * 1.5); flex: none; }
.dsp-go:active { filter: brightness(1.3); }
/* the record for orders in one day */
.dsp-stat.pr { background: linear-gradient(170deg, #eef4ff, #d6e4ff); }
.dsp-stat.pr b { color: var(--blue); }
/* the all-time leaderboards: one column per board (--cols), each a fixed number of rows (--rows) so the type is the same size however many people are on it */
.lead { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: calc(var(--d) * 1); animation: leadin .5s ease both; }
@keyframes leadin { from { opacity: 0; transform: translateY(calc(var(--d) * .8)); } to { opacity: 1; transform: none; } }
.lead-col { --tc: var(--green); --ts: var(--green-soft); min-height: 0; display: flex; flex-direction: column; background: rgba(255,255,255,.84); border-radius: calc(var(--d) * 1.4); box-shadow: var(--shadow); border-top: calc(var(--d) * .4) solid var(--tc); padding: calc(var(--d) * .9) calc(var(--d) * .9) calc(var(--d) * .9); }
.lead-rec { --tc: var(--blue); --ts: #e2ebff; }
.lead-ful { --tc: #9a5b00; --ts: #ffedb8; }
.lead-box { --tc: var(--violet); --ts: var(--violet-soft); }
.lead-col h2 { flex: none; margin: 0 0 calc(var(--d) * .7); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: calc(var(--d) * .6); font-size: calc(var(--d) * 1.9); font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.lead-col h2 svg { grid-row: 1 / 3; width: calc(var(--d) * 2.4); height: calc(var(--d) * 2.4); color: var(--tc); }
.lead-col h2 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-col h2 small { grid-column: 2; margin-top: calc(var(--d) * .15); font-size: calc(var(--d) * 1); font-weight: 650; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.lead-col ol { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(var(--rows, 10), minmax(0, 1fr)); gap: calc(var(--d) * .32); }
.lead-col li { min-height: 0; display: grid; grid-template-columns: calc(var(--d) * 1.9) calc(var(--d) * 2.6) minmax(0, 1fr) auto; align-items: center; gap: calc(var(--d) * .5); padding: 0 calc(var(--d) * .8) 0 calc(var(--d) * .45); border-radius: calc(var(--d) * .8); background: linear-gradient(90deg, var(--ts) var(--pct, 0%), rgba(7,20,37,.04) var(--pct, 0%)); cursor: pointer; }
.lead-col li:active { filter: brightness(.96); }
.lead-n { width: calc(var(--d) * 1.9); height: calc(var(--d) * 1.9); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: calc(var(--d) * 1.05); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); background: rgba(255,255,255,.85); }
.lead-col li.p1 .lead-n { background: linear-gradient(#ffe98a, #f7c948); color: #6b4300; }
.lead-col li.p2 .lead-n { background: linear-gradient(#f3f5f9, #c5cedb); color: #364152; }
.lead-col li.p3 .lead-n { background: linear-gradient(#f7d6b4, #dc9a61); color: #5a3210; }
.lead-e { line-height: 0; justify-self: center; }
.lead-e .emblem { height: calc(var(--d) * 2.5); width: auto; }
.lead-e .crown { width: calc(var(--d) * 1.5); height: auto; }
.lead-e .avatar.big { width: calc(var(--d) * 2.3); height: calc(var(--d) * 2.3); font-size: calc(var(--d) * 1.1); }
.lead-w { font-size: calc(var(--d) * 1.4); font-weight: 750; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-v { font-size: calc(var(--d) * 1.5); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
/* time worked: each number with its word underneath (1 Day, 0 Hours, 0 Minutes) */
.lead-v.time { display: inline-flex; align-items: flex-start; gap: calc(var(--d) * .5); }
.lead-v.time span { display: flex; flex-direction: column; align-items: center; line-height: 1.02; }
.lead-v.time small { font-size: calc(var(--d) * .6); font-weight: 700; letter-spacing: .01em; color: var(--muted); margin-top: calc(var(--d) * .1); }
.lead-none { margin: auto; font-size: calc(var(--d) * 1.3); font-weight: 600; color: var(--muted); text-align: center; }
/* after hours: only the logo, over the floating vials */
body.display.resting .vials { display: block !important; }
body.display.resting .vials span { height: calc(var(--h, 140px) * var(--vs, 1)); }
/* spread around the logo instead of stacked down the two edges (odd ones are placed from the left, even from the right) */
body.display.resting .vials span:nth-child(1) { left: 3% !important; top: 6% !important; }
body.display.resting .vials span:nth-child(2) { right: 3% !important; top: 9% !important; }
body.display.resting .vials span:nth-child(3) { left: 5% !important; top: 60% !important; }
body.display.resting .vials span:nth-child(4) { right: 5% !important; top: 62% !important; }
body.display.resting .vials span:nth-child(5) { left: 19% !important; top: 31% !important; }
body.display.resting .vials span:nth-child(6) { right: 19% !important; top: 29% !important; }
body.display.resting .vials span:nth-child(7) { left: 37% !important; top: 70% !important; }
body.display.resting .vials span:nth-child(8) { right: 37% !important; top: 3% !important; }
.dsp.rest { align-items: center; justify-content: center; cursor: pointer; }
.dsp-restlogo { width: min(38vw, 84vh); height: auto; display: block; animation: leadin 1s ease both; }
@media (prefers-reduced-motion: reduce) { .lead, .dsp-restlogo { animation: none; } }

/* ---------------------------------------------------------------- the display's fall theme
   body.display.fall: autumn colors. .themelayer sits outside the view (the display's repaints leave it alone):
   pumpkins and a turkey in the bottom corners, behind the content, and the leaves falling in front of it.
   Nothing in it takes a tap. --fm (set by fitBoards) is the free room beside the board, in px. */
body.display.fall {
  --text: #3a1d08; --muted: #7a5536; --brand: #5a2d0c; --line: #ecd9bf; --soft: #f7ead7;
  background: linear-gradient(180deg, #fff4d9 0%, #ffe2b3 46%, #f4b06a 100%) fixed; background-color: #ffe2b3;
}
body.display.fall .board { background: rgba(255, 250, 240, .8); box-shadow: var(--shadow), inset 0 0 0 1px rgba(122, 67, 26, .14); }
body.display.fall .dsp-stat { background: rgba(255, 250, 240, .88); }
body.display.fall .dsp-stat.pr { background: linear-gradient(170deg, #fff1dc, #ffd29a); }
body.display.fall .dsp-stat.pr b { color: #c2410c; }
body.display.fall .dsp-stat.rec { background: linear-gradient(170deg, #fffdf2, #ffe9a8); }
body.display.fall .dsp-go { background: linear-gradient(145deg, #d9480f, #a8320a); }
body.display.fall .lead-col { background: rgba(255, 250, 240, .9); }
body.display.fall .dsp-admin { background: rgba(90, 45, 12, .1); }
body.display.fall .blabel { color: rgba(58, 29, 8, .55); border-color: rgba(58, 29, 8, .24); }
.fall-decor, .fall-leaves { position: fixed; pointer-events: none; }
.fall-decor { z-index: 0; bottom: calc(clamp(10px, 1.05vw, 40px) * 4.2); width: max(var(--fm, 0px), 8vw); display: flex; justify-content: center; align-items: flex-end; }
.fall-decor svg { display: block; width: min(calc(var(--fm, 0px) - 1.2vw), 15vw); height: auto; filter: drop-shadow(0 .5vw .6vw rgba(90, 45, 12, .25)); }
.themelayer.tight .fall-decor { display: none; }
/* after hours the two lowest floating vials move in, off the pumpkins and the turkey */
body.display.fall.resting .vials span:nth-child(3) { left: 21% !important; top: 66% !important; }
body.display.fall.resting .vials span:nth-child(4) { right: 21% !important; top: 67% !important; }
body.display.fall.resting .vials span:nth-child(7) { left: 44% !important; }
.fall-left { left: 0; }
.fall-right { right: 0; }
.fall-right svg { width: min(calc(var(--fm, 0px) * .82 - 1vw), 12.5vw); transform-origin: 50% 100%; animation: turkeybob 2.6s ease-in-out infinite alternate; }
@keyframes turkeybob { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg) translateY(-2%); } }
.fall-leaves { z-index: 3; inset: 0; overflow: hidden; }
/* a leaf: the span falls, the <i> inside it sways and turns */
.leaf { position: absolute; top: -14vh; width: calc(var(--s, 2) * 1vw); opacity: .92; animation: leaffall var(--d, 14s) linear var(--dl, 0s) infinite; will-change: transform; }
.leaf i { display: block; animation: leafsway calc(var(--d, 14s) / 3.4) ease-in-out var(--dl, 0s) infinite alternate; will-change: transform; }
.leaf svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 .15vw .2vw rgba(90, 45, 12, .3)); }
@keyframes leaffall { to { transform: translate3d(0, 128vh, 0); } }
@keyframes leafsway { from { transform: translateX(calc(var(--w, 2) * -1vw)) rotate(-38deg); } to { transform: translateX(calc(var(--w, 2) * 1vw)) rotate(38deg); } }
@media (prefers-reduced-motion: reduce) { .fall-leaves { display: none; } .fall-right svg { animation: none; } }

/* ---------------------------------------------------------------- end of shift tasks
   One panel (.eos) for the app's screen and for the drawer on the wall display. Everything in it is sized
   from --e, so the drawer only has to make --e larger. --c is a task's color (the same on the wheel). */
.eos { --e: 14px; }
.eos-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--e); margin-bottom: calc(var(--e) * 1.1); }
.eos-head h2 { margin: 0; font-size: calc(var(--e) * 1.45); font-weight: 750; letter-spacing: -.015em; line-height: 1.15; }
.eos-sub { font-size: calc(var(--e) * .98); color: var(--muted); margin-top: calc(var(--e) * .2); line-height: 1.35; }
.eos-sub b { color: var(--text); }
.eos.live .eos-sub { color: var(--green); font-weight: 650; }
.eos-tabs { display: inline-flex; gap: 4px; background: var(--soft); border-radius: 999px; padding: 4px; flex: none; }
.eos-tabs:empty { display: none; }
.eos-tabs button { border: 0; background: transparent; color: var(--muted); border-radius: 999px; min-height: max(40px, calc(var(--e) * 2.6)); padding: 0 calc(var(--e) * 1.2); font-size: calc(var(--e) * 1.05); font-weight: 700; }
.eos-tabs button.on { background: var(--text); color: #fff; }
.eos-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: calc(var(--e) * 1.5); align-items: start; }
.eos-spin { text-align: center; }
.eos-wheelbox { max-width: calc(var(--e) * 27); margin: 0 auto; }
.eos-wheel { display: block; width: 100%; height: auto; filter: drop-shadow(0 calc(var(--e) * .6) calc(var(--e) * .9) rgba(7, 20, 37, .28)); }
.eos-wheel text { fill: #fff; font-weight: 750; letter-spacing: .01em; }
.eos-wheel text.none { fill: #475569; }
.eos-mine { margin-top: calc(var(--e) * 1); }
.eos-mine .hint { font-size: calc(var(--e) * .95); margin: calc(var(--e) * .6) 0 0; }
.eos-go { width: 100%; min-height: max(52px, calc(var(--e) * 3.6)); font-size: calc(var(--e) * 1.3); font-weight: 750; border-radius: calc(var(--e) * 1.1); margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--e) * .5); background: linear-gradient(145deg, #1fa35b, #127a40); }
.eos-go svg { width: calc(var(--e) * 1.4); height: calc(var(--e) * 1.4); }
.eos-spinning { font-size: calc(var(--e) * 1.3); font-weight: 750; margin: calc(var(--e) * .8) 0 0; animation: eospulse .9s ease-in-out infinite alternate; }
@keyframes eospulse { from { opacity: .45; } to { opacity: 1; } }
.eos-wait { font-size: calc(var(--e) * .92); color: var(--muted); margin: calc(var(--e) * .7) 0 0; line-height: 1.4; }
.eos-wait b { color: var(--text); }
.eos-yours { display: grid; gap: calc(var(--e) * .3); text-align: left; background: var(--soft); border-left: calc(var(--e) * .4) solid var(--c); border-radius: var(--e); padding: calc(var(--e) * .9) var(--e); margin-top: calc(var(--e) * .6); }
.eos-yours small { font-size: calc(var(--e) * .82); font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.eos-yours b { font-size: calc(var(--e) * 1.45); font-weight: 750; letter-spacing: -.015em; line-height: 1.15; }
.eos-yours span { font-size: calc(var(--e) * .95); color: var(--muted); }
.eos-yours em { font-style: normal; font-weight: 700; font-size: calc(var(--e) * 1); color: var(--amber); display: inline-flex; align-items: center; gap: 6px; }
.eos-yours.s-ok em { color: var(--green); }
.eos-yours .btn { margin-top: calc(var(--e) * .4); }
.eos-list { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(var(--e) * .5); }
.eos-task { background: var(--soft); border-left: calc(var(--e) * .4) solid var(--c); border-radius: calc(var(--e) * .9); padding: calc(var(--e) * .65) calc(var(--e) * .9); }
.eos-task.ok { background: var(--green-soft); }
.eos-n { font-weight: 700; font-size: calc(var(--e) * 1.1); line-height: 1.2; display: flex; align-items: baseline; justify-content: space-between; gap: calc(var(--e) * .6); }
.eos-n b { flex: none; font-size: .86em; font-weight: 800; color: var(--green); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Settings: the task editor's buttons under a task, and its window */
.tact { margin-top: 8px; }
.notice.taskdlg { text-align: left; max-width: 480px; }
.notice.taskdlg h2 { text-align: center; margin-bottom: 14px; }
.eos-d { font-size: calc(var(--e) * .88); color: var(--muted); margin-top: 1px; }
.eos-slots { display: flex; flex-wrap: wrap; gap: calc(var(--e) * .4); margin-top: calc(var(--e) * .45); }
.eos-p { display: inline-flex; align-items: center; gap: calc(var(--e) * .45); min-height: max(34px, calc(var(--e) * 2.5)); background: var(--card); color: var(--text); border: 0; border-radius: 999px; padding: calc(var(--e) * .2) calc(var(--e) * .3) calc(var(--e) * .2) calc(var(--e) * .85); font-size: calc(var(--e) * 1); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--line); }
.eos-w { display: inline-flex; align-items: baseline; gap: calc(var(--e) * .45); padding-right: calc(var(--e) * .5); }
.eos-w small { font-size: .82em; font-weight: 600; color: var(--muted); white-space: nowrap; }
.eos-p.open { color: var(--muted); font-weight: 600; background: transparent; box-shadow: inset 0 0 0 1.5px rgba(74, 90, 112, .35); padding-right: calc(var(--e) * .85); }
button.eos-p.open { color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.eos-p.done { background: var(--amber-soft); box-shadow: inset 0 0 0 1.5px var(--amber); }
.eos-p.ok { background: #fff; box-shadow: inset 0 0 0 1.5px var(--green); color: #0f5a30; }
.eos-p.ok .eos-w small { color: var(--green); }
.eos-p > button { border: 0; border-radius: 999px; min-height: max(30px, calc(var(--e) * 2.1)); padding: 0 calc(var(--e) * .85); font-size: calc(var(--e) * .92); font-weight: 750; background: var(--text); color: #fff; display: inline-flex; align-items: center; }
.eos-p > button.ok { background: var(--green); }
.eos-p > button.ghost { background: transparent; color: var(--muted); padding: 0 calc(var(--e) * .55); }
/* every task taken: no wheel, the list in two columns (the board on an all-hands night) */
.eos.full .eos-wheelbox { display: none; }
.eos.full .eos-body { grid-template-columns: minmax(0, 1fr); gap: calc(var(--e) * .9); }
.eos.full .eos-mine { margin-top: 0; }
.eos.full .eos-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .eos-card .eos.full .eos-list { grid-template-columns: 1fr; } }
.eos-card { padding: 18px; }
@media (max-width: 640px) { .eos-card .eos-body { grid-template-columns: 1fr; } .eos-card .eos-wheelbox { max-width: 300px; } }
/* Home: my end of shift task, beside the seat on a wide screen and under it on a phone */
.t-eos { --tc: var(--violet); --ts: var(--violet-soft); }
@media (min-width: 640px) { .strips.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } }
/* the windows the panel opens: pick a person, and the code pad's task badge */
.pickcard { max-width: 560px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; margin: 14px 0; }
.pick-grid button { min-height: 56px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font-size: 17px; font-weight: 650; padding: 4px 8px; }
.pick-grid button:active { background: var(--brand-soft); }
.pickcard details { text-align: left; margin-bottom: 12px; }
.pickcard summary { font-weight: 650; color: var(--muted); padding: 8px 2px; cursor: pointer; }
.pin-task { width: 72px; height: 72px; border-radius: 22px; background: var(--c); color: #fff; display: inline-flex; align-items: center; justify-content: center; margin: 4px 0 10px; }
.pincard.spun .pin-xp { color: var(--text); font-size: 30px; margin-bottom: 8px; }
/* the wall display's drawer: a tab at the right edge, the panel slides out from behind it */
.eos-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 12; width: min(96vw, max(560px, 62vw)); transform: translateX(100%); transition: transform .38s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.eos-drawer[hidden] { display: none; }
.eos-drawer.open { transform: none; }
.eos-scrim { position: fixed; top: 0; bottom: 0; right: 100%; width: 100vw; background: rgba(7, 20, 37, .32); opacity: 0; transition: opacity .3s; pointer-events: none; }
.eos-drawer.open .eos-scrim { opacity: 1; pointer-events: auto; }
.eos-panel { --e: clamp(12px, 1.02vw, 34px); position: absolute; inset: 0; overflow-y: auto; background: var(--card); color: var(--text); pointer-events: auto; border-radius: calc(var(--e) * 1.6) 0 0 calc(var(--e) * 1.6); padding: calc(var(--e) * 1.6) calc(var(--e) * 1.8); box-shadow: -24px 0 60px -24px rgba(7, 20, 37, .5); }
.eos-panel .eos { --e: inherit; }
.eos-handle { --e: clamp(12px, 1.02vw, 34px); position: absolute; right: 100%; top: 50%; transform: translateY(-50%); pointer-events: auto; writing-mode: vertical-rl; display: inline-flex; align-items: center; gap: calc(var(--e) * .6); border: 0; background: var(--text); color: #fff; border-radius: calc(var(--e) * 1) 0 0 calc(var(--e) * 1); padding: calc(var(--e) * 1.3) calc(var(--e) * .7); font-size: calc(var(--e) * 1.15); font-weight: 750; letter-spacing: .02em; box-shadow: -6px 0 20px -8px rgba(7, 20, 37, .55); }
.eos-handle svg { width: calc(var(--e) * 1.7); height: calc(var(--e) * 1.7); transform: rotate(180deg); transition: transform .3s; animation: eosnudge 2.4s ease-in-out infinite; }
.eos-drawer.open .eos-handle svg { transform: none; animation: none; }
.eos-handle b { font-weight: 750; font-size: .82em; background: #f5c542; color: #071425; border-radius: 999px; padding: calc(var(--e) * .5) calc(var(--e) * .2); }
.eos-handle b:empty { display: none; }
@keyframes eosnudge { 0%, 70%, 100% { translate: 0 0; } 82% { translate: -18% 0; } }
body.display.fall .eos-handle { background: #5a2d0c; }
@media (prefers-reduced-motion: reduce) { .eos-handle svg, .eos-spinning { animation: none; } .eos-drawer { transition: none; } }
