:root {
  --ink: #0a0a0a;
  --text: #1a1a1a;
  --muted: #666;
  --line: #e4e4e4;
  --soft: #f6f6f6;
  --bg: #fff;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-top: 32px; padding-bottom: 64px; }
.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
h1 { font-size: 28px; }
h2 { font-size: 19px; margin-top: 4px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
a { color: var(--ink); text-underline-offset: 3px; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--soft); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
ul { padding-left: 20px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center-text { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header and footer */
.top { border-bottom: 1px solid var(--line); background: var(--bg); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 20px; font-size: 15px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a.on { color: var(--ink); }
.nav a.btn { color: #fff; }
.foot { border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; flex-wrap: wrap; }
.foot nav { display: flex; gap: 18px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  padding: 9px 16px; border-radius: 6px; font: inherit; font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #333; border-color: #333; }
.btn:disabled { background: #bbb; border-color: #bbb; cursor: not-allowed; }
.btn-light { background: #fff; color: var(--ink); border-color: #cfcfcf; }
.btn-light:hover { background: var(--soft); border-color: var(--ink); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-wide { width: 100%; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.nav .link { color: var(--muted); text-decoration: none; }
.nav .link:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Layout helpers */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.center { justify-content: center; }
.row.tight { gap: 6px; flex-wrap: nowrap; }
.grow { flex: 1; min-width: 220px; }
.grow input { flex: 1; min-width: 0; }
.between { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.inline { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); }

/* Cards */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; background: var(--bg); }
.card > :last-child { margin-bottom: 0; }
.narrow { max-width: 420px; margin: 32px auto; }
.narrow-form { max-width: 380px; }
.empty { text-align: center; padding: 48px 24px; }
.empty svg { margin-bottom: 12px; }

/* Forms */
label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  display: block; width: 100%; margin-top: 6px;
  padding: 9px 12px; border: 1px solid #cfcfcf; border-radius: 6px;
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
textarea { resize: vertical; }
.row input, .row select { margin-top: 0; width: auto; }
.hint { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 6px; }
.hint.bad { color: var(--ink); font-weight: 600; }
.form-error { border-left: 3px solid var(--ink); background: var(--soft); padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--ink); border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.code { font-size: 24px; letter-spacing: 8px; text-align: center; font-weight: 700; }
.filter { margin-bottom: 20px; }
.filter input[type=search] { flex: 1; min-width: 180px; }
.domain-add { margin-top: 16px; }
.domain-add input { flex: 1; min-width: 200px; }

.notice { border: 1px solid var(--ink); border-radius: 6px; padding: 12px 16px; margin-bottom: 20px; font-size: 14px; }
.notice-error { background: var(--ink); color: #fff; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid var(--ink); border-radius: 999px; padding: 1px 8px; vertical-align: middle; color: var(--ink); }
.badge-dark { background: var(--ink); color: #fff; }

/* Facts and tables */
.facts { margin: 0; display: grid; gap: 10px; }
.facts div { display: flex; gap: 12px; }
.facts dt { width: 150px; color: var(--muted); font-size: 14px; flex-shrink: 0; }
.facts dd { margin: 0; }
.facts-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.facts-row div { flex-direction: column; gap: 2px; }
.facts-row dt { width: auto; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.facts-row dd { font-weight: 600; color: var(--ink); }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
table.dns { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 6px; }
table.dns th, table.dns td { padding: 8px 12px; }

/* Sites */
.site-list { list-style: none; padding: 0; margin: 0; }
.site-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 24px; margin-bottom: 12px; }
.site-row p { margin: 2px 0 0; }
.site-name { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
.site-name:hover { text-decoration: underline; }
.slug-field { display: flex; align-items: center; border: 1px solid #cfcfcf; border-radius: 6px; max-width: 460px; overflow: hidden; }
.slug-field:focus-within { outline: 2px solid var(--ink); border-color: var(--ink); }
.slug-field input { border: 0; margin: 0; flex: 1; min-width: 0; outline: none !important; }
.slug-field span { padding: 0 12px; color: var(--muted); background: var(--soft); align-self: stretch; display: flex; align-items: center; border-left: 1px solid var(--line); font-size: 15px; white-space: nowrap; }
.card h2:not(:first-child) { margin-top: 28px; }

.domain { border-top: 1px solid var(--line); padding: 16px 0; }
.domain:first-of-type { border-top: 0; padding-top: 4px; }
.domain p { margin: 8px 0 0; }

/* Uploader */
.uploader { display: flex; flex-direction: column; gap: 12px; }
.uploader p { margin: 0; }
.drop { border: 2px dashed #bdbdbd; border-radius: var(--radius); padding: 36px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: background 0.1s, border-color 0.1s; }
.drop.over { border-color: var(--ink); background: var(--soft); }
.drop-title { font-weight: 700; color: var(--ink); font-size: 17px; }
.drop .row { margin-top: 10px; }
.selection { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: var(--soft); border-radius: 6px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
progress { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 4px; background: var(--line); overflow: hidden; accent-color: var(--ink); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--ink); }
progress::-moz-progress-bar { background: var(--ink); }

/* Landing */
.hero { text-align: center; padding: 56px 0 48px; }
.hero h1 { font-size: clamp(36px, 7vw, 60px); letter-spacing: -0.04em; margin-bottom: 20px; }
.lead { font-size: 19px; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.hero .row { margin-bottom: 16px; }
.steps, .plans, .grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.steps .card, .plans .card { margin-bottom: 0; }
.step-n { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.features, .pricing { padding-top: 64px; }
.features h2, .pricing h2 { font-size: 26px; }
.grid { gap: 28px; margin-top: 24px; }
.grid h3 { margin-bottom: 4px; }
.plans { margin-top: 24px; align-items: stretch; }
.plan { display: flex; flex-direction: column; }
.plan h3 { font-size: 20px; }
.plan ul { list-style: none; padding: 0; margin: 8px 0 20px; flex: 1; }
.plan li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.plan li:last-child { border-bottom: 0; }

/* Admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { margin: 0; text-decoration: none; display: flex; flex-direction: column; }
.stat b { font-size: 30px; color: var(--ink); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; }
a.stat:hover { border-color: var(--ink); }
.admin-actions { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.details { white-space: pre-wrap; background: var(--soft); border-radius: 6px; padding: 10px 14px; font-size: 14px; overflow-wrap: anywhere; }
.pager { justify-content: center; margin-top: 8px; }

/* Text pages */
.prose { max-width: 680px; }
.prose h2 { margin-top: 32px; }

@media (max-width: 560px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .card { padding: 18px; }
  .facts div { flex-direction: column; gap: 0; }
  .facts dt { width: auto; }
  .nav { gap: 14px; }
}
