/* TPU Map — closely follows the Ethanol Map visual system. */
.guest-home-topbar { justify-content: flex-end; }
body.map-page { overflow: hidden; }
.map-main { width: 100%; margin: 0; flex: 1; display: flex; min-height: 0; }
.map-shell { position: relative; width: 100%; height: calc(100vh - var(--topbar-height, 74px)); overflow: hidden; }
#map-container { position: absolute; inset: 0; }
.map-layer-controls { position: absolute; top: 12px; left: 12px; z-index: 5; width: 240px; max-height: calc(100vh - var(--topbar-height, 74px) - 24px); overflow-y: auto; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(20,34,36,.14); padding: .5rem .25rem; font-size: .85rem; }
.layer-group { border-bottom: 1px solid #eef2ea; }
.layer-group-title { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .5rem .75rem; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.layer-group-title::before { content: "▾ "; color: var(--muted); }
.layer-group-body { padding: 0 .75rem .6rem; display: flex; flex-direction: column; gap: .25rem; }
.layer-group-body label { display: flex; align-items: center; gap: .4rem; color: var(--ink); padding: .15rem 0; }
.layer-group-body select { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: .4rem .45rem; background: #fff; color: var(--ink); font: inherit; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); }
.datacenter-dot { background: #4c9b55; border-color: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.map-message { padding: .65rem .75rem .4rem; color: var(--muted); line-height: 1.4; }
.zoom-level-chip { position: absolute; left: 12px; bottom: 28px; z-index: 5; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 5px 16px rgba(20,34,36,.13); padding: .35rem .7rem; display: flex; gap: .4rem; font-size: .8rem; color: var(--muted); }
.zoom-level-chip strong { color: var(--ink); }
.maplibregl-popup-content { font-family: "IBM Plex Sans", "Avenir Next", system-ui, sans-serif; padding: 1rem; min-width: 220px; border-radius: 10px; }
.maplibregl-popup-content h3 { margin: 0 0 .4rem; }
.maplibregl-popup-content p { margin: .55rem 0; color: var(--muted); }
.maplibregl-popup-content a { color: var(--accent); font-weight: 700; }

.page { padding: .35rem 0; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: .25rem 0 1rem; }
.page-heading h1, .detail h1 { margin: .25rem 0 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: .75rem; color: var(--accent); }
.filters { display: flex; align-items: center; gap: .5rem; }
.filters input, .filters select, .login-card input { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: .5rem .65rem; font: inherit; }
.button { display: inline-block; border: 1px solid var(--line); color: var(--ink); text-decoration: none; border-radius: 9px; padding: .5rem .75rem; background: #f5f8f3; font: 600 .9rem inherit; cursor: pointer; }
.button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 12px 26px rgba(20,34,36,.06); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .65rem .75rem; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #f8fbf6; }
tr:hover td { background: #fafdf7; }
td a { font-weight: 600; }
.status { display: inline-block; padding: .15rem .55rem; border-radius: 999px; background: #f2f7ee; color: var(--ink); font-size: .8rem; border: 1px solid var(--line); white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 3rem; }
.back { display: block; margin: .4rem 0 2rem; color: var(--muted); }
.lede { color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(280px,.7fr) 1.3fr; gap: 1rem; margin-top: 1.5rem; }
.detail dl, .detail article { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 12px 26px rgba(20,34,36,.06); padding: 1.25rem 1.5rem; margin: 0; }
.detail dl div { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.detail dl div:last-child { border-bottom: 0; }
dt { font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
dd { margin: .25rem 0 0; font-weight: 600; }
.facility-list { list-style: none; padding: 0; }
.facility-list li { padding: .65rem 0; border-bottom: 1px solid var(--line); display: grid; }
.facility-list span { font-size: .8rem; color: var(--muted); }
.login-card { max-width: 430px; margin: 3rem auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 12px 26px rgba(20,34,36,.08); padding: 1.5rem; }
.login-card input { width: 100%; }
.error { color: #9b2b2b; }
@media (max-width: 760px) { .page-heading, .filters { align-items: stretch; flex-direction: column; } .detail-grid { grid-template-columns: 1fr; } .map-layer-controls { width: 210px; } }
