:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #121826;
  --muted: #5d6678;
  --line: #dde3ee;
  --green: #16a36a;
  --mint: #6ee7b7;
  --blue: #2563eb;
  --violet: #7c3aed;
  --cyan: #0891b2;
  --red: #d44747;
  --amber: #b7791f;
  --shadow: 0 14px 36px rgba(18, 24, 38, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
.skip-link { position: absolute; left: -999px; top: 12px; background: var(--ink); color: #fff; padding: 10px 12px; }
.skip-link:focus { left: 12px; z-index: 50; }
.container { width: min(1160px, calc(100vw - 32px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 248, 251, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.nav-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.brand img { width: 36px; height: 36px; }
.brand-lockup {
  display: grid;
  gap: 1px;
}
.brand-lockup span {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.1;
}
.main-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 4px;
  overflow-x: auto;
}
.main-nav a,
.nav-menu-toggle {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  padding: 9px 11px;
  border-radius: 8px;
}
.main-nav a:hover,
.main-nav a.is-active,
.nav-menu[open] .nav-menu-toggle,
.nav-menu.is-active .nav-menu-toggle,
.nav-menu-toggle:hover {
  color: var(--ink);
  background: #e9eef8;
}
.nav-menu {
  position: relative;
  justify-self: end;
}
.nav-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::marker { content: ""; }
.nav-menu-toggle {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 6px 18px rgba(18, 24, 38, 0.08);
  white-space: nowrap;
}
.nav-menu-label {
  font-size: 0.95rem;
}
.nav-menu-icon {
  width: 18px;
  height: 14px;
  display: inline-grid;
  align-content: space-between;
}
.nav-menu-icon span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.nav-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  z-index: 30;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.nav-menu-panel a {
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
}
.nav-menu-panel a:hover,
.nav-menu-panel a.is-active {
  color: var(--ink);
  background: #eef3fb;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.2rem, 7vw, 5rem); line-height: 0.95; letter-spacing: 0; }
h2 { font-size: clamp(1.3rem, 3vw, 2rem); letter-spacing: 0; }
p { color: var(--muted); }
.eyebrow { color: var(--green); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 800; }

.hero-band { background: linear-gradient(180deg, #fbfcff, var(--bg)); border-bottom: 1px solid var(--line); }
.hero-grid {
  min-height: 560px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
  padding: 76px 0;
}
.hero-copy { display: grid; gap: 22px; max-width: 1040px; }
.hero-copy h1 { max-width: 980px; font-weight:800}
.hero-subtext { max-width: 760px; font-size: clamp(1rem, 2vw, 1.35rem); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.button-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.button.primary, button.primary { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 8px 18px rgba(22, 163, 106, 0.16); }
.button.secondary { background: #fff; border-color: #c7d2fe; color: #26345d; }
.button.secondary:nth-child(2) { border-color: #bfdbfe; color: #1d4ed8; }
.button.secondary:nth-child(3) { border-color: #b7f5d6; color: #087447; }
.button:hover, button:hover { transform: translateY(-1px); }
.button:disabled, button:disabled {
  cursor: wait;
  opacity: 0.82;
  transform: none;
}
.button-spinner {
  display: none;
  width: 15px;
  height: 15px;
  margin-left: 8px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: button-spin 720ms linear infinite;
}
.is-submitting .button-spinner { display: inline-block; }
@keyframes button-spin {
  to { transform: rotate(360deg); }
}

.page-stack, .detail-page, .admin-page, .narrow-page { padding: 34px 0 72px; display: grid; gap: 28px; }
.narrow-page { max-width: 720px; }
.section-block, .list-header, .form-panel, .status-panel, .admin-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.list-header { display: grid; gap: 10px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.section-heading a { color: var(--blue); font-weight: 800; text-decoration: none; }
.section-heading h2 { display: inline-flex; align-items: center; gap: 9px; }
.section-heading h2::before {
  content: "";
  width: 9px;
  height: 24px;
  border-radius: 999px;
  background: var(--green);
}
.section-block:nth-child(2n) .section-heading h2::before { background: var(--blue); }
.section-block:nth-child(3n) .section-heading h2::before { background: var(--violet); }
.split-heading { align-items: end; }
.section-note { max-width: 360px; text-align: right; font-weight: 600; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.agent-card {
  min-height: 220px;
  display: grid;
  gap: 12px;
  align-content: start;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.agent-card:nth-child(3n + 1) { border-top: 4px solid var(--green); }
.agent-card:nth-child(3n + 2) { border-top: 4px solid var(--blue); }
.agent-card:nth-child(3n + 3) { border-top: 4px solid var(--violet); }
.card-topline, .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-topline { align-items: flex-start; }
.card-title-stack {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.agent-name { font-weight: 800; font-size: 1.05rem; text-decoration: none; }
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 0;
  font-weight: 800;
  line-height: 1;
}
.rank-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 800;
}
.card-meta, .card-footer { font-size: 0.86rem; color: var(--muted); }
.card-summary { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  white-space: nowrap;
}
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }
.trend.steady { color: var(--amber); }
.trend-compact {
  display: none;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: #fff;
  font-size: 0.78rem;
  line-height: 1;
}
.trend-compact.up {
  background: #edfdf5;
  border-color: #b7f5d6;
}
.trend-compact.down {
  background: #fff4f4;
  border-color: #ffc9c9;
}
.trend-compact.steady {
  background: #fff8e8;
  border-color: #fde68a;
}
.empty { color: var(--muted); }

.listing-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.listing-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
.listing-table th,
.listing-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.listing-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.listing-table tr:last-child td { border-bottom: 0; }
.listing-table td:first-child {
  min-width: 280px;
}
.listing-table th:nth-child(4),
.listing-table td:nth-child(4) {
  min-width: 76px;
  white-space: nowrap;
}
.listing-table th:nth-child(5),
.listing-table td:nth-child(5) {
  min-width: 94px;
}
.table-listing-cell { display: grid; gap: 6px; }
.table-listing-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.table-rank-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.table-agent-name {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.table-summary {
  display: -webkit-box;
  color: var(--muted);
  font-size: 0.9rem;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.details-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 6px 10px;
  color: #1d4ed8;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.category-grid a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}
.category-grid a:nth-child(4n + 1) { border-color: #b7f5d6; }
.category-grid a:nth-child(4n + 2) { border-color: #bfdbfe; }
.category-grid a:nth-child(4n + 3) { border-color: #ddd6fe; }
.category-grid a:nth-child(4n + 4) { border-color: #fde68a; }
.reject-list, .log-list { display: grid; gap: 10px; }
.reject-list div, .log-list div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.reject-list span, .log-list span { color: var(--muted); }

.form-intro { margin-top: 10px; max-width: 620px; }
.submit-form { display: grid; gap: 14px; margin-top: 22px; }
.submit-form.is-submitting input,
.submit-form.is-submitting textarea {
  background: #f8fafc;
  color: #475569;
}
.captcha-box {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}
.captcha-box input[type="number"] {
  max-width: 160px;
}
.submit-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #b7f5d6;
  border-radius: 8px;
  background: #e9fff5;
  color: #087447;
  padding: 11px 12px;
  font-weight: 700;
}
.submit-progress[hidden] { display: none; }
.submit-progress::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(22, 163, 106, 0.46);
  animation: submit-pulse 1.7s ease-out infinite;
  flex: 0 0 auto;
}
@keyframes submit-pulse {
  70% { box-shadow: 0 0 0 9px rgba(22, 163, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 106, 0); }
}
label { display: grid; gap: 7px; font-weight: 800; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
}
.form-error { background: #fff1f1; color: var(--red); border: 1px solid #ffc9c9; border-radius: 8px; padding: 10px; margin-top: 14px; }
.terms-note {
  margin-top: 14px;
  font-size: 0.9rem;
}
.terms-note a, .list-header a { color: var(--blue); font-weight: 800; }

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  grid-template-areas:
    "copy score";
  gap: 22px;
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.detail-hero-with-media {
  grid-template-columns: minmax(280px, 0.88fr) minmax(0, 1fr) 220px;
  grid-template-areas:
    "media copy score";
}
.detail-copy {
  grid-area: copy;
  min-width: 0;
  display: grid;
  gap: 14px;
  align-content: center;
}
.detail-hero-with-media .detail-copy h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-row a { background: #edf2fb; color: #24324d; text-decoration: none; font-weight: 700; border-radius: 999px; padding: 6px 10px; }
.score-box { grid-area: score; display: grid; gap: 12px; align-content: center; justify-items: center; background: #eefdf6; border: 1px solid #b7f5d6; border-radius: 8px; padding: 18px; }
.score-number { font-size: 4rem; font-weight: 800; line-height: 1; color: var(--green); }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.detail-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 10px;
  align-self: start;
}
.detail-card {
  --detail-divider: rgba(18, 24, 38, 0.1);
  position: relative;
  overflow: hidden;
  gap: 14px;
  border-top-width: 4px;
  box-shadow: 0 12px 28px rgba(18, 24, 38, 0.05);
}
.detail-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.9), transparent 42%);
  pointer-events: none;
}
.detail-card-head {
  position: relative;
  display: grid;
  gap: 5px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--detail-divider);
}
.detail-card-head h2 {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.08;
}
.detail-card-copy {
  position: relative;
  font-size: 1rem;
  line-height: 1.72;
}
.detail-card-accept {
  --detail-divider: rgba(22, 163, 106, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f7fff9 100%);
  border-color: #b7f5d6;
}
.detail-card-weakness {
  --detail-divider: rgba(193, 77, 31, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #fff8f2 100%);
  border-color: #ffd6c8;
}
.detail-card-freshness {
  --detail-divider: rgba(29, 78, 216, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
  border-color: #c8dcff;
}
.detail-card-history {
  --detail-divider: rgba(91, 63, 181, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
  border-color: #ddd6fe;
}
.detail-chip-row {
  position: relative;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: #31405d;
  font-size: 0.84rem;
  font-weight: 800;
}
.detail-chip-rank {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.detail-chip-up {
  border-color: #b7f5d6;
  background: #e9fff5;
  color: #087447;
}
.detail-chip-down {
  border-color: #ffc9c9;
  background: #fff1f1;
  color: var(--red);
}
.detail-chip-steady {
  border-color: #fde68a;
  background: #fff8e8;
  color: #a16207;
}
.history-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.history-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 0;
  font-weight: 800;
  line-height: 1;
}

.detail-hero-footer {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}
.compact-meter {
  border-radius: 6px;
}
.compact-meter .meter-segment {
  min-height: 58px;
  padding: 12px 16px;
}
.compact-meter .meter-segment strong {
  font-size: 1.45rem;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.compact-meter .meter-segment strong small {
  font-size: 0.85rem;
  opacity: 0.55;
  font-weight: 600;
}
.meter-footer-note {
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.meter-footer-note a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 1060px) {
  .detail-hero-with-media {
    grid-template-columns: minmax(0, 1fr) 220px;
    grid-template-areas:
      "media media"
      "copy score";
  }

  .detail-hero-with-media .detail-copy h1 {
    font-size: clamp(2rem, 6vw, 4rem);
  }

  .detail-media-button {
    aspect-ratio: 16 / 7;
  }

  .detail-screenshot {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  .compact-meter {
    grid-template-columns: 1fr 1fr;
  }
  .compact-meter .meter-segment {
    border-right: 1px solid rgba(18, 24, 38, 0.08);
    border-bottom: 1px solid rgba(18, 24, 38, 0.08);
  }
  .compact-meter .meter-segment:nth-child(2n) {
    border-right: 0;
  }
  .compact-meter .meter-segment:nth-child(3),
  .compact-meter .meter-segment:nth-child(4) {
    border-bottom: 0;
  }
}

.how-page { gap: 24px; }
.how-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  border-top: 5px solid var(--blue);
  box-shadow: var(--shadow);
  padding: 28px;
}
.how-hero-copy { display: grid; gap: 12px; align-content: center; }
.how-hero h1 { max-width: 780px; font-size: clamp(2.1rem, 5vw, 4.4rem); }
.how-hero p { max-width: 760px; color: #d9e4f2; font-size: clamp(1rem, 1.6vw, 1.18rem); }
.process-grid, .score-breakdown-grid, .how-split {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.process-grid article, .score-breakdown-grid article, .how-split article {
  display: grid;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.compact-process article {
  min-height: 168px;
  align-content: space-between;
}
.compact-process h3 { font-size: 1.15rem; }
.compact-process p { font-size: 0.95rem; }
.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.process-grid .step-top span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}
.step-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e9fff5;
  border: 1px solid #b7f5d6;
  color: #087447;
  font-size: 0.95rem;
  line-height: 1;
}
.process-grid article:nth-child(2n) .step-icon { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.process-grid article:nth-child(3n) .step-icon { background: #faf5ff; border-color: #ddd6fe; color: #5b3fb5; }
.process-grid article:nth-child(4n) .step-icon { background: #fff7df; border-color: #fde68a; color: #8a5a00; }
.score-breakdown-grid article span {
  width: fit-content;
  border-radius: 999px;
  background: #e9fff5;
  color: #087447;
  border: 1px solid #b7f5d6;
  padding: 4px 10px;
  font-weight: 800;
}
.how-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.freshness-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.score-meter {
  display: grid;
  grid-template-columns: 30fr 30fr 20fr 20fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.meter-segment {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border-right: 1px solid rgba(18, 24, 38, 0.08);
}
.meter-segment:last-child { border-right: 0; }
.meter-segment span { font-weight: 800; }
.meter-segment strong { font-size: 1.9rem; line-height: 1; }
.meter-clarity { background: #edf5ff; color: #1d4ed8; }
.meter-useful { background: #e9fff5; color: #087447; }
.meter-specific { background: #fff7df; color: #8a5a00; }
.meter-complete { background: #f4f2ff; color: #5b3fb5; }
.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.rule-grid article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.rule-grid h3 { font-size: 1rem; }
.rule-grid p { font-size: 0.94rem; }

.legal-page { max-width: 920px; }
.legal-copy {
  display: grid;
  gap: 20px;
}
.legal-copy article {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.legal-copy article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.legal-copy h2 { font-size: 1.12rem; }
.legal-copy a { color: var(--blue); font-weight: 800; }

.admin-section { display: grid; gap: 16px; }
.admin-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}
.admin-section-heading p {
  max-width: 420px;
  text-align: right;
}
.admin-table, .admin-row, .edit-card { display: grid; gap: 10px; }
.admin-row {
  grid-template-columns: minmax(0, 1fr) auto minmax(220px, 360px);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.admin-row form { display: flex; gap: 8px; }
.edit-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 14px; }
.edit-header, .admin-actions { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.queue-list {
  display: grid;
  gap: 12px;
}
.queue-card, .submission-progress {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.queue-card strong,
.queue-card p,
.queue-meta span,
.log-list strong,
.log-list span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.queue-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.status-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 9px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}
.status-running { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.status-queued { background: #fff7df; border-color: #fde68a; color: #8a5a00; }
.status-succeeded { background: #e9fff5; border-color: #b7f5d6; color: #087447; }
.status-failed { background: #fff1f1; border-color: #ffc9c9; color: var(--red); }
.queue-progress {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e8edf5;
}
.queue-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}
.queue-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}
.queue-error {
  color: var(--red);
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.pagination-status {
  color: var(--muted);
  font-weight: 700;
}
.pagination-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pagination-link,
.pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}
.pagination-page.is-current {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.pagination-link.is-disabled {
  color: var(--muted);
  background: #f8fafc;
  cursor: default;
}
.pagination-gap {
  color: var(--muted);
  font-weight: 700;
  padding: 0 2px;
}
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; background: #fff; }
.footer-row { display: flex; justify-content: space-between; gap: 18px; }
.footer-copy { display: grid; gap: 8px; }
.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 820px) {
  .hero-grid, .detail-hero, .detail-grid, .how-hero, .process-grid, .score-breakdown-grid, .how-split, .freshness-row { grid-template-columns: 1fr; }
  .detail-hero {
    grid-template-areas:
      "copy"
      "score";
  }
  .detail-hero-with-media {
    grid-template-areas:
      "media"
      "copy"
      "score";
  }
  .detail-media-button {
    aspect-ratio: 16 / 10;
  }
  .card-grid, .category-grid, .rule-grid { grid-template-columns: 1fr; }
  .score-meter { grid-template-columns: 1fr; }
  .meter-segment { border-right: 0; border-bottom: 1px solid rgba(18, 24, 38, 0.08); }
  .meter-segment:last-child { border-bottom: 0; }
  .admin-row { grid-template-columns: 1fr; }
  .footer-row { flex-direction: column; }
  .admin-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-section-heading p { text-align: left; }
  .nav-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding: 12px 0;
  }
  .brand {
    min-width: 0;
  }
  .main-nav {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
    padding-top: 2px;
  }
  .nav-menu {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }
  .nav-menu-panel {
    right: 0;
    min-width: 180px;
  }
  .split-heading { align-items: start; }
  .section-note { text-align: left; }
  .how-page { gap: 20px; }
  .how-hero { padding: 24px; }
  .how-hero h1 {
    max-width: 17ch;
    font-size: clamp(2rem, 8vw, 2.55rem);
    line-height: 1.02;
  }
  .section-block { padding: 18px; }
  .section-heading.split-heading {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 18px;
  }
  .section-heading.split-heading h2 {
    max-width: none;
  }
  .section-note {
    max-width: none;
    font-size: 0.95rem;
  }
  .listing-table {
    min-width: 0;
  }
  .listing-table thead { display: none; }
  .listing-table,
  .listing-table tbody,
  .listing-table tr,
  .listing-table td {
    display: block;
  }
  .listing-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "listing score"
      "category action"
      "checked action";
    column-gap: 12px;
    row-gap: 6px;
    align-items: start;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }
  .listing-table tr:last-child { border-bottom: 0; }
  .listing-table td {
    border-bottom: 0;
    padding: 0;
  }
  .listing-table td:first-child {
    min-width: 0;
    grid-area: listing;
  }
  .listing-table td:nth-child(2) { grid-area: category; }
  .listing-table td:nth-child(3) { grid-area: score; }
  .listing-table td:nth-child(5) { grid-area: checked; }
  .listing-table td:nth-child(6) { grid-area: action; }
  .table-listing-topline {
    align-items: center;
    gap: 10px;
  }
  .listing-table td:nth-child(2),
  .listing-table td:nth-child(5) {
    font-size: 0.88rem;
  }
  .listing-table td:nth-child(2) {
    color: #647089;
  }
  .listing-table td:nth-child(5) {
    color: #8a93a6;
  }
  .listing-table td:nth-child(3),
  .listing-table td:nth-child(6) {
    display: flex;
    width: fit-content;
    margin-right: 0;
    justify-self: end;
  }
  .listing-table td:nth-child(4) {
    display: none;
  }
  .listing-table td:nth-child(3) {
    align-self: start;
  }
  .listing-table td:nth-child(6) {
    align-self: end;
  }
  .table-listing-cell {
    gap: 8px;
  }
  .table-rank-cluster {
    gap: 7px;
  }
  .trend-compact {
    display: inline-flex;
  }
  .table-agent-name {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    font-size: 1.03rem;
    line-height: 1.08;
  }
  .table-summary {
    -webkit-line-clamp: 3;
  }
  .compact-process {
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
  }
  .compact-process article {
    min-height: 0;
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 4px;
    align-content: start;
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    padding: 15px;
  }
  .compact-process article:last-child { border-bottom: 0; }
  .compact-process .step-top {
    grid-row: 1 / span 2;
    grid-column: 1;
    align-items: flex-start;
    justify-content: center;
  }
  .compact-process h3 {
    grid-column: 2;
    font-size: 1rem;
    line-height: 1.2;
  }
  .compact-process p {
    grid-column: 2;
    font-size: 0.92rem;
  }
  .compact-process .step-icon { display: none; }
  .process-grid .step-top span {
    width: 32px;
    height: 32px;
  }
  .pagination {
    align-items: flex-start;
    padding: 15px;
  }
  .pagination-links {
    width: 100%;
  }
  .rule-grid {
    gap: 0;
    border-top: 1px solid var(--line);
  }
  .rule-grid article {
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 14px 0;
  }
  .rule-grid article:last-child { border-bottom: 0; }
}

/* Project Screenshots */
.card-screenshot {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: #f0f2f5;
  margin-bottom: 8px;
  color: inherit;
  text-decoration: none;
}

.card-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.agent-card:hover .card-screenshot img {
  transform: scale(1.05);
}

.table-thumbnail {
  width: 64px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f2f5;
  flex: 0 0 auto;
  border: 1px solid var(--line);
}

.table-thumbnail a {
  width: 100%;
  height: 100%;
  display: block;
}

.table-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-listing-topline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-content-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.detail-media {
  grid-area: media;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3fb;
}

.detail-media-button {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 16 / 10;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #eef3fb;
  box-shadow: none;
  cursor: zoom-in;
}

.detail-media-button:hover,
.detail-media-button:focus {
  transform: none;
}

.detail-media-button:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: -3px;
}

.detail-screenshot {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: block;
  object-fit: cover;
  object-position: top center;
  transition: transform 180ms ease, filter 180ms ease;
}

.detail-media-button:hover .detail-screenshot,
.detail-media-button:focus-visible .detail-screenshot {
  transform: scale(1.02);
  filter: saturate(1.05);
}

.detail-media-action {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(18, 24, 38, 0.86);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(18, 24, 38, 0.24);
}

.image-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.image-dialog::backdrop {
  background: rgba(18, 24, 38, 0.72);
  backdrop-filter: blur(4px);
}

.image-dialog-body {
  position: relative;
  display: grid;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(18, 24, 38, 0.32);
}

.image-dialog-body img {
  width: 100%;
  max-height: calc(100vh - 64px);
  display: block;
  object-fit: contain;
  background: #f8fafc;
}

.image-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(18, 24, 38, 0.86);
  color: #fff;
  box-shadow: 0 10px 24px rgba(18, 24, 38, 0.2);
}
