/* Texas elevator lookup. Status colors never use the site's orange: orange means "ours" or
   "tap this", so an expired building can never look like our advertisement. Expired red, due
   soon yellow, current blue, no date gray; each pill also differs in fill and border, and each
   word says it, so color is never the only signal. */
:root { --st-expired: #E5484D; --st-soon: #F5C400; --st-current: #4C8DFF; --st-none: #8a9198; }

[hidden] { display: none !important; }
.narrow > * { max-width: 44rem; }

/* The hub. On a phone: the search, the map, then a picked building, then the key and the cities.
   On a computer: those in a panel down the left, and the map filling the rest of the screen. */
.lookup { padding: 0; }
.lookup-grid { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5) var(--gutter) 0; }
.lookup-side { display: contents; }
.lookup-head { order: 1; }
.lookup-right { order: 2; }
.detail { order: 3; }
.lookup-info { order: 4; }
.lookup h1 { margin: 0 0 var(--s4); font-size: clamp(1.75rem, 6.5vw, 2.5rem); }
.search input { width: 100%; min-height: 50px; padding: 0.6rem 0.9rem; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); color: var(--text); font: inherit; font-size: max(1rem, 16px); }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus { outline: 3px solid var(--orange); outline-offset: 2px; border-color: var(--orange); }
.tools { display: flex; align-items: center; gap: var(--s3); margin: var(--s2) 0 0; min-height: 44px; }
.tools .btn { flex: none; min-height: 44px; padding: 0 0.95rem; font-size: 0.9rem; }
.count { margin: 0; color: var(--soft); font-size: 0.95rem; }
.search .blist { margin: var(--s2) 0 0; }
.more { margin: var(--s3) 0 0; min-height: 44px; }
.lookup-info h2 { margin: var(--s5) 0 var(--s2); font-size: 1.25rem; }
@media (min-width: 56rem) {
	.lookup-grid { display: grid; grid-template-columns: 25rem minmax(0, 1fr); gap: 0; padding: 0; height: calc(100vh - 3.75rem); min-height: 34rem; }
	.lookup-side { display: block; overflow-y: auto; padding: var(--s5) var(--s5) var(--s6); border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
	/* A picked building takes the place of the results, the key and the cities until it's closed. */
	.lookup-side.picked #results, .lookup-side.picked #more, .lookup-side.picked .lookup-info { display: none; }
	.lookup-side .cities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The map box: full-bleed and near-square on a phone, so Texas fills it; the whole right side on a computer. */
.lookup-map { position: relative; margin: 0 calc(-1 * var(--gutter)); background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
#map { width: 100%; height: min(105vw, 62vh); min-height: 18rem; }
@media (min-width: 40rem) and (max-width: 55.99rem) { .lookup-map { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); } }
@media (min-width: 56rem) {
	.lookup-right, .lookup-map { height: 100%; }
	.lookup-map { margin: 0; border: 0; }
	#map { height: 100%; min-height: 0; }
}

/* Status buttons float on the map they act on. */
.chips { position: absolute; z-index: 2; top: 0.6rem; left: 0.6rem; display: flex; gap: 0.4rem; margin: 0; }
.chip-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 0.75rem; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(11, 21, 17, 0.92); color: var(--text); font: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.chip-btn .pill { margin: 0 -0.3rem; }
.chip-btn[aria-pressed="true"] { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.map-reset { position: absolute; z-index: 1; left: 0.6rem; bottom: 0.6rem; min-height: 36px; padding: 0 0.75rem; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(11, 21, 17, 0.92); color: var(--text); font: inherit; font-weight: 700; font-size: 0.8rem; cursor: pointer; }

/* While the map loads: Texas's outline and one line. The same box says so if something failed. */
.map-wait { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 0.75rem; margin: 0; padding: var(--s4); background: var(--bg); color: var(--muted); font-size: 0.95rem; text-align: center; }
.map-wait p { margin: 0; max-width: 20rem; }
.map-wait svg { width: min(55vw, 15rem); height: auto; }
.map-wait path { fill: none; stroke: var(--line-2); stroke-width: 1.2; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
	.map-wait path { stroke-dasharray: 4 3; animation: march 1.4s linear infinite; }
	@keyframes march { to { stroke-dashoffset: -14; } }
}
/* A message once the map is up: a bar at the top, the map still usable. */
.map-wait.toast { inset: auto 0.6rem auto 0.6rem; top: 3.4rem; display: block; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); color: var(--soft); text-align: left; }
.map-wait.toast svg { display: none; }
.link-btn { min-height: 44px; padding: 0 0.25rem; border: 0; background: none; color: var(--orange-2); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.map-load { margin: var(--s4); }

/* The key, notes and cities */
.key { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.8rem; color: var(--muted); font-size: 0.8rem; }
.key li { display: flex; align-items: center; gap: 0.35rem; }
.dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; }
.dot-expired { background: var(--st-expired); }
.dot-long { border: 2px solid var(--st-expired); }
.dot-soon { background: var(--st-soon); }
.dot-current { background: var(--st-current); width: 0.6rem; height: 0.6rem; }
.dot-none { border: 1.5px solid var(--st-none); width: 0.6rem; height: 0.6rem; }
.map-note { margin: var(--s2) 0 0; color: var(--muted); font-size: 0.875rem; max-width: 44rem; }

/* A picked building: everything the state lists for it, beside the map (under it on a phone). */
.detail:focus { outline: 0; }
.detail .back { margin: 0 0 var(--s1) -0.25rem; }
.detail h2 { margin: 0 0 0.1rem; font-size: clamp(1.4rem, 5vw, 1.75rem); }
.detail h2 a { color: var(--text); text-decoration: none; }
.detail h2 a:hover { color: var(--orange-2); }
.detail .where { margin: 0 0 var(--s2); color: var(--muted); font-size: 0.9rem; }
.detail .units { margin: var(--s4) 0; }
.detail .unit-head h3 { font-size: 1rem; }
.facts-line { margin: 0; color: var(--soft); font-size: 0.875rem; line-height: 1.5; }
.facts-line.is-overdue { color: var(--soft); font-weight: 700; } /* said in words; red is only for an expired certificate */
.detail-go { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.detail-go .btn { min-height: 44px; padding: 0 1rem; font-size: 0.9rem; }

/* Status pills: expired solid, due soon a thick outline, current a thin one, no date dashed. */
.pill { display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; line-height: 1.4; text-decoration: none; }
.pill-expired { background: #D63A40; color: #fff; border: 2px solid #D63A40; } /* a shade darker than the dots, for 4.5:1 text */
.pill-soon { color: var(--st-soon); border: 2px solid var(--st-soon); }
.pill-current { color: #8db6ff; border: 1.5px solid var(--st-current); }
.pill-unknown { color: var(--muted); border: 1.5px dashed var(--st-none); }

/* The answer sentence, the thing each building leads with. */
.answer { margin: 0.25rem 0 0.6rem; font-size: clamp(1.25rem, 4.6vw, 1.6rem); font-stretch: 85%; font-weight: 800; line-height: 1.2; max-width: 40rem; padding-left: 0.75rem; border-left: 4px solid var(--st-none); }
.answer-expired { border-left-color: var(--st-expired); }
.answer-soon { border-left-color: var(--st-soon); }
.answer-current { border-left-color: var(--st-current); }
.hedge { margin: 0 0 0.5rem; color: var(--soft); max-width: 40rem; }
.bname, .asof { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.9375rem; }

/* Lists of buildings and cities; a whole row is the link's target. */
.blist { list-style: none; padding: 0; margin: 0 0 var(--s5); max-width: 44rem; }
.blist li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.05rem 0.6rem; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.blist a { color: var(--text); font-weight: 700; text-decoration: none; }
.blist a::after { content: ""; position: absolute; inset: 0; }
.blist li:hover a { color: var(--orange-2); }
.blist li:focus-within { outline: 3px solid var(--orange); outline-offset: 2px; }
.blist a:focus-visible { outline: 0; }
.blist .where { grid-column: 1; color: var(--muted); font-size: 0.875rem; }
.blist .pill { grid-column: 2; grid-row: 1 / span 2; }
#list .blist li { content-visibility: auto; contain-intrinsic-size: auto 3.4rem; }
.cities { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s4); }
@media (min-width: 40rem) { .cities { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); } }
.cities li { display: flex; align-items: center; min-height: 44px; }
.cities a { color: var(--text); text-decoration: none; font-weight: 600; }
.cities a:hover { color: var(--orange-2); }
.cities .where { margin-left: 0.4rem; color: var(--muted); font-size: 0.85rem; }
h2 .n { color: var(--muted); font-size: 0.7em; font-weight: 600; }

/* City pages */
.strip { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: var(--s3) 0 0; }
.strip .pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 0.8rem; font-size: 0.875rem; }
.maplink { font-weight: 700; white-space: nowrap; }
.filter { position: sticky; top: 0; z-index: 3; margin: 0 calc(-1 * var(--gutter)) var(--s4); padding: 0.6rem var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line); }
.filter input { width: 100%; max-width: 30rem; min-height: 48px; padding: 0.6rem 0.85rem; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); color: var(--text); font: inherit; font-size: max(1rem, 16px); }
.filter input::placeholder { color: var(--muted); opacity: 1; }
.group { margin-bottom: var(--s4); }
.group h2 { margin: 0 0 var(--s2); }
details.group > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; max-width: 44rem; min-height: 44px; padding: 0.25rem 0; border-bottom: 1px solid var(--line); cursor: pointer; list-style: none; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary h2 { margin: 0; }
details.group > summary::after { content: "Show"; color: var(--orange-2); font-weight: 700; font-size: 0.9rem; }
details.group[open] > summary::after { content: "Hide"; }
details.group[open] > summary { margin-bottom: var(--s2); }

/* Building pages */
.crumbs { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.9rem; }
.crumbs a { color: var(--soft); }
.page-head h1 { margin-bottom: 0.5rem; }
.units { list-style: none; padding: 0; margin: 0; display: grid; max-width: 44rem; }
.unit { padding: 0.8rem 0 0.8rem 0.85rem; border-top: 1px solid var(--line); border-left: 4px solid var(--st-none); }
.unit:last-child { border-bottom: 1px solid var(--line); }
.unit-expired { border-left-color: var(--st-expired); }
.unit-soon { border-left-color: var(--st-soon); }
.unit-current { border-left-color: var(--st-current); }
.unit-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; margin-bottom: 0.35rem; }
.unit-head h3 { margin: 0; font-size: 1.0625rem; }
.decal { color: var(--muted); font-size: 0.85em; font-weight: 600; }
.facts { display: block; margin: 0; color: var(--soft); font-size: 0.9rem; line-height: 1.55; }
.facts div, .facts dt, .facts dd { display: inline; margin: 0; }
.facts div + div::before { content: " · "; color: var(--muted); }
.facts dt { color: var(--muted); }
.facts dt::after { content: " "; }
.facts dd { font-weight: 600; }
.facts .is-due dd { color: var(--st-soon); }
.facts .is-overdue dt, .facts .is-overdue dd { color: var(--soft); font-weight: 700; }
.unit-note { margin: 0.4rem 0 0; color: var(--soft); font-size: 0.875rem; }
.meaning { margin: var(--s5) 0 0; max-width: 44rem; }
.meaning > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 700; list-style: none; }
.meaning > summary::-webkit-details-marker { display: none; }
.meaning > summary::after { content: "Show"; color: var(--orange-2); font-size: 0.9rem; }
.meaning[open] > summary::after { content: "Hide"; }
.meaning > summary + p { margin-top: var(--s2); }
.note { max-width: 44rem; color: var(--soft); border-left: 0; padding-left: 0; }
.prov { padding: var(--s4); border-radius: var(--radius); background: var(--bg-2); }
.prov p { color: var(--soft); font-size: 0.9375rem; }
.prov p:last-child { margin-bottom: 0; }

/* The map's own controls, in our colors (the map's stylesheet loads before this one). */
.maplibregl-ctrl-group { background: var(--bg-2); border: 1px solid var(--line); }
.maplibregl-ctrl-group button { width: 40px; height: 40px; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(0.9); }
.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(11, 21, 17, 0.85); color: var(--muted); }
.maplibregl-ctrl-attrib a { color: var(--soft); }
