/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
  --sand:  #f5f0e8;
  --cream: #faf8f4;
  --stone: #d4c9b5;
  --bark:  #6b5b47;
  --earth: #3d2f22;
  --pine:  #2c4a3e;
  --rust:  #c0622c;
  --warn:  #b34a2a;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;

  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.75rem;
  --space-lg:  3rem;
  --space-xl:  5rem;

  --radius: 6px;
  --header-h: 68px;
  --max-w: 1100px;
  --body-w: 760px;
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
  --cream: #17140f;
  --sand:  #201c15;
  --stone: #38302a;
  --bark:  #9d9080;
  --earth: #e8ddd0;
  --pine:  #5c9878;
  --rust:  #cf7848;
  --badge-emergency-bg: rgba(239, 68, 68, 0.15);
  --badge-emergency-text: #fca5a5;
  --badge-property-bg: rgba(59, 130, 246, 0.15);
  --badge-property-text: #93c5fd;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #17140f;
    --sand:  #201c15;
    --stone: #38302a;
    --bark:  #9d9080;
    --earth: #e8ddd0;
    --pine:  #5c9878;
    --rust:  #cf7848;
    --badge-emergency-bg: rgba(239, 68, 68, 0.15);
    --badge-emergency-text: #fca5a5;
    --badge-property-bg: rgba(59, 130, 246, 0.15);
    --badge-property-text: #93c5fd;
  }
}

/* Component fixes that use hardcoded values or inverted-token patterns */
[data-theme="dark"] .site-footer { background: #0d0b08; }
[data-theme="dark"] .card:hover { background: #2b2419; }
[data-theme="dark"] .resp-row--header { background: #2e2820; color: var(--earth); }
[data-theme="dark"] .resp-row:not(.resp-row--header):nth-child(odd) { background: var(--sand); }
[data-theme="dark"] .example-block { background: var(--sand); border-color: var(--stone); }
[data-theme="dark"] .map-link-card { background: var(--sand); }
[data-theme="dark"] .map-link-card:hover { background: #2b2419; }
[data-theme="dark"] .fee-cell--total { background: var(--stone); }
[data-theme="dark"] .fee-cell--total .fee-cell-amount { color: var(--earth); }
[data-theme="dark"] .fee-cell--total .fee-cell-label,
[data-theme="dark"] .fee-cell--total .fee-cell-note { color: var(--bark); }

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; background: none; border: none; font: inherit; }

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--earth);
  color: var(--sand);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.15s;
}
.skip-link:focus { top: 0; }

/* ============================================================
   BASE
   ============================================================ */
html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--earth);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
}

h2 { font-size: 1.9rem; margin-bottom: var(--space-sm); color: var(--earth); }
h3 { font-size: 1.35rem; margin-bottom: var(--space-xs); color: var(--pine); }
h4 { font-size: 1.1rem; margin-bottom: 0.4rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 500; }

a:not([class]) {
  color: var(--pine);
  text-decoration: underline;
  text-decoration-color: var(--stone);
  text-underline-offset: 3px;
}
a:not([class]):hover { color: var(--rust); text-decoration-color: var(--rust); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--cream);
  border-bottom: 1px solid var(--stone);
  transition: background 0.2s, border-color 0.2s;
}

.header-inner {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-badge {
  width: 36px;
  height: 36px;
  background: var(--pine);
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--pine);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Desktop inline nav */
.site-nav-desktop { margin: 0 auto; overflow: hidden; }

.site-nav-desktop ul {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
}

.site-nav-desktop li { position: relative; flex-shrink: 0; }

.site-nav-desktop a {
  position: relative;
  display: block;
  padding: 0.35rem 0.5rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--bark);
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s;
}

.site-nav-desktop a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.5rem;
  right: 0.5rem;
  height: 2px;
  background: var(--pine);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.site-nav-desktop a:hover { color: var(--earth); }
.site-nav-desktop a:hover::after { transform: scaleX(1); }

.site-nav-desktop a[aria-current="page"] {
  color: var(--pine);
  font-weight: 600;
}
.site-nav-desktop a[aria-current="page"]::after { transform: scaleX(1); }

/* Per-link description tooltip */
.nav-tip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: var(--cream);
  border: 1px solid var(--stone);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 10, 5, 0.15);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--bark);
  line-height: 1.55;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s 0.08s, visibility 0s 0.2s;
  z-index: 150;
}

.has-tip:hover .nav-tip {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s, visibility 0s;
}

/* Keep last few tooltips from overflowing right edge */
.site-nav-desktop li:nth-last-child(-n+3) .nav-tip {
  left: auto;
  right: 0;
  transform: none;
}

/* Drawer nav — always side drawer */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: var(--cream);
  border-left: 1px solid var(--stone);
  box-shadow: -10px 0 40px rgba(15, 10, 5, 0.18);
  z-index: 200;
  padding: calc(var(--header-h) + var(--space-md)) var(--space-md) var(--space-md);
  overflow-y: auto;
  visibility: hidden;
  transform: translateX(110%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.3s;
}

.site-header.nav-open .site-nav {
  visibility: visible;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.site-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
}

.site-nav a:hover { background: var(--sand); }

.site-nav a[aria-current="page"] {
  background: var(--sand);
}

.nav-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--earth);
  line-height: 1.2;
}

.site-nav a[aria-current="page"] .nav-label { color: var(--pine); }

.nav-desc {
  font-size: 0.73rem;
  color: var(--bark);
  line-height: 1.35;
  font-weight: 400;
}

/* Header actions: theme toggle + hamburger */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Search button */
.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  color: var(--bark);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.search-btn:hover {
  background: var(--sand);
  color: var(--earth);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  color: var(--bark);
  transition: background 0.15s, color 0.15s;
}

.theme-toggle:hover {
  background: var(--sand);
  color: var(--earth);
}

.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* Hamburger — visible on mobile only */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: var(--radius);
  color: var(--earth);
  transition: background 0.15s;
}

.nav-toggle:hover { background: var(--sand); }

.bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s;
  transform-origin: center;
}

.site-header.nav-open .bar-1 { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .bar-2 { opacity: 0; transform: scaleX(0); }
.site-header.nav-open .bar-3 { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 721px) {
  .nav-toggle { display: none; }
}

/* Backdrop */
.nav-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 5, 0.5);
  z-index: 149;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.site-header.nav-open .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   HERO (Homepage)
   ============================================================ */
.site-hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 85% 40%, rgba(44,74,62,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 10% 90%, rgba(192,98,44,0.14) 0%, transparent 50%),
    linear-gradient(160deg, var(--cream) 0%, var(--sand) 100%);
  padding: var(--space-xl) var(--space-md);
}

.hero-texture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.04;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: var(--space-sm);
}

.site-hero h1 {
  font-size: clamp(3.2rem, 8vw, 6rem);
  font-weight: 400;
  line-height: 1.08;
  color: var(--earth);
  margin-bottom: var(--space-md);
}

.site-hero h1 em {
  font-style: italic;
  color: var(--pine);
}

.hero-cycle {
  display: inline-block;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.hero-cycle.fading {
  opacity: 0;
  transform: translateY(10px);
}

.hero-feats {
  margin-top: var(--space-md);
  height: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-feat-item {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bark);
  transition: opacity 0.45s ease;
  white-space: nowrap;
}

.hero-feat-item.fading {
  opacity: 0;
}

.hero-sub {
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--bark);
  max-width: 520px;
  margin: 0 auto var(--space-lg);
  line-height: 1.6;
}

.hero-desc {
  font-size: 0.92rem;
  color: var(--bark);
  max-width: 560px;
  margin: var(--space-lg) auto 0;
  line-height: 1.75;
  border-top: 1px solid var(--stone);
  padding-top: var(--space-md);
  text-align: left;
}

.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--pine);
  color: var(--cream);
}
.btn-primary:hover {
  background: var(--rust);
  transform: translateY(-1px);
}

/* ============================================================
   PAGE HERO (Interior pages)
   ============================================================ */
.page-hero {
  background:
    radial-gradient(ellipse at 80% 50%, rgba(44,74,62,0.12) 0%, transparent 60%),
    linear-gradient(150deg, var(--cream) 0%, var(--sand) 100%);
  border-bottom: 1px solid var(--stone);
  padding: var(--space-xl) var(--space-md) var(--space-lg);
}

.page-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  color: var(--earth);
  margin-bottom: 0.5rem;
}

.page-hero .subtitle {
  font-size: 1.05rem;
  color: var(--bark);
  font-weight: 300;
  margin: 0;
}

/* ============================================================
   PAGE BODY
   ============================================================ */
.page-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

.page-body--wide {
  max-width: 1400px;
}

/* ============================================================
   QUICK-ACCESS GRID (Homepage)
   ============================================================ */
.quick-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

.quick-section-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: var(--space-md);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: var(--space-md);
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--earth);
  display: block;
}

.card:hover {
  background: #fff;
  border-color: var(--pine);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44,74,62,0.12);
}

.card-icon {
  width: 36px;
  height: 36px;
  color: var(--pine);
  margin-bottom: var(--space-sm);
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
  color: var(--earth);
}

.card p {
  font-size: 0.88rem;
  color: var(--bark);
  margin: 0;
  line-height: 1.5;
}

.example-block {
  background: #fff;
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--pine);
  letter-spacing: 0.03em;
}

.card-badge {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.18rem 0.55rem;
  background: var(--stone);
  color: var(--bark);
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Content block cards (non-link) */
.content-block {
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: var(--space-lg) var(--space-lg);
  margin-bottom: var(--space-md);
  scroll-margin-top: 5rem;
}

.content-block h2 {
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--stone);
}

.content-block h3 {
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.content-block > p {
  margin-bottom: var(--space-xs);
  font-size: 0.95rem;
}

.content-block ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: var(--space-sm);
}

.content-block ol {
  padding-left: 1.25rem;
  margin-bottom: var(--space-sm);
}

.content-block ul li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.65;
}

.content-block ol li {
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ============================================================
   WELCOME NOTE SECTION
   ============================================================ */
.welcome-note {
  background: var(--pine);
  padding: var(--space-xl) var(--space-md);
}

.welcome-note-inner {
  max-width: var(--body-w);
  margin: 0 auto;
}

.welcome-note h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: var(--space-md);
}

.welcome-note p {
  color: rgba(245,240,232,0.88);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.8;
}

.welcome-note .signature {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--sand);
  opacity: 0.9;
  margin-top: var(--space-md);
}

/* ============================================================
   LOCATION MAP SECTION
   ============================================================ */
.location-section {
  background: var(--sand);
  border-top: 1px solid var(--stone);
  padding: var(--space-xl) var(--space-md);
}

.location-inner {
  max-width: var(--body-w);
  margin: 0 auto;
}

.location-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 0.4rem;
}

.location-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  color: var(--earth);
  margin-bottom: 0.5rem;
}

.location-sub {
  font-size: 0.92rem;
  color: var(--bark);
  margin-bottom: var(--space-md);
}

.location-map {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--stone);
  margin-bottom: 0.75rem;
}

.location-osm-link {
  font-size: 0.82rem;
  color: var(--pine);
  text-decoration: none;
}

.location-osm-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   GUIDE LAYOUT — TWO-COLUMN WITH STICKY TOC
   ============================================================ */
.guide-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.guide-sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--space-md));
}

.guide-toc {
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.guide-toc-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--stone);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toc-section {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.toc-group {
  display: block;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 0.2rem;
}

.toc-section > ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--pine);
  padding-left: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  opacity: 0.85;
}

.toc-section > ul li a {
  display: block;
  font-size: 0.83rem;
  color: var(--pine);
  text-decoration: none;
  padding: 0.15rem 0;
  line-height: 1.4;
}

.toc-section > ul li a:hover {
  color: var(--earth);
  text-decoration: none;
  background: rgba(44,74,62,0.08);
  border-radius: 2px;
  margin-left: -0.4rem;
  padding-left: 0.4rem;
  margin-right: -0.4rem;
  padding-right: 0.4rem;
}

.guide-main {
  min-width: 0;
}

/* ============================================================
   GUIDE — SPEC GRID + SECTION HEADINGS + CALLOUTS
   ============================================================ */

/* Sub-section heading inside a content-block */
.content-block h3 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bark);
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--stone);
}

/* Two-column key/value spec grid */
.spec-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1.5rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.spec-grid dt {
  font-weight: 600;
  color: var(--earth);
  white-space: nowrap;
}

.spec-grid dd {
  color: var(--earth);
  margin: 0;
}

/* Important callout box */
.guide-callout {
  background: rgba(192,98,44,0.07);
  border-left: 3px solid var(--rust);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin: 0.85rem 0;
  line-height: 1.55;
}

.guide-callout strong { color: var(--rust); }

/* ============================================================
   RESPONSIBILITY TABLE
   ============================================================ */
.resp-table {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--stone);
  margin-bottom: var(--space-md);
}

.resp-row {
  display: grid;
  grid-template-columns: 1fr 100px 100px;
  align-items: center;
}

.resp-row--header {
  background: var(--earth);
  color: var(--sand);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.resp-row:not(.resp-row--header):nth-child(even) {
  background: rgba(212,201,181,0.2);
}

.resp-row:not(.resp-row--header):nth-child(odd) {
  background: #fff;
}

.resp-cell {
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
}

.resp-cell--center { text-align: center; }

.owner-badge {
  display: inline-block;
  background: rgba(44,74,62,0.12);
  color: var(--pine);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

.tenant-badge {
  display: inline-block;
  background: rgba(107,91,71,0.12);
  color: var(--bark);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

/* ============================================================
   ACCORDION (details/summary)
   ============================================================ */
.accordion {
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.accordion + .accordion { margin-top: -1px; border-radius: 0; }
.accordion:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.accordion:last-of-type  { border-radius: 0 0 var(--radius) var(--radius); }

.accordion summary {
  background: var(--sand);
  padding: 0.9rem 1.25rem;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}

.accordion summary::-webkit-details-marker { display: none; }

.accordion summary::after {
  content: '+';
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--bark);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 1rem;
}

.accordion[open] summary {
  background: var(--cream);
  border-bottom: 1px solid var(--stone);
}

.accordion[open] summary::after {
  transform: rotate(45deg);
}

.accordion-body {
  padding: 1rem 1.25rem;
  font-size: 0.93rem;
  background: var(--cream);
}

.accordion-body ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.accordion-body ul li { margin-bottom: 0.35rem; }

.accordion-body p { margin-bottom: 0.6rem; }
.accordion-body p:last-child { margin-bottom: 0; }

/* ============================================================
   EMERGENCY
   ============================================================ */
.emergency-callout {
  background: var(--cream);
  border: 2px solid var(--warn);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  margin-bottom: var(--space-lg);
}

.emergency-callout .e911 {
  font-family: var(--font-serif);
  font-size: 4rem;
  font-weight: 600;
  color: var(--warn);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.emergency-callout p {
  font-size: 1.05rem;
  color: var(--earth);
  margin: 0;
}

.shutoff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: var(--space-lg);
}

.shutoff-item {
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.shutoff-item h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.shutoff-item h3 svg { width: 22px; height: 22px; flex-shrink: 0; }

.shutoff-item p { font-size: 0.9rem; margin-bottom: 0.4rem; }

.shutoff-item ol {
  padding-left: 1.25rem;
  font-size: 0.88rem;
}

.shutoff-item ol li { margin-bottom: 0.3rem; }

.emergency-contacts {
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.ec-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--stone);
  font-size: 0.93rem;
}

.ec-row:last-child { border-bottom: none; }
.ec-row:nth-child(even) { background: rgba(212,201,181,0.15); }

.ec-row a { color: var(--pine); font-weight: 500; white-space: nowrap; }

/* ============================================================
   UTILITY SUMMARY (top of utilities page)
   ============================================================ */
.util-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: var(--space-lg);
}

.util-summary-col {
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.util-summary-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 0.6rem;
}

.util-summary-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.util-summary-col ul li {
  font-size: 0.9rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--stone);
  line-height: 1.45;
}

.util-summary-col ul li:last-child { border-bottom: none; }

.util-summary-note p {
  font-size: 0.9rem;
  color: var(--bark);
  line-height: 1.6;
  margin: 0;
}

.util-summary-note p + p { margin-top: 0.5rem; }

@media (max-width: 720px) {
  .util-summary { grid-template-columns: 1fr; }
}

/* ============================================================
   UTILITY SETUP CARDS
   ============================================================ */
.utility-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: var(--space-lg);
}

.utility-card {
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.utility-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.utility-card h3 svg { width: 20px; height: 20px; }

.utility-card p, .utility-card li { font-size: 0.9rem; }

.utility-card a { color: var(--pine); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }

/* Included vs tenant-paid table */
.util-table {
  width: 100%;
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.util-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  padding: 0.65rem 1rem;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--stone);
  align-items: center;
  gap: 1rem;
}

.util-row > span:nth-child(2),
.util-row > span:nth-child(3) {
  text-align: center;
}

.util-provider {
  font-size: 0.85rem;
  color: var(--bark);
  text-align: center;
}

.util-provider a {
  color: var(--pine);
  text-decoration: none;
}

.util-provider a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.util-row:last-child { border-bottom: none; }
.util-row--header {
  background: var(--earth);
  color: var(--sand);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.util-row:not(.util-row--header):nth-child(even) { background: rgba(212,201,181,0.18); }
.util-row:not(.util-row--header):nth-child(odd)  { background: var(--cream); }

.badge-owner    { display: inline-block; background: rgba(44,74,62,0.1);  color: var(--pine); font-size: 0.76rem; font-weight: 500; padding: 0.15rem 0.55rem; border-radius: 20px; }
.badge-tenant   { display: inline-block; background: rgba(107,91,71,0.1); color: var(--bark); font-size: 0.76rem; font-weight: 500; padding: 0.15rem 0.55rem; border-radius: 20px; }
.badge-included { display: inline-block; background: rgba(44,74,62,0.12); color: var(--pine); font-size: 0.76rem; font-weight: 500; padding: 0.15rem 0.55rem; border-radius: 20px; }

/* Meridian fee table */
.msmd-fee-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

.msmd-fee-table th,
.msmd-fee-table td {
  text-align: left;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--stone);
}

.msmd-fee-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bark);
  font-weight: 500;
}

.msmd-fee-table td:last-child,
.msmd-fee-table th:last-child {
  text-align: right;
}

.msmd-fee-total td {
  border-top: 2px solid var(--stone);
  border-bottom: none;
  padding-top: 0.45rem;
}

/* Tips list */
.tips-list {
  list-style: none;
  padding: 0;
}

.tips-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--stone);
  font-size: 0.93rem;
  padding-left: 1.25rem;
  position: relative;
}

.tips-list li:last-child { border-bottom: none; }

.tips-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--pine);
  font-size: 0.85rem;
}

/* ============================================================
   CONTACT
   ============================================================ */
.owner-card {
  max-width: 480px;
  background: var(--sand);
  border: 1px solid var(--stone);
  border-left: 4px solid var(--pine);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}

.owner-role {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 0.25rem;
}

.owner-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--earth);
  margin-bottom: 0.75rem;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--stone);
  padding-top: 0.75rem;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}
.contact-method:hover .contact-method-value { text-decoration: underline; color: var(--pine); }

.contact-method-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bark);
  min-width: 3.5rem;
}

.contact-method-value {
  font-size: 0.95rem;
  color: var(--pine);
  font-weight: 500;
}

.contact-guide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.contact-guide-item {
  background: var(--sand);
  border: 1px solid var(--stone);
  border-top: 3px solid var(--stone);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.contact-guide-item--email  { border-top-color: var(--pine); }
.contact-guide-item--phone  { border-top-color: var(--earth); }
.contact-guide-item--emergency { border-top-color: var(--rust); }

.contact-guide-item h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.contact-guide-item p { font-size: 0.88rem; color: var(--bark); margin-bottom: 0; }


/* ============================================================
   NEIGHBORHOOD
   ============================================================ */
.essentials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: var(--space-lg);
}

.essential-card {
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.essential-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.essential-card ul { list-style: disc; padding-left: 1.1rem; }
.essential-card ul li { font-size: 0.88rem; margin-bottom: 0.2rem; color: var(--bark); }

.amenity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.amenity-item {
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.amenity-item strong { font-size: 0.95rem; color: var(--earth); }
.amenity-item span { font-size: 0.82rem; color: var(--bark); }

/* ============================================================
   GALLERY
   ============================================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: var(--space-lg);
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sand);
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img { transform: scale(1.03); }

.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(transparent, rgba(15, 10, 5, 0.65));
  color: #fff;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover figcaption { opacity: 1; }

.gallery-item--placeholder {
  background: var(--stone);
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: default;
}

/* Camera icon */
.gallery-item--placeholder::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b5b47' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.5;
}

.gallery-item--placeholder figcaption {
  position: static;
  background: none;
  color: var(--earth);
  opacity: 1;
  text-align: center;
  font-size: 0.73rem;
  padding: 0 0.5rem;
  font-weight: 500;
  transition: none;
}

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   SMART HOME GRID
   ============================================================ */
.sh-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: var(--space-lg);
}

.sh-card {
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sh-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sh-card-title {
  font-size: 1rem;
  margin-bottom: 0.1rem;
  color: var(--earth);
}

.sh-card-sub {
  font-size: 0.78rem;
  color: var(--bark);
  margin: 0;
  font-weight: 400;
}

.sh-card p { font-size: 0.9rem; margin: 0; }

.sh-tips {
  list-style: disc;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sh-tips li { font-size: 0.83rem; color: var(--bark); }
.sh-tips a { color: var(--pine); }

.sh-app-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--stone);
}

.sh-app-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--pine);
  color: var(--cream);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}

.sh-app-badge:hover {
  background: var(--rust);
  transform: translateY(-1px);
}

.sh-help-link {
  font-size: 0.78rem;
  color: var(--bark);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: auto;
  transition: color 0.15s;
}

.sh-help-link:hover { color: var(--pine); }

@media (max-width: 720px) {
  .sh-grid { grid-template-columns: 1fr; }
}

.map-embed-block {
  margin-bottom: var(--space-lg);
}

.map-embed-block p {
  font-size: 0.88rem;
  color: var(--bark);
  margin-bottom: var(--space-sm);
}

.map-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--stone);
}

.map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: var(--space-md);
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.map-link-card:hover {
  background: #fff;
  border-color: var(--pine);
  box-shadow: 0 4px 16px rgba(44,74,62,0.10);
}

.map-link-card > svg:first-child {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--pine);
}

.map-link-card div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.map-link-card strong {
  font-size: 0.95rem;
  color: var(--earth);
}

.map-link-card span {
  font-size: 0.82rem;
  color: var(--bark);
  line-height: 1.4;
}

.map-link-arrow {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--bark);
  transition: color 0.2s;
}

.map-link-card:hover .map-link-arrow {
  color: var(--pine);
}

/* ============================================================
   SECTION HEADINGS (page body)
   ============================================================ */
.section-heading {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: var(--space-sm);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--stone);
}

/* ============================================================
   SCROLL-FADE ANIMATIONS
   ============================================================ */
.card,
.content-block,
.shutoff-item,
.contact-guide-item,
.utility-card,
.essential-card,
.amenity-item,
.accordion {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease var(--delay, 0s), transform 0.45s ease var(--delay, 0s);
}

.card.visible,
.content-block.visible,
.shutoff-item.visible,
.contact-guide-item.visible,
.utility-card.visible,
.essential-card.visible,
.amenity-item.visible,
.accordion.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Elements outside js observer (welcome note, manager card, etc.) start visible */
.welcome-note,
.emergency-callout,
.owner-card,
.resp-table,
.util-table,
.emergency-contacts {
  opacity: 1;
  transform: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--earth);
  padding: var(--space-xl) var(--space-md) 0;
}

.footer-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(212,201,181,0.2);
}

.logo--light .logo-badge { background: rgba(245,240,232,0.15); color: var(--sand); }
.logo--light .logo-text  { color: rgba(245,240,232,0.75); }

.footer-address {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: rgba(212,201,181,0.88);
  line-height: 1.5;
}

.footer-section-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(212,201,181,0.5);
  margin-bottom: 0.6rem;
}

.footer-contact p {
  font-size: 0.88rem;
  color: rgba(212,201,181,0.75);
  margin-bottom: 0.2rem;
}

.footer-contact a {
  color: rgba(245,240,232,0.8);
  transition: color 0.15s;
}

.footer-contact a:hover {
  color: var(--sand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-nav ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
}

.footer-nav a {
  font-size: 0.83rem;
  color: rgba(212,201,181,0.7);
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: rgba(245,240,232,0.95);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.78rem;
  color: rgba(212,201,181,0.5);
  border-top: 1px solid rgba(212,201,181,0.12);
}

.footer-bottom a {
  color: rgba(212,201,181,0.5);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: rgba(245,240,232,0.95);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-sep { opacity: 0.4; }

.footer-profile {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: rgba(212,201,181,0.45);
  line-height: 1.6;
}

.footer-availability {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.79rem;
  color: rgba(212,201,181,0.45);
}

.footer-landlord {
  margin-bottom: 0.85rem;
}

.footer-landlord-name {
  font-size: 0.85rem;
  color: rgba(245,240,232,0.82);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.footer-landlord a {
  display: block;
  font-size: 0.8rem;
  color: rgba(212,201,181,0.6);
  text-decoration: none;
  line-height: 1.6;
  transition: color 0.15s;
}

.footer-landlord a:hover {
  color: var(--sand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-contact-note {
  font-size: 0.74rem;
  color: rgba(212,201,181,0.38);
  font-style: italic;
  margin-top: 0.1rem;
}

/* Search page — Pagefind UI variable overrides */
.pagefind-search {
  margin: var(--space-lg) 0;
  --pagefind-ui-primary:    var(--pine);
  --pagefind-ui-text:       var(--earth);
  --pagefind-ui-background: var(--sand);
  --pagefind-ui-border:     var(--stone);
  --pagefind-ui-tag:        var(--sand);
  --pagefind-ui-font:       var(--font-sans);
}

[data-theme="dark"] .pagefind-search {
  --pagefind-ui-primary:    var(--pine);
  --pagefind-ui-text:       var(--earth);
  --pagefind-ui-background: var(--sand);
  --pagefind-ui-border:     var(--stone);
  --pagefind-ui-tag:        var(--stone);
}
[data-theme="dark"] .pagefind-ui__result-title a,
[data-theme="dark"] .pagefind-ui__result-link  { color: var(--pine); }
[data-theme="dark"] .pagefind-ui__result-excerpt { color: var(--earth); }
[data-theme="dark"] .pagefind-ui__result-inner mark {
  background: rgba(92,152,120,0.3);
  color: var(--earth);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pagefind-search {
    --pagefind-ui-primary:    var(--pine);
    --pagefind-ui-text:       var(--earth);
    --pagefind-ui-background: var(--sand);
    --pagefind-ui-border:     var(--stone);
    --pagefind-ui-tag:        var(--stone);
  }
  :root:not([data-theme="light"]) .pagefind-ui__result-title a,
  :root:not([data-theme="light"]) .pagefind-ui__result-link  { color: var(--pine); }
  :root:not([data-theme="light"]) .pagefind-ui__result-excerpt { color: var(--earth); }
  :root:not([data-theme="light"]) .pagefind-ui__result-inner mark {
    background: rgba(92,152,120,0.3);
    color: var(--earth);
  }
}

.search-note { color: var(--bark); font-size: 0.9rem; margin-top: var(--space-md); }

/* ============================================================
   RESOURCES — TABLE DIRECTORY
   ============================================================ */
.res-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.res-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bark);
  border-bottom: 2px solid var(--stone);
  padding: 0.5rem 0.75rem;
}

.res-table td {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--stone);
  vertical-align: top;
  line-height: 1.5;
}

.res-table tr:last-child td { border-bottom: none; }

.res-table td:nth-child(2) {
  width: 1%;
  min-width: 8rem;
  white-space: nowrap;
}

.res-table td:nth-child(3) {
  white-space: nowrap;
  font-weight: 600;
}

.res-table small {
  display: block;
  font-size: 0.78rem;
  color: var(--bark);
  font-weight: 400;
  margin-top: 0.1rem;
}

.res-table small a { color: var(--pine); }

.res-table a { color: var(--pine); }

.res-table--emergency tbody tr:first-child td {
  font-weight: 700;
  font-size: 1rem;
}

.res-table--emergency td:nth-child(2) a {
  font-size: 1.05rem;
}

.res-group-row td {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bark);
  background: var(--sand);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--stone);
}

.res-cat {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: var(--stone);
  color: var(--bark);
  white-space: nowrap;
  line-height: 1.4;
}

.res-cat--emergency {
  background: var(--badge-emergency-bg, #fee2e2);
  color: var(--badge-emergency-text, #991b1b);
}

.res-cat--property {
  background: var(--badge-property-bg, #dbeafe);
  color: var(--badge-property-text, #1e40af);
}


.sh-overview-table {
  margin-bottom: var(--space-lg);
}

.sh-overview-table td:nth-child(2) {
  font-weight: 400;
  white-space: normal;
}

.sh-overview-table td:nth-child(3) {
  white-space: nowrap;
  font-size: 0.85rem;
}

.res-divider {
  border: none;
  border-top: 1px solid var(--stone);
  margin: var(--space-lg) 0 0;
}

/* ============================================================
   RESOURCES — QUICK LINKS
   ============================================================ */
.links-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.link-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  margin: 0 -1rem;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.link-item:hover { background: var(--sand); }

.link-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--pine);
}

.link-desc {
  font-size: 0.83rem;
  color: var(--bark);
}

.links-list li + li { border-top: 1px solid var(--stone); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* 900px — footer 2-column */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand { grid-column: 1 / -1; }
  .shutoff-grid { grid-template-columns: 1fr; }
  .contact-guide { grid-template-columns: 1fr; }
  .utility-grid  { grid-template-columns: 1fr; }
  .guide-layout { grid-template-columns: 180px 1fr; gap: var(--space-md); }
}

/* 720px — single-column layouts */
@media (max-width: 720px) {
  .site-nav-desktop { display: none; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .guide-layout { grid-template-columns: 1fr; }
  .guide-sidebar { position: static; }

  .resp-row { grid-template-columns: 1fr; }
  .resp-cell--center { text-align: left; }
  .resp-row--header .resp-cell:not(:first-child) { display: none; }

  .quick-grid    { grid-template-columns: 1fr 1fr; }
  .essentials-grid { grid-template-columns: 1fr; }
  .amenity-grid { grid-template-columns: 1fr; }
}

/* Resources table — responsive cards on mobile */
@media (max-width: 640px) {
  .res-table--directory thead { display: none; }

  .res-table--directory tr {
    display: block;
    border: 1px solid var(--stone);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.85rem 0.85rem;
  }

  .res-table--directory tr:last-child { margin-bottom: 0; }

  .res-table--directory td {
    display: block;
    border-bottom: none;
    padding: 0.1rem 0;
    white-space: normal;
    min-width: 0;
    font-size: 0.875rem;
  }

  /* Name — prominent */
  .res-table--directory td:nth-child(1) {
    font-weight: 600;
    font-size: 0.92rem;
    padding-bottom: 0.2rem;
  }

  /* Category badge — sits right under name */
  .res-table--directory td:nth-child(2) {
    padding-bottom: 0.4rem;
  }

  /* Phone + Website labels */
  .res-table--directory td[data-label="Phone"]::before,
  .res-table--directory td[data-label="Website / Notes"]::before {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bark);
    margin-top: 0.3rem;
  }

  .res-table--directory td[data-label="Phone"]::before {
    content: "Phone";
  }

  .res-table--directory td[data-label="Website / Notes"]::before {
    content: "Website / Notes";
  }
}

/* 480px */
@media (max-width: 480px) {
  .quick-grid { grid-template-columns: 1fr; }
  .logo-text  { display: none; }
  .site-hero h1 { font-size: clamp(2.6rem, 11vw, 3.5rem); }
  .hero-sub { font-size: 1rem; }
}

/* ============================================================
   UTILITY COSTS PAGE
   ============================================================ */

/* Fixed fee grid */
.fee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--stone);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: var(--space-md);
}

.fee-cell { background: var(--cream); padding: 1.25rem 1.5rem; }
.fee-cell--total { background: var(--earth); }

.fee-cell-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 0.4rem;
}
.fee-cell--total .fee-cell-label { color: rgba(245,240,232,0.5); }

.fee-cell-amount {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--earth);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.fee-cell--total .fee-cell-amount { color: var(--sand); }

.fee-cell-note { font-size: 0.78rem; color: var(--bark); line-height: 1.5; }
.fee-cell--total .fee-cell-note { color: rgba(245,240,232,0.45); }

/* Season cards */
.season-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: var(--space-md);
}

.season-card {
  background: var(--cream);
  border: 1px solid var(--stone);
  border-top-width: 3px;
  border-radius: var(--radius);
  padding: 1.5rem;
}

.season-card--summer   { border-top-color: var(--rust); }
.season-card--shoulder { border-top-color: var(--pine); }
.season-card--winter   { border-top-color: #4a7fa5; }

.season-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}
.season-card--summer   .season-label { color: var(--rust); }
.season-card--shoulder .season-label { color: var(--pine); }
.season-card--winter   .season-label { color: #4a7fa5; }

.season-months { font-size: 0.78rem; color: var(--bark); margin-bottom: var(--space-sm); }

.season-util {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--earth);
  line-height: 1;
}

.season-util-note { font-size: 0.72rem; color: var(--bark); margin-bottom: var(--space-sm); }

.season-rows {
  border-top: 1px solid var(--stone);
  padding-top: var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.season-row { display: flex; justify-content: space-between; font-size: 0.82rem; }
.season-row-label { color: var(--bark); }
.season-row-val { font-weight: 600; color: var(--earth); }

.season-row--divider {
  border-top: 1px solid var(--stone);
  padding-top: 4px;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .season-cards { grid-template-columns: 1fr; }
}

/* Bar chart */
.util-chart {
  background: var(--cream);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: var(--space-md);
  overflow-x: auto;
}

.util-chart-legend {
  display: flex;
  gap: 1rem;
  margin-bottom: var(--space-sm);
  font-size: 0.78rem;
  color: var(--bark);
}

.util-chart-legend span { display: flex; align-items: center; gap: 6px; }
.util-chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

.util-bar-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 6px; min-width: 380px; }
.util-bar-month { min-width: 52px; font-size: 0.75rem; color: var(--bark); }
.util-bar-outer { flex: 1; height: 20px; background: var(--sand); border-radius: 3px; overflow: hidden; }
.util-bar-inner { height: 100%; display: flex; }
.util-bar-seg { height: 100%; }
.util-bar-nums { display: flex; gap: 6px; align-items: center; }
.util-bar-detail { min-width: 60px; text-align: right; font-size: 0.72rem; color: var(--bark); font-variant-numeric: tabular-nums; }
.util-bar-total { min-width: 60px; text-align: right; font-size: 0.82rem; font-weight: 600; color: var(--earth); font-variant-numeric: tabular-nums; }

.util-chart-footer {
  border-top: 1px solid var(--stone);
  padding-top: var(--space-xs);
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  color: var(--bark);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}

/* Year group label inside bar chart */
.util-year-sep {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bark);
  padding: 0.65rem 0 0.3rem;
  border-bottom: 1px solid var(--stone);
  margin-bottom: 0.4rem;
  min-width: 380px;
}

/* All-in cost summary table */
.cost-summary-table th:not(:first-child),
.cost-summary-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.cost-total-row td { background: var(--sand); border-top: 2px solid var(--stone); }

/* Amenity value comparison panels */
.value-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: var(--space-md);
}
.value-compare-panel {
  background: var(--cream);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.value-compare-panel h3 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bark);
  margin: 0 0 0.85rem;
}
.value-compare-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.84rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid var(--stone);
  gap: 0.75rem;
}
.value-compare-row:last-of-type { border-bottom: none; }
.value-compare-row span:last-child { font-weight: 600; color: var(--earth); white-space: nowrap; }
.value-compare-row--total { border-top: 2px solid var(--stone); margin-top: 2px; padding-top: 0.45rem; }
.value-compare-row--total span:first-child { font-weight: 600; color: var(--earth); }
.value-compare-row--total span:last-child { color: var(--rust); }
.value-compare-note { font-size: 0.75rem; color: var(--bark); margin-top: 0.75rem; line-height: 1.5; }
@media (max-width: 640px) { .value-compare { grid-template-columns: 1fr; } }

/* 2×2 grid for the 4 "included" cards */
.included-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: var(--space-md);
}
@media (max-width: 640px) {
  .included-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   SITEMAP PAGE
   ============================================================ */
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg) var(--space-md);
}

.sitemap-group h2 {
  font-size: 1.1rem;
  color: var(--pine);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--stone);
}

.sitemap-group ul {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sitemap-group li { list-style: none; }

.sitemap-group a {
  font-size: 0.92rem;
  color: var(--earth);
  text-decoration: underline;
  text-decoration-color: var(--stone);
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.sitemap-group a:hover { color: var(--rust); text-decoration-color: var(--rust); }

@media (max-width: 640px) {
  .sitemap-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   STYLE GUIDE
   ============================================================ */
.sg-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: var(--space-sm);
}

.sg-swatch {
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 1px solid var(--stone);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.sg-swatch-label { font-size: 0.88rem; font-weight: 500; }
.sg-swatch code { font-size: 0.72rem; opacity: 0.8; }

.sg-type-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.sg-type-sample {
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--stone);
}
.sg-type-sample:last-child { border-bottom: none; }

.sg-spacing-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: var(--space-sm);
}

.sg-spacing-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sg-spacing-bar {
  height: 12px;
  background: var(--pine);
  border-radius: 2px;
  min-width: 8px;
}

.sg-spacing-item code {
  font-size: 0.82rem;
  white-space: nowrap;
}

.sg-spacing-item span {
  font-size: 0.82rem;
  color: var(--bark);
}

.sg-token-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.25rem;
  margin-top: var(--space-sm);
}

.sg-token-list dt {
  font-size: 0.88rem;
}

.sg-token-list dd {
  font-size: 0.88rem;
  color: var(--bark);
}

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-page-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--sand);
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  margin-bottom: var(--space-md);
}

.search-page-bar svg { color: var(--bark); flex-shrink: 0; }

.search-page-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--earth);
  outline: none;
}

.search-page-bar input::placeholder { color: var(--bark); opacity: 0.7; }

.search-results {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.search-result {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
}

.search-result:hover { background: var(--sand); }

.search-result-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--pine);
  margin-bottom: 0.15rem;
}

.search-result-desc {
  font-size: 0.82rem;
  color: var(--bark);
  line-height: 1.45;
}

.search-no-results {
  font-size: 0.92rem;
  color: var(--bark);
  padding: 1rem 0;
}

.search-note {
  font-size: 0.82rem;
  color: var(--bark);
  margin-top: var(--space-sm);
}
