:root {
  --ccv-yellow: #EEB111;
  --ccv-burgundy: #98132F;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #222222;
  --muted: #6b6b6b;
  --border: #e0e0e0;
  --green: #1a7a3c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: var(--ccv-burgundy);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar form {
  margin: 0;
}

.topbar button.link {
  background: none;
  border: none;
  color: #fff;
  opacity: 0.85;
  cursor: pointer;
  font-size: 14px;
}

.page {
  max-width: 480px;
  margin: 48px auto;
  padding: 0 16px;
}

.page.wide {
  max-width: 760px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
}

h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 14px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
}

input:focus {
  outline: 2px solid var(--ccv-yellow);
  border-color: var(--ccv-yellow);
}

button.primary {
  width: 100%;
  margin-top: 24px;
  padding: 12px;
  background: var(--ccv-burgundy);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button.primary:hover {
  opacity: 0.92;
}

.error {
  background: #fdecec;
  color: #a11;
  border: 1px solid #f3c2c2;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 4px;
}

.footer-link {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

.footer-link a {
  color: var(--ccv-burgundy);
  font-weight: 600;
  text-decoration: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.summary-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}

.summary-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

/* Settings > Advanced's email signature preview (views/settings/advanced.ejs)
   — wraps server-rendered signature HTML (lib/mailSignature.js's
   renderSignatureHtml), which carries its own inline styles the way a real
   email needs to; this box just visually sets it apart as "a preview of
   what gets sent", not part of the form above it. */
.signature-preview {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--bg);
}

.status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  margin-bottom: 10px;
}

.status-badge.connected {
  background: #e6f4ea;
  color: var(--green);
}

.status-badge.not-connected {
  background: #f2f2f2;
  color: var(--muted);
}

.status-badge.coming-soon {
  background: #fdf3d8;
  color: #7a5c00;
}

.connect-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 14px;
  background: var(--ccv-yellow);
  color: #4a3600;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

/* A provider that isn't switched on yet: looks like the button so the card
   keeps its shape, but is plainly inert. */
.connect-btn.disabled {
  background: #ececec;
  color: #9a9a9a;
  cursor: not-allowed;
}

.account-label {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.account-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.disconnect-form {
  margin: 12px 0 0;
}

.disconnect-btn {
  padding: 7px 13px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.disconnect-btn:hover {
  border-color: var(--ccv-burgundy);
  color: var(--ccv-burgundy);
}

/* Result of a connect / disconnect attempt, shown once on the dashboard. */
.notice {
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 0 0 20px;
}

.notice.success {
  background: #e6f4ea;
  color: var(--green);
  border: 1px solid #bfe3cb;
}

.notice.error {
  background: #fdecec;
  color: #a11;
  border: 1px solid #f3c2c2;
}

/* Something worth acting on that is not a failure — currently the automatic
   relist run holding items over because it hit its per-run ceiling. Amber
   rather than red on purpose: nothing went wrong, there is just more to do. */
.notice.warn {
  background: #fdf3e0;
  color: #8a5a00;
  border: 1px solid #f0d9a8;
}

.tool-note {
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted);
}

/* Cash Converters Shop's login form on its Settings connections card (see
   views/settings/connections.ejs) — reuses the plain label/input/
   button.primary styles above (same ones the full-page login/register forms
   use), just tightened up to fit a narrow .summary-card grid tile instead
   of a wide standalone .card. */
.cc-shop-connect-form label:first-child {
  margin-top: 4px;
}

.cc-shop-connect-form button.primary {
  margin-top: 16px;
  padding: 9px;
  font-size: 13px;
}

/* CSV Generator tool page (views/tools/csv-generator.ejs) */

.status-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 30px;
  font-size: 17px;
  font-weight: 700;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #eadfe2;
  border-top-color: var(--ccv-burgundy);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: none;
}

.running .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress-track {
  height: 11px;
  margin: 18px 0 10px;
  overflow: hidden;
  background: #eee8ea;
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ccv-burgundy), var(--ccv-yellow));
  transition: width .35s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.detail {
  min-height: 90px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fcfafb;
}

.detail .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.detail .value {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.message {
  display: none;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.4;
  font-size: 14px;
}

.message.success { display: block; color: var(--green); background: #e6f4ea; }
.message.error { display: block; color: #a11; background: #fdecec; }

.review-panel {
  display: none;
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid #f0d48a;
  border-radius: 10px;
  background: #fff9e8;
}

.review-panel.visible { display: block; }
.review-panel h2 { margin: 0 0 6px; font-size: 17px; }
.review-intro { color: var(--muted); margin-bottom: 12px; font-size: 13px; line-height: 1.4; }
.review-list { display: grid; gap: 10px; }

.review-item {
  padding: 12px;
  border-left: 4px solid var(--ccv-yellow);
  border-radius: 8px;
  background: white;
  font-size: 13px;
}

.review-name { font-weight: 800; overflow-wrap: anywhere; }
.review-reason { margin-top: 6px; color: #a11; font-weight: 700; }
.review-action { margin-top: 6px; color: var(--muted); line-height: 1.4; }

@media (max-width: 680px) {
  .details { grid-template-columns: 1fr; }
  .progress-meta { flex-direction: column; gap: 4px; }
}

@media (max-width: 480px) {
  .page { margin: 24px auto; }
  .card { padding: 20px; }
}

/* App shell: topbar icons + left sidebar (views/partials/shell-*.ejs) */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: #fff;
  opacity: 0.85;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.icon-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.14);
}

.app-shell {
  display: flex;
  align-items: stretch;
}

.sidebar {
  width: 180px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
}

.sidebar-heading {
  margin: 18px 0 6px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  margin-bottom: 4px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.sidebar-link:hover:not(.disabled) {
  background: var(--bg);
}

.sidebar-link.active {
  background: var(--ccv-burgundy);
  color: #fff;
}

.sidebar-link.disabled {
  color: #b6b6b6;
  cursor: not-allowed;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 32px 28px;
}

.main-content > *:not(.grid):not(.card):not(.review-panel):not(.fp-metrics):not(.fp-department-grid):not(.fp-status-grid):not(.je-price-strip):not(.je-metal-grid):not(.tm-listing-grid):not(.mc-page):not(.sb-page) {
  max-width: 760px;
}

.main-content .grid,
.main-content .card {
  max-width: 760px;
}

/* Settings sub-navigation tabs (views/partials/settings-subnav.ejs) */

.settings-subnav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 18px 0 24px;
}

.settings-tab {
  padding: 8px 4px;
  margin-right: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.settings-tab:hover {
  color: var(--text);
}

.settings-tab.active {
  color: var(--ccv-burgundy);
  border-bottom-color: var(--ccv-burgundy);
}

/* Photo Capture tool (views/tools/photo-capture.ejs) */

.btn-secondary,
.btn-dark {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-dark {
  background: #222;
  color: #fff;
}

.btn-dark:hover,
.btn-secondary:hover {
  opacity: 0.92;
}

.btn-secondary {
  background: var(--ccv-yellow);
  color: #4a3600;
}

.qr-reader {
  display: none;
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.qr-reader.visible {
  display: block;
}

.photo-preview {
  width: 100%;
  margin-top: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* Photos taken so far, before upload (views/tools/photo-capture.ejs,
   2026-08-27). Deliberately a scrolling row rather than a grid: this is used
   one-handed on a phone, and a row keeps the Take/Upload buttons in the same
   place no matter how many photos an item ends up with. */

.photo-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 6px;
  margin-top: 14px;
  -webkit-overflow-scrolling: touch;
}

.photo-strip:empty { display: none; }

.photo-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The number in the corner is the number that ends up in the filename. */
.photo-num {
  position: absolute;
  left: 6px;
  bottom: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

/* Sized for a thumb, not a mouse pointer. */
.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.photo-remove:hover { background: rgba(0, 0, 0, 0.85); }
.photo-remove:focus-visible { outline: 2px solid var(--ccv-yellow); outline-offset: 1px; }

/* Floorstock Pricing Dashboard (views/tools/floorstock-pricing.ejs) */

/* Compact single-row upload bar, per Shane's request — one control (the
   label, styled as a button) both opens the file picker and doubles as the
   "Upload report" action; no separate second button. */
.fp-upload-card { margin-bottom: 22px; padding: 18px 22px; }

.fp-upload-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.fp-upload-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
}

.fp-upload-copy strong { font-size: 15px; }
.fp-upload-copy span { color: var(--muted); font-size: 12px; line-height: 1.4; }

.fp-upload-btn {
  display: inline-block;
  width: auto;
  flex-shrink: 0;
  margin-top: 0;
  padding: 10px 18px;
  cursor: pointer;
  text-align: center;
}

.fp-upload-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.fp-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.fp-metric {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.fp-metric small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.fp-metric strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 24px;
}

.fp-metric p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.fp-department-grid {
  display: grid;
  /* Fixed at 7 columns (not auto-fit/auto-fill) so the 14 fixed departments
     always form two complete, evenly-stretched rows spanning the full
     width — an auto-sized track count leaves the second row's leftover
     buttons un-stretched whenever it doesn't divide evenly. */
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

@media (max-width: 900px) {
  .fp-department-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 680px) {
  .fp-department-grid { grid-template-columns: repeat(2, 1fr); }
  .fp-status-grid { grid-template-columns: repeat(2, 1fr); }
}

.fp-department-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.fp-department-btn b {
  font-size: 13px;
  font-weight: 800;
}

.fp-department-btn.selected {
  background: var(--ccv-burgundy);
  border-color: var(--ccv-burgundy);
  color: #fff;
}

/* Small label above each button grid — added once there were two stacked
   grids (departments, then statuses) so it's clear which is which without
   having to read every button. */
.fp-grid-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

/* Status filter grid (Bought On Hold, On Layby, Awaiting Processing, etc.
   — see lib/tools/floorstockPricing/parseReport.js's STATUSES), added
   2026-08-22 alongside reading the full report instead of just the ON SALE
   section. Same visual treatment as the department grid above, in its own
   class so the two can diverge later without fighting each other. */
.fp-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}

.fp-status-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.fp-status-btn b {
  font-size: 13px;
  font-weight: 800;
}

.fp-status-btn.selected {
  background: var(--ccv-burgundy);
  border-color: var(--ccv-burgundy);
  color: #fff;
}

.fp-table-title { margin-bottom: 14px; }
.fp-table-title h2 { margin: 0 0 4px; font-size: 17px; }
.fp-table-title span { color: var(--muted); font-size: 13px; }

.fp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.fp-filters input[type="text"] {
  flex: 2;
  min-width: 200px;
}

.fp-filters select {
  flex: 1;
  min-width: 160px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}

.fp-table-wrap {
  overflow-x: auto;
}

.fp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fp-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.fp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.fp-table td b {
  display: block;
}

.fp-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.fp-table th.numeric,
.fp-table td.numeric {
  text-align: right;
}

.fp-empty {
  display: none;
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* This dashboard is data-dense (a filterable table, a 14-department grid) —
   Shane asked for it to use the full available width instead of being
   capped at the site's usual 760px prose width like a settings/form page.
   Overrides the general ".main-content .card"/"> *" caps above, for this
   tool's cards/sections specifically (by class, not by page), so no other
   tool is affected. */
.main-content .fp-upload-card,
.main-content .fp-metrics,
.main-content .fp-department-grid,
.main-content .fp-table-card,
.main-content .je-price-strip,
.main-content .je-metal-grid {
  max-width: none;
}

@media (max-width: 680px) {
  .fp-filters input[type="text"],
  .fp-filters select {
    flex: 1 1 100%;
  }
}

@media (max-width: 680px) {
  .app-shell { flex-direction: column; }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
  }

  .sidebar-heading {
    width: 100%;
    margin: 4px 0 0;
  }

  .main-content { padding: 20px 16px; }
}

/* Jewellery Melt Dashboard (views/tools/jewellery-melt.ejs), ported
   2026-08-22 from the standalone CCV-Jewellery-Dashboard repo. Reuses the
   generic .fp-upload-card/.fp-metrics/.fp-status-grid/.fp-grid-label/
   .fp-table-card/.fp-table/.fp-filters/.fp-empty rules above verbatim
   (they're not actually floorstock-specific, just named after the first
   tool that needed them) — only the pieces genuinely specific to melt
   calculations get their own je- classes here: the metal-price strip, the
   metal/carat grid, the melt-risk priority badges, and the settings panel. */

.je-price-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(100deg, var(--ccv-burgundy-dark, #691124), var(--ccv-burgundy));
  color: #fff;
  border-radius: 10px;
  padding: 13px 18px;
  margin-bottom: 18px;
}

.je-price-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.je-price-status > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.je-price-status small {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #eacbd2;
}

.je-price-status b { font-size: 15px; }

.je-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #63d18b;
  box-shadow: 0 0 0 5px rgba(99, 209, 139, 0.17);
  flex-shrink: 0;
}

.je-price-meta {
  font-size: 11px;
  color: #f0d7dc;
  display: flex;
  align-items: center;
  gap: 14px;
}

.je-price-warning {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 5px 9px;
}

.je-danger-metric {
  border-top: 3px solid #c83c3c;
}

.je-metal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}

.je-metal-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.je-metal-btn b { font-size: 15px; font-weight: 800; }
.je-metal-btn small { font-weight: 600; color: var(--muted); }

.je-metal-btn.selected {
  background: var(--ccv-burgundy);
  border-color: var(--ccv-burgundy);
  color: #fff;
}

.je-metal-btn.selected small { color: #f0d7dc; }

.je-priority {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 26px;
  padding: 0 8px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 11px;
}

.je-priority.red { background: #fae0e0; color: #a31e1e; }
.je-priority.orange { background: #ffead0; color: #a95b00; }
.je-priority.yellow { background: #fff4bf; color: #876d00; }
.je-priority.green { background: #dcf2e4; color: #257342; }
.je-priority.unpriced { background: #ececec; color: #666; }

.je-review-reason {
  color: #9c5d00 !important;
}

.je-diff.negative b { color: #b62929; }
.je-diff.positive b { color: #257342; }

.je-settings-card { margin-bottom: 22px; }

.je-settings-card summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
}

.je-settings-body {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.je-settings-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.je-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.je-field input,
.je-field select {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  background: #fff;
}

.je-formula {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--wash, #f4f2f2);
  padding: 10px 12px;
  border-radius: 7px;
  margin: 0;
}

.je-settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.je-settings-actions .message {
  margin: 0;
  flex: 1;
}

@media (max-width: 900px) {
  .je-settings-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .je-price-strip { flex-direction: column; align-items: flex-start; }
  .je-settings-cols { grid-template-columns: 1fr; }
}

/* Bay Scanner / Storage Search (views/tools/bay-scanner.ejs,
   views/tools/storage-search.ejs) — ported 2026-08-23 from the standalone
   storage-scanner repo. bs- prefix, same convention as fp-/je- above. */

.bs-mode-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.bs-mode-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  opacity: 0.55;
}

.bs-mode-btn.active {
  opacity: 1;
}

.bs-mode-btn.accessories { background: var(--ccv-yellow); }
.bs-mode-btn.pawns { background: var(--ccv-burgundy); }

.bs-result {
  border-left: 6px solid var(--ccv-yellow);
  margin-top: 14px;
  padding: 16px 20px;
}

.bs-result.pawn {
  border-left-color: var(--ccv-burgundy);
}

.bs-label {
  font-weight: 700;
}

/* Staff settings (views/settings/staff.ejs) */

.staff-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.staff-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.staff-list-row:last-child {
  border-bottom: none;
}

.staff-list-row .disconnect-form {
  margin: 0;
}

/* Shared .tm-* classes, originally from the Trade Me Manager tool — that
   tool is now Online Questions (views/tools/online-questions.ejs), and
   these classes are also reused by Online Sales and Online Mail. */

.tm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tm-toolbar span {
  color: var(--muted);
  font-size: 14px;
}

.tm-toolbar .btn-secondary {
  width: auto;
  margin-top: 0;
  padding: 8px 16px;
}

.tm-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 28px 0 10px;
}

.tm-section:first-of-type .tm-section-title {
  margin-top: 0;
}

.tm-empty {
  color: var(--muted);
  font-size: 14px;
}

.tm-question-card {
  margin-bottom: 14px;
}

.tm-question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}

.tm-question-meta a {
  color: var(--ccv-burgundy);
  font-weight: 600;
  text-decoration: none;
}

.tm-question-meta a:hover {
  text-decoration: underline;
}

.tm-question-from {
  color: var(--muted);
  font-size: 13px;
}

.tm-question-text {
  margin: 8px 0 14px;
  font-size: 15px;
}

.tm-answer-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.tm-answer-form textarea:focus {
  outline: 2px solid var(--ccv-yellow);
  border-color: var(--ccv-yellow);
}

.tm-answer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.tm-counter {
  color: var(--muted);
  font-size: 12px;
}

.tm-answer-btn {
  width: auto;
  margin: 0;
  padding: 8px 18px;
}

.tm-answer-message {
  margin-top: 8px;
  margin-bottom: 0;
}

.tm-badge {
  display: inline-block;
  background: var(--ccv-yellow);
  color: #4a3600;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 6px;
}

.tm-badge-alert {
  background: #fdecec;
  color: #a11;
}

.tm-listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.tm-listing-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tm-listing-photo {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--bg);
}

.tm-listing-body {
  padding: 14px 16px;
}

.tm-listing-title {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 6px;
}

.tm-listing-title:hover {
  color: var(--ccv-burgundy);
}

.tm-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

@media (max-width: 600px) {
  .tm-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Online Sales tool (views/tools/online-sales.ejs), named "Trade Me
   Sales" until 2026-08-25 */

/* Rebuilt 2026-08-27 as three photo-first grids — the page is a visual
   check against a physical shelf, so the whole card is the tap target and
   the picture carries the identification, not the text. The .tm-sold-row
   rules further down are what the sold sections used before that; they're
   still used by other tools' pages, so they stay. */

.tm-area-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.tm-area-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.tm-area-card:hover .tm-listing-title {
  color: var(--ccv-burgundy);
}

/* Same box as a real photo so a missing picture doesn't collapse the card
   and break the grid's rhythm. */
.tm-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.tm-section-count {
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}

/* One source being unavailable is said inside the section it affects rather
   than in place of the whole page (2026-08-27, see lib/toolSources.js).
   Deliberately quieter than .error — the section below it may still be
   showing perfectly good fallback data, so this is an explanation, not an
   alarm. */
.tm-source-notice {
  display: none;
  background: #fff8e6;
  border: 1px solid #f0d999;
  color: #6b5313;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.tm-sold-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tm-sold-main {
  min-width: 0;
}

.tm-sold-row .tm-badge {
  flex-shrink: 0;
  margin-top: 0;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.tm-sold-row .tm-status-sale-completed {
  background: #e6f4ea;
  color: var(--green);
  border-color: transparent;
}

.tm-sold-row .tm-status-payment-received,
.tm-sold-row .tm-status-goods-shipped {
  background: #fff7e0;
  color: #8a6300;
  border-color: transparent;
}

/* Online Questions tool (views/tools/online-questions.ejs) — per-question
   source tag (e.g. "Trade Me"), sitting inline next to the listing link
   rather than below the text like the Dealer/alert badges. */
.tm-source-badge {
  margin-top: 0;
  background: var(--ccv-burgundy);
  color: #fff;
}

/* Link-out answer path (sources with supportsInlineAnswer: false, e.g.
   Cash Converters Shop — see lib/tools/onlineQuestions/engine.js) in place
   of the .tm-answer-form textarea. */
.tm-linkout-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tm-linkout-row .btn-secondary {
  width: auto;
  margin: 0;
  padding: 8px 18px;
  text-decoration: none;
  text-align: center;
}

.tm-mark-done-btn {
  width: auto;
  margin: 0;
  padding: 8px 18px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.tm-mark-done-btn:hover {
  border-color: var(--ccv-burgundy);
  color: var(--ccv-burgundy);
}

.tm-linkout-hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
  margin-bottom: 0;
}

/* Online Mail tool (views/tools/online-mail.ejs) — a single mail-list row
   shared by both the Gmail and Cash Converters Shop sections. .mail-row
   itself just stacks its flex header above an optional reply form (Gmail
   only, added 2026-08-25 — see .tm-reply-form below); the header row's own
   left/right split lives in .mail-row-flex. */
.mail-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mail-row-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mail-row-main {
  min-width: 0;
  flex: 1;
}

.mail-row-unread .mail-subject {
  font-weight: 700;
}

.mail-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.mail-row-top .tm-badge {
  margin-top: 0;
}

.mail-from {
  font-weight: 600;
  font-size: 14px;
}

.mail-date {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
  white-space: nowrap;
}

.mail-subject {
  font-size: 14px;
  margin-bottom: 2px;
}

.mail-snippet {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Full email text (2026-10-27), swapped in for .mail-snippet once loaded.
   pre-wrap keeps the customer's own line breaks; overflow-wrap stops a long
   link from pushing the card wider than the screen. */
.mail-body {
  font-size: 14px;
  margin-top: 6px;
}

.mail-body-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.mail-quoted {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.mail-quoted summary {
  cursor: pointer;
  margin-bottom: 6px;
}

.mail-row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.mail-row-actions .btn-secondary {
  width: auto;
  margin: 0;
  padding: 6px 14px;
  font-size: 13px;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .mail-row-flex {
    flex-direction: column;
  }

  .mail-row-actions {
    flex-direction: row;
    width: 100%;
  }

  .mail-row-actions .btn-secondary {
    flex: 1;
  }
}

/* Inline Gmail reply box (views/tools/online-mail.ejs), added 2026-08-25 —
   same textarea/row/message styling as Online Questions' .tm-answer-form,
   just under its own class since it's a sibling of .mail-row-flex rather
   than living inside it. */
.tm-reply-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.tm-reply-form textarea:focus {
  outline: 2px solid var(--ccv-yellow);
  border-color: var(--ccv-yellow);
}

.tm-reply-hint {
  color: var(--muted);
  font-size: 12px;
}

.tm-reply-btn {
  width: auto;
  margin: 0;
  padding: 8px 18px;
}

/* ---------- Floorstock Listing Tool review queue (2026-08-25) ----------
   Added with the move off the CSV importer: the tool used to be a single
   button and a progress bar, because the listings themselves lived in a CSV
   nobody could see until Trade Me imported it. Now every generated listing is
   a card here that has to be read and approved before it can go live, so this
   is where the actual work happens. */

.fl-generate-row {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}

.fl-generate-row > div { flex: 1 1 320px; }

.fl-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.fl-warnings {
  margin-top: 16px;
  padding: 12px 16px;
  border-left: 3px solid #d8a200;
  background: #fdf7e6;
  font-size: 0.9rem;
}

.fl-warnings ul { margin: 6px 0 0; padding-left: 18px; }

.fl-queue-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 32px 0 12px;
}

.fl-queue-header h2 { margin: 0; }

.fl-queue-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fl-muted { color: #666; font-size: 0.9rem; }

.fl-card { padding: 0; overflow: hidden; }

/* The left edge is the status at a glance when scrolling a queue of twenty. */
.fl-card.fl-status-needs_review { border-left: 4px solid #98132F; }
.fl-card.fl-status-failed { border-left: 4px solid #98132F; }
.fl-card.fl-status-approved { border-left: 4px solid #2e7d32; }
.fl-card.fl-status-publishing { border-left: 4px solid #d8a200; }

.fl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  flex-wrap: wrap;
}

.fl-card-head:hover { background: #fafafa; }

/* Takes the free space in the header row, which is what keeps the stock code
   and title hard left. Without the flex-grow they sit in the MIDDLE: the row is
   space-between, and the select checkbox added on 2026-09-01 made it three
   items instead of two, so the title was pushed into the gap between them. */
.fl-card-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.fl-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fl-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  color: #98132F;
  font-weight: 600;
}

.fl-card-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.fl-badge {
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eee;
  color: #444;
  white-space: nowrap;
}

/* An AI-estimated listing is the one worth reading twice — the description and
   price are a guess from photos, with no stock record behind them. */
.fl-badge.fl-source-ai { background: #fdf1d6; color: #7a5a00; }
.fl-badge.fl-source-report { background: #e6f2e6; color: #2e5d31; }

.fl-price { font-weight: 600; }

.fl-problems {
  margin: 0;
  padding: 12px 20px 12px 40px;
  background: #fdf0f2;
  color: #7a0f24;
  font-size: 0.9rem;
}

.fl-card-body {
  padding: 4px 20px 20px;
  border-top: 1px solid #eee;
}

.fl-photos {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0;
}

.fl-thumb {
  height: 120px;
  width: auto;
  border-radius: 4px;
  flex-shrink: 0;
  background: #f2f2f2;
}

.fl-report-line { margin: 0 0 14px; }

/* Where the item is actually going to be listed, added 2026-09-08.
   Deliberately reads like Trade Me's own breadcrumb — the same slash
   separators and the same Home-first trail — because it is answering the
   question staff would otherwise answer by opening Trade Me and looking. The
   last crumb is the one it lands in, so that is the one carrying weight. */
.fl-breadcrumb {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.7;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
}

.fl-crumb-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Wraps as a unit so a long trail breaks between crumbs rather than mid-word. */
.fl-crumb-trail {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  text-decoration: none;
  color: inherit;
}

a.fl-crumb-trail:hover .fl-crumb,
a.fl-crumb-trail:focus-visible .fl-crumb { text-decoration: underline; }

.fl-crumb { color: var(--ccv-burgundy); }

.fl-crumb-sep {
  color: #b9b9b9;
  user-select: none;
}

/* The category it actually lands in — the only crumb anyone needs to check. */
.fl-crumb-current {
  font-weight: 700;
  color: var(--text);
}

/* Second line, full width under the trail. */
.fl-crumb-note,
.fl-crumb-warn {
  flex-basis: 100%;
  font-size: 0.82rem;
  color: var(--muted);
}

.fl-crumb-warn { color: #8a5a00; font-weight: 600; }

/* Trade Me could not confirm it: the path is still shown, in plain grey,
   because the app's own record is better than nothing — it just isn't
   Trade Me's word for it, so it does not get the link colour. */
.fl-breadcrumb-stored .fl-crumb { color: var(--muted); }

.fl-crumb-missing {
  color: #a11;
  font-weight: 600;
}


.fl-field { display: block; margin-bottom: 14px; }

.fl-field > span {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.fl-field > span em {
  font-style: normal;
  font-weight: 400;
  color: #888;
}

.fl-field input,
.fl-field textarea { width: 100%; }

.fl-field-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.fl-field-row .fl-field { flex: 1 1 160px; }

.fl-shipping {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px 16px;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.fl-shipping legend { font-size: 0.85rem; font-weight: 600; padding: 0 6px; }

.fl-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.fl-ship-inputs { display: flex; gap: 8px; }
.fl-ship-inputs input[type="number"] { width: 90px; }
.fl-ship-inputs input[type="text"] { width: 140px; }

.fl-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fl-discard {
  background: none;
  border: none;
  color: #98132F;
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 6px;
}

.fl-card-message { font-size: 0.85rem; color: #666; }

.fl-published { margin-top: 32px; }

.fl-published-row {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

.fl-published-row a { margin-left: 8px; }

/* The review queue needs more room than the app's default 760px column: a
   card carries a photo strip, a long title, a description and three price
   fields side by side. Targeted by id so the width cap still applies to every
   other page — same approach as the .fp-* overrides above, but with ids
   because the generic ".main-content > *:not(...)" rule's long :not() chain
   out-specifies a plain class selector. */
.main-content #statusCard,
.main-content #queueHeader,
.main-content #selectionBar,
.main-content #queue,
.main-content #publishedList,
.main-content #queue .card {
  /* Widened from 1040px on 2026-09-01 at Shane's request. A review card is a
     form with a title, a description, three price fields and a shipping table
     in it — it uses the room. #selectionBar joined the list at the same time:
     it was still on the app's default 760px column, so the bar was visibly
     narrower than the cards it acts on. */
  max-width: 1400px;
}

/* button.primary and .btn-secondary are width:100% app-wide, which is right
   for a login form and wrong for a row of card actions — without this, Save /
   Check / Approve each take a full line of their own. */
.fl-actions button {
  width: auto;
  margin-top: 0;
  padding: 10px 18px;
}

.fl-actions .fl-discard {
  width: auto;
  padding: 6px;
}

/* ---------- Trade Me Manager (views/tools/trade-me-manager.ejs, 2026-08-26) ----------
   A dense list rather than the card-per-item layout the review queue uses:
   this tool is for working through hundreds of existing listings, so the row
   has to stay scannable at 600+ items. Reuses .fl-field/.fl-actions from the
   review queue for the edit panel, since that is the same job. */

.tm-tabs {
  display: flex;
  gap: 4px;
  margin: 24px 0 16px;
  border-bottom: 1px solid #ddd;
}

.tm-tab {
  width: auto;
  margin: 0;
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
}

.tm-tab.is-active {
  color: var(--ccv-burgundy);
  border-bottom-color: var(--ccv-burgundy);
}

.tm-bulkbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.tm-checkall {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.tm-bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.tm-bulk-actions button {
  width: auto;
  margin-top: 0;
  padding: 8px 16px;
  font-size: 14px;
}

.tm-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  margin-bottom: 6px;
}

.tm-row-check { display: flex; align-items: center; }

.tm-row-photo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #f2f2f2;
}

.tm-row-photo-empty { display: inline-block; }

.tm-row-main { flex: 1 1 auto; min-width: 0; }

.tm-row-title {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-row-meta { font-size: 0.82rem; color: #777; margin-top: 3px; }

.tm-row-price {
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.tm-row-action { flex-shrink: 0; }

.tm-row-action button,
.tm-row-action select {
  width: auto;
  margin-top: 0;
  padding: 7px 14px;
  font-size: 14px;
}

.tm-editor { margin: -2px 0 14px; }

.tm-editor-card { padding: 18px 20px; }

.tm-locked {
  font-style: normal;
  font-weight: 400;
  color: #98132F;
  font-size: 0.8rem;
}

/* Same reasoning as the review queue: a list of 600 listings needs more than
   the app's default 760px column. */
.main-content #bulkBar,
.main-content #list,
.main-content #tabs,
.main-content #list .card {
  max-width: 1040px;
}

@media (max-width: 680px) {
  .tm-row { flex-wrap: wrap; }
  .tm-row-main { flex: 1 1 100%; order: 3; }
}

/* Jewellery Listing Tool review queue (2026-08-26). Reuses the Floorstock
   .fl-* card rules — same job, same shape — and adds only what is specific to
   jewellery: the grid of structured fields the description is generated from,
   and the valued/standard distinction. */

.je-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 14px;
  margin-bottom: 6px;
}

/* An empty field is the thing most likely to be holding a listing back — a
   ring with no size can't go live — so it is visible without reading the
   problems list at the top of the card. */
.je-field-empty input {
  border-color: #d8a200;
  background: #fffdf5;
}

.fl-badge.je-valued { background: #efe6f5; color: #4a2a63; }

.je-preview { margin: 4px 0 16px; }

.je-preview summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.je-preview pre {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 12px 14px;
  margin: 10px 0 6px;
}

/* Photo ordering in the review queues (2026-08-26). Trade Me shows the first
   photo as the listing's main image, and Dropbox hands them over in folder
   order — so a valued ring would go live with its valuation certificate as the
   headline shot unless this can be changed before publishing. */

.fl-photo {
  margin: 0;
  flex-shrink: 0;
  position: relative;
}

.fl-photo .fl-thumb { display: block; }

.fl-photo.is-main .fl-thumb {
  outline: 3px solid var(--ccv-burgundy);
  outline-offset: -3px;
}

.fl-photo-main {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ccv-burgundy);
  text-align: center;
  padding-top: 4px;
}

.fl-photo-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding-top: 4px;
}

.fl-photo-actions button {
  width: auto;
  margin: 0;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  color: #444;
  cursor: pointer;
}

.fl-photo-actions button:hover {
  border-color: var(--ccv-burgundy);
  color: var(--ccv-burgundy);
}

/* ---- Trade Me Manager: Needs review tab (2026-08-26) ---- */

/* Count badge on the tab itself. Only the sold-in-store candidates are
   counted — see updateReviewBadge in the view for why. */
.tm-tab-badge {
  display: inline-block;
  min-width: 20px;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--ccv-burgundy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.tm-review-summary p {
  margin: 0 0 6px;
}

.tm-review-summary p:last-child {
  margin-bottom: 0;
}

/* The reason bulk withdraw is held back. Deliberately loud: it is the
   difference between a tidy list of things to delete and 43% of the account
   going dark because a stocktake was uploaded half-scanned. */
.tm-review-block {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--ccv-burgundy);
  background: #fdf3f5;
  border-radius: 4px;
  font-weight: 600;
}

.tm-review-section {
  margin-top: 28px;
}

.tm-review-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 17px;
}

.tm-review-count {
  padding: 2px 9px;
  border-radius: 10px;
  background: #eee;
  color: #555;
  font-size: 13px;
  font-weight: 700;
}

.tm-review-blurb {
  max-width: 70ch;
  margin: 0 0 12px;
  line-height: 1.5;
}

/* ---- Floorstock Dashboard: Trade Me listing status (2026-08-26) ---- */

.fp-tm-listed {
  color: #1a7f37;
  font-weight: 700;
  text-decoration: none;
}

.fp-tm-listed:hover {
  text-decoration: underline;
}

/* Not a red alarm: an unlisted item is work to do, not a fault. */
.fp-tm-missing {
  color: #9a6700;
  font-weight: 700;
}

.fp-tm-na {
  color: #bbb;
  font-weight: 400;
}

.fp-picklist {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eee;
}

.fp-picklist .fp-upload-copy {
  flex: 1 1 320px;
}

.fp-picklist-min {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #555;
  white-space: nowrap;
}

.fp-picklist-min input {
  width: 90px;
  margin: 0;
  padding: 8px 10px;
}

/* Buttons are width:100% app-wide, which would stack these full width. */
.fp-picklist-btn {
  width: auto;
  margin: 0;
  white-space: nowrap;
}

/* Shipping templates (views/settings/advanced.ejs), added 2026-08-28.
   Each template is its own form, boxed so a page with five of them still reads
   as five separate things rather than one very long form. */

.ship-template {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  background: #fafafa;
}

.ship-template.ship-new {
  border-style: dashed;
  background: #fff;
}

.ship-rows {
  display: grid;
  gap: 8px;
}

/* Description takes the room, price is a fixed narrow column, and the remove
   button is square at the end. Collapses to stacked rows on a phone below. */
.ship-row {
  display: grid;
  grid-template-columns: 1fr 110px 34px;
  gap: 8px;
  align-items: center;
}

.ship-row input {
  margin: 0;
}

.ship-remove {
  width: 34px;
  height: 38px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  color: #888;
  cursor: pointer;
}

.ship-remove:hover {
  color: #b00020;
  border-color: #b00020;
}

.ship-add {
  width: auto;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px dashed #bbb;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

.ship-hint {
  font-weight: 400;
  color: #777;
}

.ship-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.ship-actions button {
  width: auto;
  margin-top: 0;
  padding: 10px 18px;
}

.ship-delete {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #b00020;
  font-size: 14px;
  cursor: pointer;
}

@media (max-width: 620px) {
  .ship-row {
    grid-template-columns: 1fr 90px 34px;
  }
}

/* The shipping block on a review card (both Listing Tools). Same row layout as
   Settings so the two read as the same thing in two places. */

.fl-ship-template {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.fl-ship-template select {
  width: auto;
  min-width: 200px;
  margin: 0;
}

.fl-ship-rows {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.fl-ship-rows .ship-row {
  grid-template-columns: 1fr 100px 30px;
}

.fl-ship-rows .ship-remove {
  height: 34px;
}

.fl-ship-note {
  margin: 6px 0 0;
  font-size: 13px;
  color: #777;
}

/* Remove-a-photo button on a review card's thumbnail (2026-08-28). Sits on the
   image itself rather than in the caption, because the main photo's caption is
   the "Main photo" label and every photo — main included — has to be removable.
   .fl-photo is already position:relative. */

.fl-photo-remove,
.fl-photo-rotate {
  position: absolute;
  top: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 15px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease-in-out;
}

.fl-photo-remove { right: 4px; }
.fl-photo-rotate { left: 4px; }

.fl-photo:hover .fl-photo-remove,
.fl-photo:hover .fl-photo-rotate,
.fl-photo-remove:focus,
.fl-photo-rotate:focus {
  opacity: 1;
}

.fl-photo-remove:hover {
  background: #b00020;
}

.fl-photo-rotate:hover {
  background: var(--ccv-burgundy);
}

/* The thumbnail is turned with a transform while the rotated copy is being
   made and sent, so it has to be able to spill out of its own box briefly. */
.fl-photo .fl-thumb {
  transition: transform 0.15s ease-in-out;
}

/* Touch devices have no hover, and Photo Capture means these queues do get
   reviewed on a phone — so there the button is simply always visible. */
@media (hover: none) {
  .fl-photo-remove,
  .fl-photo-rotate {
    opacity: 1;
  }
}

/* "Brand new item" tick box on a review card (2026-08-28). Its own row above
   the shipping block: it changes what the listing claims about the goods, so it
   should not be mistaken for one more field in the price row. */

.fl-brand-new {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  font-weight: 600;
  cursor: pointer;
}

.fl-brand-new input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}

.fl-brand-new em {
  font-weight: 400;
  font-style: normal;
  font-size: 13px;
  color: #777;
}

/* The AI's second opinion on a ticket-based price (2026-08-28). Shown on every
   card where the two figures differ; only a wide gap also lands the item in
   Needs review, so this has to read as information rather than as a warning. */

.fl-second-opinion {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 10px;
  background: #eee;
  color: #555;
  font-size: 12px;
  white-space: nowrap;
}

/* Money possibly left on the table is the half worth catching the eye. */
.fl-second-opinion.is-higher {
  background: #fff3cd;
  color: #6b5200;
}

/* The already-live warning on an unsold row, and the duplicate groups on the
   Needs review tab (2026-08-29). Both mark the same problem — one item on the
   site twice — so they read the same way. */

.tm-already-live {
  margin-top: 4px;
  font-size: 13px;
  color: #b00020;
}

.tm-already-live a {
  color: inherit;
  font-weight: 600;
}

.tm-duplicate-group {
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 3px solid #b00020;
}

.tm-duplicate-code {
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 13px;
  color: #b00020;
}

/* Automatic relisting's last-run breakdown (views/settings/advanced.ejs,
   2026-08-29). Long on a first run against a My Products backlog, so it is
   capped and scrolled rather than pushing the rest of the page away. */

.ar-list {
  max-height: 260px;
  margin: 6px 0 0;
  padding: 8px 8px 8px 26px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
}

.ar-list .ar-code {
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ar-list em {
  color: #777;
  font-style: normal;
}

.ar-skipped { color: #555; }

.ar-failed { color: #b00020; }

/* Why an unsold row is still sitting there — withdrawn on purpose, or already
   relisted. Grey rather than red: neither is a problem, they are explanations
   for why automatic relisting stepped over the row (2026-08-29). */

.tm-unsold-note {
  margin-top: 4px;
  font-size: 13px;
  color: #777;
}

.tm-unsold-note a {
  color: inherit;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Admin portal (views/admin/*, views/partials/admin-shell-start.ejs), added
   2026-08-31.

   The portal reuses the app shell's structure (topbar + sidebar + main) but
   none of its width limits: these pages are wide tables of every store's
   numbers, not settings forms, so ".admin-main" opts out of the 760px cap the
   rest of the hub uses. Everything here is prefixed .admin- so no tool page
   can pick these rules up by accident.
--------------------------------------------------------------------------- */

/* The "Admin" link the shared topbar shows a store whose row has is_admin
   (views/partials/shell-start.ejs). */
.admin-entry {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 4px 12px;
  opacity: 0.9;
}

.admin-entry:hover { opacity: 1; }

/* Darker than the store topbar on purpose: the portal should never be
   mistaken at a glance for the store side of the hub. */
.admin-topbar {
  background: #3a0a13;
}

.admin-whoami {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.admin-exit {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}

.admin-exit:hover { opacity: 1; }

.main-content.admin-main > *,
.main-content.admin-main .card,
.main-content.admin-main .grid {
  max-width: none;
}

.admin-breadcrumb {
  margin: 0 0 10px;
  font-size: 13px;
}

.admin-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.admin-breadcrumb a:hover { color: var(--text); }

/* Headline numbers. Same idea as the Floorstock Dashboard's .fp-metrics, kept
   separate so the two can diverge without one dragging the other with it. */
.admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
}

.admin-metric {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.admin-metric small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-metric strong {
  display: block;
  font-size: 26px;
  line-height: 1.2;
  margin: 4px 0 2px;
}

.admin-metric p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.admin-metric.good { border-left-color: var(--green); }
.admin-metric.warn { border-left-color: var(--ccv-yellow); }

/* The store tiles on the Store data page double as the store filter. */
.admin-metric-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.admin-metric-link:hover { border-color: var(--ccv-yellow); }

.admin-metric-link.selected {
  border-color: var(--ccv-burgundy);
  border-left-color: var(--ccv-burgundy);
  box-shadow: 0 0 0 1px var(--ccv-burgundy) inset;
}

.admin-card {
  padding: 20px 22px;
  margin-bottom: 20px;
}

.admin-card-title {
  margin-bottom: 14px;
}

.admin-card-title-spaced { margin-top: 22px; }

.admin-card-title h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.admin-card-title span {
  color: var(--muted);
  font-size: 13px;
}

.admin-card-title a,
.admin-list a,
.admin-table a {
  color: var(--ccv-burgundy);
  font-weight: 600;
  text-decoration: none;
}

.admin-card-title a:hover,
.admin-list a:hover,
.admin-table a:hover { text-decoration: underline; }

/* Two cards side by side on a wide screen, stacked on a narrow one. */
.admin-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  align-items: start;
}

.admin-table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.admin-table td small.danger { color: #a11; font-weight: 700; }

.admin-table th.numeric,
.admin-table td.numeric { text-align: right; }

.admin-empty {
  padding: 22px 12px;
  text-align: center;
  color: var(--muted);
}

/* Label/value rows — the card equivalent of a two-column table. */
.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.admin-list li:last-child { border-bottom: none; }

.admin-list li span { color: var(--muted); }
.admin-list li b { text-align: right; }

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-badge.good { color: var(--green); border-color: #bfe3cc; background: #e6f4ea; }
.admin-badge.warn { color: #8a6100; border-color: #f0dca0; background: #fdf5e2; }
.admin-badge.danger { color: #a11; border-color: #f3c2c2; background: #fdecec; }

/* One row per action on the store page: what it does on the left, the button
   on the right. */
.admin-actions {
  display: grid;
  gap: 4px;
}

.admin-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.admin-action b {
  display: block;
  font-size: 14px;
}

.admin-action span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.admin-action input[type="text"] {
  margin-top: 8px;
  max-width: 340px;
  font-size: 13px;
  padding: 7px 10px;
}

.admin-action button {
  flex: 0 0 auto;
  margin-top: 0;
}

.admin-action button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* The one-time temporary password / verification link. Deliberately loud: it
   is shown once and cannot be retrieved again. */
.admin-secret {
  border-color: var(--ccv-yellow);
  border-left: 4px solid var(--ccv-yellow);
  margin-bottom: 20px;
  padding: 18px 22px;
}

.admin-secret small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-secret code {
  display: block;
  margin: 8px 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  word-break: break-all;
}

.admin-secret p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.admin-filter-card { padding: 16px 22px; }

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.admin-filters label {
  margin: 0;
  flex: 1 1 170px;
}

.admin-filters input,
.admin-filters select {
  margin-top: 6px;
  font-size: 14px;
  padding: 8px 10px;
}

.admin-filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-filters button {
  width: auto;
  margin-top: 0;
}

.admin-link-btn {
  color: var(--ccv-burgundy);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.admin-link-btn:hover { text-decoration: underline; }

/* A pager control that is present but unavailable — the first page still shows
   "Previous", greyed, so the pair does not jump sideways between pages. */
.admin-link-btn.disabled {
  color: var(--muted);
  opacity: 0.5;
  cursor: default;
}

/* Search boxes want more room than a dropdown, so they take two of the
   filter row's flex slots rather than one. */
.admin-filters label.admin-filter-wide { flex: 2 1 260px; }

/* Sortable column headers (stock departures). The header keeps the muted
   uppercase treatment of every other admin table header — this only makes it
   clickable and marks which column is doing the sorting. */
.admin-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.admin-sort:hover { color: var(--ccv-burgundy); }

.admin-sort.active { color: var(--text); }

.admin-sort span {
  font-size: 9px;
  color: var(--ccv-burgundy);
}

/* Short status word in a table cell. Deliberately quiet by default: on this
   table the common case is the majority of rows, and only the exceptions
   should catch an eye. */
.admin-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-tag.good {
  border-color: var(--green);
  color: var(--green);
  background: transparent;
}

.admin-tag.warn {
  border-color: var(--ccv-yellow);
  color: #8a6d00;
  background: transparent;
}

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 12px 4px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* Share-published bar in the by-month table; the fill comes from an inline
   --fill custom property so the width is data, not a class per percentage. */
.admin-bar {
  display: block;
  position: relative;
  height: 8px;
  min-width: 90px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.admin-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill, 0%);
  background: var(--green);
}

@media (max-width: 680px) {
  .admin-action {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-action button { width: 100%; }

  .admin-whoami { display: none; }
}

/* The per-store stock position table (views/admin/_stock-table.ejs), added
   2026-08-31 in place of the "N floorstock rows" tiles. Every column is a
   figure, so the whole table is right-aligned apart from the store name, and
   the secondary line under a number ("237 of 304", "309 undated") carries the
   context that stops the headline figure being read as more than it is. */

.admin-stock-table td small {
  font-variant-numeric: tabular-nums;
}

.admin-stock-table td.numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Items over 1000 days: worth the eye landing on it, not worth an alarm. */
.admin-stock-table td.numeric.flagged {
  color: var(--ccv-burgundy);
  font-weight: 700;
}

.admin-stock-table tr.active {
  background: #fdf8e8;
}

.admin-totals-row td {
  border-top: 2px solid var(--border);
  border-bottom: none;
  font-weight: 700;
  background: var(--bg);
}

.admin-table-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Stock tiles and the store picker on /admin/data (added 2026-08-31, after
   Shane asked for tiles rather than the per-store table and pointed at the
   Floorstock Dashboard's own metric strip as the look he wanted). Same shape
   as .fp-metric deliberately — one visual language for "a number that matters"
   across the whole platform — but its own class, so restyling a tool's
   dashboard never silently restyles the admin portal or the reverse. */

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.admin-stat small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-stat strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.admin-stat p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* The store picker: checkboxes styled as chips, so several stores can be
   added together without the form looking like a form. */
.admin-store-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.admin-picker-label {
  font-size: 13px;
  font-weight: 600;
}

.admin-store-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.admin-chip:hover { border-color: var(--ccv-yellow); }

.admin-chip input {
  width: auto;
  margin: 0;
  accent-color: var(--ccv-burgundy);
}

.admin-chip.checked {
  border-color: var(--ccv-burgundy);
  background: #fdf2f4;
  color: var(--ccv-burgundy);
}

.admin-picker-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-picker-actions button {
  width: auto;
  margin-top: 0;
}

.admin-picker-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-inline-search {
  margin-bottom: 16px;
}

@media (max-width: 680px) {
  .admin-store-picker { flex-direction: column; align-items: stretch; }
  .admin-picker-actions button { width: 100%; }
}

/* Sidebar count badges (views/partials/shell-start.ejs, filled in by
   shell-end.ejs), added 2026-08-31: how many questions are unanswered and how
   much mail is unread, without opening the tool.

   Only ever shown with a number in it — see lib/toolBadges.js, which returns
   nothing at all for a count of zero or one it could not work out. There is no
   empty or error state to style. */

.sidebar-badge {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ccv-burgundy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* On the open tool the sidebar link is already burgundy, so the badge inverts
   rather than disappearing into it. */
.sidebar-link.active .sidebar-badge {
  background: #fff;
  color: var(--ccv-burgundy);
}

/* Collecting an online sale off the shop floor (views/tools/online-sales.ejs),
   added 2026-09-01.

   The card used to BE the link. It is now a panel containing one, because a
   <select> and a <button> cannot live inside an <a> — invalid markup, and every
   tap on them would navigate instead of doing what it says. These rules put the
   link back in charge of the photo and title, and give the controls their own
   strip along the bottom. */

.tm-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.tm-collect {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.tm-collect-staff {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  padding: 7px 8px;
  font-size: 13px;
}

.tm-collect-btn,
.tm-undo-btn {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tm-collect-btn {
  background: var(--ccv-burgundy);
  color: #fff;
}

.tm-collect-btn:hover { opacity: 0.92; }

.tm-collect-btn[disabled],
.tm-undo-btn[disabled] { opacity: 0.5; cursor: default; }

.tm-undo-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
}

.tm-undo-btn:hover { color: var(--text); }

.tm-collected-by {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.tm-collected-by small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
}

/* A store with nobody in Settings > Staff gets the way to fix it rather than
   an empty dropdown. */
.tm-collect-note {
  color: var(--ccv-burgundy);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.tm-collect-note:hover { text-decoration: underline; }

/* Selecting several drafts in a Listing Tool's review queue, added 2026-09-01.
   The checkbox sits inside the card header, which is also the expand/collapse
   target — the click guard for that is in the view, this just keeps it from
   crowding the stock code. */

.fl-select {
  display: flex;
  align-items: center;
  margin: 0 10px 0 0;
  padding: 4px;
  cursor: pointer;
}

.fl-select input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--ccv-burgundy);
  cursor: pointer;
}

/* Appears only once something is ticked. Sticky, because a selection made at
   the bottom of a hundred-card queue is acted on without scrolling back up. */
.fl-selection {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  /* Wraps so the legal-notice confirmation can take a full row underneath the
     buttons instead of squeezing them (2026-09-01). */
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--ccv-burgundy);
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.fl-selection span {
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 700;
}

.fl-selection button {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  font-size: 13px;
}

.fl-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.fl-sort span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.fl-sort select {
  width: auto;
  padding: 7px 10px;
  font-size: 13px;
}

/* "Not in stock report" on a review-queue card, added 2026-09-01. Amber, not
   red: this is a fact about the report that wants a look, not an error — the
   item may simply have sold in store, and a part-uploaded report produces the
   same flag on dozens of good drafts at once. */

.fl-badge-stock {
  background: #fdf5e2;
  border-color: #f0dca0;
  color: #8a6100;
  font-weight: 700;
}

/* Settings > Tools: arranging the sidebar (views/settings/tools.ejs), added
   2026-09-01. Up/down buttons rather than drag and drop — Shane's choice, and
   the right one for a shop floor: they behave the same on a phone, a tablet
   and a desktop, and cannot half-fail the way a dragged item can. Each button
   is its own tiny form, so the whole page works with no JavaScript at all. */

.tool-order-list {
  list-style: none;
  margin: 18px 0;
  padding: 0;
}

.tool-order-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}

.tool-order-row:last-child { border-bottom: none; }

.tool-order-position {
  flex: 0 0 auto;
  width: 22px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.tool-order-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}

/* A tool that is not usable yet still takes its place in the order — it will
   be usable one day, and moving it then should not be a second job. */
.tool-order-name small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.tool-order-moves {
  display: flex;
  gap: 6px;
}

.tool-order-moves form { margin: 0; }

.tool-order-btn {
  width: 36px;
  margin: 0;
  padding: 6px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.tool-order-btn:hover:not([disabled]) {
  border-color: var(--ccv-burgundy);
  color: var(--ccv-burgundy);
}

.tool-order-btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

/* The second stage on a collected card (views/tools/online-sales.ejs), added
   2026-09-01: out of the sold area, and how it left. Sits under the collection
   strip as its own row, so a card reads top to bottom as the item's actual
   journey — off the floor, then out the door. */

.tm-dispatch {
  padding-top: 10px;
}

.tm-dispatch-staff {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  padding: 7px 8px;
  font-size: 13px;
}

.tm-dispatch-btn {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid var(--ccv-burgundy);
  border-radius: 6px;
  background: none;
  color: var(--ccv-burgundy);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tm-dispatch-btn:hover:not([disabled]) {
  background: var(--ccv-burgundy);
  color: #fff;
}

.tm-dispatch-btn[disabled] { opacity: 0.5; cursor: default; }

.tm-dispatched-by {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ccv-burgundy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.tm-dispatched-by small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
}

.tm-section-note {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

/* An answer on the card that asked the question (2026-09-01). The page-wide
   status bar is at the very top of a long grid of photos, so a refusal from a
   card two screens down was written where nobody would see it — pressing Sold
   simply looked like it did nothing. */
.tm-card-error {
  margin: 0;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(158, 27, 50, 0.25);
  color: var(--ccv-burgundy);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

/* The tick box for a Trade Me category's legal notice (2026-09-01).
   Sits with the problems list above the fold, because the failure this fixes
   was a validation error telling someone to tick a box that was nowhere on the
   screen. Deliberately quiet once ticked — it is a record, not an alarm. */
.fl-legal {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(158, 27, 50, 0.18);
  background: #fff8f2;
  color: #6b4a12;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.fl-legal input[type="checkbox"] {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  cursor: pointer;
}

.fl-legal strong { font-weight: 700; }

.fl-legal em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.fl-legal-agreed {
  background: #f4f8f4;
  color: var(--muted);
  border-top-color: rgba(30, 110, 60, 0.18);
}

/* In the selection bar it is a full-width row under the buttons rather than
   another thing competing with them for the line. */
.fl-legal-bulk {
  flex: 1 0 100%;
  margin-top: 8px;
  border-top: none;
  border-radius: 6px;
}

/* Advice, not refusal (2026-09-01). The two used to share one red list, which
   made "the AI valued it higher than your ticket" look like the reason a
   listing would not go live. Amber, and headed as what it is. */
.fl-advice {
  margin: 0;
  padding: 12px 20px 12px 40px;
  background: #fdf8ec;
  color: #6b4a12;
  font-size: 0.9rem;
}

/* The heading line of either list. Carries no bullet, because it is not one of
   the notes. */
.fl-note-head {
  margin-left: -20px;
  list-style: none;
  font-weight: 700;
  opacity: 0.85;
}

/* `hidden` has to actually hide (2026-09-01).
   The browser's own [hidden] { display: none } is a user-agent rule, so ANY
   author rule that sets display beats it — .tm-checkall's display:flex meant
   setting selectAllWrap.hidden did nothing at all. This app hides things with
   the hidden attribute all over the place, so the fix belongs here once rather
   than as a per-class patch each time it bites. */
[hidden] { display: none !important; }

/* "Last uploaded …" under an upload card's description (2026-09-01). Sits below
   the explanation of what an upload does, and says what is on screen now.
   Distinct from the grey description above it, because it is a fact about this
   store's data rather than instructions. */
.fp-upload-when {
  margin-top: 2px;
  color: var(--ccv-burgundy);
  font-size: 12px;
  font-weight: 600;
}

.fp-upload-when:empty { display: none; }

/* The publish progress card (2026-09-01). Same bar and spinner the generation
   card uses — a store watching two of these should not have to learn two
   idioms — but it sits with the queue it acts on rather than at the top of the
   page, and stays out of sight entirely until a run has happened. */
.fl-publish-card {
  margin-bottom: 14px;
}

.fl-publish-results {
  margin: 12px 0 0;
  padding: 0 0 0 18px;
  font-size: 13px;
  line-height: 1.5;
}

/* A listing that did not go up. The reason is the whole value of the line, so
   it is printed rather than counted. */
.fl-publish-failed { color: #7a0f24; }

/* Already live is not a failure and must not read as one — nothing went wrong
   and this run did not do it. */
.fl-publish-note { color: var(--muted); }

/* The Published list's run heading and "show earlier" toggle (2026-09-01).
   The list used to be every listing the store had ever published, in stock-code
   order; it now leads with the last run and folds the rest away. */
.fl-published-run {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.fl-published-toggle {
  width: auto;
  margin: 12px 0 4px;
  padding: 6px 12px;
  border: 1px solid var(--ccv-burgundy);
  border-radius: 6px;
  background: none;
  color: var(--ccv-burgundy);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.fl-published-toggle:hover { background: var(--ccv-burgundy); color: #fff; }

/* ---------- Worth Listing (2026-09-03) ---------- */

.wl-rules { padding-bottom: 14px; }

.wl-rule-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.wl-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.wl-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.wl-input-money {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 14px;
}

.wl-input-money input {
  width: 88px;
  margin: 0;
  padding: 7px 9px;
  font-size: 14px;
}

.wl-join {
  padding-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
}

.wl-rule-form button { width: auto; margin: 0; padding: 9px 18px; }

.wl-rule-note {
  max-width: 68ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* The four figures that say whether this page is worth acting on today. */
.wl-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
  margin-bottom: 16px;
}

.wl-total { display: flex; flex-direction: column; gap: 2px; }

.wl-total strong {
  color: var(--ccv-burgundy);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.wl-total span { color: var(--muted); font-size: 12.5px; line-height: 1.35; }

.wl-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.wl-actions .btn-dark, .wl-actions .btn-secondary { width: auto; margin: 0; padding: 9px 18px; }

.wl-freshness {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule, #e4dcde);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* A department is a job somebody picks up, so it gets its own card with its
   own total — not a heading inside one long table. */
.wl-department { padding-top: 16px; }

.wl-dep-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.wl-dep-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }

.wl-dep-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.wl-dep-stats strong { color: var(--text, #1c1518); font-variant-numeric: tabular-nums; }

.wl-table-wrap { overflow-x: auto; }

.wl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.wl-table th {
  padding: 7px 10px;
  border-bottom: 2px solid var(--ccv-burgundy);
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.wl-table td { padding: 7px 10px; border-bottom: 1px solid #eee; vertical-align: top; }
.wl-table tbody tr:hover { background: #faf8f8; }

.wl-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.wl-code {
  color: var(--ccv-burgundy);
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
}

.wl-type { display: block; color: var(--muted); font-size: 11.5px; }

.wl-why {
  display: inline-block;
  padding: 2px 8px 3px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Aged is the one that earns a second look — the shelf has had its chance. */
.wl-why-price { background: #f4f0f1; color: var(--muted); }
.wl-why-aged { background: #f8f1dd; color: #8a6a10; }

.wl-truncated { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }

/* Printed and carried around a department with a camera, which is the actual
   job this page exists for. */
@media print {
  .app-sidebar, .app-header, .wl-rules, .wl-actions, .footer-link { display: none !important; }
  .app-main, .app-shell { margin: 0 !important; padding: 0 !important; }
  .card { border: none !important; box-shadow: none !important; padding: 0 0 18px !important; }
  .wl-department { break-inside: auto; }
  .wl-table { font-size: 10.5pt; }
  .wl-table thead { display: table-header-group; }
  .wl-table tr { break-inside: avoid; }
  a[href]::after { content: ""; }
}

/* The store's watermark banner in Settings > Advanced (2026-09-03). Shown on a
   chequerboard so a transparent PNG reads as transparent rather than white. */
.wm-preview {
  margin: 12px 0 6px;
  padding: 10px;
  border: 1px solid var(--rule, #e4dcde);
  border-radius: 6px;
  background-color: #fbfbfb;
  background-image:
    linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%),
    linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}

.wm-preview img { display: block; width: 100%; height: auto; }

.wm-upload { margin-top: 14px; }
.wm-upload input[type="file"] { display: block; margin: 6px 0 10px; font-size: 14px; }
.wm-upload button { width: auto; padding: 9px 18px; }

/* The line on Photo Capture telling staff the store banner is going on each
   photo as they take it (see lib/watermark.js). Deliberately quiet — it is a
   standing fact about the page, not a message. */
.wm-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Admin category check (2026-09-08) ----
   A diagnostic page: one title in, the rules workbook's two answers and Trade
   Me's suggestions out. Laid out as columns so the comparison is the page,
   rather than three lists someone has to hold in their head. */

.cc-form .cc-title-field { flex: 1 1 420px; }
.cc-form .cc-title-field input { width: 100%; }

.cc-routing { margin: 0 0 18px; }

.cc-answers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.cc-answer {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fbfbfb;
}

.cc-answer h3 {
  margin: 0 0 2px;
  font-size: 0.95rem;
}

.cc-answer-note { margin: 0 0 12px; }

/* The whole reason the page exists: this column disagreeing with the one
   beside it is the department gate losing a category the rules already had. */
.cc-answer-differs {
  border-color: #f0d9a8;
  background: #fdf9f0;
}

.cc-none {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.cc-suggestions {
  margin: 0;
  padding-left: 22px;
}

.cc-suggestions li { margin-bottom: 10px; }
.cc-suggestions .fl-breadcrumb { margin-bottom: 2px; }
.cc-suggestions p.fl-muted { margin: 0; }

/* The raw Trade Me reply on the category check, added 2026-09-09. Collapsed
   by default and opened automatically when the suggestions list is empty —
   that is exactly when somebody needs to see what came back instead. */
.cc-raw {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.cc-raw > summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.cc-raw-url { margin: 12px 0 6px; word-break: break-all; }

.cc-collections {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 0.9rem;
}

.cc-collections li { margin-bottom: 3px; }

.cc-collection-match {
  color: var(--green);
  font-size: 0.82rem;
}

.cc-raw-body {
  background: #f7f7f7;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-size: 0.8rem;
  line-height: 1.5;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.cc-catalogue { margin: 0 0 14px; font-size: 0.95rem; }

.cc-listable { margin: 0; font-size: 0.85rem; color: var(--green); font-weight: 600; }

/* The listable categories beneath a suggested browse node — the shortlist the
   matcher will be handed. Laid out tight because there can be a dozen. */
.cc-leaves {
  margin: 6px 0 0;
  padding-left: 20px;
  columns: 2;
  font-size: 0.88rem;
}

.cc-leaves li { margin-bottom: 2px; break-inside: avoid; }
.cc-leaf-name { color: var(--text); }

@media (max-width: 640px) { .cc-leaves { columns: 1; } }

/* The category chooser on a review card (2026-09-09), replacing a free-text
   ID box. It sits inside .fl-field-row beside Brand and Model, and needs more
   width than either because every option carries its full path. */
.cp { flex: 1 1 100%; }

.cp select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  /* A path like "Gaming > Xbox 360 > Games > Strategy puzzle" is long; let the
     control shrink rather than push the row sideways on a phone. */
  max-width: 100%;
}

/* Search box and the Trade Me button, side by side under the dropdown. */
.cp-hint {
  margin: 6px 0 0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.cp-hint input[type="search"] {
  flex: 1 1 220px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}

.cp-load {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--ccv-burgundy);
  text-decoration: underline;
  cursor: pointer;
}

.cp-load:disabled { color: var(--muted); cursor: default; }

.cp-search { margin-top: 10px; }
.cp-status { margin: 4px 0 0; font-size: 0.82rem; }

/* Saved category rules on the admin category page (2026-09-09). */
.cr-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.cr-table th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding: 0 10px 6px 0;
}
.cr-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.cr-table code { background: #f4f4f4; padding: 1px 5px; border-radius: 4px; }

/* Kept visible rather than hidden: seeing the rule that mis-filed something
   is worth more than a tidy list. */
.cr-off { opacity: 0.55; }

.cr-actions { white-space: nowrap; }
.cr-actions form { display: inline; margin-right: 10px; }
.cr-delete { color: #a11; }

/* The "remember this" box on a review card. */
.cp-remember {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fdf9f0;
  border: 1px solid #f0d9a8;
  border-radius: 6px;
}
.cp-remember-tick { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.cp-remember-word { margin-top: 8px; }
.cp-remember-note { margin: 6px 0 0; font-size: 0.82rem; }

/* The automatic-relist run time (2026-09-09). Given its own block because the
   time it runs is also the time relisted auctions close, which is worth more
   explanation than a control usually gets. */
.ar-time { margin: 18px 0; }

.ar-time-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ar-time-form label { font-size: 0.85rem; font-weight: 600; }

.ar-time-form input[type="time"] {
  display: block;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

/* ---------------------------------------------------------------------------
   Home-screen tiles (2026-09-10)
   ---------------------------------------------------------------------------
   The store's own position on the page it lands on after login. Two grids:
   the three "waiting on you" tiles, which are links to the tool that clears
   them, and the six stock tiles, which are read-only.

   Deliberately NOT the admin portal's .admin-metric — that one lives inside a
   dark-chromed portal and is a report row. These are the first thing a store
   sees in the morning and want more air. */
.home-heading {
  margin: 28px 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.home-tile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-tile small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-tile strong {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--text);
  /* Figures line up between tiles instead of jittering as digits change. */
  font-variant-numeric: tabular-nums;
}

.home-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* The "as at" line sits apart from the tile's own note — it is a caveat about
   the number, not part of what the number says. */
.home-tile-asat {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

/* A dash where a figure would be. Lighter than a real number so a tile that
   cannot answer never reads as one that answered zero. */
.home-tile-empty { color: var(--muted); }

.home-tile-warn { color: var(--ccv-burgundy); font-weight: 600; }

/* The three job tiles are links to the tool that clears them. */
.home-tile-job {
  text-decoration: none;
  color: inherit;
  border-left: 3px solid var(--ccv-yellow);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.home-tile-job:hover {
  border-color: var(--ccv-burgundy);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

/* Nothing waiting. Greyed rather than hidden: an empty queue is a real answer
   and worth seeing, it just should not pull the eye like a full one. */
.home-tile-clear { color: var(--muted); }

/* Stock tiles that go somewhere when clicked (the not-listed exports, the
   published gallery — see views/dashboard.ejs), added 2026-09-13. Same
   hover treatment as .home-tile-job above so every clickable tile on the
   home screen behaves the same way, just its own class since these two
   tile families were built independently and needn't share one selector. */
.home-tile-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-left: 3px solid var(--ccv-yellow);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.home-tile-link:hover {
  border-color: var(--ccv-burgundy);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.home-tile-link-note {
  display: block;
  margin-top: 8px;
  color: var(--ccv-burgundy);
  font-weight: 700;
  font-size: 12px;
}

/* Team leaderboard (views/dashboard.ejs) — the one place the home screen
   shows every real store's own number, added 2026-09-13 for Shane's
   internal listing campaign. Bars use the same --fill-custom-property
   technique as .admin-bar above, just taller and coloured by band instead
   of a single fixed colour, since here the colour IS the point: a store
   should be able to tell at a glance whether it's behind, in the middle, or
   ahead without reading the number first. */
.lb-intro { max-width: 640px; }

.lb-boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.lb-board {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}

.lb-board h3 {
  margin: 0 0 14px;
  font-size: 15px;
}

/* What this board is NOT counting. Quiet, but on the board itself: the rule is
   fixed for every store, so it can differ from a shop's own home tile. */
.lb-board-note {
  margin: -10px 0 14px;
  font-size: 12px;
  color: var(--muted);
}

.lb-row {
  display: grid;
  grid-template-columns: 140px 1fr 46px;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
}

.lb-row + .lb-row {
  border-top: 1px solid var(--border);
}

.lb-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

/* Why a store has no bar yet — shown as a second line under its name, same
   pattern as .home-tile-warn, rather than a bar reading as a confident 0%. */
.lb-row-note {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
}

.lb-bar-track {
  position: relative;
  height: 18px;
  border-radius: 6px;
  background: var(--bg);
  overflow: hidden;
}

.lb-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill, 0%);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.lb-bar-fill.band-behind { background: var(--ccv-burgundy); }
.lb-bar-fill.band-middle { background: var(--ccv-yellow); }
.lb-bar-fill.band-ahead { background: var(--green); }
.lb-bar-fill.band-none { background: var(--border); }

.lb-value {
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lb-value-muted {
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
}

@media (max-width: 560px) {
  .lb-row {
    grid-template-columns: 96px 1fr 40px;
    gap: 8px;
  }

  .lb-name { font-size: 12px; }
}

/* Tabs across a report that has several views of the same subject
   (/admin/stock-movement, 2026-09-10). Not a nav — the sidebar is the nav;
   these switch what the one report below is showing. */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin: 18px 0 0;
}

.admin-tab {
  padding: 9px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.admin-tab:hover { color: var(--text); }

.admin-tab.active {
  color: var(--ccv-burgundy);
  border-bottom-color: var(--ccv-burgundy);
}

.admin-tab-blurb {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 13px;
  max-width: 70ch;
}

/* A caveat about what the numbers below do and do not mean. Deliberately
   heavier than a subtitle: these say things like "a disappeared item is not a
   confirmed sale", which somebody reading the table needs to have seen. */
.admin-note {
  margin: 0 0 18px;
  padding: 11px 14px;
  background: #fffbeb;
  border-left: 3px solid var(--ccv-yellow);
  border-radius: 0 6px 6px 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  max-width: 90ch;
}

.admin-note code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

/* The export tile sits in the metric row, so the download is where the numbers
   are rather than hidden at the bottom of the page. */
.admin-metric-export {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  justify-content: center;
}

.admin-export-btn {
  width: auto;
  margin: 2px 0 0;
  padding: 8px 14px;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
}

/* Unit under a filter label — says which date the range applies to, since that
   differs per tab. */
.admin-filter-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* A button with its explanation beside it rather than under it — used where
   an action needs a caveat read before it is clicked (2026-09-10). */
.admin-inline-form {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.admin-inline-form button {
  width: auto;
  margin: 0;
}

.admin-inline-form span {
  color: var(--muted);
  font-size: 12px;
  max-width: 52ch;
}

/* A line of guidance under an input — smaller and quieter than the label, and
   not an error. Added 2026-09-11 for the stock-code box, where the example on
   its own was being read as a rule. */
.field-hint {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-hint b {
  color: var(--text);
  font-weight: 700;
}

/* Published listings quick view (views/published-gallery.ejs), added
   2026-09-13 behind the home page's "Published through the hub" tile — a
   photo grid so a team member can see what's actually live without leaving
   vdv-hub, styled after Trade Me's own "My Listings" grid Shane pointed at. */
.pub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

.pub-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pub-pagination .btn-secondary {
  width: auto;
  margin: 0;
  padding: 6px 14px;
  text-decoration: none;
  text-align: center;
}

.pub-page-of {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.pub-pagination-bottom {
  justify-content: center;
  margin-top: 20px;
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.pub-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pub-photo-link {
  display: block;
  line-height: 0;
}

.pub-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg);
  display: block;
}

.pub-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.pub-card-body {
  padding: 10px 12px 12px;
}

.pub-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  min-height: 2.7em;
}

.pub-title:hover { text-decoration: underline; }

.pub-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.pub-reserve {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.pub-code {
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  .pub-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
}

/* ---------------------------------------------------------------------------
   Hold Pricing Desk (2026-09-17)

   The three verdict colours are a diverging scale — under / on / over — and
   deliberately none of them is the burgundy: brand colour must never read as a
   judgement on somebody's price. Green is the hub's existing --green so "good"
   means the same thing here as on the leaderboard.
--------------------------------------------------------------------------- */

.hp-under { color: #10657f; }
.hp-on    { color: var(--green); }
.hp-over  { color: #a85b08; }

.hp-who {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}


.hp-score { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hp-score-k { font-size: 12px; color: var(--muted); }

.hp-chip {
  font-size: 12.5px;
  border-radius: 3px;
  padding: 3px 9px;
  border: 1px solid var(--border);
}
.hp-chip b { font-variant-numeric: tabular-nums; }
.hp-chip.under { color: #10657f; border-color: #bcdbe6; background: #f0f7fa; }
.hp-chip.on    { color: var(--green); border-color: #bfe0cc; background: #f0f8f3; }
.hp-chip.over  { color: #a85b08; border-color: #ecd4ac; background: #fdf6ec; }

/* Day tabs — one per day's buying. */
.hp-days {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 18px 0 0;
  border-bottom: 1px solid var(--border);
}

.hp-day {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 9px 14px 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--muted);
}
.hp-day-text { display: block; }
.hp-day-date { display: block; font-weight: 600; font-size: 14px; color: var(--text); }
.hp-day-count { display: block; font-size: 11.5px; margin-top: 1px; white-space: nowrap; }

/* Done or still owing, at a glance — a manager scanning six tabs should not
   have to read six pairs of numbers to find the day that needs work. The mark
   carries the meaning as well as the colour, so it still reads on a printout
   and to anyone who does not separate red from green. */
.hp-day-mark {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  color: #fff;
}
.hp-day.done .hp-day-mark { background: var(--green); }
.hp-day.todo .hp-day-mark { background: var(--ccv-burgundy); }
.hp-day.done .hp-day-count { color: var(--green); }
.hp-day.todo .hp-day-count { color: var(--ccv-burgundy); }

.hp-day.active { border-bottom-color: var(--ccv-burgundy); }
.hp-day.active.done { border-bottom-color: var(--green); }

/* The stand-down. The one loud element on the page, because it is the reason
   the tool exists — this stock cannot legally be sold yet. */
.hp-standdown { margin-top: 0; border-radius: 0 0 4px 4px; }
.hp-stand-main { display: flex; gap: 12px; align-items: stretch; }
.hp-stand-rail { width: 4px; background: var(--ccv-yellow); border-radius: 2px; flex: 0 0 auto; }
.hp-stand-label {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.hp-stand-line { margin: 3px 0 0; font-size: 14px; color: var(--muted); }
.hp-stand-line b { font-size: 20px; color: var(--text); }

.hp-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }

/* Item tabs. */
.hp-items { display: flex; gap: 6px; overflow-x: auto; margin: 16px 0 0; padding-bottom: 4px; }
.hp-item-tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 3px;
  padding: 7px 11px;
  cursor: pointer;
  font: 500 12.5px inherit;
  color: var(--muted);
  white-space: nowrap;
}
.hp-item-tab:hover { border-color: #b9b9b9; color: var(--text); }
.hp-item-tab.active { background: var(--text); color: #fff; border-color: var(--text); }
.hp-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--border); flex: 0 0 auto; }
.hp-dot.done { background: var(--green); }
.hp-tab-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }

/* The working area. */
.hp-desk { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .hp-desk { grid-template-columns: 1fr; } }

.hp-shot { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
@media (max-width: 640px) { .hp-shot { grid-template-columns: 1fr; } }

.hp-frame {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #f0eeee;
  display: grid;
  place-items: center;
  overflow: hidden;
  max-width: 100%;
}
.hp-frame img { width: 100%; height: 100%; object-fit: contain; }
.hp-frame.busy { opacity: .5; }
.hp-frame.empty {
  border-style: dashed;
  align-content: center;
  gap: 8px;
  padding: 14px;
  text-align: center;
}
.hp-frame-title { margin: 0; font-weight: 600; color: #a85b08; }
.hp-upload-input { display: none; }

/* Fixed-size thumbnails (2026-09-18). They were flex: 1, so a single thumb
   stretched to the frame's full width and the same photo appeared twice, the
   second one nearly as big as the first. The page now also renders no strip at
   all below two photos - see renderPhotos. */
.hp-strip { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.hp-thumb {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #f0eeee;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}
.hp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hp-thumb.active { border-color: var(--ccv-burgundy); }

.hp-desc { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 0; }
.hp-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 9px 0 0; }
.hp-code, .hp-dept {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 11.5px;
  color: var(--muted);
  background: #fafafa;
}
.hp-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.hp-ask { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.hp-ask h3 { margin: 0; font-size: 15px; }
.hp-entry { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.hp-money { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 3px; background: #fff; }
.hp-money:focus-within { border-color: var(--ccv-yellow); outline: 2px solid var(--ccv-yellow); }
.hp-money span { padding-left: 11px; color: var(--muted); font-size: 17px; }
.hp-money input {
  width: 116px;
  border: 0;
  outline: 0;
  background: transparent;
  font: 600 19px ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  padding: 9px 12px 9px 4px;
  color: var(--text);
}

.hp-error { color: var(--ccv-burgundy); font-size: 13px; margin: 10px 0 0; }

/* The verdict. */
.hp-verdict { margin-top: 18px; border: 1px solid; border-radius: 4px; padding: 15px; }
.hp-verdict.under   { background: #f0f7fa; border-color: #bcdbe6; }
.hp-verdict.on      { background: #f0f8f3; border-color: #bfe0cc; }
.hp-verdict.over    { background: #fdf6ec; border-color: #ecd4ac; }
.hp-verdict.unknown { background: #fafafa; border-color: var(--border); }
.hp-verdict-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.hp-verdict-title { font-size: 16px; font-weight: 700; }
.hp-verdict.under .hp-verdict-title { color: #10657f; }
.hp-verdict.on .hp-verdict-title { color: var(--green); }
.hp-verdict.over .hp-verdict-title { color: #a85b08; }
.hp-verdict-gap { font-size: 13px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.hp-verdict p { margin: 8px 0 0; font-size: 13.5px; max-width: 62ch; }

/* The evidence. */
.hp-side h3 { margin: 0; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.hp-conf { display: inline-block; font-size: 11.5px; border-radius: 3px; padding: 3px 8px; margin: 9px 0 0; }
.hp-conf.strong { background: #f0f8f3; color: var(--green); }
.hp-conf.thin { background: #fdf6ec; color: #a85b08; }
.hp-comps { list-style: none; margin: 12px 0 0; padding: 0; }
.hp-comps li {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}
.hp-comps li:first-child { border-top: 0; padding-top: 0; }
.hp-comp-what { font-size: 13px; line-height: 1.35; }
.hp-comp-where { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.hp-comp-amt {
  font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--green);
}

/* The Buys by Date import panel (2026-09-17). */
.hp-import { margin-bottom: 16px; }
.hp-import h3 { margin: 0 0 4px; font-size: 15px; }
.hp-import-main {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
}
.hp-import-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hp-import-form input[type="file"] { font-size: 13px; max-width: 100%; }
.hp-ok { color: var(--green); font-size: 13px; margin: 10px 0 0; }

/* The keying list a finished day turns into (2026-09-17). Wider rows than the
   pricing card on purpose: this one is read at arm's length, next to the POS. */
.hp-list { margin-top: 16px; }
.hp-list-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.hp-list-head h3 { margin: 0; font-size: 15px; }
.hp-list-head .hp-note { margin-top: 4px; }

.hp-tickets { list-style: none; margin: 0; padding: 0; }
.hp-ticket {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.hp-ticket:last-child { border-bottom: 0; }
.hp-ticket:hover { background: #fafafa; }

.hp-ticket-shot {
  width: 76px;
  height: 76px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  overflow: hidden;
  flex: 0 0 auto;
}
.hp-ticket-shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hp-ticket-shot.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.hp-ticket-main { min-width: 0; }
.hp-ticket-code {
  font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
}
.hp-ticket-badge {
  margin-left: 10px;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--muted);
  text-transform: uppercase;
}
.hp-ticket-desc {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
}
.hp-ticket-price {
  font: 700 20px ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--green);
}

@media (max-width: 560px) {
  .hp-ticket { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; }
  .hp-ticket-shot { width: 56px; height: 56px; }
  .hp-ticket-price { font-size: 17px; }
}

/* "due out" on the tab whose stand-down is up - the day an inventory officer
   is actually looking for. */
.hp-day-due {
  display: inline-block;
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ccv-burgundy);
  border: 1px solid #e3c7cf;
  background: #fbf2f4;
  border-radius: 2px;
  padding: 1px 5px;
}

.hp-done-line {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.hp-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--ccv-burgundy);
  text-decoration: underline;
  cursor: pointer;
}

/* THE DESK USES THE WHOLE WINDOW (2026-09-17)
   Shane, looking at it on a shop PC: "so much dead space".

   The app caps a page at 760px, which is right for a settings form and wrong
   here - a photo, a description, a price entry and its evidence sit side by
   side, and the keying list is read across. Same widening the review queue got
   on 1 September, and the same 1400px.

   Ids on the ones that are direct children of .main-content, because the
   generic ".main-content > *:not(...)" cap carries ten :not() classes and
   out-specifies any plain class selector. The cards are reached by class,
   and win by coming later in the file. */
.main-content #hp-days,
.main-content #hp-standdown,
.main-content #hp-work,
.main-content #hp-done-line,
.main-content .hp-import,
.main-content .hp-who,
.main-content .hp-list {
  max-width: 1400px;
}

/* Inside the desk the grid decides, so these two only have to stop obeying the
   760px cap they inherit from ".main-content .card". */
.main-content .hp-item,
.main-content .hp-side {
  max-width: none;
}

/* The photo is the point on a pricing card, so it takes some of the room the
   widening just freed up. */
@media (min-width: 1100px) {
  /* The frame is square by aspect-ratio, so the column width is all it needs. */
  .hp-shot { grid-template-columns: 300px minmax(0, 1fr); }
}

/* THE PHOTO, FULL SIZE (2026-09-18)

   Trade Me's behaviour, which is what Shane pointed at: one big picture, the
   thumbnails only when there is more than one, and clicking either opens it
   properly. */
.hp-frame.has-photo { cursor: zoom-in; }

.hp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.hp-lightbox[hidden] { display: none; }
.hp-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 3px;
  background: #fff;
}
.hp-lightbox-nav,
.hp-lightbox-close {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  border-radius: 99px;
  line-height: 1;
  width: auto;
}
.hp-lightbox-nav { top: 50%; transform: translateY(-50%); font-size: 34px; padding: 6px 18px; }
.hp-lightbox-nav.prev { left: 16px; }
.hp-lightbox-nav.next { right: 16px; }
.hp-lightbox-close { top: 16px; right: 16px; font-size: 26px; padding: 2px 14px 6px; }
.hp-lightbox-nav:hover,
.hp-lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

/* WHAT THE GROUP HAS LIKE THIS ONE (2026-09-18)

   Two lists in the side panel: ticketed on a shelf right now, and gone before.
   The ticket price is deliberately NOT green - green is what somebody paid. */
.hp-market { margin-top: 16px; }
.hp-market + .hp-market { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.hp-market-title {
  margin: 0;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.hp-market .hp-comps { margin-top: 8px; }
.hp-comp-amt.ticket { color: var(--text); }
.hp-match {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid #bfe0cc;
  background: #f0f8f3;
  border-radius: 2px;
  padding: 0 4px;
  vertical-align: 1px;
}

/* TWO STREAMS (2026-09-18)

   Buys and Pawns. A pulled pawn is a loan nobody came back for - the goods are
   the shop's to sell and need a ticket price just like a counter buy - so it is
   the same desk with a different report behind it. */
.hp-streams { display: flex; gap: 8px; margin: 0 0 16px; }
.hp-stream {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 99px;
  padding: 7px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  width: auto;
}
.hp-stream:hover { border-color: #b9b9b9; color: var(--text); }
.hp-stream.active {
  background: var(--ccv-burgundy);
  border-color: var(--ccv-burgundy);
  color: #fff;
}
/* How many are still waiting a price on the other side. Nothing shows when
   there is nothing waiting - a zero in a tab reads as a count of something. */
.hp-stream-count {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  color: var(--muted);
  border-radius: 99px;
  padding: 1px 7px;
}
.hp-stream-count:empty { display: none; }
.hp-stream.active .hp-stream-count { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* Clearing a day off the desk (2026-09-18). The only thing that removes stock
   from this tool now that the stocktake does not. */
.hp-dayactions {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 2px 0;
  max-width: 1400px;
}
.hp-dayactions .hp-note { margin: 0; max-width: 78ch; }
.hp-remove { width: auto; white-space: nowrap; }
/* Asking, not warning: it goes burgundy only once it has been clicked and is
   waiting for the second click. */
.hp-remove.armed {
  border-color: var(--ccv-burgundy);
  color: var(--ccv-burgundy);
  font-weight: 600;
}

/* The Trade Me category on the pricing desk (2026-09-21), and the picker that
   fixes a wrong one. Same job as the picker on a review card, smaller: there is
   one item on screen, so it is a line of text until somebody wants to change
   it. */
.hp-cat { margin-top: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.hp-cat-line { margin: 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.hp-cat-path { font-size: 12.5px; line-height: 1.4; color: var(--text); }
.hp-cat-path.unknown { color: var(--muted); font-style: italic; }
.hp-cat-picker { margin-top: 10px; }
.hp-cat-picker select {
  width: 100%;
  font-size: 13px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
}
.hp-cat-search { margin-top: 6px; }
.hp-cat-search input {
  width: 100%;
  font-size: 13px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 3px;
}

/* "Use this category for anything like it" (2026-09-21). Offered after a
   correction, never before: the choice and the rule are different statements. */
.hp-cat-remember { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.hp-cat-remember label { display: block; font-size: 11.5px; color: var(--muted); }
.hp-cat-remember-row { display: flex; gap: 8px; margin-top: 5px; }
.hp-cat-remember-row input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 3px;
}
.hp-cat-remember-row .btn-secondary { width: auto; white-space: nowrap; padding: 6px 12px; }

/* The tree's best guess, when an item has no category on file (2026-09-21). */
.hp-cat-suggest { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.hp-cat-suggest span { color: var(--text); }
/* Which shelf a comparison row is on. Quiet - it explains the row rather than
   being the point of it. */
.hp-comp-cat { display: block; font-size: 11px; color: #9a9a9a; margin-top: 2px; }

/* VALUE CHECK (2026-09-21)

   One search box, four figures, two lists. Its own prefix (vc-) rather than
   reusing the pricing desk's, because the two tools will drift and a shared
   class is how that becomes somebody else's bug. */
.main-content #vc-summary,
.main-content .vc-ask,
.main-content .vc-list,
.main-content #vc-empty {
  max-width: 1400px;
}

.vc-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vc-field { flex: 1; min-width: 260px; }
.vc-field input {
  width: 100%;
  font-size: 16px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 3px;
}
.vc-field input:focus { border-color: var(--ccv-yellow); outline: 2px solid var(--ccv-yellow); }
.vc-form .primary { width: auto; padding: 11px 26px; }

.vc-of { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.vc-figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 720px) { .vc-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vc-figure { border-left: 3px solid var(--ccv-yellow); padding-left: 12px; }
.vc-figure-k {
  display: block;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.vc-figure b {
  display: block;
  font: 700 24px ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}
.vc-figure-note { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.vc-list h3 { margin: 0 0 4px; font-size: 15px; }
.vc-count {
  font: 600 11.5px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  background: var(--bg);
  border-radius: 99px;
  padding: 1px 8px;
  margin-left: 6px;
}
.vc-rows { list-style: none; margin: 10px 0 0; padding: 0; }
.vc-row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 8px;
  border-top: 1px solid var(--border);
}
.vc-row:first-child { border-top: 0; }
/* The searcher's own shop, so "have we got one" answers itself. */
.vc-row.mine { background: #fdfaf0; }
.vc-row-main { min-width: 0; }
.vc-row-what { font-size: 13.5px; line-height: 1.35; }
.vc-row-where { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.vc-row-where b { color: var(--text); }
.vc-mine {
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #7a5c06;
  background: #fdf3d6;
  border: 1px solid #ecd9a5;
  border-radius: 2px;
  padding: 0 4px;
}
.vc-row-amt {
  font: 600 16px ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--green);
}
.vc-row-amt.ticket { color: var(--text); }

/* AGED STOCK (2026-09-21). Shares the Value Check figure row and list rows -
   they are the same two shapes - and adds the band tabs and the department
   table. */
.main-content .as-summary,
.main-content .as-depts,
.main-content .as-list,
.main-content #as-empty,
.main-content #as-bands {
  max-width: 1400px;
}

.as-bands { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.as-band {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  padding: 9px 16px;
  cursor: pointer;
  text-align: left;
  width: auto;
}
.as-band:hover { border-color: #b9b9b9; }
.as-band-label { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.as-band-days { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.as-band.active { background: var(--ccv-burgundy); border-color: var(--ccv-burgundy); }
.as-band.active .as-band-label,
.as-band.active .as-band-days { color: #fff; }

.as-depts-head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.as-depts-head h3 { margin: 0; font-size: 15px; }

.as-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.as-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--border);
}
.as-table th.num, .as-table td.num { text-align: right; }
.as-table td {
  padding: 9px 8px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
.as-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.as-table tbody tr { cursor: pointer; }
.as-table tbody tr:hover { background: #fafafa; }
/* The department being looked at. */
.as-table tbody tr.chosen { background: #fdfaf0; }
.as-table tbody tr.chosen td:first-child { font-weight: 600; }

/* "Repriced 45 days ago" beside the age (2026-09-21). Never repriced is the
   one worth noticing, so it is the one with a colour. */
.as-repriced { margin-left: 8px; }
.as-repriced.never { color: var(--ccv-burgundy); font-weight: 600; }

/* The Aged Stock list as a report (2026-09-21). Laid out like the POS's own
   Overdue Repricing sheet: department heading, then the items under it. */
.as-list-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.as-list-head h3 { margin: 0; font-size: 15px; }
.as-download { width: auto; white-space: nowrap; text-decoration: none; display: inline-block; }

.as-report td { vertical-align: top; }
.as-report tbody tr { cursor: default; }
.as-report tbody tr:hover { background: transparent; }
/* The department heading row. */
.as-report tr.as-group td {
  background: var(--bg);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text);
  padding-top: 12px;
}
.as-report tbody tr:not(.as-group):hover { background: #fafafa; }
/* The code is the thing that gets typed into the POS, so it is the thing that
   copies on a click. */
.as-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}
.as-code:hover { text-decoration: underline; }
.as-code.copied { background: #f0f8f3; color: var(--green); font-weight: 600; }
.as-report td.never { color: var(--ccv-burgundy); font-weight: 600; }


/* ---------------------------------------------------------------------------
   Melt Calculator (views/tools/melt-calculator.ejs, added 2026-09-23)
   --------------------------------------------------------------------------- */

.mc-page { max-width: 1240px; }
.main-content .mc-page .card { max-width: none; margin-bottom: 16px; }
.mc-page h3 { font-size: 15px; margin: 0 0 12px; }
.mc-muted { color: var(--muted); font-size: 12px; font-weight: 400; }

.mc-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.mc-pill { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.mc-pill span { display: block; font-size: 11px; color: var(--muted); }
.mc-pill strong { font-size: 15px; }
.mc-pill-warn { border-color: #e0a100; background: #fff8e1; }

.mc-settings summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.mc-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }

.mc-scan-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.mc-field label { margin-top: 0; }
.mc-ref { flex: 0 1 240px; }
.mc-code { flex: 1 1 260px; }
.mc-code-cell .mc-code { font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
#stockCode { font-size: 18px; padding: 12px 14px; border: 2px solid var(--ccv-yellow); }
.mc-group-note { margin: 10px 0 0; }
.mc-scan-card .message { margin: 12px 0 0; }

.mc-btn { font: inherit; font-size: 14px; cursor: pointer; border-radius: 6px; padding: 11px 16px; border: 1px solid transparent; }
.mc-btn-yellow { background: var(--ccv-yellow); color: #3b2b00; font-weight: 600; }
.mc-btn-dark { background: var(--ccv-burgundy); color: #fff; font-weight: 600; }
.mc-btn-plain { background: #fff; border-color: #cfcfcf; color: var(--text); }
.mc-btn[data-armed] { background: #a11; color: #fff; border-color: #a11; }
.mc-row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.mc-inline-msg { font-size: 13px; }
.mc-inline-msg.success { color: var(--green); }
.mc-inline-msg.error { color: #a11; }

.mc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.mc-items-card, .mc-side { min-width: 0; }
.mc-items-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mc-items-head h3 { margin: 0; }
.mc-filter { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.mc-filter button { font: inherit; font-size: 12px; background: #fff; border: none; border-right: 1px solid var(--border); padding: 6px 10px; cursor: pointer; }
.mc-filter button:last-child { border-right: none; }
.mc-filter button.active { background: #fdf3d6; font-weight: 600; }

.mc-table-wrap { overflow-x: auto; }
.mc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mc-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 6px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.mc-table td { padding: 8px 6px; border-bottom: 1px solid #eee; vertical-align: middle; }
.mc-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc-code-cell { min-width: 160px; }
.mc-desc { color: var(--muted); font-size: 12px; max-width: 240px; }
.mc-reason { font-size: 11px; color: #9a5b00; margin-top: 2px; }
.mc-red { color: #a11; }
.mc-table select, .mc-table input { font: inherit; font-size: 13px; padding: 5px 4px; width: auto; max-width: 128px; margin: 0; }
.mc-table input.mc-weight { width: 64px; text-align: right; }
.mc-warn td { background: #fffaf0; }
.mc-excluded td { opacity: .55; }
.mc-remove { background: none; border: none; color: #999; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 6px; }
.mc-remove:hover { color: #a11; }
.mc-empty { color: var(--muted); font-size: 14px; padding: 12px 0 0; }

.mc-badge { display: inline-block; font-size: 11px; line-height: 1.3; padding: 2px 8px; border-radius: 10px; background: #eee; max-width: 150px; }
.mc-st-sale { background: #e3f1e7; color: var(--green); }
.mc-st-hold { background: #fdecc8; color: #8a5300; }
.mc-st-proc { background: #e5ecf8; color: #2c4f8c; }
.mc-st-ext { background: #efe4f5; color: #6a2c8c; }

.mc-chip { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 600; line-height: 1.3; padding: 3px 8px; border-radius: 4px; max-width: 150px; }
.mc-chip-wait { background: #ffe9a8; color: #6b4700; border: 1px solid #e0b400; }
.mc-chip-ok { background: #e3f1e7; color: var(--green); }
.mc-chip-bad { background: #fdecec; color: #a11; }

.mc-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mc-metric { background: #fafafa; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.mc-metric .l { font-size: 12px; color: var(--muted); }
.mc-metric .v { font-size: 19px; font-weight: 700; margin-top: 2px; }
.mc-total { grid-column: 1 / -1; background: #fff8e1; border-color: var(--ccv-yellow); }
.mc-total .v { font-size: 28px; }
.mc-hold-summary { margin-top: 10px; font-size: 13px; }
.mc-hold-line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid #eee; }
.mc-hold-wait { color: #8a5300; }
.mc-hold-ok { color: var(--green); }

.mc-invoice { font-size: 13px; line-height: 1.6; }
.mc-invoice p { margin: 0 0 6px; }
.mc-inv-line { display: flex; justify-content: space-between; gap: 10px; }
.mc-inv-total { font-weight: 700; font-size: 15px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; }

@media (max-width: 1180px) {
  .mc-layout { grid-template-columns: minmax(0, 1fr); }
  .mc-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
  .main-content .mc-side .card { margin-bottom: 0; }
}

@media print {
  .topbar, .sidebar, .mc-no-print, .mc-settings, .mc-scan-card, .mc-filter { display: none !important; }
  .main-content { padding: 0; }
  .mc-layout { grid-template-columns: 1fr; }
  .mc-table select, .mc-table input { border: none; background: none; appearance: none; -webkit-appearance: none; padding: 0; }
  .mc-page .card { border: none; padding: 0; }
}

/* Trade Me Sale (views/tools/trade-me-sale.ejs, added 2026-10-04) */
.ts-page .card { margin-bottom: 16px; }
.ts-choices { display: flex; gap: 16px; flex-wrap: wrap; }
.ts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.ts-choice { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 4px 0; font-size: 14px; }
.ts-choice input { width: auto; margin: 0; }
.ts-sub { margin-top: 10px; padding: 10px 12px; background: #fafafa; border: 1px solid var(--border); border-radius: 8px; }
.ts-tag { margin-top: 16px; }
.ts-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ts-actions form { margin: 0; }
.ts-actions button { width: auto; padding: 10px 18px; }
/* Preview tick boxes (2026-11-14): untick to leave an item out. */
.ts-pick { width: 1%; white-space: nowrap; }
.ts-pick input { width: 20px; height: 20px; margin: 0; cursor: pointer; }
.ts-pick .ts-choice { margin: 0; font-weight: 600; }
.ts-row.ts-out td:not(.ts-pick) { opacity: 0.45; text-decoration: line-through; }
#tsStartBtn:disabled { opacity: 0.5; cursor: not-allowed; }
.ts-table-wrap { overflow-x: auto; max-width: 100%; min-width: 0; }
.ts-table-wrap td:first-child strong, .ts-table-wrap td:first-child { white-space: nowrap; }

/* Trade Me Manager - Feedback tab (2026-10-07). Item on the left, buyer and
   price in the middle, Trade Me's three faces on the right. */
.tm-fb-buyer {
  flex: 0 0 170px;
  min-width: 0;
  text-align: left;
}

.tm-fb-nick {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-fb-price { font-size: 0.9rem; color: #555; margin-top: 2px; }

.tm-fb-right {
  flex: 0 0 300px;
  display: flex;
  justify-content: flex-end;
}

.tm-fb-faces {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.tm-face {
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 3px;
  background: none;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
}

.tm-face:hover,
.tm-face:focus-visible { border-color: #bbb; background: #f6f6f6; }
.tm-face:disabled { opacity: 0.4; cursor: default; }

.tm-face-svg { width: 100%; height: 100%; }
.tm-face-eye { fill: #333; }
.tm-face-mouth path { fill: none; stroke: #333; stroke-width: 1.6; stroke-linecap: round; }
.tm-face-positive .tm-face-fill { fill: #f7c600; }
.tm-face-neutral .tm-face-fill { fill: #2d8fd5; }
.tm-face-negative .tm-face-fill { fill: #e9572b; }
.tm-face-fill { stroke: rgba(0, 0, 0, 0.25); stroke-width: 0.8; }

.tm-fb-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  font-size: 0.9rem;
}

.tm-fb-confirm button { width: auto; margin: 0; padding: 7px 14px; font-size: 14px; }
.tm-fb-row.is-busy { opacity: 0.55; }

@media (max-width: 680px) {
  .tm-tabs { overflow-x: auto; }
  .tm-tab { padding: 10px 12px; white-space: nowrap; }
  .tm-fb-buyer { flex: 1 1 auto; }
  .tm-fb-right { flex: 0 1 auto; }
}

/* Owner logins and the admin store switcher (2026-10-09). The banner shows on
   every page while switched into another store. */
.switch-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 20px;
  background: #fff4d6;
  border-bottom: 1px solid #ecd28a;
  color: #4a3b00;
  font-size: 0.92rem;
}

.switch-banner-actions { display: flex; align-items: center; gap: 16px; }
.switch-banner-actions a,
.switch-banner-actions button.link {
  width: auto;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--ccv-burgundy);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.st-group { margin-bottom: 28px; max-width: 1040px; }
.st-group-name { font-size: 1.05rem; margin: 8px 0 12px; }
.st-count {
  display: inline-block;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 11px;
  background: #eee;
  color: #555;
  font-size: 0.8rem;
  text-align: center;
}

.st-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}

.main-content .st-card { margin: 0; padding: 18px 20px; max-width: none; min-width: 0; }
.st-card.is-here { border: 2px solid var(--ccv-burgundy); }
.st-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.st-card-head h3 { margin: 0; font-size: 1.1rem; flex: 1 1 auto; }

.st-pill { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.st-pill-here { background: var(--ccv-burgundy); color: #fff; }
.st-pill-warn { background: #fde2e2; color: #98132f; }

.st-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin: 0 0 12px;
}

.st-stats div { min-width: 0; }
.st-stats dt { font-size: 0.75rem; color: #777; }
.st-stats dd { margin: 1px 0 0; font-weight: 700; font-size: 1.02rem; }

.st-facts { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 8px; }
.st-facts li { font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; }
.st-facts li.ok { background: #e3f4e8; color: #1e6b37; }
.st-facts li.no { background: #f1f1f1; color: #888; text-decoration: line-through; }

.st-login { font-size: 0.8rem; margin: 0 0 12px; }
.st-actions { display: flex; gap: 8px; }
.st-actions form { flex: 1 1 0; margin: 0; }
.st-actions button { width: 100%; margin: 0; }

/* Trade Me Manager - "Run automatic relist now" on the Unsold tab
   (2026-10-19). Sits to the right of the page heading. */
.tm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

/* Same width as the tabs and list below (.main-content #tabs), so the button lines up with their right edge. */
.main-content #tmHead { max-width: 1040px; }
.tm-head-copy { flex: 1 1 auto; min-width: 0; max-width: 760px; }

.tm-relist-box {
  flex: 0 0 300px;
  margin-top: 6px;
}

.tm-relist-box button { width: 100%; margin: 0; }
.tm-relist-note { font-size: 0.8rem; color: #666; margin: 8px 0 0; line-height: 1.4; }
.tm-relist-status { font-size: 0.85rem; margin: 8px 0 0; }
.tm-relist-status:empty { display: none; }
.tm-relist-status.success { color: #1e6b37; }
.tm-relist-status.error { color: #98132f; }

@media (max-width: 760px) {
  .tm-head { flex-direction: column; gap: 4px; }
  .tm-relist-box { flex-basis: auto; width: 100%; margin-top: 0; }
}

/* Shopify Sync (views/tools/shopify-sync.ejs) - added 2026-10-30. */
.ss-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 12px 0; }
.ss-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; min-width: 220px; }
.ss-connected { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ss-help { margin-top: 8px; font-size: 13px; }
.ss-help code { font-size: 12px; }
.ss-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ss-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.ss-table td:nth-child(3) { max-width: 420px; }
.ss-held td { color: var(--muted); }
.ss-status { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 100px; background: #f2f2f2; }
.ss-status.ss-live, .ss-status.ss-linked { background: #e6f4ea; color: var(--green); }
.ss-status.ss-queued { background: #fdf3d8; color: #7a5c00; }
.ss-status.ss-failed { background: #fbe9e9; color: #a12622; }
.ss-error { font-size: 12px; color: #a12622; margin-top: 4px; max-width: 260px; }
.ss-dialog { max-width: 720px; width: calc(100% - 32px); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.ss-photos { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0; }
.ss-photos img { height: 140px; border-radius: 6px; }
.ss-desc p { margin: 4px 0; font-size: 14px; }
.ss-connection .muted, .ss-table .muted, .ss-head .muted { color: var(--muted); font-weight: 400; }
.ss-head-actions { display: flex; gap: 8px; }
.ss-form label.ss-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; min-width: 0; }
.ss-options { flex-direction: column; align-items: flex-start; gap: 6px; }

/* Start price under ticket + 10% on a review card (2026-11-02). A warning, not
   a block — Shane's call — so it has to be loud enough to be read. */

.fl-below-ticket {
  margin: 4px 0 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fdecee;
  color: #b00020;
  font-size: 13px;
  font-weight: 600;
}

.fl-below-ticket[hidden] {
  display: none;
}

/* Shopify settlements (admin) */
.ss-inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.ss-scan-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; display: block; }

/* Shopify Sync: the boxes use the full width (Shane, 2026-11-03) - the
   piece tables are wide and were squeezed into the 760px column. */
.main-content .ss-card { max-width: none; }
.ss-filters { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0; font-size: 13px; }
.ss-filters label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.ss-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; display: block; }
.ss-media-strip { display: flex; gap: 6px; flex-wrap: wrap; max-width: 330px; }
.ss-media-item { position: relative; }
.ss-media-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; display: block; border: 1px solid var(--border); }
.ss-media-remove { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: #a12622; font-weight: 700; line-height: 16px; cursor: pointer; }
.ss-media-remove:hover { background: #a12622; color: #fff; }
.ss-media-add { width: 56px; height: 56px; border: 1px dashed var(--border); border-radius: 6px; background: transparent; font-size: 22px; color: var(--muted); cursor: pointer; }
.ss-status.ss-sold, .ss-status.ss-hidden { background: #eee; color: #555; }
.ss-reasons { min-width: 260px; max-width: 380px; }
.ss-reason { font-size: 13px; margin-bottom: 6px; }
.ss-reason b { font-weight: 600; }
.ss-accept { flex-wrap: wrap; margin-bottom: 6px; }
.ss-media-strip { max-width: 420px; }
.ss-media-strip.ss-busy { opacity: 0.5; pointer-events: none; }
.ss-media-item a { position: relative; display: block; }
.ss-media-first img, .ss-media-first .ss-media-placeholder { outline: 2px solid #8a6d2f; outline-offset: 1px; }
.ss-media-tag { position: absolute; left: 2px; bottom: 2px; font-size: 9px; font-weight: 700; background: #8a6d2f; color: #fff; padding: 0 4px; border-radius: 3px; }
.ss-media-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; text-shadow: 0 0 4px rgba(0,0,0,.7); pointer-events: none; }
.ss-media-placeholder { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; font-size: 9px; color: var(--muted); border: 1px dashed var(--border); border-radius: 6px; }
.ss-media-moves { display: flex; justify-content: center; gap: 2px; margin-top: 2px; min-height: 16px; }
.ss-media-moves button { font-size: 10px; line-height: 1; padding: 1px 4px; border: 1px solid var(--border); background: #fff; border-radius: 3px; cursor: pointer; }
.ss-media-item[draggable="true"] { cursor: grab; }
.ss-media-item.ss-dragging { opacity: 0.4; }
.ss-media-item.ss-drop img { outline: 2px dashed #8a6d2f; }
.ss-media-link { font-size: 12px; font-weight: 700; }
.ss-media-failed { color: #a12622; border-color: #a12622; }
.ss-allow { font-size: 11px; margin-top: 4px; }
/* Not on Shopify: the Trade Me photo next to any photos added in the hub. */
.ss-media-tm { display: block; }
.ss-media-tm .ss-media-tag { background: #555; }
.ss-upload { white-space: nowrap; margin-bottom: 4px; }
.ss-head-actions a.button { display: inline-block; padding: 2px 8px; border: 1px solid #767676; border-radius: 3px; background: #efefef; color: #000; font-size: 13px; text-decoration: none; }
.ss-head-actions a.button:hover { background: #e5e5e5; }
#ss-not-on td.ss-stage { min-width: 190px; }



/* Drop the 10% on slow stock (Settings > Advanced, 2026-11-06). */
.fee-drop-form { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 12px 0 4px; }
.fee-drop-form label { display: flex; align-items: center; gap: 6px; font-weight: 600; margin: 0; }
.fee-drop-form input[type="number"] { width: 6em; margin: 0; }
.fee-drop-actions { display: flex; gap: 8px; width: 100%; }
.fee-drop-actions button { width: auto; margin: 0; }


/* Gold price graph on the Jewellery Dashboard (2026-11-06). */
.gp-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin: 14px 0; }
.gp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.gp-head small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.gp-now { font-size: 26px; font-weight: 800; margin-top: 2px; }
.gp-change { font-size: 14px; font-weight: 700; margin-left: 8px; }
.gp-up { color: #257342; }
.gp-down { color: #a31e1e; }
.gp-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.gp-toggle button { width: auto; margin: 0; border: 0; border-radius: 0; background: #fff; color: #333; padding: 7px 14px; font-weight: 700; font-size: 13px; cursor: pointer; }
.gp-toggle button.on { background: var(--ccv-burgundy); color: #fff; }
.gp-stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
.gp-stats b { color: var(--text); }
#goldChart { width: 100%; height: 220px; display: block; }
.gp-note { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* The gold graph spans the full width like the price bar above it (Shane,
   2026-11-07). By id, because the generic ".main-content > *:not(...)" 760px
   cap out-specifies a plain class. */
.main-content #goldChartCard { max-width: none; }

/* ---------------------------------------------------------------------------
   Stock Balancer (views/stock-balancer/*, added 2026-11-10). Owner pages that
   compare stores side by side, so they run full width: .sb-page is in the
   .main-content cap's :not() chain above, and .sb-page .card undoes the
   760px card cap by coming later in the file.
   --------------------------------------------------------------------------- */

.sb-page { display: flex; flex-direction: column; gap: 16px; }
.sb-page .card { max-width: none; padding: 20px; }
.sb-page h1 { margin: 0; }
.sb-page h2 { font-size: 17px; margin: 0 0 8px; }
.sb-page .subtitle { margin: 4px 0 0; }

.sb-head { display: flex; gap: 12px 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.sb-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.sb-btn {
  display: inline-block; padding: 9px 14px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text); font: inherit; font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.sb-btn:hover { border-color: #bdbdbd; }
.sb-btn-primary { background: var(--ccv-burgundy); border-color: var(--ccv-burgundy); color: #fff; }
.sb-btn-primary:hover { opacity: 0.92; }
.sb-page button.link { background: none; border: 0; padding: 0; color: var(--ccv-burgundy); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.sb-page :focus-visible { outline: 2px solid var(--ccv-yellow); outline-offset: 2px; }

.sb-owner-pick { display: flex; gap: 8px; align-items: center; }
.sb-owner-pick label { margin: 0; }
.sb-owner-pick select { width: auto; }

.sb-controls { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.sb-window { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sb-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-right: 4px; }
.sb-seg { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); text-decoration: none; font-size: 13px; }
.sb-seg.is-on { background: var(--ccv-yellow); border-color: var(--ccv-yellow); color: #3a2a00; font-weight: 700; }
.sb-asat { margin: 0; font-size: 12px; color: var(--muted); }

.sb-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-pill { display: inline-block; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; background: #ece9e7; color: var(--text); }
.sb-pill.sb-short { background: #fbe7e8; color: #b3202f; }
.sb-pill.sb-over { background: #fdf0d8; color: #8a5200; }
.sb-pill.sb-ok { background: #e3f3e9; color: var(--green); }

.sb-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.sb-tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.sb-tabs a.is-on { color: var(--ccv-burgundy); border-bottom-color: var(--ccv-burgundy); }
.sb-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #ece9e7; color: var(--text); font-size: 12px; text-align: center; }

.sb-table-wrap { overflow-x: auto; }
.sb-grid, .sb-items { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sb-grid th, .sb-grid td, .sb-items th, .sb-items td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.sb-grid thead th, .sb-items thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.sb-grid tbody tr:last-child > *, .sb-items tbody tr:last-child > * { border-bottom: 0; }
.sb-group-name { min-width: 160px; font-weight: 600; }
.sb-group-name a { color: var(--text); text-decoration: none; }
.sb-group-name a:hover { text-decoration: underline; }
.sb-group-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

.sb-cell {
  display: flex; flex-direction: column; gap: 2px; width: 100%; min-width: 150px; text-align: left;
  border: 2px solid transparent; border-radius: 8px; padding: 8px 10px; background: #f3f1ef;
  color: var(--text); font: inherit; cursor: pointer;
}
.sb-cell:hover { border-color: #d6d1ce; }
.sb-cell.is-open { border-color: var(--text); }
.sb-cell.sb-short { background: #fbe7e8; }
.sb-cell.sb-ok { background: #e3f3e9; }
.sb-cell.sb-over { background: #fdf0d8; }
.sb-tag { font-size: 12px; font-weight: 700; color: var(--muted); }
.sb-cell.sb-short .sb-tag { color: #b3202f; }
.sb-cell.sb-ok .sb-tag { color: var(--green); }
.sb-cell.sb-over .sb-tag { color: #8a5200; }
.sb-n { font-size: 20px; font-weight: 700; line-height: 1.15; }
.sb-n em { font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); }
.sb-m { font-size: 12px; color: #555; }
.sb-few { font-size: 11px; font-style: italic; color: var(--muted); }

.sb-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.sb-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sb-key.sb-short { background: #d64550; }
.sb-key.sb-ok { background: var(--green); }
.sb-key.sb-over { background: #d28b12; }

.sb-drawer-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.sb-drawer-head p { margin: 0 0 8px; }
.sb-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; white-space: nowrap; }
.sb-chip { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #ece9e7; color: var(--muted); font-size: 11px; font-weight: 600; }

.sb-suggest-form { display: flex; flex-direction: column; gap: 14px; }
.sb-suggest-form > p { margin: 0; }
.sb-move + .sb-move { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.sb-route { margin: 0; }
.sb-why { margin: 2px 0 8px; font-size: 13px; }
.sb-picks { display: flex; flex-direction: column; gap: 4px; }
.sb-pick { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 6px 8px; border-radius: 6px; background: var(--bg); font-weight: 400; margin: 0; cursor: pointer; }
.sb-pick input { margin: 0; }
.sb-desc { flex: 1; min-width: 200px; }
.sb-meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.sb-send-bar {
  position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  padding: 12px 16px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}
#sb-picked { color: var(--muted); font-size: 13px; }
.sb-print-bar { display: flex; justify-content: flex-end; }

.sb-editor { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sb-form label { margin-top: 14px; }
.sb-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font: inherit; resize: vertical; }
.sb-form input[type="number"] { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.sb-fieldset { border: 0; padding: 0; margin: 16px 0 0; }
.sb-fieldset legend { font-size: 13px; font-weight: 600; padding: 0; }
.sb-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; margin-top: 6px; }
.sb-check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; }
.sb-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.sb-switch { padding-top: 30px; }
.sb-switch p { margin: 4px 0 0; font-size: 12px; }
.sb-type-list { margin-top: 10px; }
.sb-type-list summary { cursor: pointer; font-size: 13px; color: var(--ccv-burgundy); }
.sb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.sb-chip-btn { border: 1px solid var(--border); background: var(--card-bg); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.sb-chip-btn span { color: var(--muted); }
.sb-form-actions { margin-top: 20px; }
.sb-preview { position: sticky; top: 16px; }
.sb-preview p { margin: 0 0 10px; }
.sb-sample { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.sb-sample li { padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.sb-delete { margin: 0; font-size: 13px; }

@media (max-width: 900px) {
  .sb-editor { grid-template-columns: 1fr; }
  .sb-preview { position: static; }
}

@media (max-width: 600px) {
  .sb-cell { min-width: 120px; }
  .sb-n { font-size: 18px; }
}

@media print {
  .sb-page .sb-head, .sb-page .sb-controls, .sb-page .sb-summary, .sb-page .sb-tabs,
  .sb-page .sb-print-bar, .sb-page .sb-noprint, .sb-page .message { display: none !important; }
  body:has(.sb-picklist) .topbar, body:has(.sb-picklist) .sidebar, body:has(.sb-picklist) .switch-banner { display: none !important; }
  .sb-picklist { break-inside: avoid; border: 0; padding: 0; }
  .sb-picklist + .sb-picklist { break-before: page; }
}

/* Ask the Hub (views/ask-hub/index.ejs, added 2026-11-17) */
.ah-page { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.ah-page h1 { margin: 0; }
.ah-page .subtitle { margin: 4px 0 0; }
.ah-page .card { max-width: none; }
.ah-head { display: flex; gap: 12px 24px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.ah-scope { display: flex; gap: 4px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.ah-scope label { display: flex; align-items: center; gap: 6px; margin: 0; padding: 6px 10px; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ah-scope label:has(input:checked) { background: var(--ccv-yellow); color: #4a3600; }
.ah-scope input { margin: 0; width: auto; }
.ah-mine { margin: -6px 0 0; }
.ah-thread { display: flex; flex-direction: column; gap: 12px; }
.ah-examples ul { margin: 6px 0 0; padding-left: 18px; }
.ah-examples li { margin: 6px 0; }
.ah-page button.link { background: none; border: 0; padding: 0; color: var(--ccv-burgundy); font: inherit; font-size: 14px; text-align: left; text-decoration: underline; cursor: pointer; }
.ah-msg { border-radius: 10px; padding: 12px 16px; line-height: 1.5; }
.ah-msg p { margin: 0 0 8px; }
.ah-msg p:last-child { margin-bottom: 0; }
.ah-msg ul { margin: 4px 0 8px; padding-left: 20px; }
.ah-q { align-self: flex-end; max-width: 80%; background: #fff6dc; border: 1px solid #f0dfa8; }
.ah-a { align-self: stretch; background: var(--card-bg); border: 1px solid var(--border); }
.ah-scope-tag { display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 10px; background: #fff; border: 1px solid #e6cf86; font-size: 11px; font-weight: 700; color: #6b5200; vertical-align: 1px; }
.ah-error { color: var(--ccv-burgundy); }
.ah-table-wrap { overflow-x: auto; margin: 6px 0 10px; }
.ah-table { border-collapse: collapse; font-size: 14px; min-width: 50%; }
.ah-table th, .ah-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.ah-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.ah-downloads { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.ah-download { font-size: 13px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--ccv-burgundy); text-decoration: none; background: #fafafa; }
.ah-download:hover { border-color: var(--ccv-burgundy); }
.ah-form { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.ah-form textarea { width: 100%; resize: vertical; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; box-sizing: border-box; }
.ah-form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ah-form-row > span { display: flex; align-items: center; gap: 16px; }
.ah-page button.primary { width: auto; padding: 9px 22px; margin: 0; }
.ah-page :focus-visible { outline: 2px solid var(--ccv-yellow); outline-offset: 2px; }

/* Ask the Hub change requests (added 2026-11-17) */
.ah-proposal-box { border-color: var(--ccv-yellow); border-width: 2px; }
.ah-proposal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.ah-status { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; background: #eee; color: #444; }
.ah-status-proposed { background: #fff6dc; color: #6b5200; }
.ah-status-applying, .ah-status-undoing { background: #e7f0ff; color: #1d4f9c; }
.ah-status-applied, .ah-status-undone { background: #e6f4ea; color: var(--green); }
.ah-status-partly_applied, .ah-status-paused, .ah-status-failed { background: #fde8ec; color: var(--ccv-burgundy); }
.ah-proposal .ah-table td.ah-title { white-space: normal; min-width: 220px; }
.ah-proposal .ah-table-wrap { max-height: 420px; overflow-y: auto; }
.ah-proposal-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 10px; }
.ah-recent ul { margin: 8px 0 0; padding-left: 18px; }
.ah-recent li { margin: 6px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
