:root {
  --bg0: #0b1020;
  --bg1: #0f1b2d;
  --card: rgba(255, 255, 255, 0.08);
  --card2: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);
  --muted2: rgba(255, 255, 255, 0.5);
  --accent: #77e3b6;
  --accent2: #72a7ff;
  --danger: #ff6b6b;
  --warn: #ffd166;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji",
    "Segoe UI Emoji";
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  background: radial-gradient(1200px 700px at 20% 10%, rgba(114, 167, 255, 0.20), transparent 55%),
              radial-gradient(900px 600px at 90% 20%, rgba(119, 227, 182, 0.18), transparent 50%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.25;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 18px;
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
  background: rgba(8, 12, 22, 0.55);
}

.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, rgba(119,227,182,0.95), rgba(114,167,255,0.95));
  color: rgba(10, 15, 30, 0.95);
}
.title h1 { margin: 0; font-size: 16px; letter-spacing: 0.2px; }
.subtitle { margin-top: 2px; font-size: 12px; color: var(--muted); }

.actions { display: flex; align-items: center; gap: 10px; }
.btn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}
.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.18); }
.btn.ghost { background: transparent; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 18px; }
.panel {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 20px 80px rgba(0,0,0,0.35);
  overflow: hidden;
}
.panelHead { padding: 16px; border-bottom: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.03); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.metric {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 10px 12px;
}
.metric.wide { grid-column: span 2; }
.metric .k { font-size: 12px; color: var(--muted); }
.metric .v { font-size: 18px; font-weight: 700; margin-top: 4px; font-family: var(--mono); }

.controls {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); }
input[type="text"], select {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);
  color: var(--text);
  padding: 10px 10px;
  border-radius: 12px;
  outline: none;
}
input[type="text"]:focus, select:focus { border-color: rgba(119, 227, 182, 0.55); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.chipGroup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,0.10); background: rgba(0,0,0,0.12); padding: 8px 10px; border-radius: 14px; }
.chipLabel { font-size: 12px; color: var(--muted2); margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.04); cursor: pointer; user-select: none; }
.chip input { accent-color: var(--accent); }

.rangeRow {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}
.rangeLabel { font-size: 12px; color: var(--muted2); width: 30px; }
.rangeVal { font-family: var(--mono); font-size: 12px; color: var(--text); width: 18px; text-align: right; }
.rangeRow input[type="range"] { width: 180px; }

.worldTldBox {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.10);
}
.worldTldHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.worldTldActions { display: flex; gap: 8px; }
.worldTldControls { display: grid; grid-template-columns: 1fr; gap: 10px; }
.worldTldRow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
#worldTlds {
  width: 100%;
  min-height: 240px;
}

.tableWrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky;
  top: 0;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stroke);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 12px;
  text-align: left;
  cursor: pointer;
}
thead th:hover { background: rgba(12, 17, 32, 0.90); }

tbody td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  white-space: nowrap;
}
tbody tr:hover { background: rgba(255,255,255,0.04); }
td.domain { font-family: var(--mono); font-weight: 700; }
.muted { color: var(--muted); }

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.10);
}
.field.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field.inline > span { margin: 0; }

.starCell { width: 52px; }
.starBtn {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.20);
  color: rgba(255,255,255,0.85);
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.starBtn.on { border-color: rgba(119,227,182,0.35); color: rgba(119,227,182,0.95); }
.starBtn:hover { background: rgba(255,255,255,0.08); }
.starBtn:disabled { opacity: 0.6; cursor: not-allowed; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  font-size: 12px;
}
.pill.ok { border-color: rgba(119,227,182,0.35); }
.pill.warn { border-color: rgba(255,209,102,0.35); }
.pill.bad { border-color: rgba(255,107,107,0.35); }

.foot {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.hint { color: var(--muted); font-size: 12px; }
.small { color: var(--muted2); font-size: 12px; }
code { font-family: var(--mono); font-size: 12px; }

/* Dictionary-specific columns are hidden unless dictionary mode is enabled. */
.dictOnly { display: none !important; }
body.dict-mode .dictOnly { display: inline-flex !important; }
body.dict-mode th.dictOnly,
body.dict-mode td.dictOnly { display: table-cell !important; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric.wide { grid-column: span 2; }
  .controls { grid-template-columns: 1fr; }
  .actions { display: none; }
}
