:root {
  --bg: #f4f1ea;
  --ink: #1c1915;
  --muted: #5e584f;
  --line: #ddd6c8;
  --panel: #fbf9f4;
  --verizon: #d01212;
  --att: #1565c0;
  --tmobile: #e20074;
  --dish: #e0a800;
  --comcast: #4a1578;
  --charter: #6f1d32;
  --spacex: #1e7a34;
  --other: #8b9089;
  --none: #d9d3c7;
  --shadow: 0 10px 30px rgba(40, 32, 20, 0.12);
  color-scheme: only light;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--bg);
}
.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  position: relative;
}

#sidebar {
  width: 420px;
  flex: 0 0 420px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 2;
}

.mast { padding: 18px 18px 8px; }
.folds { display: flex; justify-content: flex-start; gap: 4px; margin-top: 8px; }
.fold {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 8px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.fold.on {
  color: var(--ink);
  border-color: var(--line);
  background: white;
}
h1 {
  margin: 4px 0 6px;
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  padding: 10px 18px 12px;
}
.legend button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18);
  flex: 0 0 auto;
}
.legend button.off { opacity: 0.38; }
.legend button.picked { background: #e7f0fa; border-radius: 6px; }

.tools { padding: 0 18px 10px; }
#search {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}
.lease-toggle {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.filters button, .views button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink);
}
.filters button.on, .views button:hover, .filters button:hover {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

#list-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.table {
  overflow: auto;
  flex: 1 1 auto;
  border-top: 1px solid var(--line);
  min-height: 160px;
}
.band {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #efeae1;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 18px;
  border-bottom: 1px solid var(--line);
}
.block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eee8dc;
  background: transparent;
  padding: 8px 18px;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}
.block .row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.block:hover { background: #f3efe6; }
.block[aria-selected="true"] {
  background: #e7f0fa;
  box-shadow: inset 3px 0 0 var(--att);
}
.block .name { font-weight: 650; font-size: 14px; }
.block .freq { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.block .geo {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.detail {
  position: absolute;
  z-index: 500;
  left: 432px;
  bottom: 12px;
  width: min(340px, calc(100% - 456px));
  max-height: min(420px, calc(100% - 24px));
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 12px 14px 10px;
  font-size: 13px;
}
.detail .fold { float: right; margin: 0 0 6px 8px; }
.detail:empty { display: none; }
body.fold-key #legend { display: none; }
body.fold-list #list-panel { display: none; }
body.fold-summary #detail-body { display: none; }
body.fold-summary .detail {
  width: auto;
  max-height: none;
  padding: 6px;
  overflow: visible;
}
body.fold-summary .detail .fold { float: none; margin: 0; }
.detail h2 { margin: 0 0 2px; font-size: 16px; }
.detail .sub { margin: 0 0 8px; color: var(--muted); }
.bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--none);
  margin: 8px 0;
}
.bar span { display: block; height: 100%; }
.stats { margin: 0; padding: 0; list-style: none; }
.stats li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.stats .count { font-variant-numeric: tabular-nums; color: var(--muted); }
.note { color: var(--muted); margin: 8px 0 0; line-height: 1.35; }
.note label { color: var(--ink); }
#depth-legend { display: none; padding: 0 18px 16px; }
#depth-legend .filters { margin-top: 0; }
.stats li.off { opacity: 0.45; }
body.mode-holdings #depth-legend { display: block; }
body.mode-holdings #search,
body.mode-holdings .tools .filters,
body.mode-holdings #table,
body.mode-holdings #detail { display: none; }
.ramp {
  height: 12px;
  border-radius: 99px;
  margin: 10px 0 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.ramp-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.holding { display: flex; gap: 12px; align-items: center; }
.holding .stats { flex: 1 1 auto; }
.stats .swatch, .carrier-hold .swatch { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.pie { flex: 0 0 auto; display: block; }
.carrier-hold + .carrier-hold {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.carrier-hold h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 14px;
}
.carrier-hold h3 .count {
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.carrier-hold > .note { margin-top: 0; }

.notes {
  flex: 0 0 auto;
  width: 100%;
  padding: 10px 18px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.notes p { margin: 0 0 6px; }
.notes p:last-child { margin-bottom: 0; }
.notes .copy a { color: inherit; text-decoration: underline; }

.license {
  flex: 1 1 auto;
  overflow: auto;
  max-width: 740px;
  padding: 28px 22px 40px;
  color: var(--ink);
}
.license .back { margin: 0 0 18px; font-size: 14px; }
.license .back a { color: var(--att); }
.license h1 {
  font-size: 28px;
  line-height: 1.2;
}
.license h2 {
  margin: 22px 0 8px;
  font-size: 18px;
}
.license ul { margin: 0; padding-left: 1.2em; }
.license li { margin: 0 0 8px; line-height: 1.45; }

#map { flex: 1 1 auto; height: 100%; background: #d5e3ef; }
.views {
  position: absolute;
  z-index: 500;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
}
.leaflet-container { font: inherit; background: #d5e3ef; }
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; line-height: 1.35; }
.leaflet-popup-content h3 { margin: 0 0 2px; font-size: 15px; }
.leaflet-popup-content .carrier-hold h3 { font-size: 14px; }
.leaflet-popup-content .stats li { margin: 0; }
.leaflet-popup-content .who { margin: 0 0 8px; color: var(--muted); }
.leaflet-popup-content ul { margin: 0; padding: 0; list-style: none; }
.leaflet-popup-content li { margin: 0 0 6px; }
.leaflet-popup-content a { color: var(--att); }
.tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 1px 6px;
  margin-right: 4px;
  color: white;
}

@media (max-width: 860px) {
  h1 { font-size: 22px; }
  .stage { flex-direction: column; }
  #sidebar {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    max-height: 46vh;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  body.fold-list #sidebar { max-height: none; overflow: visible; }
  .notes { font-size: 11px; }
  .mast { padding-bottom: 8px; }
  .table { min-height: 0; }
  .detail {
    left: 8px;
    right: auto;
    bottom: 12px;
    width: min(320px, calc(100% - 16px));
    max-height: 40vh;
  }
  #map { height: auto; min-height: 0; flex: 1 1 auto; }
  .views { display: none; }
}
