/* CLIA Lab Citations – styles */

:root {
  /* Sound theme (matches soundlabconsult.com) */
  --navy: #0b2545;
  --navy-2: #13315c;
  --ink: #0f172a;
  --red: #c8102e;
  --red-d: #a50d26;
  --line: #e2e8f0;
  --surface: #f5f7fa;
  --wrap: 1160px;
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-muted: #f5f7fa;
  --text: #334155;
  --text-muted: #64748b;
  --accent: #13315c;
  --accent-deep: #0b2545;
  --accent-dim: rgba(19, 49, 92, 0.1);
  --accent-pop: #c8102e;
  --accent-pop-dim: rgba(200, 16, 46, 0.08);
  --accent-gradient: linear-gradient(135deg, #0b2545 0%, #13315c 100%);
  --accent-gradient-hover: linear-gradient(135deg, #0f172a 0%, #0b2545 100%);
  --success: #059669;
  --warning: #d97706;
  --error: #dc2626;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: var(--font-sans);
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  width: 100%;
  min-height: 100vh;
}

/* Header */
.site-header {
  background: var(--accent-gradient);
  border-bottom: none;
  padding: 1.5rem 1.5rem;
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255,255,255,0.15), transparent);
  pointer-events: none;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.site-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 0.5rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  line-height: 1.1;
}

.header-hero {
  padding-bottom: 2rem;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0.65rem;
}

.hero-lead {
  font-family: var(--font-display);
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(1rem, 2.1vw, 1.2rem);
  font-weight: 600;
  line-height: 1.45;
  max-width: 42rem;
  margin: 0 auto 0.75rem;
}

.hero-lead strong {
  font-weight: 800;
  color: #fff;
}

.tagline {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

.site-intro {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
  font-weight: 400;
  margin: 0 auto 1rem;
  max-width: 40rem;
  line-height: 1.55;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.btn-lg {
  padding: 0.65rem 1.35rem;
  font-size: 0.95rem;
  border-radius: 10px;
}

.btn-hero-primary {
  background: #fff;
  color: #0c4a6e;
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-hero-primary:hover {
  background: #f0f9ff;
  color: #082f49;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.btn-hero-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn-hero-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.65);
  transform: translateY(-1px);
}

.hero-trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin: 1.35rem auto 0;
  padding: 0;
  max-width: 46rem;
}

.hero-trust li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.35;
  text-align: left;
}

.hero-trust li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(165, 243, 252, 0.95);
  box-shadow: 0 0 0 3px rgba(165, 243, 252, 0.2);
}

.source-attribution {
  margin: 1.25rem auto 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}

.source-link-inline {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-intro a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-intro a:hover {
  color: #e8f4ff;
}

.source-link {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 500;
}

.source-link:hover {
  text-decoration: underline;
  color: #fff;
}

/* Nav */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.nav-link.active {
  color: #0c4a6e;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

/* Main */
.main {
  width: 100%;
  margin: 0;
  padding: 1rem 1.5rem;
  flex: 1 0 auto;
  overflow: visible;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text);
}

/* Homepage marketing & SEO sections */
.home-marketing {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 0.25rem;
}

.home-section h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.home-section-lead {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.1rem;
  max-width: 52rem;
}

.value-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .value-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.value-card {
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: linear-gradient(145deg, #f8fafc 0%, #fff 55%);
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-sm);
}

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

.value-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.audience-pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.audience-pills li {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-display);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent-deep);
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.home-seo-corpus .corpus-intro {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 1rem;
}

.term-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .term-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.term-block {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-muted);
  border: 1px solid #e2e8f0;
}

.term-block dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.term-block dd {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.term-block code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: #fff;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.filters-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: -0.35rem 0 1rem;
  max-width: 48rem;
}

.home-faq {
  margin-bottom: 2rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 0;
  background: var(--bg-elevated);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  list-style: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.faq-item summary::after {
  content: '+';
  margin-left: auto;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: '–';
}

.faq-item summary:hover {
  background: var(--bg-muted);
}

.faq-item p {
  margin: 0;
  padding: 0 1rem 1rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  border-top: 1px solid #f1f5f9;
  padding-top: 0.75rem;
}

.faq-item p a {
  color: var(--accent-deep);
  font-weight: 600;
}

/* Filters */
.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  align-items: end;
}

.filters-grid .field.span-2 {
  grid-column: span 2;
}

.filters-grid .field.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.field input,
.field select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.multi-select-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent) 100%);
  color: #fff;
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0c4a6e 0%, var(--accent-deep) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid #cbd5e1;
  font-weight: 500;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-muted);
  border-color: var(--accent);
}

/* Results */
.results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.results-header h2 {
  margin-bottom: 0;
}

.results-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.loading,
.empty,
.prompt,
.error {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.error {
  color: var(--error);
}

.empty code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-muted);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  color: var(--text);
}

.table-wrap {
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.pagination-wrap {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pagination .btn-pagination {
  min-width: 5rem;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.pagination .btn-page {
  min-width: 2.25rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
}

.pagination .btn-page[aria-current="page"] {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent) 100%);
  border-color: var(--accent);
}

.pagination .btn-page:hover:not([aria-current="page"]) {
  color: var(--text);
  background: var(--bg-muted);
}

.pagination .btn-pagination:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-ellipsis {
  color: var(--text-muted);
  padding: 0 0.25rem;
  font-size: 0.9rem;
}

#results-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 0.8rem;
  table-layout: fixed;
  line-height: 1.35;
}

#results-table th,
#results-table td {
  padding: 0.4rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  overflow: visible;
  text-overflow: clip;
  hyphens: auto;
}

#results-table td a,
#results-table td .link-pdf {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Long facility / address lines: links are inline and can resist wrapping without a max width */
#results-table td:nth-child(2) .google-search-link,
#results-table td:nth-child(3) .google-maps-link {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

/* Column widths using percentage-based widths for fixed table layout */
#results-table th:nth-child(1),
#results-table td:nth-child(1) {
  width: 6%;
}

#results-table th:nth-child(2),
#results-table td:nth-child(2) {
  width: 12%;
}

#results-table th:nth-child(3),
#results-table td:nth-child(3) {
  width: 8%;
}

#results-table th:nth-child(4),
#results-table td:nth-child(4) {
  width: 6%;
}

#results-table th:nth-child(5),
#results-table td:nth-child(5) {
  width: 3.5%;
}

/* Zip column */
#results-table th:nth-child(6),
#results-table td:nth-child(6) {
  width: 4%;
}

/* Phone column */
#results-table th:nth-child(7),
#results-table td:nth-child(7) {
  width: 5%;
}

/* Lab Director — often long names; needs room to wrap within the cell */
#results-table th:nth-child(8),
#results-table td:nth-child(8) {
  width: 10%;
}

/* Survey date column */
#results-table th:nth-child(9),
#results-table td:nth-child(9) {
  width: 5.5%;
}

/* Type column */
#results-table th:nth-child(10),
#results-table td:nth-child(10) {
  width: 4.5%;
}

/* X4 Tag column */
#results-table th:nth-child(11),
#results-table td:nth-child(11) {
  width: 5%;
}

/* Deficiencies column */
#results-table th:nth-child(12),
#results-table td:nth-child(12) {
  width: 8%;
}

/* Summary column */
#results-table th:nth-child(13),
#results-table td:nth-child(13) {
  width: 8%;
}

/* Website column */
#results-table th:nth-child(14),
#results-table td:nth-child(14) {
  width: 5%;
}

/* Report column */
#results-table th:nth-child(15),
#results-table td:nth-child(15) {
  width: 3.5%;
}

/* Actions/Save column */
#results-table th:nth-child(16),
#results-table td:nth-child(16) {
  width: 3%;
}

#results-table th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: relative;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid var(--accent);
}

#results-table th.sortable {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

#results-table th.sortable:hover {
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
}

#results-table th .th-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  white-space: normal;
  line-height: 1.25;
  flex-wrap: wrap;
}

#results-table th .sort-icon {
  font-size: 0.9rem;
  opacity: 0.3;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

#results-table th.sortable:hover .sort-icon {
  opacity: 0.6;
}

#results-table th .column-filter {
  width: 100%;
  padding: 0.2rem 0.3rem;
  font-size: 0.7rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-top: 0.25rem;
}

#results-table th .column-filter:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

#results-table th .column-filter::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

#results-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

#results-table tbody tr:hover {
  background: #f1f5f9;
}

#results-table code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-muted);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  color: var(--text);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

#results-table .tags-cell {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-wrap: break-word;
}

#results-table .tags-cell code.tag {
  margin-right: 0.25rem;
  margin-bottom: 0.15rem;
  display: inline-block;
}

#results-table .summary-cell {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

#results-table .summary-cell .summary-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text);
  cursor: help;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.link-pdf {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.link-pdf:hover {
  text-decoration: underline;
  color: var(--accent-deep);
}

.google-search-link {
  color: #1a73e8;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, text-decoration 0.2s;
}

.google-search-link:hover {
  color: #1557b0;
  text-decoration: underline;
}

.google-search-link:visited {
  color: #681da8;
}

.google-maps-link {
  color: #34a853;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, text-decoration 0.2s;
  font-weight: 500;
}

.google-maps-link:hover {
  color: #2d8f47;
  text-decoration: underline;
}

.google-maps-link:visited {
  color: #2d8f47;
}

/* Map Section */
.map-section {
  margin-bottom: 1rem;
  position: relative;
  flex-shrink: 0;
}

.map-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.map-header h2 {
  margin-bottom: 0;
}

.map-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.map-container {
  width: 100%;
  height: 800px;
  min-height: 800px;
  max-height: 800px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: var(--bg-elevated);
  position: relative;
  flex-shrink: 0;
}

/* Google Maps InfoWindow customization */
.gm-style .gm-style-iw-c {
  border-radius: var(--radius);
  font-family: var(--font-sans);
  padding: 0;
  max-width: 450px !important;
  min-width: 350px !important;
  max-height: 500px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.gm-style .gm-style-iw-d {
  padding: 0.6rem;
  font-size: 0.85rem;
  overflow: visible !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  word-wrap: break-word !important;
  max-height: none !important;
}

/* Ensure InfoWindow content wrapper doesn't overflow */
.gm-style .gm-style-iw-d > div {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* Ensure InfoWindow is positioned correctly and visible */
.gm-style-iw {
  max-width: 450px !important;
  min-width: 350px !important;
  max-height: 500px !important;
}

/* Ensure InfoWindow close button is visible */
.gm-style .gm-style-iw-tc {
  z-index: 1001 !important;
}

.gm-style .gm-style-iw-d h3 {
  margin: 0 0 0.4rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.gm-style .gm-style-iw-d h3 a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.gm-style .gm-style-iw-d h3 a:hover {
  text-decoration: underline;
}

.gm-style .gm-style-iw-d p {
  margin: 0.2rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.gm-style .gm-style-iw-d .popup-line {
  margin: 0.15rem 0;
}

.gm-style .gm-style-iw-d .popup-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin-top: 0.5rem;
  display: inline-block;
}

.gm-style .gm-style-iw-d .popup-link:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid #e2e8f0;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover {
  text-decoration: underline;
  color: var(--accent-deep);
}

/* Reports page */
.reports-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.reports-total {
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

.reports-tables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.reports-table-block {
  overflow: hidden;
}

.reports-table-block h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.reports-table th,
.reports-table td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.reports-table th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: #f8fafc;
}

.reports-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.reports-table code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: var(--bg-muted);
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--text-muted);
}

#reports-facilities-table-wrap {
  overflow-x: auto;
}

#reports-facilities-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#reports-facilities-table th,
#reports-facilities-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

#reports-facilities-table th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid var(--accent);
}

#reports-facilities-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

#reports-facilities-table tbody tr:hover {
  background: #f1f5f9;
}

#reports-facilities-table code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-muted);
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

/* Downloads page */
.downloads-hero {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem 2.5rem;
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.06) 0%, transparent 100%);
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--accent-pop);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.downloads-hero h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.downloads-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 780px;
  margin: 0 auto;
}

.downloads-desc strong {
  color: var(--text);
  font-weight: 600;
}

#btn-checkout {
  padding: 0.65rem 1.5rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.downloads-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.downloads-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.months-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.month-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.month-checkbox:hover {
  background: var(--bg-muted);
}

.month-checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.field-hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.downloads-summary {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.05) 0%, var(--bg-elevated) 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
}

.downloads-summary h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
  gap: 1rem;
}

.summary-item:last-of-type {
  border-bottom: none;
}

.summary-item span {
  color: var(--text-muted);
}

.summary-item strong {
  color: var(--text);
  text-align: right;
}

.summary-item small {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.summary-total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--accent);
  font-size: 1.25rem;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 700;
}

.summary-total strong {
  color: var(--text);
}

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

.pricing-item {
  background: var(--bg-elevated);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pricing-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.pricing-item h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.pricing-item .price {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent-deep);
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
}

.pricing-item .price-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.pricing-item ul {
  list-style: none;
  text-align: left;
  margin-top: 1rem;
}

.pricing-item ul li {
  padding: 0.4rem 0;
  color: var(--text);
  font-size: 0.9rem;
  position: relative;
  padding-left: 1.5rem;
}

.pricing-item ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 600;
}

.purchases-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.purchase-item {
  background: var(--bg-elevated);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.purchase-item.expired {
  opacity: 0.6;
}

.purchase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.purchase-header h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.purchase-status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.purchase-status.active {
  background: var(--success);
  color: #fff;
}

.purchase-status.expired {
  background: var(--text-muted);
  color: #fff;
}

.purchase-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}

.purchase-details p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}

.purchase-details strong {
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.expired-notice,
.pending-notice {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  margin: 0;
  padding: 0.5rem;
  background: var(--bg-muted);
  border-radius: 4px;
}

/* Paywall blur overlay */
.paywall-overlay {
  position: relative;
}

.paywall-blur {
  position: relative;
  transition: filter 0.3s ease;
}

/* Container for search results table - needed for overlay positioning */
#search-paywall-blur-container {
  position: relative;
}

.paywall-blur.unblurred {
  filter: none;
}

/* Blur specific cells in search results table */
/* SOLUTION: Use :has() to detect cells with overlays and handle them differently */
.paywall-blur:not(.unblurred) .paywall-cell {
  position: relative;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

/* For cells WITHOUT pdf-report-blur: blur the entire cell */
.paywall-blur:not(.unblurred) .paywall-cell:not(:has(.pdf-report-blur)) {
  filter: blur(8px);
}

/* For cells WITH pdf-report-blur: don't blur the cell, blur only the content */
/* This prevents the overlay from being blurred */
@supports selector(:has(*)) {
  .paywall-blur:not(.unblurred) .paywall-cell:has(.pdf-report-blur) {
    filter: none;
  }
  
  /* Blur all direct children of the cell except pdf-report-blur */
  .paywall-blur:not(.unblurred) .paywall-cell:has(.pdf-report-blur) > *:not(.pdf-report-blur) {
    filter: blur(8px);
    pointer-events: none;
  }
  
  /* Also blur nested content in those children */
  .paywall-blur:not(.unblurred) .paywall-cell:has(.pdf-report-blur) > *:not(.pdf-report-blur) * {
    filter: blur(8px);
  }
}

/* Fallback for browsers without :has() support */
/* In this case, we blur the cell but the overlay will be slightly affected */
@supports not selector(:has(*)) {
  .paywall-blur:not(.unblurred) .paywall-cell {
    filter: blur(8px);
  }
}

/* Keep pdf-report-blur container unblurred and interactive */
.paywall-blur:not(.unblurred) .paywall-cell .pdf-report-blur {
  position: relative;
  display: inline-block;
  filter: none !important;
  pointer-events: auto !important;
  z-index: 10;
}

/* Large modal-style overlay (e.g. legacy markup). Never apply to --compact rows: 280px min-width
   breaks out of the Lab Director column and stacks over other rows. */
#search-paywall-blur-container:not(.unblurred) .paywall-cell .pdf-report-blur .citation-unlock-overlay:not(.citation-unlock-overlay--compact) {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background: var(--bg-elevated) !important;
  border: 3px solid var(--accent) !important;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
  text-align: center;
  min-width: 280px;
  max-width: 400px;
  filter: none !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  -webkit-font-smoothing: antialiased;
  font-smooth: always;
}

/* Blur only the link inside pdf-report-blur */
.paywall-blur:not(.unblurred) .paywall-cell .pdf-report-blur .blurred-link {
  filter: blur(8px);
  pointer-events: none;
  opacity: 0.6;
}

.paywall-blur.unblurred .paywall-cell {
  filter: none;
  pointer-events: auto;
  -webkit-user-select: auto;
  user-select: auto;
}

/* Editable fields for super admin */
.editable-field-container {
  position: relative;
  max-width: 100%;
}

.editable-field-display {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2rem;
  max-width: 100%;
}

.editable-field-value {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 0.25rem 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.btn-edit-field {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  opacity: 0.6;
}

.btn-edit-field:hover {
  background: var(--bg-elevated, #f1f5f9);
  color: var(--accent, #3b82f6);
  opacity: 1;
}

.btn-edit-field:active {
  background: var(--bg-elevated, #e2e8f0);
}

.btn-edit-field svg {
  width: 14px;
  height: 14px;
}

/* Smaller edit button for linked fields */
.btn-edit-field-small {
  width: 16px;
  height: 16px;
  margin-left: 0.25rem;
  opacity: 0.5;
}

.btn-edit-field-small:hover {
  opacity: 1;
}

.btn-edit-field-small svg {
  width: 12px;
  height: 12px;
}

/* Linked editable field container */
.editable-linked-field .editable-field-display {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 100%;
}

.editable-linked-field .editable-field-value {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.editable-field-input {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.editable-field-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.editable-field-input-wrapper .editable-field {
  flex: 1;
}

.btn-save-field-checkbox {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid #10b981;
  background: #10b981;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-save-field-checkbox:hover {
  background: #059669;
  border-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.btn-save-field-checkbox:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-save-field-checkbox:disabled {
  background: #9ca3af;
  border-color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.btn-save-field-checkbox svg {
  width: 16px;
  height: 16px;
}

.editable-field-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.editable-field {
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.editable-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.editable-field:hover {
  border-color: #94a3b8;
}

.editable-textarea {
  resize: vertical;
  min-height: 60px;
  font-family: var(--font-sans);
  line-height: 1.5;
}

/* For textarea fields, the checkbox should be positioned differently */
.editable-field-input-wrapper:has(.editable-textarea) {
  align-items: flex-start;
}

.editable-field-input-wrapper:has(.editable-textarea) .btn-save-field-checkbox {
  margin-top: 0.25rem;
}

.editable-lab-director {
  display: flex;
  gap: 0.25rem;
  flex-direction: column;
}

.editable-lab-director .editable-field {
  width: 100%;
}

.save-cell {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.save-column {
  min-width: 80px;
  text-align: center;
}

.btn-save-row {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  white-space: nowrap;
  min-width: 60px;
}

/* Ensure editable fields are not blurred even in paywall cells */
.paywall-cell .editable-field {
  filter: none !important;
  pointer-events: auto !important;
  -webkit-user-select: auto !important;
  user-select: auto !important;
}

/* Paywall content - only for reports section, not search results */
#paywall-content.paywall-content {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: var(--bg-elevated);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 500px;
  width: 90%;
}

/* Map popup paywall should not use absolute positioning */
.gm-style .map-popup-paywall {
  position: relative !important;
  z-index: 1 !important;
  margin: 0.5rem 0 0.25rem 0 !important;
  padding: 0.75rem !important;
  background: #f1f5f9 !important;
  border-radius: 6px !important;
  border: 2px solid #0ea5e9 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.gm-style .map-popup-paywall h4 {
  font-size: 0.95rem !important;
  margin: 0 0 0.4rem 0 !important;
}

.gm-style .map-popup-paywall p {
  font-size: 0.8rem !important;
  margin: 0.3rem 0 !important;
  line-height: 1.3;
}

.gm-style .map-popup-paywall div[style*="font-size: 1.5rem"] {
  font-size: 1.25rem !important;
  margin: 0.4rem 0 !important;
}

.gm-style .map-popup-paywall button {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.85rem !important;
  margin-top: 0.4rem !important;
}

.paywall-content h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.paywall-content p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.paywall-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-deep);
  margin: 1rem 0;
}

.paywall-content .btn {
  margin-top: 0.5rem;
}

@media (max-width: 640px) {
  .filters-grid .field.span-2 {
    grid-column: span 1;
  }

  .main {
    padding: 1rem;
  }

  #results-table th,
  #results-table td {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .downloads-filters {
    grid-template-columns: 1fr;
  }

  .months-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .paywall-content {
    padding: 1.5rem;
    top: 40px;
  }

  .paywall-content h3 {
    font-size: 1.25rem;
  }

  .paywall-price {
    font-size: 1.75rem;
  }
}

/* Citation unlock blur styles */
.citation-blur-overlay {
  position: relative;
  display: inline-block;
}

.citation-blur-overlay .citation-blurred {
  filter: blur(8px);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  opacity: 0.6;
  transition: filter 0.3s ease, opacity 0.3s ease;
  position: relative;
  z-index: 1;
}

.citation-blur-overlay.unlocked .citation-blurred {
  filter: none;
  pointer-events: auto;
  -webkit-user-select: auto;
  user-select: auto;
  opacity: 1;
}

.citation-unlock-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: var(--bg-elevated);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  min-width: 280px;
  max-width: 400px;
}

/* Map popup content container */
.gm-style .map-popup-content {
  max-width: 100%;
  box-sizing: border-box;
}

/* Map popup unlock container */
.gm-style .map-popup-unlock-container {
  position: relative;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  width: 100%;
}

/* Compact unlock overlay for map popup PDF links */
.gm-style .citation-blur-overlay.map-popup-blur {
  position: relative;
  display: inline-block;
  margin-bottom: 0.4rem;
}

.gm-style .map-popup-unlock-box {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  margin-top: 0.4rem;
  margin-bottom: 0.25rem;
  padding: 0.75rem;
  min-width: 100%;
  max-width: 100%;
  width: 100%;
  z-index: 1;
  display: block;
  box-sizing: border-box;
}

.gm-style .map-popup-unlock-box h4 {
  font-size: 0.95rem !important;
  margin: 0 0 0.4rem 0 !important;
  font-weight: 600;
}

.gm-style .map-popup-unlock-box .unlock-desc {
  font-size: 0.8rem !important;
  margin: 0.3rem 0 !important;
  color: var(--text-muted);
  line-height: 1.3;
}

.gm-style .map-popup-unlock-box .unlock-desc-small {
  font-size: 0.75rem !important;
  color: var(--text-muted);
  margin: 0.25rem 0 !important;
  line-height: 1.3;
}

.gm-style .map-popup-unlock-box .citation-unlock-price {
  font-size: 1.25rem !important;
  margin: 0.4rem 0 !important;
  font-weight: 700;
}

.gm-style .map-popup-unlock-box .btn {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.85rem !important;
  margin-top: 0.4rem !important;
  width: 100%;
}

.gm-style .map-popup-unlock-box .unlock-session {
  font-size: 0.7rem !important;
  color: var(--text-muted);
  margin: 0.3rem 0 0 0 !important;
}

.citation-unlock-overlay.hidden {
  display: none;
}

.citation-unlock-overlay h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.citation-unlock-overlay p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.citation-unlock-price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-deep);
  margin: 0.75rem 0;
}

.citation-unlock-overlay .btn {
  margin-top: 0.5rem;
  width: 100%;
}

/* Map info window styles - popup content is always visible, only PDF link is blurred */

/* PDF report link blur */
.pdf-report-blur {
  position: relative;
  display: inline-block;
}

.pdf-report-blur .blurred-link {
  filter: blur(8px);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  opacity: 0.6;
  position: relative;
  z-index: 1;
}

.pdf-report-blur.unlocked .blurred-link {
  filter: none;
  pointer-events: auto;
  -webkit-user-select: auto;
  user-select: auto;
  opacity: 1;
}

/* Ensure unlock overlay appears above blurred content */
.pdf-report-blur {
  position: relative;
  display: inline-block;
}

/* Compact PDF unlock: single button per row, contained in Lab Director cell */
#search-paywall-blur-container:not(.unblurred) .paywall-cell-pdf-report {
  display: table-cell;
  vertical-align: middle;
  text-align: center;
  overflow: hidden;
  position: relative;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

#search-paywall-blur-container:not(.unblurred) .paywall-cell-pdf-report .pdf-report-blur--compact {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0;
  min-height: 0;
}

#search-paywall-blur-container:not(.unblurred) .paywall-cell-pdf-report .pdf-report-blur:not(.pdf-report-blur--compact) {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: inherit;
  margin: 0 auto;
}

.pdf-report-blur.pdf-report-blur--compact {
  display: flex;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Wins over .paywall-blur .paywall-cell .pdf-report-blur { display: inline-block } */
.paywall-blur:not(.unblurred) .paywall-cell .pdf-report-blur.pdf-report-blur--compact {
  display: flex !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.btn-citation-unlock--row {
  display: block;
  width: 100%;
  max-width: 7.25rem;
  margin: 0 auto;
  padding: 0.3rem 0.45rem !important;
  font-size: 0.68rem !important;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 6px;
  white-space: nowrap;
  box-sizing: border-box;
}

.paywall-blur:not(.unblurred) .paywall-cell .pdf-report-blur--compact .btn-citation-unlock--row {
  filter: none !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 5;
}

.pdf-report-blur.unlocked .btn-citation-unlock--row {
  display: none;
}

/* Fallback for when not in search results - use relative positioning */
.pdf-report-blur .citation-unlock-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background: var(--bg-elevated);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  min-width: 280px;
  max-width: 400px;
  filter: none !important;
  pointer-events: auto !important;
  opacity: 1 !important;
}

/* For map popup, make unlock overlay relative so it's always visible */
.gm-style .pdf-report-blur .citation-unlock-overlay,
.gm-style .citation-blur-overlay .citation-unlock-overlay {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  width: 100%;
  max-width: 100%;
  display: block;
}

/* Authentication UI */
.main-auth {
  max-width: 500px;
  margin: 2rem auto;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--bg-muted);
}

.auth-tab {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -0.25rem;
}

.success-message {
  background: var(--success);
  color: white;
  padding: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

/* Dashboard */
.main-dashboard {
  max-width: 1000px;
  margin: 2rem auto;
}

.dashboard-profile,
.dashboard-purchases {
  margin-bottom: 2rem;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.purchases-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.purchase-item {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-muted);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.2s;
}

.purchase-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.purchase-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.purchase-header h4 {
  margin: 0;
  font-size: 1.1rem;
}

.purchase-status {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.purchase-status.active {
  background: var(--success);
  color: white;
}

.purchase-status.expired {
  background: var(--text-muted);
  color: white;
}

.purchase-status.pending {
  background: var(--warning);
  color: white;
}

.purchase-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.purchase-details p {
  margin: 0;
}

.expired-notice,
.pending-notice {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Admin Panel */
.main-admin {
  max-width: 1200px;
  margin: 2rem auto;
}

.admin-users,
.admin-purchases {
  margin-bottom: 2rem;
}

.admin-users-list,
.admin-purchases-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-user-item,
.admin-purchase-item {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-muted);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.admin-user-header,
.admin-purchase-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.admin-user-header h4,
.admin-purchase-header h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
}

.admin-user-email,
.admin-purchase-email {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.admin-user-date,
.admin-purchase-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.admin-user-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-muted);
}

.admin-user-actions label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.admin-purchase-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-purchase-details p {
  margin: 0;
}

.admin-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Navigation updates */
.nav-link-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-link-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Facility pages: related information tags */
.facility-page .backlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.facility-page .backlink {
  display: inline-flex;
  align-items: center;
  margin-right: 0;
  line-height: 1.4;
}


/* =====================================================================
   SOUND THEME LAYER — visual system shared with soundlabconsult.com
   (navy #0b2545, red CTA #c8102e, Inter, light-surface hero, 12px cards).
   Applies to the SPA, facility pages, Terms and Privacy (site-theme.css).
   ===================================================================== */
body { background: #fff; color: var(--text); font-size: 16px; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -0.02em; }
a { color: var(--navy-2); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* Top bar */
.topbar { background: var(--navy); color: #dbe4f0; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 34px; }
.topbar a { color: #fff; font-weight: 700; text-decoration: none; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; color: var(--ink); padding: 0; border-bottom: 1px solid var(--line); box-shadow: none; overflow: visible; }
.site-header::before { display: none; }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.logo-mark { width: 36px; height: 36px; display: block; }
.logo-text { font-weight: 800; font-size: 19px; letter-spacing: -0.02em; color: var(--navy); line-height: 1; }
.logo-text span { color: var(--red); }
.site-nav { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: 0 0 0 auto; flex-wrap: wrap; }
.nav-link { color: var(--ink); font-family: var(--font-sans); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 8px; background: none; border: 0; cursor: pointer; }
.nav-link:hover { color: var(--navy); background: var(--surface); }
.nav-link.active { color: var(--red); background: transparent; box-shadow: none; }
.nav-link[hidden] { display: none; }

/* Buttons */
.btn { font-family: var(--font-sans); font-weight: 600; border-radius: 8px; transition: background .15s, color .15s, border-color .15s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-cta, .btn-primary, .btn-hero-primary { background: var(--red); color: #fff; border: 1px solid var(--red); box-shadow: none; }
.btn-cta:hover, .btn-primary:hover, .btn-hero-primary:hover { background: var(--red-d); border-color: var(--red-d); color: #fff; transform: none; box-shadow: none; }
.btn-ghost, .btn-secondary, .btn-hero-ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-ghost:hover, .btn-secondary:hover, .btn-hero-ghost:hover { background: var(--navy); color: #fff; border-color: var(--navy); transform: none; }
.header-cta { padding: 10px 16px; font-size: 14px; flex-shrink: 0; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 8px; }

/* Hero (search route only) */
.hero { background: linear-gradient(180deg, var(--surface) 0%, #fff 100%); border-bottom: 1px solid var(--line); padding: 64px 0 72px; }
body[data-route]:not([data-route="home"]) .hero { display: none; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.header-hero { padding: 0; text-align: left; }
.hero-eyebrow { color: var(--red); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.25rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; color: var(--ink); margin-bottom: 18px; text-shadow: none; }
.hero-lead { font-family: var(--font-sans); color: var(--text); font-size: 18px; font-weight: 400; line-height: 1.6; margin: 0 0 14px; max-width: 40rem; }
.hero-lead strong { color: var(--ink); font-weight: 700; }
.site-intro { color: var(--muted, #64748b); font-size: 15px; margin: 0 0 26px; max-width: 40rem; }
.site-intro a { color: var(--navy-2); }
.site-intro a:hover { color: var(--red); }
.hero-cta-row { justify-content: flex-start; gap: 12px; margin: 0; }
.hero-trust { justify-content: flex-start; margin: 26px 0 0; gap: 10px 22px; max-width: none; }
.hero-trust li { color: var(--ink); font-size: 14px; font-weight: 500; padding-left: 26px; }
.hero-trust li::before { top: 1px; width: 18px; height: 18px; border-radius: 50%; background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; box-shadow: none; }
.source-attribution { margin: 20px 0 0; }
.source-link, .source-link:hover { color: var(--text-muted); font-size: 13px; }
.hero-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 28px; }
.hero-panel-title { font-weight: 700; color: var(--ink); font-size: 15px; margin-bottom: 14px; }
.hero-panel-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.hero-panel-list li { display: grid; gap: 2px; padding: 12px 14px; border-radius: 8px; background: var(--surface); font-size: 14px; color: var(--text); border-left: 3px solid var(--red); }
.hero-panel-list li span { font-weight: 700; color: var(--navy); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.hero-panel-link { font-weight: 700; color: var(--red); text-decoration: none; font-size: 14px; }
.hero-panel-link:hover { text-decoration: underline; }

/* Main content + cards */
.main { max-width: var(--wrap); margin: 0 auto; padding: 48px 24px 64px; }
.home-marketing { max-width: none; }
.card { border: 1px solid var(--line); border-radius: 12px; box-shadow: none; padding: 28px; margin-bottom: 24px; background: #fff; }
.card h2, .home-section h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); font-weight: 800; color: var(--ink); letter-spacing: -0.025em; }
.home-section-lead, .filters-intro, .corpus-intro { color: var(--text); font-size: 16px; }
.value-card { border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 22px; box-shadow: none; }
.value-card-title { color: var(--ink); font-weight: 700; font-size: 17px; }
.value-card-title::before { content: ''; display: block; width: 36px; height: 36px; border-radius: 8px; margin-bottom: 14px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%230b2545' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat; }
.audience-pills li { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; font-weight: 600; }
.term-block { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.term-block dt { color: var(--navy); }
.faq-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.faq-item summary { color: var(--ink); font-weight: 700; }
.faq-item summary::after { color: var(--red); }
.faq-item p a, .card a:not(.btn) { color: var(--navy-2); }

/* Search filters: fix the tall-gap layout caused by multi-selects */
.filters-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px 18px; align-items: start; }
.filters-grid select[multiple] { height: 220px; }
.filters-grid .field:has(select[multiple]) { grid-column: span 2; }
.filters-grid .field.actions { align-self: end; }
.field label { color: var(--ink); font-weight: 600; font-size: 13px; }
.field input, .field select { border: 1px solid #cbd5e1; border-radius: 8px; font-family: var(--font-sans); font-size: 15px; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(19, 49, 92, .15); }
#results-table th { background: var(--surface); color: var(--ink); }
.cms-link, .cms-link code { color: var(--navy-2); }

/* Footer */
.site-footer { max-width: none; width: 100%; margin: 0; padding: 48px 0 0; text-align: left; background: var(--navy); color: #c7d2e2; border-top: 0; font-size: 14px; }
.site-footer a { color: #fff; font-weight: 500; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 36px; }
.footer-logo { font-weight: 800; font-size: 19px; color: #fff; margin-bottom: 10px; }
.footer-logo span { color: #ff6b81; }
.footer-brand p:not(.footer-logo) { max-width: 30rem; line-height: 1.6; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-h { color: #fff; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; padding-bottom: 22px; font-size: 13px; color: #9fb0c7; }

/* Static pages (facility, terms, privacy) */
.page-body { max-width: var(--wrap); margin: 0 auto; padding: 40px 24px 64px; }
.page-crumbs { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
.page-crumbs a { color: var(--navy-2); text-decoration: none; font-weight: 600; }
.page-crumbs a:hover { color: var(--red); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding: 44px 0 52px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .header-cta { display: none; }
}
@media (max-width: 640px) {
  .topbar .hide-sm { display: none; }
  .header-row { flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 6px; }
  .site-nav { margin: 0; width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .nav-link { padding: 8px 10px; font-size: 14px; white-space: nowrap; }
  .filters-grid .field:has(select[multiple]) { grid-column: span 1; }
  .hero-cta-row .btn { width: 100%; }
  .card { padding: 20px; }
}

/* Homepage state directory links */
.state-links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.state-links a { display: block; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; background: #fff; }
.state-links a:hover { border-color: var(--navy); color: var(--navy); }

/* Dedicated search page (#/search) */
.search-page-header { padding: 8px 0 20px; }
.search-page-header .page-crumbs { font-size: 14px; color: var(--text-muted, #64748b); margin-bottom: 14px; }
.search-page-header .page-crumbs a { color: var(--navy-2); text-decoration: none; }
.search-page-header .page-crumbs a:hover { color: var(--red); text-decoration: underline; }
.search-page-header h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; color: var(--ink); line-height: 1.15; margin: 0 0 10px; }
.search-page-lead { color: var(--text); font-size: 16px; line-height: 1.6; max-width: 52rem; margin: 0; }
.search-page-lead a { color: var(--navy-2); }
