:root {
  /* Clipboard Zero brand palette - matches clipboardzero.com. --danger/--ok/--warn
     below are semantic (ticket status, errors) and deliberately NOT part of the
     brand accent - only --primary carries brand identity. */
  --bg: #f6f4ee;
  --surface: #ffffff;
  --text: #191f22;
  --text-dim: #5b6469;
  --border: #e4e0d3;
  --primary: #0e6e58;
  --primary-dark: #0a5445;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 10px;
  --font-display: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Elevation - cream-tinted, not a generic grey shadow, so lifted surfaces
     read as "paper on paper" rather than a default UI-kit shadow. */
  --shadow-color: 30, 26, 14;
  --shadow-sm: 0 1px 2px rgba(var(--shadow-color), 0.06), 0 1px 1px rgba(var(--shadow-color), 0.05);
  --shadow-md: 0 4px 10px rgba(var(--shadow-color), 0.08), 0 2px 4px rgba(var(--shadow-color), 0.06);
  --shadow-lg: 0 12px 28px rgba(var(--shadow-color), 0.14), 0 4px 10px rgba(var(--shadow-color), 0.08);
  --focus-ring: 0 0 0 3px rgba(14, 110, 88, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 80px;
}

.office .screen { max-width: 900px; }

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 5;
}

header.topbar h1 { font-size: 1.05rem; margin: 0; font-weight: 700; letter-spacing: -0.01em; }

.topbar-brand { display: flex; flex-direction: column; gap: 1px; }
.wordmark-mini {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: -0.01em;
  color: var(--text-dim);
}
.wordmark-mini .zero { color: var(--primary); }

/* Topbar nav — real pill links (padding + gap + hover state) instead of bare
   <a> tags with no layout control, which is why it used to look cramped on
   phones and like plain default hyperlinks on desktop. */
.topbar-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--bg); color: var(--text); }
/* Same [hidden]-vs-author-rule specificity trap this project has hit
   before (signature-kiosk, detail-panel, quote-decision-actions): a plain
   author rule that sets display always beats the browser's UA-default
   [hidden]{display:none}, regardless of specificity, so an admin-only nav
   link stayed visible even while hidden. */
.nav-link[hidden] { display: none; }
.topbar-actions { display: flex; align-items: center; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

/* Only office.html/stores.html/technicians.html use .collapsible (3 nav
   links) — app.html and the manage-* pages have at most one nav link and
   stay inline at every width, no hamburger needed. */
@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .topbar-nav.collapsible {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 190px;
    z-index: 10;
  }
  .topbar-nav.collapsible.open { display: flex; }
  .topbar-nav.collapsible .nav-link { width: 100%; }
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-weight: 600;
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.1s, border-color 0.15s;
}

button.primary { background: var(--primary); color: white; box-shadow: var(--shadow-sm); }
button.primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); transform: translateY(-1px); }
button.primary:active { background: var(--primary-dark); box-shadow: var(--shadow-sm); transform: translateY(0); }
button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { border-color: var(--text-dim); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
button.secondary:active { box-shadow: none; transform: translateY(0); }
button.danger { background: var(--danger); color: white; box-shadow: var(--shadow-sm); }
button.danger:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
button.link { background: none; color: var(--primary); padding: 8px; }
button.link:hover { color: var(--primary-dark); text-decoration: underline; }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--primary);
}

.full-width { width: 100%; }

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 14px 0 6px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text);
}
.checkbox-label input[type="checkbox"] { width: auto; }

/* Two-way choice (Visit Type, "was the job completed?") - a plain button pair
   rather than radios, matching the app's existing button-driven interactions
   instead of introducing a new input style. */
.segmented { display: flex; gap: 8px; }
.segmented-option {
  flex: 1;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.segmented-option.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.repeatable-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.repeatable-row input { flex: 1; }

.repeatable-group { padding: 12px; }
.repeatable-group-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.repeatable-group textarea { min-height: 60px; margin-top: 8px; }
.repeatable-group .remove-row { margin-top: 4px; padding: 4px 0; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea { min-height: 100px; resize: vertical; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  margin-bottom: 12px;
}

h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ticket-card { display: flex; flex-direction: column; gap: 4px; transition: box-shadow 0.15s, transform 0.1s, border-color 0.15s; }
a.ticket-card, button.ticket-card, .ticket-card[role="button"] { cursor: pointer; }
.card:has(> .ticket-card):hover, .ticket-card:hover { box-shadow: var(--shadow-md); border-color: var(--text-dim); transform: translateY(-1px); }
.ticket-card .row { display: flex; justify-content: space-between; align-items: center; }
.ticket-card .store { font-weight: 700; font-family: var(--font-display); }
.ticket-card .meta { font-size: 0.85rem; color: var(--text-dim); }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge.draft { background: #e5e7eb; color: #374151; }
.badge.in_progress { background: #fef3c7; color: var(--warn); }
.badge.pending_review { background: #dbeafe; color: var(--primary-dark); }
.badge.needs_return_visit { background: #fee2e2; color: var(--danger); }
.badge.billed { background: #dcfce7; color: var(--ok); }
.badge.archived { background: #e5e7eb; color: var(--text-dim); }
.badge.assigned { background: #ede9fe; color: #6d28d9; }
.badge.visit_type { background: #ede9fe; color: #6d28d9; text-transform: none; }
.badge.quote-pending { background: #fef3c7; color: var(--warn); }
.badge.quote-approved { background: #dcfce7; color: var(--ok); }
.badge.quote-declined { background: #fee2e2; color: var(--danger); }

.sync-pill {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fee2e2;
  color: var(--danger);
}

.error-text { color: var(--danger); font-size: 0.85rem; margin-top: 8px; }
.hint-text { color: var(--text-dim); font-size: 0.85rem; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Signature kiosk — deliberately full-screen and free of app navigation,
   since a store manager (not the tech) is the one holding the phone here. */
#signature-kiosk {
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 16px;
}
/* The ID selector above outranks the browser's default [hidden]{display:none}
   (attribute selectors have lower specificity than ID selectors), so without
   this the panel still renders full-screen and eats clicks even while
   "hidden" — caught by a real click failing during testing, not by inspection. */
#signature-kiosk[hidden] {
  display: none;
}
#signature-kiosk .kiosk-header { text-align: center; margin-bottom: 8px; }
#signature-kiosk .kiosk-header h2 { margin: 0 0 4px; font-size: 1.3rem; }

#kiosk-signing-area { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#kiosk-signing-area[hidden] { display: none; }

#signature-kiosk canvas {
  flex: 1;
  width: 100%;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  box-shadow: inset var(--shadow-sm);
  touch-action: none;
  background: #fff;
}
#signature-kiosk .kiosk-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
#signature-kiosk .kiosk-actions button { flex: 1; }

/* Loading/confirmation state shown while the ticket actually saves - same
   [hidden]-vs-author-display specificity trap as everything else on this
   page, guarded the same proven way. */
#kiosk-submitting {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
#kiosk-submitting[hidden] { display: none; }
#kiosk-submitting p { color: var(--text-dim); font-size: 1rem; margin: 0; }

.kiosk-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: kiosk-spin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .kiosk-spinner { animation-duration: 2.4s; }
}
@keyframes kiosk-spin { to { transform: rotate(360deg); } }

.kiosk-check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
}
.kiosk-check[hidden] { display: none; }

table.ticket-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table.ticket-table th, table.ticket-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
table.ticket-table th { color: var(--text-dim); font-weight: 600; }
table.ticket-table tbody tr { cursor: pointer; transition: background-color 0.1s; }
table.ticket-table tbody tr:hover { background: var(--bg); }
table.ticket-table tbody tr:last-child td { border-bottom: none; }

.tabular-nums, .dash-stat .num, .dash-legend, .chart-value-label,
#mt-day-hours, #mt-night-hours, #mt-total-hours {
  font-variant-numeric: tabular-nums;
}

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select { width: auto; }

/* Office table -> stacked cards below tablet width. Single markup source
   (data-label attrs set in office.js) rather than a second render path, so
   there's nothing to keep in sync between a "desktop" and "mobile" view. */
@media (max-width: 700px) {
  table.ticket-table, table.ticket-table thead, table.ticket-table tbody,
  table.ticket-table th, table.ticket-table td, table.ticket-table tr {
    display: block;
  }
  table.ticket-table thead {
    position: absolute;
    left: -9999px;
  }
  table.ticket-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 4px 12px;
  }
  table.ticket-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
  }
  table.ticket-table td:last-child { border-bottom: none; }
  table.ticket-table td::before {
    content: attr(data-label);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.78rem;
    text-align: left;
  }
}

.store-results {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-top: -8px;
  margin-bottom: 8px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
}
.store-results .store-result-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.store-results .store-result-item:last-child { border-bottom: none; }
.store-results .store-result-item:hover,
.store-results .store-result-item:active { background: var(--bg); }
.store-results .store-result-item .client-tag { color: var(--text-dim); font-size: 0.85rem; }

.note-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 0.9rem;
}
.note-item .note-meta { color: var(--text-dim); font-size: 0.78rem; margin-top: 2px; }
.note-badge {
  display: inline-block;
  background: var(--danger);
  color: white;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  margin-left: 6px;
}
.parts-badge {
  display: inline-block;
  background: var(--warn);
  color: white;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  margin-left: 6px;
}
.quote-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  margin-left: 6px;
}

/* Same specificity trap as #signature-kiosk/#detail-panel above: an author
   rule that sets display (even a plain class) beats the browser's default
   [hidden]{display:none}, so a hidden-but-flex element stays visible AND
   clickable. Caught by a real Playwright click succeeding when it should
   have been blocked, not by inspection. */
.quote-decision-actions { display: flex; gap: 10px; margin-top: 10px; }
.quote-decision-actions[hidden] { display: none; }

.quote-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
  margin-top: 8px;
  font-size: 0.9rem;
}

/* Office ticket detail panel — same inline-style/[hidden] specificity trap as
   the signature kiosk above; moved out of an inline style for exactly that
   reason (an inline display:flex would beat [hidden] even more directly).
   Centered (not bottom-anchored) and sized off the dynamic viewport (dvh) -
   a bottom-sheet anchored to plain vh looked like it was "running off the
   bottom" on phones, since iOS Safari's address/toolbar chrome eats into the
   visual viewport that plain vh doesn't account for. */
#detail-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
#detail-panel-card {
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  margin: 0;
  box-shadow: var(--shadow-lg);
}

/* Detail-panel sub-sections - replaces the repeated inline style="margin-top:..."
   pattern in office.html with a real class, and gives a long ticket detail
   visible chunking (divider + light tint) instead of one flat scroll. Using a
   class rather than inline display keeps this out of the [hidden]-vs-inline-
   style specificity trap this project has hit repeatedly before. */
.detail-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.detail-section:first-of-type { margin-top: 14px; }
.detail-section > strong { display: block; margin-bottom: 8px; font-family: var(--font-display); }
.detail-subcard {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 12px;
}
.detail-actions-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.detail-actions-row-final { margin-top: 18px; }
.detail-signature-img {
  max-width: 250px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 6px;
  background: #fff;
}
#detail-panel[hidden] {
  display: none;
}

/* Print view: only the open ticket's detail panel, laid out as a plain
   document rather than the on-screen modal (overlay/centering/scroll-clip
   would otherwise clip content or print a solid dark background). */
@media print {
  header.topbar, .filters, table.ticket-table, #close-detail, #detail-actions {
    display: none !important;
  }
  #detail-panel {
    position: static;
    inset: auto;
    background: none;
    padding: 0;
    display: block;
  }
  #detail-panel-card {
    max-width: none;
    max-height: none;
    overflow: visible;
    border: none;
    padding: 0;
  }
  #d-wo-edit, #d-notes-edit {
    border: none;
    padding: 0;
    background: none;
    resize: none;
  }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Add-on features (see supabase-client.js): anything marked with
   data-feature / data-feature-write stays hidden until the license has
   loaded; per-feature rules are injected after that. */
html:not(.features-ready) [data-feature],
html:not(.features-ready) [data-feature-write] { display: none !important; }

.license-banner {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.plan-features { list-style: none; margin: 10px 0 0; padding: 0; }
.plan-features li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border, #e5e7eb);
}
.plan-features li:last-child { border-bottom: none; }
.plan-features .badge { white-space: nowrap; }

/* Price Book page */
.pb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; margin: 8px 0; }
.pb-grid label { font-size: 0.88rem; }
.pb-table-wrap { overflow-x: auto; margin: 8px 0; }
.pb-rates, .pb-list { border-collapse: collapse; width: 100%; min-width: 520px; }
.pb-rates th, .pb-list th { text-align: left; font-size: 0.8rem; color: var(--text-dim); padding: 4px 6px; font-weight: 600; }
.pb-rates td, .pb-list td { padding: 3px 4px; }
.pb-rates input, .pb-list input, .pb-list select { margin: 0; min-width: 70px; }
.pb-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.pb-inline input, .pb-inline select { flex: 1 1 140px; margin: 0; }
.pb-client { border-top: 1px solid var(--border); padding: 10px 0; }
.pb-client summary { cursor: pointer; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.pb-holiday { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); }
.pb-ok { color: var(--ok); }
.screen > .card + .card { margin-top: 16px; }

/* Invoice section of the office ticket panel */
.invoice-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 0.92rem; }
.invoice-table th { text-align: left; font-size: 0.78rem; color: var(--text-dim); font-weight: 600; padding: 4px; border-bottom: 1px solid var(--border); }
.invoice-table td { padding: 6px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.invoice-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.invoice-table .inv-category { margin: 4px 0 0; padding: 2px 6px; font-size: 0.82rem; width: auto; }
.invoice-totals { margin: 6px 0 10px auto; max-width: 280px; font-variant-numeric: tabular-nums; }
.invoice-totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.invoice-totals .inv-total { font-weight: 700; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; }
.inv-nte { background: #fef3c7; color: #78350f; border: 1px solid #fcd34d; border-radius: 8px; padding: 8px 10px; font-size: 0.9rem; }
.inv-add-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.inv-add-row > * { flex: 1 1 120px; margin: 0; }
.inv-add-row #inv-desc { flex: 2 1 200px; }
.inv-add-row #inv-qty { flex: 0 1 80px; }
.inv-add-row [hidden] { display: none; }
@media print { #inv-add-form, .inv-category { display: none !important; } }

.inv-ai-badge { background: #ede9fe; color: #6d28d9; text-transform: none; font-size: 0.72rem; margin-left: 4px; }
.inv-ai-note { font-size: 0.82rem; color: #6d28d9; margin: 2px 0; }
.inv-cost-row { display: flex; gap: 6px; margin: 4px 0; }
.inv-cost-row input { max-width: 130px; margin: 0; }
.inv-cost-row button { margin: 0; padding: 4px 10px; }
.inv-unpriced { background: #fee2e2; color: #991b1b; border-radius: 6px; padding: 4px 8px; margin-bottom: 6px; font-size: 0.88rem; }
@media print { .inv-ai-badge, .inv-ai-note, .inv-cost-row, #inv-ai-box, #inv-ai-status { display: none !important; } }

/* Materials Used (field ticket) */
.mu-card { margin: 14px 0; }
.mu-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.mu-card #add-receipt-btn { margin-top: 8px; }
.mu-stock-head { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.mu-card #mu-source { margin: 8px 0; }
.mu-add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.mu-add-row button { margin: 0; }
.mu-picked-name { flex: 1 1 100%; color: var(--text-dim); font-size: 0.9rem; }
.mu-stepper { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; }
.mu-stepper button { -webkit-tap-highlight-color: transparent; min-width: 44px; min-height: 44px; font-size: 1.3rem; line-height: 1; padding: 0; }
.mu-stepper input { margin: 0; width: 4.5em; text-align: center; font-size: 1.1rem; }
#mu-add { min-height: 44px; padding: 0 22px; }
#mu-source { margin-top: 8px; }
#mu-form [hidden], .mu-card [hidden] { display: none; }
.mu-office-edit { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.mu-office-edit input { width: 72px; margin: 0; padding: 4px 6px; }
.inv-neg { color: var(--danger); font-weight: 600; }
.inv-low-cell { color: #b45309; font-weight: 600; }
.inv-grid .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Messaging */
.msg-status { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.msg-contact { border-top: 1px solid var(--border); padding: 12px 0; }
.msg-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.msg-checks .checkbox-label { margin: 2px 0; }
.msg-body { white-space: pre-wrap; font-size: 0.85rem; background: var(--bg); border-radius: 6px; padding: 8px; margin-top: 6px; max-width: 520px; }
.dash-stat-link { text-decoration: none; color: inherit; }
.ar-late .num { color: var(--danger); }

/* AI invoice review (step 4) */
.draft-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: #ede9fe; color: #5b21b6; }
.draft-badge.drafting { background: var(--bg); color: var(--text-dim); }
.review-banner { display: block; width: 100%; margin: 0 0 14px; padding: 12px 16px; border: none; border-radius: 10px; background: #ede9fe; color: #4c1d95; font-weight: 600; text-align: left; cursor: pointer; }
.review-banner::after { content: " ›"; }
.inv-cost-detail { margin: 10px 0; padding: 8px 12px; border: 1px dashed var(--border); border-radius: 8px; }
.inv-cost-detail summary { cursor: pointer; font-weight: 600; }
.inv-approve { margin: 12px 0 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.inv-approve-blockers { margin-bottom: 8px; padding: 8px 12px; border-radius: 8px; background: #fef2f2; color: var(--danger); font-size: 0.9rem; }
.inv-approve-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.inv-approve-row[hidden], .inv-approve-blockers[hidden], .inv-approve[hidden] { display: none; }
.inv-approve-row button { flex: 1 1 200px; margin: 0; }
#inv-approve-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Public demo (demo.clipboardzero.com) */
.demo-banner { padding: 10px 16px; background: #fff7e6; border-bottom: 1px solid #f3d9a4; color: #7a4b00; font-size: 0.9rem; text-align: center; }
.demo-mode #change-password-link, .demo-mode #change-password-view, .demo-mode #change-password-card { display: none !important; }
