/* Colors live here; change them in one place. The app is always dark, for everyone, whatever the device setting.
   The accent is a solid, slightly dark orange -- Bootnet's too, the same three values: buttons, links, what's
   selected or on. accent-bg: a selected / highlighted background. Statuses keep their own colours (they mean something). */
:root {
  --bg: #161615; --panel: #1f1f1e; --text: #ecebe7; --muted: #9c9b95; --line: #33332f; --hover: #2a2a28;
  --accent: #d9701e; --accent-text: #1c0c02; --accent-bg: #352416; --danger: #e07a6b;
  --ordered: #e3c46b; --ordered-bg: #3a3220; --shipping: #8fb7e0; --shipping-bg: #1f2d3b;
  --delivered: #8ccb98; --delivered-bg: #1f3324; --muted-bg: #2c2c2a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 18px 0 8px; }

/* ---------- Top bar ---------- */
header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.brand .home-icon { width: 22px; height: 22px; color: var(--accent); }
.section-name { font-weight: 700; color: var(--muted); }
.section-name:empty { display: none; }
.section-name::before { content: "› "; color: var(--line); }

/* ---------- Main page ---------- */
.home { max-width: 760px; margin: 10px auto; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.app-tile { display: flex; gap: 16px; align-items: center; padding: 20px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; color: var(--text); text-decoration: none; transition: transform .08s, box-shadow .15s; }
.app-tile:hover { box-shadow: 0 6px 20px rgb(0 0 0 / .1); transform: translateY(-1px); }
.app-tile img { width: 56px; height: 56px; border-radius: 13px; flex: none; }
.app-tile b { display: block; font-size: 18px; }
.app-tile .meta { display: block; margin-top: 2px; }

.store-switch { padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.store-switch:empty { display: none; }
.store-switch::after { content: " ▾"; color: var(--muted); }
nav { display: flex; gap: 2px; margin-right: auto; }
nav a { padding: 6px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; }
nav a.on { background: var(--bg); color: var(--text); font-weight: 600; }
.admin-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; border-radius: 6px;
  color: var(--muted); text-decoration: none; }
.admin-btn[hidden] { display: none; }
.admin-btn svg { width: 20px; height: 20px; flex: none; }
.admin-btn:hover { background: var(--hover); }
.admin-btn.on { background: var(--bg); color: var(--text); font-weight: 600; }
.panel code { overflow-wrap: anywhere; }  /* long folder paths wrap on phones */
.test-light { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 13px;
  border: 1px solid var(--line); color: var(--muted); }
.test-light::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.test-light.on { color: #1b6b30; background: #d9f2df; border-color: #8fd19e; font-weight: 600; }
.test-light.on::before { background: #22a046; box-shadow: 0 0 6px #22a046; }
.test-light.warn { color: #7a5a00; background: #fbefc9; border-color: #e6c35c; font-weight: 600; }
.test-light.warn::before { background: #e0a800; }
.test-light.off { color: var(--muted); }
.meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 6px; color: var(--muted); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; }
.menu-body { position: absolute; right: 0; top: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px; min-width: 170px; box-shadow: 0 6px 20px rgb(0 0 0 / .12); display: flex; flex-direction: column; }
.menu summary { display: inline-flex; align-items: center; min-height: 40px; }
.me-icon { width: 20px; height: 20px; display: none; }
.menu-who { display: none; padding: 8px 10px 4px; }
.menu-body a, .menu-body button { padding: 8px 10px; text-align: left; border: 0; background: none; font: inherit; color: var(--text); text-decoration: none; border-radius: 6px; cursor: pointer; }
.menu-body a:hover, .menu-body button:hover { background: var(--hover); }
@media (max-width: 640px) {
  nav { order: 5; width: 100%; margin-right: 0; }
  .brand span { display: none; }
  .menu { margin-left: auto; }
  .admin-btn:not([hidden]) { margin-left: auto; }
  .admin-btn:not([hidden]) ~ .admin-btn, .admin-btn:not([hidden]) ~ .menu { margin-left: 0; }
  .admin-btn span { display: none; }  /* just the icons on a phone */
  #userName { display: none; }  /* the account shows as a person icon; the name is at the top of its menu */
  .me-icon, .menu-who { display: block; }
  .admin-btn { min-width: 40px; justify-content: center; }
  /* Keep the top row on one line: the store button already says where you are, so "› Orders" is dropped next to
     it, and a long store name is shortened with "…". */
  header { gap: 8px; }
  #topbar:has(.store-switch:not(:empty)) .section-name { display: none; }
  .store-switch { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- Layout ---------- */
main { padding: 20px; max-width: 1200px; margin: 0 auto; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
@media (max-width: 640px) { main { padding: 14px 16px; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.pad { padding: 16px 18px; }
.split { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 20px; align-items: start; }
.split > * { min-width: 0; }  /* let wide tables scroll inside the panel instead of stretching the page */@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.bar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.bar .grow { flex: 1; }
.center { min-height: 70vh; display: grid; place-items: center; }
.stack > * + * { margin-top: 12px; }
.scroll { overflow-x: auto; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.meta { color: var(--muted); font-size: 13px; }
.err { color: var(--danger); min-height: 1.2em; margin: 6px 0 0; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 7px 13px; border-radius: 7px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }
input, select { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); }
input[type=checkbox] { width: 17px; height: 17px; padding: 0; vertical-align: -3px; accent-color: var(--accent); }
input[type=number] { width: 86px; text-align: right; }
label { display: block; }
form label > input:not([type=checkbox]):not([type=radio]) { display: block; width: 100%; margin-top: 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks label { display: flex; gap: 6px; align-items: center; }

/* ---------- Sign-in screens ---------- */
.auth { width: 100%; max-width: 360px; padding: 26px; }
.auth .logo { width: 52px; height: 52px; border-radius: 12px; display: block; margin-bottom: 12px; }
.auth form > * + * { margin-top: 14px; }
.auth .btn { width: 100%; justify-content: center; padding: 10px; }

/* ---------- Store picker ---------- */
.stores { display: grid; gap: 10px; max-width: 520px; margin: 0 auto; }
.store-btn { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; font-size: 17px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.store-btn:hover { background: var(--hover); }
.store-btn.all-stores { border-color: var(--accent); background: var(--accent-bg); }
.store-btn.all-stores > span:first-child { display: flex; flex-direction: column; }
.store-btn.all-stores > span:first-child .meta { font-weight: 400; font-size: 13px; }
.store-btn .meta { font-weight: 400; }

/* ---------- Orders ---------- */
.list { max-height: calc(100vh - 160px); overflow-y: auto; }
@media (max-width: 760px) { .list { max-height: none; } }
.row { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
/* Orders list: a heading for each day orders were placed ("Today · 3 orders"). */
.day-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; padding: 7px 14px;
  background: var(--bg); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--text); }
.test-item { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.test-item label { flex: 1 1 90px; min-width: 0; }
.test-item label.grow { flex: 3 1 200px; }
.day-head span { font-weight: 400; color: var(--muted); }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--hover); }
.row.sel { background: var(--accent-bg); }
.row .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-weight: 600; }  /* label stays one line high when a long name wraps */
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; text-transform: capitalize; white-space: nowrap; background: var(--muted-bg); color: var(--muted); }
.pill.ordered { color: var(--ordered); background: var(--ordered-bg); }
.pill.shipping { color: var(--shipping); background: var(--shipping-bg); }
.pill.delivered { color: var(--delivered); background: var(--delivered-bg); }
.pill.arriving { color: var(--delivered); background: var(--delivered-bg); outline: 1px solid var(--delivered); }
.pill.late { color: var(--danger); background: var(--muted-bg); }
.pill.clock-in { color: var(--delivered); background: var(--delivered-bg); }
.pill.clock-out { color: var(--danger); background: var(--muted-bg); }
.pill.hot { color: var(--ordered); background: var(--ordered-bg); }    /* still live */
.pill.cold { color: var(--shipping); background: var(--shipping-bg); } /* moved to its own file */
.pill.admin { color: var(--delivered); background: var(--delivered-bg); }  /* People: this account is an admin */
.detail h2 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; align-items: center; }
.totals { margin-top: 12px; text-align: right; color: var(--muted); }
.totals b { color: var(--text); }
.move-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.move-box select { width: auto; display: inline-block; margin: 0; }
.move-box .meta { width: 100%; }
.back { display: none; }
@media (max-width: 760px) {
  .split.has-detail .list-panel { display: none; }
  .split:not(.has-detail) .detail { display: none; }
  .back { display: inline-block; margin-bottom: 10px; }
}

/* ---------- Calendar ---------- */
.year-switch { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.year-switch .btn { padding: 4px 12px; font-size: 18px; }
.cal-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.cal-layout > * { min-width: 0; }
.cal-side { position: sticky; top: 70px; display: grid; gap: 14px; max-height: calc(100vh - 90px); overflow-y: auto; }
@media (max-width: 760px) { .cal-layout { grid-template-columns: 1fr; } .cal-side { position: static; max-height: none; overflow: visible; } }
.cal-day h4 { margin: 12px 0 4px; font-size: 14px; color: var(--delivered); }
.month { padding: 12px; }
.month-title { min-width: 9.5em; text-align: center; }
.month-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.days .dow { font-size: 11px; color: var(--muted); padding-bottom: 2px; }
/* Roomy days: the date on top, then the 🛒 and 🚚 tags inside the box under it. */
.days .day { position: relative; border: 1px solid transparent; background: none; color: var(--text); font: inherit; font-size: 13px;
  min-height: 58px; padding: 5px 1px 4px; border-radius: 7px; cursor: pointer; font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column; align-items: center; gap: 2px; }
@media (min-width: 761px) { .days .day { min-height: 72px; font-size: 14px; } }
.days .day:hover { background: var(--hover); }
.days .day.past { color: var(--muted); }
.days .day.today { border-color: var(--accent); font-weight: 700; }
.days .day.has { font-weight: 700; color: var(--text); }
.days .day.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.days .day i, .days .day em { display: block; font-style: normal; font-size: 10px; font-weight: 700; line-height: 1.2;
  padding: 1px 4px; border-radius: 6px; white-space: nowrap; }
.days .day i { background: var(--shipping-bg); color: var(--shipping); }
.days .day em { background: var(--delivered-bg); color: var(--delivered); }
a.day-order { display: block; color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }

/* ---------- Reports ---------- */
.report-form select { margin-top: 4px; }
.report-form .bar label { flex: 1 1 170px; min-width: 0; }
.report-out > * { margin-top: 14px; }
/* Reports: size buttons, and the suggestions under the Product box. */
.field-label { font-size: 14px; margin-bottom: 4px; }
.size-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line);
  background: none; color: var(--text); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.suggest-wrap { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 4; margin-top: 2px; max-height: 320px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / .35); }
.suggest-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item.on { background: var(--hover); }
.suggest-none { padding: 10px 12px; }
.answer .big { font-size: 30px; font-weight: 800; line-height: 1.15; color: var(--accent); }
.answer .mid { font-size: 20px; font-weight: 700; }
.answer-cols { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start; }
.answer-cols > div { flex: 1 1 260px; }
.answer-cols > div > div + div { margin-top: 4px; }
.answer .before { border-left: 3px solid var(--line); padding-left: 18px; }
.chg { font-weight: 700; white-space: nowrap; }
.chg.up { color: var(--delivered); }
.chg.down { color: var(--danger); }
.chg.same { color: var(--muted); }
.items summary .n { text-align: right; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 7px 12px; border-radius: 7px; font: inherit; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--panel); color: var(--text); font-weight: 600; border: 1px solid var(--line); }
.roles { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.role { flex: 1 1 160px; display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.role:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.role input { margin-top: 3px; accent-color: var(--accent); }
.role > span { display: flex; flex-direction: column; }
.items > details { border-bottom: 1px solid var(--line); }
.items > details:last-child { border-bottom: 0; }
.items summary { padding: 12px 16px; cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; }
.items summary::-webkit-details-marker { display: none; }
.items summary:hover { background: var(--hover); }
.items summary .grow { flex: 1; min-width: 140px; }
.items .body { padding: 4px 16px 16px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 15px; background: var(--bg); border: 1px dashed var(--line);
  border-radius: 7px; padding: 10px 12px; word-break: break-all; user-select: all; }
pre.log { white-space: pre-wrap; font: 12px/1.4 ui-monospace, Consolas, monospace; margin: 10px 0 0; max-height: 300px; overflow: auto; }
.notice { background: var(--accent-bg); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.notice > * + * { margin-top: 8px; }

.narrow { max-width: 520px; margin: 0 auto; }
.ok { color: var(--delivered); font-weight: 600; margin: 0; }
select { width: 100%; margin-top: 4px; display: block; }

/* ---------- Setup page (/install) ---------- */
.setup { max-width: 600px; }
.setup > * + * { margin-top: 14px; }
.setup-head { display: flex; gap: 14px; align-items: center; margin: 8px 0 18px; }
.setup-logo { width: 56px; height: 56px; border-radius: 13px; }
.setup h2 { display: flex; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 14px; flex: none; }
.btn.big { font-size: 17px; padding: 12px 22px; width: 100%; justify-content: center; }
.steps { margin: 0; padding-left: 22px; }
.steps li { margin: 8px 0; }
.inline-icon { width: 20px; height: 20px; vertical-align: -4px; color: var(--accent); }
.substep { border-top: 1px solid var(--line); padding-top: 12px; }
.copy-row { display: inline-flex; gap: 8px; align-items: center; margin: 4px 0; }
.copy-row code { font: 14px ui-monospace, Consolas, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; user-select: all; }
.copy-row .btn { padding: 3px 10px; font-size: 13px; }
.substep > * + * { margin-top: 8px; }

#toast { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 9px 15px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 10; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; }

/* Prices: the price now → the new price, and when */
.change-chips { margin-bottom: 2px; }
.price-list { padding: 0; }
.price-row { display: grid; grid-template-columns: minmax(0, 2fr) 1.3fr 1.3fr .8fr; gap: 6px 14px; align-items: center;
             padding: 10px 14px; border-top: 1px solid var(--line); }
.price-row:first-child { border-top: 0; }
.price-cell .meta:first-child { display: none; }
.price-row .was { color: var(--muted); }
.cheaper { color: var(--delivered); }
.pricier { color: var(--danger); }
@media (max-width: 760px) {
  .price-row { grid-template-columns: 1fr; gap: 2px; }
  .price-cell .meta:first-child { display: inline-block; width: 48px; }
}

.price-tools { align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.price-tools .sort { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.price-tools .chip .link { padding: 0 0 0 4px; }
.rank { display: inline-block; min-width: 30px; color: var(--muted); font-weight: 700; }
.pct { font-weight: 700; font-size: 13px; margin-left: 4px; }
.pager { justify-content: space-between; align-items: center; margin: 12px 0 24px; }
.pager input { width: 64px; padding: 4px 6px; }
.letters { display: flex; flex-wrap: wrap; gap: 4px; }
.letters .chip { min-width: 30px; text-align: center; text-decoration: none; }
.brand-list { padding: 0 0 6px; }
.letter-head { margin: 0; padding: 10px 14px 4px; color: var(--accent); font-size: 15px; border-top: 1px solid var(--line); }
.letter-head:first-child { border-top: 0; }
.brand-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 14px; color: inherit; text-decoration: none; }
.brand-row:hover { background: var(--hover); }
@media (max-width: 760px) { .pager { flex-wrap: wrap; } .pager .meta { order: -1; width: 100%; text-align: center; } }
.cat-chips .chip .meta, .class-chips .chip .meta { font-size: 11px; }
.cat-chips .chip.on .meta, .class-chips .chip.on .meta { color: inherit; opacity: .8; }
.class-chips { padding-left: 10px; border-left: 2px solid var(--line); }
.price-where { color: var(--muted); font-weight: 600; }
.tracker { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.tracker-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.tracker-nums b { display: block; font-size: 22px; }
.tracker-nums .meta { font-size: 12px; }
.tracker progress { width: 100%; height: 8px; margin-bottom: 6px; accent-color: var(--accent); }
.bad-text, .bad-text b { color: var(--danger); }
.good-text b { color: var(--delivered); }
@media (max-width: 520px) { .tracker-nums { grid-template-columns: repeat(2, 1fr); } }
.stale { background: #3a2a14; border: 1px solid #a8742a; color: #f2d7a6; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.stale b { color: #ffd38a; }
.stale ul { margin: 6px 0 8px 18px; padding: 0; }
.tag-stale { display: inline-block; vertical-align: middle; font-size: 12px; font-weight: 700; padding: 2px 8px;
             border-radius: 99px; background: #a8742a; color: #1b1206; margin-left: 6px; }
.ask { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: var(--panel); border: 1px solid var(--line);
       border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.crash-log { margin-top: 8px; font-size: 13px; }
.crash-log summary { cursor: pointer; color: var(--muted); }
.crash-log ul { list-style: none; margin: 6px 0 0; padding: 0; }
.crash-log li { padding: 6px 0; border-top: 1px solid var(--line); }
.dist-line { margin: -4px 0 10px; }
.dist-list { display: grid; gap: 10px; margin-top: 10px; }
.dist-tile { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line);
             border-radius: 12px; color: inherit; text-decoration: none; }
a.dist-tile:hover { background: var(--hover); }
.dist-tile b { font-size: 17px; }
.dist-tile.off { opacity: .6; }
/* The section's links stay one row: each on one line, the row scrolls sideways on a phone if it doesn't fit */
#nav { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
#nav::-webkit-scrollbar { display: none; }
#nav a { white-space: nowrap; flex: none; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs button { white-space: nowrap; flex: none; }
.updated-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 50; font: inherit; font-weight: 700; padding: 12px 18px; border-radius: 99px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-text); box-shadow: 0 6px 24px rgb(0 0 0 / .35); max-width: calc(100% - 32px); }
.updated-banner[hidden] { display: none; }
.test-panel .bar { flex-wrap: wrap; }
.test-panel .bar .grow { flex: 1 1 220px; }
.live-view pre.log { white-space: pre-wrap; word-break: break-word; }
/* Calendar: an order and its truck share a letter and a colour (dot: ● ordered that day, ■ its truck that day) */
.otag { display: inline-block; min-width: 18px; padding: 0 4px; margin-right: 6px; border-radius: 5px; color: #111;
        font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; vertical-align: 1px; }
.days .dots { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; margin-top: 2px; max-width: 100%; }
.days .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.days .dot.truck { border-radius: 2px; }
.days .dots small { font-size: 9px; line-height: 7px; color: var(--muted); }
/* Prices: the Tag drop-down (Out of stock, Close out, New ... or In stock only) */
.tag-pick select { width: auto; min-width: 220px; max-width: 100%; display: block; margin-top: 4px; }
.price-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; margin: 2px 4px 0 0;
             background: var(--muted-bg); color: var(--muted); }
.price-tag.close-out { background: #3a2a14; color: #ffd38a; }
.price-tag.stock-out { background: #3d1c1c; color: #ff9b8f; }
.price-tag.trending { background: #173226; color: #8fe0b4; }
.reader-sites { margin-bottom: 12px; }

/* Calendar: each day's distributors as named chips, one colour per distributor (legend under the month) */
.days .day .dnum { line-height: 1.2; }
.days .dchips { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 0 3px; }
.dchip { display: block; font-size: 10px; font-weight: 700; line-height: 15px; border-radius: 4px; padding: 0 4px;
         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #111; background: var(--dc); }
.days .dchips small { font-size: 10px; color: var(--muted); font-weight: 600; }
@media (min-width: 761px) { .days .day { min-height: 86px; } .dchip { font-size: 11px; line-height: 16px; } }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.cal-legend .dchip { display: inline-block; }
.cal-show { margin-right: 8px; }
.dchip.inline { display: inline-block; vertical-align: 1px; margin-right: 4px; }

/* Next order */
.next-dists .chip { display: inline-flex; align-items: center; gap: 4px; }
.next-row { align-items: center; }
.next-qty { display: flex; flex-direction: column; align-items: flex-end; min-width: 8em; text-align: right; }
.next-sig { min-width: 10em; display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.pill.cheaper { color: var(--delivered); background: var(--delivered-bg); }
.pill.pricier { color: var(--danger); text-transform: none; }
.pill.cheaper { text-transform: none; }
@media (max-width: 760px) { .next-row { flex-wrap: wrap; } .next-qty, .next-sig { min-width: 0; align-items: flex-start; justify-content: flex-start; text-align: left; } }

/* Next order: three steps, big buttons */
.step { margin: 18px 0; }
.step h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; margin: 0 0 10px; }
.step .num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent);
             color: var(--accent-text); font-size: 15px; font-weight: 800; flex: none; }
.big-picks { display: flex; flex-wrap: wrap; gap: 10px; }
.big-pick { padding: 12px 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel, transparent); color: var(--text);
            font-size: 17px; font-weight: 700; text-decoration: none; }
.big-pick:hover { background: var(--hover); }
.big-pick.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.dist-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.dist-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 10px; font: inherit;
             border: 1px solid var(--line); background: var(--panel, transparent); color: var(--text); cursor: pointer; }
.dist-card:hover { background: var(--hover); }
.dist-card.on { outline: 3px solid var(--accent); outline-offset: -1px; }
.dist-card .dc-top { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.dist-card .dc-when { font-weight: 700; font-size: 15px; }
.next-help { margin-top: 24px; }
.next-help p { margin: 8px 0 0; }
.dist-card .dchip { flex: none; max-width: none; }
.step { scroll-margin-top: 64px; }

/* Inventory / Reports form */
.report-form .big-label input { font-size: 17px; padding: 10px 12px; }
.report-form .big-label { font-weight: 700; }
.report-form .period-chips { margin-top: 4px; }
.report-form .more-options summary { cursor: pointer; }
.report-form .more-options .checks, .report-form .more-options > label { margin-top: 6px; }
.answer .whole-last { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Inventory answer: the product, then a box per period, then one line saying the difference */
.answer-title { font-size: 16px; margin-bottom: 10px; }
.answer-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.abox { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.abox.main { border-color: var(--accent); }
.abox .alabel { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.answer-change { margin-top: 12px; font-size: 16px; font-weight: 700; }
.abox .adates { margin: -2px 0 4px; }
.pill.test-pill { color: #7a5a00; background: #fbefc9; text-transform: none; margin-left: 6px; }
.pill.forgot { color: #7a5a1f; background: #f3e4c4; text-transform: none; margin-left: 6px; }
.pill.manual { color: var(--shipping); background: var(--shipping-bg); text-transform: none; margin-left: 6px; }  /* a punch added here */
.pill.voided { color: var(--danger); background: var(--muted-bg); text-transform: none; margin-left: 6px; }
.voided > summary .top > span:first-child, .row.voided .top > span:first-child { text-decoration: line-through; opacity: .6; }
.clock-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.clock-edit label { display: flex; flex-direction: column; gap: 4px; }
.clock-edit .wide { grid-column: 1 / -1; }
.clock-edit .actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.clock-history { font-size: 13px; color: var(--muted); }
.clock-history div { padding: 2px 0; }
@media (max-width: 520px) { .clock-edit { grid-template-columns: 1fr; } }

/* ---------- Remote (views/remote.js) and Admin tiles (views/admin.js) ---------- */
.admin-home .app-tile { border-left: 4px solid var(--muted); }
.warn-panel { border: 1px solid var(--danger); }
.warn-panel b { color: var(--danger); }
.pcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.pc-card .pc-name { font-size: 17px; }
.pc-card .actions { margin: 0; }
.pc-setup summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.setup-steps { margin: 8px 0 0; padding-left: 20px; }
.setup-steps li + li { margin-top: 6px; }
.mono { font-family: ui-monospace, Consolas, monospace; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.pc-form { margin: 14px 0; }
.pc-form label { display: flex; flex-direction: column; gap: 4px; }
.pc-form .wol-fields, .pc-form .link-fields { display: grid; gap: 10px; }
.scan-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.scan-list .btn { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.pc-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.pc-row.removed b { opacity: .7; }
.gone { margin-top: 16px; }
.gone summary { cursor: pointer; color: var(--muted); }
.crd-callout { border: 1px solid var(--accent); margin: 10px 0; }
.crd-callout b { color: var(--accent); }
.setup-steps .btn { margin: 6px 8px 2px 0; }
.setup-steps li { margin-bottom: 10px; }

/* ---------- Files (views/files.js, views/links.js): Bootnet's Manager → Files page, the same rules ---------- */
/* Its rows, find box and uploads are Bootnet's App rules (.app-*); its tab strip is Bootnet's Music one (.mu-tabs there). */
.app-screen { max-width: 980px; }  /* comfortable line lengths on a wide desktop */
.app-add-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.app-pick { cursor: pointer; }
.app-uploads { display: grid; gap: 8px; margin-top: 12px; }
.app-upload { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--bg); }
.app-upload .top { display: flex; justify-content: space-between; gap: 10px; }
.app-upload .top b { overflow-wrap: anywhere; }
.app-upload .top .meta { flex: none; white-space: nowrap; }  /* its size stays on one line beside a long name */
.app-upload progress { width: 100%; height: 8px; margin: 6px 0 2px; accent-color: var(--accent); }
.app-upload .bar { margin: 0; }
.app-find { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.app-find input { flex: 1; min-width: 0; }
.app-find select { width: auto; flex: none; margin-top: 0; }
.app-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.app-chips .chip .meta { font-size: 11px; }
.app-chips .chip.on .meta { color: inherit; opacity: .8; }
.app-links { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.app-link { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.app-link:last-child { border-bottom: 0; }
.app-link .actions { margin: 0; }
.app-link-main { min-width: 200px; }
.app-link-edit { flex-basis: 100%; }
.app-link.gone b { opacity: .8; }
.app-gone { margin-top: 14px; }
.app-gone summary { cursor: pointer; color: var(--muted); }
.app-gone > .meta { margin: 6px 0; }
.btn.wide { width: 100%; }
.bc-auto { display: flex; align-items: center; gap: 8px; }
/* The tab strip stays in reach on a long page: it sticks just under the topbar (main.js keeps --topbar-h to the
   topbar's height, which changes as it wraps; 61px is its usual one-line height, until that's measured). Its panel
   background is solid, so rows don't show through it; and when it's narrower than the page (a computer), a band of
   the page's own background runs on to its right (a shadow, clipped to the strip's height), so they don't show beside
   it either. */
.mf .mf-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 16px; overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  position: sticky; top: var(--topbar-h, 61px); z-index: 4; box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax 0 0); }
.mf-tab { flex: 1 0 auto; padding: 9px 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600; text-align: center; white-space: nowrap; }
.mf-tab:hover { color: var(--text); }
.mf-tab.on { background: var(--accent); color: var(--accent-text); }
.mf-add.over { border-style: dashed; border-color: var(--accent); background: var(--accent-bg); }
.mf-add .app-add-actions { margin-top: 0; }
.mf-add > .meta { margin-top: 10px; }
.mf-upname { margin-top: 8px; width: 100%; }
.mf-head { display: flex; justify-content: space-between; padding: 7px 12px; background: var(--bg); border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 700; }   /* not .day-head: that one is sticky at top:0, under the sticky topbar */
.mf-head span { font-weight: 400; color: var(--muted); }
.mf-row .app-link-main, .mf .app-link.gone .app-link-main { flex: 1 1 220px; min-width: 0; }   /* (Removed's too: its buttons line up with the list's) */
.mf-name, .mf-note, .mf-row .app-link-main > .meta, .mf .app-link.gone b { overflow-wrap: anywhere; }  /* (a long name, or "sent as …", wraps on a phone) */
.mf-type { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; font-size: 11px;
  font-weight: 800; letter-spacing: .03em; background: var(--muted-bg); color: var(--muted); }
.mf-type.pic { background: var(--ordered-bg); color: var(--ordered); }
.mf-type.pdf { background: #3d1c1c; color: #ff9b8f; }
.mf-type.sheet { background: var(--delivered-bg); color: var(--delivered); }
.mf-type.doc { background: var(--shipping-bg); color: var(--shipping); }
.mf-row.just { background: var(--accent-bg); }
.links-out .pill { text-transform: none; }   /* "Admins only", not "Admins Only" (.pill capitalizes) */
.links-out .link-row .grow { min-width: 0; overflow-wrap: anywhere; }   /* a long link or label wraps on a phone, never widening the page */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px; }  /* phones zoom in on any box under 16px when it's tapped */
  .app-link .actions { width: 100%; }
  .app-link .actions .btn { flex: 1 1 auto; white-space: nowrap; justify-content: center; padding-top: 9px; padding-bottom: 9px; }  /* (whole buttons wrap, not their words) */
  .app-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .app-chips .chip { flex: none; }
  .app-add-actions .btn { padding-top: 9px; padding-bottom: 9px; }
}
@media (max-width: 420px) { .mf-tab { padding: 9px 10px; } }
@media (min-width: 900px) {
  .mf .mf-tabs { width: fit-content; max-width: 100%; }  /* only as wide as its tabs (a block, not inline-flex: that sticks surely) */
  .mf-tab { flex: 0 0 auto; padding: 8px 18px; }
}

/* ---------- Jarvis (views/jarvis.js) ---------- */
.jarvis { display: grid; gap: 14px; max-width: 1100px; margin: 0 auto; }
.jv-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.jv-grid > * { min-width: 0; }
@media (max-width: 860px) { .jv-grid { grid-template-columns: 1fr; } }
.jv-log { min-height: 220px; max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.jv-msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; background: var(--hover); overflow-wrap: anywhere; }
.jv-msg.jv-you { align-self: flex-end; background: var(--accent-bg); }
.jv-msg.jv-jarvis { align-self: flex-start; }
.jv-msg.jv-note { align-self: center; background: none; color: var(--muted); font-size: 13px; }
.jv-events { margin-top: 4px; color: var(--muted); font-size: 12px; }
.jv-confirm { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--accent); border-radius: 10px; }
.jv-send { display: flex; gap: 8px; align-items: center; }
.jv-send input { flex: 1; min-width: 0; }
.jv-mic svg { width: 18px; height: 18px; }
.jv-mic.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.jv-mic.convo { box-shadow: 0 0 0 2px var(--accent); }   /* a conversation is open: tap the mic to end it */
.jv-pcs { display: grid; }
.jv-pc { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.jv-pc:first-child { border-top: 0; }
.pill.jv-on { color: var(--delivered); background: var(--delivered-bg); }
.pill.jv-off { color: var(--ordered); background: var(--ordered-bg); }
.pill.jv-offline, .pill.jv-connecting, .pill.jv-unreachable { color: var(--muted); background: var(--muted-bg); }
.jv-more summary { cursor: pointer; color: var(--muted); }
.jv-limits { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.jv-limits li + li { margin-top: 6px; }
.jv-settings label { display: flex; flex-direction: column; gap: 4px; }
.jv-update { color: var(--ordered); font-size: 12px; }
.jv-current { color: var(--delivered); font-size: 12px; }
/* the voice mode: his sphere, full screen over the page, as on his own page (views/jarvis-live.js draws it) */
.jv-live { position: fixed; inset: 0; z-index: 9; color: var(--text);
  background: radial-gradient(ellipse at 50% 42%, #1c1813 0%, #121211 48%, #0a0a09 100%); }
.jv-live[hidden] { display: none; }
body.jv-voice-open { overflow: hidden; }
.jv-live canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.jv-live-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; z-index: 2; }
.jv-live-brand { color: var(--muted); font-size: 12px; letter-spacing: .14em; }
.jv-live-captions { position: absolute; left: 0; right: 0; bottom: calc(140px + env(safe-area-inset-bottom)); text-align: center;
  padding: 0 20px; z-index: 2; pointer-events: none; }
.jv-cap-state { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); min-height: 16px; }
.jv-cap-heard { color: var(--muted); font-size: 14px; margin: 8px auto 0; max-width: 640px; overflow-wrap: anywhere; }
.jv-cap-heard b { font-weight: 600; color: #b9b7af; }
.jv-cap-heard b:not(:empty)::after { content: ': '; }
.jv-cap-reply { color: var(--text); font-size: 16px; margin: 6px auto 0; max-width: 680px; overflow-wrap: anywhere; }
.jv-live-bar { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex;
  flex-direction: column; align-items: center; gap: 10px; z-index: 2; padding: 0 16px; }
.jv-live-bar .jv-confirm { background: var(--panel); }
.jv-live-mic { width: 58px; height: 58px; border-radius: 50%; padding: 0; justify-content: center; }
.jv-live-mic svg { width: 26px; height: 26px; }
.jv-live-mic.on { animation: jv-pulse 1.2s infinite; }
@keyframes jv-pulse { 50% { opacity: .35; } }
.jv-live-note { position: absolute; left: 0; right: 0; bottom: calc(90px + env(safe-area-inset-bottom)); text-align: center;
  color: var(--muted); font-size: 13px; padding: 0 20px; z-index: 2; display: none; }
.jv-live-note.show { display: block; }
.jv-live-fps { position: absolute; left: 12px; bottom: 12px; font-size: 11px; color: var(--muted); display: none; z-index: 2; }
.jv-live-fps.show { display: block; }
@media (prefers-reduced-motion: reduce) { .jv-live-mic.on { animation: none; } }

/* Jarvis: the hub (his modes), the coding panel and the job panel (views/jarvis.js) */
.jv-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.jv-mode { font: inherit; font-size: 13px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); cursor: pointer; }
.jv-mode.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.jv-mode.coming { color: var(--muted); cursor: default; }
.jv-mode.coming small { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.jv-mode:disabled { cursor: default; opacity: .7; }
.jv-coding { font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.jv-coding[hidden] { display: none; }
.jv-project { max-width: 16em; }
.jv-project-text { flex: 1; min-width: 10em; }
.jv-brains { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.jv-brain { display: inline-flex; align-items: center; gap: 4px; }
.jv-brain.coming { color: var(--muted); }
.jv-brain input { margin: 0; }
.jv-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.jv-seg .btn { border: 0; border-radius: 0; padding: 4px 11px; font-size: 13px; }
.jv-seg .btn.active { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.jv-job { background: var(--hover); border-radius: 10px; padding: 8px 10px; }
.jv-job[hidden] { display: none; }
.jv-steps { margin: 6px 0 0; padding: 0; list-style: none; max-height: 11em; overflow-y: auto; }
.jv-step { padding: 2px 0 2px 1.4em; position: relative; }
.jv-step.done::before { content: '✓'; position: absolute; left: 0; color: var(--delivered); }
.jv-step.now::before { content: '›'; color: var(--accent); }
.jv-at { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }
.jv-finish { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.jv-finish::before { content: ''; }
.jv-q[hidden] { display: none; }
.jv-q, .jv-q-under { margin-top: 8px; }
.jv-q-text { font-weight: 600; margin-bottom: 6px; }
.jv-q-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.jv-q-own { display: flex; gap: 6px; margin-top: 6px; }
.jv-q-own input { flex: 1; min-width: 0; }
