/* VendorFlow v2.59 */
/* style.css — main stylesheet */
/* v2.59 - .btn-toggle pressed state (Errors only read as unselected); .code-strip 2FA panel */
/* v2.58 - stats: highlights grid down to 2 cards; chart head row + day-scrubber readout styles */
/* v2.57 - --input-bg lightened another ~10% (35% → 42%) — fields were still reading too dark */
/* v2.56 - editable-field affordance: orange left rule moved off .suggestion-reasoning onto every
           input/select/textarea, and the field surface lightened ~10% via new --input-bg token */
/* v2.55 - .poll-dot--amber: "online but AppFolio login failing" degraded status */
/* v2.54 - background REPLACED: dropped bg.png; flat base + topo texture (body::before) + center vignette (body::after) */
/* v2.53 - faint topographic contour texture (topo.svg) layered over the glow via body::after */
/* v2.52 - suggestion reasoning badge now uses neutral gray styling (no orange accent) */
/* v2.51 - "AI Reasoning" badge inside the suggestion-reasoning box */
/* v2.50 - home-warranty banner on the WO detail (loud for active coverage, muted for expired) */
/* v2.49 - fix: history detail panel showed by default — add .history-detail[hidden] so display:flex
           doesn't beat [hidden]'s display:none (same gotcha as the export modal) */
/* v2.48 - expandable history cards: chevron, hover, and the reveal panel (tenant original + AI suggestion) */
/* v2.47 - accent style for multi-trade pills on vendor cards (tag-pill--trade) */
/* v2.46 - increased vendor form field spacing via component rules (replacing inline per-field margin tweaks) */
/* v2.45 - tags editor now switches to a left/right layout on tablet+ (pills left, add input right) */
/* v2.44 - vendor tag add-input is now compact (one-word width) instead of expanding across the full row */
/* v2.43 - added reusable form-label icon helpers for inline label glyphs (used by Military Preferred) */
/* v2.42 - vendor cards cap the tag pills at 8; a "View all" btn-link reveals the rest */
/* v2.41 - tag editor: the add-a-tag input is now a separate field below the active pills (was fused into one box) */
/* v2.40 - vendor tags: read-only pills on cards + a pill editor (comma/Enter → removable pills) in the add/edit form */
/* v2.39 - documented the fixed viewport background layer to explain the tablet rotation workaround */
/* v2.38 - moved the global background image to a fixed viewport layer so tablet rotation no longer scales it to page content height */
/* v2.37 - vendor card descriptions no longer truncate; notes now wrap to full content */
/* v2.36 - removed one-off .vendor-edit-btn styles; vendors page now uses shared btn btn-secondary btn-sm */
/* v2.35 - vendors page cards redesigned to a fixed two-column tile layout with header row (star + name + Edit) */
/* v2.34 - removed unused vendor toggle-pref/active selectors after vendors card badge cleanup */
/* v2.33 - suggestion confidence badge now aligns inline/right with the Suggested Vendor label */
/* v2.32 - removed unused stat-tabs styles (now DDS-free and dead sitewide) */
/* v2.31 - added reusable .checkbox base class with 4px radius and shared checkbox styling */
/* v2.30 - function-bar item hover transitions now match shared button ease-in-out timing */
/* v2.29 - nav-link hover transitions now match shared button ease-in-out timing */
/* v2.28 - button hover transitions now ease in and out across the shared button system */
/* v2.27 - btn-link dotted underline tightened: 0.2rem offset + 0.1rem dotted stroke */
/* v2.26 - btn-link hover text + dotted underline now use tertiary-200 */
/* v2.25 - btn-link text + dotted underline now use tertiary-300 with tertiary-400 hover */
/* v2.24 - simplified btn-link to only override required styles on top of .btn */
/* v2.23 - Activity Export moved to a right-aligned headline link button */
/* v2.22 - added btn-link variant in lg/md/sm sizes with dotted underline style */
/* v2.21 - Export Logs modal date inputs now use the same calendar icon as the Activity toolbar */
/* v2.20 - fix: .export-modal[hidden] guard so the modal stays closed on load (display:flex was overriding [hidden]) */
/* v2.19 - Export Logs modal (date range + errors-only) on the Activity page */
/* v2.18 - mobile hamburger status badge now shows last-polled text inline (no separate bubble) */
/* v2.17 - increased mobile hamburger menu link vertical padding by ~20% */
/* v2.16 - removed mobile .btn-sm stretch behavior so buttons hug text globally */
/* v2.15 - mobile Vendors Add Vendor button now hugs text while staying right-aligned */
/* v2.14 - reassign nudge now uses the shared golden token */
/* v2.13 - added reusable golden color token (#f9c516) */
/* v2.12 - reassign nudge text (no-reason-selected speed bump) */
/* v2.11 - removed truncation from home wo-list-desc so full descriptions show */
/* v2.10 - renamed full-width Activity bar container selector to reusable .toolbar */
/* v2.9 - narrowed Activity search input to a compact one-word width */
/* v2.8 - Activity bar now spans full width with left (date+errors) and right (search) flex groups */
/* v2.7 - grouped Activity prev/date/next controls into a zero-gap date cluster */
/* v2.6 - removed border and border radius from the activity date picker button */
/* v2.5 - activity date paddles now stretch to the full control height inside the search bar */
/* v2.4 - restored activity date paddles and fixed consolidated date-picker click behavior */
/* v2.3 - nav version badge now uses tertiary-700 fill with tertiary-400 border */
/* v2.2 - renamed .footer-beta/.nav-beta to .app-version/.nav-version (v2 launch, beta badge removed) */
/* v2.1 — consolidated activity search bar: date picker + errors + divider + search input in single row */
/* v2.0 — right-aligned the Vendors page Add Vendor button */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-style: unset;
}

:root {
  --bg: #120c04;
  --color-tertiary-25: oklch(97% 0 89.9);
  --color-tertiary-50: oklch(95.2% 0 89.9);
  --color-tertiary-100: oklch(91.3% 0 89.9);
  --color-tertiary-200: oklch(85.1% 0 89.9);
  --color-tertiary-300: oklch(75.1% 0 89.9);
  --color-tertiary-400: oklch(56.9% 0 89.9);
  --color-tertiary-500: oklch(26.9% 0 89.9);
  --color-tertiary-600: oklch(24.8% 0 89.9);
  --color-tertiary-700: oklch(21.8% 0 89.9);
  --color-tertiary-800: oklch(18.2% 0 89.9);
  --color-tertiary-900: oklch(14.5% 0 89.9);
  --color-tertiary-950: oklch(12.9% 0 89.9);
  --border: rgba(255, 255, 255, 0.08);
  --orange: #f97316;
  --orange-10: rgba(249, 115, 22, 0.1);
  --orange-20: rgba(249, 115, 22, 0.2);
  --orange-30: rgba(249, 115, 22, 0.3);
  --orange-40: rgba(249, 115, 22, 0.4);
  --orange-50: rgba(249, 115, 22, 0.5);
  --orange-60: rgba(249, 115, 22, 0.6);
  --orange-70: rgba(249, 115, 22, 0.7);
  --orange-80: rgba(249, 115, 22, 0.8);
  --orange-90: rgba(249, 115, 22, 0.9);
  --orange-dim: rgba(249, 115, 22, 0.15);
  --golden: #f9c516;
  --white: var(--color-tertiary-25);
  --off-white: var(--color-tertiary-50);
  --muted: var(--color-tertiary-300);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --link-blue: #006eb7;
  --link-gray: #728089;
  --radius-2xs: 0.125rem;
  --radius-xs: 0.25rem;
  --radius-sm: 0.375rem;
  --radius-button: 0.5rem;
  --radius: 0.625rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --bp-xs: 30rem;
  --bp-sm: 36rem;
  --bp-md: 48rem;
  --bp-lg: 62rem;
  --bp-xl: 75rem;
  /* Type scale — body/UI sizes are even px only (10–16): 10/12/14/16.
     Larger display steps: 18/20/22/24/32. Drive every font-size off these vars;
     no raw rem font-sizes in component classes. */
  --font-h1: 2rem; /* 32 */
  --font-xl: 1.75rem; /* 28 */
  --font-h2: 1.5rem; /* 24 */
  --font-lg: 1.375rem; /* 22 */
  --font-h3: 1.25rem; /* 20 */
  --font-h4: 1.125rem; /* 18 */
  --font-p: 1rem; /* 16 */
  --font-small: 0.875rem; /* 14 */
  --font-xs: 0.75rem; /* 12 */
  --font-2xs: 0.625rem; /* 10 */
  --font-mono: "DM Mono", monospace;
  --header-card-bg: var(--color-tertiary-800);
  --card-bg: var(--color-tertiary-900);
  /* Editable-field surface — ~10% lighter (composited) than the old 28.5% fill so
     inputs read as editable against the card. Every input/select/textarea uses it. */
  --input-bg: oklch(42% 0.007 48.5 / 0.3);
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Create a local stacking context so the fixed background layer can sit behind
     all page content without relying on body background attachment quirks. */
  position: relative;
  isolation: isolate;
  font-family: "DM Sans", sans-serif;
  background-color: var(--color-tertiary-950);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Background system: a flat warm-dark base (body's background-color) + a faint
   topographic contour texture + a center vignette. Both layers are fixed to the
   viewport and sit behind all content. Replaced the old bg.png / bg-mobile.png raster.
   NOTE: bg.png + bg-mobile.png in assets/bg/ are now unreferenced. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("assets/bg/topo.svg") 50% 50% / 1600px 800px;  /* tiles at natural size */
  opacity: 0.07;                                                 /* subtle — bump to taste */
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(1000px 700px at 50% 40%,
              transparent 35%, rgba(8, 7, 6, 0.85) 100%);
}

::selection {
  background: var(--orange-80);
  color: var(--color-tertiary-25);
}

::-moz-selection {
  background: var(--orange-80);
  color: var(--color-tertiary-25);
}

/* ============================================ */
/* TYPOGRAPHY SCALE                             */
/* ============================================ */
h1,
h2,
h3,
h4,
p,
small,
label {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  margin-bottom: 0.8rem;
}

h1 {
  font-size: var(--font-h1);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--font-h2);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--font-h3);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.015em;
}

h4 {
  font-size: var(--font-h4);
  line-height: 1.35;
  font-weight: 600;
}

p {
  font-size: var(--font-p);
  line-height: 1.55;
  color: var(--white);
}

small,
.text-small {
  font-size: var(--font-small);
  line-height: 1.45;
  color: var(--muted);
}

.text-xs {
  font-size: var(--font-xs);
  line-height: 1.4;
  font-weight: 600;
  color: var(--muted);
}

label,
.label {
  font-size: var(--font-xs);
  line-height: 1.2;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* everything sits above the glow */
.main {
  flex: 1 0 auto;
  position: relative;
  z-index: 1;
}
.header {
  position: relative;
  z-index: 10;
}

/* ── Poller offline banner ───────────────────────────────────────────────── */
@keyframes pulse-red {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* ============================================ */
/* CONTAINER                                    */
/* ============================================ */
.container {
  width: 100%;
  max-width: 42.5rem;
  margin-inline: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
.container-md {
  max-width: 52.5rem;
}
.container--nav {
  max-width: 60rem;
}
.main > .container {
  padding-bottom: 3rem;
}

/* ============================================ */
/* HEADER                                        */
/* ============================================ */
.header {
  padding-block: 1.125rem;
}
body.photo-modal-open .header {
  opacity: 0.1;
}
.header .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 20px;
}
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.5rem;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}
.header-logo img {
  display: block;
  height: 1.35rem;
  width: auto;
}
.header-logo-group {
  display: flex;
  align-items: flex-end;
  flex: 0 0 auto;
  gap: 0.5rem;
  position: relative;
  z-index: 2; /* stay above the full-screen mobile menu overlay */
}
.app-version {
  font-size: var(--font-2xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--orange);
  background: var(--orange-10);
  border: 0.0625rem solid var(--orange-30);
  border-radius: var(--radius-xs);
  padding: 0.125rem 0.375rem;
  margin-top: 0.25rem;
  line-height: 1.4;
}
.header-hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  gap: 0.3125rem;
  cursor: pointer;
  padding: 0.25rem;
  background: transparent;
  appearance: none;
  position: relative;
  z-index: 2; /* stay above the full-screen mobile menu overlay */
}
.header-hamburger:not([hidden]) {
  display: flex;
}
.header-hamburger:hover {
  background: transparent;
}
.header-hamburger[hidden] {
  display: none !important;
}
.header-hamburger span {
  display: block;
  width: 1.375rem;
  height: 0.125rem;
  background: var(--white);
  border-radius: var(--radius-2xs);
}

/* ============================================ */
/* HAMBURGER ANIMATION                          */
/* ============================================ */
.header-hamburger span {
  transition:
    transform 0.22s ease,
    opacity 0.15s ease;
  transform-origin: center;
}
.header-hamburger.open span:nth-child(1) {
  transform: translateY(0.4375rem) rotate(45deg);
}
.header-hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.header-hamburger.open span:nth-child(3) {
  transform: translateY(-0.4375rem) rotate(-45deg);
}

/* ============================================ */
/* NAV MENU                                     */
/* ============================================ */

.nav-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
}
.nav-inline > * {
  flex: 0 0 auto;
}
.nav-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 30;
  min-width: 14rem;
  max-width: min(22rem, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  padding: 0.375rem 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(6, 6, 6, 0.82);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(1rem) saturate(1.3);
  backdrop-filter: blur(1rem) saturate(1.3);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.22s ease;
  transform: translateY(-0.25rem);
}
.nav-menu[hidden] {
  display: none !important;
}
.nav-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-inline .nav-link {
  display: block;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-button);
  border-left: none;
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--off-white);
  text-decoration: none;
  transition:
    color 0.15s ease-in-out,
    border-color 0.15s ease-in-out,
    background 0.15s ease-in-out;
}
.nav-menu .nav-link {
  display: block;
  padding: 0.9rem 1rem;
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--off-white);
  text-decoration: none;
  border-left: 0.1875rem solid transparent;
  transition:
    color 0.15s ease-in-out,
    border-color 0.15s ease-in-out,
    background 0.15s ease-in-out;
}
.nav-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
}
.nav-inline .nav-link.active {
  color: var(--orange);
  background: var(--orange-10);
}
.nav-menu .nav-link.active {
  color: var(--orange);
  border-left-color: var(--orange);
  background: var(--orange-10);
}

/* Admin sub-nav group */
.nav-admin {
  display: block;
}
.nav-inline .nav-admin {
  position: relative;
}
.nav-admin > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.nav-admin > summary::-webkit-details-marker {
  display: none;
}
.nav-inline .nav-admin-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-button);
  border-left: none;
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--off-white);
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}
.nav-menu .nav-admin-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--off-white);
  border-left: 0.1875rem solid transparent;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}
.nav-admin-toggle::after {
  content: "▾";
  font-size: var(--font-xs);
  opacity: 0.5;
  transition: transform 0.15s;
}
.nav-admin[open] .nav-admin-toggle::after {
  transform: rotate(-180deg);
}
.nav-admin-toggle:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
}
.nav-inline .nav-admin-toggle.active {
  color: var(--orange);
  background: var(--orange-10);
}
.nav-menu .nav-admin-toggle.active {
  color: var(--orange);
  border-left-color: var(--orange);
  background: var(--orange-10);
}
.nav-version {
  margin-top: 0;
}
.nav-inline .nav-version,
.nav-menu .nav-version {
  color: var(--off-white);
  background: var(--color-tertiary-700);
  border-color: var(--color-tertiary-400);
}
.nav-inline .nav-admin-links {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  min-width: 9rem;
  background: var(--color-tertiary-800);
  -webkit-backdrop-filter: blur(0.75rem) saturate(1.35);
  backdrop-filter: blur(0.75rem) saturate(1.35);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem 0;
  z-index: 999;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.35);
}
.nav-menu .nav-admin-links {
  padding: 0.125rem 0 0.25rem;
}
.nav-inline .nav-admin-badge-wrap {
  padding: 0.5rem 1rem 0.25rem;
}
.nav-menu .nav-admin-badge-wrap {
  padding: 0.5rem 1rem 0.25rem 2.25rem;
}
.nav-inline .nav-admin-links .nav-link {
  padding: 0.5rem 1rem;
  border-radius: 0;
  border-left: none;
}
.nav-inline .nav-admin-links .nav-link.active {
  border-left: none;
}
.nav-menu .nav-admin-links .nav-link {
  padding: 1em 1rem 0.6rem 2.25rem;
  border-left: none;
}
.nav-status {
  flex: 0 0 auto;
}
.nav-inline .nav-status {
  align-self: auto;
  margin: 0;
}
.nav-menu .nav-status {
  align-self: stretch;
  margin: 0.5rem 1rem 0.25rem;
}

@media (max-width: 30rem) {
  .nav-menu {
    left: 0;
    right: 0;
    max-width: none;
    height: 100vh;
  }
}

/* ============================================ */
/* PAGE TITLES                                  */
/* ============================================ */
.page-title {
  font-size: var(--font-h2);
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.025rem;
  margin-bottom: 1rem;
}
.page-subtitle {
  font-size: var(--font-small);
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.last-checked {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  position: relative;
  appearance: none;
  font-size: var(--font-xs);
  font-weight: 500;
  font-family: inherit;
  color: var(--color-tertiary-200);
  background: var(--color-tertiary-800);
  border: 0.0625rem solid var(--color-tertiary-600);
  border-radius: var(--radius-xs);
  padding: 0.25rem 0.5rem 0.25rem 0.625rem;
  text-align: left;
}

.poll-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.poll-dot--green {
  background: #22c55e;
  box-shadow: 0 0 5px #22c55e99;
}
/* offline — a hollow ring (shape cue), so online vs offline reads without relying on
   the red/green hue alone (the adjacent "System online/offline" text is the primary cue) */
.poll-dot--red {
  background: transparent;
  box-shadow:
    inset 0 0 0 0.09375rem #ef4444,
    0 0 5px #ef444499;
}
/* degraded — poller is online but AppFolio login is failing. Filled amber (it's still
   "online", so it keeps the filled-dot cue like green, distinct from the hollow red ring);
   the "Online — AppFolio login failing" text alongside is the primary cue. */
.poll-dot--amber {
  background: #f59e0b;
  box-shadow: 0 0 5px #f59e0b99;
}

.last-checked {
  cursor: pointer;
}

.poll-info-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  opacity: 0.6;
}
.poll-info-icon img {
  filter: brightness(0) invert(1);
}

.poll-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--color-tertiary-800);
  border: 0.0625rem solid var(--color-tertiary-600);
  border-radius: var(--radius-button);
  padding: 0.5rem 0.75rem;
  font-size: var(--font-xs);
  white-space: nowrap;
  color: var(--color-tertiary-200);
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.last-checked:hover .poll-dropdown,
.poll-dropdown--open {
  display: block;
}

@media (max-width: 40rem) {
  .nav-menu .last-checked {
    align-items: center;
    flex-wrap: wrap;
  }
  .nav-menu .poll-info-icon {
    display: none;
  }
  .nav-menu .poll-dropdown {
    display: block;
    position: static;
    top: auto;
    right: auto;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    white-space: normal;
    color: var(--muted);
    font-size: var(--font-xs);
  }
}

/* ============================================ */
/* HOME GREETING                                */
/* ============================================ */
.home-greeting {
  margin-bottom: 1.75rem;
}
.greeting-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.greeting-name {
  font-family: "Clash Display", sans-serif;
  font-size: clamp(var(--font-h2), 5vw, var(--font-h1));
  font-weight: 600;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 0;
}
.greeting-sub {
  font-size: var(--font-small);
  font-style: italic;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.125rem;
}
.greeting-sub-phrase {
  display: inline-block;
  min-height: 1.4em;
  white-space: pre;
  opacity: 1;
  transition: opacity 0.18s ease;
}
.greeting-sub-phrase--fade {
  opacity: 0;
}
.greeting-sub-letter {
  display: inline-block;
  opacity: 0;
  animation: greetingLetterFade 0.26s ease forwards;
  animation-delay: var(--letter-delay, 0ms);
}

@keyframes greetingLetterFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================ */
/* BACK LINK                                    */
/* ============================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--off-white);
  font-size: var(--font-small);
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1.5rem;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.back-link:hover {
  opacity: 1;
}
.back-link::before {
  content: "←";
  font-size: var(--font-p);
}

/* ============================================ */
/* MAIN CONTENT                                 */
/* ============================================ */
.main {
  margin-top: 3.125rem;
}

.walkthrough {
  max-width: 31.25rem;
  margin: 0 auto;
}

/* ============================================ */
/* WORK ORDER LIST CARDS                        */
/* ============================================ */
.wo-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.wo-list-card {
  background: var(--card-bg);
  border: 0.0625rem solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: slideUp 0.25s ease both;
  transition: background 0.2s ease-in-out;
}
.wo-list-card:hover {
  background: var(--color-tertiary-800);
}
.wo-list-card:nth-child(1) {
  animation-delay: 0.05s;
}
.wo-list-card:nth-child(2) {
  animation-delay: 0.1s;
}
.wo-list-card:nth-child(3) {
  animation-delay: 0.15s;
}
.wo-list-card:nth-child(4) {
  animation-delay: 0.2s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(0.625rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wo-list-time {
  font-size: var(--font-xs);
  color: var(--muted);
  white-space: nowrap;
}
.wo-list-address-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.wo-list-address {
  margin-bottom: 0;
}
.wo-list-address span {
  font-size: var(--font-xs);
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.25rem;
}
.wo-list-desc {
  margin-bottom: 0.875rem;
  color: var(--white);
}
.wo-list-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================ */
/* DETAIL CARD                                  */
/* ============================================ */
.detail-card {
  background: var(--color-tertiary-900);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.375rem;
  animation: slideUp 0.25s ease;
}
.detail-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}
.detail-card-top-left {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.detail-address {
  font-size: var(--font-h3);
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.0187rem;
  line-height: 1.3;
}
.detail-time {
  font-size: var(--font-xs);
  color: var(--muted);
  margin-bottom: 1.375rem;
  margin-left: auto;
}
.trade-badge {
  display: inline-block;
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--off-white);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.1875rem 0.625rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* detail rows */
.detail-row {
  margin-bottom: 1.125rem;
}
.detail-row:last-of-type {
  margin-bottom: 0;
}
.detail-row-label {
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.3125rem;
}
.detail-row-value {
  font-size: var(--font-p);
  color: var(--white);
  line-height: 1.6;
}

/* ============================================ */
/* ISSUE DETAILS TABLE (tenant triage Q&A)      */
/* ============================================ */
/* ============================================ */
/* TENANT PHOTO STRIP (detail view thumbnails)  */
/* ============================================ */
.wo-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.wo-photo-thumb {
  width: 5rem;
  height: 5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  display: block;
  flex-shrink: 0;
  border: 0.0625rem solid var(--border);
  background: var(--color-tertiary-600);
  padding: 0;
  cursor: pointer;
  transition:
    opacity 0.15s,
    border-color 0.15s;
}
.wo-photo-thumb:hover {
  border-color: var(--orange);
  opacity: 0.85;
}
.wo-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* "Some/all tenant photos failed to load" placeholder — sits inline in .wo-photos */
.wo-photo-missing {
  height: 5rem;
  width: 13rem;
  flex: 0 0 auto;
  border-radius: 0.5rem;
  border: 0.0625rem solid var(--border);
  background: var(--color-tertiary-600);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  text-align: center;
}
.wo-photo-missing-text {
  font-size: var(--font-xs);
  font-style: italic;
  color: var(--muted);
}
.wo-photo-missing-link {
  font-size: var(--font-xs);
  font-style: italic;
  color: var(--orange);
  text-decoration: underline;
}
.wo-photo-missing-link:hover {
  opacity: 0.85;
}

/* ============================================ */
/* PHOTO LIGHTBOX MODAL                         */
/* ============================================ */

/* The modal IS the backdrop — no child overlay div needed */
.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(
    0,
    0,
    0,
    0.6
  ); /* lighter — the backdrop blur provides the separation */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overscroll-behavior: contain; /* don't chain scroll to the page behind */
}
.photo-modal-content {
  width: 100%;
  max-width: clamp(320px, 90vw, 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}
/* Close button sits in its own row, pushed to the right */
.photo-modal-header {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}
.photo-modal-close {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 0.0625rem solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: var(--font-p);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
}
.photo-modal-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
/* Image area */
.photo-modal-main {
  width: 100%;
  height: 68vh; /* fixed height so the thumbnail strip below never shifts between
                   portrait/landscape photos — the image is centered + contained within */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; /* anchor the pinch-to-zoom hint badge */
  overflow: hidden; /* clip the zoomed image to the container (pinch-to-zoom) */
  touch-action: none; /* pinch / pan / swipe are all handled in JS */
}
.photo-modal-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%; /* fit within the fixed-height image area */
  border-radius: 0.4rem;
  object-fit: contain;
  transform-origin: center center; /* zoom math assumes a centered origin */
  touch-action: none;
  will-change: transform;
}
/* Pinch-to-zoom hint — a black circle with the (white) gesture animation, shown briefly */
/* DISABLED: photo-zoom-hint
.photo-zoom-hint {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  width: 3.84rem;
  height: 3.84rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 2;
}
.photo-zoom-hint.show {
  opacity: 1;
}
.photo-zoom-hint lottie-player {
  width: 58%;
  height: 58%;
  filter: invert(
    1
  );
}
*/
/* Thumbnail strip — single horizontal carousel (scrolls; never wraps into rows) */
.photo-modal-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
  align-self: stretch; /* parent is align-items:center — opt out so we fill + can scroll */
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.photo-modal-strip-thumb {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.375rem;
  overflow: hidden;
  padding: 0;
  border: 0.125rem solid transparent;
  background: transparent;
  cursor: pointer;
  opacity: 0.4;
  transition:
    opacity 0.15s,
    border-color 0.15s;
  flex-shrink: 0;
}
.photo-modal-strip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-modal-strip-thumb:hover {
  opacity: 0.72;
}
.photo-modal-strip-thumb.active {
  opacity: 1;
  border-color: var(--orange);
}

/* ============================================ */
/* EXPORT LOGS MODAL                            */
/* ============================================ */
.export-modal[hidden] {
  display: none;
}
.export-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(0.75rem);
  -webkit-backdrop-filter: blur(0.75rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.15s ease;
}
.export-modal-card {
  width: 100%;
  max-width: clamp(20rem, 90vw, 26rem);
  background: var(--card-bg);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  animation: slideUp 0.2s ease both;
}
.export-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.export-modal-title {
  font-size: var(--font-h3);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--white);
  margin: 0;
}
.export-modal-close {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 0.0625rem solid var(--border);
  background: var(--header-card-bg);
  color: var(--off-white);
  font-size: var(--font-h3);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s;
}
.export-modal-close:hover {
  background: var(--color-tertiary-700);
}
.export-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.export-field-row {
  display: flex;
  gap: 0.75rem;
}
.export-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}
.export-field-label {
  font-size: var(--font-xs);
  color: var(--muted);
  font-weight: 500;
}
.export-modal input[type="date"] {
  background: var(--input-bg) url("assets/icons/calendar.svg") right
    0.75rem center / 0.95rem 0.95rem no-repeat;
  padding-right: 2.5rem;
  color-scheme: dark;
}
.export-modal input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
}
.export-hint {
  color: var(--muted);
  margin: 0;
}
.export-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  cursor: pointer;
  color: var(--off-white);
  font-size: var(--font-small);
}

/* Base checkbox primitive (4px radius) */
.checkbox,
.export-check input,
.vendor-check-label input[type="checkbox"] {
  border-radius: 0.25rem;
  accent-color: var(--orange);
  cursor: pointer;
}

.export-check input {
  width: 1.05rem;
  height: 1.05rem;
}
.export-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
  margin-top: 0.25rem;
}
@media (max-width: 30rem) {
  .export-field-row {
    flex-direction: column;
  }
}

/* ============================================ */
/* SHARED CARD BASE                             */
/* ============================================ */
.card {
  background: var(--color-tertiary-900);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 1.375rem;
}

/* ============================================ */
/* VENDOR SUGGESTION CARD                       */
/* ============================================ */
.suggestion-card {
  margin-bottom: 0.75rem;
  animation: slideUp 0.25s ease 0.05s both;
}
.suggestion-label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}
.suggestion-label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.suggestion-label-row .suggestion-label {
  margin: 1rem 0 0.5rem;
}
.suggestion-label-row .confidence-badge {
  margin-left: auto;
}
.suggestion-vendor {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.025rem;
  margin-bottom: 0.1875rem;
}
.suggestion-vendor-aka {
  font-size: var(--font-small);
  font-style: italic;
  color: var(--muted);
  margin-bottom: 0.375rem;
}
.suggestion-trade {
  font-size: var(--font-xs);
  color: var(--muted);
  margin-bottom: 1rem;
}
.suggestion-reasoning {
  font-size: var(--font-small);
  color: var(--off-white);
  line-height: 1.65;
  padding: 0.8125rem 0.9375rem;
  background: oklch(28.5% 0.007 48.5 / 0.3);
  border-radius: var(--radius);
}
.suggestion-reasoning-badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: var(--font-2xs);
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.0312rem;
  color: var(--color-tertiary-200);
  background: var(--color-tertiary-700);
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-2xs);
}
.suggestion-reasoning-text {
  margin: 0;
}
.confidence-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.875rem;
}
.confidence-label {
  font-size: var(--font-xs);
  color: var(--muted);
}
.confidence-badge {
  font-size: var(--font-2xs);
  font-weight: 700;
  padding: 0.1875rem 0.625rem;
  border-radius: var(--radius-2xs);
  letter-spacing: 0.0312rem;
}
.conf-high {
  background: var(--green-dim);
  color: var(--green);
}
/* ── Reasoning callout (medium / low confidence) ─────────────────────────── */
/* ============================================ */
/* REVIEW BANNER                                */
/* ============================================ */
.review-banner {
  background: var(--orange-10);
  border: 0.0625rem solid var(--orange-80);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  animation: slideUp 0.25s ease;
}
.review-banner-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--amber);
  margin-top: 0.0625rem;
}
.review-banner-title {
  color: var(--amber);
  margin-bottom: 0.1875rem;
}
.review-banner-text {
}

/* Home-warranty banner — property-level coverage that changes how a WO is dispatched.
   Loud (orange) when active; muted (neutral) when expired/on-file-only. */
.warranty-banner {
  background: var(--orange-10);
  border: 0.0625rem solid var(--orange-80);
  border-left: 0.1875rem solid var(--orange);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin: 0.75rem 0;
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  animation: slideUp 0.25s ease;
}
.warranty-banner-icon {
  flex-shrink: 0;
  line-height: 1.3;
}
.warranty-banner-text strong {
  color: var(--orange);
}
.warranty-banner--expired {
  background: transparent;
  border: 0.0625rem solid var(--border);
  border-left: 0.1875rem solid var(--border);
}
.warranty-banner--expired .warranty-banner-text,
.warranty-banner--expired .warranty-banner-text strong {
  color: var(--muted);
}

/* ============================================ */
/* BUTTONS                                      */
/* ============================================ */
.btn-group {
  display: flex;
  flex-direction: row;
  gap: 0.625rem;
  margin-top: 1rem;
  animation: slideUp 0.25s ease 0.1s both;
}
.btn-group .btn {
  flex: 1;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-button);
  font-size: var(--font-p);
  font-weight: 500;
  font-family: "DM Sans", sans-serif;
  cursor: pointer;
  border: 0.0625rem solid transparent;
  transition:
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out,
    color 0.15s ease-in-out,
    transform 0.1s ease;
  text-decoration: none;
  width: auto;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.0063rem;
  line-height: 1.2;
}
.btn:active {
  transform: scale(0.97);
}
/* disabled — muted + not-allowed; pair with adjacent text explaining why */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
/* loading — set aria-busy="true" during the async fill; hides label, shows spinner,
   blocks the double-submit that an un-stated approval invites */
.btn[aria-busy="true"] {
  color: transparent;
  pointer-events: none;
  position: relative;
}
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.05rem;
  height: 1.05rem;
  margin: -0.525rem 0 0 -0.525rem;
  border: 0.15rem solid var(--white);
  border-right-color: transparent;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}
@keyframes btnSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Button sizes — LG / MD / SM */
.btn-lg {
  padding: 0.5rem 1rem;
  font-size: var(--font-p);
  border-radius: var(--radius-button);
}
.btn-md {
  padding: 0.5rem;
  font-size: var(--font-small);
  border-radius: var(--radius-button);
}

/* Small controls use the compact 6px radius token from the button spec. */
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: var(--font-xs);
  border-radius: var(--radius-sm);
}

/* Primary — orange tint */
.btn-primary {
  background: var(--orange-20);
  color: var(--white);
  border: 0.0625rem solid var(--orange);
}
.btn-primary:hover {
  background: var(--orange-30);
}

/* Secondary — dark fill with border */
.btn-secondary {
  background: var(--color-tertiary-800);
  color: var(--white);
  border: 0.0625rem solid var(--color-tertiary-600);
}
.btn-secondary:hover {
  background: var(--color-tertiary-500);
  border-color: var(--color-tertiary-600);
}

/* Tertiary — no accent fill, outlined */
.btn-tertiary {
  background: var(--color-tertiary-900);
  color: var(--white);
  border: 0.0625rem solid var(--color-tertiary-500);
}
.btn-tertiary:hover {
  background: var(--color-tertiary-800);
  border-color: var(--color-tertiary-400);
}

/* Ghost — subtle dark fill, no border */
.btn-ghost {
  background: var(--color-tertiary-800);
  color: var(--white);
  border: 0.0625rem solid transparent;
}
.btn-ghost:hover {
  background: var(--color-tertiary-700);
}

/* Link button — text-first CTA with dotted underline rule */
.btn-link {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-tertiary-300);
}
.btn-link::after {
  content: "";
  display: block;
  width: 100%;
  margin-top: 0.2rem;
  border-bottom: 0.1rem dotted var(--color-tertiary-300);
  transition: border-bottom-color 0.15s ease-in-out;
}
.btn-link:hover {
  color: var(--color-tertiary-200);
}
.btn-link:hover::after {
  border-bottom-color: var(--color-tertiary-200);
}
.btn-link:active {
  transform: none;
}

/* ============================================ */
/* STEP INDICATOR                               */
/* ============================================ */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 1.25rem 0.25rem;
}
.step-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition:
    width 0.3s ease,
    background-color 0.3s ease,
    border-radius 0.3s ease;
}
.step-dot.active {
  background: var(--orange);
  width: 1.375rem;
  border-radius: var(--radius-xs);
}
.step-dot.done {
  background: var(--green);
}
/* ============================================ */
/* OVERRIDE FORM                                */
/* ============================================ */
.override-form {
  background: var(--card-bg);
  margin-bottom: 0.75rem;
  animation: slideUp 0.25s ease;
}
.form-label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.0312rem;
  margin-bottom: 0.5rem;
  display: block;
}

.form-label-prefix {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.form-label-icon {
  width: 0.875rem;
  height: 0.875rem;
  flex: 0 0 auto;
}

.form-field {
  margin-bottom: 1rem;
}
.form-select,
.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius-button);
  font-size: var(--font-p);
  font-family: "DM Sans", sans-serif;
  color: var(--white);
  background: var(--input-bg);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color 0.15s;
  /* Orange left rule (moved off the AI-reasoning box) — the affordance that marks
     a surface as editable. */
  border-left: 0.1875rem solid var(--orange);
}
.form-select option {
  background: #1c1410;
  color: var(--white);
}
.form-select:focus,
.form-input:focus,
.form-textarea:focus {
  border-color: none;
}
.form-textarea {
  resize: none;
  height: 5rem;
  line-height: 1.5;
}
/* Dropdown chevron (selects use appearance:none above, so draw our own) */
.form-select {
  padding-right: 2.25rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
}

/* ── Vendor searchable combobox ─────────────────────────────────────────── */
.vendor-search-wrap {
  position: relative;
  margin-bottom: 1rem;
}
.vendor-search-input {
  margin-bottom: 0;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
}
.vendor-search-input--selected {
  border-color: var(--orange);
  background-image: none;
}
.vendor-dropdown {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  right: 0;
  background: #1e1510;
  border: 0.0625rem solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  max-height: 20rem;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  box-shadow:
    0 0.75rem 2rem rgba(0, 0, 0, 0.65),
    0 0 0 0.0625rem rgba(0, 0, 0, 0.3);
  padding: 0.375rem 0;
}
.vendor-option-group-label {
  font-size: var(--font-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.28);
  padding: 0.75rem 1rem 0.3rem;
}
.vendor-option-group-label:first-child {
  padding-top: 0.5rem;
}
.vendor-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6875rem 1rem;
  cursor: pointer;
  transition: background 0.1s;
  gap: 1rem;
  min-height: 2.75rem;
}
.vendor-option:hover,
.vendor-option--active {
  background: rgba(249, 115, 22, 0.1);
}
.vendor-option--suggested {
  background: rgba(249, 115, 22, 0.06);
  border-left: 0.1875rem solid var(--orange);
}
.vendor-option--suggested:hover,
.vendor-option--suggested.vendor-option--active {
  background: rgba(249, 115, 22, 0.14);
}
.vendor-option-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
}
.vendor-option-name {
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vendor-option--suggested .vendor-option-name {
  color: var(--orange);
}
.vendor-option-aka {
  font-style: italic;
  font-weight: 400;
  font-size: var(--font-xs);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vendor-option-trade {
  font-size: var(--font-xs);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}
.vendor-option--empty {
  color: rgba(255, 255, 255, 0.3);
  font-size: var(--font-small);
  justify-content: center;
  cursor: default;
  padding: 1.25rem 1rem;
}

/* Description editor on suggestion step */
/* Textarea inside the job description card — shares the editable-field surface */
.suggestion-desc-textarea {
  margin-top: 0.5rem;
  background: var(--input-bg);
  resize: vertical;
  min-height: 8.5rem;
  height: auto;
}

/* reason chips */
.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.reason-chip {
  padding: 0.4375rem 0.8125rem;
  border-radius: var(--radius-button);
  font-size: var(--font-xs);
  font-weight: 500;
  border: 0.0625rem solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--off-white);
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.reason-chip.selected {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}
.reason-chip:active {
  transform: scale(0.96);
}
.reassign-nudge {
  font-size: var(--font-small);
  color: var(--golden);
  margin: 0 0 8px;
}

/* ============================================ */
/* SUCCESS STATE                                */
/* ============================================ */
/* ── Notification preview step ───────────────────────────────────────────── */
.notify-block {
  padding: 1.125rem 1.25rem 1rem;
  margin-bottom: 0.75rem;
  animation: slideUp 0.2s ease;
}
.notify-block-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  justify-content: space-between;
}
.notify-recipient-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--orange-10);
  color: var(--orange);
  flex-shrink: 0;
}
.notify-recipient-label {
  margin-bottom: 0.1rem;
}
.notify-recipient-name {
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--white);
}
.notify-textarea {
  height: auto;
  min-height: 7rem;
  resize: vertical;
  white-space: pre-wrap;
  font-size: var(--font-small);
  line-height: 1.6;
  margin-bottom: 0;
}
.notify-toggle-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  font-size: var(--font-xs);
  font-family: "DM Sans", sans-serif;
  color: var(--orange);
  cursor: pointer;
  margin-bottom: 0.5rem;
}
.notify-block-header .btn {
  margin-left: auto;
  flex-shrink: 0;
}
.notify-block--skipped {
  opacity: 0.5;
}
.notify-skip-note {
  color: var(--muted);
  font-size: var(--font-xs);
  margin: 0;
  font-style: italic;
}

.success-card {
  background: var(--card-bg);
  border-color: rgba(34, 197, 94, 0.3);
  padding: 2.5rem 1.5rem;
  text-align: center;
  animation: slideUp 0.3s ease;
}
.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  margin-bottom: 0.875rem;
}
.success-icon-lottie {
  width: 52px;
  height: 52px;
}
.success-title {
  font-size: var(--font-h3);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.375rem;
}
.success-sub {
  font-size: var(--font-small);
  color: var(--muted);
}
.success-card--review {
  border-color: rgba(245, 158, 11, 0.3);
}
.success-card--review .success-icon {
  color: var(--amber);
}
.success-card--review .success-icon-lottie {
  color: var(--orange);
  filter: brightness(0) invert(1);
}

.savings-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1.25rem;
  padding-top: 1.125rem;
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.08);
}
.savings-value {
  font-size: var(--font-small);
  font-weight: 700;
  color: var(--orange);
}
.savings-divider {
  font-size: var(--font-small);
  color: var(--muted);
}
.savings-label {
  font-size: var(--font-small);
  color: var(--muted);
  width: 100%;
  text-align: center;
  margin-top: 0.1rem;
}

/* Undo grace period */
.undo-bar-wrap {
  display: block;
  margin: 1.375rem auto 0;
  width: 100%;
  max-width: 16rem;
  height: 0.375rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.undo-bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--green);
  border-radius: var(--radius-lg);
  transition: width 0.1s linear;
}
#undoBtn {
  margin-top: 0.875rem;
}
#undoBtn:disabled {
  opacity: 0.35;
  cursor: default;
}
.standard-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.875rem;
}

/* ============================================ */
/* EMPTY STATE                                  */
/* ============================================ */
.empty-state {
  text-align: center;
  padding: 5rem 1.25rem;
  animation: slideUp 0.3s ease;
}
.empty-title {
  font-size: var(--font-h3);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.empty-text {
  font-size: var(--font-small);
  color: var(--muted);
  line-height: 1.6;
}

/* Home "caught up" hero (index.php empty state) */
.empty-home-lottie {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 0.875rem;
}
.empty-home-lottie lottie-player {
  width: 4.5rem;
  height: 4.5rem;
  display: block;
}
.empty-greeting-name {
  font-family: "Clash Display", sans-serif;
  font-size: clamp(var(--font-h2), 5vw, var(--font-h1));
  font-weight: 600;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}
.empty-state--home .empty-text {
  font-style: italic;
}
.empty-skeleton {
  width: 100%;
  max-width: 34rem;
  margin: 2.75rem auto 0;
  opacity: 0.5;
}
.empty-skeleton img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ============================================ */
/* MISC                                         */
/* ============================================ */
.wo-number {
  font-family: "DM Mono", monospace;
  font-size: var(--font-xs);
  color: var(--orange);
  font-weight: 500;
  margin-bottom: 0.1875rem;
}
/* When the WO number is a link to AppFolio, keep the orange and add a hover affordance. */
a.wo-number {
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
a.wo-number:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* ── Login page ─────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 22rem;
  background: var(--bg-card-20);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.login-logo img {
  height: 1.75rem;
  width: auto;
  display: block;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.form-input--error {
  border-color: var(--red) !important;
}
/* Visually masks input as dots without using type="password" — keeps Safari
   from treating the field as a password (no autofill / keychain / strong-pw). */
.form-input--mask {
  -webkit-text-security: disc;
  text-security: disc;
}
.login-hint {
  font-size: var(--font-xs);
  color: var(--muted);
  margin-top: 0.375rem;
  opacity: 0.6;
}
.login-error {
  font-size: var(--font-small);
  color: var(--red);
  margin-top: 0.375rem;
}

/* ============================================ */
/* FOOTER                                       */
/* ============================================ */
.site-footer {
  background: transparent;
  width: 100%;
  max-width: 42.5rem;
  margin: auto auto 1.5rem;
  padding: 1.75rem 1.25rem 0;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
}

.clicks-saved-stat {
  color: #e3e7ec;
  background: linear-gradient(
    to right,
    rgba(227, 231, 236, 0.82) 0%,
    rgba(255, 246, 240, 0.9) 30%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 246, 240, 0.9) 70%,
    rgba(227, 231, 236, 0.82) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* text-shadow: 0 0 0.65rem rgba(249, 115, 22, 0.34), 0 0 1.15rem rgba(255, 255, 255, 0.18);
  filter: drop-shadow(0 0 0.45rem rgba(249, 115, 22, 0.26)); */
  animation: savedStatShine 7s linear infinite;
}

@keyframes savedStatShine {
  to {
    background-position: -200% center;
  }
}

/* ============================================ */
/* KEYBOARD FOCUS — visible ring, never removed  */
/* ============================================ */
/* Placed after the form-field `outline: none` so keyboard focus is restored for
   keyboard nav only (:focus-visible), without re-introducing mouse-click focus rings. */
:focus-visible {
  outline: 0.125rem solid var(--color-tertiary-400);
  outline-offset: 0.125rem;
}
.form-select:focus-visible,
.form-input:focus-visible,
.form-textarea:focus-visible,
.vendor-search-input:focus-visible {
  outline: 0.125rem solid var(--color-tertiary-400);
  outline-offset: 0.125rem;
  /* border-color: var(--orange); */
}

@media (prefers-reduced-motion: reduce) {
  .clicks-saved-stat {
    animation: none;
  }
  /* Kill the always-on ambient glow pulse, card entrance slides, the per-letter
     greeting fade, and the offline-dot pulse — keep state changes near-instant. */
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  body::after {
    animation: none;
  }
  .greeting-sub-letter {
    animation: none;
    opacity: 1;
  }
}

.site-footer p + p {
  margin-top: 0.25rem;
}

.site-footer-credit {
  margin-top: 0.5rem !important;
}

.site-footer a {
  color: var(--orange);
  text-decoration-color: var(--orange-50);
  text-underline-offset: 0.125rem;
}

.site-footer a:hover {
  color: var(--white);
  text-decoration-color: var(--white);
}

/* ============================================ */
/* STANDARD BREAKPOINTS: xs, sm, md, lg, xl    */
/* ============================================ */

/* xs: < 36rem */
@media (max-width: 35.99875rem) {
  .header {
    padding-block: 0.875rem;
  }

  .main {
    margin-top: 2.125rem;
  }

  .btn-group {
    flex-direction: column-reverse;
  }

  .btn-group .btn {
    flex: none;
  }

  .site-footer {
    padding: 0 0.875rem;
  }

  .wo-list-card {
    padding: 0.875rem;
  }

  .wo-list-address-row {
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .wo-list-time {
    order: -1;
    width: 100%;
    margin-bottom: 0.375rem;
    text-align: left;
  }

  .wo-list-address {
    flex: 1 1 auto;
    min-width: 0;
  }

  .detail-card-top {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .detail-time {
    order: -1;
    width: 100%;
    margin: 0 0 0.375rem;
    text-align: right;
  }

  .detail-card-top-left {
    flex: 1 1 auto;
  }

  .trade-badge {
    margin-left: auto;
  }
}

/* ============================================ */
/* ACTIVITY PAGE                                */
/* ============================================ */
.activity-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.activity-header > .function-bar {
  margin-bottom: 0;
}

.activity-header-titles {
  min-width: 0;
}

/* filter chips */
/* Function Bar — segmented status filter. A dark track holds the segments;
  the active one is solid orange, the rest are subtle borderless chips (raised one step
  off the track) with a leading currentColor icon. The bar hugs its content and wraps
  into right-aligned rows instead of scrolling. Markup is a .function-bar wrapping
  .function-bar__item chips (icon in a .function-bar__icon span). */
.function-bar {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  justify-content: flex-end;
  align-items: center;
  gap: 0.375rem 0.5rem;
  min-height: 2.75rem;
  margin-left: auto;
  margin-bottom: 1.25rem;
  padding: 0.5rem;
  border-radius: var(--radius-button);
  /* background: var(--color-tertiary-900); */
  overflow: visible;
}
.function-bar__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 0.375rem;
  height: 1.75rem;
  min-height: 1.75rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-button);
  background: var(--color-tertiary-600);
  color: var(--muted);
  font-family: inherit;
  font-size: var(--font-small);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease-in-out,
    color 0.15s ease-in-out;
  -webkit-tap-highlight-color: transparent;
}
.function-bar__item:hover {
  background: var(--color-tertiary-700);
  color: var(--off-white);
}
.function-bar__item.is-active,
.function-bar__item.is-active:hover {
  background: var(--orange-10);
  color: var(--orange);
}
.function-bar__icon {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
}
.function-bar__item:hover .function-bar__icon {
  filter: brightness(0) invert(1);
}
.function-bar__item.is-active .function-bar__icon {
  filter: brightness(0) saturate(100%) invert(52%) sepia(99%) saturate(1403%)
    hue-rotate(352deg) brightness(99%) contrast(96%);
}

/* Activity: cross-day search bar */
.activity-search {
  --activity-control-h: 2.75rem;
  margin-bottom: 0.75rem;
}
/* Title row: keep headline left, consolidated search bar inline right. */
.activity-header--search {
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}
.activity-export-link {
  margin-left: auto;
  flex: 0 0 auto;
}

/* Consolidated search bar: date picker + errors button + separator + search input */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0;
  margin-bottom: 0;
  flex: 1 1 100%;
  width: 100%;
  max-width: none;
  padding: 0.5rem;
  background: var(--color-tertiary-950);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
}
.activity-search-left {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  flex: 0 0 auto;
}
.activity-search-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex: 0 0 auto;
  min-width: 0;
}
.activity-date-cluster {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.toolbar .day-nav-arrow {
  width: 2.5rem;
  align-self: stretch;
  height: auto;
  min-height: 0;
  border-radius: 0;
}
.activity-date-cluster .day-nav-arrow--prev {
  border-radius: var(--radius-button) 0 0 var(--radius-button);
}
.activity-date-cluster .day-nav-arrow--next {
  border-radius: 0 var(--radius-button) var(--radius-button) 0;
}

/* Date picker button — clickable to open the date input */
.activity-date-picker {
  display: flex;
  align-items: center;
  position: relative;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-tertiary-800);
  border: none;
  border-radius: 0;
  color: var(--white);
  font-family: inherit;
  font-size: var(--font-small);
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.activity-date-picker:hover {
  background: var(--color-tertiary-700);
}
.activity-date-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.activity-date-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--muted);
}
.activity-date-native-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

/* Search input area */
.activity-search-input-wrap {
  flex: 0 0 13rem;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 13rem;
  max-width: 13rem;
}
.activity-search-input {
  flex: 1 1 auto;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-right: 2.75rem;
}

/* Mobile: stack title and search bar vertically */
@media (max-width: 40rem) {
  .activity-header--search {
    flex-wrap: wrap;
    align-items: stretch;
    margin-bottom: 0.75rem;
  }
  .activity-export-link {
    align-self: flex-end;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }
  .activity-search-left,
  .activity-search-right {
    width: 100%;
    margin-left: 0;
  }
  .activity-search-right {
    justify-content: space-between;
  }
  .activity-search-input-wrap {
    min-width: 0;
    max-width: none;
  }
}
.activity-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  margin: 0;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-width='2' d='M4 4l8 8M12 4 4 12'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-width='2' d='M4 4l8 8M12 4 4 12'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.activity-search-row .btn {
  min-height: var(--activity-control-h);
  display: inline-flex;
  align-items: center;
}
.activity-filters-icon-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border: none;
  color: var(--white);
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.15s;
  padding: 0;
  list-style: none;
}
.activity-filters-icon {
  width: 100%;
  height: 2rem;
  display: block;
  background-color: currentColor;
  -webkit-mask: url("assets/icons/filter.svg") center / contain no-repeat;
  mask: url("assets/icons/filter.svg") center / contain no-repeat;
}
.activity-filters-icon-toggle:hover {
  opacity: 1;
}
.activity-filters[open] .activity-filters-icon-toggle {
  opacity: 1;
}
.activity-search-row .btn {
  flex-shrink: 0;
}
.activity-search-date {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.activity-search-date-label {
  font-size: var(--font-xs);
  color: var(--muted);
}
.activity-search-date .form-input {
  width: auto;
  padding: 0.45rem 0.6rem;
  font-size: var(--font-xs);
  color-scheme: dark;
}
/* "Filters" dropdown — collapses level/type/date-range out of the search row */
.activity-filters {
  position: relative;
  flex-shrink: 0;
}
.activity-filters > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
}
.activity-filters > summary::-webkit-details-marker {
  display: none;
}
.activity-filters[open] .activity-filters-toggle::after {
  transform: rotate(-180deg);
}
.activity-filters-panel {
  position: absolute;
  top: calc(100% + 1.6rem);
  right: 0;
  left: auto;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 13rem;
  padding: 0.85rem;
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  background: var(--color-tertiary-800);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.45);
}
.activity-filters-panel .form-select {
  width: 100%;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: var(--font-xs);
}
.activity-filters-panel .activity-search-date {
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
}
.activity-filters-panel .activity-search-date .form-input {
  width: 100%;
}
@media (max-width: 40rem) {
  .activity-filters-panel {
    left: auto;
    right: 0;
  }
}
.activity-search-meta {
  font-size: var(--font-xs);
  color: var(--muted);
  margin-bottom: 1rem;
}
/* Day divider in flat search results (poll-run grouping doesn't apply across days) */
.log-search-day {
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.25rem 0 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 0.0625rem solid var(--border);
}
.log-search-day:first-child {
  margin-top: 0;
}

/* Activity: day-by-day navigator / reusable date bar component */
.day-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  margin-left: auto;
  width: fit-content;
  max-width: 100%;
  padding: 0.5rem;
  border-radius: var(--radius-button);
  background: var(--color-tertiary-800);
}
/* The calendar + Errors controls live in a dedicated container so their spacing
   is handled once, instead of by per-child margin tweaks. */
.day-nav-actions {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-left: 0.75rem;
  flex-shrink: 0;
}
/* display:flex would otherwise beat the [hidden] attribute — keep it hidden during search */
.day-nav[hidden] {
  display: none;
}
.day-nav-arrow {
  width: 2.75rem;
  height: var(--activity-control-h, 2.75rem);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-button);
  border: 0.0625rem solid rgba(255, 255, 255, 0.04);
  background: var(--color-tertiary-600);
  color: var(--off-white);
  font-size: var(--font-h3);
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.day-nav-arrow:not(:disabled) {
  background: rgba(49, 49, 48, 1);
  border: none;
}
.day-nav-arrow:not(:disabled):hover {
  background: rgba(49, 49, 48, 1);
  border: none;
}
.day-nav-arrow--prev {
  border-radius: var(--radius-button) 0 0 var(--radius-button);
}
.day-nav-arrow--prev:not(:disabled) {
  background: rgba(49, 49, 48, 1);
}
.day-nav-arrow--prev:not(:disabled):hover {
  background: rgba(49, 49, 48, 1);
}
.day-nav-arrow--next {
  border-radius: 0 var(--radius-button) var(--radius-button) 0;
}
.day-nav-arrow:disabled {
  cursor: default;
}
.day-nav-label {
  display: inline-flex;
  align-items: center;
  min-height: var(--activity-control-h, 2.75rem);
  padding: 0 1.25rem;
  border-radius: 0;
  background: var(--color-tertiary-600);
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--white);
  min-width: 9.5rem;
  text-align: center;
  margin-left: -0.0625rem;
}
/* Compact calendar button — the label already shows the date, so the input is
   collapsed to just its picker icon (click anywhere on it to jump to a day). */
.day-nav-date {
  width: 2.75rem;
  height: var(--activity-control-h, 2.75rem);
  flex-shrink: 0;
  border-radius: var(--radius-button);
  border: 0.0625rem solid rgba(255, 255, 255, 0.04);
  background: var(--color-tertiary-600) url("assets/icons/calendar.svg")
    center / 0.95rem 0.95rem no-repeat;
  background-clip: content-box;
  color-scheme: dark;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.day-nav-date:hover {
  background-color: var(--color-tertiary-800);
}
.day-nav-date {
  margin-left: 0;
  margin-right: 0;
}
.day-nav-date,
.day-nav-date::-webkit-datetime-edit,
.day-nav-date::-webkit-datetime-edit-fields-wrapper,
.day-nav-date::-webkit-datetime-edit-text,
.day-nav-date::-webkit-datetime-edit-day-field,
.day-nav-date::-webkit-datetime-edit-month-field,
.day-nav-date::-webkit-datetime-edit-year-field,
.day-nav-date::-webkit-inner-spin-button,
.day-nav-date::-webkit-calendar-picker-indicator {
  color: transparent;
}
.day-nav-date::-webkit-datetime-edit {
  opacity: 0;
}
.day-nav-date::-webkit-inner-spin-button,
.day-nav-date::-webkit-clear-button {
  display: none;
}
.day-nav-date::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}
.day-nav-date::-webkit-calendar-picker-indicator:hover {
  opacity: 0;
}
.day-nav-date:focus,
.day-nav-date:focus-visible,
.day-nav-date:active {
  color: transparent;
}
.day-nav .btn {
  min-height: var(--activity-control-h, 2.75rem);
  display: inline-flex;
  align-items: center;
  background: var(--color-tertiary-600);
  border-color: rgba(255, 255, 255, 0.04);
  color: var(--white);
  border-radius: var(--radius-button);
  margin-left: 0;
}
.day-nav .btn:hover {
  background: var(--color-tertiary-800);
}
.day-nav .btn[aria-pressed="true"] {
  background: var(--orange-20);
  border-color: var(--orange);
  color: var(--white);
}
/* Pressed state for toolbar toggles (Activity's "Errors only"). Replaces the rule above,
   which is dead: activity.php's toggle lives in .activity-search-left, not .day-nav. */
.btn-toggle[aria-pressed="true"] {
  background: var(--orange-20);
  border-color: var(--orange);
  color: var(--white);
}
.btn-toggle[aria-pressed="true"]:hover {
  background: var(--orange-30);
}

/* Recent 2FA codes — always-on strip above the Activity log, so the current AppFolio
   login code is one glance away instead of behind the Type filter. */
.code-strip {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.75rem 0.875rem;
  background: var(--card-bg);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
}
.code-strip[hidden] {
  display: none;
}
.code-strip-label {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.0312rem;
  color: var(--muted);
}
.code-strip-items {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
}
.code-strip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.code-strip-when {
  font-size: var(--font-xs);
  color: var(--muted);
  white-space: nowrap;
}

/* log list */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.log-list.is-loading {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s;
}
.log-empty-day {
  padding: 2.5rem 1rem;
}

/* Messages page — received 2FA texts */
.msg-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.msg-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border: 0.0625rem solid var(--border);
  border-radius: 0.625rem;
  background: var(--card-bg);
}
.msg-code-wrap {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.msg-code-box {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 6.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-2xs);
  border: 0.0625rem dashed var(--color-tertiary-700);
  background: var(--color-tertiary-700);
  color: var(--white);
  font-family: "DM Mono", monospace;
  background-image:
    repeating-linear-gradient(
      -28deg,
      #545454,
      #545454 4px,
      transparent 4px,
      transparent 10px,
      #545454 10px
    ),
    repeating-linear-gradient(
      62deg,
      #545454,
      #545454 4px,
      transparent 4px,
      transparent 10px,
      #545454 10px
    ),
    repeating-linear-gradient(
      152deg,
      #545454,
      #545454 4px,
      transparent 4px,
      transparent 10px,
      #545454 10px
    ),
    repeating-linear-gradient(
      242deg,
      #545454,
      #545454 4px,
      transparent 4px,
      transparent 10px,
      #545454 10px
    );
  background-size:
    1px 100%,
    100% 1px,
    1px 100%,
    100% 1px;
  background-position:
    0 0,
    0 0,
    100% 0,
    0 100%;
  background-repeat: no-repeat;
}
.msg-code-value {
  order: 1;
  font-size: var(--font-lg);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.1;
}
.msg-code-copy-trigger {
  order: 2;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-2xs);
  transition:
    color 0.15s,
    background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.msg-code-copy-trigger img {
  width: 1rem;
  height: 1rem;
  display: block;
  filter: brightness(0) saturate(100%) invert(89%) sepia(8%) saturate(168%)
    hue-rotate(326deg) brightness(90%) contrast(89%);
}
.msg-code-copy-trigger:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}
.msg-code-copy-trigger.is-copied {
  color: #22c55e;
}
.msg-code-copy-trigger.is-copied img {
  filter: brightness(0) saturate(100%) invert(70%) sepia(25%) saturate(1714%)
    hue-rotate(83deg) brightness(93%) contrast(90%);
}
.msg-code-box.is-copied {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.16);
}
.msg-detail {
  flex: 1;
  min-width: 0;
}
.msg-body {
  font-size: var(--font-small);
  color: var(--off-white);
  word-break: break-word;
}
.msg-meta {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--font-xs);
  color: var(--muted);
}
@media (max-width: 30rem) {
  .msg-card {
    flex-direction: column;
    align-items: stretch;
  }
  .msg-code-wrap {
    justify-content: space-between;
    width: 100%;
  }
  .msg-code-box {
    min-width: 0;
  }
}

.log-date-divider {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.0375rem;
  padding: 1rem 0 0.375rem;
  margin-bottom: 0.25rem;
}
.log-date-divider:first-child {
  padding-top: 0;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}
.log-entry:hover {
  background: rgba(255, 255, 255, 0.03);
}
.log-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  margin-top: 0.3125rem;
}
.log-body {
  flex: 1;
  min-width: 0;
}
.log-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.125rem;
  flex-wrap: wrap;
}
.log-event {
  font-size: var(--font-xs);
  font-weight: 600;
  font-family: "DM Mono", monospace;
  color: var(--off-white);
}
.log-wo-badge {
  font-size: var(--font-2xs);
  font-family: "DM Mono", monospace;
  color: var(--orange);
  background: var(--orange-10);
  border: 0.0625rem solid var(--orange-20);
  border-radius: var(--radius-xs);
  padding: 0.0625rem 0.375rem;
  text-decoration: none;
}
.log-wo-badge:hover {
  background: var(--orange-20);
}

.log-time {
  margin-left: auto;
  white-space: nowrap;
  font-size: var(--font-xs);
  color: var(--muted);
}
.log-message {
  font-size: var(--font-small);
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* ── Poll-run groups (collapsible) ─────────────────────────────────────────── */
.log-run {
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  background: var(--color-tertiary-500);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.log-run-summary {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.1s;
}
.log-run-summary::-webkit-details-marker {
  display: none;
}
.log-run-summary::marker {
  content: "";
}
.log-run-summary:hover {
  background: rgba(255, 255, 255, 0.03);
}
.log-run-chevron {
  width: 0.4375rem;
  height: 0.4375rem;
  border-right: 0.125rem solid var(--muted);
  border-bottom: 0.125rem solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-left: 0.125rem;
}
.log-run[open] .log-run-chevron {
  transform: rotate(45deg);
}

.log-run-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}
.log-run-title {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--off-white);
  white-space: nowrap;
}
.log-run-label {
  font-size: var(--font-xs);
  font-family: "DM Mono", monospace;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.025rem;
}

.log-run-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.log-run-stat {
  font-size: var(--font-xs);
  font-family: "DM Mono", monospace;
  color: var(--off-white);
  white-space: nowrap;
}
.log-run-stat--muted {
  color: var(--muted);
}
.log-run-badge {
  font-size: var(--font-2xs);
  font-family: "DM Mono", monospace;
  color: var(--red);
  background: var(--red-dim);
  border-radius: var(--radius-xs);
  padding: 0.0625rem 0.375rem;
  white-space: nowrap;
}

.log-run-body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.25rem 0.375rem 0.5rem;
  border-top: 0.0625rem solid var(--border);
  background: var(--card-bg);
}

/* ============================================ */
/* HISTORY PAGE                                 */
/* ============================================ */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.history-card {
  background: var(--card-bg);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  animation: slideUp 0.2s ease both;
}
.history-card--error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.04);
}

.history-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}
.history-card-left {
  min-width: 0;
}
.history-address {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.0125rem;
  line-height: 1.3;
  margin-bottom: 0;
}
.history-unit {
  font-size: var(--font-xs);
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.25rem;
}

.history-desc {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.625rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.history-vendor {
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--off-white);
}
.history-vendor--muted {
  color: var(--muted);
  font-style: italic;
}
.history-trade {
  font-weight: 400;
  color: var(--muted);
}
.history-time {
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.history-undo-form {
  margin: 0;
  margin-left: auto;
}
.history-undo-form .btn {
  font-size: var(--font-xs);
  padding: 0.2rem 0.65rem;
  opacity: 0.7;
}
.history-undo-form .btn:hover {
  opacity: 1;
}

.history-override {
  margin-top: 0.5rem;
  font-size: var(--font-xs);
  color: var(--muted);
  padding: 0.375rem 0.625rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-xs);
}

.history-fill-error {
  margin-top: 0.5rem;
  font-size: var(--font-xs);
  color: var(--red);
  padding: 0.375rem 0.625rem;
  background: var(--red-dim);
  border-radius: var(--radius-xs);
}

/* Expandable history card — click to reveal the tenant's original request + the AI suggestion */
.history-card--expandable {
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.history-card--expandable:hover {
  border-color: rgba(255, 255, 255, 0.18);
}
.history-card-top-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.history-chevron {
  display: inline-flex;
  color: var(--muted);
  transition:
    transform 0.2s ease,
    color 0.15s ease;
}
.history-card--expandable:hover .history-chevron {
  color: var(--off-white);
}
.history-card[aria-expanded="true"] .history-chevron {
  transform: rotate(180deg);
}
.history-detail {
  margin-top: 0.625rem;
  padding-top: 0.75rem;
  border-top: 0.0625rem solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
/* Restore the hidden behavior — the display:flex above would otherwise beat [hidden]'s display:none. */
.history-detail[hidden] {
  display: none;
}
.history-detail-label {
  display: block;
  font-size: var(--font-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.history-detail-text {
  font-size: var(--font-small);
  color: var(--off-white);
  line-height: 1.5;
}
.history-detail-text strong {
  color: var(--white);
  font-weight: 600;
}

/* status pills */
.status-pill {
  display: inline-block;
  font-size: var(--font-2xs);
  font-weight: 600;
  padding: 0.1875rem 0.5625rem;
  border-radius: var(--radius-xs);
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-pill--queued {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}
.history-card-status {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex-shrink: 0;
}

/* ============================================ */
/* LEARNING PAGE                                */
/* ============================================ */
.section-title {
  font-size: var(--font-h3);
  font-weight: 600;
  color: var(--white);
  margin-top: 2rem;
  margin-bottom: 0.375rem;
}
.section-desc {
  margin-bottom: 1rem;
}
.learn-empty {
  color: var(--muted);
  padding: 1rem 0;
}

/* Stats row */
.learn-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.learn-stat-card {
  background: var(--header-card-bg);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem 1rem;
  text-align: center;
}
.learn-stat-card--accent {
  border-color: var(--orange-30);
  background: var(--orange-10);
}
.learn-stat-value {
  font-size: var(--font-h1);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.375rem;
}
.learn-stat-card--accent .learn-stat-value {
  color: var(--orange);
}
.learn-stat-label {
  margin-bottom: 0.25rem;
}
.learn-stat-sub {
  color: var(--muted);
}

/* Tier status badges */
.tier-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.tier-badge {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: var(--card-bg);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
}
.tier-badge--active {
  border-color: var(--green);
  background: var(--green-dim);
}
.tier-badge-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
.tier-badge-dot--on {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}
.tier-badge-name {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.125rem;
}
.tier-badge--active .tier-badge-name {
  color: var(--green);
}
.tier-badge-desc {
  color: var(--muted);
}

/* Emerging patterns */
.pattern-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.pattern-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-tertiary-500);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
}
.pattern-row--ready {
  border-color: var(--orange-30);
  background: var(--orange-10);
}
.pattern-owner {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.125rem;
}
.pattern-detail {
  color: var(--muted);
}
.pattern-detail strong {
  color: var(--white);
}
.pattern-meta {
  text-align: right;
  flex-shrink: 0;
}
.pattern-count {
  font-size: var(--font-h3);
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
}
.pattern-status {
  color: var(--muted);
  margin-top: 0.125rem;
}
.pattern-row--ready .pattern-status {
  color: var(--orange);
}

/* Vendor accuracy bars */
.vendor-perf-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}
.vendor-perf-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0.75rem;
}
.vendor-perf-name {
  font-size: var(--font-small);
  color: var(--off-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vendor-perf-bar-wrap {
  width: 5rem;
  height: 0.375rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.vendor-perf-bar {
  height: 100%;
  background: var(--orange);
  border-radius: var(--radius-lg);
  min-width: 0.25rem;
  transition: width 0.4s ease;
}
.vendor-perf-pct {
  color: var(--white);
  font-weight: 600;
  width: 2.5rem;
  text-align: right;
}
.vendor-perf-counts {
  color: var(--muted);
  white-space: nowrap;
  width: 4rem;
  text-align: right;
}

/* Override reasons */
.reason-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}
.reason-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 0.0625rem solid var(--border);
}
.reason-row:last-child {
  border-bottom: none;
}
.reason-label {
  color: var(--off-white);
}
.reason-count {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--orange);
}

/* Decision feed */
.decision-feed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.decision-row {
  display: flex;
  gap: 0.875rem;
  background: var(--color-tertiary-500);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
}
.decision-indicator {
  width: 0.1875rem;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  align-self: stretch;
}
.decision-row--approved .decision-indicator {
  background: var(--green);
}
.decision-row--override .decision-indicator {
  background: var(--orange);
}
.decision-body {
  flex: 1;
  min-width: 0;
}
.decision-desc {
  color: var(--off-white);
  margin-bottom: 0.25rem;
}
.decision-meta {
  color: var(--muted);
  margin-bottom: 0.375rem;
}
.decision-vendors {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.decision-suggested {
  color: var(--muted);
  text-decoration: line-through;
}
.decision-arrow {
  color: var(--muted);
}
.decision-chosen {
  color: var(--green);
  font-weight: 600;
}
.decision-row--override .decision-chosen {
  color: var(--orange);
}
.decision-trade {
  color: var(--muted);
}

/* ============================================ */
/* VENDORS PAGE                                 */
/* ============================================ */
/* ── Vendor grid: one card per trade in a single column; each card's vendor chips
   still flow left-to-right in the same fixed-size grid ────────────────────── */
.vendor-grid {
  column-count: 1;
  column-gap: 1rem;
}

.vendor-trade-card {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  /* background: var(--card-bg);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius); */
  padding: 0.875rem;
  margin-bottom: 1rem;
  animation: slideUp 0.2s ease both;
}

.vendor-trade-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.625rem;
  margin-bottom: 0.75rem;
  border-bottom: 0.0625rem solid var(--border);
}
.vendor-trade-name {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.vendor-trade-count {
  font-size: var(--font-2xs);
  background: var(--color-tertiary-500);
  color: var(--muted);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}
.vendor-trade-card-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 52rem) {
  .vendor-trade-card-body {
    grid-template-columns: 1fr;
  }
}

.vendor-chip {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  background: rgb(7 7 7 / 50%);
  border: 0.0625rem solid var(--border);
  border-radius: 0.8rem;
  min-width: 0;
  min-height: 2rem;
  transition:
    opacity 0.2s,
    border-color 0.15s,
    background-color 0.15s;
}
.vendor-chip--inactive {
  opacity: 0.45;
}
.vendor-chip-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.vendor-chip-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.vendor-chip-name-text {
  min-width: 0;
  font-size: var(--font-p);
  font-weight: 600;
  color: var(--off-white);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vendor-preferred-star {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
.vendor-preferred-star:hover {
  color: var(--off-white);
}
.vendor-preferred-star.is-preferred,
.vendor-preferred-star.is-preferred:hover {
  color: var(--orange);
}
.vendor-chip-notes {
  font-size: var(--font-small);
  color: var(--muted);
  line-height: 1.4;
  white-space: normal;
  overflow: visible;
  margin-top: 0;
}

/* ── Tags: read-only pills (cards) + pill editor (add/edit form) ──────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
/* card cap: show the first 8 pills; the "View all" btn-link reveals the rest */
.tag-list--capped .tag-pill:nth-child(n + 9) {
  display: none;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.25rem 0.55rem;
  background: rgba(255, 255, 255, 0.05);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-small);
  line-height: 1.3;
  color: var(--off-white);
}
.tag-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-pill--readonly {
  color: var(--muted);
}
/* card trade pills: accented so AppFolio trades read distinctly from the neutral keyword tags */
.tag-pill--trade {
  background: color-mix(in oklab, var(--orange) 12%, transparent);
  border-color: color-mix(in oklab, var(--orange) 45%, transparent);
  color: var(--off-white);
}
.tag-pill-x {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-right: -0.2rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-2xs);
  background: none;
  font-family: inherit;
  font-size: var(--font-p);
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 0.15s,
    background-color 0.15s;
}
.tag-pill-x:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}
/* the editable pill list sits ABOVE a separate add-a-tag row (input + button) */
.tag-list--editable {
  margin-bottom: 0.55rem;
}
.tag-editor-layout {
  display: block;
}
.tag-add-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}
.tag-add-input {
  flex: 0 1 11rem;
  width: 11rem;
  min-width: 8rem;
  max-width: 100%;
}
.tag-add-btn {
  flex-shrink: 0;
}

@media (min-width: 48rem) {
  .tag-editor-layout {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .tag-list--editable {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
  }

  .tag-add-row {
    flex: 0 0 auto;
    align-self: flex-start;
  }
}

/* Vendor add/edit form */
/* ── Vendor import strip ────────────────────────────────────────────────── */
.vendor-import-strip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
}
.vendor-import-label {
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.vendor-import-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.vendor-import-input {
  flex: 1;
  font-size: var(--font-small);
  font-family: var(--font-mono);
}
.vendor-import-status {
  font-size: var(--font-xs);
  min-height: 1.2em;
  margin-top: 0.4rem;
  display: none;
}
.vendors-actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 1.25rem;
}

.vendor-form-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  animation: slideUp 0.2s ease;
}
.vendor-form-title {
  font-size: var(--font-p);
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.vendor-form-error {
  margin-bottom: 1.25rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  background: rgba(220, 38, 38, 0.12);
  border: 0.0625rem solid rgba(220, 38, 38, 0.4);
  color: #fca5a5;
  font-size: var(--font-small);
  line-height: 1.5;
}
.vendor-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.vendor-form-card .form-field {
  margin-bottom: 1.85rem;
}
.form-label-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: var(--font-xs);
}
.vendor-form-checks {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}
.vendor-check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-small);
  color: var(--off-white);
  cursor: pointer;
}
.vendor-check-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

/* Ignore toast — bottom banner with a 10s orange countdown bar; Undo restores the WO.
   Rendered by index.php when ?ignored=<id> is present. */
.wo-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  min-width: 15rem;
  max-width: calc(100vw - 2rem);
  padding: 1.2rem;
  border-radius: var(--radius);
  background: var(--color-tertiary-800);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: wo-toast-in 0.25s ease;
}
.wo-toast-text {
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--white);
}
.wo-toast-undo-form {
  margin: 0;
}
.wo-toast-undo-form .btn {
  font-family: inherit;
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--orange);
  background: transparent;
  border: 0.0625rem solid var(--orange-40);
  border-radius: var(--radius-button);
  padding: 0.5rem 1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
.wo-toast-undo-form .btn:hover {
  background: var(--orange-20);
  border-color: var(--orange);
}
.wo-toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 0.1875rem;
  width: 100%;
  background: var(--orange);
  animation: wo-toast-countdown 10s linear forwards;
}
@keyframes wo-toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@keyframes wo-toast-countdown {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wo-toast {
    animation: none;
  }
  .wo-toast-progress {
    animation: none;
  }
}

/* ============================================ */
/* DEV-ONLY: test work-order seeder (homepage)  */
/* Rendered only when !IS_PROD — drops a fake WO */
/* into the list to exercise the assign flow.   */
/* ============================================ */
.dev-seed {
  margin: 0 0 1.25rem;
}
.dev-seed-menu {
  position: relative;
  display: inline-block;
}
.dev-seed-toggle {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "DM Mono", monospace;
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--orange);
  background: var(--orange-10);
  border: 0.0625rem dashed var(--orange-40);
  border-radius: var(--radius-button);
  padding: 0.4rem 0.75rem;
}
.dev-seed-toggle::-webkit-details-marker {
  display: none;
}
.dev-seed-toggle::after {
  content: "\25BE";
  font-size: 0.7em;
  opacity: 0.8;
}
.dev-seed-menu[open] .dev-seed-toggle::after {
  content: "\25B4";
}
.dev-seed-options {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 30;
  min-width: 14rem;
  padding: 0.3rem;
  background: var(--color-tertiary-800);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.45);
}
.dev-seed-options form {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.dev-seed-options .btn {
  width: 100%;
  text-align: left;
  color: var(--off-white);
  border-radius: var(--radius-sm);
  justify-content: flex-start;
  transition:
    background-color 0.12s,
    color 0.12s;
}
.dev-seed-options .btn:hover {
  background: var(--orange-10);
  color: var(--white);
}

/* ============================================ */
/* STATS DASHBOARD (stats.php)                  */
/* ============================================ */
.stats-highlights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.default-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--card-bg);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
}
.default-card--gradient {
  border-color: transparent;
  background:
    radial-gradient(
      86% 122% at 0% 100%,
      rgb(249 115 22 / 0.28) 0%,
      rgb(247 114 22 / 0.28) 12%,
      rgb(241 112 21 / 0.28) 21%,
      rgb(232 107 21 / 0.28) 29%,
      rgb(220 102 20 / 0.28) 35%,
      rgb(205 95 19 / 0.28) 40%,
      rgb(188 88 18 / 0.28) 45%,
      rgb(170 80 17 / 0.28) 48%,
      rgb(150 71 15 / 0.28) 52%,
      rgb(129 61 14 / 0.28) 55%,
      rgb(108 52 13 / 0.28) 60%,
      rgb(0 0 0 / 0) 79%
    ),
    radial-gradient(
      62% 88% at 100% 0%,
      rgb(249 115 22 / 0.4) 0%,
      rgb(247 114 22 / 0.4) 12%,
      rgb(241 112 21 / 0.4) 21%,
      rgb(232 107 21 / 0.4) 29%,
      rgb(220 102 20 / 0.4) 35%,
      rgb(205 95 19 / 0.4) 40%,
      rgb(188 88 18 / 0.4) 45%,
      rgb(170 80 17 / 0.4) 48%,
      rgb(150 71 15 / 0.4) 52%,
      rgb(129 61 14 / 0.4) 55%,
      rgb(108 52 13 / 0.4) 60%,
      rgb(0 0 0 / 0) 79%
    ),
    #000;
}
.default-card-value {
  font-size: var(--font-h2);
  font-weight: 700;
  line-height: 1;
  color: var(--orange);
}
.default-card-label {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--off-white);
}
.default-card-sub {
  font-size: var(--font-xs);
  color: var(--muted);
}
.stats-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.stats-chart-card {
  background: var(--card-bg);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem 1.125rem;
}
.stats-chart-card--wide {
  grid-column: 1 / -1;
}
.stats-chart-title {
  margin: 0 0 0.85rem;
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--off-white);
}
/* Title row for charts that carry a live readout alongside the heading */
.stats-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.stats-chart-head .stats-chart-title {
  margin: 0;
}
.stats-scrub-readout {
  font-size: var(--font-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.stats-scrub-day::after {
  content: " · ";
}
.stats-scrub-value {
  color: var(--orange);
  font-weight: 700;
  margin-right: 0.25rem;
}
.stats-chart-body {
  position: relative;
  height: 15rem;
}
/* Draggable day scrubber — horizontal drags scrub, vertical still scrolls the page */
.stats-chart-body--scrub canvas {
  cursor: ew-resize;
  touch-action: pan-y;
}
/* Stats — featured impact metrics (hero row) */
.stats-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.stats-hero-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--card-bg);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.stats-hero-card.default-card--gradient {
  border: none;
  background:
    radial-gradient(
      86% 122% at 0% 100%,
      rgb(249 115 22 / 0.28) 0%,
      rgb(247 114 22 / 0.28) 12%,
      rgb(241 112 21 / 0.28) 21%,
      rgb(232 107 21 / 0.28) 29%,
      rgb(220 102 20 / 0.28) 35%,
      rgb(205 95 19 / 0.28) 40%,
      rgb(188 88 18 / 0.28) 45%,
      rgb(170 80 17 / 0.28) 48%,
      rgb(150 71 15 / 0.28) 52%,
      rgb(129 61 14 / 0.28) 55%,
      rgb(108 52 13 / 0.28) 60%,
      rgb(0 0 0 / 0) 79%
    ),
    radial-gradient(
      62% 88% at 100% 0%,
      rgb(249 115 22 / 0.4) 0%,
      rgb(247 114 22 / 0.4) 12%,
      rgb(241 112 21 / 0.4) 21%,
      rgb(232 107 21 / 0.4) 29%,
      rgb(220 102 20 / 0.4) 35%,
      rgb(205 95 19 / 0.4) 40%,
      rgb(188 88 18 / 0.4) 45%,
      rgb(170 80 17 / 0.4) 48%,
      rgb(150 71 15 / 0.4) 52%,
      rgb(129 61 14 / 0.4) 55%,
      rgb(108 52 13 / 0.4) 60%,
      rgb(0 0 0 / 0) 79%
    ),
    #000;
}
.stats-hero-card--reversed {
  background: var(--orange);
  border-color: transparent;
}
.stats-hero-value {
  font-size: var(--font-h1);
  font-weight: 700;
  line-height: 1;
  color: var(--white);
}
.stats-hero-card--reversed .stats-hero-value,
.stats-hero-card--reversed .stats-hero-value--accent {
  color: var(--white);
}
.stats-hero-value--accent {
  color: var(--orange);
}
.stats-hero-label {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--off-white);
}
.stats-hero-card--reversed .stats-hero-label {
  color: var(--white);
}
.stats-hero-sub {
  font-size: var(--font-xs);
  color: var(--muted);
}
.stats-hero-card--reversed .stats-hero-sub {
  color: rgb(255 255 255 / 76%);
}
@media (max-width: 40rem) {
  .stats-hero,
  .stats-highlights,
  .stats-charts {
    grid-template-columns: 1fr;
  }
}

/* Merged WO detail+suggestion card (index.php suggestion step) */
.detail-people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.125rem;
}
.detail-vendor {
  margin-top: 1.5rem;
}
