:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --primary: #0f172a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --green-bg: #dcfce7;
  --green-text: #166534;
  --green-border: #bbf7d0;
  --amber-bg: #fef3c7;
  --amber-text: #92400e;
  --amber-border: #fde68a;
  --red-bg: #fee2e2;
  --red-text: #991b1b;
  --red-border: #fecaca;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none !important;
}

.brand-mark {
  background: var(--primary);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: -0.02em;
}

.verified-pill {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--green-bg);
  color: var(--green-text);
  border: 1px solid var(--green-border);
  padding: 2px 8px;
  border-radius: 999px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-cta {
  background: var(--primary);
  color: #fff !important;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 6px;
  text-decoration: none !important;
}

.nav-cta:hover {
  opacity: 0.92;
}

/* Hero Section */
.hero {
  padding: 36px 0 24px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #bfdbfe;
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 1.02rem;
  max-width: 820px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2px;
}

/* Filter & Matcher Toolbar */
.toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.search-input {
  flex: 1 1 240px;
  min-width: 220px;
  padding: 9px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font-size: 0.92rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pill-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.pill-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.matcher-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--surface-muted);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
}

.matcher-bar label {
  font-weight: 600;
  color: var(--text);
}

.matcher-bar input[type="number"] {
  width: 100px;
  padding: 5px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Directory Table & Cards */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  margin-bottom: 28px;
}

.dir-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.dir-table th {
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.dir-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.dir-table tr:last-child td {
  border-bottom: none;
}

.dir-table tr:hover td {
  background: #f8fafc;
}

.dir-table tr.row-retired td {
  opacity: 0.75;
  background: #fffafa;
}

.provider-title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.96rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.model-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.model-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-green {
  background: var(--green-bg);
  color: var(--green-text);
  border: 1px solid var(--green-border);
}

.badge-amber {
  background: var(--amber-bg);
  color: var(--amber-text);
  border: 1px solid var(--amber-border);
}

.badge-red {
  background: var(--red-bg);
  color: var(--red-text);
  border: 1px solid var(--red-border);
}

.quota-main {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.quota-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.catch-text {
  font-size: 0.83rem;
  color: var(--text-secondary);
  max-width: 310px;
}

.action-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none !important;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s;
}

.btn-sm:hover {
  background: var(--surface-muted);
}

.btn-primary-sm {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}

.btn-primary-sm:hover {
  background: var(--accent-hover);
}

/* Code / Config Generator Box */
.code-card {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  position: relative;
  overflow-x: auto;
}

.code-card pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.83rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Modal Drawer for Snippet & Rules */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
}

.modal-panel {
  background: var(--surface);
  border-radius: 12px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* Info / SEO Content Blocks & Sponsor Footer */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.info-box h2,
.info-box h3 {
  font-size: 1.08rem;
  margin-bottom: 10px;
}

.info-box ul {
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.info-box li {
  margin-bottom: 6px;
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 36px 0;
  margin-top: 48px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

@media (max-width: 768px) {
  .dir-table th:nth-child(4),
  .dir-table td:nth-child(4) {
    min-width: 200px;
  }
}
