/* Self-hosted fonts (replaces Google Fonts dependency) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/fonts/fraunces-400.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/fraunces-500.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/fraunces-600.woff2') format('woff2'); }

/* M Power Mend - styles */

:root {
  --c-primary: #5b6e5a;
  --c-primary-dark: #3e4f3e;
  --c-primary-light: #8aa089;
  --c-accent: #c97b5e;
  --c-bg: #faf6ee;
  --c-warm: #f3ecdb;
  --c-surface: #ffffff;
  --c-text: #2d2a26;
  --c-muted: #5f6857;
  --c-border: #e6dfd0;
  --c-error: #b3553e;
  --c-error-bg: #fbe9e1;
  --c-ok: #4a6b48;
  --c-ok-bg: #e7efe1;
  --c-warn: #a8742d;
  --c-warn-bg: #faeed3;

  --shadow-sm: 0 1px 2px rgba(45,42,38,0.04), 0 1px 3px rgba(45,42,38,0.06);
  --shadow-md: 0 4px 6px rgba(45,42,38,0.05), 0 10px 15px rgba(45,42,38,0.08);
  --shadow-lg: 0 12px 24px rgba(45,42,38,0.08), 0 24px 48px rgba(45,42,38,0.10);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --container: 1140px;
  --narrow: 720px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--c-text);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; font-family: 'Inter', sans-serif; font-weight: 600; }

p { margin: 0 0 1em; }
a { color: var(--c-primary-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--c-accent); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: var(--narrow); }
.text-center { text-align: center; }
.muted { color: var(--c-muted); }
.small { font-size: 0.875rem; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-primary);
  margin-bottom: 0.75rem;
}

.lede {
  font-size: 1.18rem;
  line-height: 1.55;
  color: #443d35;
  margin-bottom: 1.6rem;
  max-width: 38em;
}

/* === Header === */
.site-header {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(250, 246, 238, 0.9);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  gap: 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--c-text);
  font-weight: 600;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--c-primary);
  color: var(--c-surface);
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.2rem;
}
.brand-name {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  font-weight: 500;
}
.site-header nav { display: flex; align-items: center; gap: 1.5rem; }
.site-header nav a { color: var(--c-text); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--c-primary); }
.site-header nav a.nav-cta {
  background: var(--c-primary);
  color: var(--c-surface);
  padding: 0.55rem 1rem;
  border-radius: 999px;
}
.site-header nav a.nav-cta:hover { background: var(--c-primary-dark); color: var(--c-surface); }

/* legacy 640px nav hide rule removed - see consolidated header rules below */

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, color 0.15s ease;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--c-primary); color: var(--c-surface); border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-dark); color: var(--c-surface); }
.btn-ghost { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-warm); color: var(--c-text); }
.btn-small { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-google {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border);
  padding: 0.85rem 1.6rem;
}
.btn-google:hover { background: var(--c-warm); color: var(--c-text); }

/* === Hero === */
.hero {
  padding: 4rem 0 3rem;
  background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-warm) 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: center;
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
}
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.hero-centered { padding: 6rem 0 5rem; }
.hero-centered .hero-cta { justify-content: center; }

.trust-row {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.trust-row li {
  font-size: 0.88rem;
  color: var(--c-muted);
  position: relative;
  padding-left: 1.4rem;
}
.trust-row li::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--c-primary);
  border-radius: 50%;
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
}

.hero-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}
.card-heading {
  font-weight: 600;
  margin: 0 0 1.2rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-primary);
}
.facts { margin: 0; padding: 0; }
.facts > div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--c-border);
}
.facts > div:last-child { border-bottom: none; }
.facts dt { font-weight: 600; color: var(--c-muted); font-size: 0.85rem; }
.facts dd { margin: 0; font-size: 0.95rem; }

/* === Sections === */
.section { padding: 4rem 0; }
.section-warm { background: var(--c-warm); }
.section-contact { padding: 4rem 0 5rem; background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-warm) 100%); }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}
@media (max-width: 880px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }

.card-feature {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-feature h3 { margin: 0 0 0.5rem; color: var(--c-primary-dark); }
.card-feature p { margin: 0; color: var(--c-muted); font-size: 0.96rem; }

.steps {
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  padding: 1.1rem 0 1.1rem 3rem;
  border-bottom: 1px solid var(--c-border);
  position: relative;
  font-size: 1.02rem;
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 1rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-primary);
  color: var(--c-surface);
  font-weight: 600;
  display: grid;
  place-items: center;
  font-family: 'Fraunces', serif;
}

/* === Forms === */
.contact-form { margin-top: 1.5rem; }
.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
  color: var(--c-text);
}
.field input, .field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--c-surface);
  color: var(--c-text);
  transition: border 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(91, 110, 90, 0.15);
}
.field textarea { resize: vertical; min-height: 120px; }
.field-error {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--c-error);
}
.form-error {
  background: var(--c-error-bg);
  color: var(--c-error);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}
.field.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.disclaimer { margin-top: 1rem; }

/* === Footer === */
.site-footer {
  background: var(--c-primary-dark);
  color: #d6dcd2;
  padding: 3rem 0 1.5rem;
  margin-top: 0;
}
.site-footer a { color: #f3ecdb; }
.site-footer .muted { color: #aab3a4; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; } }
.footer-brand {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  margin: 0 0 0.4rem;
  color: var(--c-surface);
}
.footer-heading {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 0.5rem;
  color: var(--c-surface);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.5rem;
}

/* === Admin === */
.admin-shell {
  min-height: 80vh;
  padding: 3rem 1.25rem;
  display: grid;
  place-items: start center;
}
.admin-shell.wide {
  display: block;
  max-width: 1100px;
  margin: 0 auto;
}
.admin-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-md);
}
.admin-card h1 { font-size: 1.6rem; margin-bottom: 0.6em; }
.admin-card .btn { width: 100%; margin: 1.5rem 0; }

.admin-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.admin-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.banner {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.banner-warn { background: var(--c-warn-bg); color: #6b4810; border: 1px solid #e9c98c; }
.banner-ok { background: var(--c-ok-bg); color: var(--c-ok); border: 1px solid #b8c9b3; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}
@media (max-width: 600px) { .stats-row { grid-template-columns: 1fr; } }
.stat {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}
.stat-num {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--c-primary-dark);
}
.stat-label { font-size: 0.85rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.1em; }

.msg-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.msg {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.msg-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.msg-meta { display: flex; align-items: center; gap: 0.6rem; }
.msg-body {
  white-space: pre-wrap;
  background: var(--c-warm);
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  margin: 0.5rem 0 1rem;
}
.msg-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pill-ok { background: var(--c-ok-bg); color: var(--c-ok); }
.pill-warn { background: var(--c-warn-bg); color: var(--c-warn); }

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

/* === Missions callout band === */
.section-callout {
  background: linear-gradient(180deg, var(--c-warm) 0%, var(--c-bg) 100%);
  padding: 3.5rem 0;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}
.section-callout h2 { margin-bottom: 0.6em; }
.section-callout .btn { margin-top: 0.5rem; }

/* === Header auth controls === */
.site-header nav a.nav-auth,
.site-header nav .nav-auth-button {
  color: #6b6155;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.site-header nav a.nav-auth:hover,
.site-header nav .nav-auth-button:hover {
  color: var(--c-primary);
  background: rgba(91, 110, 90, 0.08);
}
.site-header nav .nav-auth-form {
  display: inline-flex;
  margin: 0;
}
.site-header nav .nav-auth-button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
/* legacy 640px nav-auth rule removed */

/* Role pill (super admin) */
.role-pill {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  vertical-align: middle;
}
.role-pill-super {
  background: var(--c-primary, #5b6e5a);
  color: #faf6ee;
}

/* Role pill: admin variant */
.role-pill-admin {
  background: #d8d2c2;
  color: #4a4439;
}

/* Admin users page */
.admin-flash {
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
}
.admin-flash-ok { background: #e7efe2; color: #2f4a2c; border: 1px solid #c5d8bd; }
.admin-flash-err { background: #f7e0d8; color: #6b2e1a; border: 1px solid #e4b8a5; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--c-border, #e2dccf);
}
.admin-table th { font-weight: 600; color: #6b6155; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.btn-link-danger {
  background: none;
  border: none;
  color: #b3431a;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  text-decoration: underline;
}
.btn-link-danger:hover { color: #802a0e; }
.form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.form-row label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.form-row input, .form-row select {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--c-border, #d8d2c2);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  min-width: 240px;
}

/* Muted secondary auth link (e.g., Staff next to Client sign in) */
.site-header nav a.nav-auth-muted {
  opacity: 0.6;
  font-size: 0.85rem;
}
.site-header nav a.nav-auth-muted:hover { opacity: 1; }

/* ====================== Header v2 (skip-link, focus, mobile drawer) ====================== */

/* Skip to content - visible only on keyboard focus */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0.5rem;
  background: var(--c-primary, #5b6e5a);
  color: var(--c-surface, #faf6ee);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.5rem; }
.visually-hidden-anchor {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.visually-hidden-anchor:focus { outline: none; }

/* Universal focus-visible for keyboard users on header controls */
.site-header a:focus-visible,
.site-header button:focus-visible {
  outline: 2px solid var(--c-primary, #5b6e5a);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Hamburger toggle: hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.nav-toggle:hover { background: rgba(91, 110, 90, 0.08); }
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text, #2c2a26);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile: <=768px - show hamburger, hide nav until toggled */
@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }

  .site-header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--c-bg, #faf6ee);
    border-bottom: 1px solid var(--c-border, #e2dccf);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
  }
  .site-header nav.is-open { display: flex; }

  .site-header nav a,
  .site-header nav .nav-auth-form {
    width: 100%;
    padding: 0.85rem 0.5rem;
    border-bottom: 1px solid var(--c-border, #e2dccf);
    border-radius: 0;
    text-align: left;
  }
  .site-header nav .nav-auth-form { padding: 0; }
  .site-header nav .nav-auth-form .nav-auth-button {
    width: 100%;
    padding: 0.85rem 0.5rem;
    text-align: left;
    border-radius: 0;
  }

  /* CTA stays distinct on mobile */
  .site-header nav a.nav-cta {
    margin-top: 0.5rem;
    text-align: center;
    border-bottom: none;
    border-radius: 999px;
  }

  /* Lock body scroll while drawer open */
  body.nav-open { overflow: hidden; }

  /* Need position relative on the nav-row container so drawer anchors to it */
  .nav-row { position: relative; }
  .site-header { position: sticky; }
}

/* Destructive cue for Sign out button so it does not look identical to other links */
.site-header nav .nav-auth-signout {
  color: #8a3a1a;
}
.site-header nav .nav-auth-signout:hover {
  color: #6b2a10;
  background: rgba(138, 58, 26, 0.06);
}

/* ============== Portal Layout: sub-nav, dashboard, threads, forms ============== */

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.75rem auto 1rem;
  padding: 0.4rem;
  border-bottom: 1px solid var(--c-border, #e2dccf);
}
.admin-subnav a {
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  text-decoration: none;
  color: #6b6155;
  font-size: 0.92rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.admin-subnav a:hover { background: rgba(91, 110, 90, 0.06); color: var(--c-primary, #5b6e5a); }
.admin-subnav a.is-current { background: var(--c-primary, #5b6e5a); color: #faf6ee; }
.admin-subnav a.is-current:hover { background: var(--c-primary-dark, #4a5d4a); color: #faf6ee; }

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 1rem 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-border, #e2dccf);
}
.subnav a {
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  text-decoration: none;
  color: #6b6155;
  font-size: 0.92rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.subnav a:hover { background: rgba(91, 110, 90, 0.06); color: var(--c-primary, #5b6e5a); }
.subnav a.is-current { background: var(--c-primary, #5b6e5a); color: #faf6ee; }

.subnav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  padding: 0 0.4em;
  height: 1.4em;
  font-size: 0.75rem;
  font-weight: 700;
  background: #b3431a;
  color: #faf6ee;
  border-radius: 999px;
}

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* Forms */
.form-stack { display: flex; flex-direction: column; gap: 1rem; max-width: 780px; }
.form-stack fieldset { border: 1px solid var(--c-border, #e2dccf); border-radius: 8px; padding: 1rem 1.25rem; }
.form-stack legend { font-weight: 600; padding: 0 0.4rem; color: #4a4439; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem 1rem;
}
.form-grid label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; font-weight: 500; }
.form-grid label.grid-span-2 { grid-column: span 2; }
.form-grid input, .form-grid select, .form-grid textarea,
.form-stack textarea {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--c-border, #d8d2c2);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--c-surface, #ffffff);
}
.form-grid input:focus-visible, .form-grid select:focus-visible, .form-grid textarea:focus-visible,
.form-stack textarea:focus-visible {
  outline: 2px solid var(--c-primary, #5b6e5a);
  outline-offset: 1px;
  border-color: var(--c-primary, #5b6e5a);
}
.form-grid input:disabled { background: #f4eee0; color: #8a8275; }
.form-actions { display: flex; gap: 0.75rem; }

/* Visually hidden helper for labels */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Thread */
.thread { display: flex; flex-direction: column; gap: 0.75rem; }
.thread-msg {
  border-radius: 10px;
  padding: 0.85rem 1rem;
  max-width: 85%;
}
.thread-msg header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  align-items: baseline;
}
.thread-msg p { margin: 0; white-space: pre-wrap; word-wrap: break-word; }
.thread-client { background: #eef1ea; align-self: flex-end; }
.thread-staff { background: #f5efe2; align-self: flex-start; }
.thread-row { padding: 0.5rem; border-bottom: 1px solid var(--c-border, #e2dccf); margin: 0; }
.thread-row:last-child { border-bottom: none; }

/* Appointment cards */
.appointment-card { margin-top: 1rem; }
.appointment-card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

/* Filter chips */
.filter-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.filter-chip {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--c-border, #d8d2c2);
  background: var(--c-surface, #ffffff);
  text-decoration: none;
  color: #6b6155;
  font-size: 0.88rem;
  text-transform: capitalize;
}
.filter-chip:hover { background: rgba(91, 110, 90, 0.06); }
.filter-chip.is-current { background: var(--c-primary, #5b6e5a); color: #faf6ee; border-color: var(--c-primary, #5b6e5a); }

/* Warn banner reuse */
.banner.banner-warn.unread-banner { background: #fff4e2; color: #6b4a1a; border: 1px solid #e8d4a8; }

/* Admin flash warn variant */
.admin-flash-warn { background: #fff4e2; color: #6b4a1a; border: 1px solid #e8d4a8; padding: 0.6rem 0.9rem; border-radius: 6px; }

/* ============== Batch additions: status pills, search, pagination, locked field ============== */

/* Status pill variants by status name */
.role-pill-pending   { background: #efe9d8; color: #5a4e2a; }
.role-pill-scheduled { background: #2f5a3a; color: #faf6ee; }
.role-pill-declined  { background: #b3431a; color: #faf6ee; }
.role-pill-cancelled { background: #8a3a18; color: #faf6ee; }

/* Search row on /admin/clients */
.search-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1rem 0;
  max-width: 600px;
}
.search-row input[type="search"] {
  flex: 1 1 240px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--c-border, #d8d2c2);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--c-surface, #ffffff);
  min-width: 200px;
}
.search-row input[type="search"]:focus-visible {
  outline: 2px solid var(--c-primary, #5b6e5a);
  outline-offset: 1px;
  border-color: var(--c-primary, #5b6e5a);
}

/* Locked field (email on profile) */
.field-locked {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.field-locked-value {
  padding: 0.55rem 0.7rem;
  background: #f4eee0;
  border: 1px solid var(--c-border, #d8d2c2);
  border-radius: 6px;
  color: #6b6155;
  font-weight: 400;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.92rem;
}
.pagination a {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--c-border, #d8d2c2);
  border-radius: 6px;
  text-decoration: none;
  color: var(--c-primary, #5b6e5a);
  font-weight: 500;
}
.pagination a:hover { background: rgba(91, 110, 90, 0.06); }
.pagination-disabled {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--c-border-light, #e9e3d4);
  border-radius: 6px;
  color: #b3a999;
}

/* Danger link-style button for client appointment cancel */
.btn-link-danger {
  background: none;
  border: none;
  color: #b3431a;
  cursor: pointer;
  font-size: 0.88rem;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}
.btn-link-danger:hover { color: #8a3a18; text-decoration: none; }

/* Make sure skip-link still hides off-screen since target moved to <main> */
.skip-link:focus-visible {
  top: 0.5rem;
  left: 0.5rem;
}

/* Soft-delete / archive UI */
.thread-msg.is-archived { opacity: 0.55; border-left: 3px solid #b3431a; padding-left: 0.85rem; }
.thread-msg-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.4rem; flex-wrap: wrap; font-size: 0.85rem; }
.inline-edit { display: inline-block; }
.inline-edit > summary { cursor: pointer; color: var(--c-primary, #5b6e5a); font-weight: 500; padding: 0.1rem 0; }
.inline-edit > summary:hover { text-decoration: underline; }
.inline-edit form { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.inline-edit textarea {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--c-border, #d8d2c2);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--c-surface, #ffffff);
  resize: vertical;
}
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

/* Bulk archive toolbar on admin inbox */
.bulk-toolbar {
  display: flex; align-items: center; gap: 1rem;
  margin: 0.5rem 0 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--c-warm, #f3ecdb);
  border-radius: 6px;
}
.bulk-select-all { display: flex; align-items: center; gap: 0.4rem; font-size: 0.92rem; cursor: pointer; }
.bulk-row-check { display: inline-flex; align-items: center; margin-right: 0.5rem; vertical-align: middle; }
.bulk-checkbox, #bulk-select-all { width: 1.1em; height: 1.1em; cursor: pointer; }
#bulk-archive-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   Legal + multi-page additions (added with home/services split)
   ============================================================ */

/* Pending placeholder marker. Highly visible by design.
   These render where Hudson/Melissa still needs to confirm a value
   (license numbers, pricing, etc.) before the page is launched. */
.pending {
  display: inline-block;
  background: #fff4d6;
  color: #6b4d00;
  border: 1px dashed #c79a00;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  line-height: 1.4;
}

/* Inner-page hero (slimmer than homepage hero) */
.hero-page {
  padding: 4rem 0 2rem;
}
.hero-page h1 {
  margin: 0.25rem 0 1rem;
}

/* Two-up card grid (used for the homepage Therapy/Coaching router) */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.card-path {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.card-path h3 {
  margin: 0 0 0.25rem;
}
.card-path .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Coaching pricing stack */
.pricing-stack {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}
.pricing-row {
  position: relative;
  padding: 1.25rem 1.25rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
}
.pricing-row h3 { margin: 0 0 0.25rem; color: var(--c-primary-dark); }
.pricing-row p { margin: 0.35rem 0; }
.pricing-recommended {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 1px var(--c-primary) inset;
}
.recommended-pill {
  position: absolute;
  top: -0.6rem;
  right: 1rem;
  background: var(--c-primary);
  color: var(--c-surface);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* PHI warning on contact form */
.form-phi-warning {
  background: #fff4d6;
  border-left: 4px solid #c79a00;
  color: #4a3700;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  margin: 0.5rem 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Footer legal links row */
.footer-legal {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--c-border);
  margin-top: 1rem;
}
.footer-legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.footer-legal-nav a {
  color: var(--c-muted);
  text-decoration: none;
}
.footer-legal-nav a:hover { color: var(--c-primary); text-decoration: underline; }
.footer-legal-nav span { color: var(--c-border); }

/* Legal-page typography. Long-form readability. */
.legal-page .section { padding-top: 2.5rem; }
.legal-page h1 { margin-bottom: 0.5rem; }
.legal-page h2 {
  margin-top: 2rem;
  font-size: 1.25rem;
  color: var(--c-primary-dark);
}
.legal-page p, .legal-page ul, .legal-page ol { line-height: 1.65; }
.legal-page ul, .legal-page ol { padding-left: 1.25rem; margin: 0.5rem 0 1rem; }
.legal-page li { margin: 0.25rem 0; }

/* Coaching Services Agreement: signature block + print styles */
.signature-block {
  margin: 2rem 0 1rem;
  padding: 1.25rem;
  background: var(--c-warm);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.8;
}
.signature-block p { margin: 0.35rem 0; }
.print-cta { margin-top: 2rem; }

@media print {
  .no-print, .site-header, .site-footer, .skip-link { display: none !important; }
  body { background: white; color: #000; }
  .container, .narrow { max-width: 100%; padding: 0; }
  .section { padding: 0 0 1rem; }
  h1, h2 { page-break-after: avoid; }
  .signature-block { background: transparent; border: 1px solid #000; }
  a { color: #000; text-decoration: underline; }
  .form-phi-warning, .pending { background: transparent; border: 1px solid #000; color: #000; }
}
