/* Geospatial Intelligence: layers menu, layer legend card and the About the Data dialog. Tokens come from geo.css. */
.layers-ctl{position:absolute;inset:0;z-index:1;pointer-events:none}
.layers-ctl>*{pointer-events:auto}

.lyr-btn{position:absolute;top:82px;right:10px;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);color:var(--text);box-shadow:var(--shadow);font-weight:700;font-size:var(--fs-1);cursor:pointer}
.lyr-btn:hover{background:var(--surface-2)}
.lyr-btn svg{width:20px;height:20px;flex:none}
.lyr-btn[aria-expanded="true"]{background:var(--pressed-bg);color:var(--pressed-text);border-color:var(--pressed-bg)}

.lyr-panel{position:absolute;top:134px;right:10px;width:min(320px,calc(100% - 20px));max-height:calc(100% - 134px - 44px);overflow-y:auto;padding:14px 16px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.lyr-panel h2{font-size:var(--fs-1);font-weight:700;margin:0 0 6px}
.lyr-opts{display:flex;flex-direction:column}
.lyr-opt{display:flex;align-items:center;gap:12px;min-height:44px;cursor:pointer;font-weight:700;font-size:var(--fs-1)}
.lyr-opt input{width:20px;height:20px;margin:0;flex:none;accent-color:var(--accent);cursor:pointer}
.lyr-set{margin-top:8px;padding-top:12px;border-top:1px solid var(--line)}
.lyr-note{margin:12px 0 0;color:var(--muted);font-size:var(--fs-0);line-height:1.4}
.lyr-range{margin-top:8px}
.lyr-range label{display:flex;justify-content:space-between;align-items:baseline;gap:12px;font-weight:700;font-size:var(--fs-1)}
.lyr-range output{font-weight:400;color:var(--muted);font-size:var(--fs-0);white-space:nowrap}

.lyr-card{position:absolute;left:16px;bottom:32px;width:min(300px,calc(100% - 32px));padding:12px 14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow);font-size:var(--fs-0);line-height:1.4}
.lyr-title{display:block;font-weight:700;font-size:var(--fs-1);margin-bottom:8px}
.lyr-swatches{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:4px 12px}
.lyr-swatches li{display:flex;align-items:center;gap:8px;min-width:0}
.lyr-swatches li.wide{grid-column:1/-1}
.lyr-swatches i{flex:none;width:16px;height:14px;border-radius:3px;border:1px solid var(--line)}
.lyr-swatches i.loss{width:14px;height:14px;border-radius:2px;border:0}
.lyr-ramp{height:10px;border-radius:5px;border:1px solid var(--line)}
.lyr-ramp-ends{display:flex;justify-content:space-between;gap:12px;margin-top:2px;color:var(--muted)}
.lyr-unit,.lyr-hint{margin:8px 0 0}
.lyr-unit{color:var(--muted)}
.lyr-hint{font-weight:400}
.lyr-credit{margin:10px 0 0;padding-top:8px;border-top:1px solid var(--line);color:var(--muted);font-size:.8125rem;line-height:1.35}

@media (max-width:820px){
  .lyr-card{left:8px;top:8px;bottom:auto;width:min(296px,calc(100% - 76px));padding:10px 12px}
  .lyr-btn{top:82px;right:10px}
  .lyr-btn span{display:none}
  .lyr-btn{width:44px;padding:0;justify-content:center}
  .layers-ctl.open .lyr-card{display:none}
  .lyr-panel{top:8px;right:62px;width:min(320px,calc(100% - 70px));max-height:calc(100% - 8px - 32px);padding:10px 14px 12px}
  .lyr-opt{min-height:40px}
}

/* About the Data dialog */
dialog.about{padding:0;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);color:var(--text);box-shadow:0 20px 60px rgba(8,13,38,.35);width:min(780px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);overflow:hidden}
dialog.about[open]{display:flex}
dialog.about::backdrop{background:rgba(8,13,38,.6)}
.ab{display:flex;flex-direction:column;min-height:0;width:100%;max-height:calc(100dvh - 24px)}
.ab-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 24px;border-bottom:1px solid var(--line)}
.ab-head h2{font-size:var(--fs-3);margin:0}
.ab-close{flex:none;min-height:44px;padding:0 20px;border-radius:var(--radius);border:1px solid var(--line);background:var(--surface);color:var(--text);font-weight:700;font-size:var(--fs-1);cursor:pointer}
.ab-close:hover{background:var(--surface-2)}
.ab-body{overflow-y:auto;padding:8px 24px 28px;min-height:0}
.ab-body section{padding-top:20px}
.ab-body h3{font-size:var(--fs-2);font-weight:700;margin:0 0 8px;line-height:1.2}
.ab-body p{margin:0 0 10px;line-height:1.5}
.ab-body ul{margin:0;padding-left:22px;display:flex;flex-direction:column;gap:6px;line-height:1.5}
.ab-table{width:100%;border-collapse:collapse;margin:12px 0;font-size:var(--fs-0);line-height:1.4}
.ab-table caption{caption-side:top;text-align:left;color:var(--muted);padding-bottom:6px}
.ab-table th,.ab-table td{text-align:left;vertical-align:top;padding:8px 10px;border-bottom:1px solid var(--line)}
.ab-table thead th{font-size:var(--fs-1);font-weight:700;background:var(--surface-2);border-bottom:0}
.ab-table tbody th{font-weight:400}
.ab-table .mute{color:var(--muted)}
.ab-table.speeds td{text-align:right;width:20%}
.ab-table.speeds thead th:not(:first-child){text-align:right}
.ab-table.sources tbody th{font-weight:700;font-size:var(--fs-1)}

@media (max-width:640px){
  .ab-head{padding:12px 16px}
  .ab-head h2{font-size:var(--fs-2)}
  .ab-body{padding:4px 16px 24px}
  .ab-table.sources thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .ab-table.sources,.ab-table.sources tbody,.ab-table.sources tr,.ab-table.sources th,.ab-table.sources td{display:block}
  .ab-table.sources tr{padding:10px 0;border-bottom:1px solid var(--line)}
  .ab-table.sources th,.ab-table.sources td{border:0;padding:2px 0}
  .ab-table.sources td::before{content:attr(data-l) ": ";color:var(--muted)}
  .ab-table.speeds th,.ab-table.speeds td{padding:8px 4px}
}
@media (prefers-reduced-motion:reduce){.lyr-btn,.lyr-panel{transition:none}}
