:root {
  --bg: #0b0f16;
  --bg-soft: #111823;
  --card: #141c29;
  --card-2: #182233;
  --line: #243044;
  --line-soft: #1c2534;
  --text: #e8eef8;
  --muted: #93a2ba;
  --muted-2: #6d7f99;
  --accent: #4dd6c1;
  --accent-2: #7aa2ff;
  --good: #3ddc97;
  --bad: #ff6b81;
  --warn: #ffc857;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  width: min(1500px, 100% - 40px);
  margin-inline: auto;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(11,15,22,.98), rgba(11,15,22,.92));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0 12px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }

.logo {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 20px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 20%, #1f3a4d, #12202c);
  border: 1px solid #2b4a5c;
}

h1 { font-size: 18px; margin: 0; letter-spacing: .2px; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

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

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.stat b { color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.stat.good b { color: var(--good); }
.stat.warn b { color: var(--warn); }

.progress-track { height: 3px; background: transparent; }
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 18px 0 6px;
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); }

.search-field { position: relative; flex: 1 1 280px; min-width: 220px; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); font-size: 16px; pointer-events: none;
}

input[type="search"], select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="search"] { width: 100%; padding-left: 34px; }
input[type="search"]::placeholder { color: var(--muted-2); }
input[type="search"]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 214, 193, .14);
}
select { cursor: pointer; min-width: 150px; }
select option { background: var(--card); }

.toolbar-actions { display: flex; gap: 8px; margin-left: auto; }

.btn {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { border-color: #3a4d68; background: #1d2839; }
.btn:active { transform: translateY(1px); }
.btn.ghost { color: var(--muted); }

.hint { color: var(--muted-2); font-size: 12.5px; margin: 4px 0 14px; }
.hint .verified { color: #6f8aa6; }

/* ---------- table ---------- */
.table-wrap {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden auto;
  max-height: calc(100vh - 250px);
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
  position: sticky; top: 0; z-index: 5;
  background: #16202e;
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
}

th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text); }
th.sortable::after { content: ""; margin-left: 5px; opacity: .45; font-size: 10px; }
th.sortable[aria-sort="ascending"]::after { content: "▲"; opacity: 1; color: var(--accent); }
th.sortable[aria-sort="descending"]::after { content: "▼"; opacity: 1; color: var(--accent); }

tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
tbody tr:hover td { background: #16202e; }
tbody tr:last-child td { border-bottom: none; }

.col-check { width: 44px; text-align: center; }
td.col-check { text-align: center; padding-top: 13px; }

.checkbox {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}

tr.is-checked td { opacity: .62; }
tr.is-checked .name { text-decoration: line-through; text-decoration-color: rgba(147,162,186,.55); }
tr.is-checked td { background: rgba(61, 220, 151, .030); }

.name-cell { min-width: 168px; }
.platform-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.platform-link:hover { color: var(--accent); border-bottom-color: rgba(77,214,193,.5); }
a.platform-link svg, .ext { opacity: .55; font-size: 11px; margin-left: 3px; }

.aka { display: block; color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }
.no-site { color: var(--muted-2); font-weight: 600; }

.desc-cell { min-width: 260px; max-width: 380px; color: #cfdaea; }
.note { display: block; color: var(--muted-2); font-size: 12px; margin-top: 4px; line-height: 1.45; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge[title] { cursor: help; }
.badge.s-active { color: var(--good); background: rgba(61,220,151,.10); border-color: rgba(61,220,151,.25); }
.badge.s-defunct { color: var(--bad); background: rgba(255,107,129,.10); border-color: rgba(255,107,129,.25); }
.badge.s-unknown { color: var(--warn); background: rgba(255,200,87,.10); border-color: rgba(255,200,87,.25); }

.cam { color: #cfdaea; white-space: nowrap; }
.cam small { color: var(--muted-2); }
.cam-req { color: var(--warn); font-weight: 600; }
.cam-none { color: var(--muted); }

.price { font-weight: 600; white-space: nowrap; }
.price-free { color: var(--good); }
.price-freemium { color: var(--accent-2); }
.price-paid { color: var(--muted); }

.muted { color: var(--muted); }
.region-cell { min-width: 120px; color: #cfdaea; }
.groups-cell { min-width: 150px; color: #cfdaea; }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; margin: 0; }

.foot { color: var(--muted-2); font-size: 12px; padding: 18px 2px 40px; max-width: 900px; }
.foot p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .wrap { width: calc(100% - 24px); }
  .table-wrap { max-height: none; overflow-x: auto; }
  table { min-width: 1050px; }
  .toolbar-actions { margin-left: 0; }
  .stat b { font-size: 12.5px; }
}

@media print {
  .topbar, .toolbar, .foot, .hint { display: none; }
  body { background: #fff; color: #000; }
  .table-wrap { border: none; max-height: none; }
  tbody td { border-color: #ddd; }
}
