/* Blake Taylor Services — design system.
   Mobile-first, glassmorphic, orange + blue. All color/space/type decisions live in the
   token layer below; components never hardcode hex values. No build step. */

/* ---------- Tokens ---------- */
:root {
  --brand-orange: #f2741a;
  --brand-orange-deep: #d85a0a;
  --brand-blue: #1e5cb3;
  --brand-blue-deep: #0e3a78;
  --ink: #0e1726;
  --ink-soft: #3c4a5e;
  --ink-faint: #6b7686;

  --surface: #f4f7fb;
  --surface-2: #e9eff7;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 8px 32px rgba(14, 58, 120, 0.12), 0 2px 8px rgba(14, 23, 38, 0.06);
  --glass-blur: 14px;

  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #a16207;
  --warn-bg: #fef9c3;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --info-bg: #dbeafe;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: clamp(2rem, 6vw, 2.75rem);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(60rem 40rem at 110% -10%, rgba(242, 116, 26, 0.16), transparent 60%),
    radial-gradient(70rem 50rem at -20% 110%, rgba(30, 92, 179, 0.18), transparent 60%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 var(--space-3);
  color: var(--ink);
}
h1 { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: var(--text-xl); font-weight: 700; }
h4 { font-size: var(--text-lg); font-weight: 600; }
p { margin: 0 0 var(--space-4); }
a { color: var(--brand-blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-blue-deep); }
img, svg { max-width: 100%; display: block; }

.muted { color: var(--ink-faint); }
.small { font-size: var(--text-sm); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.container {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
}
.container--narrow { width: min(100% - 2rem, 34rem); }

main.page {
  padding: var(--space-5) 0 calc(var(--space-7) + 6rem);
}

.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
.between { justify-content: space-between; }
.grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Glass card ---------- */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  padding: var(--space-5);
}
.card--tight { padding: var(--space-4); }
.card--accent { border-top: 3px solid var(--brand-orange); }
.card--blue { border-top: 3px solid var(--brand-blue); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 2px 16px rgba(14, 23, 38, 0.06);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand img { width: 36px; height: 36px; }
.brand span em { color: var(--brand-orange); font-style: normal; }

.nav-toggle {
  background: none;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  padding: var(--space-2);
  cursor: pointer;
  color: var(--ink);
}
.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  /* Near-opaque: the open menu must stay readable over busy page content. */
  background: rgba(247, 250, 254, 0.97);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 14px 34px rgba(14, 23, 38, 0.16);
  padding: var(--space-3) var(--space-4) var(--space-4);
}
.site-nav.open { display: block; }
.site-nav a {
  display: block;
  padding: var(--space-3) var(--space-2);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
}
.site-nav a:hover { background: rgba(30, 92, 179, 0.08); }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    position: static;
    background: none;
    border: 0;
    padding: 0;
    gap: var(--space-1);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .site-nav a { padding: var(--space-2) var(--space-3); }
}

/* ---------- Admin "More" dropdown ---------- */
.nav-more { position: relative; }
.nav-more__toggle {
  list-style: none;
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  font-size: inherit;
  cursor: pointer;
  color: var(--ink);
  border-radius: var(--radius-sm);
  user-select: none;
}
.nav-more__toggle::-webkit-details-marker,
.nav-more__toggle::marker { display: none; }
.nav-more__toggle:hover { background: rgba(30, 92, 179, 0.08); }
.nav-more__panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: rgba(247, 250, 254, 0.98);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(14, 23, 38, 0.14);
  min-width: 160px;
  z-index: 200;
  padding: var(--space-2) 0;
}
.nav-more__panel a {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-radius: 0;
}
.nav-more__panel a:hover { background: rgba(30, 92, 179, 0.08); }
@media (max-width: 899px) {
  .nav-more { position: static; }
  .nav-more__panel {
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding: 0;
    min-width: 0;
  }
  .nav-more__panel a { padding: var(--space-3) var(--space-2); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 44px; /* touch target */
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(216, 90, 10, 0.35);
}
.btn--primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(216, 90, 10, 0.45); }
.btn--blue {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(14, 58, 120, 0.3);
}
.btn--blue:hover { color: #fff; }
.btn--ghost {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-color: rgba(30, 92, 179, 0.35);
  color: var(--brand-blue-deep);
}
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: 0.4rem 0.9rem; min-height: 36px; font-size: var(--text-sm); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Sticky call + emergency ---------- */
.call-fab {
  position: fixed;
  right: var(--space-4);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  z-index: 60;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-deep) 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(216, 90, 10, 0.5);
  text-decoration: none;
}
.call-fab svg { width: 26px; height: 26px; }
body.has-bottom-nav .call-fab { bottom: calc(5rem + env(safe-area-inset-bottom)); }

.emergency-strip {
  background: linear-gradient(90deg, var(--brand-blue-deep), var(--brand-blue));
  color: #fff;
  text-align: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
}
.emergency-strip a { color: #ffd9b8; font-weight: 800; }

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-6) 0 var(--space-5);
}
.hero .lede {
  font-size: var(--text-lg);
  color: var(--ink-soft);
  max-width: 38rem;
}
.hero-card {
  margin-top: var(--space-5);
}
.trust-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.trust-item {
  text-align: center;
  padding: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-soft);
}
.trust-item strong { display: block; font-size: var(--text-xl); color: var(--brand-blue-deep); }

/* ---------- Staff login link ---------- */
.staff-login-link {
  text-align: center;
  padding: var(--space-6) 0 var(--space-2);
}
.staff-login-link a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
}
.staff-login-link a:hover { text-decoration: underline; }

/* ---------- Trade / plan cards ---------- */
.trade-icon {
  width: 52px;
  height: 52px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  background: linear-gradient(135deg, rgba(242, 116, 26, 0.18), rgba(30, 92, 179, 0.18));
  font-size: 1.6rem;
}
.price-line { font-size: var(--text-2xl); font-weight: 800; color: var(--brand-blue-deep); }
.price-line .small { font-weight: 600; }
.checklist { list-style: none; padding: 0; margin: 0 0 var(--space-4); }
.checklist li { padding-left: 1.5rem; position: relative; margin-bottom: var(--space-2); }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }

.review-card blockquote { margin: 0 0 var(--space-2); font-style: italic; color: var(--ink-soft); }
.stars { color: var(--brand-orange); letter-spacing: 2px; }

/* ---------- Forms ---------- */
label.field-label {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
  color: var(--ink-soft);
}
.input,
select.input,
textarea.input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(14, 58, 120, 0.25);
  background: var(--glass-strong);
  font: inherit;
  color: var(--ink);
  min-height: 44px;
}
textarea.input { min-height: 7rem; resize: vertical; }
.input:focus {
  outline: 3px solid rgba(242, 116, 26, 0.35);
  border-color: var(--brand-orange);
}
.field { margin-bottom: var(--space-4); }
.field-row { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .field-row-2 { grid-template-columns: 1fr 1fr; }
  .field-row-3 { grid-template-columns: 2fr 1fr 1fr; }
}
.checkbox { display: flex; gap: var(--space-2); align-items: center; font-size: var(--text-sm); }
.otp-input {
  font-size: 1.8rem;
  letter-spacing: 0.6em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- Flash messages ---------- */
.flash-stack { margin: var(--space-4) 0; }
.flash {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  border: 1px solid transparent;
}
.flash--success { background: var(--ok-bg); color: var(--ok); border-color: rgba(21, 128, 61, 0.25); }
.flash--error { background: var(--danger-bg); color: var(--danger); border-color: rgba(185, 28, 28, 0.25); }
.flash--info { background: var(--info-bg); color: var(--brand-blue-deep); }

/* ---------- Tables (stack on mobile) ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
table.data th,
table.data td {
  text-align: left;
  padding: var(--space-3);
  border-bottom: 1px solid rgba(14, 58, 120, 0.12);
  vertical-align: top;
}
table.data th { color: var(--ink-faint); font-weight: 700; white-space: nowrap; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.badge[data-status="requested"], .badge[data-status="pending"] { background: var(--warn-bg); color: var(--warn); }
.badge[data-status="confirmed"], .badge[data-status="scheduled"], .badge[data-status="sent"],
.badge[data-status="processing"], .badge[data-status="open"] { background: var(--info-bg); color: var(--brand-blue-deep); }
.badge[data-status="in_progress"] { background: rgba(242, 116, 26, 0.18); color: var(--brand-orange-deep); }
.badge[data-status="complete"], .badge[data-status="paid"], .badge[data-status="active"],
.badge[data-status="succeeded"], .badge[data-status="synced"] { background: var(--ok-bg); color: var(--ok); }
.badge[data-status="cancelled"], .badge[data-status="canceled"], .badge[data-status="void"],
.badge[data-status="failed"], .badge[data-status="past_due"], .badge[data-status="error"] { background: var(--danger-bg); color: var(--danger); }
.badge[data-status="invoiced"], .badge[data-status="draft"] { background: var(--surface-2); color: var(--ink-soft); }

.badge--urgency-emergency { background: var(--danger-bg); color: var(--danger); }
.badge--urgency-urgent { background: var(--warn-bg); color: var(--warn); }

/* ---------- Schedule agenda (admin) ---------- */
.badge--trade { background: var(--info-bg); color: var(--brand-blue-deep); }
.badge--tech { background: var(--surface-2); color: var(--ink-soft); text-transform: none; }
.badge--unassigned { background: var(--danger-bg); color: var(--danger); }
.badge--due { background: var(--warn-bg); color: var(--warn); border: 1px dashed var(--warn); }
.badge--today { background: rgba(242, 116, 26, 0.18); color: var(--brand-orange-deep); }

.sched-week-label {
  font-size: var(--text-sm);
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sched-day + .sched-day {
  border-top: 1px solid rgba(14, 58, 120, 0.12);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
}
.sched-day--today {
  border-left: 3px solid var(--brand-orange);
  padding-left: var(--space-3);
}
.sched-day__head {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  margin-bottom: var(--space-2);
}
.sched-item {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
  padding: var(--space-2) 0;
}
.sched-item__body {
  flex: 1 1 12rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sched-item__body a { font-weight: 600; }
.sched-time {
  flex: 0 0 4.75rem;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--brand-blue-deep);
}
.sched-item--due {
  border: 1px dashed var(--warn);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  background: var(--warn-bg);
}
.sched-item--due .sched-time {
  color: var(--warn);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}
.cluster--tight { gap: var(--space-2); }
.input--inline { width: auto; min-width: 9rem; }

/* Month grid (wall-calendar view) */
.cal__head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: var(--space-1);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-align: center;
}
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal__day {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 5.5rem;
  min-width: 0;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.cal__day.is-out { background: transparent; opacity: 0.4; }
.cal__day.is-today { outline: 2px solid var(--brand-orange); outline-offset: -2px; }
.cal__num {
  align-self: flex-start;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
}
a.cal__num:hover { color: var(--brand-blue-deep); text-decoration: underline; }
.cal-chip {
  display: block;
  min-height: 0.5rem;
  padding: 1px 4px;
  border-radius: 4px;
  border-left: 3px solid var(--brand-blue);
  background: var(--info-bg);
  color: var(--brand-blue-deep);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.cal-chip[data-trade="electrical"] {
  background: var(--warn-bg);
  color: var(--warn);
  border-left-color: var(--warn);
}
.cal-chip[data-trade="plumbing"] {
  background: var(--ok-bg);
  color: var(--ok);
  border-left-color: var(--ok);
}
.cal-chip--due {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px dashed var(--warn);
  border-left: 3px solid var(--warn);
}
/* Phones: chips collapse to color bars; the day number links into the agenda. */
@media (max-width: 719px) {
  .cal__day { min-height: 3.1rem; padding: 2px; }
  .cal-chip {
    height: 7px;
    padding: 0;
    font-size: 0;
    border-left-width: 0;
    border-top: 2px solid var(--brand-blue);
  }
  .cal-chip[data-trade="electrical"] { border-top-color: var(--warn); }
  .cal-chip[data-trade="plumbing"] { border-top-color: var(--ok); }
  .cal-chip--due { border: 1px dashed var(--warn); }
}

/* ---------- Stat cards ---------- */
.stat { text-align: left; }
.stat .stat-num { font-size: var(--text-2xl); font-weight: 800; color: var(--brand-blue-deep); }
.stat .stat-label { font-size: var(--text-sm); color: var(--ink-faint); font-weight: 600; }

/* ---------- Portal bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  display: flex;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--glass-border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: var(--space-2) 0 var(--space-3);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-faint);
  text-decoration: none;
}
.bottom-nav a .bn-icon { display: block; font-size: 1.25rem; }
.bottom-nav a.active { color: var(--brand-orange-deep); }
@media (min-width: 900px) {
  .bottom-nav { display: none; }
  body.has-bottom-nav .call-fab { bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
}

/* ---------- Chat widget ---------- */
.bot-fab {
  position: fixed;
  left: var(--space-4);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-deep) 100%);
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 10px 28px rgba(14, 58, 120, 0.45);
}
body.has-bottom-nav .bot-fab { bottom: calc(5rem + env(safe-area-inset-bottom)); }

.bot-panel {
  position: fixed;
  z-index: 70;
  inset: auto var(--space-3) calc(5.5rem + env(safe-area-inset-bottom)) var(--space-3);
  max-width: 25rem;
  margin-inline: auto;
  display: none;
  flex-direction: column;
  max-height: min(70vh, 34rem);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) + 6px));
  backdrop-filter: blur(calc(var(--glass-blur) + 6px));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.bot-panel.open { display: flex; }
@media (min-width: 900px) {
  .bot-panel { inset: auto auto 6rem var(--space-5); width: 25rem; }
}
.bot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-deep) 100%);
  color: #fff;
}
.bot-head button { background: none; border: 0; color: #fff; font-size: 1.2rem; cursor: pointer; }
.bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.bot-msg {
  max-width: 85%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  white-space: pre-wrap;
}
.bot-msg--user { align-self: flex-end; background: var(--brand-blue); color: #fff; }
.bot-msg--bot { align-self: flex-start; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--glass-border); }
.bot-msg--typing { color: var(--ink-faint); font-style: italic; }
.bot-input-row { display: flex; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--glass-border); }
.bot-input-row input { flex: 1; }
.bot-disclaimer { font-size: 0.7rem; color: var(--ink-faint); padding: 0 var(--space-3) var(--space-2); margin: 0; }

/* ---------- Invoice ---------- */
.invoice-totals { margin-left: auto; max-width: 18rem; }
.invoice-totals .row { display: flex; justify-content: space-between; padding: var(--space-1) 0; }
.invoice-totals .row.total { font-weight: 800; font-size: var(--text-lg); border-top: 2px solid var(--ink); margin-top: var(--space-2); padding-top: var(--space-2); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--space-7);
  padding: var(--space-6) 0 calc(var(--space-7) + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, var(--brand-blue-deep), #081f42);
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-sm);
}
.site-footer a { color: #ffd9b8; }

/* Jobsite photo gallery (work order detail) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}
.photo-thumb { margin: 0; }
.photo-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--surface-2);
}
.photo-thumb figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: 4px;
}
.btn--active { background: var(--brand-blue); color: #fff; }
.radio { display: block; margin: 4px 0; }
.site-footer h4 { color: #fff; }
body.has-bottom-nav .site-footer { padding-bottom: calc(8rem + env(safe-area-inset-bottom)); }

/* ---------- Payment element ---------- */
#payment-element { margin: var(--space-4) 0; }
.pay-status { font-weight: 600; }

/* ---------- Accessibility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand-blue-deep);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  z-index: 100;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid rgba(242, 116, 26, 0.6); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Admin mail panel ---------- */
.mail-row--unread td { font-weight: 700; }
.mail-body {
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  margin: 0;
  max-height: 60vh;
  overflow-y: auto;
}
