.phone-help { font-size: 0.8rem; color: var(--muted); line-height: 1.5; margin: 6px 0; }
.phone-warning { font-size: 0.85rem; line-height: 1.5; padding: 10px; border: 1px solid var(--gold); border-radius: 6px; }
/* MJS Recovery & Son — palette derived from the official logo */
/* Keep permission-controlled navigation and inactive states hidden. */
html body [hidden] { display: none !important; }
:root {
  --bg: #f3f1ec;
  --card: #fffdf8;
  --border: #d9d3c7;
  --text: #17181a;
  --muted: #5c5a55;
  --accent: #c8102e;
  --accent-hover: #9e0c24;
  --gold: #e0a526;
  --green: #3aa335;
  --charcoal: #17181a;
  --danger: #b0121f;
  --ok: #23772b;
  --focus: 0 0 0 3px rgba(224, 165, 38, 0.55);
}
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  border-top: 6px solid var(--accent);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed; left: 0; right: 0; top: 6px; height: 3px;
  background: var(--gold); pointer-events: none; z-index: 1;
}
h1 { font-weight: 800; font-style: italic; letter-spacing: -0.01em; color: var(--charcoal); }
h2 { font-weight: 750; }
.brand-title { display: flex; align-items: center; gap: 12px; }
.brand-title h1 { margin: 0 0 2px; }
.brand-title .sub { margin-bottom: 0 !important; }
.brand-logo {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none;
  border: 2px solid var(--charcoal); background: var(--charcoal);
}
.page-header {
  margin-bottom: 20px !important;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.card, section.card, main.card {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 0 rgba(23, 24, 26, 0.04), 0 6px 18px -12px rgba(23, 24, 26, 0.25);
}
.list-header h2, #list-view h2 { border-left: 4px solid var(--accent); padding-left: 10px; }
legend { color: var(--accent) !important; font-weight: 700; letter-spacing: 0.06em; }
th { color: var(--muted) !important; background: #f1ece2; letter-spacing: 0.04em; }
thead th:first-child { border-top-left-radius: 6px; }
thead th:last-child { border-top-right-radius: 6px; }
tbody tr:hover td { background: #fbf6ea; }
.saved-purchase td { background: #fbf6ea; border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); }
button:disabled { cursor: wait; opacity: 0.65; }
input:not([data-input-otp]), select, textarea {
  background: #fff !important; border-color: var(--border) !important; color: var(--text) !important;
  min-height: 40px;
}
input:not([data-input-otp]):focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: none; box-shadow: var(--focus); border-color: var(--gold) !important;
}
button, .btn-secondary, .page-nav a { min-height: 40px; transition: background-color .15s, color .15s, border-color .15s, transform .1s; }
button:active { transform: translateY(1px); }
.btn-secondary, .page-nav a {
  display: inline-flex !important; align-items: center; justify-content: center;
  background: var(--card) !important; color: var(--charcoal) !important;
  border: 1px solid var(--border) !important; border-radius: 8px !important;
  padding: 8px 14px; font-weight: 600; font-size: 0.88rem;
}
.btn-secondary:hover, .page-nav a:hover { border-color: var(--charcoal) !important; }
.page-nav a[aria-current="page"] {
  background: var(--charcoal) !important; color: #fffdf8 !important; border-color: var(--charcoal) !important;
  box-shadow: inset 0 -3px 0 var(--gold);
}
.btn-primary, .camera-btn.primary {
  background: var(--accent) !important; color: #fffdf8 !important; border-color: var(--accent) !important;
  border-radius: 8px !important; min-height: 46px; font-weight: 700; letter-spacing: 0.01em;
}
.btn-primary:hover, .camera-btn.primary:hover { background: var(--accent-hover) !important; }
.confirm-btn { background: var(--ok) !important; border-radius: 8px !important; min-height: 52px; }
.confirm-btn:hover:not(:disabled) { background: #1b5f22 !important; }
.confirm-btn:disabled { background: var(--border) !important; color: var(--muted) !important; }
.mark-collected-btn { color: var(--ok) !important; border: 1px solid var(--ok) !important; border-radius: 6px !important; min-height: 32px; }
.mark-collected-btn:hover { background: #e6f3e4 !important; }
.del-btn { color: var(--danger) !important; border: 1px solid var(--danger) !important; border-radius: 6px !important; min-height: 32px; }
.del-btn:hover { background: #fbe8e6 !important; }
.msg.error { background: #fbe8e6 !important; color: var(--danger) !important; border-left: 4px solid var(--danger); }
.msg.ok { background: #e6f3e4 !important; color: var(--ok) !important; border-left: 4px solid var(--green); }
.vehicle-lookup-row { display: flex; align-items: flex-end; gap: 0.6rem; flex-wrap: wrap; }
.vehicle-lookup-row .registration-field { flex: 1 1 160px; }
.vehicle-lookup-row button { margin-bottom: 0.1rem; }
.lookup-status { margin: 0.35rem 0 0.8rem; color: var(--muted); font-size: 0.9rem; }
.purchase-item {
  background: #fff !important; border: 1px solid var(--border) !important; border-left: 4px solid var(--accent) !important;
  border-radius: 10px !important; min-height: 56px; color: var(--text);
}
.purchase-item:hover { border-color: var(--charcoal) !important; border-left-color: var(--accent) !important; }
.purchase-item:active { background: #fbf6ea !important; }
.back-btn, .job-directions, .job-contact a, .detail-row a[href^="tel:"] { color: var(--accent) !important; }
.back-btn { min-height: 44px; }
.camera-btn { min-height: 44px; border-radius: 8px !important; }
.sig-actions button { min-height: 40px; }
canvas#signature-pad { border: 2px dashed var(--gold) !important; border-radius: 10px !important; }
.id-capture { border-radius: 10px !important; background: #fbf8f1; }
dialog { border-top: 4px solid var(--accent) !important; border-radius: 12px !important; }
dialog::backdrop { background: rgba(23, 24, 26, 0.55) !important; }
dialog h3 { color: var(--accent) !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.empty { color: var(--muted) !important; font-style: italic; }
a { color: var(--accent); }

/* Landing / pending / auth cards */
main.card { text-align: center; }
main.card .logo { width: 200px; height: auto; border-radius: 12px; display: block; margin: 0 auto 8px; }
main.card > a {
  background: var(--accent) !important; color: #fffdf8 !important; border-radius: 8px !important;
  min-height: 46px; padding: 12px 28px !important; font-weight: 700;
}
main.card > a:hover { background: var(--accent-hover) !important; }
main.card .brand-logo { width: 72px; height: 72px; display: block; margin: 0 auto 10px; }
#auth-gate.auth-screen { min-height: 100vh; background: var(--bg); color: var(--text); }
body.auth-body { margin: 0; }
.auth-screen--gate { position: fixed; inset: 0; z-index: 99999; overflow-y: auto; }
.auth-header {
  width: min(1120px, calc(100% - 48px)); min-height: 84px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border);
}
.auth-brand {
  display: inline-flex; gap: 12px; align-items: center; color: var(--text);
  font-size: 1rem; font-weight: 700; line-height: 1.15; text-decoration: none;
}
.auth-brand-logo { width: 46px; height: 46px; object-fit: cover; border-radius: 9px; }
.auth-brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.auth-header-label { color: var(--muted); font-size: 0.9rem; }
.auth-page { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: clamp(28px, 6vh, 64px) 0 24px; }
.auth-layout {
  min-height: 470px; display: grid; grid-template-columns: minmax(290px, 0.85fr) minmax(400px, 1.15fr);
  overflow: hidden; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 18px 48px rgba(23, 24, 26, 0.08);
}
.auth-intro {
  padding: clamp(32px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center;
  background: var(--charcoal); color: #fffdf8;
}
.auth-eyebrow, .auth-panel-eyebrow { margin: 0 0 16px; color: var(--gold); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; }
.auth-intro h1 {
  max-width: 380px; margin: 0; color: #fffdf8; font-size: clamp(2rem, 3.4vw, 3.1rem);
  line-height: 1.08; letter-spacing: -0.035em;
}
.auth-intro > p { max-width: 360px; margin: 18px 0 0; color: rgba(255, 253, 248, 0.78); font-size: 1rem; line-height: 1.65; }
.auth-benefits { display: grid; gap: 14px; margin: 30px 0 0; padding: 0; list-style: none; color: rgba(255, 253, 248, 0.9); font-size: 0.9rem; }
.auth-benefits li::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 11px 1px 0; border-radius: 50%; background: var(--accent); }
.auth-panel { box-sizing: border-box; align-self: center; min-width: 0; width: 100%; max-width: 540px; margin: 0 auto; padding: clamp(32px, 5vw, 64px); overflow-wrap: anywhere; }
.auth-panel-eyebrow { margin-bottom: 10px; color: var(--accent); }
.auth-panel h2 { margin: 0; font-size: clamp(1.7rem, 2.5vw, 2.15rem); line-height: 1.2; letter-spacing: -0.025em; }
.auth-panel-copy { margin: 10px 0 20px; color: var(--muted); line-height: 1.5; }
.auth-message { margin: 0 0 14px; color: var(--muted); font-size: 0.87rem; line-height: 1.5; }
.auth-access-note { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 0.85rem; }
#clerk-sign-in, #clerk-sign-in .cl-rootBox, #clerk-sign-in .cl-cardBox, #clerk-sign-in .cl-card {
  width: 100% !important; max-width: none !important;
}
#clerk-sign-in .cl-cardBox, #clerk-sign-in .cl-card {
  margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important;
}
#clerk-sign-in .cl-headerTitle, #clerk-sign-in .cl-headerSubtitle, #clerk-sign-in .cl-logoBox { display: none !important; }
#clerk-sign-in .cl-formFieldInput { min-height: 48px; border-radius: 8px !important; }
#clerk-sign-in .cl-dividerRow { display: none !important; }
#clerk-sign-in .cl-otpCodeFieldInputs {
  display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important;
  align-items: center; justify-content: center; gap: 6px;
  width: 100% !important; max-width: 294px !important; min-width: 0; margin-inline: auto;
}
#clerk-sign-in .cl-otpCodeFieldInputContainer {
  /* Clerk wraps all six slots and the focusable input; keep the entire row wide. */
  display: flex !important; align-items: center; justify-content: center;
  box-sizing: border-box; min-width: 0 !important; width: 100% !important;
  max-width: 294px !important; margin-inline: auto;
}
#clerk-sign-in .cl-otpCodeFieldInputContainer > [data-input-otp-container] {
  box-sizing: border-box; min-width: 0; width: 100%;
}
#clerk-sign-in .cl-otpCodeFieldInput {
  box-sizing: border-box; flex: 0 1 44px !important; min-width: 32px !important;
  width: 44px !important; max-width: 44px !important;
  height: 52px !important; min-height: 52px !important; padding: 0; text-align: center;
  font-size: 22px !important; line-height: 1.2;
}
#clerk-sign-in input[data-input-otp] {
  /* The focusable input overlays the slots for typing, paste and iOS AutoFill.
     Never hide/disable it: only the six visual slots should paint the digits. */
  color: transparent !important; -webkit-text-fill-color: transparent !important;
  background: transparent !important; caret-color: transparent !important;
  border-color: transparent !important; box-shadow: none !important;
  min-height: 0 !important; pointer-events: auto;
}
#clerk-sign-in .cl-formButtonPrimary, #clerk-sign-in .cl-socialButtonsBlockButton { min-height: 46px; border-radius: 8px !important; }
#clerk-sign-in .cl-formButtonPrimary { background: var(--accent) !important; }
#clerk-sign-in .cl-formButtonPrimary:hover { background: var(--accent-hover) !important; }
.sign-out-btn, #auth-sign-out {
  background: var(--card); color: var(--charcoal); border: 1px solid var(--border); border-radius: 8px; padding: 8px 16px; font-weight: 600; cursor: pointer;
}
body > .sign-out-btn { display: block; margin: 8px auto; }

@media (max-width: 600px) {
  .brand-logo { width: 44px; height: 44px; }
  .page-nav a, .btn-secondary { min-height: 44px; }
  input:not([data-input-otp]), select, textarea { min-height: 44px; font-size: 16px !important; }
}
@media (max-width: 760px) {
  .auth-header, .auth-page { width: min(calc(100% - 32px), 560px); }
  .auth-header { min-height: 72px; }
  .auth-header-label { display: none; }
  .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-intro { padding: 28px; }
  .auth-intro h1 { font-size: 2rem; }
  .auth-benefits { display: none; }
  .auth-panel { max-width: none; padding: 30px 28px; }
}
@media (max-width: 600px) {
  #clerk-sign-in .cl-otpCodeFieldInput {
    flex: 0 0 36px !important; min-width: 36px !important;
    width: 36px !important; max-width: 36px !important;
  }
}
@media (max-width: 360px) {
  #clerk-sign-in .cl-otpCodeFieldInputs { gap: 4px; }
  #clerk-sign-in .cl-otpCodeFieldInput {
    flex: 0 0 32px !important; min-width: 32px !important;
    width: 32px !important; max-width: 32px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  button:active { transform: none; }
}

/* Data Register uses the same dark production masthead as the dismantling apps. */
.data-register-header {
  max-width: none !important;
  width: 100%;
  margin: -24px -16px 24px !important;
  padding: 16px max(16px, calc((100vw - 1200px) / 2));
  align-items: center;
  background: #212329;
  color: #f6f2e8;
  border: 0;
  border-bottom: 3px solid #b80f2c;
}
.data-register-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 30px);
}
.data-register-header .brand-lockup {
  flex: none;
  color: #f6f2e8;
  text-decoration: none;
}
.data-register-header .brand-lockup span {
  font-weight: 800;
  letter-spacing: -.03em;
  white-space: nowrap;
}
.data-register-header .brand-lockup small {
  display: block;
  margin-top: 3px;
  color: #b7b3aa;
  font: 500 9px "DM Mono", monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.data-register-header .brand-logo {
  width: 48px;
  height: 48px;
  border-color: #f6f2e8;
}
.data-register-header .register-heading {
  min-width: 0;
  padding-left: clamp(14px, 2vw, 26px);
  border-left: 1px solid rgba(246, 242, 232, .25);
}
.data-register-header .register-heading h1 {
  margin: 0 0 4px;
  color: #f6f2e8;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-style: normal;
  letter-spacing: -.025em;
}
.data-register-header .register-heading .sub {
  max-width: 620px;
  margin: 0 !important;
  color: #c5c1b7;
  font-size: .8rem;
  line-height: 1.45;
}
.data-register-header .page-nav {
  flex: 0 0 auto;
}
.data-register-header .page-nav a:focus-visible,
.data-register-header .page-nav button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  box-shadow: none;
}
.dismantling-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.dismantling-dashboard .list-header { margin-bottom: 0; }
.dismantling-dashboard .list-header h2 { margin-bottom: 4px; }
.dismantling-dashboard-metric {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: 10px;
  background: #fff;
}
.dismantling-dashboard-label {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.dismantling-dashboard-value {
  margin: 8px 0 2px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
}
.dismantling-dashboard-period,
.dismantling-dashboard-baseline,
.dismantling-dashboard-delta {
  margin: 6px 0 0;
  font-size: .86rem;
}
.dismantling-dashboard-period,
.dismantling-dashboard-baseline { color: var(--muted); }
.dismantling-dashboard-delta { font-weight: 700; }
.dismantling-dashboard-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .data-register-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .data-register-header .page-nav {
    width: 100%;
    justify-content: flex-start;
  }
}
@media (max-width: 600px) {
  .data-register-header {
    padding: 16px;
  }
  .data-register-identity {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .data-register-header .register-heading {
    padding: 0;
    border: 0;
  }
  .data-register-header .page-nav a,
  .data-register-header .page-nav button {
    flex: 1 1 auto;
  }
}
