/* style.css. Hand-rolled, no framework, no webfonts: the system stack keeps
   first paint instant and the page self-contained. Light and dark via
   prefers-color-scheme; every motion effect collapses under
   prefers-reduced-motion. */

:root {
  /* Surfaces and text */
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f4f4f2;
  --fg: #1b1c1f;
  --muted: #6b7280;
  --faint: #9ca3af;
  --border: #e4e4e2;
  --border-strong: #d4d4d1;

  /* Accent, shared with the project's chart blue */
  --accent: #2455a4;
  --accent-hover: #1c4487;
  --accent-fg: #ffffff;
  --accent-soft: #eaf1fb;

  /* Freshness verdicts */
  --fresh-fg: #1a7f37;
  --fresh-bg: #ecf7ee;
  --aging-fg: #9a6700;
  --aging-bg: #fdf6e3;
  --old-fg: #b3423a;
  --old-bg: #fdefed;

  --pay-fg: #245c33;
  --pay-bg: #e7f2e9;
  --badge-bg: #f0f0ee;

  --shadow-card: 0 1px 2px rgb(27 28 31 / 0.04);
  --shadow-lift: 0 4px 16px rgb(27 28 31 / 0.07), 0 1px 3px rgb(27 28 31 / 0.05);
  --radius: 10px;
  --radius-sm: 7px;

  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --surface: #17181c;
    --surface-2: #1d1f24;
    --fg: #e8e9eb;
    --muted: #9aa1ab;
    --faint: #6b7280;
    --border: #26282e;
    --border-strong: #34373f;

    --accent: #7aa5e8;
    --accent-hover: #94b7ef;
    --accent-fg: #0d1017;
    --accent-soft: #1a2331;

    --fresh-fg: #57ab5a;
    --fresh-bg: #17241a;
    --aging-fg: #c9963a;
    --aging-bg: #272112;
    --old-fg: #d0655c;
    --old-bg: #2a1a18;

    --pay-fg: #8fc79a;
    --pay-bg: #1a2a1c;
    --badge-bg: #23252b;

    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.35);
    --shadow-lift: 0 6px 20px rgb(0 0 0 / 0.45), 0 1px 3px rgb(0 0 0 / 0.4);
  }
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The hidden attribute must always win: several elements below set their own
   display, which would otherwise override the UA's [hidden] rule. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0 auto;
  max-width: 68rem;
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 3vw, 1.5rem) 4rem;
  padding-top: max(clamp(1.25rem, 3vw, 2.5rem), env(safe-area-inset-top));
  padding-right: max(clamp(1rem, 3vw, 1.5rem), env(safe-area-inset-right));
  padding-bottom: max(4rem, env(safe-area-inset-bottom));
  padding-left: max(clamp(1rem, 3vw, 1.5rem), env(safe-area-inset-left));
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  font-size: 0.9375rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* A whisper of grain keeps the large flat surfaces from reading as sterile.
   Inline turbulence, no asset, and quiet enough to miss unless you look. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

/* Thin, theme-quiet scrollbars where the platform allows styling them. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* --- header ---------------------------------------------------------------- */

.site-header {
  margin-bottom: clamp(0.85rem, 2vw, 1.35rem);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.wordmark .mark {
  color: var(--accent);
  flex: none;
}

.tagline {
  margin: 0.5rem 0 0;
  color: var(--muted);
  max-width: 52rem;
  font-size: 0.9375rem;
  text-wrap: pretty;
}

/* --- honesty banner -------------------------------------------------------- */

.banner {
  padding: 0.4rem 0 0.55rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  animation: rise 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.banner:empty {
  /* Height is reserved before content arrives so the metadata filling in
     cannot push the page. */
  min-height: 2.55rem;
}

.snapshot-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.75rem;
  align-items: baseline;
}

.snapshot-line::before {
  content: "";
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.banner.fresh .snapshot-line::before {
  background: var(--fresh-fg);
  box-shadow: 0 0 0 4px var(--fresh-bg);
}

.banner.aging .snapshot-line::before {
  background: var(--aging-fg);
  box-shadow: 0 0 0 4px var(--aging-bg);
}

.banner.old .snapshot-line::before,
.banner.partial .snapshot-line::before {
  background: var(--old-fg);
  box-shadow: 0 0 0 4px var(--old-bg);
}

.banner .strong {
  font-weight: 650;
}

.snapshot-counts {
  color: var(--muted);
}

.banner .caution {
  color: var(--aging-fg);
  font-weight: 600;
}

.banner a {
  color: var(--accent);
  font-size: 0.8125rem;
  text-underline-offset: 3px;
}

.snapshot-details {
  margin: 0.15rem 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.snapshot-details summary {
  width: fit-content;
  cursor: pointer;
  text-underline-offset: 3px;
}

.snapshot-details summary:hover {
  color: var(--fg);
}

.snapshot-details p {
  max-width: 50rem;
  margin: 0.35rem 0 0;
}

.snapshot-details .caution {
  display: block;
  margin-top: 0.25rem;
}

/* --- loading --------------------------------------------------------------- */

.loading {
  margin-top: 1rem;
}

.skeleton-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.skeleton-fill {
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.1s ease-in-out infinite;
}

@keyframes slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(350%);
  }
}

.stage {
  color: var(--muted);
  font-size: 0.85rem;
  min-height: 1.3em;
  margin: 0.5rem 0 0;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.25s ease;
  /* The marquee must never wrap: a second line every 600 ms is a page that
     twitches. Long lines fade out at the edge instead. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.error {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--old-fg) 40%, transparent);
  background: var(--old-bg);
  color: var(--fg);
  overflow-wrap: anywhere;
}

.error p {
  margin: 0 0 0.65rem;
}

/* --- filters --------------------------------------------------------------- */

form {
  margin: 0.8rem 0 1rem;
  animation: rise 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.search-row {
  display: flex;
  gap: 0.5rem;
}

.form-readiness {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}

.search-input {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  padding: 0.65rem 4.5rem 0.65rem 0.9rem;
}

/* The "/" affordance: visible until the field is in use. */
.key-hint {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--faint);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 0.05rem 0.4rem;
  background: var(--surface-2);
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.search-box:focus-within .key-hint {
  opacity: 0;
}

/* The in-flight dot: invisible until a search is actually running, then a
   soft pulse beside the keyboard hint. */
.spin {
  position: absolute;
  right: 2.6rem;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.spin.busy {
  opacity: 1;
  animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.7);
  }
  50% {
    transform: scale(1.15);
  }
}

input[type="text"],
input[type="number"],
select {
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  min-height: 2.45rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

input::placeholder {
  color: var(--faint);
}

input:hover,
select:hover {
  border-color: var(--faint);
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

summary:focus-visible {
  border-radius: var(--radius-sm);
}

.refine {
  margin-top: 0.65rem;
  padding: 0 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}

.refine summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.5rem;
  cursor: pointer;
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 600;
  user-select: none;
  width: 100%;
  padding: 0.25rem 0;
  transition: color 0.15s ease;
  list-style: none;
  touch-action: manipulation;
}

.refine summary::-webkit-details-marker {
  display: none;
}

.refine summary::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex: none;
}

.refine[open] summary::before {
  transform: rotate(45deg);
}

.refine summary:hover {
  color: var(--fg);
}

.refine .grid {
  margin-top: 0.45rem;
}

.filter-summary {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.refine-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.refine-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.meaning-note {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.meaning-note summary {
  min-height: 2.5rem;
  width: fit-content;
  color: var(--accent);
  font-weight: 550;
}

.meaning-note p {
  max-width: 52rem;
  margin: 0.35rem 0 0;
}

.url-note {
  margin: -0.8rem 0 1.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-wrap: pretty;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.8rem 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 550;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  align-items: center;
  margin: 0.75rem 0 0.65rem;
}

.lifecycle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  min-width: 100%;
  margin: 0.15rem 0 0;
  padding: 0.65rem 0 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.lifecycle legend {
  float: left;
  margin-right: 0.4rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.check {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: var(--fg);
  font-weight: 450;
  cursor: pointer;
}

.check input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* --- buttons --------------------------------------------------------------- */

button {
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
  min-height: 2.45rem;
  transition:
    background 0.15s ease,
    transform 0.1s ease,
    box-shadow 0.15s ease;
}

button:hover {
  background: var(--accent-hover);
}

button:active {
  transform: scale(0.97);
}

button[disabled] {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

button.secondary {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border-strong);
}

button.secondary:hover {
  background: var(--surface-2);
  border-color: var(--faint);
}

button.quiet {
  min-height: auto;
  padding: 0.25rem 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.8125rem;
}

button.quiet:hover {
  background: transparent;
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

button.quiet[disabled] {
  color: var(--faint);
  text-decoration: none;
}

/* --- saved searches --------------------------------------------------------- */

.saved {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.chip {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease;
  animation: rise 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.chip:hover {
  border-color: var(--faint);
}

.chip-run,
.chip-x {
  background: none;
  border: none;
  border-radius: 0;
  color: var(--fg);
  font-size: 0.8125rem;
  font-weight: 550;
  padding: 0.3rem 0.35rem 0.3rem 0.8rem;
  cursor: pointer;
}

.chip-run:hover,
.chip-x:hover {
  background: var(--surface-2);
}

.chip-run:active,
.chip-x:active {
  transform: none;
}

.chip-x {
  color: var(--faint);
  padding: 0.3rem 0.7rem 0.3rem 0.25rem;
  font-size: 0.9rem;
  line-height: 1;
}

.chip-x:hover {
  color: var(--old-fg);
}

/* --- the rollup ------------------------------------------------------------- */

/* The shell animates its row from 0fr to 1fr so the summary glides open and
   the content below moves with it. Popping to full height was a measured
   layout shift right as the reader reached the results. */
.rollup-shell {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.rollup-shell.open {
  grid-template-rows: 1fr;
}

.rollup-shell > .rollup {
  overflow: hidden;
  min-height: 0;
}

.rollup {
  position: relative;
  margin-top: 1rem;
  padding: 0.9rem 2.4rem 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.rollup-head {
  margin: 0 0 0.6rem;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.rollup-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rollup-item {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 550;
  padding: 0.3rem 0.85rem;
  font-variant-numeric: tabular-nums;
}

.rollup-item:hover {
  background: var(--badge-bg);
  color: var(--fg);
}

.rollup-item.fresh {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.rollup-item.fresh:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}

.rollup-quiet {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.rollup-dismiss {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 1rem;
  line-height: 1;
  padding: 0.3rem 0.45rem;
  border-radius: var(--radius-sm);
}

.rollup-dismiss:hover {
  background: var(--surface-2);
  color: var(--fg);
}

/* --- results --------------------------------------------------------------- */

.count {
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  margin: 0 0 0.75rem;
  min-height: 1.3em; /* reserved before the first count lands: no shift */
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.72rem 0.9rem;
  box-shadow: var(--shadow-card);
  transition:
    border-color 0.15s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  animation: rise 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--stagger, 0s);
  /* A hundred cards render per page; off-screen ones cost nothing. */
  content-visibility: auto;
  contain-intrinsic-size: auto 7rem;
}

/* Keystroke-driven refills skip the entrance so typing feels instant. */
.list.instant .card {
  animation: none;
}

/* While a search runs, the stale results say so by stepping back. */
.list.searching {
  opacity: 0.55;
  transition: opacity 0.15s ease 0.1s;
}

/* Skeleton cards hold the layout while the rows stream in. */
.card.skeleton {
  pointer-events: none;
}

.bone {
  border-radius: 5px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--badge-bg) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.title-bone {
  width: 45%;
  height: 1rem;
  margin-bottom: 0.55rem;
}

.where-bone {
  width: 30%;
  height: 0.8rem;
  margin-bottom: 0.65rem;
}

.meta-bone {
  width: 60%;
  height: 0.9rem;
  border-radius: 999px;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (hover: hover) {
  .card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lift);
    transform: translateY(-1px);
  }
}

.card .title {
  font-weight: 650;
  font-size: 1rem;
  color: var(--fg);
  text-decoration: none;
  overflow-wrap: anywhere;
  letter-spacing: -0.01em;
}

.card a.title {
  color: var(--accent);
}

.card a.title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card a.title::after {
  content: " ↗";
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 500;
}

.card .where {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0.1rem 0 0.4rem;
  overflow-wrap: anywhere;
}

.location-details {
  margin: -0.15rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.location-details summary {
  width: fit-content;
  min-height: 2rem;
  display: flex;
  align-items: center;
  color: var(--accent);
  cursor: pointer;
  touch-action: manipulation;
}

.location-details p {
  max-width: 100%;
  margin: 0.3rem 0;
  padding: 0.45rem 0.55rem;
  border-left: 2px solid var(--border-strong);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.location-details .location-note {
  border: 0;
  padding: 0;
  font-style: italic;
}

.card .company {
  color: var(--fg);
  font-weight: 550;
}

.card .location:not(:first-child)::before {
  content: " · ";
  color: var(--faint);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card-facts {
  display: grid;
  gap: 0.38rem;
}

.status-meta {
  color: var(--muted);
}

.detail-meta {
  align-items: center;
}

.org-meta {
  font-size: 0.78rem;
}

.card-source {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.55rem;
  padding-top: 0.4rem;
  overflow-wrap: anywhere;
}

.badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.08rem 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.badge:not(:last-child):not(.pay):not([class*="state-"])::after {
  content: " ·";
  color: var(--faint);
}

.badge.pay {
  background: var(--pay-bg);
  color: var(--pay-fg);
  font-weight: 600;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
}

.badge.date-anomaly {
  background: var(--old-bg);
  color: var(--old-fg);
  font-weight: 650;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
}

.badge.unknown {
  color: var(--faint);
}

.badge.organization {
  color: var(--muted);
}

.card,
.card * {
  unicode-bidi: plaintext;
}

.badge.platform {
  background: transparent;
  color: var(--muted);
}

/* Lifecycle states: open is the quiet default; anything else must be seen. */
.badge.state-open {
  background: var(--fresh-bg);
  color: var(--fresh-fg);
  font-weight: 600;
}

.badge.state-stale {
  background: var(--aging-bg);
  color: var(--aging-fg);
  font-weight: 600;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
}

.badge.state-closed,
.badge.state-lapsed {
  background: var(--old-bg);
  color: var(--old-fg);
  font-weight: 600;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.page-jump {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  animation: none;
}

.page-jump label {
  display: block;
  color: var(--muted);
}

.page-jump input {
  width: 5.5rem;
}

.page-shortcuts {
  flex-basis: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.page-shortcuts kbd {
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  background: var(--surface-2);
}

/* --- footer ---------------------------------------------------------------- */

footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8125rem;
  text-wrap: pretty;
}

footer a {
  color: var(--accent);
  text-underline-offset: 3px;
}

/* --- motion ---------------------------------------------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- small screens --------------------------------------------------------- */

@media (max-width: 30rem) {
  /* Input takes the full first row; Search and Save share the second. Two
     stacked full-width buttons read as a form, not a tool. */
  .search-row {
    flex-wrap: wrap;
  }

  .search-box {
    flex-basis: 100%;
  }

  .search-row button {
    flex: 1;
    padding-block: 0.6rem;
  }

  .card {
    padding: 0.75rem 0.85rem;
  }

  .snapshot-counts {
    flex-basis: calc(100% - 1.25rem);
    margin-left: 1.25rem;
  }

  .snapshot-details {
    margin-left: 1.25rem;
  }

  .refine {
    border-color: var(--border-strong);
    padding-inline: 0.85rem;
  }

  .refine[open] {
    padding-bottom: 0.85rem;
  }

  .refine summary {
    min-height: 3rem;
  }

  .pagination > button {
    flex: 1;
  }

  .page-jump {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
  }
}

/* Touch devices have no "/" key to hint at, and the reserved space is better
   spent on the query. */
@media (pointer: coarse) {
  .key-hint {
    display: none;
  }

  .search-input {
    padding-right: 2.4rem;
  }

  .spin {
    right: 0.9rem;
  }

  button,
  .refine summary,
  .snapshot-details summary,
  .chip-run,
  .chip-x {
    min-height: 2.75rem;
  }

  input[type="text"],
  input[type="number"],
  select {
    min-height: 2.75rem;
  }

  .check {
    min-height: 2.75rem;
  }

  .check input {
    width: 1.25rem;
    height: 1.25rem;
  }
}

@media (min-width: 48rem) and (max-width: 63.99rem) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 0.75rem;
  }
}

@media (min-width: 64rem) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem 0.75rem;
  }

  .grid label {
    min-width: 0;
  }
}

/* The empty state earns a designed moment: what happened, and one useful
   action, not a bare sentence. */
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  animation: rise 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.empty p {
  margin: 0 0 0.9rem;
}

.empty strong {
  color: var(--fg);
  font-weight: 600;
}

@media print {
  .pagination,
  .key-hint,
  .spin {
    display: none !important;
  }

  .location-details > summary {
    display: none;
  }

  .location-details:not([open]) > * {
    display: block;
  }
}
