/* Compatibility DB — live data from docs/compatibility/database.json */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

.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;
}

.compat-page {
  background: radial-gradient(ellipse at 90% 8%, #22443750, transparent 40%), var(--bg);
}

.compat-page header,
.compat-page main,
.compat-page footer {
  max-width: 1400px;
}

.compat-page .nav-play {
  padding: 10px 16px;
  border: 1px solid #506659;
  border-radius: 7px;
  color: var(--accent);
}

.compat-page .page-links a[aria-current="page"] {
  color: var(--accent);
}

.compat-main {
  padding-top: 0;
}

.compat-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 44px;
  padding: 62px 0 34px;
  border-bottom: 1px solid var(--line);
}

.compat-hero h1 {
  margin: 13px 0 18px;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -4px;
  font-weight: 650;
}

.compat-hero p {
  max-width: 700px;
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
}

.compat-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--muted);
  font: 10px/1.6 monospace;
  text-align: right;
}

.compat-meta a {
  color: var(--accent);
}

.compat-meta a:hover,
.compat-footnote a:hover,
.evidence:hover {
  text-decoration: underline;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid #2c4638;
  border-radius: 5px;
  background: #15261e;
  color: #a9c2b8;
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px #a7efca88;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0 30px;
}

.summary-card {
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #141b2480;
}

.summary-card strong {
  display: block;
  color: #e8f1f6;
  font: 30px/1 monospace;
  font-weight: 500;
}

.summary-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.4px;
}

.summary-card.green {
  border-color: #2c4638;
  background: #15261e80;
}

.summary-card.green strong {
  color: var(--accent);
}

.summary-card.yellow {
  border-color: #5a4a22;
  background: #2a241580;
}

.summary-card.yellow strong {
  color: #f5d67b;
}

.summary-card.red {
  border-color: #5a2a2e;
  background: #2a171980;
}

.summary-card.red strong {
  color: #ff9b9b;
}

.summary-card.grey strong {
  color: #b3c0ce;
}

.compat-notice {
  margin: 0 0 20px;
  padding: 11px 14px;
  border: 1px solid #5a4a22;
  border-radius: 8px;
  background: #2a241580;
  color: #f5d67b;
  font-size: 12px;
}

.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 18px;
}

.results-head h2 {
  margin: 8px 0 0;
  font-size: 30px;
  letter-spacing: -1px;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font: 11px monospace;
  white-space: nowrap;
}

.compat-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.search {
  flex: 1 1 290px;
  min-width: 190px;
}

.search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f151c;
  color: #edf2f8;
  font: 12px system-ui, sans-serif;
}

.search input::placeholder {
  color: #718196;
}

.search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filters .filter {
  padding: 8px 10px;
  font-size: 11px;
  white-space: nowrap;
}

.filters .filter.active {
  border-color: var(--accent);
  background: #1d3329;
  color: var(--accent);
}

.filter-count {
  color: var(--muted);
  font: 10px monospace;
}

.filters .filter.active .filter-count {
  color: #a9c2b8;
}

.refresh {
  flex: 0 0 auto;
  padding: 9px 13px;
  font-size: 11px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f151c;
  box-shadow: 0 22px 70px #0004;
}

#compat-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

#compat-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: #141b24;
  color: #809f8d;
  font: 10px monospace;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-align: left;
  text-transform: uppercase;
}

#compat-table td {
  padding: 14px 15px;
  border-bottom: 1px solid #1e2834;
  color: #cbd5e1;
  font-size: 12px;
  vertical-align: top;
}

#compat-table tbody tr:last-child td {
  border-bottom: 0;
}

#compat-table tbody tr:hover td {
  background: #151f27;
}

.app-name {
  color: #e8f1f6;
  font-size: 13px;
  font-weight: 600;
}

.app-name:hover {
  color: var(--accent);
}

.app-version {
  display: block;
  max-width: 260px;
  margin-top: 4px;
  color: var(--muted);
  font: 10px/1.5 monospace;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid;
  border-radius: 999px;
  font: 10px monospace;
  white-space: nowrap;
}

.pill.green {
  border-color: #2c4638;
  background: #15261e;
  color: var(--accent);
}

.pill.yellow {
  border-color: #5a4a22;
  background: #2a2415;
  color: #f5d67b;
}

.pill.red {
  border-color: #5a2a2e;
  background: #2a1719;
  color: #ff9b9b;
}

.pill.grey {
  border-color: #354354;
  background: #1a2028;
  color: #b3c0ce;
}

.result {
  max-width: 540px;
  line-height: 1.65;
}

.evidence {
  color: var(--accent);
  font: 10px monospace;
  white-space: nowrap;
}

.date {
  color: var(--muted);
  font: 10px monospace;
  white-space: nowrap;
}

.compat-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f151c;
  color: var(--muted);
  font-size: 12px;
}

.compat-state.error {
  border-color: #5a2a2e;
  background: #2a171980;
  color: #ffb3b3;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #354354;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: compat-spin 0.8s linear infinite;
}

@keyframes compat-spin {
  to { transform: rotate(360deg); }
}

.retry {
  display: block;
  margin: 12px 0 0;
  padding: 8px 12px;
  font-size: 11px;
}

.empty {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f151c;
  text-align: center;
  font: 12px monospace;
}

.compat-footnote {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.compat-footnote p {
  max-width: 920px;
  margin: 8px 0;
  font-size: 11px;
  line-height: 1.8;
}

.compat-footnote a {
  color: var(--accent);
}

.noscript {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px 30px;
  color: #ffb3b3;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .compat-toolbar {
    flex-wrap: wrap;
  }

  .search {
    flex-basis: 100%;
  }

  .filters {
    order: 3;
    width: 100%;
  }
}

@media (max-width: 1000px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-card.total {
    grid-column: 1 / -1;
  }

  .compat-hero {
    display: block;
    padding-top: 44px;
  }

  .compat-meta {
    align-items: flex-start;
    margin-top: 24px;
    text-align: left;
  }
}

@media (max-width: 760px) {
  .compat-page header,
  .compat-page main,
  .compat-page footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .compat-page .page-links > a:first-child {
    display: none;
  }

  .compat-hero h1 {
    font-size: 52px;
    letter-spacing: -3px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary-card {
    padding: 14px 15px;
  }

  .summary-card strong {
    font-size: 25px;
  }

  .results-head {
    display: block;
  }

  .result-count {
    margin-top: 10px;
  }

  .filters .filter {
    font-size: 10px;
  }

  .compat-state {
    padding: 18px;
    text-align: center;
  }

  .compat-footnote p {
    font-size: 10px;
  }
}

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