/* Region Gaps: one comparative board, with the evidence visible before opening anything. */
.gaps-overview {
  margin: 12px 0 16px;
  padding: 14px 18px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-card);
}
.gaps-overview__intro {
  margin: 0 0 10px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gaps-overview__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.gaps-overview__metric {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding: 2px 18px;
  border-left: 1px solid var(--hairline);
}
.gaps-overview__metric:first-child { border-left: 0; padding-left: 0; }
.gaps-overview__metric strong {
  color: var(--text);
  font: 700 clamp(19px, 2vw, 26px)/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gaps-overview__metric small { color: var(--text-3); font-size: .55em; }
.gaps-overview__metric span:last-child { color: var(--text-2); font-size: 12px; line-height: 1.35; }
.gaps-overview__live {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: 3px;
}
.gaps-overview__foot {
  margin: 11px 0 0;
  color: var(--text-3);
  font-size: 11px;
}

/* The sort select already covers Gap and Margin; the second sort control added a row of noise. */
#screenLine #rankCap, #screenLine #rankSeg { display: none; }
body.is-gaps-view #potDeck .fam-rail { gap: 4px; padding: 0 8px; }
body.is-gaps-view #potDeck .fam-seg { min-height: 42px; padding: 0 12px; border-radius: 6px 6px 0 0; }
body.is-gaps-view #potDeck .fam-seg[aria-selected="true"] {
  background: var(--bg-2);
  border-bottom-color: var(--blue-bright);
}
#screenLine {
  margin-top: 0;
  padding: 10px 14px;
  gap: 12px;
  border-top: 1px solid var(--hairline);
}
#screenLine .sub-cap { font-family: inherit; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
#screenLine .screen-rail { gap: 6px; }
#screenLine .screen-chip {
  min-height: 36px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  border-color: var(--border);
  background: var(--bg-1);
  color: var(--text-2);
  font-weight: 500;
}
#screenLine .screen-chip:hover { background: var(--bg-2); border-color: var(--border); }
#screenLine .screen-chip.is-on { background: var(--blue-dim); border-color: var(--blue); color: var(--blue-bright); font-weight: 600; }
@media (pointer: coarse) { #screenLine .screen-chip { min-height: 44px; } }
@media (max-width: 700px) {
  #screenLine { padding: 10px 8px; }
  #screenLine .sub-cap { flex-basis: 100%; }
}
@media (min-width: 701px) and (max-width: 1300px) {
  #potDeck .deck-tools { margin-left: 0; }
}

/* One readable result summary above the comparison grid, with freshness kept secondary. */
#gapsCount {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
  max-width: none;
  margin: 0 0 8px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card);
  line-height: 1.4;
}
#gapsCount .pd-count__result { color: var(--text-2); font-weight: 600; }
#gapsCount .pd-count__result b { margin-right: 3px; color: var(--text); font: 700 16px/1 var(--font-mono); }
#gapsCount .pd-count__fresh { margin-left: auto; color: var(--text-2); }
#gapsCount .pd-count__sort { color: var(--text-2); }

/* The labels lead the comparison rather than reading as tiny metadata above it. */
.gaps-rows .pd-lhead {
  padding-block: 12px;
  color: var(--text);
  font: 700 16px/1.3 var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}
.gaps-rows .pd-lhead .h-reg { gap: 0; }
.gaps-rows .pd-lhead .pd-sortbtn,
.gaps-rows .pd-lhead .pd-headlbl { min-height: 44px; }
.gaps-rows .pd-slots-head .pd-sortbtn,
.gaps-rows .pd-slots-head .pd-headlbl {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  margin: 0;
  padding-left: 8px;
  font: inherit;
  letter-spacing: 0;
}
@media (max-width: 700px) { #gapsCount .pd-count__fresh { margin-left: 0; } }

.gaps-rows .pd-lhead,
.gaps-rows .pd-card {
  grid-template-columns: 24px 26px minmax(170px, 1fr) minmax(390px, 1.45fr) 86px 150px;
  grid-template-areas: "star icon pot slot pct net";
  gap: 10px;
}
.gaps-rows .pd-card { grid-template-areas: "star icon body slot pct net"; min-height: 62px; }
.gaps-rows .pd-lhead > span:nth-child(1) { grid-area: star; display: none; }
.gaps-rows .pd-lhead > span:nth-child(2) { grid-area: icon; display: none; }
.gaps-rows .pd-lhead .h-pot { grid-area: pot; }
.gaps-rows .pd-lhead .h-reg { grid-area: slot; display: flex; }
.gaps-rows .pd-lhead .h-pct { grid-area: pct; display: block; }
.gaps-rows .pd-lhead .h-net { grid-area: net; }
.gaps-rows .pd-card > .fav-star { grid-area: star; }
.gaps-rows .pd-card > .pd-icon,
.gaps-rows .pd-card > .pd-icon-ph { grid-area: icon; }
.gaps-rows .pd-body { grid-area: body; }
.gaps-rows .pd-card > .pd-slots { grid-area: slot; }
.gaps-rows .pd-card > .pd-pct { grid-area: pct; }
.gaps-rows .pd-card > .pd-net { grid-area: net; }
.gaps-rows .pd-slot.is-sell {
  border-color: var(--border);
  background: var(--bg-2);
}
.gaps-rows .pd-slot.is-sell b,
.gaps-rows .pd-slot.is-sell .pd-role { color: var(--text); }
.gaps-rows .pd-slot {
  grid-template-columns: minmax(0, 1fr) 48px;
  grid-template-areas: "region role" "price qty";
  column-gap: 3px;
  row-gap: 2px;
  padding: 5px 7px;
}
.gaps-rows .pd-slot i { grid-area: region; }
.gaps-rows .pd-slot .pd-role { grid-area: role; text-align: right; }
.gaps-rows .pd-slot b { grid-area: price; text-align: left; overflow: visible; }
.gaps-rows .pd-slot em { grid-area: qty; align-self: end; }
.gaps-rows .pd-role { font-size: 8px; }
.gaps-rows .pd-held::before { content: "Held "; }

@container pdg (max-width: 959px) {
  .gaps-rows .pd-lhead,
  .gaps-rows .pd-card {
    grid-template-columns: 24px 26px minmax(0, 1fr) 82px 120px;
    column-gap: 9px;
    row-gap: 8px;
  }
  .gaps-rows .pd-lhead { grid-template-areas: "star icon pot pct net" "slot slot slot slot slot"; }
  .gaps-rows .pd-card { grid-template-areas: "star icon body pct net" "slot slot slot slot slot"; }
  .gaps-rows .pd-lhead .h-reg { padding-top: 3px; }
  .gaps-rows .pd-lhead .h-net .pd-sortbtn { white-space: normal; }
}
@container pdg (max-width: 540px) {
  .gaps-rows .pd-lhead { row-gap: 0; padding-block: 4px; }
  .gaps-rows .pd-lhead .h-reg { padding-top: 0; }
  .gaps-rows .pd-lhead,
  .gaps-rows .pd-card { grid-template-columns: 24px 26px minmax(0, 1fr) 94px; }
  .gaps-rows .pd-lhead { grid-template-areas: ". . pot pot" ". . pct net" "slot slot slot slot"; }
  .gaps-rows .pd-card { grid-template-areas: "star icon body body" ". . pct net" "slot slot slot slot"; }
  .gaps-rows .pd-slot { min-width: 0; grid-template-columns: minmax(0, 1fr) 48px; }
  .gaps-rows .pd-slot.is-none { opacity: .65; }
}
@media (max-width: 700px) {
  .gaps-overview { padding: 12px; }
  .gaps-overview__metrics { grid-template-columns: 1fr 1fr; gap: 10px 0; }
  .gaps-overview__metric { display: block; padding: 0 10px; }
  .gaps-overview__metric:nth-child(3) { border-left: 0; padding-left: 0; }
  .gaps-overview__metric span:last-child { display: block; margin-top: 4px; }
}
