:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #555;
  --accent: #0b3d91;
  --crisis: #b91c1c;
  --card-bg: #f8f9fa;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
header, .site-header {
  border-bottom: 1px solid var(--border);
  padding: 12px 0 16px;
  text-align: center;
  position: relative;
}
.header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}
.pryvix-mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}
.header-logo {
  height: 32px;
  width: auto;
  max-width: 120px;
}
.tagline {
  color: var(--muted);
  font-size: 0.7rem;
  margin: 0;
}
.header-seal {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex: none;
}
.header-main {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.brand-logo {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.crisis-banner {
  background: #fef2f2;
  color: var(--crisis);
  padding: 10px 0;
  font-size: 0.95rem;
}
.btn-crisis, .btn-help {
  display: inline-block;
  margin-left: 12px;
  background: var(--crisis);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}
.btn-help { margin-left: 0; margin-top: 8px; }

h1 { margin-top: 24px; font-size: 2.25rem; text-align: center; }
.subtitle { text-align: center; font-size: 1.25rem; color: var(--muted); margin: 16px 0 20px; }

.crisis-click {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #8b1e3f;
  color: white;
  padding: 14px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  margin: 0 auto 24px;
  max-width: 520px;
  text-align: center;
}
.crisis-click:hover { background: #6e1832; }
.click-here {
  background: white;
  color: #8b1e3f;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal[hidden] { display: none; }
.modal-content {
  background: white;
  border-radius: 8px;
  padding: 28px 24px 20px;
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #333;
}
.modal-content h2 { margin: 0 0 12px; font-size: 1.35rem; }
.crisis-options { list-style: none; padding: 0; margin: 16px 0; }
.crisis-options li { border-bottom: 1px solid #eee; padding: 10px 0; }
.crisis-options a { color: #0b3d91; text-decoration: none; font-weight: 500; }
.crisis-options a:hover { text-decoration: underline; }
.purpose { color: var(--muted); margin-bottom: 24px; }

.search-section {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.search-section input, .search-section select, .search-section button {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}
#search-btn { background: var(--accent); color: white; border: none; cursor: pointer; }

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.category-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
}
.category-card:hover, .category-card.active { border-color: var(--accent); }
.category-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.category-card p { margin: 0; font-size: 0.9rem; color: var(--muted); }

#results-list { display: flex; flex-direction: column; gap: 12px; }
.facility {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.facility h3 { margin: 0 0 6px; }
.badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
}
.badge-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  color: #fff;
  cursor: help;
  vertical-align: middle;
  line-height: 1.3;
}
.badge-verified { background: #1b7f4e; }
.badge-classifier-inferred { background: #b36b00; }
.badge-unverified { background: #5c6570; }
.meta { color: var(--muted); font-size: 0.9rem; }
.qualifiers, .restrictions { margin: 6px 0 0; font-size: 0.9rem; }

.how-to { margin: 40px 0; }
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 40px;
  font-size: 0.9rem;
  color: var(--muted);
}
.disclaimer { font-style: italic; }
.support { font-weight: 600; color: var(--text); margin-top: 16px; }

@media (max-width: 600px) {
  .search-section { flex-direction: column; }
  .search-section > * { width: 100%; }
  .header-bar { min-height: 48px; }
  .header-seal { width: 48px; height: 48px; }
  .header-logo { height: 28px; }
  .brand-logo { max-width: 90%; }
}

.support { font-weight: 700; color: var(--text); margin-top: 20px; font-size: 1.65rem; line-height: 1.3; }
.btn-help {
  display: inline-block;
  margin-left: 0;
  margin-top: 12px;
  background: var(--crisis);
  color: white;
  padding: 12px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
  max-width: 36em;
}
.sponsor { margin: 16px 0 0; color: var(--text); font-weight: 600; }
.sponsor-loc { margin: 4px 0 0; color: var(--text); }
.va-note { margin: 12px 0 0; font-style: italic; font-size: 0.8rem; color: var(--muted); max-width: 40em; }
.legacy-help { margin: 12px 0 0; color: var(--muted); }
.legacy-help a { color: var(--accent); }
.legal-nav { margin: 16px 0 8px; }
.legal-nav a { color: var(--accent); }

/* Legal pages */
.legal { max-width: 800px; }
.legal h1 { font-size: 1.75rem; margin: 16px 0 8px; text-align: left; }
.legal .effective { color: var(--muted); margin: 0 0 24px; }
.legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.legal h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.legal p, .legal li { font-size: 0.98rem; }
.legal ul, .legal ol { padding-left: 1.25rem; }
.back-link { margin: 8px 0 0; }
.legal-header .brand-logo { max-width: 420px; }
.legal-header { padding-bottom: 12px; }

/* First-visit consent */
html:not(.consent-accepted) { overflow: hidden; }
html:not(.consent-accepted) #site-wrap { pointer-events: none; user-select: none; }
#consent-modal { display: none; }
html:not(.consent-accepted) #consent-modal {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 16px;
}
.consent-dialog {
  background: #fff;
  border-radius: 10px;
  max-width: 640px;
  width: 100%;
  margin: 24px auto;
  padding: 0 0 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  outline: none;
}
.consent-emergency {
  background: #8b1e3f;
  color: #fff;
  padding: 12px 16px 16px;
  border-radius: 10px 10px 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.consent-emergency .ce-line { margin: 4px 0; line-height: 1.4; font-weight: 600; }
.consent-emergency a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 6px;
  line-height: 1.2;
  box-sizing: border-box;
}
.consent-emergency a.ce-link { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.55); }
.consent-emergency a.ce-link:hover { background: rgba(255,255,255,0.28); }
.consent-emergency a:focus-visible { outline: 3px solid #ffd400; outline-offset: 2px; }
.consent-emergency .ce-911 { font-size: 1.3rem; font-style: italic; font-weight: 700; }
.consent-emergency a.ce-btn-911 {
  background: #ffd400;
  color: #1a1a1a;
  font-style: italic;
  padding: 8px 16px;
  margin-left: 6px;
  border: 2px solid #ffd400;
}
.consent-emergency a.ce-btn-911:hover { background: #ffe352; }
.consent-emergency a.ce-btn-911:focus-visible { outline: 3px solid #fff; }
.consent-emergency .ce-more { white-space: nowrap; }
.consent-emergency .ce-or { margin: 0 4px; }
.consent-dialog h2 { margin: 20px 20px 8px; font-size: 1.35rem; }
.consent-body { padding: 0 20px; }
.consent-body ul { padding-left: 1.2rem; }
.consent-body li { margin: 8px 0; }
.consent-agree {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0 14px;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.consent-agree input { margin-top: 4px; flex: none; width: 18px; height: 18px; }
.consent-agree label { font-weight: 600; cursor: pointer; }
.consent-enter {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.consent-enter:disabled { background: #9aa3b2; cursor: not-allowed; }
@media (max-width: 600px) {
  .btn-help { font-size: 1rem; }
  .support { font-size: 1.5rem; }
  .consent-dialog { margin: 8px auto; }
  .consent-emergency a { min-height: 44px; padding: 8px 10px; }
  .consent-emergency .ce-911 { font-size: 1.2rem; }
}

/* Transportation box (v4) */
.empty-prompt { color: var(--muted); font-size: 1rem; }
.transport-intro { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 16px; background: var(--card-bg); }
.transport-intro p { margin: 0; font-size: 0.95rem; }
.transport-group { margin: 12px 0 0; font-size: 1.1rem; }
.scope-tag { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 6px; border: 1px solid var(--border); color: var(--muted); }
.scope-regional { border-color: #b36b00; color: #b36b00; }
.transport-offers, .transport-how { margin: 6px 0 0; font-size: 0.95rem; }
.transport-links { margin: 6px 0 0; padding-left: 20px; font-size: 0.9rem; }
.transport-source { margin-top: 6px; font-size: 0.8rem; word-break: break-all; }

/* Grok header/footer update (t49, Nov 17 2026). Scoped so legal-page footers are unchanged. */
.top-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 16px;
  margin: -12px 0 10px;
  font-size: 0.9rem;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  text-align: right;
}
.need-facility {
  color: #0b3d91;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid #0b3d91;
  border-radius: 6px;
  padding: 4px 10px;
  background: #eaf1fb;
}
.need-facility:hover, .need-facility:focus { text-decoration: underline; }
.phone-blue { color: #0b3d91; font-weight: 700; }
.top-bar .sponsor {
  margin: 0;
  text-align: right;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.3;
}
.site-footer { text-align: center; }
.site-footer .support { text-align: center; margin: 12px 0 4px; }
.not-va { text-align: center; font-size: 0.9rem; color: var(--muted); margin: 0 0 12px; }
.btn-help-blue {
  display: inline-block;
  background: #0b3d91;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  margin: 4px auto;
}
.btn-help-blue:hover, .btn-help-blue:focus { background: #092d6b; }
.help-note { text-align: center; font-size: 0.8rem; color: var(--muted); margin: 4px 0 12px; }
.legal-links { text-align: center; margin: 12px 0; }
.legal-links a { color: #0b3d91; text-decoration: none; }
.legal-links a:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .top-bar { align-items: center; text-align: center; }
  .top-bar .sponsor { text-align: center; }
}

/* v5: center the consent Enter button (Bo t50u). The button shares .consent-body with the summary list, so it is centered on its own. */
.consent-enter {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: fit-content;
  margin: 0 auto;
}

/* v6: small Reset / Refresh buttons in the search bar (ported from Grok t51) */
.search-section .btn-secondary {
  background: #e5e7eb;
  color: #1a1a1a;
  border: 1px solid #d1d5db;
  padding: 10px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
@media (max-width: 600px) {
  .search-section .btn-secondary { padding: 8px 10px; }
}
.search-section .btn-secondary:hover { background: #d1d5db; }
.search-section .btn-secondary:disabled { cursor: progress; opacity: 0.8; }
@media (min-width: 601px) {
  .search-section #location-input { flex: 1 1 140px; min-width: 120px; }
}

@media (max-width: 359px) {
  .consent-emergency .ce-more { white-space: normal; }
}
.consent-emergency .ce-nowrap { white-space: nowrap; }

/* v9: facility block centered in the logo row (left logo | centered block | right seal) */
.header-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "logo fac seal";
  align-items: center;
}
.header-bar .pryvix-mark { grid-area: logo; justify-self: start; }
.header-bar .header-seal { grid-area: seal; justify-self: end; }
.facility-block {
  grid-area: fac;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  font-size: 0.9rem;
}
.facility-block .sponsor {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.3;
}
@media (max-width: 760px) {
  .header-bar {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "logo seal" "fac fac";
    row-gap: 10px;
  }
  .facility-block { max-width: 100%; }
  .facility-block .need-facility { max-width: 100%; }
}

/* v10: bookmarks, personal ratings (1 = best), share */
.facility-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e5e7eb; position: relative; }
.facility-actions .act-btn { background: #f3f4f6; color: #1f2937; border: 1px solid #d1d5db; border-radius: 6px; padding: 5px 10px; font-size: 0.85rem; cursor: pointer; }
.facility-actions .act-btn:hover, .facility-actions .act-btn:focus-visible { background: #e5e7eb; }
.facility-actions .bookmark-btn.on { background: #fff7e0; border-color: #f59e0b; color: #92400e; }
.rating-group { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; color: #374151; }
.rating-label small { color: #6b7280; }
.rating-stars { display: inline-flex; gap: 0; }
.star-btn { background: none; border: 0; padding: 2px 3px; font-size: 1.25rem; line-height: 1; color: #cbd5e1; cursor: pointer; }
.star-btn.on { color: #f59e0b; }
.star-btn:hover, .star-btn:focus-visible { color: #d97706; outline-offset: 1px; }
.rating-value { min-width: 1.2em; font-weight: 600; }
.share-menu { position: absolute; z-index: 20; top: 100%; right: 0; display: flex; gap: 6px; align-items: center; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.share-menu a { padding: 6px 10px; border-radius: 6px; background: #eef2ff; color: #1e3a8a; text-decoration: none; font-size: 0.9rem; }
.share-menu .share-close { background: none; border: 0; font-size: 1.2rem; cursor: pointer; padding: 0 4px; }
.saved-note { font-size: 0.85rem; color: #4b5563; margin: 0 0 10px; }
.link-btn { background: none; border: 0; padding: 0; color: #1d4ed8; text-decoration: underline; cursor: pointer; font-size: inherit; }
.my-rank { margin-top: 6px; font-size: 0.9rem; }
.saved-flash:empty { display: none; }
.saved-flash { color: #92400e; font-size: 0.85rem; }
@media (max-width: 600px) {
  .star-btn { font-size: 1.45rem; padding: 4px; }
}
