/* =========================================================================
   WMP Manager — brand + layout styles (loaded after bootstrap.min.css)
   Brand colors live in :root so they can be swapped in one place.
   ========================================================================= */

:root {
  /* Brand (sampled from _docs/mock.png) */
  --wmp-navy: #10294b;
  --wmp-navy-600: #1b3a66;
  --wmp-navy-050: #eef2f8;
  --wmp-gold: #c49a2c;
  --wmp-gold-600: #a9831f;
  --wmp-gold-050: #fbf5e4;

  /* Status */
  --wmp-urgent: #d63a3a;       /* high / urgent */
  --wmp-urgent-050: #fdecec;
  --wmp-completed: #2e9e5b;    /* completed */
  --wmp-completed-050: #e8f6ee;
  --wmp-attention: #e8891c;    /* partial / attention */
  --wmp-attention-050: #fdf1e3;
  --wmp-info: #2f6fdb;         /* info */
  --wmp-info-050: #e9f0fc;

  /* Surfaces */
  --wmp-bg: #f4f6fa;
  --wmp-surface: #ffffff;
  --wmp-border: #e1e6ee;
  --wmp-muted: #6b778a;
  --wmp-text: #1d2738;
  --wmp-sidebar-bg: #eef2f8;

  /* Shape & sizing */
  --wmp-radius: .875rem;
  --wmp-radius-sm: .5rem;
  --wmp-shadow: 0 1px 2px rgba(16, 41, 75, .06), 0 2px 8px rgba(16, 41, 75, .05);
  --wmp-sidebar-width: 248px;
  --wmp-appbar-height: 56px;
  --wmp-tabbar-height: 62px;
  --wmp-content-max: 1100px;
  --wmp-safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Bootstrap hooks */
  --bs-body-bg: var(--wmp-bg);
  --bs-body-color: var(--wmp-text);
  --bs-primary: var(--wmp-navy);
  --bs-primary-rgb: 16, 41, 75;
  --bs-link-color: var(--wmp-navy-600);
  --bs-link-color-rgb: 27, 58, 102;
  --bs-link-hover-color: var(--wmp-navy);
  --bs-border-color: var(--wmp-border);
  --bs-border-radius: var(--wmp-radius-sm);
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body { min-height: 100%; }
body { background: var(--wmp-bg); -webkit-tap-highlight-color: transparent; }

/* ---------- Buttons ---------- */
.btn { --bs-btn-border-radius: var(--wmp-radius-sm); --bs-btn-font-weight: 600; }
.btn-primary {
  --bs-btn-bg: var(--wmp-navy); --bs-btn-border-color: var(--wmp-navy);
  --bs-btn-hover-bg: var(--wmp-navy-600); --bs-btn-hover-border-color: var(--wmp-navy-600);
  --bs-btn-active-bg: #0b1f3a; --bs-btn-active-border-color: #0b1f3a;
  --bs-btn-disabled-bg: var(--wmp-navy); --bs-btn-disabled-border-color: var(--wmp-navy);
  --bs-btn-focus-shadow-rgb: 16, 41, 75;
}
.btn-outline-primary {
  --bs-btn-color: var(--wmp-navy); --bs-btn-border-color: var(--wmp-border);
  --bs-btn-hover-bg: var(--wmp-navy-050); --bs-btn-hover-color: var(--wmp-navy); --bs-btn-hover-border-color: var(--wmp-navy-050);
  --bs-btn-active-bg: var(--wmp-navy-050); --bs-btn-active-color: var(--wmp-navy); --bs-btn-active-border-color: var(--wmp-navy);
  background: var(--wmp-surface);
}
/* Gold accent — "Start Visit" */
.btn-accent {
  --bs-btn-color: #fff; --bs-btn-bg: var(--wmp-gold); --bs-btn-border-color: var(--wmp-gold);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--wmp-gold-600); --bs-btn-hover-border-color: var(--wmp-gold-600);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--wmp-gold-600); --bs-btn-active-border-color: var(--wmp-gold-600);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--wmp-gold); --bs-btn-disabled-border-color: var(--wmp-gold);
  --bs-btn-focus-shadow-rgb: 196, 154, 44;
}
.btn-lg { --bs-btn-padding-y: .7rem; --bs-btn-font-size: 1.05rem; }

/* ---------- Cards ---------- */
.wmp-card {
  background: var(--wmp-surface);
  border: 1px solid var(--wmp-border);
  border-radius: var(--wmp-radius);
  box-shadow: var(--wmp-shadow);
}
.wmp-card-body { padding: 1rem; }
a.wmp-card { color: inherit; text-decoration: none; display: block; transition: border-color .15s, box-shadow .15s; }
a.wmp-card:hover { border-color: #c9d3e3; box-shadow: 0 4px 14px rgba(16, 41, 75, .09); }

.wmp-section-title {
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--wmp-muted); margin: 1.25rem 0 .5rem;
}
.wmp-section-title.is-urgent { color: var(--wmp-urgent); }

/* ---------- Status helpers ---------- */
.text-urgent { color: var(--wmp-urgent) !important; }
.text-completed { color: var(--wmp-completed) !important; }
.text-attention { color: var(--wmp-attention) !important; }
.text-info-wmp { color: var(--wmp-info) !important; }
.wmp-badge {
  display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .55rem;
  border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.2;
}
.wmp-badge--urgent { background: var(--wmp-urgent-050); color: var(--wmp-urgent); }
.wmp-badge--completed { background: var(--wmp-completed-050); color: var(--wmp-completed); }
.wmp-badge--attention { background: var(--wmp-attention-050); color: var(--wmp-attention); }
.wmp-badge--info { background: var(--wmp-info-050); color: var(--wmp-info); }
.wmp-badge--muted { background: #edf0f4; color: var(--wmp-muted); }

.wmp-icon-tile {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: .65rem; font-size: 1.2rem;
}
.wmp-icon-tile--navy { background: var(--wmp-navy-050); color: var(--wmp-navy); }
.wmp-icon-tile--gold { background: var(--wmp-gold-050); color: var(--wmp-gold-600); }
.wmp-icon-tile--red { background: var(--wmp-urgent-050); color: var(--wmp-urgent); }
.wmp-icon-tile--green { background: var(--wmp-completed-050); color: var(--wmp-completed); }
.wmp-icon-tile--blue { background: var(--wmp-info-050); color: var(--wmp-info); }

.wmp-avatar {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--wmp-navy); color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .02em;
}

button.wmp-avatar { padding: 0; cursor: pointer; }
.wmp-avatar--lg { width: 3.25rem; height: 3.25rem; font-size: 1.05rem; }

/* Label / value list inside a card */
.wmp-dl { margin: 0; }
.wmp-dl > div { display: flex; gap: 1rem; padding: .65rem 1rem; border-top: 1px solid var(--wmp-border); }
.wmp-dl dt { flex: 0 0 7.5rem; font-weight: 500; color: var(--wmp-muted); }
.wmp-dl dd { flex: 1 1 auto; min-width: 0; margin: 0; }

.wmp-user-chip {
  display: inline-flex; align-items: center; gap: .5rem; padding: .2rem .65rem .2rem .2rem;
  border: 1px solid var(--wmp-border); border-radius: 999px; background: var(--wmp-surface);
  color: var(--wmp-text); text-decoration: none; font-size: .9rem; font-weight: 600;
}
.wmp-user-chip .wmp-avatar { width: 1.9rem; height: 1.9rem; font-size: .72rem; }

/* ---------- Logo ---------- */
.wmp-logo { display: block; height: 40px; width: auto; }
.wmp-logo--lg { height: 72px; margin: 0 auto; }

/* =========================================================================
   Navigation (shared partial renders both variants)
   ========================================================================= */
.wmp-sidenav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.wmp-sidenav a {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .85rem;
  border-radius: var(--wmp-radius-sm); color: var(--wmp-text); text-decoration: none; font-weight: 500;
}
.wmp-sidenav a .bi { font-size: 1.1rem; color: var(--wmp-navy-600); }
.wmp-sidenav a:hover { background: rgba(16, 41, 75, .06); }
.wmp-sidenav a.active { background: var(--wmp-navy); color: #fff; }
.wmp-sidenav a.active .bi { color: #fff; }
.wmp-nav-badge {
  margin-left: auto; min-width: 1.35rem; padding: .1rem .4rem; border-radius: 999px;
  background: var(--wmp-urgent); color: #fff; font-size: .7rem; font-weight: 700; line-height: 1.2; text-align: center;
}

.wmp-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  background: var(--wmp-surface); border-top: 1px solid var(--wmp-border);
  padding-bottom: var(--wmp-safe-bottom);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
  box-shadow: 0 -2px 10px rgba(16, 41, 75, .05);
}
.wmp-tabbar ul { list-style: none; margin: 0; padding: 0; display: flex; height: var(--wmp-tabbar-height); }
.wmp-tabbar li { flex: 1 1 0; min-width: 0; }
.wmp-tabbar a {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--wmp-muted); text-decoration: none; font-size: .7rem; font-weight: 600;
}
.wmp-tabbar a .bi { font-size: 1.35rem; line-height: 1; }
.wmp-tabbar a.active { color: var(--wmp-navy); }
.wmp-tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }

/* =========================================================================
   App shell — Tech & Client (mobile-first)
   ========================================================================= */
.wmp-app { min-height: 100vh; min-height: 100dvh; }
.wmp-app .wmp-sidebar { display: none; }
.wmp-main { min-width: 0; }

.wmp-appbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: .5rem;
  min-height: var(--wmp-appbar-height); padding: .4rem 1rem;
  padding-top: max(.4rem, env(safe-area-inset-top, 0px));
  padding-left: max(1rem, env(safe-area-inset-left, 0px)); padding-right: max(1rem, env(safe-area-inset-right, 0px));
  background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--wmp-border);
  backdrop-filter: saturate(1.4) blur(6px);
}
.wmp-appbar-title { flex: 1 1 auto; min-width: 0; }
.wmp-appbar-title h1 {
  font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--wmp-navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wmp-appbar-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; margin-left: -.5rem; border-radius: 50%;
  color: var(--wmp-navy); font-size: 1.35rem; text-decoration: none;
}
.wmp-appbar-back:hover { background: var(--wmp-navy-050); }
/* App-bar icon button (Stage 16b: Refresh — the installed app has no browser reload button). */
.wmp-appbar-action {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 50%; color: var(--wmp-navy-600); font-size: 1.25rem; text-decoration: none;
}
.wmp-appbar-action:hover, .wmp-appbar-action:focus-visible { background: var(--wmp-navy-050); color: var(--wmp-navy); }

/* Client property switcher (only when the client has more than one property) */
.wmp-property-switcher .btn {
  --bs-btn-padding-y: 0; --bs-btn-padding-x: 0; --bs-btn-font-size: .8rem; --bs-btn-font-weight: 500;
  --bs-btn-color: var(--wmp-muted); --bs-btn-hover-color: var(--wmp-navy); --bs-btn-active-color: var(--wmp-navy);
  border: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.wmp-content {
  width: 100%; max-width: var(--wmp-content-max); margin: 0 auto;
  padding: 1rem 1rem calc(var(--wmp-tabbar-height) + var(--wmp-safe-bottom) + 1.25rem);
  overflow-x: clip;
}

@media (min-width: 992px) {
  .wmp-app { display: flex; }
  .wmp-app .wmp-sidebar {
    display: flex; flex-direction: column; flex: 0 0 var(--wmp-sidebar-width);
    position: sticky; top: 0; height: 100vh;
    background: var(--wmp-sidebar-bg); border-right: 1px solid var(--wmp-border); padding: 1.25rem 1rem;
  }
  .wmp-main { flex: 1 1 auto; }
  .wmp-appbar { padding-left: max(2rem, env(safe-area-inset-left, 0px)); padding-right: max(2rem, env(safe-area-inset-right, 0px)); }
  .wmp-appbar-title h1 { font-size: 1.25rem; }
  .wmp-content { padding: 1.5rem 2rem 2.5rem; }
  .wmp-tabbar { display: none; }
}

.wmp-sidebar-brand { padding: 0 .35rem 1.25rem; }
.wmp-sidebar-footer { margin-top: auto; padding-top: 1rem; font-size: .75rem; color: var(--wmp-muted); }
.wmp-version { font-size: .6875rem; opacity: .8; font-variant-numeric: tabular-nums; }

/* Two-pane list + detail: one column on phones, side by side from 992px. */
.wmp-two-pane { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.wmp-two-pane > .wmp-pane-detail { display: none; }
@media (min-width: 992px) {
  .wmp-two-pane { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  .wmp-two-pane > .wmp-pane-detail { display: block; position: sticky; top: calc(var(--wmp-appbar-height) + 1.5rem); }
}

/* =========================================================================
   Admin shell — desktop-first; sidebar becomes an offcanvas below 992px
   ========================================================================= */
.wmp-admin { min-height: 100vh; }
.wmp-admin .wmp-sidebar .offcanvas-lg { --bs-offcanvas-width: 280px; --bs-offcanvas-bg: var(--wmp-sidebar-bg); }
.wmp-admin .wmp-topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: .75rem; min-height: 60px;
  padding: max(.5rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) .5rem max(1rem, env(safe-area-inset-left, 0px));
  background: var(--wmp-surface); border-bottom: 1px solid var(--wmp-border);
}
.wmp-admin .wmp-topbar h1 { font-size: 1.15rem; font-weight: 700; color: var(--wmp-navy); margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wmp-admin .wmp-admin-content { padding: 1rem; max-width: 1400px; overflow-x: clip; }
.wmp-hamburger { font-size: 1.5rem; color: var(--wmp-navy); padding: .15rem .35rem; border: 0; background: none; }

@media (min-width: 992px) {
  .wmp-admin { display: flex; }
  .wmp-admin .wmp-sidebar {
    flex: 0 0 var(--wmp-sidebar-width); position: sticky; top: 0; height: 100vh;
    background: var(--wmp-sidebar-bg); border-right: 1px solid var(--wmp-border); padding: 1.25rem 1rem;
    display: flex; flex-direction: column;
  }
  .wmp-admin .wmp-sidebar .offcanvas-lg { display: flex; flex-direction: column; flex: 1 1 auto; }
  .wmp-admin .wmp-sidebar .offcanvas-body { flex: 1 1 auto; }
  .wmp-admin .wmp-main { flex: 1 1 auto; }
  .wmp-admin .wmp-topbar { padding: .75rem 2rem; }
  .wmp-admin .wmp-admin-content { padding: 1.75rem 2rem; }
}

/* =========================================================================
   Auth layout — centered card
   ========================================================================= */
.wmp-auth {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, var(--wmp-navy-050) 0%, var(--wmp-bg) 60%);
}
.wmp-auth-card { width: 100%; max-width: 420px; }
.wmp-auth-card .wmp-card-body { padding: 2rem 1.5rem; }
.wmp-auth-title { font-size: 1.4rem; font-weight: 700; color: var(--wmp-navy); text-align: center; margin: 0 0 1.25rem; }

/* =========================================================================
   Forms
   ========================================================================= */
/* MVC validation hooks → Bootstrap look. An empty summary renders hidden. */
.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.validation-summary-errors ul:has(> li:only-child) { list-style: none; padding-left: 0; }
.input-validation-error { border-color: var(--bs-form-invalid-border-color); }
.input-validation-error:focus { box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), .25); }
.wmp-password-toggle { --bs-btn-color: var(--wmp-muted); --bs-btn-border-color: var(--bs-border-color); --bs-btn-hover-bg: var(--wmp-navy-050); --bs-btn-hover-color: var(--wmp-navy); --bs-btn-hover-border-color: var(--bs-border-color); --bs-btn-active-bg: var(--wmp-navy-050); --bs-btn-active-color: var(--wmp-navy); }

/* =========================================================================
   Page components
   ========================================================================= */
.wmp-page-header h2 { font-size: 1.6rem; font-weight: 800; color: var(--wmp-navy); margin: 0; }
.wmp-page-header p { color: var(--wmp-muted); margin: .15rem 0 0; }

/* Tech: visit card */
.wmp-visit-card .wmp-visit-name { font-size: 1.05rem; font-weight: 700; color: var(--wmp-navy); margin: 0; }
.wmp-meta { display: flex; align-items: center; gap: .45rem; color: var(--wmp-muted); font-size: .9rem; }
.wmp-meta .bi { color: var(--wmp-navy-600); }

/* Tech: task list */
.wmp-task-list { list-style: none; margin: 0; padding: 0; }
.wmp-task-list > li + li { border-top: 1px solid var(--wmp-border); }
.wmp-task-row {
  display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; color: inherit; text-decoration: none;
}
a.wmp-task-row:hover { background: var(--wmp-navy-050); }
.wmp-task-row .wmp-task-title { font-weight: 600; }
.wmp-task-row .wmp-task-sub { font-size: .85rem; color: var(--wmp-muted); }
.wmp-task-row.is-high { box-shadow: inset 3px 0 0 var(--wmp-urgent); }
.wmp-task-check {
  flex: 0 0 auto; width: 1.35rem; height: 1.35rem; border: 2px solid #b5c0d0; border-radius: .3rem;
}
.wmp-task-row .bi-chevron-right { color: #a3aec0; margin-left: auto; }

.wmp-segmented { display: flex; gap: .25rem; padding: .25rem; background: var(--wmp-navy-050); border-radius: 999px; }
.wmp-segmented button {
  flex: 1 1 0; border: 0; background: none; border-radius: 999px; padding: .4rem .5rem;
  font-size: .85rem; font-weight: 600; color: var(--wmp-muted);
}
.wmp-segmented button.active { background: var(--wmp-surface); color: var(--wmp-navy); box-shadow: var(--wmp-shadow); }

.wmp-dot { display: inline-block; flex: 0 0 auto; width: .55rem; height: .55rem; border-radius: 50%; background: var(--wmp-completed); }
.wmp-dot--completed { background: var(--wmp-completed); }
.wmp-dot--gold { background: var(--wmp-gold); }
.wmp-dot--muted { background: #a3aec0; }

/* Tech: top bar second line, admin "Viewing as" bar */
.wmp-appbar-sub { display: flex; align-items: center; gap: .4rem; min-width: 0; font-size: .85rem; color: var(--wmp-muted); line-height: 1.2; }
.wmp-viewas { background: var(--wmp-gold-050); border-bottom: 1px solid #ecdcae; padding: .45rem 1rem; font-size: .9rem; }
.wmp-viewas-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; max-width: var(--wmp-content-max); }
.wmp-viewas .form-select { width: auto; min-width: 12rem; max-width: 100%; min-height: 2.25rem; }
@media (min-width: 992px) { .wmp-viewas { padding: .45rem 2rem; } }

/* Tech: tap targets (>= 44px), callouts, notes */
.wmp-tap { min-height: 44px; display: inline-flex; align-items: center; }
/* Address → maps app: underlined, 44px tall tap target */
.wmp-maps-link {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; color: var(--wmp-navy-600);
  text-decoration: underline; text-decoration-color: rgba(27, 58, 102, .35); text-underline-offset: 3px; font-style: normal;
}
.wmp-maps-link:hover { text-decoration-color: currentColor; }
@media print { .wmp-maps-link { color: inherit; text-decoration: none; min-height: 0; } }
.wmp-tap-sm { min-height: 2.25rem; min-width: 2.75rem; }
.wmp-btn-xl { --bs-btn-padding-y: 1rem; --bs-btn-font-size: 1.15rem; }
.wmp-callout { display: flex; align-items: flex-start; gap: .65rem; padding: .8rem 1rem; border-radius: var(--wmp-radius-sm); border: 1px solid transparent; }
.wmp-callout > .bi { font-size: 1.15rem; line-height: 1.3; }
.wmp-callout--attention { background: var(--wmp-attention-050); border-color: #f6d3a8; color: #8a4c06; }
.wmp-callout--attention > .bi { color: var(--wmp-attention); }
.wmp-callout--info { background: var(--wmp-info-050); border-color: #c9daf7; }
.wmp-callout--info > .bi { color: var(--wmp-info); }
.wmp-callout--completed { background: var(--wmp-completed-050); border-color: #bfe5cf; }
.wmp-callout--completed > .bi { color: var(--wmp-completed); }
.wmp-section-title.is-attention { color: var(--wmp-attention); }
.wmp-note { padding: .75rem 1rem; border-radius: var(--wmp-radius-sm); background: #f8f9fc; border: 1px solid var(--wmp-border); }
.wmp-note--client { background: var(--wmp-gold-050); border-color: #ecdcae; box-shadow: inset 4px 0 0 var(--wmp-gold); }
.wmp-note-label { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wmp-muted); margin-bottom: .2rem; }
.wmp-note--client .wmp-note-label { color: var(--wmp-gold-600); }
.wmp-detail-title { font-size: 1.2rem; font-weight: 800; color: var(--wmp-navy); margin: 0; overflow-wrap: anywhere; }
.wmp-detail-h { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wmp-muted); margin: 0 0 .4rem; }
.wmp-detail-close { align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; color: var(--wmp-muted); text-decoration: none; }
.wmp-detail-close:hover { background: var(--wmp-navy-050); color: var(--wmp-navy); }

/* Tech: task rows — outcome indicator, selection, date chip */
.wmp-task-row { min-height: 56px; }
.wmp-task-row.is-selected { background: var(--wmp-gold-050); }
.wmp-outcome { flex: 0 0 auto; font-size: 1.3rem; line-height: 1; }
.wmp-outcome--pending { color: #b5c0d0; }
.wmp-outcome--completed { color: var(--wmp-completed); }
.wmp-outcome--attention { color: var(--wmp-attention); }
.wmp-outcome--info { color: var(--wmp-info); }
.wmp-outcome--muted { color: var(--wmp-muted); }
.wmp-outcome--urgent { color: var(--wmp-urgent); }
.wmp-date-chip {
  flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: var(--wmp-radius-sm); background: var(--wmp-navy-050);
  color: var(--wmp-navy); font-weight: 800; font-size: 1rem; line-height: 1;
}
.wmp-date-chip > span { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--wmp-muted); margin-bottom: .1rem; }
.wmp-progress.wmp-progress--lg { display: block; width: 100%; height: .6rem; }

/* Tech: link tabs in the segmented control */
.wmp-segmented a {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: .4rem .5rem;
  border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--wmp-muted); text-decoration: none; white-space: nowrap;
}
.wmp-segmented a.active { background: var(--wmp-surface); color: var(--wmp-navy); box-shadow: var(--wmp-shadow); }

/* Tech: sticky action bar (above the bottom tab bar on phones) */
.wmp-actionbar {
  position: sticky; bottom: calc(var(--wmp-tabbar-height) + var(--wmp-safe-bottom)); z-index: 1010;
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin: 1rem -1rem 0; padding: .75rem 1rem;
  background: rgba(244, 246, 250, .97); border-top: 1px solid var(--wmp-border); backdrop-filter: blur(6px);
}
.wmp-actionbar-link { min-height: 44px; display: inline-flex; align-items: center; margin-left: auto; }
.wmp-actionbar > .d-grid { min-width: 12rem; }
/* A row of secondary links under the buttons (Photos / Observations / Property Info). */
.wmp-actionbar-links { display: flex; flex-wrap: wrap; justify-content: flex-end; column-gap: .25rem; flex: 1 1 100%; }
.wmp-actionbar-links > .wmp-actionbar-link { margin-left: 0; padding-left: .5rem; padding-right: .5rem; }
@media (min-width: 992px) {
  .wmp-actionbar { bottom: 0; margin: 1rem 0 0; border: 1px solid var(--wmp-border); border-radius: var(--wmp-radius); }
}

/* Tech: task detail — phones show only the task; from 992px the list stays on the left */
@media (max-width: 991.98px) {
  .wmp-two-pane.is-detail > .wmp-pane-list { display: none; }
  .wmp-two-pane.is-detail > .wmp-pane-detail { display: block; }
}
.wmp-start { max-width: 640px; }

/* Admin: stat tiles & activity */
.wmp-stat .wmp-stat-value { font-size: 1.9rem; font-weight: 800; color: var(--wmp-navy); line-height: 1.1; }
.wmp-stat .wmp-stat-label { font-size: .85rem; color: var(--wmp-muted); }
.wmp-activity { list-style: none; margin: 0; padding: 0; }
.wmp-activity li { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; }
.wmp-activity li + li { border-top: 1px solid var(--wmp-border); }
.wmp-activity .bi { font-size: 1.15rem; }
.wmp-activity .tone-completed { color: var(--wmp-completed); }
.wmp-activity .tone-info { color: var(--wmp-info); }
.wmp-activity .tone-urgent { color: var(--wmp-urgent); }
.wmp-activity .tone-attention { color: var(--wmp-attention); }
.wmp-activity .tone-navy { color: var(--wmp-navy); }
.wmp-activity .tone-muted { color: var(--wmp-muted); }
.wmp-activity-summary { font-size: .9rem; overflow-wrap: anywhere; }
.wmp-activity-summary a:hover { text-decoration: underline !important; }

/* ---------- Admin dashboard (Stage 15): tile links, Needs attention, today's visits by technician, settings ---------- */
.wmp-stat-main { display: block; color: inherit; text-decoration: none; }
.wmp-stat-main:hover .wmp-stat-value { text-decoration: underline; }
.wmp-stat-sub { display: inline-block; margin-top: .2rem; font-size: .8rem; font-weight: 600; text-decoration: none; }
.wmp-stat-sub--urgent { color: var(--wmp-urgent); }
.wmp-stat-sub--completed { color: var(--wmp-completed); }
.wmp-stat-sub--muted { color: var(--wmp-muted); font-weight: 400; }
.wmp-attention { list-style: none; margin: 0; padding: 0; }
.wmp-attention > li { display: flex; align-items: flex-start; gap: .75rem; padding: .85rem 1rem; }
.wmp-attention > li + li { border-top: 1px solid var(--wmp-border); }
.wmp-attention-examples { list-style: none; margin: .35rem 0 .25rem; padding: 0; font-size: .85rem; }
.wmp-attention-examples li { padding: .1rem 0; overflow-wrap: anywhere; }
.wmp-attention-examples a { font-weight: 600; text-decoration: none; }
.wmp-attention-clear { align-items: center !important; color: var(--wmp-muted); font-size: .9rem; }
.wmp-tech-day + .wmp-tech-day { border-top: 1px solid var(--wmp-border); }
.wmp-tech-day-head { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem .25rem; }
.wmp-tech-day-visits { list-style: none; margin: 0; padding: 0 1rem .5rem; }
.wmp-tech-day-visits li { display: flex; align-items: center; gap: .75rem; padding: .5rem 0 .5rem 2.25rem; }
.wmp-tech-day-visits li + li { border-top: 1px dashed var(--wmp-border); }
.wmp-settings { margin: 0; }
.wmp-settings > div { display: grid; grid-template-columns: minmax(8rem, 38%) 1fr; gap: .25rem 1rem; padding: .6rem 1rem; }
.wmp-settings > div + div { border-top: 1px solid var(--wmp-border); }
.wmp-settings dt { font-weight: 600; font-size: .875rem; color: var(--wmp-muted); }
.wmp-settings dd { margin: 0; min-width: 0; }
@media (max-width: 575.98px) {
  .wmp-settings > div { grid-template-columns: 1fr; }
  .wmp-tech-day-visits li { padding-left: 0; }
}

/* Admin: data tables */
.wmp-table { margin: 0; --bs-table-bg: transparent; }
.wmp-table > :not(caption) > * > * { padding: .7rem 1rem; vertical-align: middle; }
.wmp-table thead th { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wmp-muted); background: #f8f9fc; }
.wmp-table tbody tr:last-child > * { border-bottom: 0; }
.wmp-table a.wmp-row-link { font-weight: 600; text-decoration: none; }

/* Empty states */
.wmp-empty { text-align: center; padding: 3rem 1.5rem; color: var(--wmp-muted); }
.wmp-empty .bi { font-size: 2.5rem; color: #b5c0d0; }

.min-w-0 { min-width: 0; }

/* =========================================================================
   Admin patterns (Stage 4) — page header, filters, stacked tables, tabs, pager
   ========================================================================= */
/* <wmp-page-header>: breadcrumbs, title + badge, actions */
.wmp-page-head { margin-bottom: 1rem; }
.wmp-breadcrumb { --bs-breadcrumb-margin-bottom: .35rem; --bs-breadcrumb-divider-color: #a3aec0; --bs-breadcrumb-item-active-color: var(--wmp-muted); font-size: .85rem; flex-wrap: wrap; }
.wmp-breadcrumb a { text-decoration: none; }
.wmp-breadcrumb .breadcrumb-item { min-width: 0; overflow-wrap: anywhere; }
.wmp-page-head-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.wmp-page-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: 1.4rem; font-weight: 800; color: var(--wmp-navy); margin: 0; overflow-wrap: anywhere; }
.wmp-page-sub { color: var(--wmp-muted); margin: .2rem 0 0; }
.wmp-page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 575.98px) {
  .wmp-page-actions { width: 100%; }
  .wmp-page-actions > .btn, .wmp-page-actions > form { flex: 1 1 auto; }
  .wmp-page-actions > form > .btn { width: 100%; }
}

/* Card header with a title and an action */
.wmp-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--wmp-border); }
.wmp-card-head h2, .wmp-card-head h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.wmp-card-foot { padding: .65rem 1rem; border-top: 1px solid var(--wmp-border); background: var(--wmp-navy-050); border-radius: 0 0 var(--wmp-radius) var(--wmp-radius); }

/* Stacked tables: below 768px each row becomes a card; cells show their data-label. No horizontal scrolling. */
@media (max-width: 767.98px) {
  .wmp-table--stack thead { display: none; }
  .wmp-table--stack, .wmp-table--stack tbody, .wmp-table--stack tr, .wmp-table--stack td { display: block; width: 100%; }
  .wmp-table--stack tbody tr { padding: .75rem 1rem; border-bottom: 1px solid var(--wmp-border); }
  .wmp-table--stack tbody tr:last-child { border-bottom: 0; }
  .wmp-table--stack > :not(caption) > * > * { padding: .2rem 0; border-bottom: 0; }
  .wmp-table--stack td[data-label] { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; text-align: right; }
  .wmp-table--stack td[data-label]::before { content: attr(data-label); flex: 0 0 auto; color: var(--wmp-muted); font-size: .85rem; font-weight: 500; text-align: left; }
  .wmp-table--stack td.wmp-cell-primary { font-size: 1.02rem; padding-bottom: .4rem; }
}

/* Tabs whose active tab is in the URL (?tab=); the strip scrolls sideways on phones, the page doesn't. */
.wmp-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; margin-bottom: 1rem; }
.wmp-tabs::-webkit-scrollbar { display: none; }
.wmp-tabs .nav-link { white-space: nowrap; color: var(--wmp-muted); font-weight: 600; }
.wmp-tabs .nav-link.active { color: var(--wmp-navy); background: var(--wmp-surface); }
.wmp-tab-count { display: inline-block; min-width: 1.4rem; margin-left: .3rem; padding: 0 .4rem; border-radius: 999px; background: var(--wmp-navy-050); color: var(--wmp-navy-600); font-size: .75rem; text-align: center; }

/* Pager */
.wmp-pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 1rem; }
.wmp-pager .pagination { --bs-pagination-active-bg: var(--wmp-navy); --bs-pagination-active-border-color: var(--wmp-navy); --bs-pagination-color: var(--wmp-navy-600); }

/* Masked secrets (gate / lockbox codes) */
.wmp-secret { font-family: var(--bs-font-monospace); letter-spacing: .05em; }

.wmp-empty--compact { padding: 1.75rem 1rem; }
.wmp-empty--compact .bi { font-size: 1.75rem; }

.wmp-prewrap { white-space: pre-line; overflow-wrap: anywhere; }
.wmp-list-plain { list-style: none; margin: 0; padding: 0; }
.wmp-list-plain > li { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; }
.wmp-list-plain > li + li { border-top: 1px solid var(--wmp-border); }

/* =========================================================================
   Tasks (Stage 6) — recurrence panel in the form, history on the detail page
   ========================================================================= */
.wmp-subpanel { margin: 0; padding: .25rem 1rem 1rem; border: 1px solid var(--wmp-border); border-radius: var(--wmp-radius-sm); background: var(--wmp-navy-050); }
.wmp-history { list-style: none; margin: 0; padding: 0; }
.wmp-history > li { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1rem; }
.wmp-history > li + li { border-top: 1px solid var(--wmp-border); }
.wmp-history-icon {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--wmp-navy-050); color: var(--wmp-navy-600);
}

/* =========================================================================
   Property info (Stage 5) — admin tab rows, property sheet, print
   ========================================================================= */
.wmp-info-row { flex-wrap: wrap; align-items: flex-start !important; }
.wmp-info-group { padding: .5rem 1rem; background: #f8f9fc; border-top: 1px solid var(--wmp-border); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wmp-muted); }
.wmp-row-actions { display: flex; gap: .25rem; flex: 0 0 auto; }
.wmp-row-actions form { margin: 0; }
.wmp-row-actions .btn { --bs-btn-padding-x: .45rem; --bs-btn-padding-y: .2rem; }
@media (max-width: 575.98px) {
  .wmp-row-actions { width: 100%; justify-content: flex-end; }
}

/* Read-only property sheet (PropertySheet view component): one column on phones, two from 992px, one when printed. */
.wmp-sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.wmp-sheet-title { font-size: 1.35rem; font-weight: 800; color: var(--wmp-navy); margin: 0; overflow-wrap: anywhere; }
.wmp-sheet-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) {
  .wmp-sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .wmp-sheet-wide { grid-column: 1 / -1; }
}
.wmp-sheet-h { display: flex; align-items: center; gap: .5rem; font-size: 1rem; font-weight: 700; margin: 0; padding: .85rem 1rem; }
.wmp-sheet-h .bi { color: var(--wmp-navy-600); }
.wmp-sheet-section .wmp-dl dt { flex-basis: 9rem; }
.wmp-sheet-section .wmp-list-plain { border-top: 1px solid var(--wmp-border); }
.wmp-sheet-group { padding: .4rem 1rem; background: #f8f9fc; border-top: 1px solid var(--wmp-border); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--wmp-muted); }
.wmp-sheet-empty { margin: 0; padding: .75rem 1rem; border-top: 1px solid var(--wmp-border); color: var(--wmp-muted); }

/* Visits (Stage 7): day headers, small avatar, progress bar, task picker rows, a visit's ordered task list */
.wmp-avatar--sm { width: 1.75rem; height: 1.75rem; font-size: .68rem; }
.wmp-day-head { display: flex; align-items: center; gap: .4rem; font-size: .95rem; font-weight: 700; color: var(--wmp-navy); margin: 0 0 .5rem; }
.wmp-day-head.is-today { color: var(--wmp-gold-600); }
.wmp-progress { display: inline-block; width: 4.5rem; height: .4rem; border-radius: 999px; background: var(--wmp-navy-050); overflow: hidden; vertical-align: middle; }
.wmp-progress > span { display: block; height: 100%; background: var(--wmp-completed); }
/* Bar widths as classes (VisitDisplay.PercentClass): the Content-Security-Policy allows no inline style attributes. */
.wmp-progress > .wmp-pct-0 { width: 0%; }
.wmp-progress > .wmp-pct-5 { width: 5%; }
.wmp-progress > .wmp-pct-10 { width: 10%; }
.wmp-progress > .wmp-pct-15 { width: 15%; }
.wmp-progress > .wmp-pct-20 { width: 20%; }
.wmp-progress > .wmp-pct-25 { width: 25%; }
.wmp-progress > .wmp-pct-30 { width: 30%; }
.wmp-progress > .wmp-pct-35 { width: 35%; }
.wmp-progress > .wmp-pct-40 { width: 40%; }
.wmp-progress > .wmp-pct-45 { width: 45%; }
.wmp-progress > .wmp-pct-50 { width: 50%; }
.wmp-progress > .wmp-pct-55 { width: 55%; }
.wmp-progress > .wmp-pct-60 { width: 60%; }
.wmp-progress > .wmp-pct-65 { width: 65%; }
.wmp-progress > .wmp-pct-70 { width: 70%; }
.wmp-progress > .wmp-pct-75 { width: 75%; }
.wmp-progress > .wmp-pct-80 { width: 80%; }
.wmp-progress > .wmp-pct-85 { width: 85%; }
.wmp-progress > .wmp-pct-90 { width: 90%; }
.wmp-progress > .wmp-pct-95 { width: 95%; }
.wmp-progress > .wmp-pct-100 { width: 100%; }
.wmp-pick-row { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1rem; margin: 0; cursor: pointer; }
.wmp-pick-row:hover { background: var(--wmp-navy-050); }
.wmp-pick-row .form-check-input { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; margin-top: .1rem; }
.wmp-pick-row.is-high { box-shadow: inset 3px 0 0 var(--wmp-urgent); }
.wmp-visit-tasks { list-style: none; margin: 0; padding: 0; }
.wmp-visit-tasks > li { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1rem; scroll-margin-top: 5rem; }
.wmp-visit-tasks > li + li { border-top: 1px solid var(--wmp-border); }
.wmp-visit-tasks > li.is-high { box-shadow: inset 3px 0 0 var(--wmp-urgent); }
.wmp-visit-tasks > li:target { background: var(--wmp-gold-050); }
.wmp-visit-task-no {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--wmp-navy-050); color: var(--wmp-navy-600); font-size: .8rem; font-weight: 700;
}
@media (max-width: 575.98px) {
  .wmp-visit-tasks > li { flex-wrap: wrap; }
  .wmp-visit-tasks > li > .flex-grow-1 { flex: 1 1 0; }
  .wmp-visit-tasks .wmp-row-actions { width: 100%; justify-content: flex-end; }
}

/* =========================================================================
   Outcomes & Finish Visit (Stage 9)
   ========================================================================= */
/* Task list rows: <li class="wmp-task-item" id="vt-…"> = optional quick-complete form + the row link */
.wmp-task-item { display: flex; align-items: stretch; scroll-margin-top: calc(var(--wmp-appbar-height) + 1rem); }
.wmp-task-item > .wmp-task-row { flex: 1 1 auto; min-width: 0; }
.wmp-task-item.is-high { box-shadow: inset 3px 0 0 var(--wmp-urgent); }
.wmp-task-item.is-selected, .wmp-task-item:target { background: var(--wmp-gold-050); }
.wmp-task-row.has-check { padding-left: .25rem; }
.wmp-quick-done { display: flex; align-items: center; margin: 0; padding-left: .5rem; }
.wmp-check-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; }
.wmp-check-btn .bi {
  display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem;
  border: 2px solid #b5c0d0; border-radius: 50%; color: transparent; font-size: 1.05rem; transition: color .15s, border-color .15s, background .15s;
}
.wmp-check-btn.is-high .bi { border-color: var(--wmp-urgent); }
.wmp-check-btn:hover .bi, .wmp-check-btn:focus-visible .bi { border-color: var(--wmp-completed); color: var(--wmp-completed); }
.wmp-check-btn:focus-visible { outline: 2px solid var(--wmp-navy-600); outline-offset: -2px; }
.wmp-check-btn:disabled .bi { background: var(--wmp-completed); border-color: var(--wmp-completed); color: #fff; }
.wmp-check-btn .spinner-border { display: none; }

/* Task detail: Frequency / Next due, inset tabs, outcome radio cards */
.wmp-info-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: .75rem 1rem; border-top: 1px solid var(--wmp-border); }
.wmp-info-pair-label { font-size: .8rem; color: var(--wmp-muted); }
.wmp-segmented--inset { margin: 0 1rem .25rem; }
.wmp-segmented--inset button { min-height: 44px; }
.wmp-outcome-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.wmp-outcome-option {
  display: flex; align-items: center; gap: .5rem; min-height: 52px; margin: 0; padding: .55rem .75rem;
  border: 2px solid var(--wmp-border); border-radius: var(--wmp-radius-sm); background: var(--wmp-surface);
  font-weight: 600; line-height: 1.2; cursor: pointer; user-select: none;
}
.wmp-outcome-option:first-of-type { grid-column: 1 / -1; }
.wmp-outcome-option .bi { flex: 0 0 auto; font-size: 1.3rem; }
.wmp-outcome-option--completed .bi { color: var(--wmp-completed); }
.wmp-outcome-option--attention .bi { color: var(--wmp-attention); }
.wmp-outcome-option--info .bi { color: var(--wmp-info); }
.wmp-outcome-option--muted .bi { color: var(--wmp-muted); }
.wmp-outcome-option:hover { border-color: #c5cfdd; }
.btn-check:checked + .wmp-outcome-option--completed { background: var(--wmp-completed-050); border-color: var(--wmp-completed); }
.btn-check:checked + .wmp-outcome-option--attention { background: var(--wmp-attention-050); border-color: var(--wmp-attention); }
.btn-check:checked + .wmp-outcome-option--info { background: var(--wmp-info-050); border-color: var(--wmp-info); }
.btn-check:checked + .wmp-outcome-option--muted { background: #edf0f4; border-color: var(--wmp-muted); }
.btn-check:focus-visible + .wmp-outcome-option { outline: 2px solid var(--wmp-navy-600); outline-offset: 2px; }

/* Finish Visit review */
.wmp-icon-tile--sm { width: 2rem; height: 2rem; border-radius: .5rem; font-size: 1rem; }
.wmp-review-list > li { padding: .55rem 1rem; }
.wmp-review-list > li.is-zero { color: var(--wmp-muted); }

/* Toast (TempData[Alerts.Toast]): fades out by itself, no JS */
.wmp-toast {
  position: fixed; left: 50%; bottom: calc(var(--wmp-tabbar-height) + var(--wmp-safe-bottom) + 5.5rem); z-index: 1090;
  display: flex; align-items: center; gap: .5rem; width: max-content; max-width: calc(100vw - 2rem); padding: .6rem 1.1rem; border-radius: 999px;
  background: var(--wmp-navy); color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(16, 41, 75, .25);
  pointer-events: none; transform: translateX(-50%); animation: wmp-toast 3.5s ease forwards;
}
.wmp-toast .bi { color: #7fd6a2; }
@keyframes wmp-toast {
  0% { opacity: 0; transform: translate(-50%, .5rem); }
  8%, 82% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; visibility: hidden; transform: translate(-50%, 0); }
}
@media (min-width: 992px) { .wmp-toast { bottom: 6rem; } }

/* =========================================================================
   Photos (Stage 10) — thumbnail grid, uploader + queue, lightbox
   ========================================================================= */
.wmp-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; list-style: none; margin: 0; padding: 0; }
@media (min-width: 768px) { .wmp-photo-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .65rem; } }
.wmp-photo { min-width: 0; }
.wmp-photo-frame { position: relative; aspect-ratio: 1 / 1; border-radius: var(--wmp-radius-sm); overflow: hidden; background: var(--wmp-navy-050); }
.wmp-photo-link { display: block; width: 100%; height: 100%; }
.wmp-photo-link img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .15s; }
.wmp-photo-link:focus-visible { outline: 3px solid var(--wmp-gold); outline-offset: -3px; }
.wmp-photo.is-hidden .wmp-photo-link img { opacity: .5; }
.wmp-photo-kind {
  position: absolute; left: .3rem; bottom: .3rem; padding: .1rem .45rem; border-radius: 999px; pointer-events: none;
  font-size: .68rem; font-weight: 700; letter-spacing: .02em; color: #fff; background: rgba(16, 41, 75, .78);
}
.wmp-photo-kind--before { background: rgba(169, 131, 31, .92); }
.wmp-photo-kind--after { background: rgba(46, 158, 91, .92); }
.wmp-photo-actions { position: absolute; top: .3rem; right: .3rem; display: flex; gap: .3rem; }
.wmp-photo-actions form { margin: 0; }
.wmp-photo-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0;
  border: 0; border-radius: 50%; background: rgba(16, 41, 75, .78); color: #fff; font-size: 1rem;
}
.wmp-photo-btn:hover, .wmp-photo-btn:focus-visible { background: var(--wmp-navy); }
.wmp-photo-btn:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.wmp-photo-btn.is-on { background: var(--wmp-completed); }
.wmp-photo-btn:disabled { opacity: .6; }
.wmp-photo-meta { font-size: .75rem; color: var(--wmp-muted); margin-top: .2rem; }
.wmp-photo-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; aspect-ratio: 1 / 1; margin: 0;
  border: 2px dashed #b5c0d0; border-radius: var(--wmp-radius-sm); background: var(--wmp-surface);
  color: var(--wmp-navy-600); font-size: .85rem; font-weight: 600; cursor: pointer; text-align: center;
}
.wmp-photo-add .bi { font-size: 1.6rem; }
.wmp-photo-add:hover { border-color: var(--wmp-navy-600); background: var(--wmp-navy-050); }

/* Uploader: the file inputs are opened by their labels (Take Photo / Choose from library / Add Photo tiles). */
.wmp-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
/* Keyboard focus on a hidden input shows on its button. */
.wmp-uploader:has(#photoCamera:focus-visible) label[for="photoCamera"],
.wmp-uploader:has(#photoLibrary:focus-visible) label[for="photoLibrary"] { outline: 3px solid var(--wmp-gold); outline-offset: 2px; }
.wmp-segmented--radio .btn-check + label {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: .4rem .5rem;
  border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--wmp-muted); cursor: pointer;
}
.wmp-segmented--radio .btn-check:checked + label { background: var(--wmp-surface); color: var(--wmp-navy); box-shadow: var(--wmp-shadow); }
.wmp-segmented--radio .btn-check:focus-visible + label { outline: 2px solid var(--wmp-navy-600); outline-offset: 1px; }
.wmp-upload-queue { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .5rem; }
.wmp-upload-queue:empty { display: none; }
.wmp-upload-item { display: flex; align-items: center; gap: .65rem; padding: .5rem; border: 1px solid var(--wmp-border); border-radius: var(--wmp-radius-sm); background: var(--wmp-surface); }
.wmp-upload-item > img { flex: 0 0 auto; width: 3rem; height: 3rem; object-fit: cover; border-radius: .4rem; background: var(--wmp-navy-050); }
.wmp-upload-item .progress { height: .35rem; }
.wmp-upload-item .progress-bar { background: var(--wmp-navy-600); transition: width .2s; }
.wmp-upload-item.is-done .progress-bar { background: var(--wmp-completed); }
.wmp-upload-item.is-done [data-status] { color: var(--wmp-completed); font-weight: 600; }
.wmp-upload-item.is-failed { border-color: #f1b9b9; background: var(--wmp-urgent-050); }
.wmp-upload-item.is-failed [data-status] { color: var(--wmp-urgent); }
.wmp-upload-item.is-failed .progress { display: none; }

/* Lightbox (_PhotoLightbox): full screen, dark, prev / next, swipe */
.wmp-lightbox .modal-content { background: #0b1220; color: #fff; border: 0; }
.wmp-lightbox-bar { display: flex; align-items: center; gap: .25rem; padding: .5rem .5rem 0 1rem; padding-top: max(.5rem, env(safe-area-inset-top, 0px)); }
.wmp-lightbox-count { flex: 1 1 auto; font-size: .9rem; color: rgba(255, 255, 255, .75); }
.wmp-lightbox-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: none; color: #fff; font-size: 1.25rem; text-decoration: none;
}
.wmp-lightbox-btn:hover, .wmp-lightbox-btn:focus-visible { background: rgba(255, 255, 255, .12); color: #fff; }
.wmp-lightbox-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: .5rem; touch-action: pan-y pinch-zoom; }
.wmp-lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.wmp-lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.4rem;
}
.wmp-lightbox-nav:hover, .wmp-lightbox-nav:focus-visible { background: rgba(0, 0, 0, .7); }
.wmp-lightbox-nav.is-prev { left: .5rem; }
.wmp-lightbox-nav.is-next { right: .5rem; }
.wmp-lightbox-caption { padding: .5rem 1rem; padding-bottom: max(.75rem, env(safe-area-inset-bottom, 0px)); text-align: center; font-size: .95rem; overflow-wrap: anywhere; }
@media (min-width: 992px) { .wmp-lightbox-nav.is-prev { left: 1.5rem; } .wmp-lightbox-nav.is-next { right: 1.5rem; } }

/* Admin: property Photos filter */
.wmp-pills { --bs-nav-pills-link-active-bg: var(--wmp-navy); --bs-nav-link-color: var(--wmp-navy-600); --bs-nav-link-hover-color: var(--wmp-navy); gap: .25rem; }
.wmp-pills .nav-link { padding: .35rem .85rem; font-weight: 600; font-size: .9rem; }

/* =========================================================================
   Client portal (Stage 12) — home summary strip, service reports list, report
   ========================================================================= */
.wmp-client-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .5rem; }
.wmp-client-stat-link { display: flex; flex-direction: column; gap: .1rem; height: 100%; padding: .75rem .85rem; color: inherit; text-decoration: none; min-width: 0; }
a.wmp-client-stat-link:hover { background: var(--wmp-navy-050); border-radius: inherit; }
.wmp-client-stat-label { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wmp-muted); }
.wmp-client-stat-value { font-size: 1.25rem; font-weight: 800; color: var(--wmp-navy); line-height: 1.2; }
.wmp-client-stat-sub { font-size: .78rem; line-height: 1.25; color: var(--wmp-muted); overflow-wrap: anywhere; }
@media (min-width: 768px) { .wmp-client-strip { gap: 1rem; } .wmp-client-stat-link { padding: 1rem 1.25rem; } .wmp-client-stat-value { font-size: 1.6rem; } }

.wmp-report-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.wmp-report-list > li + li { border-top: 1px solid var(--wmp-border); }
.wmp-report-head { display: none; }
.wmp-report-row { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; align-items: center; gap: .85rem; padding: .7rem 1rem; color: inherit; text-decoration: none; min-height: 56px; }
.wmp-report-row:hover { background: var(--wmp-navy-050); }
.wmp-report-row > .bi-chevron-right { color: #a3aec0; }
.wmp-report-thumb { display: flex; align-items: center; justify-content: center; width: 4rem; height: 3rem; border-radius: var(--wmp-radius-sm); overflow: hidden; background: var(--wmp-navy-050); color: #a3aec0; font-size: 1.3rem; }
.wmp-report-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wmp-report-text { display: flex; flex-direction: column; min-width: 0; font-size: .85rem; color: var(--wmp-muted); }
.wmp-report-date { font-size: 1rem; font-weight: 700; color: var(--wmp-navy); }
.wmp-report-none { display: none; }
@media (min-width: 768px) {
  .wmp-report-head, .wmp-report-row { grid-template-columns: 4.5rem minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 1rem; }
  .wmp-report-head { display: grid; gap: .85rem; padding: .55rem 1rem; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wmp-muted); background: #f8f9fc; }
  .wmp-report-thumb { width: 4.5rem; height: 3.25rem; }
  .wmp-report-text { display: contents; font-size: .9rem; }
  .wmp-report-none { display: inline; }
}

.wmp-report-hero { border-radius: var(--wmp-radius); overflow: hidden; background: var(--wmp-navy-050); aspect-ratio: 16 / 9; max-height: 340px; width: 100%; }
.wmp-report-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wmp-report-hero-empty { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 3rem; color: #a3aec0; }
.wmp-report-summary { padding: 1rem 0 0; }
.wmp-report-tasks { list-style: none; margin: 0; padding: 0; }
.wmp-report-tasks > li { padding: .75rem 1rem; }
.wmp-report-tasks > li + li { border-top: 1px solid var(--wmp-border); }
.wmp-report-print-head { align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 4mm; margin-bottom: 4mm; border-bottom: 2px solid var(--wmp-navy); font-weight: 700; color: var(--wmp-navy); }
@media (min-width: 992px) { .wmp-report-hero { max-height: 380px; } }

@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; font-size: 11pt; }
  .wmp-sidebar, .wmp-topbar, .wmp-appbar, .wmp-tabbar, .wmp-no-print, .modal, .alert-success, .alert-danger { display: none !important; }
  .wmp-admin, .wmp-app { display: block !important; min-height: 0; }
  .wmp-admin .wmp-admin-content, .wmp-content { padding: 0 !important; max-width: none !important; }
  .wmp-sheet-grid { display: block !important; }
  .wmp-sheet-grid > * { margin-bottom: 4mm; }
  .wmp-card { box-shadow: none !important; border-color: #bbb !important; break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
  .wmp-icon-tile { width: auto; height: auto; background: none !important; }
  /* Client visit report: one column, a smaller hero, photos two per row. */
  .wmp-report-cols > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .wmp-report-hero { max-height: 70mm; aspect-ratio: auto; height: 70mm; }
  .wmp-report-photos .wmp-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 4mm; }
  .wmp-report-photos .wmp-photo-frame { aspect-ratio: 4 / 3; break-inside: avoid; }
  .wmp-report-photos .wmp-photo { break-inside: avoid; }
  .wmp-report-photos .wmp-photo-kind { color: #000 !important; background: #fff !important; border: 1px solid #999; }
}
@media (max-width: 575.98px) {
  .wmp-sheet-section .wmp-dl > div { flex-direction: column; gap: .1rem; }
  .wmp-sheet-section .wmp-dl dt { flex-basis: auto; font-size: .85rem; }
}

/* ---------- "Internal" badge (_InternalBadge): text only WMP staff can see (Stage 13) ---------- */
.wmp-badge--internal {
  background: var(--wmp-gold-050); color: var(--wmp-gold-600); border: 1px solid #efe2bb;
  font-size: .7rem; padding: .1rem .45rem; vertical-align: middle; cursor: help;
}
/* "Visible to client" badge (text the client will read: request responses) */
.wmp-badge--client-visible { background: var(--wmp-info-050); color: var(--wmp-info); font-size: .7rem; padding: .1rem .45rem; vertical-align: middle; }

/* ---------- Client requests (Stage 13) ---------- */
.wmp-request-list { list-style: none; margin: 0 0 1rem; padding: 0; overflow: hidden; }
.wmp-request-list > li + li { border-top: 1px solid var(--wmp-border); }
.wmp-request-row { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; align-items: center; gap: .85rem; padding: .75rem 1rem; color: inherit; text-decoration: none; min-height: 56px; }
.wmp-request-row:hover { background: var(--wmp-navy-050); }
.wmp-request-text { display: flex; flex-direction: column; min-width: 0; }
.wmp-request-title { font-weight: 700; overflow-wrap: anywhere; }
.wmp-request-response { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 575.98px) { .wmp-request-new { width: 100%; } }

/* Status timeline (client request detail) */
.wmp-timeline { list-style: none; margin: 0; padding: 0; }
.wmp-timeline > li { position: relative; display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; gap: .65rem; padding: .35rem 0; color: var(--wmp-muted); }
.wmp-timeline > li + li::before { content: ""; position: absolute; left: calc(1rem - 1px); top: -.6rem; height: 1rem; border-left: 2px solid var(--wmp-border); }
.wmp-timeline > li.is-done + li.is-done::before { border-color: var(--wmp-completed); }
.wmp-timeline-dot { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: #edf0f4; font-size: .9rem; }
.wmp-timeline > li.is-done { color: var(--wmp-text); }
.wmp-timeline > li.is-done .wmp-timeline-dot { background: var(--wmp-completed-050); color: var(--wmp-completed); }
.wmp-timeline-label { font-weight: 600; }
.wmp-timeline-date { font-size: .85rem; color: var(--wmp-muted); text-align: right; }

/* Admin request queue cards */
.wmp-request-card .wmp-request-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Nav badges in the bottom tab bar (client: unread messages) sit on the icon. */
.wmp-tabbar a { position: relative; }
.wmp-tabbar .wmp-nav-badge { position: absolute; top: 6px; left: calc(50% + 4px); margin: 0; }

/* =========================================================================
   Messages (Stage 14) — _MessageThread: bubbles, date separators, composer
   ========================================================================= */
.wmp-thread { display: flex; flex-direction: column; }
.wmp-thread-page { max-width: 760px; margin: 0 auto; }
.wmp-thread-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.wmp-thread-earlier { display: flex; justify-content: center; margin: 0 0 1rem; }
.wmp-thread-items + .wmp-thread-earlier { margin: 1rem 0 0; }
.wmp-thread-day { display: flex; align-items: center; gap: .75rem; margin: .5rem 0 0; font-size: .75rem; font-weight: 700; color: var(--wmp-muted); text-transform: uppercase; letter-spacing: .04em; }
.wmp-thread-day::before, .wmp-thread-day::after { content: ""; flex: 1 1 0; border-top: 1px solid var(--wmp-border); }
.wmp-msg { display: flex; flex-direction: column; max-width: min(85%, 34rem); }
.wmp-msg.is-left { align-self: flex-start; align-items: flex-start; }
.wmp-msg.is-right { align-self: flex-end; align-items: flex-end; }
.wmp-msg-meta { display: flex; gap: .4rem; align-items: baseline; padding: 0 .4rem .15rem; font-size: .75rem; color: var(--wmp-muted); }
.wmp-msg-sender { font-weight: 700; color: var(--wmp-text); }
.wmp-msg-bubble { padding: .6rem .85rem; border-radius: 1.1rem; box-shadow: var(--wmp-shadow); min-width: 0; max-width: 100%; }
.wmp-msg.is-left .wmp-msg-bubble { background: var(--wmp-surface); border: 1px solid var(--wmp-border); border-top-left-radius: .35rem; }
.wmp-msg.is-right .wmp-msg-bubble { background: var(--wmp-navy); color: #fff; border-top-right-radius: .35rem; }
/* Plain text: line breaks kept, long words / URLs wrap (never auto-linked). */
.wmp-msg-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.wmp-context-chip {
  display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; margin-bottom: .35rem; padding: .15rem .55rem;
  border-radius: 999px; background: var(--wmp-info-050); color: var(--wmp-info); font-size: .75rem; font-weight: 600;
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
a.wmp-context-chip:hover { text-decoration: underline; }
.wmp-msg.is-right .wmp-context-chip { background: rgba(255, 255, 255, .16); color: #fff; }

.wmp-composer {
  position: sticky; bottom: calc(var(--wmp-tabbar-height) + var(--wmp-safe-bottom)); z-index: 1010;
  margin: 1rem -1rem 0; padding: .6rem 1rem; background: rgba(244, 246, 250, .97); border-top: 1px solid var(--wmp-border);
  backdrop-filter: blur(6px);
}
.wmp-composer-row { display: flex; align-items: flex-end; gap: .5rem; }
.wmp-composer textarea { resize: none; min-height: 44px; max-height: 40vh; border-radius: 1.4rem; padding: .6rem 1rem; line-height: 1.4; overflow-y: auto; }
.wmp-composer-send {
  flex: 0 0 44px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--wmp-navy); color: #fff; font-size: 1.05rem;
}
.wmp-composer-send:hover, .wmp-composer-send:focus-visible { background: var(--wmp-navy-600); }
.wmp-composer-send:disabled { opacity: .7; }
.wmp-composer-send .spinner-border { margin: 0 !important; }
.wmp-composer-send .spinner-border ~ .bi { display: none; }
.wmp-composer-context { display: flex; align-items: center; gap: .25rem; margin-bottom: .4rem; }
.wmp-composer-context .wmp-context-chip { margin: 0; }
.wmp-context-remove { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: var(--wmp-muted); }
.wmp-context-remove:hover { background: var(--wmp-navy-050); color: var(--wmp-navy); }
.wmp-composer-error { margin-bottom: .4rem; font-size: .85rem; color: var(--wmp-urgent); }
.wmp-thread-readonly { margin: 1rem 0 0; padding: .75rem 1rem; border-radius: var(--wmp-radius-sm); background: var(--wmp-navy-050); color: var(--wmp-muted); font-size: .9rem; }
@media (min-width: 992px) {
  .wmp-composer { bottom: 0; margin: 1rem 0 0; border: 1px solid var(--wmp-border); border-radius: var(--wmp-radius); }
}
/* Admin layout: no bottom tab bar. */
.wmp-admin .wmp-composer { bottom: 0; }
/* Embedded (admin property tab): the thread scrolls inside the card, the composer sits under it. */
.wmp-thread--embedded .wmp-thread-scroll { max-height: 60vh; overflow-y: auto; padding: 1rem; }
.wmp-thread--embedded .wmp-composer { position: static; margin: 0; border: 0; border-top: 1px solid var(--wmp-border); border-radius: 0 0 var(--wmp-radius) var(--wmp-radius); }
.wmp-thread--embedded .wmp-thread-readonly { margin: 0; border-radius: 0; }

/* Admin inbox */
.wmp-inbox { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.wmp-inbox > li + li { border-top: 1px solid var(--wmp-border); }
.wmp-inbox-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .85rem; padding: .8rem 1rem; color: inherit; text-decoration: none; }
.wmp-inbox-row:hover { background: var(--wmp-navy-050); }
.wmp-inbox-row.is-unread .wmp-inbox-property { font-weight: 800; }
.wmp-inbox-property { font-weight: 700; color: var(--wmp-navy); overflow-wrap: anywhere; }
.wmp-inbox-excerpt { grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wmp-muted); font-size: .92rem; }
.wmp-inbox-meta { display: flex; align-items: center; gap: .4rem; justify-content: flex-end; font-size: .8rem; color: var(--wmp-muted); white-space: nowrap; }
.wmp-unread-count { min-width: 1.4rem; padding: .1rem .45rem; border-radius: 999px; background: var(--wmp-info); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; }
.wmp-badge--awaiting { background: var(--wmp-attention-050); color: var(--wmp-attention); font-size: .7rem; }
@media (min-width: 768px) {
  .wmp-inbox-row { grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) auto; align-items: center; }
  .wmp-inbox-excerpt { grid-column: auto; }
}
@media print { .wmp-composer { display: none !important; } .wmp-msg-bubble { box-shadow: none; border: 1px solid #bbb !important; color: #000 !important; background: #fff !important; } }

/* =========================================================================
   Installable PWA (Stage 16b) — install banner, "new version" toast
   ========================================================================= */
.wmp-install-banner {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: var(--wmp-radius);
  background: var(--wmp-navy-050); border: 1px solid #d5dfee; color: var(--wmp-navy);
}
.wmp-install-banner-icon {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem;
  border-radius: .65rem; background: var(--wmp-navy); color: #fff; font-size: 1.2rem;
}
.wmp-install-banner .btn-close { flex: 0 0 auto; }
.wmp-update-toast {
  position: fixed; left: 50%; bottom: calc(var(--wmp-tabbar-height) + var(--wmp-safe-bottom) + 1rem); z-index: 1095;
  display: flex; align-items: center; gap: .75rem; width: max-content; max-width: calc(100vw - 2rem);
  padding: .5rem .6rem .5rem 1.1rem; border-radius: 999px; transform: translateX(-50%);
  background: var(--wmp-navy); color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(16, 41, 75, .25);
}
.wmp-admin ~ .wmp-update-toast, .wmp-auth ~ .wmp-update-toast { bottom: calc(var(--wmp-safe-bottom) + 1rem); }
@media (min-width: 992px) { .wmp-update-toast { bottom: 1.5rem; } }
@media print { .wmp-install-banner, .wmp-update-toast, .wmp-appbar-action { display: none !important; } }
