/* 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 (Bootmagic uses the same one): buttons, links, what's on, App → Music.
   The page background is not flat: a soft, warm radial glow up top sits over the base colour (body, below), so a
   screen of panels doesn't read as plain black. */
:root {
  --bg: #161615; --panel: #1f1f1e; --text: #ecebe7; --muted: #9c9b95; --line: #33332f; --hover: #2a2a28;
  --accent: #d9701e; --accent-text: #1c0c02; --accent-bg: #352416; --danger: #e07a6b;  /* accent-bg: a selected / highlighted background */
  --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);
  background-image: radial-gradient(1400px 650px at 50% -180px, rgb(255 255 255 / .12), transparent 70%); background-repeat: no-repeat; }
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; }
.manager-home .app-tile { border-left: 4px solid var(--accent); }
.admin-home .app-tile { border-left: 4px solid var(--muted); }

/* ---------- The Ask bar (js/ask.js): in the topbar on every screen, its answers in a panel under it ---------- */
.ask { position: relative; display: flex; align-items: center; gap: 8px; flex: 1 1 220px; max-width: 560px; min-width: 160px;
  padding: 0 10px; min-height: 40px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.ask:focus-within { border-color: var(--accent); }
.ask-icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.ask input { flex: 1; min-width: 0; border: 0; background: none; padding: 8px 0; font: inherit; color: var(--text); outline: none; }
.ask input::-webkit-search-cancel-button { filter: invert(.6); }
.ask-panel { position: absolute; top: calc(100% + 6px); left: -1px; right: -1px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 14px 40px rgb(0 0 0 / .45); max-height: min(70vh, 600px); overflow: auto; padding: 6px; z-index: 30; }
.ask-note { padding: 8px 10px; line-height: 1.4; }
.ask-fix { color: var(--accent); }
.ask-group { display: flex; align-items: center; gap: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 10px 4px; }
.ask-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.ask-row:hover, .ask-row.sel { background: var(--hover); }
.ask-big { font-weight: 600; line-height: 1.3; }
.ask-num { margin-left: auto; flex: none; text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.ask-sub { margin-top: 2px; }
/* "Build ▾": the question builder's drop-downs, above the answers in the same panel */
.ask-build { flex: none; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.ask-build:hover, .ask-build.on { background: var(--hover); color: var(--text); }
.ask-builder { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ask-builder label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); flex: 1 1 140px; min-width: 0; }
.ask-builder select, .ask-builder input { width: 100%; font: inherit; font-size: 14px; padding: 6px 8px; }
.ask-builder .btn { flex: none; }
.ask-num b { font-size: 20px; line-height: 1.1; }
.ask-mini { padding: 4px 10px; min-height: 0; font-size: 13px; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 10px 10px; }
.ask-chip { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.ask-chip:hover { background: var(--hover); }
@media (max-width: 640px) {
  .ask { order: 10; flex-basis: 100%; max-width: none; }
}

/* ---------- Clock in/out: each its own page (views/clock-punch.js), opened from a tile on the main page
   (views/home.js). A fake "working on it" sequence, a success popup, a streak badge -- none of it changes what's
   actually recorded. The loading/success modals are appended straight to <body> (not inside the page), so
   they're centered on the whole screen regardless of where the button sits. */
.clock-history-title { margin: 20px 0 8px; }

.clock-overlay { position: fixed; inset: 0; background: rgb(0 0 0 / .55); display: flex; align-items: center;
  justify-content: center; z-index: 80; padding: 20px; }
.clock-modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px;
  text-align: center; width: 100%; max-width: 300px; }

.clock-progress { height: 8px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; margin-bottom: 16px; }
.clock-progress-bar { height: 100%; width: 0%; border-radius: 99px; background: var(--accent); animation: clock-fill 4s linear forwards; }
@keyframes clock-fill { to { width: 100%; } }

.clock-step { font-size: 15px; color: var(--muted); min-height: 1.4em; }
.clock-step.stutter { animation: clock-stutter .3s steps(3); }
@keyframes clock-stutter { 0% { transform: translateX(-3px); opacity: .4; } 45% { transform: translateX(2px); } 100% { transform: translateX(0); opacity: 1; } }

.clock-success { animation: clock-pop .25s ease; }
@keyframes clock-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.clock-check { position: relative; width: 84px; height: 84px; margin: 0 auto 14px; }
.clock-check svg { width: 100%; height: 100%; }
.clock-check circle { stroke: var(--delivered); stroke-width: 3; stroke-dasharray: 145; stroke-dashoffset: 145; animation: clock-circle .4s ease forwards; }
.clock-check path { stroke: var(--delivered); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; animation: clock-tick .25s ease forwards .35s; }
@keyframes clock-circle { to { stroke-dashoffset: 0; } }
@keyframes clock-tick { to { stroke-dashoffset: 0; } }
.clock-success-text { font-size: 18px; font-weight: 700; }

.clock-confetti { position: absolute; inset: 0; pointer-events: none; }
.clock-confetti span { position: absolute; top: 50%; left: 50%; width: 7px; height: 11px; margin: -5px 0 0 -3px;
  background: hsl(var(--hue), 80%, 60%); opacity: 0; animation: clock-confetti-burst .9s ease-out forwards; }
@keyframes clock-confetti-burst {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(480deg); opacity: 0; }
}

.clock-streak { position: fixed; right: 16px; bottom: 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 99px; padding: 10px 18px; font-weight: 600; box-shadow: 0 8px 24px rgb(0 0 0 / .35);
  transform: translateY(20px); opacity: 0; transition: transform .3s ease, opacity .3s ease; z-index: 90; }
.clock-streak.show { transform: translateY(0); opacity: 1; }
body.has-player .clock-streak { bottom: calc(var(--mp-space) + 16px); }  /* (above Music's player bar) */

.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; }
#userName { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }  /* a long full legal name (all of it in its tooltip) */
.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; }
.code-box { margin: 14px 0; padding: 14px; border-radius: 8px; background: var(--hover);
  text-align: center; letter-spacing: 2px; font-size: 1.1em; word-break: break-all; }

/* ---------- 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.manager { color: var(--accent-text); background: var(--accent); text-transform: none; }
.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); }
.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; }
.items-table { margin-top: 8px; font-size: 13px; }
.items-table td { padding: 4px 8px; border-bottom: 0; }

/* ---------- 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; }
.secret.code { font-size: 28px; letter-spacing: 6px; text-align: center; font-weight: 700; }
.code-steps { margin: 4px 0 0; padding-left: 20px; }
.code-steps li + li { margin-top: 2px; }

.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); }
/* Bottle counting's product card (views/bottle-counting.js): a clear hierarchy -- big name, then the facts that
   say which bottle this is, then the two numbers that matter (price, on hand) big enough to read across a shelf. */
.bc-name { font-size: 22px; font-weight: 700; line-height: 1.2; }
.bc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bc-facts .meta { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.bc-facts b { font-size: 16px; font-weight: 600; }
.pickline { cursor: pointer; padding: 4px 0 4px 10px; border-left: 2px solid var(--line); margin-top: 4px; color: var(--muted); font-size: 13px; }
.pickline b { color: var(--text); }
.pickline:hover { color: var(--text); border-color: var(--accent); }
.search-group .top { margin-bottom: 2px; }
.bc-sibs { padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 2; }
.bc-sibs button { margin-right: 6px; }
.bc-pen { font-size: 14px; padding: 0 4px; text-decoration: none; opacity: .55; vertical-align: baseline; }
.bc-pen:hover { opacity: 1; }
.bc-name .bc-pen { font-size: 16px; }
.bc-inline { margin-top: 0; }
.bc-inline label { font-size: 12px; color: var(--muted); }
.bc-inline input { font-size: 15px; }
.bc-stat { padding: 14px 0; border-bottom: 1px solid var(--line); }
.bc-stat:last-child { border-bottom: 0; padding-bottom: 0; }
.bc-stat > span.meta { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.bc-value { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bc-value b { font-size: 28px; font-weight: 800; line-height: 1.1; }
.bc-sub { margin-top: 4px; }
.bc-edit { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 6px; }
.bc-edit label { flex: 1 1 120px; }
.bc-head { display: flex; gap: 12px; align-items: flex-start; }
.bc-auto { display: flex; align-items: center; gap: 8px; }
.bc-printer { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* What's been scanned from the scan card and not saved yet (bottle-counting.js showEntry) */
.gun-entry { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; padding: 12px 16px; margin-bottom: 12px;
  border: 2px solid var(--accent); border-radius: 10px; font-size: 16px; }
.gun-entry .on { color: var(--accent); }
.gun-problem, .gun-problem .meta { color: var(--danger); }  /* the scan card's "couldn't use this" lines */
/* The scan card (views/scan-card.js): barcodes to print and carry with the gun. White behind the bars on screen
   too, so it can be scanned straight off the monitor to try it. */
.scan-card { width: fit-content; max-width: 100%; }
.scan-card h2, .scard-how, .scard-example, .scan-card > .meta { contain: inline-size; }  /* the barcodes set the width; text wraps to it */
.scan-card h2 { margin: 0 0 12px; }
.scard-grid { display: grid; gap: 14px 24px; margin-bottom: 18px; }
.scard-grid.two { grid-template-columns: repeat(2, max-content); }
.scard-grid.three { grid-template-columns: repeat(3, max-content); }
.scard-key { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 12px; background: #fff; color: #000;
  border: 1px solid var(--line); border-radius: 8px; }
.scard-key b { font-size: 18px; letter-spacing: .04em; }
.scard-key.big b { font-size: 22px; }
.scard-key svg { display: block; }
.scard-how { margin: 6px 0 8px; padding-left: 22px; }
.scard-example { margin-bottom: 8px; }
@media (max-width: 700px) { .scard-grid.two, .scard-grid.three { grid-template-columns: 1fr; justify-items: start; } }
/* The Scan tab's light: lit while this window has the keyboard (the gun is caught page-wide, see onGunKey) */
.scan-ready { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--line);
  font-size: 18px; font-weight: 600; color: var(--muted); cursor: pointer; }
.scan-ready .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); flex: none; }
.scan-ready.on { color: var(--delivered); border-color: var(--delivered); border-style: solid; }
.scan-ready.on .dot { background: var(--delivered); box-shadow: 0 0 0 4px var(--delivered-bg); }
.scan-input { width: 100%; }
/* Scanner gun or phone camera (bottle-counting.js) */
.scan-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.scan-pick .btn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.camera-box { position: relative; border-radius: 12px; overflow: hidden; background: #000; border: 3px solid transparent; }
.camera-box video { display: block; width: 100%; max-height: 55vh; object-fit: cover; }
.camera-box .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; background: rgb(0 0 0 / .55); color: #fff; }
.camera-box .meta:empty { display: none; }
.camera-box.flash { border-color: var(--delivered); }
/* Order list (order-list.js) */
.ol-table { width: 100%; border-collapse: collapse; }
.ol-table td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.ol-qty { white-space: nowrap; }
.ol-qty label { display: inline-flex; flex-direction: column; font-size: 11px; color: var(--muted); margin-right: 8px; }
.ol-qty input { width: 64px; }
.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: thin; max-width: 100%; }
#nav a { white-space: nowrap; flex: none; }
/* Tabs wrap onto another line rather than run off the edge: a row that scrolled sideways with its scrollbar
   hidden left the last tabs unreachable with a mouse on a narrow window. */
.tabs { flex-wrap: wrap; }
.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.backfilled { color: #7a5a1f; background: #f3e4c4; text-transform: none; margin-left: 6px; }

/* ---------- Scheduling (schedule.js, schedule-people.js, my-schedule.js) ---------- */
.sched-nav b { font-size: 16px; }
.sched-store { position: relative; margin-bottom: 14px; }
.sched-store h2 { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.sched-store h2 .meta { font-weight: 400; }
.sched-wrap { overflow-x: auto; }
table.sched { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 640px; }
.sched th, .sched td { padding: 6px 4px; border: 1px solid var(--line); text-align: center; vertical-align: middle; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched th { color: var(--muted); font-weight: 600; }
.sched th.name, .sched td.name { text-align: left; width: 118px; font-weight: 600; }
.sched th.today { color: var(--accent); }
.sched td.hrs, .sched th.hrs { width: 48px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.sc-cell { cursor: pointer; }
.sc-cell:hover, .sc-cell:focus, .sc-cell.editing { outline: 2px solid var(--accent); outline-offset: -2px; }
.sc-off { color: var(--muted); }
.sc-away { color: var(--muted); font-style: italic; }
.sc-other { font-style: italic; }
.sc-unknown { color: var(--ordered); font-weight: 700; }
.sc-empty { color: var(--line); }
.sc-note { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ordered); vertical-align: middle; margin-left: 4px; }
.sc-x { float: right; font-size: 14px; padding: 0 4px; text-decoration: none; opacity: .35; }
.sc-x:hover { opacity: 1; color: var(--danger); }
.sc-edit { position: absolute; z-index: 20; width: min(380px, 94vw); box-shadow: 0 14px 40px rgb(0 0 0 / .5); }
.sc-edit input { width: 100%; font-size: 17px; }
.sc-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-picks .btn { padding: 4px 10px; font-size: 13px; }
.sched-foot select { width: auto; margin: 0; }
.sched-foot form input { min-width: 160px; }
.sched-foot form select { width: auto; margin: 0; }
.sched-notes { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.sched-notes li { margin: 3px 0; }
.sched-warn ul { margin: 6px 0 0 18px; padding: 0; }
.sched-warn li { margin: 2px 0; }
.sched-import summary { cursor: pointer; }
.sched-switch { margin-bottom: 12px; }
.sched-switch .meta { flex: 1 1 240px; }
.sched-timeoff form select, .sched-timeoff form input[type=date] { width: auto; margin: 0; }
.sched-timeoff form label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.print-title { display: none; }
.usual-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.usual-row label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; }
.usual-row input { width: 100%; min-width: 0; padding: 6px 4px; text-align: center; }
.usual-sum { flex: 1 1 100%; font-size: 12px; }
.items summary .usual-sum { margin-top: -4px; }
.hours-table th { text-align: center; }
.hours-table td { text-align: center; padding: 4px; }
.hours-table input { width: 84px; text-align: center; padding: 6px 4px; }
.ro .sc-cell { cursor: default; }
.ro .sc-cell:hover { outline: none; }
.my-week td.day { width: 120px; white-space: nowrap; }
textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); width: 100%; }
@media (max-width: 520px) { .usual-row { grid-template-columns: repeat(4, 1fr); } }
/* Printing a week: the one-page layout the paper schedule had -- the stores stacked, black on white */
@media print {
  header, .no-print, .sched-warn, .sc-edit, .sched-import, #toast, .sched-foot, .sched-notes, .sc-note, .sc-x, .sched-timeoff { display: none !important; }
  body { background: #fff; color: #000; font-size: 11px; }
  :root { --panel: #fff; --text: #000; --muted: #333; --line: #000; --bg: #fff; --accent: #000; }
  .print-title { display: block; font-size: 15px; font-weight: 700; margin: 0 0 8px; }
  .panel { border: 0; border-radius: 0; }
  .panel.pad { padding: 0; }
  .sched-store { page-break-inside: avoid; margin-bottom: 10px; }
  .sched-store h2 { margin: 6px 0 2px; font-size: 13px; }
  table.sched { min-width: 0; }
  .sched th, .sched td { border: 1px solid #000; padding: 2px 3px; font-size: 11px; }
  .sc-cell:hover { outline: none; }
  .sc-empty { color: #fff; }
  .sched-notes { font-size: 10px; }
  /* the scan card: a dashed edge to cut along */
  .panel.scan-card { border: 2px dashed #000; padding: 14px; }
  .scard-key { border-color: #000; }
  /* Music's player is never on paper */
  .mp-bar, .mp-now, .mp-sheet-wrap, .mp-watch { display: none !important; }
  body.has-player { padding-bottom: 0; }
}

/* ---------- Admin → App (app-home.js) ---------- */
.app-home-switch { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 4px 0 14px; cursor: pointer; }
.app-page { max-width: none; margin: 0; }
.app-tile-add { font: inherit; text-align: left; cursor: pointer; border-style: dashed; background: transparent; width: 100%; }
.app-tile-add img { opacity: .55; }
.app-tool-body > h3:first-child { margin-top: 0; }
.app-link-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.app-link-fields label, .app-link-add > label, .app-link-edit > label { display: flex; flex-direction: column; gap: 4px; }
.app-link-add textarea { resize: none; min-height: 44px; display: block; }
.app-link-add [data-moreopts-box] { margin-top: 10px; }
.app-add-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.app-add-actions .grow { flex: 1; }
.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-url { font-size: 13px; overflow-wrap: anywhere; }
.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; }
.app-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.app-note { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.app-note .bar { margin: 0; }
.app-note-title { font: inherit; font-weight: 600; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); padding: 4px 2px; }
.app-note-title:focus { outline: none; border-bottom-color: var(--accent); }
.app-note-body { border: 0; background: transparent; resize: vertical; min-height: 70px; padding: 4px 2px; }
.app-note-body:focus { outline: none; }
.btn.wide { width: 100%; }
.app-screen { max-width: 980px; }  /* App's tool screens: comfortable line lengths on a wide desktop */
.app-screen.wide { max-width: 1280px; }  /* notes sit side by side */
.app-modes { display: flex; gap: 6px; margin-bottom: 12px; }
.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-drops { margin-top: 12px; }
.app-drops .bar { margin-bottom: 6px; }
.app-drop { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 10px; }
.app-drop .actions { margin: 0; }
.app-drop.open .app-link-url { color: var(--text); font-weight: 600; }
.app-link.inbox { background: var(--accent-bg); }
.app-decide { margin-bottom: 0; }
.pill.new { color: var(--accent); background: var(--bg); text-transform: none; }
.pill.drop { color: var(--danger); background: var(--muted-bg); text-transform: none; }
.app-keep-pick { display: inline-flex; gap: 14px; flex-wrap: wrap; }
.app-keep-pick label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.app-keep-row { margin: 10px 0 6px; }
.app-keep-hint { margin-top: 8px; }
.app-note-keep { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.app-note-keep select { width: auto; margin-top: 0; padding: 3px 8px; font-size: 13px; }
.app-modes .chip { padding: 7px 16px; font-size: 14px; }
.app-pick { cursor: pointer; }
.app-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.app-pic { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); display: flex; flex-direction: column; }
.app-pic-img { border: 0; padding: 0; margin: 0; background: var(--bg); aspect-ratio: 4 / 3; cursor: zoom-in; display: block; width: 100%; }
.app-pic-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-pic-info { padding: 8px 10px 0; overflow-wrap: anywhere; }
.app-pic .actions { padding: 8px 10px 10px; margin: 0; gap: 6px; }
.app-pic .actions .btn { flex: 1; justify-content: center; padding-left: 6px; padding-right: 6px; }
.app-pic .app-link-edit { padding: 0 10px 10px; }
.app-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgb(0 0 0 / .9); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.app-lightbox img { max-width: 100%; max-height: calc(100% - 64px); object-fit: contain; border-radius: 6px; }
.app-lightbox-bar { display: flex; gap: 8px; }
@media (max-width: 560px) { .app-link-fields { grid-template-columns: 1fr; } }
@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; }
  .app-pics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .app-pic .actions { flex-wrap: wrap; }
  .app-pic .actions .btn { padding-top: 8px; padding-bottom: 8px; }
}

/* ---------- Manager → Files (views/files.js): App's rows and find box, Music's tab strip, a badge per kind ---------- */
.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; }   /* .price-tag.stock-out's pair */
.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 */
.links-out > .meta { margin-bottom: 8px; }   /* (an admin's note on the Admins only ones, above the list) */

/* ---------- Admin → App → Music (views/app-music.js) and its player (js/player.js) ----------
   The player lives outside the screens: a bar along the bottom of every screen while something's queued (a floating
   one on a phone, like Offline Music's; a full-width player bar on a computer), Now Playing over everything, and
   the sheets that slide up for Repeat, Speed, "…". Bootnet's accent (the orange at the top) for what's playing and on. */
:root { --music: var(--accent); --music-text: var(--accent-text); --music-dim: var(--accent-bg); --mp-space: 0px; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mp-ib { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none;
  color: var(--text); cursor: pointer; font: inherit; flex: none; }
@media (hover: hover) { .mp-ib:hover:not(:disabled) { background: var(--hover); } }  /* (a phone keeps :hover on whatever was last tapped) */
.mp-ib:disabled { opacity: .4; cursor: default; }
.mp-ib.on { color: var(--music); }
.mp-art { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 1; border-radius: 8px; color: var(--music);
  background: linear-gradient(180deg, #2e2a26 0%, #161412 55%, #060505 100%); flex: none; }
.mp-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-art-ph { display: grid; place-items: center; width: 100%; height: 100%; }
.mp-art-ph .ic { width: 46%; height: 46%; }
.mp-range { width: 100%; height: 28px; margin: 0; accent-color: var(--music); cursor: pointer; background: transparent; }
body.has-player { --mp-space: calc(84px + env(safe-area-inset-bottom)); padding-bottom: var(--mp-space); }
body.has-player #toast, body.has-player .updated-banner { bottom: calc(var(--mp-space) + 10px); }
body.has-player #toast { z-index: 100; }
html.mp-now-open, html.mp-now-open body { overflow: hidden; }

/* The bar along the bottom */
.mp-bar { position: fixed; left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right)); bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 40;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px; padding: 8px 6px 8px 8px;
  background: rgb(36 36 34 / .97); border: 1px solid #3a3a36; border-radius: 16px; box-shadow: 0 10px 30px rgb(0 0 0 / .5); }
@supports (backdrop-filter: blur(1px)) { .mp-bar { background: rgb(36 36 34 / .86); backdrop-filter: blur(14px); } }
.mp-bar[hidden] { display: none; }
.mp-bar-line { position: absolute; left: 16px; right: 16px; top: -1px; height: 2px; overflow: hidden; border-radius: 2px; pointer-events: none; }
.mp-bar-line span { display: block; height: 100%; background: var(--music); transform-origin: left; transform: scaleX(0); }
.mp-bar-song { display: flex; gap: 10px; align-items: center; min-width: 0; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer; }
.mp-art-sm { width: 46px; border-radius: 10px; }
.mp-art-xs { width: 40px; border-radius: 6px; }
.mp-bar-text { display: flex; flex-direction: column; min-width: 0; }
.mp-bar-text b, .mp-bar-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-bar-text b { font-size: 16px; font-weight: 600; }
.mp-bar-text span { font-size: 13px; color: var(--muted); }
.mp-bar-text .mp-lost, .mp-now-sub.mp-lost { color: var(--music); }
.mp-bar-controls, .mp-bar-right { display: flex; align-items: center; gap: 2px; }
.mp-bar .mp-play { background: var(--music); color: var(--music-text); }
.mp-bar .mp-play:hover { background: var(--music); filter: brightness(1.08); }
.mp-bar .mp-play .ic, .mp-bar [data-mp="next"] .ic, .mp-bar [data-mp="prev"] .ic { width: 24px; height: 24px; }
.mp-bar .mp-x { color: var(--muted); width: 36px; }
.mp-bar .mp-x .ic { width: 18px; height: 18px; }
.mp-bar .mp-wide-only { display: none; }
.mp-play.busy, .mp-big-play.busy { animation: mp-pulse 1s ease-in-out infinite alternate; }
@keyframes mp-pulse { to { opacity: .55; } }

/* Now Playing */
.mp-now { position: fixed; inset: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain; color: var(--text);
  background: linear-gradient(180deg, #1c1c1b 0%, #0b0b0b 60%, #000 100%); transform: translateY(100%); transition: transform .2s ease-out; }
.mp-now.open { transform: none; }
.mp-now[hidden] { display: none; }
/* A phone: one screen tall, the controls along the bottom, the cover taking whatever room is left (smaller on a
   small phone, or under a two-line title) -- never pushing the controls off the bottom */
.mp-now-inner { max-width: 540px; height: 100vh; height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; gap: 14px;
  padding: max(10px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
.mp-now-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.mp-now-top b { color: var(--music); font-size: 20px; }
.mp-round { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid #34342f;
  background: rgb(255 255 255 / .04); color: var(--music); cursor: pointer; padding: 0; }
.mp-round-pair { justify-self: end; width: auto; display: inline-flex; padding: 0 4px; border-radius: 99px; cursor: default; }
.mp-round-pair .mp-ib { color: var(--music); }
.mp-now-top > .mp-round:first-child { justify-self: start; }
.mp-now-body { display: flex; flex-direction: column; gap: 18px; flex: 1; min-height: 0; }
.mp-now-left { flex: 1 1 0; min-height: 140px; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; container-type: size; }
.mp-now-artbox { position: relative; width: min(100%, 54vh); }
@supports (width: 1cqmin) { .mp-now-artbox { width: 100cqmin; } }  /* the biggest square that fits */
.mp-now-artbox[hidden] { display: none; }
.mp-now-art { width: 100%; border-radius: 18px; box-shadow: 0 18px 50px rgb(0 0 0 / .5); }
.mp-watch-btn { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: inline-flex; gap: 8px; align-items: center;
  padding: 10px 16px; border: 0; border-radius: 99px; background: rgb(0 0 0 / .7); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.mp-watch-btn[hidden] { display: none; }
.mp-now-queue { place-self: stretch; height: 100%; overflow-y: auto; overscroll-behavior: contain; background: rgb(255 255 255 / .04);
  border: 1px solid #2a2a27; border-radius: 18px; padding: 6px; }
.mp-q-head { display: flex; gap: 10px; align-items: baseline; padding: 10px 10px 4px; }
.mp-q-head .link { margin-left: auto; }
.mp-q-row { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
@media (hover: hover) { .mp-q-row:hover { background: var(--hover); } }
.mp-q-row.now b { color: var(--music); }
.mp-q-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mp-q-text b, .mp-q-text .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-q-x { width: 36px; height: 36px; color: var(--muted); }
.mp-q-x .ic { width: 16px; height: 16px; }
.mp-q-empty { padding: 8px 10px; }
.mp-now-right { display: flex; flex-direction: column; gap: 6px; }
.mp-now-head { display: flex; gap: 12px; align-items: flex-start; }
.mp-now-names { flex: 1; min-width: 0; }
.mp-now-title { font-size: 24px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mp-now-sub { display: block; max-width: 100%; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--music); font: inherit;
  font-size: 18px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-now-sub:disabled { cursor: default; }
.mp-heart { color: #8d8d88; width: 48px; height: 48px; }
.mp-heart .ic { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.mp-heart.on { color: #ff5c7c; }
.mp-now-seek { margin-top: 10px; }
.mp-now-times { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.mp-now-controls { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 8px; }
.mp-ib-md { color: #9a9a95; width: 52px; height: 52px; }
.mp-ib-md .ic { width: 32px; height: 32px; stroke-width: 1.8; }
.mp-ib-lg { width: 60px; height: 60px; }
.mp-ib-lg .ic { width: 40px; height: 40px; }
.mp-big-play { width: 88px; height: 88px; background: var(--music); color: var(--music-text); }
.mp-big-play:hover:not(:disabled) { background: var(--music); filter: brightness(1.08); }
.mp-big-play .ic { width: 42px; height: 42px; }
.mp-now-extras { display: flex; justify-content: space-around; align-items: center; margin-top: 6px; }
.mp-extra { color: #8d8d88; width: 52px; height: 52px; position: relative; }
.mp-extra .ic { width: 28px; height: 28px; }
.mp-extra span { font-weight: 700; font-size: 16px; }
.mp-extra .ic + span { position: absolute; bottom: 2px; font-size: 10px; }
.mp-now-vol { display: flex; gap: 10px; align-items: center; color: var(--muted); margin-top: 8px; }

/* Sheets */
.mp-sheet-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center;
  background: rgb(0 0 0 / 0); transition: background .18s; }
.mp-sheet-wrap.open { background: rgb(0 0 0 / .6); }
.mp-sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: #262624; color: var(--text);
  border-radius: 22px 22px 0 0; padding: 6px 0 max(10px, env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .18s ease-out; }
.mp-sheet-wrap.open .mp-sheet { transform: none; }
.mp-sheet-title { padding: 12px 22px 8px; color: var(--muted); font-size: 13px; text-align: center; overflow-wrap: anywhere; }
.mp-sheet-row { display: flex; gap: 18px; align-items: center; width: 100%; min-height: 58px; padding: 10px 22px; border: 0; border-bottom: 1px solid #343430;
  background: none; color: var(--text); font: inherit; font-size: 17px; text-align: left; cursor: pointer; }
.mp-sheet-row:hover, .mp-sheet-row:focus-visible { background: rgb(255 255 255 / .05); outline: none; }
.mp-sheet-row > span { display: flex; flex-direction: column; min-width: 0; }
.mp-sheet-row .ic { width: 28px; height: 28px; color: #a3a39e; }
.mp-sheet-row.on .ic { color: var(--music); }
.mp-sheet-row.danger { color: var(--danger); }
.mp-sheet-row.danger .ic { color: var(--danger); }
.mp-sheet-tick { margin-left: auto; }
.mp-sheet-cancel { display: block; width: 100%; padding: 16px; border: 0; background: none; color: var(--music); font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; }

/* Watch video */
.mp-watch { position: fixed; inset: 0; z-index: 90; background: #000; display: flex; flex-direction: column; }
.mp-watch-top { display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)); }
.mp-watch-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-watch video { flex: 1; min-height: 0; width: 100%; background: #000; padding-bottom: env(safe-area-inset-bottom); }

/* The playing row: bars over its artwork in the accent, moving while it plays */
.mp-bars { display: inline-flex; align-items: flex-end; justify-content: center; gap: 3px; width: 22px; height: 18px; flex: none; }
.mp-bars i { width: 4px; height: 100%; border-radius: 2px; background: var(--music); transform-origin: bottom; transform: scaleY(.45);
  animation: mp-eq .8s ease-in-out infinite alternate; animation-play-state: paused; }
.mp-bars i:nth-child(2) { animation-delay: -.3s; animation-duration: .7s; }
.mp-bars i:nth-child(3) { animation-delay: -.55s; animation-duration: .95s; }
.mp-bars.on i, .mu-row.playing .mp-bars i { animation-play-state: running; }
@keyframes mp-eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .mp-bars i { animation: none; } .mp-now, .mp-sheet { transition: none; } }

/* Music's screens (and Manager → Files', which has the same tab strip) */
/* 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. */
.music .mu-tabs, .mf .mu-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); }
.mu-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; }
.mu-tab:hover { color: var(--text); }
.mu-tab.on { background: var(--music); color: var(--music-text); }
.mu-top { display: flex; gap: 10px; margin-bottom: 12px; }
.mu-shuffle { flex: 1; display: inline-flex; gap: 10px; align-items: center; justify-content: center; min-height: 54px; border: 1px solid #3a3a36; border-radius: 99px;
  background: #2b2b29; color: var(--music); font: inherit; font-size: 20px; font-weight: 600; cursor: pointer; }
.mu-shuffle .ic { width: 26px; height: 26px; }
.mu-round { display: inline-grid; place-items: center; width: 54px; height: 54px; flex: none; border: 1px solid #3a3a36; border-radius: 50%;
  background: #2b2b29; color: var(--music); cursor: pointer; padding: 0; }
@media (hover: hover) { .mu-shuffle:hover, .mu-round:hover { background: #33332f; } }
.mu-round.on { background: var(--music); border-color: var(--music); color: var(--music-text); }
.mu-find { margin-bottom: 10px; }
.mu-titlebar { gap: 12px; align-items: center; }
.mu-titlebar h1 { margin: 0; }
.mu-opts { margin: 4px 0 8px; }
.mu-opts summary { cursor: pointer; color: var(--muted); }
.mu-opts .app-keep-row { margin: 8px 0 4px; }
.mu-takeoff { margin-top: 28px; }
.mu-chips { align-items: center; }
.mu-chips .chip { display: inline-flex; gap: 5px; align-items: center; padding-top: 6px; padding-bottom: 6px; }
.mu-chips .chip .ic { width: 15px; height: 15px; }
.mu-chips .chip.on { background: var(--music); border-color: var(--music); color: var(--music-text); }
.mu-count { margin-left: auto; white-space: nowrap; }
.mu-none { padding: 12px 4px; }
.mu-head { display: none; }
.mu-row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "art main acts" "art nums acts";
  column-gap: 12px; row-gap: 3px; align-items: center; padding: 8px 4px; border-radius: 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .mu-row:hover { background: var(--hover); } }
.mu-row:focus-visible { outline: 2px solid var(--music); outline-offset: -2px; }
.mu-row.chosen { background: var(--music-dim); }
.mu-art { grid-area: art; width: 58px; border-radius: 9px; }
.mu-art .mp-art-ph .ic { width: 50%; height: 50%; }
.mu-art .mp-bars { display: none; position: absolute; inset: 0; width: auto; height: auto; padding: 24% 22%; background: rgb(0 0 0 / .6); }
.mu-row.now .mu-art .mp-bars { display: flex; }
.mu-row.now .mu-title { color: var(--music); }
.mu-check { grid-area: art; z-index: 1; place-self: center; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #fff; background: rgb(0 0 0 / .45); color: var(--music-text); }
.mu-check .ic { width: 18px; height: 18px; stroke-width: 3; }
.mu-row.chosen .mu-check { background: var(--music); border-color: var(--music); }
.mu-main { grid-area: main; min-width: 0; align-self: end; }
.mu-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 16px; font-weight: 500; line-height: 1.28; overflow-wrap: anywhere; }
.mu-sub { display: block; margin-top: 1px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-col { display: none; }
.mu-nums { grid-area: nums; align-self: start; display: flex; gap: 16px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.mu-nums > span { display: inline-flex; gap: 4px; align-items: center; }
.mu-nums .ic { width: 14px; height: 14px; }
.mu-plays .ic { fill: currentColor; stroke: none; }
.mu-acts { grid-area: acts; display: flex; align-items: center; gap: 2px; }
.mu-acts .pill { margin-right: 4px; }
.mu-fav .ic { width: 16px; height: 16px; fill: #ff5c7c; stroke: none; }
.mu-vid { color: var(--muted); }
.mu-vid .ic { width: 16px; height: 16px; }
.mu-more { color: var(--music); }
.mu-more .ic { width: 26px; height: 26px; }
.mu-acts [data-up], .mu-acts [data-down], .mu-acts [data-out] { color: var(--muted); }
.mu-list + .btn.wide { margin-top: 10px; }
.mu-selbar { position: sticky; bottom: calc(var(--mp-space) + 10px); z-index: 3; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 12px; padding: 10px 12px; background: #262624; border: 1px solid #3a3a36; border-radius: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / .45); }
.mu-selbar .grow { flex: 1; }
.mu-selbar .btn .ic { width: 16px; height: 16px; }
.mu-removed { margin-top: 22px; }
.mu-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; text-align: center; }
.mu-empty .btn { margin-top: 8px; }
.mu-empty-ic { width: 54px; height: 54px; color: var(--music); }
.mu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px 14px; }
.mu-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: var(--text); text-decoration: none; }
.mu-card-art { width: 100%; border-radius: 12px; margin-bottom: 6px; transition: transform .1s; }
.mu-card:hover .mu-card-art { transform: translateY(-2px); }
.mu-card b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-card .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-loose { margin-top: 16px; }
.mu-header { display: flex; gap: 18px; align-items: flex-end; margin: 4px 0 16px; }
.mu-header-art { width: 132px; border-radius: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / .4); }
.mu-header-text { min-width: 0; flex: 1; }
.mu-header-text h2 { font-size: 22px; overflow-wrap: anywhere; }
.mu-header-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mu-header-buttons .btn .ic { width: 16px; height: 16px; }
.mu-header-buttons .btn.primary { background: var(--music); border-color: var(--music); color: var(--music-text); }
.mu-header-buttons .mu-play-btn .ic { fill: currentColor; stroke: none; }
.mu-order-note { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mu-order-note .grow { flex: 1; }
.mu-pls { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.mu-pl { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--text); text-decoration: none; min-width: 0; }
@media (hover: hover) { .mu-pl:hover { background: var(--hover); } }
.mu-pl-art { width: 56px; border-radius: 9px; }
.mu-pl-art .mp-art-ph .ic { width: 44%; height: 44%; }
.mu-pl-text { display: flex; flex-direction: column; min-width: 0; }
.mu-pl-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {  /* the four automatic playlists two by two, so yours are in sight */
  .mu-pls.smart { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mu-pls.smart .mu-pl { flex-direction: column; align-items: flex-start; gap: 8px; }
  .mu-pls.smart .mu-pl-art { width: 44px; }
}
.music, .mu-edit { accent-color: var(--music); }
.music .btn.primary { background: var(--music); border-color: var(--music); color: var(--music-text); }
.music .btn .ic { width: 18px; height: 18px; }
.music .app-file-add .btn .ic { width: 18px; height: 18px; }
.mu-edit-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 20px 12px; }
.mu-edit-body > label { display: flex; flex-direction: column; gap: 4px; }
.mu-edit-body input { font-size: 16px; }
.mu-edit-art { display: flex; gap: 14px; align-items: center; }
.mu-edit-art .mp-art { width: 96px; border-radius: 12px; }
.mu-edit-artbtns { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.mu-edit-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 8px 20px 4px; }
.mu-edit-foot .btn.primary { background: var(--music); border-color: var(--music); color: var(--music-text); }

@media (max-width: 420px) {
  .mu-header { align-items: center; }
  .mu-header-art { width: 104px; }
  .mu-tab { padding: 9px 10px; }
  .mp-now-title { font-size: 22px; }
  .mp-big-play { width: 80px; height: 80px; }
}

/* A computer: the songs in columns; Now Playing side by side; a full-width player bar */
@media (min-width: 900px) {
  body.has-player { --mp-space: 84px; }
  .mp-bar { left: 0; right: 0; bottom: 0; border-radius: 0; border-width: 1px 0 0; padding: 8px 20px; column-gap: 18px; row-gap: 0;
    grid-template-columns: minmax(200px, 1fr) minmax(360px, 1.6fr) minmax(200px, 1fr); grid-template-areas: "song controls right" "song seek right"; }
  .mp-bar-line { display: none; }
  .mp-bar-song { grid-area: song; }
  .mp-bar-controls { grid-area: controls; justify-self: center; }
  .mp-bar-seek { grid-area: seek; display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
  .mp-bar-seek .mp-range { height: 18px; }
  .mp-bar-right { grid-area: right; justify-self: end; }
  .mp-bar .mp-wide-only { display: inline-grid; }
  .mp-bar .mp-bar-seek.mp-wide-only, .mp-bar .mp-vol.mp-wide-only { display: flex; }
  .mp-bar .mp-ib { width: 38px; height: 38px; }
  .mp-bar .mp-play { width: 40px; height: 40px; }
  .mp-vol { align-items: center; gap: 2px; }
  .mp-vol .mp-range { width: 110px; height: 18px; }
  .mp-bar .mp-ib.on { color: var(--music); }
  .mp-art-sm { width: 52px; }
  .mp-now-inner { max-width: 1100px; height: auto; min-height: 100%; padding: 18px 40px 30px; }
  .mp-now-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
  .mp-now-left { display: block; min-height: 0; container-type: normal; }
  .mp-now-artbox { width: min(100%, 64vh); margin: 0 auto; }
  .mp-now-queue { height: auto; max-height: 64vh; }
  .mp-now-title { font-size: 30px; }
  .mp-sheet-wrap { align-items: center; }
  .mp-sheet { max-width: 420px; border-radius: 16px; padding-bottom: 6px; transform: translateY(16px) scale(.98); opacity: 0; transition: transform .15s, opacity .15s; }
  .mp-sheet-wrap.open .mp-sheet { opacity: 1; }
  .mp-sheet-row { min-height: 50px; font-size: 15px; }
  .mp-sheet-row .ic { width: 22px; height: 22px; }
  .music .mu-tabs, .mf .mu-tabs { width: fit-content; max-width: 100%; }  /* only as wide as its tabs (a block, not inline-flex: that sticks surely) */
  .mu-tab { flex: 0 0 auto; padding: 8px 18px; }
  .mu-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .mu-head, .mu-row { grid-template-columns: 44px minmax(0, 2.4fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 64px 48px 160px; grid-template-areas: none;
    column-gap: 14px; align-items: center; padding: 6px 12px; }
  .mu-head { display: grid; padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px;
    text-transform: uppercase; letter-spacing: .04em; }
  .mu-head > span:nth-child(5), .mu-head > span:nth-child(6) { text-align: right; }
  .mu-head .ic { width: 14px; height: 14px; }
  .mu-row { border-radius: 0; border-bottom: 1px solid var(--line); }
  .mu-row:last-child { border-bottom: 0; }
  .mu-art { grid-area: 1 / 1; width: 44px; border-radius: 6px; }  /* (Select's tick sits on the cover, as on a phone) */
  .mu-art .mp-bars { padding: 26% 20%; }
  .mu-check { grid-area: 1 / 1; width: 26px; height: 26px; }
  .mu-main, .mu-acts { grid-area: auto; }
  .mu-main, .mu-col, .mu-time, .mu-plays, .mu-acts { grid-row: 1; }
  .mu-main { align-self: center; }
  .mu-title { -webkit-line-clamp: 1; font-size: 15px; }
  .mu-sub { display: none; }
  .mu-col { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 14px; }
  .no-album .mu-album { visibility: hidden; }
  .mu-nums { display: contents; }
  .mu-nums .ic { display: none; }
  .mu-time, .mu-plays { justify-content: flex-end; color: var(--muted); font-size: 14px; }
  .mu-acts { justify-content: flex-end; min-width: 0; }
  .mu-acts .pill { font-size: 11px; }
  .mu-more { opacity: .55; }
  .mu-row:hover .mu-more, .mu-row:focus-within .mu-more { opacity: 1; }
  .mu-header-art { width: 200px; }
  .mu-header-text h2 { font-size: 30px; }
  .mu-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}
