/* SantaiRepair's own pieces on top of the shared back-office styles: statuses, a case's page, the claim slip and the
   customer's tracking page. */

/* ---------- People and stores ---------- */

.user-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #1b6ec2;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: .5rem;
  background-color: rgba(96, 165, 250, .18);
  color: #60a5fa;
  flex-shrink: 0;
}

.store-badge-lg {
  width: 3rem;
  height: 3rem;
  font-size: 1.35rem;
  background-color: var(--console-accent-soft, #e0ecf9);
  color: var(--console-accent-text, #1b6ec2);
}

/* ---------- Statuses ---------- */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
  padding: .4em .65em;
  border-radius: 999px;
}

.status-received { background-color: #e5e7eb; color: #374151; }
.status-diagnosing { background-color: #cffafe; color: #0e7490; }
.status-awaiting_approval { background-color: #fef3c7; color: #92400e; }
.status-waiting_parts { background-color: #ffedd5; color: #9a3412; }
.status-in_repair { background-color: #dbeafe; color: #1d4ed8; }
.status-testing { background-color: #e0e7ff; color: #4338ca; }
.status-ready { background-color: #dcfce7; color: #15803d; }
.status-collected { background-color: #f3f4f6; color: #4b5563; }
.status-cancelled { background-color: #fee2e2; color: #b91c1c; }

/* Dark mode: each status as a deep tint of its colour with light text, not the light pill dimmed (color-dark-mode). */
[data-bs-theme="dark"] .status-received { background-color: rgba(156, 163, 175, .18); color: #d1d5db; }
[data-bs-theme="dark"] .status-diagnosing { background-color: rgba(34, 211, 238, .16); color: #67e8f9; }
[data-bs-theme="dark"] .status-awaiting_approval { background-color: rgba(251, 191, 36, .16); color: #fcd34d; }
[data-bs-theme="dark"] .status-waiting_parts { background-color: rgba(251, 146, 60, .16); color: #fdba74; }
[data-bs-theme="dark"] .status-in_repair { background-color: rgba(96, 165, 250, .16); color: #93c5fd; }
[data-bs-theme="dark"] .status-testing { background-color: rgba(129, 140, 248, .18); color: #a5b4fc; }
[data-bs-theme="dark"] .status-ready { background-color: rgba(74, 222, 128, .15); color: #86efac; }
[data-bs-theme="dark"] .status-collected { background-color: rgba(156, 163, 175, .14); color: #d1d5db; }
[data-bs-theme="dark"] .status-cancelled { background-color: rgba(248, 113, 113, .16); color: #fca5a5; }

/* A quick fix (done while the customer waited): its own colour, apart from the statuses. #6b21a8 on #f3e8ff is 8.9:1. */
.quick-fix-badge { background-color: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
[data-bs-theme="dark"] .quick-fix-badge { background-color: rgba(192, 132, 252, .16); color: #d8b4fe; border-color: rgba(192, 132, 252, .3); }

/* The take-in form's "Fixing it now" / "Leaving it with us" switch: big halves, easy to hit. */
.intake-mode > .btn { min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; }

.overdue-text { color: #dc2626; font-weight: 600; }
[data-bs-theme="dark"] .overdue-text { color: #f87171; }

.repair-row { cursor: pointer; }
.repair-row .case-number { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }

/* ---------- A case's page ---------- */

.detail-list { display: grid; grid-template-columns: minmax(7rem, 35%) 1fr; gap: .45rem 1rem; margin: 0; }
.detail-list dt { font-weight: 500; color: var(--bs-secondary-color); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }

.money-summary { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; }
.money-summary .total { font-weight: 700; font-size: 1.1rem; }
.money-summary .owed { font-weight: 700; color: #b45309; }
.money-summary .settled { font-weight: 700; color: #15803d; }
/* Dark mode: the amber and green read 3.4:1 on the dark card, so lighter shades (over 7:1) (color-dark-mode). */
[data-bs-theme="dark"] .money-summary .owed { color: #fbbf24; }
[data-bs-theme="dark"] .money-summary .settled { color: #4ade80; }

.status-steps { display: flex; flex-wrap: wrap; gap: .5rem; }

.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: .7rem; top: .25rem; bottom: .25rem; width: 2px; background-color: var(--bs-border-color); }
.timeline li { position: relative; padding: 0 0 1rem 2.25rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .timeline-dot {
  position: absolute; left: 0; top: .1rem; width: 1.45rem; height: 1.45rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: .7rem;
  background-color: var(--bs-body-bg); border: 2px solid var(--bs-border-color); color: var(--bs-secondary-color);
}
.timeline .timeline-dot.dot-status { border-color: #1b6ec2; color: #1b6ec2; }
.timeline .timeline-dot.dot-payment { border-color: #15803d; color: #15803d; }
.timeline .timeline-dot.dot-note-public { border-color: #b45309; color: #b45309; }
.timeline .timeline-message { white-space: pre-line; overflow-wrap: anywhere; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .75rem; }
/* The take-in form's photos, before they're saved: smaller, so the form stays short on a phone. */
.photo-grid-sm { grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .5rem; }
.photo-tile { position: relative; border-radius: .5rem; overflow: hidden; background-color: var(--bs-tertiary-bg); aspect-ratio: 1; border: 1px solid var(--bs-border-color); }
.photo-tile .photo-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.photo-tile .photo-open:focus-visible { outline: 3px solid var(--focus-ring, #258cfb); outline-offset: -3px; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* "Add photo" is a label around a file field hidden from sight; the label shows the field's keyboard focus. */
#photo-add:has(#photo-input:focus-visible), #intake-photo-add:has(#intake-photo-input:focus-visible) { outline: 3px solid var(--focus-ring, #258cfb); outline-offset: 2px; }
.photo-tile .photo-caption { position: absolute; pointer-events: none; left: 0; right: 0; bottom: 0; padding: .25rem .4rem; font-size: .75rem; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Big enough to hit on purpose (2rem, 44px on a touch screen), not a speck beside the tap that opens the photo. */
.photo-tile .photo-delete {
  position: absolute; top: .3rem; right: .3rem; width: 2rem; height: 2rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.photo-viewer img { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; }

.passcode-hidden { letter-spacing: .2em; }

/* ---------- Intake form ---------- */

.intake-section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--bs-secondary-color); margin-bottom: .75rem; }
.customer-suggestions { max-height: 16rem; overflow-y: auto; }

/* ---------- Claim slip (printed) ---------- */

/* The column is what a receipt printer's head reaches, as SantaiPOS's receipt (receipt.css): 72 mm on an 80 mm roll,
   48 mm on a 58 mm one. The page size is left to the printer's driver, so it neither shrinks the slip nor cuts it. */
.slip-body { background-color: #e5e7eb; --slip-width: 72mm; }
.slip-body.paper-58 { --slip-width: 48mm; }
.slip-toolbar { max-width: min(26rem, calc(100% - 32px)); margin: 1rem auto; }
.slip-toolbar .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.slip-paper .btn[aria-pressed="true"] { --bs-btn-bg: #41464b; --bs-btn-color: #fff; --bs-btn-hover-bg: #41464b; --bs-btn-hover-color: #fff; }
/* The slip page loads Bootstrap without site.css, so its two buttons get the business blue and a grey dark enough for
   the grey backdrop here (7.7:1). */
.slip-toolbar .btn-primary {
  --bs-btn-bg: #1b6ec2; --bs-btn-border-color: #1b6ec2; --bs-btn-hover-bg: #1861ac; --bs-btn-hover-border-color: #1861ac;
  --bs-btn-active-bg: #155a9a; --bs-btn-active-border-color: #155a9a; --bs-btn-disabled-bg: #1b6ec2; --bs-btn-disabled-border-color: #1b6ec2;
}
.slip-toolbar .btn-outline-secondary { --bs-btn-color: #41464b; }
.slip {
  width: calc(var(--slip-width) + 8mm); margin: 0 auto 2rem; padding: 5mm 4mm; background: #fff; color: #000;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; line-height: 1.35;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.slip h1 { font-size: 15px; font-weight: 700; text-align: center; margin: 0 0 2px; }
/* The shop's logo above its name: small, and in grey tones so a receipt printer renders it cleanly. */
.slip .slip-logo { display: block; max-width: 40mm; max-height: 16mm; margin: 0 auto 4px; object-fit: contain; filter: grayscale(1) contrast(1.2); }
.slip .slip-center { text-align: center; }
.slip .slip-rule { border-top: 1px dashed #000; margin: 6px 0; }
.slip .slip-case { font-size: 16px; font-weight: 700; text-align: center; letter-spacing: .03em; margin: 4px 0; }
.slip table { width: 100%; border-collapse: collapse; }
.slip td { vertical-align: top; padding: 1px 0; }
.slip td.slip-label { width: 38%; color: #333; }
.slip .slip-qr { display: flex; justify-content: center; margin: 6px 0 2px; }
.slip .slip-qr img { width: 34mm; height: 34mm; image-rendering: pixelated; }
.slip .slip-code { text-align: center; font-weight: 700; letter-spacing: .12em; }
.slip .slip-terms { white-space: pre-line; font-size: 10px; }
.slip .slip-sign { margin-top: 14px; display: flex; justify-content: space-between; gap: 8px; }
.slip .slip-sign div { flex: 1; border-top: 1px solid #000; padding-top: 2px; text-align: center; font-size: 10px; }
/* Headings and row labels in English with the Malay under them (on 58 mm a label's Malay follows it after " / "). */
.slip .slip-heading { text-align: center; font-weight: 700; letter-spacing: .04em; }
.slip .slip-heading-ms { display: block; font-weight: 400; font-style: italic; letter-spacing: 0; font-size: 10px; }
.slip .slip-label-ms { display: block; font-style: italic; font-size: 9px; color: #333; }
.slip .slip-reprint { text-align: center; font-weight: 700; margin: 2px 0; }
.slip .slip-small { font-size: 9px; }
/* A long word (an email, an IMEI, a pasted link) breaks rather than running off the printed column. */
.slip h1, .slip td, .slip .slip-center, .slip .slip-heading, .slip .slip-terms, .slip .slip-sign div { overflow-wrap: anywhere; }

/* 58 mm: about 27 characters a line, so labels sit over their values, the QR is the app's 200 dots (25 mm), and the
   signatures stack. */
.paper-58 .slip { font-size: 10px; }
.paper-58 .slip h1 { font-size: 13px; }
.paper-58 .slip .slip-case { font-size: 14px; }
.paper-58 .slip .slip-logo { max-width: 32mm; max-height: 14mm; }
.paper-58 .slip tr, .paper-58 .slip td { display: block; width: auto; }
.paper-58 .slip td.slip-label { width: auto; padding-top: 3px; }
.paper-58 .slip td.slip-label .slip-label-ms { display: inline; }
.paper-58 .slip td.slip-label .slip-label-ms::before { content: " / "; font-style: normal; }
.paper-58 .slip td:not(.slip-label) { padding-left: 2mm; font-weight: 600; }
.paper-58 .slip .slip-qr img { width: 25mm; height: 25mm; }
.paper-58 .slip .slip-sign { flex-direction: column; gap: 18px; }

@media print {
  @page { margin: 0; }
  .slip-body { background: #fff; }
  .slip-toolbar { display: none !important; }
  .slip { box-shadow: none; margin: 0 auto; width: var(--slip-width); padding: 2mm 0; }
}

/* ---------- Customer tracking page ---------- */

.track-card { max-width: 40rem; margin: 0 auto; }
.track-progress { display: flex; justify-content: space-between; position: relative; margin: 1.5rem 0 1rem; padding: 0; list-style: none; }
/* A narrow phone has no room for five names under the dots: only the current one shows, as "Step 3 of 5: Repairing" says
   above; the others stay there for screen readers. */
@media (max-width: 419.98px) {
  .track-step:not(.current) .track-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
  .track-step.current .track-label { white-space: nowrap; }
}
.track-step-of { font-size: .875rem; color: var(--bs-secondary-color); margin: 1.25rem 0 -.5rem; }
.track-progress::before { content: ""; position: absolute; top: 1rem; left: 1rem; right: 1rem; height: 3px; background-color: var(--bs-border-color); }
.track-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; flex: 1; min-width: 0; text-align: center; font-size: .8125rem; line-height: 1.25; color: var(--bs-secondary-color); }
.track-step .track-dot { width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; background-color: var(--bs-body-bg); border: 3px solid var(--bs-border-color); z-index: 1; }
.track-step.done .track-dot { background-color: #1b6ec2; border-color: #1b6ec2; color: #fff; }
.track-step.current .track-dot { background-color: #fff; border-color: #1b6ec2; color: #1b6ec2; box-shadow: 0 0 0 4px rgba(27, 110, 194, .2); }
.track-step.current { color: var(--bs-body-color); font-weight: 600; }
.track-lookup { max-width: 28rem; margin: 0 auto; }
/* The quote's 6-digit key: big, spaced figures (Release 2). */
.track-digits { max-width: 12rem; font-variant-numeric: tabular-nums; letter-spacing: .3em; }
.track-quote-lines { font-variant-numeric: tabular-nums; }

/* ---------- The repairs list (as the SantaiPOS repair add-on had it) ---------- */

/* A repair's card: opens the repair when tapped anywhere but its links. Flat; the border darkens on hover. */
.repair-card { cursor: pointer; transition: border-color .15s; }
.repair-card:hover { border-color: var(--bs-border-color); }
/* A long device name wraps to a second line rather than being cut off. */
.repair-card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  .repair-card { transition: none; }
}

/* ---------- Taking a device in (as the SantaiPOS repair add-on had it) ---------- */

/* The country code beside the phone, as narrow as its longest code ("+880 BD"). */
.input-group > .repair-phone-code {
  flex: 0 0 6.5rem; width: 6.5rem; padding-right: 1.75rem; background-position: right .5rem center;
}

/* The device type as tiles, an icon over its name. */
.repair-type-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr)); gap: .4rem; }
.repair-type-tile {
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  padding: .45rem .25rem; font-size: .8rem; line-height: 1.15;
}
.repair-type-tile .bi { font-size: 1.3rem; }

/* A field that must be filled in (required-indicators); the input carries `required` for screen readers. */
.required-mark { color: var(--bs-danger-text-emphasis); font-weight: 600; }

/* The rarely needed details, folded until wanted. */
.repair-more > summary { cursor: pointer; color: var(--bs-primary-text-emphasis); }


/* ---------- A repair's page (as the SantaiPOS repair add-on had it) ---------- */

/* Its history, newest at the top: a line of dots, the newest filled. */
.repair-history { list-style: none; margin: 0; padding: 0; }
.repair-history li {
  position: relative; padding: 0 0 .9rem 1.4rem;
  border-left: 2px solid var(--bs-border-color); margin-left: .35rem;
}
.repair-history li:last-child { border-left-color: transparent; padding-bottom: 0; }
.repair-history li::before {
  content: ""; position: absolute; left: -.45rem; top: .2rem;
  width: .8rem; height: .8rem; border-radius: 50%;
  background: var(--bs-secondary-bg); border: 2px solid var(--bs-secondary-color);
}
.repair-history li:first-child::before { background: var(--bs-primary); border-color: var(--bs-primary); }
.repair-history li.history-payment::before { border-color: var(--bs-success); }
.repair-history li.history-note::before { border-color: var(--bs-warning); }
.repair-history .timeline-message { white-space: pre-line; overflow-wrap: anywhere; }

/* Counts and money keep their width as they change (tabular figures). */
.tabs-bar .count, .money-summary, .repair-card .card-footer, #repair-rows td:last-child { font-variant-numeric: tabular-nums; }

/* Yellow outline buttons: the text in the warning's readable shade (1.6:1 was too faint), the yellow kept for the border. */
.btn-outline-warning { --bs-btn-color: var(--bs-warning-text-emphasis); }
/* A table's move up/down buttons: big enough to tap (24px minimum). */
.btn-move { width: 1.75rem; height: 1.75rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }

/* The shared date and time field (_DateTimePick.cshtml, date-time-pick.js): chips like the other picks, a month
   calendar in a dropdown, and the choice as a sentence. */
.dt-pick .repair-picks > .dropdown > .btn { padding-left: .9rem; padding-right: .9rem; }
.dt-cal { padding: .5rem; width: 19rem; max-width: calc(100vw - 2rem); }
.dt-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .25rem; }
.dt-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.dt-cal-grid abbr { font-size: .75rem; color: var(--bs-secondary-color); text-decoration: none; padding: .25rem 0; cursor: default; }
.dt-cal-grid .btn { min-height: 2.5rem; padding: 0; border-radius: .5rem; }
.dt-cal-day { color: var(--bs-body-color); border: 0; }
.dt-cal-day:hover { background: var(--bs-tertiary-bg); }
.dt-cal-day:disabled { color: var(--bs-secondary-color); opacity: .45; }
.dt-cal-grid .is-today:not(.btn-primary) { box-shadow: inset 0 0 0 1px var(--bs-primary); }
.dt-sum, .dt-sum-text { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.dt-sum-text { display: inline-flex; }
/* On a touch screen, small buttons and fields grow to 44px so a thumb hits them (touch-target-size). .tap-target is for
   any small control that needs it; the sizes above stay for a mouse. */
@media (any-pointer: coarse) {
  .tap-target, .btn-move, .photo-tile .photo-delete, .input-group-sm.tap-target > .btn, .input-group-sm.tap-target > .form-control,
  .input-group-sm.tap-target > .input-group-text {
    min-height: 2.75rem;
  }
  .btn.tap-target, .btn-move, .photo-tile .photo-delete { min-width: 2.75rem; }
  .photo-tile .photo-delete { width: 2.75rem; height: 2.75rem; }
  /* The take-in form's chips (brand, repair, ready by...): a thumb's height, with room between them (touch-spacing). */
  .repair-picks { gap: .5rem !important; }
  .repair-picks > .btn { min-height: 2.75rem; padding-left: .9rem; padding-right: .9rem; }

  .dt-pick .repair-picks > .dropdown > .btn, .dt-pick .dt-time-list, .dt-cal-grid .btn { min-height: 2.75rem; }

  /* A repair's next steps, and the small buttons in card headers (Add photo, Record money). */
  #next-steps .btn, .admin-card-header .btn-sm { min-height: 2.75rem; }
  .admin-card-header .btn-sm { display: inline-flex; align-items: center; }
  /* "Call the customer" and email: a full-height row each. */
  .contact-link { display: inline-flex; align-items: center; min-height: 2.75rem; }
  /* Breadcrumb and "Repairs" back links: a 44px tap area; the negative margin keeps the header the same height. */
  .breadcrumb a, #back-to-list { display: inline-flex; align-items: center; min-height: 2.75rem; margin-block: -.75rem; }
  /* The claim slip's and receipt's buttons (Print, Record another quick fix, Open the case). */
  .slip-toolbar .btn { min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; }
  /* The page head's buttons (Print claim slip, Edit repair, More actions). */
  .page-head-actions .btn { min-height: 2.75rem; display: inline-flex; align-items: center; }
  /* A checkbox and its label make one 44px row, so the whole line takes the tap. */
  .form-check { display: flex; align-items: center; min-height: 2.75rem; margin-bottom: 0; }
  .form-check .form-check-input { margin-top: 0; flex-shrink: 0; }
  .form-check .form-check-label { padding-block: .5rem; padding-left: .5rem; }
}

/* ---------- Technicians' phones (docs/01-technicians.md) ---------- */

/* A paired phone on the store's Phones page: the accent colours, which read on a light card and in dark mode. */
.phone-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .5rem;
  font-size: 1.15rem;
  background-color: var(--console-accent-soft, #e0ecf9);
  color: var(--console-accent-text, #1b6ec2);
  flex-shrink: 0;
}

/* The pairing code to read off the screen, beside its QR code. */
.pair-code-box {
  padding: 1rem;
  border-radius: .75rem;
  background-color: var(--bs-tertiary-bg);
}
.pair-qr {
  display: block;
  margin: 0 auto .75rem;
  background: #fff;
  padding: .5rem;
  border-radius: .5rem;
  image-rendering: pixelated;
}
.pair-code {
  font-family: var(--bs-font-monospace);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.2;
}

/* On the phone: the code and the PIN as typed, easy to check at a glance. 16px+ so iOS doesn't zoom in. */
.pair-code-input {
  font-family: var(--bs-font-monospace);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.pin-input {
  letter-spacing: .3em;
}
/* Show PIN: a full-height, 48px-wide button beside the field. */
.pin-toggle {
  min-width: 3rem;
}

/* Outside the back office (the phone's sign-in page) the console's colour tokens aren't set: the same dark values here. */
[data-bs-theme="dark"] .store-badge-lg,
[data-bs-theme="dark"] .phone-badge {
  background-color: var(--console-accent-soft, #1d3452);
  color: var(--console-accent-text, #7ab8f5);
}


/* ---------- Refined layout (docs/11-ui-refinement.md) ---------- */

/* Blocks are flat: a hairline and no shadow. A block's header is a small label over a rule. */
.admin-card { border: 1px solid var(--bs-border-color-translucent); box-shadow: none; }
.admin-card-header { padding: .75rem 1.25rem; border-bottom: 1px solid var(--bs-border-color-translucent); }
.admin-card-header :is(h2, h3, h4).h6 {
  font-size: .8rem; line-height: 1.4; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bs-secondary-color);
}

/* Every page starts the same way: its title (the one h1), then its one main action on the right. */
.page-head { margin-bottom: 1.25rem; }
.page-head-title { font-size: 1.5rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.page-head-context { font-size: .875rem; color: var(--bs-secondary-color); }
.page-head-back { display: inline-block; font-size: .875rem; margin-bottom: .25rem; }

/* Status tabs above a list: one is open, each with its count. */
.tabs-bar { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--bs-border-color); margin-bottom: 1rem; }
.tabs-bar .tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0;
  padding: .55rem .9rem; min-height: 2.75rem; display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 600; color: var(--bs-secondary-color);
}
@media (max-width: 575.98px) { .tabs-bar { gap: 0; } .tabs-bar .tab { padding-inline: .6rem; } }
.tabs-bar .tab:hover { color: var(--bs-body-color); }
.tabs-bar .tab[aria-pressed="true"] { color: var(--bs-body-color); border-bottom-color: var(--console-accent, #1b6ec2); }
.tabs-bar .tab:focus-visible { outline: 3px solid var(--focus-ring, #258cfb); outline-offset: -3px; border-radius: .375rem; }
.tabs-bar .count { font-weight: 500; color: var(--bs-secondary-color); }
.tabs-bar .count.is-late { color: var(--bs-danger-text-emphasis); font-weight: 700; }

/* The row above a list: the search, then the layout and the filter menu. */
.list-toolbar { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.list-toolbar .input-group { flex: 1 1 auto; min-width: 0; }
.filter-menu { min-width: 16rem; }

/* The case's head, as the slip's: the number large in monospace, a dashed rule under it, the step line below. */
.ticket-head { border-bottom: 1px dashed var(--bs-border-color); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.ticket-number { font-family: var(--bs-font-monospace); font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.step-line { list-style: none; display: flex; margin: 1rem 0 0; padding: 0; }
.step-line li { flex: 1 1 0; min-width: 0; position: relative; padding-top: 1.4rem; text-align: center; font-size: .8125rem; line-height: 1.25; color: var(--bs-secondary-color); }
.step-line li::before {
  content: ""; position: absolute; top: .3rem; left: 50%; width: .75rem; height: .75rem; margin-left: -.375rem; z-index: 1;
  border-radius: 50%; background: var(--bs-body-bg); border: 2px solid var(--bs-border-color);
}
.step-line li + li::after { content: ""; position: absolute; top: .6rem; left: -50%; width: 100%; height: 2px; background: var(--bs-border-color); }
.step-line li.done::before, .step-line li.current::before { background: var(--console-accent, #1b6ec2); border-color: var(--console-accent, #1b6ec2); }
.step-line li.done::after, .step-line li.current::after { background: var(--console-accent, #1b6ec2); }
.step-line li.current::before { outline: 2px solid var(--console-accent, #1b6ec2); outline-offset: 2px; }
.step-line li.current { color: var(--bs-body-color); font-weight: 600; }
@media (max-width: 575.98px) {
  .step-line li:not(.current) .step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}

/* A stack of facts in a block: label above, value below on a phone, side by side from a tablet. */
.fact-list { display: grid; grid-template-columns: minmax(6.5rem, 30%) 1fr; gap: .5rem 1rem; margin: 0; }
.fact-list dt { font-weight: 500; color: var(--bs-secondary-color); }
.fact-list dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }

/* Empty states are one line. */
.state-line { padding: 2.5rem 1rem; text-align: center; color: var(--bs-secondary-color); }

.modal-note > summary { cursor: pointer; color: var(--bs-primary-text-emphasis); }

/* Take in: the button and what's still missing stay in reach at the foot of the form on a phone, above the bottom bar. */
.intake-footer { background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color-translucent); }
.intake-preview > summary { cursor: pointer; color: var(--bs-primary-text-emphasis); }
@media (max-width: 991.98px) {
  .intake-footer { position: sticky; bottom: calc(3.5rem + env(safe-area-inset-bottom)); z-index: 5; }
}

/* The dashboard's figures: one flat block, four numbers divided by hairlines. */
.figure-row { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--bs-border-color-translucent); border-radius: .75rem; background: var(--bs-body-bg); overflow: hidden; }
@media (min-width: 992px) { .figure-row { grid-template-columns: repeat(4, 1fr); } }
.figure { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.25rem; color: var(--bs-body-color); text-decoration: none; border-right: 1px solid var(--bs-border-color-translucent); border-bottom: 1px solid var(--bs-border-color-translucent); margin: 0 -1px -1px 0; }
.figure-link:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.figure-link:focus-visible { outline: 3px solid var(--focus-ring, #258cfb); outline-offset: -3px; }
.figure-label { font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bs-secondary-color); }
.figure-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.figure-value.is-late { color: var(--bs-danger-text-emphasis); }

/* Where the repairs are: a thin bar cut by status, and a legend. */
.status-bar { display: flex; height: .5rem; border-radius: 999px; overflow: hidden; gap: 2px; }
.status-bar > span { display: block; min-width: .5rem; }
.status-legend { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .4rem; }
.status-legend li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-variant-numeric: tabular-nums; }

/* The folded owner check: its summary is the block's header. */
details.admin-card > summary { list-style: none; cursor: pointer; }
details.admin-card > summary::-webkit-details-marker { display: none; }
details.admin-card[open] > summary { border-bottom: 1px solid var(--bs-border-color-translucent); }
details.admin-card:not([open]) > summary { border-bottom: 0; }
details.admin-card[open] > summary .bi-chevron-down { transform: rotate(180deg); }

/* A list inside a block ends on the block's own edge. */
.admin-card > .list-group-flush > .list-group-item:last-child { border-bottom: 0; }
.admin-card > .list-group-flush { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }

/* Table heads read as the blocks' labels do. */
.admin-card .table > thead th { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bs-secondary-color); }

/* Plans on the landing page (flat blocks, like the rest of the site). */
.plan { display: flex; flex-direction: column; padding: 1.25rem; border: 1px solid var(--bs-border-color); border-radius: .75rem; background: var(--bs-body-bg); }
.plan-featured { border-color: var(--bs-primary); box-shadow: inset 0 0 0 1px var(--bs-primary); }
.plan-price { font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.plan-bundle { min-height: 1.5rem; margin: .35rem 0 1rem; font-size: .875rem; font-weight: 600; color: var(--bs-success-text-emphasis, #0f5132); }
.plan-list { margin-bottom: 1.25rem; }
.plan-list li { display: flex; gap: .5rem; padding: .25rem 0; }
.plan-list .bi { flex-shrink: 0; color: var(--bs-primary); }
.plan .btn { min-height: 44px; }
@media (max-width: 767.98px) { .plan-bundle-none { display: none; } }

/* A store's card: four numbers with their icons, and one pill for SantaiPOS. */
.card-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; padding: .875rem 0 .5rem; border-top: 1px solid var(--bs-border-color-translucent); }
.card-stat { display: inline-flex; align-items: center; gap: .4rem; color: var(--bs-body-color); text-decoration: none; min-width: 0; min-height: 2rem; }
.card-stat .bi { color: var(--bs-secondary-color); font-size: 1.1rem; }
a.card-stat:hover .card-stat-value { color: var(--bs-link-color); text-decoration: underline; }
.card-stat-value { font-size: 1.25rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.card-stat-value.is-none { color: var(--bs-secondary-color); font-weight: 600; }
.pos-pill { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color-translucent); }
.pos-pill.is-linked { color: var(--bs-success-text-emphasis); background: var(--bs-success-bg-subtle); border-color: transparent; }
.pos-pill.is-linked:hover { text-decoration: underline !important; }
@media (any-pointer: coarse) { .card-stat { min-height: 2.75rem; } }

/* A store's logo: a small rounded tile, the same on its card and in its settings. */
.store-logo { width: 3rem; height: 3rem; object-fit: contain; border-radius: .5rem; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); padding: .15rem; }
.store-logo-lg { width: 4rem; height: 4rem; }

/* The SantaiPOS pill sits in the card's top right corner, floated so the name wraps around it (two lines at most) instead of being cut. On a narrow card it shrinks to its icon. */
.pos-slot { float: right; position: relative; z-index: 2; margin: 0 0 0 .5rem; }
.store-card-title { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.store-address a { overflow-wrap: anywhere; }
/* On a narrow card the pill is its icon only, and grows to the left over the name when pointed at or focused. */
@container (max-width: 18rem) {
  .pos-slot { width: 2.1rem; height: 1.55rem; }
  .pos-slot .pos-pill { position: absolute; top: 0; right: 0; white-space: nowrap; gap: 0; }
  .pos-slot .pos-label { display: inline-block; max-width: 0; margin-left: 0; opacity: 0; overflow: hidden; }
  .pos-slot .pos-pill:hover .pos-label, .pos-slot .pos-pill:focus-visible .pos-label { max-width: 7rem; margin-left: .35rem; opacity: 1; }
  .pos-slot .pos-pill:hover, .pos-slot .pos-pill:focus-visible { box-shadow: 0 0 0 .25rem var(--bs-body-bg); }
}
@media (prefers-reduced-motion: no-preference) {
  @container (max-width: 18rem) {
    .pos-slot .pos-label { transition: max-width .25s ease, margin-left .25s ease, opacity .2s ease; }
  }
}
.card-gear { width: 2rem; height: 2rem; border-radius: .5rem; font-size: 1.15rem; color: var(--bs-secondary-color); text-decoration: none; }
.card-gear:hover { color: var(--bs-link-color); background: var(--bs-tertiary-bg); }
@media (any-pointer: coarse) { .card-gear { width: 2.75rem; height: 2.75rem; } }
/* The card's two ways in: the store's back office pages, and its store system (its own tab). Icon and word, so neither has to be guessed. */
.card-link { text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card-link .bi { font-size: 1rem; }

/* The stores' cards share their rows: in a row of cards the top parts are as tall as the tallest, so the dividers, the four numbers
   and the links line up across the cards, with the same spacing in each. */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); column-gap: 1rem; }
.store-card { grid-row: span 3; display: grid; grid-template-rows: subgrid; margin-bottom: 1rem; }
.store-card .card-body { grid-row: 1 / -1; display: grid; grid-template-rows: subgrid; padding-block: 1rem .5rem; }
.store-card-top { padding-bottom: .875rem; container-type: inline-size; }  /* a layout-contained subgrid wouldn't size its rows, so the pill's container is the top part */
.store-card-foot { align-self: end; padding-top: .25rem; }

/* Add store: a tile to pick the logo, beside the name. */
.logo-pick-wrap { position: relative; width: 4rem; }
.logo-pick { display: grid; place-items: center; width: 4rem; height: 4rem; padding: 0; overflow: hidden; border: 1px dashed var(--bs-border-color); border-radius: .75rem; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); font-size: 1.5rem; }
.logo-pick:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.logo-pick:focus-visible { outline: 3px solid var(--focus-ring, #258cfb); outline-offset: 2px; }
.logo-pick img { width: 100%; height: 100%; object-fit: contain; }
.logo-pick-clear { position: absolute; top: -.4rem; right: -.4rem; display: grid; place-items: center; width: 1.4rem; height: 1.4rem; padding: 0; border: 1px solid var(--bs-border-color); border-radius: 50%; background: var(--bs-body-bg); color: var(--bs-secondary-color); font-size: .65rem; }
.logo-pick-clear:hover { color: var(--bs-danger); }
@media (any-pointer: coarse) { .logo-pick-clear { width: 2rem; height: 2rem; top: -.75rem; right: -.75rem; } }

/* Address suggestions under a field. */
.suggest-list { position: absolute; z-index: 5; top: calc(100% + .25rem); left: 0; right: 0; max-height: 16rem; overflow-y: auto; margin: 0; padding: .25rem; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .5rem; box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .15); }
.suggest-list [role="option"] { padding: .5rem .625rem; border-radius: .375rem; font-size: .875rem; cursor: pointer; }
.suggest-list [role="option"]:hover, .suggest-list [role="option"][aria-selected="true"] { background: var(--bs-tertiary-bg); }
.suggest-list .suggest-credit { padding: .375rem .625rem .125rem; font-size: .6875rem; color: var(--bs-secondary-color); }
.suggest-list .suggest-credit a { color: inherit; }
@media (any-pointer: coarse) { .suggest-list [role="option"] { padding: .75rem .625rem; } }

/* A field's icon, inside it at the left (rule in CLAUDE.md): the same icon the card shows for that fact. */
.field-icon { position: relative; }
.field-icon > .field-icon-mark { position: absolute; z-index: 4; left: .8rem; top: .55rem; font-size: 1.05rem; color: var(--bs-secondary-color); pointer-events: none; }
.field-icon > .form-control { padding-left: 2.5rem; }
.field-icon > .position-relative > .form-control { padding-left: 2.5rem; }
.field-icon > .input-group > .phone-code, .field-icon > .input-group > .repair-phone-code { flex-basis: 8.5rem; width: 8.5rem; padding-left: 2.5rem; }

/* What's wrong, said with an icon (form-design-system in CLAUDE.md): a field's message and a form's alert. */
.invalid-feedback::before,
.modal .alert-danger::before,
.modal .alert-warning::before {
  font-family: bootstrap-icons !important;
  font-style: normal;
  content: "\f333";
  margin-right: .35rem;
  vertical-align: -.1em;
}

/* The customer's pages are the shop's: its logo and name on top, nothing of ours around them. */
.track-shop { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: .5rem 0 1.5rem; text-align: center; }
.track-shop-name { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.track-footer { padding: 1.5rem 1rem 2rem; text-align: center; font-size: .8125rem; }
.track-footer a { color: var(--bs-secondary-color); }

/* An icon inside an input-group (a PIN with its Show button, a number with its unit): the first control leaves room for it. */
.input-group.field-icon > .field-icon-mark + .form-control { padding-left: 2.5rem; margin-left: 0; border-top-left-radius: var(--bs-border-radius); border-bottom-left-radius: var(--bs-border-radius); }
.input-group.field-icon > .field-icon-mark { z-index: 4; }
.field-icon:has(> .form-control-lg) > .field-icon-mark { top: .8rem; font-size: 1.2rem; }
.field-icon:has(> .form-control-sm) > .field-icon-mark { top: .4rem; font-size: .95rem; }

/* A field's icon sits beside its label, before the words (form-design-system in CLAUDE.md). A field with no visible label
   (a search, a filter) keeps its icon inside, as .field-icon. */
.label-icon { margin-right: .4rem; font-size: 1em; color: var(--bs-secondary-color); vertical-align: -.1em; }

/* A repair's parts (docs/14), built like its photos: name and quantity, then the price; a pill only when something's
   wrong. The same rows list Fix now's parts. */
.part-rows { font-variant-numeric: tabular-nums; }
.part-rows > li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .4rem 0; border-top: 1px solid var(--bs-border-color-translucent); }
.part-rows > li:first-child { border-top: 0; padding-top: 0; }
.part-rows .badge { font-weight: 500; }

/* The parts picker: the quantity beside the search; each result a full-width row (a thumb's height), the picked one in
   repair blue with its words still readable. */
.part-qty { width: 7.5rem; }
.part-results .part-option { min-height: 3.25rem; font-variant-numeric: tabular-nums; }
.part-option-meta { color: var(--bs-secondary-color); }
.part-option.active .part-option-meta { color: inherit; }
.part-stock { font-weight: 500; }
/* The category pills: they wrap onto more lines when the store has many, so each can be seen and reached by any pointer. */
.part-cats { flex-wrap: wrap; }
/* The letters a search found, in a name: the theme's highlight, readable in both modes and on the picked row. */
.part-match { padding: 0; background: var(--bs-highlight-bg); color: var(--bs-highlight-color, inherit); border-radius: .15rem; }

/* ---------------- The store system's sign-in, as SantaiPOS's register lock screen ----------------
   A narrow card: the store, who's signing in, the PIN as dots over a keypad, and Sign in. */
.auth-card.pin-card { max-width: 22rem; border-radius: 1rem; }
.auth-card.pin-card > .card-body { padding: 1.5rem !important; }
.pin-head { display: flex; flex-direction: column; align-items: center; margin-bottom: 1rem; text-align: center; }
.pin-head .store-badge-lg { width: 3.25rem; height: 3.25rem; border-radius: .875rem; font-size: 1.5rem; }
.pin-store { max-width: 100%; margin: .75rem 0 .125rem; font-size: 1.25rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.pin-business { max-width: 100%; font-size: .875rem; color: var(--bs-secondary-color); overflow-wrap: anywhere; }
/* A notice can be a sentence ("You were signed out: ..."): it wraps inside the card. */
.pin-notice {
  max-width: 100%; margin-top: .625rem; font-weight: 500; white-space: normal; line-height: 1.35; overflow-wrap: anywhere;
  background-color: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
}

/* The people who signed in here lately, each a wide button with their initials; "someone else" a square beside them. */
.pin-people { display: flex; flex-wrap: wrap; gap: .5rem; }
.pin-person {
  flex: 1 1 7rem; display: flex; align-items: center; justify-content: center; gap: .5rem; min-width: 0; min-height: 2.875rem;
  padding: .35rem .6rem; border: 1px solid var(--bs-border-color); border-radius: .75rem;
  background-color: var(--bs-body-bg); color: var(--bs-body-color); font-size: .9rem; font-weight: 600;
}
.pin-person[aria-pressed="true"] { border-color: var(--bs-primary); background-color: var(--bs-primary-bg-subtle); box-shadow: inset 0 0 0 1px var(--bs-primary); }
.pin-person[aria-pressed="true"] .pin-person-initials { background-color: var(--bs-primary); color: #fff; }
.pin-person-other { flex: 0 0 2.875rem; color: var(--bs-secondary-color); font-size: 1.15rem; }
.pin-person-other[aria-pressed="true"] { color: var(--bs-primary-text-emphasis); }
.pin-person-initials {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 1.625rem; height: 1.625rem;
  border-radius: 50%; background-color: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-size: .7rem; font-weight: 700;
}

/* The PIN as dots. The real box lies over them, unseen, so a keyboard or a scanner still types into it. */
.pin-entry { position: relative; display: flex; align-items: center; justify-content: center; height: 3rem; border-radius: .75rem; }
.pin-entry-input { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; }
.pin-entry:focus-within { outline: 2px solid var(--bs-primary); outline-offset: -2px; }
.pin-dots { display: flex; gap: .875rem; pointer-events: none; }
.pin-dots i { width: .875rem; height: .875rem; border: 1.5px solid var(--bs-secondary-color); border-radius: 50%; }
.pin-dots i.is-on { border-color: var(--bs-emphasis-color); background-color: var(--bs-emphasis-color); }
.pin-dots.is-invalid i { border-color: var(--bs-danger); background-color: var(--bs-danger); }
.pin-dots-hint { color: var(--bs-secondary-color); font-size: 1rem; }
.pin-dots.is-invalid .pin-dots-hint { color: var(--bs-danger-text-emphasis); }
@media (prefers-reduced-motion: no-preference) {
  .pin-dots i.is-new { animation: pin-dot-in .14s ease-out; }
}
@keyframes pin-dot-in { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* Fewer than 4 digits: Sign in looks not ready yet, but still answers a tap with what's missing. */
.pin-submit.is-waiting:not(:disabled) { opacity: .5; }
.pin-feedback { text-align: center; }

.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .5rem; }
.pin-key {
  display: inline-flex; align-items: center; justify-content: center; height: 3.5rem; padding: 0; border: 0; border-radius: .875rem;
  background-color: var(--bs-secondary-bg); color: var(--bs-body-color); font-size: 1.3rem; font-weight: 600;
  transition: transform .08s ease, background-color .12s ease;
}
.pin-key:hover { background-color: color-mix(in srgb, var(--bs-secondary-bg) 85%, var(--bs-body-color)); }
.pin-key:active { transform: scale(.96); }
.pin-key-quiet { background: none; color: var(--bs-secondary-color); font-size: .9rem; }
.pin-key-quiet .bi { font-size: 1.35rem; }
.pin-submit { min-height: 3.25rem; border-radius: .75rem; font-weight: 600; }
.pin-key:focus-visible, .pin-person:focus-visible { outline: 3px solid var(--bs-primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .pin-key { transition: none; } .pin-key:active { transform: none; } }

/* ---------------- Scanning with the camera (camera-scan.js) ---------------- */

/* The camera button sits at the end of the search box, and the clear button moves in beside it. */
.register-find-scan {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--bs-body-color);
  font-size: 1.2rem;
}

.register-find-scan[hidden] {
  display: none;
}

.register-find-scan:hover {
  color: var(--bs-primary);
}

.register-find-scan:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: -4px;
}

.register-find.has-scan .form-control {
  padding-right: 5.25rem;
}

.register-find.has-scan .register-find-clear {
  right: 2.75rem;
}

/* The scanner covers the page: the camera's picture edge to edge, a frame to aim with, and what was read under it. */
body.camera-scan-open {
  overflow: hidden;
}

.camera-scan {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #0b0f17;
  color: #fff;
}

.camera-scan-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .2s ease;
}

.camera-scan.is-live .camera-scan-video {
  opacity: 1;
}

.camera-scan.has-problem .camera-scan-video,
.camera-scan.has-problem .camera-scan-guide {
  display: none;
}

/* Where to hold the code, and the only part of the picture that's read; everything around it is dimmed. Wide for a
   barcode's bars, square for a QR code. */
.camera-scan-guide {
  position: absolute;
  top: 46%;
  left: 50%;
  width: min(86vw, 30rem);
  height: min(30vh, 12rem);
  border: 3px solid #fff;
  border-radius: 1rem;
  box-shadow: 0 0 0 100vmax rgba(11, 15, 23, .55);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.camera-scan.is-qr .camera-scan-guide {
  width: min(70vw, 46vh, 18rem);
  height: min(70vw, 46vh, 18rem);
}

.camera-scan-top,
.camera-scan-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: max(.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .75rem max(1rem, env(safe-area-inset-left));
}

.camera-scan-title {
  flex: 1;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.camera-scan-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 1.25rem;
}

.camera-scan-button[hidden] {
  display: none;
}

.camera-scan-button[aria-pressed="true"] {
  background: #fff;
  color: #0b0f17;
}

.camera-scan-button:focus-visible,
.camera-scan-done:focus-visible,
.camera-scan-retry:focus-visible {
  outline: 3px solid #8ec5ff;
  outline-offset: 2px;
}

.camera-scan-foot {
  flex-direction: column;
  align-items: stretch;
  gap: .75rem;
  padding-top: .75rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* What the last barcode was: the item and its price in green, or that nothing has it in red. */
.camera-scan-result {
  align-self: center;
  max-width: 100%;
  min-height: 2.75rem;
  margin: 0;
  padding: .625rem 1rem;
  border-radius: 999px;
  background: #14532d;
  color: #fff;
  font-weight: 600;
  text-align: center;
  overflow-wrap: anywhere;
  visibility: hidden;
}

.camera-scan-result.is-shown {
  visibility: visible;
}

.camera-scan-result.is-bad {
  background: #842029;
}

/* Barcode or QR code: the two halves of one control, the chosen one lifted. The scanner reads only that kind. */
.camera-scan-kinds {
  display: flex;
  gap: .25rem;
  width: 100%;
  max-width: 30rem;
  align-self: center;
  padding: .25rem;
  border-radius: .875rem;
  background: rgba(255, 255, 255, .16);
}

.camera-scan-kinds[hidden] {
  display: none;
}

.camera-scan-kind {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: 0 .5rem;
  border: 0;
  border-radius: .625rem;
  background: none;
  color: #fff;
  font-weight: 600;
}

.camera-scan-kind[aria-checked="true"] {
  background: #fff;
  color: #0b0f17;
}

.camera-scan-kind:focus-visible {
  outline: 3px solid #8ec5ff;
  outline-offset: 2px;
}

.camera-scan-done {
  width: 100%;
  max-width: 30rem;
  min-height: 3.25rem;
  align-self: center;
  font-weight: 600;
}

.camera-scan-problem {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1.5rem;
  text-align: center;
}

.camera-scan-problem[hidden] {
  display: none;
}

/* With no picture there's one thing to do, Try again; Close is still at the top. */
.camera-scan.has-problem {
  justify-content: flex-start;
}

.camera-scan.has-problem .camera-scan-problem {
  margin: auto;
}

.camera-scan.has-problem .camera-scan-foot {
  display: none;
}

.camera-scan-problem-icon {
  font-size: 2.5rem;
  opacity: .85;
}

.camera-scan-problem-text {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.camera-scan-problem-fact {
  margin: 0;
  color: #d5dbe5;
}

.camera-scan-retry {
  min-height: 2.75rem;
  margin-top: .5rem;
  padding-inline: 1.25rem;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .camera-scan-video {
    transition: none;
  }
}


/* The repair station's connect card, as SantaiPOS's register setup: the code with its Scan QR button, then one quiet row
   of the other ways in. */
.pair-scan { min-width: 3.5rem; font-size: 1.25rem; }
/* No camera, no Scan QR: the code field keeps its right corners (Bootstrap's has-validation counts the hidden button). */
#pair-code:has(+ #pair-scan.d-none) { border-top-right-radius: var(--bs-border-radius-lg); border-bottom-right-radius: var(--bs-border-radius-lg); }
.setup-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 .75rem; margin-top: .75rem; }
.setup-links:not(:has(> :not(.d-none))) { display: none; }

/* The Services page: each service a card, the most used first; the whole card is the button that edits it. */
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .75rem; }
.service-card {
  display: flex; flex-direction: column; gap: .5rem; min-height: 7.5rem; padding: 1rem; text-align: start;
  border: 1px solid var(--bs-border-color); border-radius: .75rem; background-color: var(--bs-body-bg); color: var(--bs-body-color);
}
button.service-card { cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease; }
button.service-card:hover { border-color: var(--bs-primary); }
button.service-card:focus-visible { outline: 3px solid var(--bs-primary); outline-offset: 2px; }
.service-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.service-card-name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.service-card-top-pill { flex-shrink: 0; font-weight: 700; border: 1px solid var(--bs-border-color); background-color: transparent; color: var(--bs-body-color); }
.service-card-desc { margin-top: -.25rem; font-size: .8125rem; color: var(--bs-secondary-color); overflow-wrap: anywhere; }
.service-card-price { margin-top: auto; font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.service-card-price.is-none { font-size: .9375rem; font-weight: 500; color: var(--bs-secondary-color); }
.service-card-pills { display: flex; flex-wrap: wrap; gap: .375rem; }
.service-pill { font-weight: 500; border: 1px solid var(--bs-border-color); background-color: transparent; color: var(--bs-secondary-color); }
@media (prefers-reduced-motion: reduce) { button.service-card { transition: none; } }

/* ---------- Android app download page (Views/Home/App.cshtml) ---------- */

.app-dl-hero { padding: 1.5rem 0 2.5rem; }
/* .lp-eyebrow is repair blue, too dark on the dark page (AA): Night Accent Text there. */
[data-bs-theme="dark"] .app-dl-hero .lp-eyebrow { color: #7ab8f5; }
.app-dl-more { padding: 2rem 0 1rem; border-top: 1px solid var(--bs-border-color-translucent); }
.app-dl-card {
  padding: 1.5rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  background: var(--bs-body-bg);
  box-shadow: 0 1.5rem 3rem -1.5rem rgb(17 24 39 / 20%);
}
[data-bs-theme="dark"] .app-dl-card { box-shadow: none; background: var(--bs-tertiary-bg); }
.app-dl-button { min-height: 48px; font-weight: 650; border-radius: .75rem; }
@media (max-width: 575.98px) { .app-dl-button { width: 100%; } }
/* QR codes scan best dark on light, so it keeps its white ground in dark mode too. */
.app-dl-qr { width: min(100%, 220px); margin: 0 auto; padding: .5rem; border-radius: .5rem; background: #fff; }
.app-dl-qr svg { display: block; width: 100%; height: auto; }
.app-dl-steps { display: grid; gap: 1rem; }
.app-dl-steps > li { display: flex; gap: 1rem; align-items: center; min-height: 2.75rem; }
.app-dl-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background: #1b6ec2;
}
[data-bs-theme="dark"] .app-dl-num { color: #0d121b; background: #7ab8f5; }
.app-dl-notes { padding-left: 1.25rem; line-height: 1.6; }
.app-dl-history { border-top: 1px solid var(--bs-border-color-translucent); }
.app-dl-release { border-bottom: 1px solid var(--bs-border-color-translucent); }
.app-dl-release[open] { padding-bottom: .75rem; }
/* Kept as a list item, so the browser's arrow shows it opens; the padding makes it a 44px target. */
.app-dl-release summary { padding: .625rem 0; min-height: 2.75rem; cursor: pointer; }
.app-dl-link { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; }

/* ---------- The quote builder (Release 2, web station) ---------- */

.quote-builder .q-qty { width: 5rem; }
.quote-builder .q-price { width: 9rem; }
.quote-builder .btn-group-sm > .btn { min-height: 2.25rem; }
@media (pointer: coarse) { .quote-builder .btn-group-sm > .btn, .quote-builder .form-control-sm { min-height: 44px; } }
