/* ============================================================
   TLD:list — clean domain price comparison styling
   ============================================================ */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-dim: #64748b;
  --text-faint: #94a3b8;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --accent-ink: #1d4ed8;
  --best: #16a34a;
  --best-soft: #dcfce7;
  --warn: #d97706;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.05);
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111a2b;
  --surface-2: #16213a;
  --border: #233048;
  --border-strong: #2f3f5c;
  --text: #e7edf6;
  --text-dim: #9fb0c8;
  --text-faint: #6b7d99;
  --accent: #4f8bff;
  --accent-soft: #1b2c4d;
  --accent-ink: #86b0ff;
  --best: #4ade80;
  --best-soft: #15331f;
  --warn: #fbbf24;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
}
.topbar-inner { display: flex; align-items: center; gap: 22px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 22px; }
.brand-accent { color: var(--accent); }
.brand-name { letter-spacing: -.02em; }
.topnav { display: flex; gap: 18px; margin-left: 8px; }
.topnav a { color: var(--text-dim); font-weight: 600; font-size: 14px; padding: 6px 2px; }
.topnav a.active, .topnav a:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  margin-left: auto; background: var(--surface-2); border: 1px solid var(--border);
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer; font-size: 16px; color: var(--text);
}
.theme-toggle:hover { border-color: var(--border-strong); }

/* ---------- Hero ---------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 34px 0 26px; }
.hero h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.02em; }
.hero-sub { margin: 0 0 18px; color: var(--text-dim); font-size: 15px; }
.hero-sub strong { color: var(--text); }

.ad-banner { margin: 0 0 20px; }
.ad-link {
  display: block; background: linear-gradient(90deg, var(--accent-soft), transparent);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 12px 16px; color: var(--text-dim); font-size: 13px;
}
.ad-link:hover { text-decoration: none; border-color: var(--accent); }
.ad-tag {
  display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); border: 1px solid var(--border-strong); border-radius: 4px;
  padding: 1px 6px; margin-right: 10px; vertical-align: middle;
}
.ad-text { vertical-align: middle; }

/* ---------- Controls ---------- */
.controls { display: flex; gap: 12px; flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 0 12px; height: 44px; flex: 1; min-width: 260px;
}
.search-icon { color: var(--text-faint); }
.search-box input {
  border: none; background: transparent; outline: none; flex: 1; font-size: 15px;
  color: var(--text); height: 100%;
}
.clear-search {
  border: none; background: transparent; color: var(--text-faint); font-size: 22px;
  cursor: pointer; line-height: 1; padding: 0 4px; display: none;
}
.clear-search.show { display: block; }

.filterbar { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 18px; }
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); font-weight: 700; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
  font-size: 13px; color: var(--text-dim); cursor: pointer; user-select: none;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip.toggle { cursor: default; }
.chip.toggle input { accent-color: var(--accent); }

.result-count { color: var(--text-dim); font-size: 14px; margin: 16px 0 0; }
.result-count span { color: var(--text); font-weight: 700; }

/* ---------- Table ---------- */
main.wrap { padding-top: 22px; padding-bottom: 40px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.cmp { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
table.cmp thead th {
  text-align: left; padding: 12px 14px; background: var(--surface-2);
  color: var(--text-dim); font-weight: 700; font-size: 12.5px; border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 60px;
}
table.cmp th.sortable { cursor: pointer; }
table.cmp th.sortable:hover { color: var(--text); }
table.cmp th.sort-asc::after { content: " ▲"; font-size: 9px; }
table.cmp th.sort-desc::after { content: " ▼"; font-size: 9px; }
table.cmp tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.cmp tbody tr:last-child td { border-bottom: none; }
table.cmp tbody tr:hover { background: var(--surface-2); }

.th-domain, .c-domain { width: 150px; }
.th-price, .c-price { width: 150px; }
.th-pop, .c-pop { text-align: center; }
.th-value, .c-value { width: 200px; }

/* domain cell */
.tld-name { font-weight: 800; font-size: 16px; }
.tld-name a { color: var(--text); }
.tld-name a:hover { color: var(--accent); }
.tld-cat { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }

/* price cells */
.price-main { font-weight: 700; font-size: 15px; }
.price-promo { font-size: 12px; color: var(--best); font-weight: 700; margin-top: 2px; }
.price-promo .code {
  display: inline-block; background: var(--best-soft); color: var(--best);
  border-radius: 4px; padding: 0 5px; margin-left: 4px; font-family: var(--mono); font-size: 11px;
}
.price-registrar { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* value cell */
.value-box { font-size: 12.5px; }
.value-reg { color: var(--text-dim); }
.value-reg b { color: var(--text); font-weight: 700; }
.value-renew { color: var(--text-dim); }
.value-renew b { color: var(--text); font-weight: 700; }

/* popularity bar */
.pop-num { font-weight: 700; }
.pop-bar { height: 6px; background: var(--surface-2); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.pop-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-ink)); border-radius: 4px; }

/* badges */
.badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.badge-yes { background: var(--best-soft); color: var(--best); }
.badge-no { background: var(--surface-2); color: var(--text-faint); }
.badge-paid { background: #fef3c7; color: var(--warn); }
[data-theme="dark"] .badge-paid { background: #3a2c0c; color: var(--warn); }

/* ---------- Pager ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.pager button {
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: 8px; padding: 8px 16px; cursor: pointer; font-weight: 600; font-size: 14px;
}
.pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager-info { color: var(--text-dim); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pager-info select { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 7px; padding: 6px 8px; font-size: 13px; }

/* ---------- Detail page ---------- */
.detail { padding-top: 22px; }
.breadcrumb { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb span.sep { margin: 0 6px; }
.detail-head h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.02em; }
.detail-sub { color: var(--text-dim); margin: 0 0 18px; }
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.scard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.scard .label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.scard .value { font-size: 22px; font-weight: 800; margin-top: 4px; }
.scard .sub { font-size: 12px; color: var(--text-faint); margin-top: 3px; }

.registrars h2, .subdomains h2 { font-size: 19px; margin: 26px 0 12px; }
.fineprint { color: var(--text-faint); font-size: 12.5px; margin-top: 12px; }

/* ---------- FAQ ---------- */
.faq { margin: 36px auto; }
.faq h2 { font-size: 22px; margin-bottom: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.faq details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.faq p { color: var(--text-dim); margin: 0 0 12px; }
.faq code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 20px; }
.footer-inner { padding: 22px 20px; color: var(--text-faint); font-size: 13px; }
.footer-inner code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* plugin nav + footer (rendered around shortcodes) */
.tldlist-bar { position: static; }
.tldlist-bar .wrap { max-width: 1080px; }
.tldlist-footer .footer-links a { color: var(--text-dim); margin: 0 4px; }

/* sources grid */
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 18px 0 28px; }
.source-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.source-card .source-name { font-weight: 700; font-size: 16px; }
.source-card .source-meta { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* newsletter */
.news-form { display: flex; gap: 10px; max-width: 460px; margin-top: 8px; flex-wrap: wrap; }
.news-form input[type=email] { flex: 1; min-width: 220px; height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 15px; background: var(--bg); color: var(--text); }
.news-form button { height: 44px; padding: 0 22px; border: none; border-radius: var(--radius); background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.news-form button:hover { background: var(--accent-ink); }
.news-msg { margin-top: 10px; font-size: 14px; min-height: 18px; }
.news-msg.ok { color: var(--best); }
.news-msg.err { color: #b91c1c; }

.hidden { display: none !important; }

@media (max-width: 680px) {
  .topnav { display: none; }
  .hero h1 { font-size: 23px; }
  .filterbar { gap: 16px; }
  table.cmp { font-size: 13px; }
  .th-pop, .c-pop { display: none; }
}
