[hidden] { display: none !important; }
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --text: #17171a;
  --muted: #6b6b73;
  --line: #e4e4df;
  --accent: #5b5bd6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(91, 91, 214, 0.12);
  --ok: #1f9d55;
  --ok-soft: rgba(31, 157, 85, 0.12);
  --bad: #d23c3c;
  --bad-soft: rgba(210, 60, 60, 0.1);
  --warn: #b7791f;
  --code-bg: #16161a;
  --code-ink: #ecebf5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  /* Springs: a soft one for screens, a bouncy one for ticks and pops. */
  --spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 16px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f12;
    --surface: #18181c;
    --surface-2: #202026;
    --text: #ededf0;
    --muted: #9a9aa5;
    --line: #2a2a31;
    --accent: #8b8bf5;
    --accent-ink: #0f0f12;
    --accent-soft: rgba(139, 139, 245, 0.14);
    --ok: #3ccf7f;
    --ok-soft: rgba(60, 207, 127, 0.14);
    --bad: #ff6b6b;
    --bad-soft: rgba(255, 107, 107, 0.12);
    --warn: #e9b44c;
    --code-bg: #0a0a0d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
code, .mono { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
a { color: var(--accent); }

.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 720px; margin: 0 auto; padding: 20px 16px 0;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 17px; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }
.mark svg { width: 18px; height: 18px; fill: none; stroke: var(--accent-ink); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }

.dots { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; opacity: 0; transition: opacity 0.3s var(--ease); }
.dots.on { opacity: 1; }
.dots li { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: width 0.5s var(--spring), background 0.3s; }
.dots li.on { background: var(--accent); }
.dots li.here { width: 18px; }

main { max-width: 720px; margin: 0 auto; padding: 32px 16px 80px; position: relative; overflow-wrap: anywhere; }

/* Screens slide and fade; the outgoing one leaves before the next arrives. */
.screen { transition: opacity 0.22s var(--ease), transform 0.22s var(--ease); }
.screen.leaving { opacity: 0; transform: translateY(-10px); }
.screen.entering { animation: rise 0.6s var(--spring) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

h1 { font-size: clamp(32px, 6vw, 48px); line-height: 1.08; letter-spacing: -0.025em; margin: 8px 0 16px; font-weight: 700; }
h2 { font-size: clamp(26px, 4.5vw, 34px); line-height: 1.15; letter-spacing: -0.02em; margin: 8px 0 20px; }
h3 { font-size: 17px; margin: 0 0 6px; }
.soft { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 650; color: var(--accent); margin: 0; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hint { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

.btn {
  appearance: none; border: 0; border-radius: 12px; padding: 13px 22px; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  transition: transform 0.4s var(--spring), background 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px var(--accent-soft); }
.btn.primary:hover { box-shadow: 0 8px 28px var(--accent-soft); transform: translateY(-1px); }
.btn.big { font-size: 19px; padding: 18px 34px; border-radius: 14px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.back { appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; padding: 4px 0; }
.back::before { content: "‹ "; }

.facts { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 12px; color: var(--muted); max-width: 34em; }
.facts b { color: var(--text); }

.field { display: block; margin: 0 0 16px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type="text"] {
  width: 100%; font: inherit; font-size: 18px; padding: 14px 16px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.at { display: flex; align-items: center; gap: 0; }
.at b { font-size: 18px; color: var(--muted); padding: 0 10px 0 2px; }
.error { color: var(--bad); font-size: 14px; min-height: 0; margin: 0; max-height: 0; opacity: 0; transition: opacity 0.2s, max-height 0.3s var(--ease); }
.error.on { opacity: 1; max-height: 3em; margin: -6px 0 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 20px 0; box-shadow: var(--shadow); }
.card > p:first-of-type { margin-top: 4px; }

table.records { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; table-layout: fixed; }
.records th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 8px 6px 0; }
.records th:first-child { width: 44px; }
.records th:last-child { width: 32%; }
.records td { padding: 8px 8px 8px 0; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.records td.ip { color: var(--muted); font-family: inherit; font-style: italic; }

/* Quick start or own domain */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 20px; }
@media (max-width: 560px) { .modes { grid-template-columns: 1fr; } }
.mode {
  appearance: none; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: grid; gap: 4px; transition: border-color 0.2s, box-shadow 0.25s, transform 0.45s var(--spring);
}
.mode:active { transform: scale(0.98); }
.mode[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.mode b { font-size: 16px; }
.mode > span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.suffix { display: flex; align-items: center; }
.suffix b { font-size: 18px; color: var(--muted); padding: 0 2px 0 10px; white-space: nowrap; }
.name-status { font-size: 14px; margin: -8px 0 12px; min-height: 1.4em; color: var(--muted); transition: color 0.2s; }
.name-status.ok { color: var(--ok); }
.name-status.bad { color: var(--bad); }

/* Choose */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .choices { grid-template-columns: 1fr; } }
.choice {
  appearance: none; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px;
  display: grid; gap: 4px; box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.45s var(--spring);
}
.choice:hover { transform: translateY(-2px); }
.choice:active { transform: scale(0.98); }
.choice[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.choice b { font-size: 17px; }
.choice > span:last-child { color: var(--muted); font-size: 14px; }
.choice-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 8px; }
.choice-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.reveal { animation: rise 0.6s var(--spring) both; }
.step-label { font-weight: 600; margin: 28px 0 10px; }

.code { position: relative; background: var(--code-bg); color: var(--code-ink); border-radius: 14px; padding: 18px 18px 18px 18px; }
.code pre { margin: 0; font-family: var(--mono); font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; padding-right: 76px; }
.copy {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
  background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 8px 14px;
  transition: transform 0.45s var(--spring), background 0.2s;
}
.code .copy { position: absolute; top: 12px; right: 12px; }
.copy:active { transform: scale(0.94); }
.copy.done { background: var(--ok); color: #fff; animation: pop 0.5s var(--spring); }
.copy, .btn, .back, .tabs button { white-space: nowrap; overflow-wrap: normal; flex: none; }
.copy.small { font-size: 13px; padding: 5px 10px; border-radius: 8px; }
@keyframes pop { 0% { transform: scale(0.9); } 100% { transform: scale(1); } }

.tabs { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.tabs button { appearance: none; border: 0; font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; transition: background 0.2s, color 0.2s; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.tips { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.tips summary { cursor: pointer; font-weight: 600; }
.tips dl { margin: 10px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.tips dt { font-weight: 600; }
.tips dd { margin: 0; color: var(--muted); }
.tips[open] dl { animation: rise 0.45s var(--spring) both; }
@media (max-width: 480px) { .tips dl { grid-template-columns: 1fr; } .tips dd { margin-bottom: 6px; } }

.server-size p { margin: 0; font-size: 14px; color: var(--muted); }
.server-size b { color: var(--text); }

.waiting { display: flex; align-items: center; gap: 12px; margin-top: 24px; color: var(--muted); font-size: 15px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); position: relative; flex: none; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: ping 1.6s var(--ease) infinite; }
@keyframes ping { from { transform: scale(1); opacity: 0.6; } to { transform: scale(3); opacity: 0; } }

/* Progress */
.stages { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 4px; }
.stage {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; align-items: start;
  padding: 12px 14px; border-radius: 14px; transition: background 0.4s var(--ease), opacity 0.4s var(--ease);
  opacity: 0.45; animation: rise 0.55s var(--spring) both;
}
.stage.active { background: var(--surface); box-shadow: var(--shadow); opacity: 1; }
.stage.done, .stage.failed { opacity: 1; }
.stage .icon { width: 28px; height: 28px; position: relative; }
.stage .icon svg { width: 28px; height: 28px; position: absolute; inset: 0; }
.stage .ring { fill: none; stroke: var(--line); stroke-width: 2; }
.stage .spin { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 20 60; opacity: 0; transform-origin: 14px 14px; transition: opacity 0.25s; }
.stage.active .spin { opacity: 1; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage .fill { fill: var(--ok); transform: scale(0); transform-origin: 14px 14px; transition: transform 0.55s var(--spring); }
.stage .tick { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset 0.35s var(--ease) 0.18s; }
.stage.done .fill { transform: scale(1); }
.stage.done .tick { stroke-dashoffset: 0; }
.stage.failed .fill { fill: var(--bad); transform: scale(1); }
.stage .cross { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; opacity: 0; transition: opacity 0.25s 0.15s; }
.stage.failed .cross { opacity: 1; }
.stage .label b { display: block; font-weight: 600; }
.stage .label .sub { font-size: 14px; color: var(--muted); }
.stage .latest {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
  display: grid; max-height: 0; opacity: 0; margin-top: 0;
  transition: max-height 0.4s var(--ease), opacity 0.25s var(--ease), margin-top 0.4s var(--ease);
}
.stage .latest.on { max-height: 2em; opacity: 1; margin-top: 6px; }
.stage .latest span { grid-area: 1 / 1; animation: lineIn 0.45s var(--spring) both; overflow: hidden; text-overflow: ellipsis; }
.stage .latest span.out { animation: lineOut 0.25s var(--ease) both; }
@keyframes lineIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes lineOut { to { opacity: 0; transform: translateY(-8px); } }
.stage .label { min-width: 0; }
.stage .time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 3px; }

.notes { display: grid; gap: 8px; margin-top: 16px; }
.note { font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 10px; padding: 10px 14px; animation: rise 0.5s var(--spring) both; }

.failbox { margin-top: 20px; background: var(--bad-soft); border: 1px solid var(--bad); border-radius: var(--radius); padding: 20px; animation: rise 0.55s var(--spring) both; }
.failbox h3 { color: var(--bad); }
.failbox p { margin: 8px 0; }
.failbox .code { margin-top: 12px; }

/* Done */
.hero-done { text-align: center; padding: 8px 0 8px; }
.hero-done .lead { margin: 0 auto 8px; }
.big-tick { display: inline-block; width: 72px; height: 72px; }
.big-tick svg { width: 72px; height: 72px; }
.big-tick circle { fill: var(--ok); transform-origin: 26px 26px; animation: grow 0.7s var(--spring) both; }
.big-tick path { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.45s var(--ease) 0.35s forwards; }
@keyframes grow { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
[data-screen="done"] .card { animation: rise 0.6s var(--spring) both; }
[data-screen="done"] .card:nth-of-type(2) { animation-delay: 0.08s; }
[data-screen="done"] .card:nth-of-type(3) { animation-delay: 0.16s; }
[data-screen="done"] .card:nth-of-type(4) { animation-delay: 0.24s; }

.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.kv:first-of-type { border-top: 0; }
.kv > span:first-child { color: var(--muted); font-size: 14px; }
.kv .pw { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kv .pw b { overflow-wrap: anywhere; }
#pw.unknown { font-family: inherit; font-weight: 400; color: var(--muted); font-size: 14px; }

.recs { display: grid; gap: 10px; margin-top: 12px; }
.rec { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 44px 1fr; gap: 4px 10px; font-size: 14px; }
.rec .type { font-weight: 700; font-size: 13px; color: var(--accent); padding-top: 2px; }
.rec .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.rec .row + .row { grid-column: 2; }
.rec .val { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; word-break: break-all; min-width: 0; }
.rec .lbl { color: var(--muted); font-size: 12px; display: block; font-family: inherit; }
.rec .copy { background: var(--surface-2); color: var(--text); }
.rec .copy.done { background: var(--ok); color: #fff; }
.rec .why { grid-column: 2; color: var(--muted); font-size: 13px; }

.ports { margin: 8px 0 0; padding-left: 20px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: opacity 0.2s var(--ease), transform 0.5s var(--spring);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.15s !important; transition-duration: 0.15s !important; animation-iteration-count: 1 !important; }
}

/* Port 25 warning on the done screen: stands out, rises in like the rest. */
.warnbox { margin: 0 0 20px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid var(--warn); border-radius: var(--radius); padding: 20px; animation: rise 0.55s var(--spring) both; }
.warnbox h3 { color: var(--warn); margin: 0 0 6px; }
.warnbox p { margin: 8px 0; }
.warnbox dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0; font-size: 14px; }
.warnbox dt { font-weight: 600; }
.warnbox dd { margin: 0; }
@media (max-width: 480px) { .warnbox dl { grid-template-columns: 1fr; } .warnbox dd { margin-bottom: 6px; } }
.warnbox .fix { margin-top: 16px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.warnbox h4 { margin: 0 0 6px; font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.warnbox .tag { font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.warnbox ol { margin: 8px 0; padding-left: 20px; font-size: 14px; }
.warnbox ol li { margin: 4px 0; }
.warnbox .code { margin: 8px 0; }

/* DNS records: download for bulk import, and copied records dim so it's clear what's left. */
.dns-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.btn.small { font-size: 14px; padding: 9px 16px; border-radius: 10px; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.rec, .rec .row { transition: opacity 0.3s ease, border-color 0.3s ease, background-color 0.3s ease; }
.rec .row.copied .val { opacity: 0.5; transition: opacity 0.3s ease; }
.rec .row .val { transition: opacity 0.3s ease; }
.rec.copied { opacity: 0.5; border-style: dashed; }
.rec.copied:hover, .rec.copied:focus-within { opacity: 0.85; }
.rec .type { display: flex; align-items: center; gap: 4px; }
.rec .tick { display: inline-block; width: 0; opacity: 0; overflow: hidden; color: var(--ok); transform: scale(0.4); transition: width 0.3s var(--spring), opacity 0.25s ease, transform 0.35s var(--spring); }
.rec.copied .tick { width: 12px; opacity: 1; transform: scale(1); }
.warnbox .ai-prompt { margin-top: 14px; }
.warnbox .ai-prompt h4 { margin-bottom: 2px; }
.code pre.prompt { font-size: 13px; line-height: 1.55; max-height: 220px; overflow-y: auto; }
.kv a { overflow-wrap: anywhere; text-align: right; min-width: 0; }
