/* Reconciliation — core-api vs routing, side by side.
 *
 * Each list is a fixed ten-row window (--sbs-row × 10) that scrolls, so the
 * skeleton, a sparse day and a 500-row day are all the same box. */

.recon-sbs {
  --sbs-row: 34px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0 1.4rem;
}

/* Hairline between the two systems, only when they sit side by side. */
.recon-sbs__col + .recon-sbs__col {
  border-left: 1px solid var(--panel-border);
  padding-left: 1.4rem;
}

@media (max-width: 640px) {
  .recon-sbs__col + .recon-sbs__col {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--panel-border);
    padding-top: 0.9rem;
    margin-top: 0.9rem;
  }
}

.recon-sbs__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.25rem 0.6rem 0.6rem;
}

.recon-sbs__system {
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--text-muted);
}

.recon-sbs__total {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.recon-sbs__cap {
  margin-right: 0.3rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
}

.recon-sbs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  height: calc(var(--sbs-row) * 10);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 18%, transparent) transparent;
  /* Soft fade at the bottom edge hints that the list scrolls. */
  mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent);
}

/* One line per record: code · window · details · status, columns aligned
   down the list so it scans like a table. */
.recon-sbs__row {
  display: grid;
  grid-template-columns: 12ch 9.5ch minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  height: var(--sbs-row);
  padding: 0 0.6rem;
  border-radius: 8px;
  transition: background-color 120ms ease;
}

/* Zebra rather than rules — a faint band every other row keeps the eye on
   the line without drawing a grid. */
.recon-sbs__row:nth-child(even) {
  background: color-mix(in srgb, var(--text) 2.5%, transparent);
}

.recon-sbs__row:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.recon-sbs__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.recon-sbs__code:hover,
a.recon-sbs__code:focus-visible {
  color: var(--accent);
}

.recon-sbs__code--orphan {
  color: var(--bad);
}

.recon-sbs__sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recon-sbs__window {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.recon-sbs__status {
  justify-self: end;
}

.recon-sbs__row .status-pill {
  flex: none;
  padding: 0.1rem 0.6rem;
  font-size: 0.68rem;
  border-radius: 999px;
}

.recon-sbs__empty {
  padding: 1rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* In-flight toggle: the old list dims rather than blanking, so the box never
   jumps. htmx sets .htmx-request on the requesting body. */
#recon-sbs-body {
  transition: opacity 150ms ease;
}

#recon-sbs-body.htmx-request {
  opacity: 0.55;
}

/* --- Segmented toggle ------------------------------------------------------ */

.recon-seg {
  display: inline-flex;
  margin-left: auto;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.recon-seg__btn {
  padding: 0.3rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.recon-seg__btn:hover {
  color: var(--text);
}

.recon-seg__btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px color-mix(in srgb, #000 14%, transparent);
}

.recon-seg__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
