/* ==========================================================================
   The Ranch Hand: "Rustic Barn" design system, ported to plain CSS.
   Tokens mirror client/tailwind.config.js + client/src/index.css exactly.
   ========================================================================== */

:root {
  /* Brand accent: deep blue denim (the live app's override of "barn red"). */
  --barn: #2E4B7C;      --barn-dark: #1D3050;   --barn-light: #5476A8;
  --hay: #D9A441;       --hay-dark: #B9831F;    --hay-light: #E7C078;
  --saddle: #6B4226;    --saddle-dark: #4A2D18; --saddle-light: #8A5C3A;
  --cream: #F7F1E3;     --cream-100: #FBF7EE;   --cream-200: #F1E7D2;
  --charcoal: #2E2A26;  --charcoal-muted: #6B645C;
  --sage: #6F8A5E;      --sage-dark: #566E47;
  --clay: #C2603F;      --clay-dark: #9E4A2E;
  --line: #E4D9C3;

  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-xl: 24px;
  --shadow-card: 0 4px 16px rgba(74, 45, 24, 0.10);
  --shadow-pop: 0 12px 32px rgba(74, 45, 24, 0.16);

  --font-display: "Bitter", Georgia, serif;
  --font-sans: "Nunito Sans", system-ui, -apple-system, sans-serif;
}

/* --- Reset-ish base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--saddle-dark);
  line-height: 1.2;
  margin: 0;
}
p { margin: 0; }
ul { margin: 0; }

/* Visible keyboard focus everywhere (WCAG 2.2 AA). */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--cream), 0 0 0 4px var(--barn);
  border-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* --- Layout --------------------------------------------------------------- */
.container-rh { margin: 0 auto; width: 100%; max-width: 72rem; padding: 0 1rem; }
@media (min-width: 640px) { .container-rh { padding: 0 1.5rem; } }
.section { padding: 4rem 0; }
.section-alt { background: rgba(241, 231, 210, 0.6); }
.section-dark { background: var(--saddle-dark); color: var(--cream-100); }
.text-center { text-align: center; }
.mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; } .mt-10 { margin-top: 2.5rem; }
.measure { max-width: 40rem; margin-left: auto; margin-right: auto; }

/* Typographic scale: fluid via clamp() so headings scale down cleanly on
   phones instead of wrapping into a cramped, "compressed" block. */
.display-xl { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.05rem, 1.2rem + 4vw, 3.25rem); line-height: 1.12; }
.display-lg { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.55rem, 1rem + 2.6vw, 1.875rem); line-height: 1.18; }
.display-md { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.3rem, 1.05rem + 1.4vw, 1.5rem); }
.lead { font-size: clamp(1rem, 0.95rem + 0.5vw, 1.125rem); line-height: 1.7; }
.muted { color: var(--charcoal-muted); }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: var(--radius-md); padding: 0 1.25rem; min-height: 44px;
  font-family: var(--font-sans); font-weight: 700; font-size: 1rem;
  border: none; cursor: pointer; transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
  text-align: center;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--barn); color: var(--cream-100); }
.btn-primary:hover { background: var(--barn-dark); }
.btn-secondary { background: transparent; color: var(--saddle); border: 2px solid var(--saddle); }
.btn-secondary:hover { background: var(--saddle); color: var(--cream-100); }
.btn-hay { background: var(--hay); color: var(--charcoal); }
.btn-hay:hover { background: var(--hay-dark); }
.btn-ghost { background: transparent; color: var(--saddle); }
.btn-ghost:hover { background: var(--cream-200); }
.btn-sm { min-height: 38px; padding: 0 1rem; font-size: .875rem; }

/* Denim twill weave on primary/denim fills (matches index.css .bg-barn). */
.bg-barn, .btn-primary, .badge-hay-solid.is-barn {
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0, rgba(255,255,255,.06) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(45deg, rgba(0,0,0,.14) 0, rgba(0,0,0,.14) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.035) 0, rgba(255,255,255,.035) 1px, transparent 1px, transparent 6px),
    linear-gradient(135deg, rgba(255,255,255,.05), rgba(0,0,0,.07));
}
.bg-barn { background-color: var(--barn); color: var(--cream-100); }

/* --- Cards --------------------------------------------------------------- */
.card {
  background: var(--cream-100); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 1.5rem;
}
.card-hover { transition: box-shadow .2s ease, transform .2s ease; }
.card-hover:hover { box-shadow: var(--shadow-pop); transform: translateY(-2px); }

/* --- Badges / chips ------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: .25rem; border-radius: 9999px;
  padding: .25rem .75rem; font-size: .75rem; font-weight: 700;
}
.badge-service { background: rgba(217, 164, 65, 0.2); color: var(--saddle-dark); }
.badge-hay { background: var(--hay); color: var(--charcoal); }
.badge-sage { background: rgba(111, 138, 94, 0.25); color: var(--sage-dark); }
.chip {
  display: inline-flex; align-items: center; gap: .375rem; border-radius: 9999px;
  border: 1px solid var(--line); background: var(--cream-100);
  padding: .375rem .75rem; font-size: .875rem; font-weight: 600; color: var(--saddle);
}

/* --- Forms --------------------------------------------------------------- */
.field { margin-bottom: 1.25rem; }
.label { display: block; font-size: .875rem; font-weight: 700; color: var(--saddle); margin-bottom: .375rem; }
.input, .select, .textarea {
  width: 100%; border-radius: var(--radius-md); border: 1px solid var(--line);
  background: #fff; padding: .625rem 1rem; color: var(--charcoal);
  font-family: var(--font-sans); font-size: 1rem;
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--barn); box-shadow: 0 0 0 3px rgba(46, 75, 124, 0.3);
}
.help { font-size: .8125rem; color: var(--charcoal-muted); margin-top: .375rem; }

/* --- Grids --------------------------------------------------------------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-6 { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-6 { grid-template-columns: repeat(6, 1fr); } }

/* --- Header / nav -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 247, 238, 0.95); backdrop-filter: blur(8px);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: .75rem 0; }
.brand { display: inline-flex; align-items: center; gap: .625rem; }
.brand img { height: 2.25rem; width: auto; }
.brand-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--saddle-dark); line-height: 1; }
.brand-sub { font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--charcoal-muted); }
.nav-right { display: flex; align-items: center; gap: .5rem; }
.nav-links { display: none; align-items: center; gap: .25rem; }
@media (min-width: 768px) { .nav-links { display: flex; } .nav-toggle { display: none; } }
.nav-link { padding: .5rem .75rem; border-radius: var(--radius-md); font-size: .875rem; font-weight: 700; color: var(--saddle); transition: color .15s ease; }
.nav-link:hover, .nav-link.is-active { color: var(--barn); }
.nav-link-quiet { color: var(--charcoal-muted); font-weight: 600; }
.nav-link-quiet:hover { color: var(--saddle-dark); }
/* Signup: the logo and the score, nothing to pull a Hand off the wizard. */
.site-header-bare .nav { padding: .875rem 0; }
.nav-toggle { background: transparent; border: none; color: var(--saddle); padding: .5rem; cursor: pointer; border-radius: var(--radius-md); }
.nav-toggle:hover { background: var(--cream-200); }
.mobile-menu { display: none; border-top: 1px solid var(--line); background: var(--cream-100); }
.mobile-menu.is-open { display: block; }
@media (min-width: 768px) { .mobile-menu { display: none !important; } }
.mobile-menu-inner { display: flex; flex-direction: column; gap: .25rem; padding: .75rem 0; }
.mobile-menu-label {
  margin-top: .5rem; padding: .25rem .75rem 0;
  font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--charcoal-muted);
}
.nav-link-sub { padding-left: 1.5rem; }

/* "Resources" dropdown in the desktop header. */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: inline-flex; align-items: center; gap: .3rem;
  background: transparent; border: 0; font-family: inherit; line-height: inherit; cursor: pointer;
}
.nav-dropdown-toggle svg { transition: transform .15s ease; }
.nav-dropdown-toggle[aria-expanded="true"] { color: var(--barn); }
.nav-dropdown-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + .375rem); left: 0; z-index: 50;
  min-width: 12rem; padding: .375rem;
  display: flex; flex-direction: column; gap: .125rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--cream-100); box-shadow: var(--shadow-pop);
}
.nav-dropdown-menu[hidden] { display: none; }
/* Bridges the gap under the button so hovering down to the menu keeps it open. */
.nav-dropdown-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -.5rem; height: .5rem; }
.nav-dropdown-link {
  display: block; padding: .5rem .75rem; border-radius: var(--radius-md);
  font-size: .875rem; font-weight: 700; color: var(--saddle-dark);
}
.nav-dropdown-link:hover, .nav-dropdown-link:focus-visible { background: var(--cream-200); color: var(--barn); }
.nav-dropdown-link.is-active { color: var(--barn); }

/* --- Trust Score Board (header pill) ------------------------------------- */
.account { position: relative; }
.trust-board {
  position: relative;
  display: inline-flex; align-items: center; gap: .4375rem;
  padding: .25rem .625rem .25rem .25rem;
  border: 1px solid var(--line); border-radius: 9999px;
  background: var(--cream-100); line-height: 1; white-space: nowrap;
  font-family: inherit; cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.trust-board:hover, .trust-board[aria-expanded="true"] { border-color: var(--hay); background: #fff; }
.trust-board-avatar {
  flex: 0 0 auto; width: 1.75rem; height: 1.75rem; border-radius: 9999px;
  object-fit: cover; display: block; background: var(--cream-200);
}
.trust-board-avatar-initials {
  display: grid; place-items: center;
  background: var(--hay); color: var(--charcoal);
  font-family: var(--font-display); font-size: .75rem; font-weight: 700; letter-spacing: .02em;
}
.trust-board-num {
  font-family: var(--font-display); font-size: .9375rem; font-weight: 700;
  color: var(--saddle-dark); font-variant-numeric: tabular-nums;
  transition: color .2s ease;
}
.trust-board-cap {
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--charcoal-muted);
}
@media (max-width: 400px) { .trust-board-cap { display: none; } }

/* The "+15" that floats off the pill when the score rises. */
.trust-board-pop {
  position: absolute; left: 50%; top: 0; z-index: 1;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 0);
  padding: .1875rem .4375rem; border-radius: 9999px;
  background: var(--sage); color: #fff;
  font-family: var(--font-sans); font-size: .75rem; font-weight: 800;
  box-shadow: var(--shadow-card);
}
.trust-board-pop.is-live { animation: trh-trust-rise 2.6s cubic-bezier(.22, 1, .36, 1) forwards; }
@keyframes trh-trust-rise {
  0%   { opacity: 0; transform: translate(-50%, .25rem) scale(.6); }
  14%  { opacity: 1; transform: translate(-50%, -1.5rem) scale(1); }
  72%  { opacity: 1; transform: translate(-50%, -1.75rem) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -2.75rem) scale(.95); }
}
.trust-board.is-rising {
  border-color: var(--hay);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, .3);
}
.trust-board.is-rising .trust-board-num { color: var(--sage-dark); }
.trust-board-pop.is-loss { background: var(--clay); }
.trust-board.is-falling { border-color: var(--clay); box-shadow: 0 0 0 3px rgba(194, 96, 63, .22); }
.trust-board.is-falling .trust-board-num { color: var(--clay-dark); }

/* The account menu behind the badge. */
.account-menu {
  position: absolute; top: calc(100% + .5rem); right: 0; z-index: 50;
  width: 15rem; padding: .5rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--cream-100); box-shadow: var(--shadow-pop);
}
.account-head {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem .5rem .75rem; border-bottom: 1px solid var(--line);
}
.account-avatar {
  flex: 0 0 auto; width: 2.5rem; height: 2.5rem; border-radius: 9999px;
  object-fit: cover; display: block; background: var(--cream-200);
}
.account-avatar-initials {
  display: grid; place-items: center;
  background: var(--hay); color: var(--charcoal);
  font-family: var(--font-display); font-size: .9375rem; font-weight: 700;
}
.account-id { display: flex; flex-direction: column; gap: .125rem; min-width: 0; }
.account-name {
  font-family: var(--font-display); font-size: .9375rem; font-weight: 700;
  color: var(--saddle-dark); overflow: hidden; text-overflow: ellipsis;
}
.account-user { font-size: .8125rem; color: var(--charcoal-muted); }
.account-score {
  display: flex; align-items: center; justify-content: space-between;
  margin: .5rem 0; padding: .5rem .625rem; border-radius: var(--radius-md);
  background: var(--cream-200); font-size: .8125rem; font-weight: 700;
  color: var(--charcoal-muted);
}
.account-score:hover { background: var(--line); }
.account-score strong {
  font-family: var(--font-display); font-size: 1.125rem; color: var(--saddle-dark);
  font-variant-numeric: tabular-nums;
}
.account-links { display: flex; flex-direction: column; }
.account-links a {
  padding: .5rem .625rem; border-radius: var(--radius-md);
  font-size: .875rem; font-weight: 700; color: var(--saddle);
}
.account-links a:hover { background: var(--cream-200); color: var(--barn); }
.account-signout { color: var(--charcoal-muted) !important; font-weight: 600 !important; }

/* Announced to screen readers; never drawn. */
.trust-board-live {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .trust-board-pop.is-live { animation: trh-trust-hold 2.6s linear forwards; }
  @keyframes trh-trust-hold {
    0%, 82% { opacity: 1; transform: translate(-50%, -1.625rem); }
    100%    { opacity: 0; transform: translate(-50%, -1.625rem); }
  }
  .trust-board.is-rising { transition: none; }
}

/* Awards earned after signup, listed under the dashboard breakdown. */
.score-earned { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 2px solid var(--line); }
.score-earned-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--saddle-dark);
}
.score-when { display: block; font-size: .8125rem; color: var(--charcoal-muted); margin-top: .125rem; }

/* --- Hero ---------------------------------------------------------------- */
.hero { position: relative; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-grain { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(46,42,38,.55) 0%, rgba(46,42,38,.35) 45%, rgba(46,42,38,.65) 100%); }
.hero-inner { position: relative; padding: 5rem 0; }
@media (min-width: 640px) { .hero-inner { padding: 7rem 0; } }
.hero h1 { color: var(--cream-100); }
.hero p { color: rgba(247, 241, 227, 0.9); }

/* Search bar */
.searchbar { display: flex; flex-wrap: wrap; gap: .75rem; background: var(--cream-100); padding: 1rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.searchbar .field { margin: 0; flex: 1 1 180px; }
.searchbar .btn { flex: 0 0 auto; align-self: flex-end; }

/* --- Value props / steps ------------------------------------------------- */
.icon-lg { font-size: 1.875rem; line-height: 1; }
.step-num {
  margin: 0 auto; display: flex; height: 3rem; width: 3rem; align-items: center; justify-content: center;
  border-radius: 9999px; background: var(--barn); color: var(--cream-100);
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
}

/* --- Animal categories (dark) ------------------------------------------- */
.animal-tile {
  display: block; text-align: center; padding: 1.25rem; border-radius: var(--radius-lg);
  border: 1px solid rgba(247, 241, 227, 0.15); background: rgba(107, 66, 38, 0.4);
  transition: background-color .15s ease;
}
.animal-tile:hover { background: var(--saddle); }
.animal-tile .emoji { font-size: 2.25rem; transition: transform .15s ease; }
.animal-tile:hover .emoji { transform: scale(1.1); }
.animal-tile h3 { color: var(--cream-100); font-size: 1rem; margin-top: .75rem; }
.animal-tile p { color: rgba(247, 241, 227, 0.7); font-size: .75rem; line-height: 1.4; margin-top: .25rem; }

/* --- Caretaker card ------------------------------------------------------ */
.ck-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.ck-card .ck-photo { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--cream-200); }
.ck-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.ck-name { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; color: var(--saddle-dark); }
.ck-loc { font-size: .8125rem; color: var(--charcoal-muted); }
.ck-headline { color: var(--charcoal); font-size: .9375rem; }
.ck-tags { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: auto; }
.ck-foot { display: flex; align-items: center; justify-content: space-between; padding-top: .75rem; border-top: 1px solid var(--line); }
.ck-price { font-family: var(--font-display); font-weight: 700; color: var(--saddle-dark); }
.ck-price span { font-size: .75rem; font-weight: 400; color: var(--charcoal-muted); }

/* --- Stars --------------------------------------------------------------- */
.stars { display: inline-flex; align-items: center; gap: .25rem; }
.stars .star { color: var(--hay); font-size: 1rem; line-height: 1; }
.stars .star.empty { color: var(--line); }
.stars .num { font-weight: 700; color: var(--charcoal); font-size: .875rem; }
.stars .count { color: var(--charcoal-muted); font-size: .8125rem; }

/* --- Directory filters --------------------------------------------------- */
.directory { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .directory { grid-template-columns: 260px 1fr; } }
.filters { align-self: start; position: sticky; top: 88px; }

/* --- Profile ------------------------------------------------------------- */
.profile-head { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: center; }
@media (min-width: 640px) { .profile-head { grid-template-columns: 160px 1fr; } }
.profile-photo { width: 100%; max-width: 160px; aspect-ratio: 1; border-radius: var(--radius-lg); object-fit: cover; }
.profile-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .profile-grid { grid-template-columns: 1fr 340px; } }
.rate-row { display: flex; align-items: center; justify-content: space-between; padding: .625rem 0; border-bottom: 1px solid var(--line); }
.rate-row:last-child { border-bottom: none; }

/* --- Footer -------------------------------------------------------------- */
.site-footer { margin-top: 5rem; background: var(--saddle-dark); color: rgba(247, 241, 227, 0.85); }
.footer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; padding: 3rem 0; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-brand { grid-column: span 2; }
@media (min-width: 768px) { .footer-brand { grid-column: span 1; } }
.footer-brand .brand-name { color: var(--cream-100); }
.footer h4 { font-family: var(--font-display); font-size: .875rem; font-weight: 700; color: var(--hay-light); margin-bottom: .75rem; }
.footer-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; }
.footer-list a:hover { color: var(--cream-100); }
.footer-bottom { border-top: 1px solid rgba(247, 241, 227, 0.15); }
.footer-bottom .inner { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: .5rem; padding: 1.25rem 0; font-size: .75rem; color: rgba(247, 241, 227, 0.65); }
@media (min-width: 640px) { .footer-bottom .inner { flex-direction: row; } }

/* --- Notices ------------------------------------------------------------- */
.notice { border-radius: var(--radius-md); padding: 1rem 1.25rem; font-weight: 600; }
.notice-success { background: rgba(111, 138, 94, 0.18); color: var(--sage-dark); border: 1px solid rgba(111, 138, 94, 0.4); }
.notice-error { background: rgba(194, 96, 63, 0.15); color: var(--clay-dark); border: 1px solid rgba(194, 96, 63, 0.4); }

/* --- WP content (generic pages) ------------------------------------------ */
.prose { max-width: 46rem; margin: 0 auto; }
.prose h2 { font-size: 1.5rem; margin: 2rem 0 .75rem; }
.prose h3 { font-size: 1.25rem; margin: 1.5rem 0 .5rem; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .375rem; }
.prose a { color: var(--barn); font-weight: 700; }
.prose a:hover { color: var(--barn-dark); }

/* --- Page hero (interior) ------------------------------------------------ */
.page-hero { background: var(--cream-200); border-bottom: 1px solid var(--line); padding: 3rem 0; }
.page-hero h1 { color: var(--saddle-dark); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none; }
.flex-between { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }

/* ==========================================================================
   Mobile refinements (≤ 640px)
   Everything above is desktop-first; this block tightens the phone layout so
   sections breathe, headings scale, and nothing overflows the viewport.
   ========================================================================== */

/* Global safety net: never let a stray wide element force sideways scroll.
   `clip` (not `hidden`) avoids turning the body into a scroll container, which
   would otherwise interfere with the sticky header. */
html, body { overflow-x: clip; }

/* --- Homepage photo gallery (masonry via CSS columns; mixed portrait/landscape
   photos keep their aspect ratio, no cropping). Add images by dropping files in
   assets/img/gallery/ — see trh_gallery_images() in functions.php. ---------- */
.photo-gallery { columns: 2; column-gap: 1rem; }
@media (min-width: 640px)  { .photo-gallery { columns: 3; column-gap: 1.25rem; } }
@media (min-width: 1024px) { .photo-gallery { columns: 4; } }
.photo-item { margin: 0 0 1rem; break-inside: avoid; -webkit-column-break-inside: avoid; }
@media (min-width: 640px) { .photo-item { margin-bottom: 1.25rem; } }
.photo-item img {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  transition: box-shadow .18s ease, transform .18s ease;
}
.photo-item img:hover { box-shadow: var(--shadow-pop); transform: translateY(-2px); }

@media (max-width: 639px) {
  /* Comfortable, consistent vertical rhythm, smaller than the desktop 4rem. */
  .section { padding: 2.75rem 0; }

  /* Hero: clear breathing room between the header and the eyebrow badge (top)
     and between the search form and the section below it (bottom). */
  .hero-inner { padding: 4.25rem 0 5rem; }

  /* Eyebrow badge: wrap to two lines instead of being clipped off the right
     edge on narrow screens (the long "…done right" text was overflowing). */
  .hero .badge { max-width: 100%; white-space: normal; line-height: 1.35; text-align: left; }

  /* Give the search form clear separation from the hero copy above it. */
  .searchbar { margin-top: 1.75rem; }

  /* A touch more side gutter so text isn't jammed against the screen edge. */
  .container-rh { padding: 0 1.125rem; }

  /* Header/nav should not be squished by the brand sub-label. */
  .brand img { height: 2rem; }
  .brand-name { font-size: 1.125rem; }

  /* Section headers with a trailing "View all →" link must stack, otherwise
     the heading gets crushed into a narrow, wrapping column. */
  .flex-between { flex-direction: column; align-items: flex-start; gap: .5rem; }

  /* Search bar: fields stack full-width and the submit button spans the row
     instead of floating, cramped, to the right. */
  .searchbar { flex-direction: column; gap: 1rem; padding: 1rem; }
  .searchbar .field { flex: 1 1 auto; width: 100%; }
  .searchbar .btn { width: 100%; align-self: stretch; }

  /* Animal tiles sit two-up; trim the padding so the blurb has room to read. */
  .grid-6 { gap: .75rem; }
  .animal-tile { padding: 1rem .75rem; }
  .animal-tile .emoji { font-size: 2rem; }

  /* Slightly tighter card padding reclaims horizontal space on narrow screens. */
  .card { padding: 1.25rem; }

  /* CTA panel: reduce the generous desktop insets. */
  .bg-barn[style] { padding: 2.25rem 1.5rem !important; }

  /* Directory/profile: drop the sticky offset that wastes space when stacked. */
  .filters { position: static; top: auto; }

  /* Ensure long words / URLs in body copy wrap instead of overflowing. */
  p, blockquote, .lead, h1, h2, h3 { overflow-wrap: break-word; }
}

/* Very small phones (≤ 380px): keep two-column tiles from getting too tight. */
@media (max-width: 380px) {
  .grid-6 { grid-template-columns: 1fr; }
}

/* --- Contact page --------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: 1fr 320px; } }
.contact-links { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .625rem; font-size: .9375rem; }
.contact-links a { color: var(--barn); font-weight: 700; }
.contact-links a:hover { color: var(--barn-dark); }

/* --- Footer: legal links -------------------------------------------------- */
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.25rem; }
.footer-legal a:hover { color: var(--cream-100); text-decoration: underline; }

/* ==========================================================================
   Hand signup wizard + Hand dashboard
   (page-hand-signup.php, page-dashboard.php, assets/js/hand-signup.js)
   ========================================================================== */

/* --- Interior hero variant ------------------------------------------------ */
.page-hero-tight { padding: 2.5rem 0 2rem; }
.hero-kicker {
  font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--barn); margin-bottom: .375rem;
}
.link { color: var(--barn); font-weight: 700; }
.link:hover { color: var(--barn-dark); text-decoration: underline; }
.notice-list { list-style: disc; padding-left: 1.25rem; margin: 0; display: flex; flex-direction: column; gap: .25rem; }

/* --- Step progress bar --------------------------------------------------- */
.steps-bar {
  list-style: none; margin: 0 0 2rem; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: .75rem;
}
@media (min-width: 768px) { .steps-bar { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
.step-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .875rem 1rem; border-radius: var(--radius-lg);
  border: 1px solid var(--line); background: var(--cream-100);
}
.step-item.is-current { border-color: var(--barn); box-shadow: 0 0 0 2px rgba(46, 75, 124, .15); }
.step-item.is-done { background: rgba(111, 138, 94, .12); border-color: rgba(111, 138, 94, .4); }
.step-dot {
  flex: 0 0 auto; width: 1.75rem; height: 1.75rem; border-radius: 9999px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: .9375rem;
  background: var(--cream-200); color: var(--charcoal-muted);
}
.step-item.is-current .step-dot { background: var(--barn); color: var(--cream-100); }
.step-item.is-done .step-dot { background: var(--sage); color: var(--cream-100); }
.step-meta { display: flex; flex-direction: column; }
.step-label { font-family: var(--font-display); font-weight: 700; color: var(--saddle-dark); font-size: 1rem; }
.step-blurb { font-size: .8125rem; color: var(--charcoal-muted); line-height: 1.4; }

/* --- Wizard shell ------------------------------------------------------- */
.wizard { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .wizard { grid-template-columns: 1fr 320px; align-items: start; } }
.wizard-aside { display: block; }
@media (min-width: 1024px) { .wizard-aside { position: sticky; top: 88px; } }
.wizard-card { padding: 1.75rem; }
.wizard-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  margin-top: 1.5rem;
}
.wizard-actions .btn { min-width: 12rem; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.aside-title { font-family: var(--font-display); font-size: 1.0625rem; color: var(--saddle-dark); margin-bottom: .5rem; }

/* --- Fieldsets / labels ------------------------------------------------- */
.fieldset { border: none; padding: 0; margin: 0 0 1.25rem; }
.legend {
  padding: 0; margin-bottom: .625rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--saddle-dark);
}
.label-opt { font-weight: 600; font-size: .75rem; color: var(--charcoal-muted); text-transform: none; }
.grid-loc { display: grid; grid-template-columns: 1fr; gap: 0 1.25rem; }
@media (min-width: 640px) { .grid-loc { grid-template-columns: 1.5fr 1fr .7fr; } }

/* --- Points pills ------------------------------------------------------- */
.pts-pill {
  display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap;
  border-radius: 9999px; padding: .3125rem .75rem;
  font-size: .75rem; font-weight: 800; letter-spacing: .01em;
  background: var(--hay); color: var(--charcoal);
}
.pts-pill.is-earned { background: rgba(111, 138, 94, .25); color: var(--sage-dark); }
.pts-inline {
  display: inline-block; margin-left: .125rem; padding: .0625rem .4375rem;
  border-radius: 9999px; background: rgba(247, 241, 227, .22);
  font-size: .8125rem; font-weight: 800;
}

/* --- Password field ----------------------------------------------------- */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 4.25rem; }
.pw-toggle {
  position: absolute; right: .375rem; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  font-family: var(--font-sans); font-size: .8125rem; font-weight: 700; color: var(--barn);
  padding: .375rem .5rem; border-radius: var(--radius-sm);
}
.pw-toggle:hover { background: var(--cream-200); }

/* --- Inline checkbox (terms, remember me) ------------------------------- */
.check-inline {
  display: flex; align-items: flex-start; gap: .625rem;
  font-size: .9375rem; color: var(--charcoal); margin-bottom: 1rem; cursor: pointer;
}
.check-inline input { margin-top: .25rem; width: 1.05rem; height: 1.05rem; accent-color: var(--barn); flex: 0 0 auto; }
.check-inline a { color: var(--barn); font-weight: 700; text-decoration: underline; }

/* --- City combobox ------------------------------------------------------ */
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 50; top: calc(100% + .25rem); left: 0; right: 0;
  list-style: none; margin: 0; padding: .25rem;
  max-height: 18rem; overflow-y: auto;
  background: var(--cream-100); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
}
.combo-option {
  display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
  padding: .5rem .625rem; border-radius: var(--radius-sm); cursor: pointer;
}
.combo-option.is-active, .combo-option:hover { background: rgba(46, 75, 124, .1); }
.combo-city { font-weight: 700; color: var(--saddle-dark); }
.combo-state { font-size: .8125rem; color: var(--charcoal-muted); white-space: nowrap; }

/* --- File inputs / uploads ---------------------------------------------- */
.file {
  display: block; width: 100%; font-family: var(--font-sans); font-size: .9375rem;
  color: var(--charcoal); background: #fff;
  border: 1px dashed var(--line); border-radius: var(--radius-md); padding: .75rem;
}
.file::file-selector-button {
  font-family: var(--font-sans); font-weight: 700; font-size: .875rem;
  background: var(--cream-200); color: var(--saddle); border: none;
  border-radius: var(--radius-sm); padding: .5rem .875rem; margin-right: .875rem; cursor: pointer;
}
.file::file-selector-button:hover { background: var(--line); }
.file-current { margin-top: .5rem; font-size: .875rem; color: var(--sage-dark); font-weight: 600; }
.upload-row { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.upload-preview {
  flex: 0 0 auto; width: 6.5rem; height: 6.5rem; border-radius: var(--radius-lg);
  overflow: hidden; background: var(--cream-200); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-placeholder { font-size: 2.25rem; }
.upload-body { flex: 1 1 16rem; min-width: 0; }
.ref-block { border: none; padding: 0; margin: 1.5rem 0 0; }
.ref-block + .ref-block { border-top: 1px solid var(--line); padding-top: 1.25rem; }

/* --- Experience checklist ----------------------------------------------- */
.check-counter {
  margin: 1.5rem 0 0; font-size: .875rem; font-weight: 700; color: var(--barn);
}
.check-group { border: none; padding: 0; margin: 1.5rem 0 0; }
.group-title {
  padding: 0; margin-bottom: .75rem;
  font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700; color: var(--saddle-dark);
}
.check-grid { display: grid; grid-template-columns: 1fr; gap: .5rem; }
@media (min-width: 640px) { .check-grid { grid-template-columns: repeat(2, 1fr); } }
.check-item {
  position: relative; display: flex; align-items: flex-start; gap: .625rem;
  padding: .75rem .875rem; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: #fff; cursor: pointer; font-size: .9375rem; line-height: 1.35;
  transition: border-color .12s ease, background-color .12s ease;
}
.check-item input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.check-item:focus-within { border-color: var(--barn); box-shadow: 0 0 0 3px rgba(46, 75, 124, .25); }
.check-box {
  flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin-top: .125rem;
  border: 2px solid var(--line); border-radius: 5px; background: #fff;
  display: grid; place-items: center;
}
.check-box::after {
  content: "\2713"; font-size: .75rem; font-weight: 700; line-height: 1;
  color: var(--cream-100); opacity: 0;
}
.check-item.is-checked, .check-item:has(input:checked) {
  border-color: var(--barn); background: rgba(46, 75, 124, .07);
}
.check-item.is-checked .check-box, .check-item:has(input:checked) .check-box {
  background: var(--barn); border-color: var(--barn);
}
.check-item.is-checked .check-box::after, .check-item:has(input:checked) .check-box::after { opacity: 1; }
.check-text { color: var(--charcoal); }

/* --- My Profile ---------------------------------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.profile-photo { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.profile-photo-current {
  width: 5.5rem; height: 5.5rem; border-radius: 9999px; object-fit: cover;
  display: block; background: var(--cream-200); border: 2px solid var(--line);
}
.profile-photo-current-initials {
  display: grid; place-items: center;
  background: var(--hay); color: var(--charcoal);
  font-family: var(--font-display); font-size: 1.75rem; font-weight: 700;
}
.profile-photo-controls { display: flex; flex-direction: column; align-items: flex-start; gap: .625rem; }
.profile-photo-controls label.btn { cursor: pointer; margin: 0; }
.profile-photo-remove {
  display: inline-flex; align-items: center; gap: .4375rem;
  font-size: .875rem; color: var(--charcoal-muted); cursor: pointer;
}
.social-rows { display: flex; flex-direction: column; gap: .625rem; }
.social-row {
  display: grid; grid-template-columns: 1fr; gap: .375rem;
  padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--cream-100);
}
@media (min-width: 640px) {
  .social-row { grid-template-columns: 9rem 1fr 3rem; align-items: center; gap: .75rem; }
}
.social-row.is-linked { border-color: var(--sage); background: rgba(111, 138, 94, .06); }
.social-label {
  display: inline-flex; align-items: center; gap: .4375rem;
  font-size: .875rem; font-weight: 700; color: var(--saddle-dark);
}
.social-row input { width: 100%; }
.social-pts {
  font-size: .8125rem; font-weight: 800; color: var(--sage-dark); text-align: right;
}
.mt-8 { margin-top: 2rem; }
.notice-warn {
  border-left: 4px solid var(--clay); background: rgba(194, 96, 63, .08); color: var(--saddle-dark);
}

/* --- Trust Score dial + breakdown --------------------------------------- */
.score-dial {
  position: relative; margin: 0 auto;
  width: var(--dial, 9rem); height: var(--dial, 9rem); border-radius: 50%;
  background: conic-gradient(var(--hay) calc(var(--pct) * 1%), var(--cream-200) 0);
  display: grid; place-items: center;
}
.score-dial-inner {
  width: calc(100% - 22px); height: calc(100% - 22px); border-radius: 50%;
  background: var(--cream-100);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 4px rgba(74, 45, 24, .1);
}
.score-dial-num { font-family: var(--font-display); font-size: 2.125rem; font-weight: 700; color: var(--saddle-dark); line-height: 1; }
.score-dial-cap {
  margin-top: .25rem; font-size: .625rem; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--charcoal-muted);
}
.score-head { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: center; }
@media (min-width: 640px) { .score-head { grid-template-columns: 9rem 1fr; } }
.score-avail { color: var(--saddle-dark); font-size: .9375rem; }
.score-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.score-row {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .875rem 0; border-bottom: 1px solid var(--line);
}
.score-row:last-child { border-bottom: none; }
.score-tick {
  flex: 0 0 auto; width: 1.375rem; height: 1.375rem; border-radius: 9999px;
  display: grid; place-items: center; font-size: .8125rem; font-weight: 700;
  background: var(--cream-200); color: var(--charcoal-muted);
}
.score-row.is-earned .score-tick { background: var(--sage); color: var(--cream-100); }
.score-text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.score-label { font-weight: 700; color: var(--saddle-dark); font-size: .9375rem; }
.score-blurb { font-size: .8125rem; color: var(--charcoal-muted); line-height: 1.4; }
.score-pts {
  flex: 0 0 auto; font-family: var(--font-display); font-weight: 700;
  color: var(--sage-dark); font-size: .9375rem;
}
.score-cta { flex: 0 0 auto; white-space: nowrap; }

/* --- Sign-in page ------------------------------------------------------- */
.auth-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .auth-grid { grid-template-columns: 1fr 320px; align-items: start; } }

/* --- Dashboard ---------------------------------------------------------- */
.dash-hero { background: var(--cream-200); border-bottom: 1px solid var(--line); padding: 2rem 0; }
.dash-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; }
.dash-ident { display: flex; align-items: center; gap: 1.25rem; }
.dash-avatar {
  flex: 0 0 auto; width: 5rem; height: 5rem; border-radius: var(--radius-lg);
  object-fit: cover; border: 2px solid var(--cream-100); box-shadow: var(--shadow-card);
}
.dash-avatar-empty { display: grid; place-items: center; font-size: 2.25rem; background: var(--cream-100); }
.dash-sub { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; margin-top: .375rem; font-size: .9375rem; color: var(--charcoal-muted); }
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .dash-grid { grid-template-columns: 1fr 320px; align-items: start; } }
.dash-facts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.dash-facts li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.dash-facts li:last-child { border-bottom: none; }
.dash-facts span { color: var(--charcoal-muted); }
.dash-facts strong { color: var(--saddle-dark); text-align: right; overflow-wrap: anywhere; }
.dash-steps { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .5rem; font-size: .9375rem; color: var(--charcoal-muted); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Signup-complete celebration banner. */
.celebrate {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.75rem; border-radius: var(--radius-lg);
  background: rgba(217, 164, 65, .18); border: 1px solid rgba(217, 164, 65, .5);
}
.celebrate-badge {
  flex: 0 0 auto; width: 4.5rem; height: 4.5rem; border-radius: 9999px;
  display: grid; place-items: center; background: var(--hay); color: var(--charcoal);
  font-family: var(--font-display); font-size: 1.375rem; font-weight: 700;
  box-shadow: var(--shadow-card);
}
.celebrate > div { flex: 1 1 20rem; min-width: 0; }

@media (max-width: 639px) {
  .wizard-card { padding: 1.25rem; }
  .wizard-actions .btn { width: 100%; min-width: 0; }
  .wizard-actions { flex-direction: column; align-items: stretch; text-align: center; }
  .score-row { flex-wrap: wrap; }
  .score-cta { width: 100%; margin-top: .5rem; }
  .dash-ident { gap: 1rem; }
  .dash-avatar { width: 3.75rem; height: 3.75rem; }
  .celebrate { padding: 1.25rem; gap: 1rem; }
}
