:root {
  --ink: #16211d;
  --ink-2: #384740;
  --muted: #6b756f;
  --faint: #9aa39d;
  --bg: #fbfcfb;
  --bg-2: #f2f5f3;
  --panel: #fff;
  --line: #e7ebe7;
  --brand: #1b5e42;
  --brand-2: #2a8159;
  --brand-50: #edf5f0;
  --gold: #c99a3f;
  --gold-50: #f8f1de;
  --ok: #1b5e42;
  --danger: #b42318;
  --shadow: 0 18px 40px -28px rgba(10, 36, 25, 0.45);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-family: Fraunces, Georgia, serif; font-style: italic; font-weight: 600; font-size: 18px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; }
.brand-text em { font-style: normal; color: var(--muted); font-size: 12px; }
nav { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: var(--brand); }

main { max-width: 1120px; margin: 0 auto; padding: 36px 20px 80px; }
.hero { max-width: 720px; margin-bottom: 28px; }
.kicker {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--brand-2); font-weight: 600; margin: 0 0 8px;
}
h1 {
  font-family: Fraunces, Georgia, serif; font-weight: 560;
  font-size: clamp(28px, 4vw, 44px); line-height: 1.12; margin: 0 0 12px;
}
.lede { color: var(--ink-2); font-size: 16px; line-height: 1.55; margin: 0; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 22px; box-shadow: var(--shadow);
}
.modes { display: flex; gap: 8px; margin-bottom: 18px; }
.mode, .filters button, .presets button {
  border: 1px solid var(--line); background: var(--bg-2);
  border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 13px;
}
.mode.on, .filters button.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 22px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.pair.three { grid-template-columns: 1fr 1fr 1.2fr; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
label span, .hint { font-weight: 400; color: var(--muted); }
.hint { font-size: 13px; line-height: 1.45; margin: 8px 0 0; }
.labrow { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.labrow label { font-size: 13px; }
.meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tiny { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0 4px; }

input, textarea, select {
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; padding: 11px 12px; outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--brand-50);
}
textarea { width: 100%; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; }
.preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 8px; }
.chip {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  background: var(--bg-2); border-radius: 8px; padding: 3px 8px; color: var(--ink-2);
}
.chip b { color: var(--brand-2); font-weight: 600; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tld-box {
  height: 280px; overflow: auto; border: 1px solid var(--line);
  border-radius: 14px; padding: 8px; background: var(--bg);
}
.tld {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.tld:hover { background: var(--brand-50); }
.tld input { accent-color: var(--brand); }
.tld .ext { font-family: ui-monospace, Menlo, monospace; }
.tld .tag { margin-left: auto; font-size: 10px; color: var(--faint); letter-spacing: 0.04em; }

.go { margin-top: 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.primary {
  background: var(--brand); color: #fff; border: 0; border-radius: 12px;
  padding: 12px 18px; font-weight: 650; cursor: pointer;
}
.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.primary.slim, .ghost.slim { padding: 8px 12px; font-size: 13px; }
.ghost {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 18px; cursor: pointer; font-weight: 600;
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 10px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px;
}
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }
.stat.ok b { color: var(--ok); }
.stat.gold b { color: var(--gold); }
.stat.bad b { color: var(--danger); }

.progress { margin: 8px 0 18px; }
.bar { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--gold)); transition: width 0.25s ease; }
#progress-label { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.results-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin: 12px 0 12px; flex-wrap: wrap; }
.results-head h2 { margin: 0; font-size: 22px; font-family: Fraunces, Georgia, serif; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }

.results {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 10px;
}
.row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px; font-family: ui-monospace, Menlo, monospace; font-size: 13px;
}
.row:hover { background: var(--bg-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.available { background: #1b5e42; }
.dot.premium { background: #c99a3f; }
.dot.registered { background: #b42318; }
.dot.unknown { background: #9aa39d; }
.row .src { margin-left: auto; color: var(--faint); font-size: 10px; }

.copied { color: var(--brand); font-size: 13px; margin: 10px 0 0; }
.drawer {
  position: fixed; inset: 0; background: rgba(22, 33, 29, 0.35);
  display: grid; place-items: center; padding: 20px; z-index: 20;
}
.drawer[hidden] { display: none; }
.drawer-card {
  background: #fff; max-width: 720px; width: 100%; border-radius: 18px;
  padding: 20px; border: 1px solid var(--line);
}
.drawer-card pre {
  background: #0f3527; color: #edf5f0; padding: 14px; border-radius: 12px;
  overflow: auto; font-size: 12px; line-height: 1.45;
}
footer { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }
footer a { color: var(--ink-2); }

@media (max-width: 860px) {
  .grid, .results, .stats, .pair, .pair.three { grid-template-columns: 1fr; }
  .top { padding: 14px 16px; }
  .tld-box { height: 220px; }
}
