:root {
  color-scheme: light;
  --ink: #18202f;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --soft: #f3f6f9;
  --accent: #0f7b6c;
  --accent-strong: #095f54;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 16px 40px rgba(22, 34, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eef3f1;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

.site-frame {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.site-frame .app-shell {
  width: min(1240px, 100%);
  margin: 0;
}

.public-frame {
  min-height: 100vh;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.public-brand,
.public-nav {
  display: flex;
  align-items: center;
}

.public-brand {
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.public-brand span:last-child {
  display: grid;
  gap: 2px;
}

.public-brand small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.public-nav {
  gap: 8px;
}

.public-nav a {
  display: grid;
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.public-logout {
  margin: 0;
}

.public-logout button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.public-shell {
  min-height: auto;
}

.vendor-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 0.35fr) 90px auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.vendor-search label {
  display: grid;
  gap: 5px;
}

.vendor-search span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.vendor-search input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.vendor-row {
  grid-template-columns: minmax(0, 1fr) 110px minmax(160px, 0.35fr);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}

.settings-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.settings-form {
  display: grid;
  gap: 12px;
}

.settings-form label:not(.toggle-row) {
  display: grid;
  gap: 6px;
}

.settings-form label > span:first-child {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-form input[type="email"],
.settings-form input[type="number"],
.settings-form input[name="service_country"],
.settings-form input[name="service_postal_code"] {
  min-height: 44px;
}

.radius-settings {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) minmax(110px, 0.45fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.invite-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.invite-list {
  display: grid;
  gap: 10px;
}

.invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.invite-row span {
  display: grid;
  gap: 3px;
}

.invite-row small {
  color: var(--muted);
  font-weight: 750;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  margin: 0 0 12px;
}

.account-choice-panel {
  width: min(760px, 100%);
}

.account-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-choice-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.account-choice-card strong {
  font-size: 1.18rem;
}

.account-choice-card span {
  color: var(--muted);
  line-height: 1.4;
}

.account-choice-card:hover {
  border-color: rgba(15, 123, 108, 0.45);
  box-shadow: 0 10px 28px rgba(22, 34, 51, 0.1);
}

.auth-copy {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-error {
  margin: 0 0 14px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 6px;
  padding: 10px;
  color: var(--danger);
  background: #fff7f5;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 5px;
}

.auth-form label span,
.auth-secret span,
.auth-qr > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-form input {
  min-height: 44px;
}

.auth-secondary-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.auth-secret {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
}

.auth-secret strong,
.auth-secret small {
  overflow-wrap: anywhere;
}

.auth-secret small {
  color: var(--muted);
  line-height: 1.35;
}

.auth-qr {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #f8fafc;
}

.auth-qr img {
  width: min(240px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.auth-qr p {
  margin: 0;
  color: var(--muted);
}

.auth-qr details {
  display: grid;
  gap: 6px;
}

.auth-qr summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
}

.auth-qr strong,
.auth-qr small {
  overflow-wrap: anywhere;
}

.auth-qr small {
  color: var(--muted);
  line-height: 1.35;
}

.side-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  background: #fbfcfd;
}

.side-brand,
.side-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.side-brand {
  min-height: 48px;
  padding: 0 8px;
}

.brand-mark,
.side-nav-link span {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-weight: 900;
}

.side-brand strong,
.side-brand small {
  display: block;
}

.side-brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.side-nav-links {
  display: grid;
  gap: 6px;
}

.side-logout {
  margin-top: auto;
}

.side-logout .secondary-button {
  width: 100%;
}

.side-nav-link {
  min-height: 44px;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.94rem;
}

.side-nav-link.is-active {
  background: #e8f3ef;
  color: var(--accent-strong);
}

.side-nav-link.is-disabled {
  color: #9aa6b6;
}

button,
input,
select {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0 22px;
}

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

.dashboard-actions {
  align-items: flex-end;
  flex-direction: column;
}

.dashboard-status {
  min-height: 18px;
  max-width: 320px;
  text-align: right;
}

.topbar-actions .danger-button {
  min-height: 44px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 7vw, 4.6rem);
  line-height: 0.95;
}

h2 {
  font-size: 1rem;
}

.status-pill {
  min-width: 86px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 6px 18px rgba(22, 34, 51, 0.06);
}

.status-pill[data-tone="success"] {
  border-color: rgba(8, 116, 67, 0.28);
  color: var(--success);
}

.status-pill[data-tone="working"] {
  border-color: rgba(15, 123, 108, 0.28);
  color: var(--accent);
}

.status-pill[data-tone="error"] {
  border-color: rgba(180, 35, 24, 0.28);
  color: var(--danger);
}

.capture-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.station-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
}

.capture-panel,
.recent-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.capture-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 18px;
  padding: 18px;
}

.station-panel {
  grid-template-columns: minmax(0, 1fr) 310px;
}

.preview-frame {
  position: relative;
  display: grid;
  min-height: 560px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(24, 32, 47, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(24, 32, 47, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(24, 32, 47, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(24, 32, 47, 0.035) 75%),
    #fbfcfd;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
  background-size: 16px 16px;
}

.preview-frame video,
.preview-frame img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.station-preview img {
  object-fit: cover;
}

.preview-frame video.is-visible,
.preview-frame img.is-visible {
  display: block;
}

#captureCanvas {
  display: none;
}

.empty-preview {
  display: grid;
  gap: 12px;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.empty-preview.is-hidden {
  display: none;
}

.camera-mark {
  position: relative;
  width: 72px;
  height: 52px;
  border: 5px solid #9aa6b6;
  border-radius: 8px;
}

.camera-mark::before {
  position: absolute;
  top: -15px;
  left: 13px;
  width: 28px;
  height: 10px;
  border-radius: 5px 5px 0 0;
  background: #9aa6b6;
  content: "";
}

.camera-mark::after {
  position: absolute;
  top: 12px;
  left: 20px;
  width: 22px;
  height: 22px;
  border: 4px solid #9aa6b6;
  border-radius: 999px;
  content: "";
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.device-help {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.device-help strong {
  font-size: 0.86rem;
}

.device-help span,
.small-status {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  word-break: break-word;
}

.field-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

select,
input[type="text"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 700;
}

.toggle-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.station-buttons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.primary-button,
.secondary-button,
.danger-button {
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:active {
  background: var(--accent-strong);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.danger-button:active {
  background: #8f1d15;
}

.capture-card.needs-review,
.inventory-tile.needs-review {
  border-color: rgba(180, 35, 24, 0.34);
  background: #fff8f6;
}

.compact-button {
  min-height: 44px;
}

.secondary-link {
  display: grid;
  min-height: 44px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.icon-button {
  display: grid;
  min-width: 36px;
  min-height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.icon-button:active {
  background: var(--soft);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.capture-label.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

#photoInput {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.recent-panel {
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading span {
  min-width: 32px;
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.recent-list {
  display: grid;
  gap: 10px;
  max-height: 702px;
  overflow: auto;
  padding-right: 2px;
}

.capture-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.capture-card-link {
  color: inherit;
  text-decoration: none;
}

.capture-card-link:hover,
.capture-card-link:focus-visible {
  border-color: rgba(15, 123, 108, 0.5);
  outline: 0;
  box-shadow: 0 8px 22px rgba(15, 123, 108, 0.12);
}

.capture-card img {
  width: 72px;
  height: 88px;
  border-radius: 6px;
  background: var(--soft);
  object-fit: cover;
}

.capture-card div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.capture-card strong,
.capture-card span,
.capture-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capture-card strong {
  font-size: 0.94rem;
  display: -webkit-box;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.capture-card span,
.capture-card small,
.empty-list {
  color: var(--muted);
  font-size: 0.85rem;
}

.empty-list {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.inventory-shell {
  display: grid;
  align-content: start;
  gap: 18px;
}

.compact-topbar h1 {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.inventory-section,
.set-summary-band,
.filter-bar,
.customer-card-photo,
.customer-card-facts {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.metric-card span,
.set-summary-band span,
.customer-price span,
.customer-fact-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 1.55rem;
}

.inventory-section {
  padding: 16px;
}

.inventory-group-list {
  display: grid;
  gap: 18px;
}

.inventory-subgroup {
  display: grid;
  gap: 10px;
}

.subgroup-heading {
  margin-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading span {
  min-width: 32px;
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px minmax(160px, 0.35fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.user-row:hover,
.user-row:focus-visible {
  border-color: rgba(15, 123, 108, 0.5);
  outline: 0;
  box-shadow: 0 8px 22px rgba(15, 123, 108, 0.12);
}

.user-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.user-row strong,
.user-row small {
  overflow-wrap: anywhere;
}

.user-row small {
  color: var(--muted);
}

.reservation-row {
  grid-template-columns: minmax(0, 1fr) 90px 140px 140px 150px;
}

.offer-list {
  display: grid;
  gap: 10px;
}

.offer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 130px minmax(180px, 0.42fr) 130px auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.offer-row:hover,
.offer-row:focus-visible {
  border-color: rgba(15, 123, 108, 0.5);
  outline: 0;
  box-shadow: 0 8px 22px rgba(15, 123, 108, 0.12);
}

.offer-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.offer-row strong,
.offer-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.offer-row small {
  color: var(--muted);
}

.review-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.review-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.review-card div {
  display: grid;
  gap: 4px;
}

.review-card small {
  color: var(--muted);
}

.review-card form {
  display: grid;
  gap: 8px;
}

.review-card input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.review-station {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.review-photo-stack,
.review-decision-panel,
.review-actions {
  display: grid;
  gap: 12px;
}

.review-photo-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.review-photo-panel img {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 6px;
  background: #f6f7f8;
}

.review-decision-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.review-decision-panel h2 {
  margin: 0;
  font-size: 1.4rem;
}

.review-actions label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 850;
}

.review-actions input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}

.set-tile {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.set-tile:hover,
.set-tile:focus-visible,
.inventory-tile:hover,
.inventory-tile:focus-visible {
  border-color: rgba(15, 123, 108, 0.5);
  outline: 0;
  box-shadow: 0 8px 22px rgba(15, 123, 108, 0.12);
}

.set-tile img {
  width: 78px;
  height: 92px;
  border-radius: 6px;
  background: var(--soft);
  object-fit: cover;
}

.set-tile span,
.inventory-tile-body {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.set-tile strong,
.inventory-tile strong {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.set-tile small,
.inventory-tile small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.set-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.inventory-tile {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.inventory-tile img {
  width: 100%;
  aspect-ratio: 0.72;
  border-radius: 6px;
  background: var(--soft);
  object-fit: cover;
}

.set-summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.set-summary-band div {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: #fff;
}

.set-summary-band strong {
  font-size: 1.25rem;
}

.filter-bar {
  display: flex;
  gap: 8px;
  padding: 8px;
  box-shadow: none;
}

.filter-bar a {
  display: grid;
  min-height: 40px;
  place-items: center;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.filter-bar a.is-active {
  background: var(--accent);
  color: #fff;
}

.customer-card-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.customer-photo-stack {
  display: grid;
  gap: 12px;
}

.customer-card-photo {
  display: grid;
  min-height: 620px;
  overflow: hidden;
  place-items: center;
}

.customer-card-photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 56px);
  object-fit: contain;
  background: #fbfcfd;
}

.customer-card-facts {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.customer-price {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.customer-price strong {
  font-size: 2rem;
}

.accounting-panel,
.sale-record-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.accounting-panel > div,
.sale-record-heading {
  display: grid;
  gap: 3px;
}

.accounting-panel span,
.sale-record-heading span,
.sale-record-heading small {
  color: var(--muted);
  font-weight: 800;
}

.accounting-panel label,
.sale-record-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.accounting-panel input,
.accounting-panel select,
.sale-record-panel input {
  width: 100%;
  color: var(--ink);
}

.sale-item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sale-record-panel label.is-unavailable {
  opacity: 0.55;
}

.sale-record-panel label.is-unavailable input {
  pointer-events: none;
  background: #f2f4f7;
}

.customer-offer-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(15, 123, 108, 0.28);
  border-radius: 8px;
  padding: 16px;
  background: #eef9f5;
  box-shadow: var(--shadow);
}

.customer-offer-callout div {
  display: grid;
  gap: 4px;
}

.customer-offer-callout span,
.customer-offer-callout small {
  color: var(--muted);
  font-weight: 850;
}

.customer-offer-callout strong {
  font-size: 2rem;
}

.customer-offer-cancel {
  display: flex;
  justify-content: flex-end;
}

.customer-fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.customer-fact-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.customer-fact-grid strong {
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.detail-shell {
  width: min(1380px, 100%);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: start;
}

.detail-photo-stack {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}

.detail-photo-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.detail-photo-panel {
  position: relative;
  display: grid;
  min-height: 640px;
  overflow: hidden;
  place-items: center;
}

.detail-photo-stack .detail-photo-panel,
.customer-photo-stack .customer-card-photo {
  min-height: 420px;
}

.detail-photo-stack .detail-photo-panel:only-child {
  min-height: 640px;
}

.customer-photo-stack .customer-card-photo:only-child {
  min-height: 620px;
}

.photo-side-label {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  border: 1px solid rgba(216, 222, 232, 0.9);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.zoomable-photo-panel {
  position: relative;
  touch-action: none;
  user-select: none;
}

.zoomable-photo {
  transform-origin: center center;
  transition: transform 120ms ease;
  will-change: transform;
}

.image-zoom-toolbar {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(120px, 180px) auto auto;
  gap: 6px;
  align-items: center;
  border: 1px solid rgba(216, 222, 232, 0.9);
  border-radius: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 26px rgba(22, 34, 51, 0.16);
}

.image-zoom-toolbar input {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

.detail-photo-panel img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 48px);
  object-fit: contain;
  background: #fbfcfd;
}

.detail-stack {
  display: grid;
  gap: 14px;
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.audit-row > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.audit-row span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.audit-row pre {
  max-height: 220px;
  overflow: auto;
  border-radius: 8px;
  background: #f6f8fb;
  padding: 10px;
  font-size: 0.78rem;
}

.report-photo-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.report-photo-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 900;
}

.report-photo-panel form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.report-photo-panel label,
.report-row {
  display: grid;
  gap: 6px;
}

.report-photo-panel select,
.report-photo-panel textarea {
  width: 100%;
}

.report-list {
  display: grid;
  gap: 10px;
}

.report-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.report-row span,
.report-row p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.report-row p {
  margin: 0;
}

.delete-confirmation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(180, 35, 24, 0.28);
  border-radius: 8px;
  padding: 14px;
  background: #fff7f5;
  box-shadow: var(--shadow);
}

.delete-confirmation[hidden] {
  display: none;
}

.delete-confirmation div:first-child {
  display: grid;
  gap: 4px;
}

.delete-confirmation strong {
  color: var(--danger);
}

.delete-confirmation span,
.delete-status {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.delete-actions {
  display: flex;
  gap: 10px;
}

.delete-actions .danger-button,
.delete-actions .secondary-button {
  min-height: 44px;
}

.delete-status {
  grid-column: 1 / -1;
  min-height: 1.2em;
  margin: 0;
}

.correction-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.correction-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.correction-form label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.correction-form input,
.correction-form select {
  min-height: 42px;
}

.correction-form .wide-field {
  grid-column: 1 / -1;
}

.correction-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.correction-actions .primary-button {
  min-height: 46px;
}

.review-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(18, 24, 35, 0.48);
}

.review-modal[hidden] {
  display: none;
}

.review-card {
  width: min(860px, 100%);
  max-height: min(780px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.review-card .panel-heading {
  align-items: start;
  margin-bottom: 14px;
}

.review-card .panel-help {
  margin: 4px 0 0;
}

.review-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.review-image-stack {
  display: grid;
  gap: 10px;
}

.review-image-stack img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.review-rotate-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.review-body .correction-form {
  grid-template-columns: 1fr;
}

.review-body .correction-actions {
  grid-template-columns: minmax(150px, 0.5fr) minmax(140px, 0.4fr);
}

.detail-panel {
  padding: 16px;
}

.panel-help {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.danger-zone {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fffaf9;
}

.danger-zone p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.danger-zone .danger-button {
  min-height: 44px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.info-row,
.signal-row {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.info-row span,
.signal-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.info-row strong,
.signal-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  line-height: 1.3;
}

.info-row a {
  color: var(--accent);
}

.price-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.price-table th,
.price-table td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
}

.price-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.signal-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.ocr-text,
.json-view {
  width: 100%;
  max-height: 380px;
  margin: 12px 0 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #101828;
  color: #eef3f1;
  font: 0.82rem/1.45 Consolas, "SFMono-Regular", Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .site-frame {
    grid-template-columns: 1fr;
  }

  .public-header {
    position: static;
    align-items: flex-start;
    padding: 10px 12px;
  }

  .public-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .vendor-search,
  .vendor-row,
  .radius-settings {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    align-items: start;
    min-height: 100svh;
    padding: 12px;
  }

  .auth-panel {
    width: 100%;
    border-radius: 8px;
    padding: 18px;
  }

  .auth-panel h1 {
    font-size: clamp(2.2rem, 12vw, 3.35rem);
    line-height: 1;
    margin-bottom: 10px;
  }

  .auth-copy {
    margin-bottom: 14px;
    font-size: 1rem;
    line-height: 1.38;
  }

  .auth-form {
    gap: 10px;
  }

  .auth-qr {
    padding: 10px;
  }

  .auth-qr img {
    width: min(210px, 100%);
  }

  .account-choice-grid {
    grid-template-columns: 1fr;
  }

  .image-zoom-toolbar {
    right: 8px;
    bottom: 8px;
    left: 8px;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .side-nav {
    position: static;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }

  .side-nav-links {
    display: flex;
    justify-content: flex-end;
    overflow-x: auto;
  }

  .side-nav-link {
    flex: 0 0 auto;
  }

  .app-shell {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 2.75rem);
    line-height: 1;
  }

  .compact-topbar h1 {
    font-size: clamp(1.8rem, 9vw, 2.55rem);
    line-height: 1.03;
  }

  .capture-layout,
  .capture-panel,
  .detail-layout,
  .customer-card-layout {
    grid-template-columns: 1fr;
  }

  .detail-photo-panel {
    position: static;
    min-height: min(58vh, 520px);
  }

  .detail-photo-stack {
    position: static;
  }

  .customer-card-photo {
    min-height: min(58vh, 520px);
  }

  .detail-photo-stack .detail-photo-panel,
  .detail-photo-stack .detail-photo-panel:only-child,
  .customer-photo-stack .customer-card-photo,
  .customer-photo-stack .customer-card-photo:only-child {
    min-height: min(58vh, 520px);
  }

  .station-buttons {
    grid-template-columns: 1fr;
  }

  .info-grid,
  .signal-list,
  .set-summary-band,
  .customer-fact-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .set-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  }

  .delete-confirmation {
    grid-template-columns: 1fr;
  }

  .delete-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .correction-form,
  .correction-actions {
    grid-template-columns: 1fr;
  }

  .review-modal {
    padding: 12px;
  }

  .review-card {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(100svh - 24px);
    padding: 14px;
  }

  .review-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .review-image-stack img {
    max-height: 42vh;
  }

  .review-body .correction-actions {
    grid-template-columns: 1fr;
  }

  .capture-panel {
    padding: 12px;
  }

  .preview-frame {
    min-height: min(64vh, 560px);
  }

  .recent-list {
    max-height: none;
  }
}

.phone-shell {
  width: min(860px, 100%);
}

.phone-layout {
  display: grid;
  gap: 14px;
}

.phone-preview {
  min-height: min(70vh, 720px);
}

.phone-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.zoom-control {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.zoom-control[hidden] {
  display: none;
}

.zoom-control span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.zoom-control input {
  width: 100%;
  accent-color: var(--accent);
}

.phone-controls .small-status {
  grid-column: 1 / -1;
}

#phoneCanvas {
  display: none;
}

.notice-banner {
  border: 1px solid #f2c94c;
  background: #fff8d7;
  color: #5c4700;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 800;
}

.cart-action-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.market-status {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.market-available {
  background: #e8f7ee;
  color: #116034;
}

.market-in_cart {
  background: #e8f0ff;
  color: #1e4e9a;
}

.market-reserved,
.market-sold {
  background: #f1f1f1;
  color: #616161;
}

.market-countered,
.market-accepted,
.market-approved {
  background: #e8f0ff;
  color: #1e4e9a;
}

.market-rejected,
.market-released,
.market-customer_cancelled,
.market-stale_offer,
.market-expired {
  background: #fff0e6;
  color: #8a3b12;
}

.inventory-tile.market-reserved,
.inventory-tile.market-sold {
  opacity: 0.58;
}

.cart-shell {
  display: grid;
  gap: 14px;
}

.cart-summary,
.cart-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.cart-summary {
  display: grid;
  gap: 4px;
}

.cart-summary span,
.cart-summary small,
.cart-line small,
.cart-line span {
  color: var(--muted);
  font-weight: 750;
}

.cart-summary strong {
  font-size: 1.8rem;
}

.cart-list {
  display: grid;
  gap: 10px;
}

.offer-form,
.offer-summary-grid {
  display: grid;
  gap: 12px;
}

.offer-summary-grid {
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
}

.offer-summary-grid label,
.offer-line label,
.offer-actions form {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.offer-summary-grid input,
.offer-line input,
.offer-actions input {
  width: 100%;
  color: var(--ink);
}

.cart-line {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  gap: 12px;
}

.cart-line img {
  width: 88px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.cart-line div {
  display: grid;
  gap: 4px;
}

.cart-line.offer-line {
  grid-template-columns: 88px minmax(0, 1fr) minmax(140px, 0.22fr) auto;
}

.cart-line.is-unavailable {
  opacity: 0.48;
  background: #f6f7f8;
}

.cart-line.is-unavailable img {
  filter: grayscale(1);
}

.cart-line.customer-offer-line {
  grid-template-columns: 88px minmax(0, 1fr);
}

.cart-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .public-header {
    gap: 10px;
  }

  .public-brand small {
    display: none;
  }

  .public-nav {
    width: 100%;
    justify-content: stretch;
  }

  .public-nav a,
  .public-nav form,
  .public-nav button {
    flex: 1 1 auto;
  }

  .auth-panel {
    padding: 16px;
  }

  .auth-panel h1 {
    font-size: clamp(2rem, 11vw, 2.85rem);
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .side-nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    overflow-x: visible;
  }

  .side-nav-link {
    flex: 0 1 auto;
    justify-content: center;
    padding: 8px 6px;
    text-align: center;
  }

  .brand-mark,
  .side-nav-link span {
    display: none;
  }

  .app-shell {
    padding: 12px;
  }

  .topbar {
    flex-direction: column;
    padding-bottom: 14px;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .secondary-link,
  .topbar-actions .danger-button {
    flex: 1;
  }

  .status-pill {
    width: 100%;
  }

  .preview-frame {
    min-height: 430px;
  }

  .detail-photo-panel,
  .customer-card-photo,
  .detail-photo-stack .detail-photo-panel,
  .detail-photo-stack .detail-photo-panel:only-child,
  .customer-photo-stack .customer-card-photo,
  .customer-photo-stack .customer-card-photo:only-child {
    min-height: min(54vh, 430px);
  }

  .detail-panel,
  .customer-card-facts,
  .accounting-panel,
  .sale-record-panel,
  .metric-card,
  .inventory-section {
    padding: 12px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .set-grid {
    grid-template-columns: 1fr;
  }

  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .inventory-tile {
    padding: 8px;
  }

  .inventory-thumb {
    min-height: 148px;
  }

  .customer-price strong,
  .customer-offer-callout strong {
    font-size: 1.55rem;
  }

  .customer-fact-grid div {
    padding: 9px;
  }

  .button-row {
    grid-template-columns: 1fr 1fr;
  }

  .account-choice-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid,
  .invite-form {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cart-line {
    grid-template-columns: 72px 1fr;
  }

  .cart-line.offer-line,
  .offer-summary-grid,
  .reservation-row,
  .offer-row,
  .customer-offer-callout {
    grid-template-columns: 1fr;
  }

  .cart-line form {
    grid-column: 1 / -1;
  }

  .sale-item-grid {
    grid-template-columns: 1fr;
  }

  .review-station {
    grid-template-columns: 1fr;
  }
}
