/* Lab-only additions on top of the main site's styles.css and prep.css. */
.lab-hh-slot { display: flex; align-items: center; position: relative; }
.lab-hh-control { position: relative; color: #c6d1de; font-size: 0.9rem; }
.lab-hh-control > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 6px 12px; border: 1px solid rgba(255,255,255,0.36); border-radius: 8px;
  background: rgba(255,255,255,0.06); color: #fff; font-weight: 650;
}
.lab-hh-control > summary::-webkit-details-marker { display: none; }
.lab-hh-control > summary::after { content: "▾"; font-size: 0.8em; }
.lab-hh-label { color: #c6d1de; font-weight: 600; }
.lab-hh-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(92vw, 380px);
  padding: 14px 16px; border-radius: 10px; background: #0b1b2e; border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}
.lab-hh-group { margin: 4px 0 8px; color: #fff; font-weight: 750; font-size: 0.9rem; }
.lab-hh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.lab-hh-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; font-weight: 650; color: #c6d1de; }
.lab-hh-field select {
  min-height: 38px; padding: 4px 8px; border: 1px solid rgba(255,255,255,0.36); border-radius: 8px;
  background: #fff; color: var(--ink-900, #0f172a); font: inherit; font-size: 0.95rem; font-weight: 700;
}
/* Homepage: picker shown inline, panel always open */
.lab-hh-inline .lab-hh-control > summary { display: none; }
.lab-hh-inline .lab-hh-panel { position: static; width: auto; background: rgba(255,255,255,0.06); box-shadow: none; }
@media (max-width: 520px) { .lab-hh-label { display: none; } }
@media print { .lab-hh-slot { display: none; } }
.lab-hh-inline { margin-top: 14px; display: block; }

/* Header area indicator */
.lab-hh-slot { gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; flex-shrink: 1; }
.lab-area > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lab-area {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 10px; border-radius: 8px;
  color: #c6d1de; font-size: 0.85rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  max-width: 52vw; overflow: hidden; text-overflow: ellipsis;
}
.lab-area strong { color: #fff; margin-left: 3px; overflow: hidden; text-overflow: ellipsis; }
/* name may take two lines on phones; "· change" always stays visible */
.lab-area > span { display: inline-flex; align-items: center; }
.lab-area-change { flex-shrink: 0; }
@media (max-width: 520px) {
  .lab-area { max-width: calc(100vw - 185px); white-space: normal; line-height: 1.2; }
  .lab-area > span { max-width: 100%; flex-direction: column; align-items: flex-end; }
  .lab-area-dot { display: none; }
  .lab-area-change { font-size: 0.75rem; font-weight: 500; }
  .lab-area strong { flex: 0 1 auto; min-width: 0; width: max-content; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; overflow-wrap: anywhere; text-align: right; }
}
.lab-area:hover, .lab-area:focus-visible { color: #fff; text-decoration: underline; }
@media (max-width: 520px) { .lab-area-label { display: none; } .lab-area { padding-inline: 4px; font-size: 0.8rem; } }

/* "For your area" box on regular pages */
.lab-local {
  margin: 1.6em 0; padding: 14px 16px 6px; border: 1px solid #bfd3ea; border-left: 4px solid var(--blue-500, #2563eb);
  border-radius: 10px; background: #f4f8fd;
}
.prose .lab-local-head, .lab-local-head { margin: 0 0 8px; font-size: 0.95rem; color: var(--ink-700, #334155); }
.lab-local-head strong { color: var(--ink-900, #0f172a); }
.lab-local-sub { border-top: 1px solid #d8e4f2; }
.lab-local-sub > summary {
  cursor: pointer; padding: 10px 0; font-weight: 750; color: var(--ink-900, #0f172a); list-style: none;
  display: flex; justify-content: space-between; gap: 12px;
}
.lab-local-sub > summary::-webkit-details-marker { display: none; }
.lab-local-sub > summary::after { content: "+"; font-weight: 800; color: var(--blue-500, #2563eb); }
.lab-local-sub[open] > summary::after { content: "–"; }
.lab-local-body { padding: 0 0 8px; font-size: 0.96rem; }
.lab-local-body > :first-child { margin-top: 0; }
.lab-local-body p, .lab-local-body li { overflow-wrap: anywhere; }
.lab-local-body ul ul { margin: 0.3em 0; }
.prose .lab-local-none, .lab-local-none { margin: 1.2em 0; font-size: 0.92rem; color: var(--ink-700, #334155); }
@media print { .lab-local-sub > summary::after { content: none; } .lab-local-sub:not([open]) > .lab-local-body { display: block; } }
.lab-local-intro p { margin: 0 0 8px; font-size: 0.94rem; }

/* Region / hazard gating (port/regionalize.py + js/local.js) */
.rg-alt { display: none; }
.rg-swap > .rg-orig { display: none; }
.rg-swap > .rg-alt { display: inline; }
.rg-off, .rg-empty { display: none !important; }
/* generic stand-ins: shown with no ZIP (and with no JS) and outside the metros; metros fill slots instead */
html[data-area="charleston"] [data-rg="generic"], html[data-area="metro"] [data-rg="generic"] { display: none !important; }
.lab-local-none p { margin: 0 0 6px; }
.lab-local-none p:last-child { margin-bottom: 0; }
.lab-local-caveat { font-weight: 600; }
.lab-local-links { font-size: 0.9rem; }
/* Local-only links hidden unless the ZIP is in a metro with local data (local.js) */
.lab-hide { display: none !important; }
/* Index: grouped page list (production nav order) */
.lab-topic-list h2 { margin-top: 1.6em; }
.lab-topic-groups { display: grid; grid-template-columns: 1fr; gap: 4px 28px; }
@media (min-width: 760px) { .lab-topic-groups { grid-template-columns: 1fr 1fr; } }
.lab-topic-group h3 { margin: 1.1em 0 0.35em; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-700, #334155); }
.lab-topic-group ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border, #e2e8f0); }
.lab-topic-group li { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--border, #e2e8f0); }
.lab-topic-group li > a { font-weight: 700; }
.lab-topic-desc { display: block; margin-top: 2px; color: var(--ink-700, #475569); font-size: 0.9rem; line-height: 1.4; }
.lab-topic-local { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 999px; background: #e0ecfb; color: #1e40af; font-size: 0.72rem; font-weight: 750; vertical-align: 2px; }
/* 390px: long URLs wrap, wide tables scroll inside the page instead of widening it */
.prose a, .prose li, .prose p { overflow-wrap: anywhere; }
.prose table { display: block; max-width: 100%; overflow-x: auto; }

/* Charleston parity (docs/charleston-parity-contract.md) */
[data-cp-slot], template.cp-tpl { display: none !important; }
.cp-on > .rg-orig, .cp-on > .rg-alt, .cp-on.rg-swap > .rg-alt { display: none !important; }
.cp-hidden { display: none !important; }
details.cp-more > summary { cursor: pointer; color: var(--blue-700, #1d4ed8); }
details.cp-more > ul { margin: .35em 0 .2em; }

/* "Last checked <Month YYYY>" under local contacts and links (review item 4). */
.lab-checked { margin: 10px 0 0; font-size: 0.85rem; color: #475569; }

/* Primary buttons: white text needs at least 4.5:1 (review item 5). #2b84ea was 3.76:1 and the #56a4ff
   hover about 2.6:1; #1d6fd0 is 4.96:1 and the #1a5fb4 hover 6.4:1. */
.button-primary { background: #1d6fd0; }
.button-primary:hover, .button-primary:focus-visible { background: #1a5fb4; }

/* Folded Charleston resources on /local/ (neutral_static): long sign-up URLs wrap on phones; wide tables scroll */
.lab-local-chs{overflow-wrap:anywhere}
.lab-local-chs table{display:block;overflow-x:auto;max-width:100%}
