/* Atlas ITI: full-bleed map under the shared navbar, with a docked control panel. Requires iti.css and navbar.css. */
body.atlas {
  --ink: #333; --ink-2: #555; --ink-3: #666; --rule: #ddd; --paper: #fff; --paper-2: #f5f5f5; --card: #fff;
  --terra: #337ab7; --serif: "Helvetica Neue", Helvetica, Arial, sans-serif; --sans: var(--serif);
  --nav-h: 46px; --panel-w: 320px;
  margin: 0; height: 100vh; height: 100dvh; overflow: hidden; background: #fff; color: var(--ink); font: 14px/1.43 var(--sans);
}
body.atlas .navbar { position: absolute; inset: 0 0 auto 0; z-index: 10; }
#map { position: absolute; inset: var(--nav-h) 0 0 0; background: #EDE6D8; }

/* control panel */
.panel { position: absolute; left: 0; top: var(--nav-h); bottom: 0; width: var(--panel-w); display: flex; flex-direction: column; background: #fff; border-right: 1px solid #ccc; z-index: 5; }
.panel.closed { bottom: auto; border-bottom: 1px solid #ccc; }
.panel.closed .body { display: none; }
.panel header { display: flex; align-items: center; min-height: 40px; padding: 4px 8px 4px 12px; background: #f5f5f5; border-bottom: 1px solid #ddd; }
.panel h1 { flex: 1; margin: 0; font-size: 16px; font-weight: 700; }
.collapse { width: 26px; height: 26px; border: 1px solid #ccc; border-radius: 3px; background: #fff; color: #333; font-size: 15px; line-height: 1; cursor: pointer; }
.collapse:hover { background: #e6e6e6; border-color: #adadad; }
.body { overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; }
.body section { padding: 10px 12px 12px; border-bottom: 1px solid var(--rule); }
.body section:last-child { border: 0; }
.body h2 { margin: 0 0 7px; font-size: 13px; font-weight: 700; color: var(--ink); }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.chips button { padding: 4px 8px; border: 1px solid #ccc; border-radius: 3px; background: #fff; color: #333; font-size: 12.5px; line-height: 1.3; text-align: left; cursor: pointer; }
.chips button:hover { background: #e6e6e6; border-color: #adadad; }
.chips button[aria-pressed="true"] { background: var(--terra); border-color: #2e6da4; color: #fff; }

#mobStats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 9px; font-size: 12px; color: var(--ink-2); }
#mobStats[hidden] { display: none; }
#mobStats b { display: block; font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--ink); font-feature-settings: "tnum"; }
#mobStats small { grid-column: 1 / -1; color: var(--ink-3); font-size: 11px; line-height: 1.3; }
.lgroup { margin-bottom: 10px; }
.lgroup:last-child { margin-bottom: 0; }
.lgroup h3 { margin: 0 0 2px; padding-bottom: 3px; border-bottom: 1px solid #eee; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.lrow { display: grid; grid-template-columns: 18px 1fr auto; gap: 5px; align-items: start; padding: 3px 0; font-size: 13px; cursor: pointer; }
.lrow:hover { color: var(--terra); }
.lrow input { accent-color: var(--terra); margin: 3px 0 0; width: 13px; height: 13px; }
.lrow small { color: var(--ink-3); font-size: 11.5px; font-feature-settings: "tnum"; padding-top: 2px; white-space: nowrap; }
.lrow .info { border: 0; background: none; color: var(--terra); cursor: pointer; font-size: 12px; font-weight: 700; padding: 0 0 0 4px; }
.lrow.busy span { opacity: .5; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 3px; color: #fff; }

/* map toolbar */
.tools { position: absolute; top: calc(var(--nav-h) + 10px); right: 10px; display: flex; z-index: 4; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.tools button { margin-left: -1px; padding: 5px 11px; border: 1px solid #ccc; background: #fff; color: #333; font-size: 13px; cursor: pointer; }
.tools button:first-child { margin-left: 0; border-radius: 3px 0 0 3px; }
.tools button:last-child { border-radius: 0 3px 3px 0; }
.tools button:hover { background: #e6e6e6; }
.tools button[aria-pressed="true"] { position: relative; background: var(--terra); border-color: #2e6da4; color: #fff; }

/* layer provenance */
.card { position: absolute; right: 10px; top: calc(var(--nav-h) + 52px); width: 320px; max-height: calc(100% - var(--nav-h) - 120px); overflow-y: auto; background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 12px 14px; box-shadow: 0 6px 12px rgba(0, 0, 0, .175); z-index: 4; }
.card h3 { margin: 8px 24px 8px 0; font-size: 17px; line-height: 1.2; font-weight: 700; }
.card .close { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: #666; }
.card dl { margin: 10px 0 0; display: grid; grid-template-columns: 1fr; gap: 6px; }
.card dt { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.card dd { margin: 0; font-size: 13px; }
.card table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 4px; }
.card td { padding: 3px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.card td:first-child { color: var(--ink-3); padding-right: 12px; }

.caption { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); text-align: center; z-index: 3; pointer-events: none; color: var(--ink); text-shadow: 0 0 14px rgba(255, 255, 255, .95), 0 0 3px rgba(255, 255, 255, .9); max-width: 80vw; }
.caption b { display: block; font-size: clamp(26px, 3.4vw, 46px); line-height: 1.1; }
.caption span { font-size: clamp(15px, 1.4vw, 19px); }

.legend { position: absolute; left: calc(var(--panel-w) + 10px); bottom: 24px; z-index: 3; background: #fff; border: 1px solid #ccc; border-radius: 3px; padding: 8px 10px; font-size: 12px; width: 200px; }
.legend b { display: block; font-weight: 700; margin-bottom: 5px; }
.legend .ramp { height: 8px; }
.legend .ticks { display: flex; justify-content: space-between; color: var(--ink-2); margin-top: 3px; font-feature-settings: "tnum"; }

.note { position: absolute; left: 50%; top: calc(var(--nav-h) + 10px); transform: translateX(-50%); background: #333; color: #fff; padding: 5px 12px; border-radius: 3px; font-size: 13px; z-index: 6; max-width: 56vw; }

.maplibregl-popup-content { background: #fff; border-radius: 3px; font: 13px/1.4 var(--sans); padding: 8px 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.maplibregl-popup-content b { font-size: 14px; display: block; margin-bottom: 3px; }
.maplibregl-popup-content button.more { border: 0; background: none; color: var(--terra); cursor: pointer; padding: 3px 0 0; font-size: 12.5px; }
.maplibregl-ctrl-attrib { font-size: 11px; }

@media (max-width: 760px) {
  .panel { right: 0; width: auto; bottom: auto; max-height: 52%; border-right: 0; border-bottom: 1px solid #ccc; }
  .tools { top: auto; bottom: 26px; right: 8px; }
  .card { left: 8px; right: 8px; width: auto; top: auto; bottom: 74px; max-height: 42%; }
  .legend, .caption { display: none; }
}
