/* Monochrome by design: one ink colour, one paper colour, and the greys
   between them. Themes swap the two. Nothing else carries hue, so contrast
   alone has to do the work — which keeps the page honest. */

:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --raised: #fafafa;
  --focus: #0a0a0a;
  --danger: #1a1a1a;
  --radius: 2px;
  --w: 34rem;
}

:root[data-theme="dark"],
:root[data-theme="auto"] {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --paper: #0a0a0a;
    --ink: #f2f2f2;
    --muted: #8f8f8f;
    --line: #262626;
    --raised: #141414;
    --focus: #f2f2f2;
    --danger: #f2f2f2;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0a0a0a;
  --ink: #f2f2f2;
  --muted: #8f8f8f;
  --line: #262626;
  --raised: #141414;
  --focus: #f2f2f2;
  --danger: #f2f2f2;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.6 ui-sans-serif, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Inter, system-ui, sans-serif;
  letter-spacing: -0.006em;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------- bar -- */

.bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.mark { font-size: .7rem; line-height: 1; }
.bar-title { font-weight: 600; letter-spacing: -0.02em; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.who { color: var(--muted); font-size: .85rem; }

.icon-btn {
  background: none; border: 1px solid var(--line); color: var(--ink);
  width: 28px; height: 28px; border-radius: var(--radius);
  cursor: pointer; font-size: .8rem; line-height: 1;
}
.icon-btn:hover { border-color: var(--ink); }

/* --------------------------------------------------------------- main -- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--w);
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.view { animation: rise .18s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

h1 {
  font-size: 1.9rem; font-weight: 600; letter-spacing: -0.035em;
  margin-bottom: .6rem;
}
h2 { font-size: .8rem; font-weight: 600; text-transform: uppercase;
     letter-spacing: .09em; color: var(--muted); margin-bottom: .9rem; }

.lede { color: var(--muted); margin-bottom: 1.8rem; }
.fine { font-size: .82rem; color: var(--muted); margin-top: .9rem; }
.fine.error { color: var(--danger); font-weight: 500; }
.hint { font-size: .8rem; color: var(--muted); margin: .4rem 0 1.3rem; }
code {
  font: 500 .84em ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--raised); border: 1px solid var(--line);
  padding: .05em .35em; border-radius: var(--radius);
}

/* -------------------------------------------------------------- steps -- */

.steps {
  display: flex; gap: 1.4rem; list-style: none;
  margin-bottom: 2.4rem; font-size: .82rem; color: var(--muted);
  counter-reset: s;
}
.steps li { counter-increment: s; display: flex; align-items: center; gap: .45rem; }
.steps li::before {
  content: counter(s);
  width: 19px; height: 19px; flex: none;
  border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; font-size: .68rem;
}
.steps li.on { color: var(--ink); font-weight: 500; }
.steps li.on::before { border-color: var(--ink); }
.steps li.did::before {
  content: "✓"; background: var(--ink); color: var(--paper); border-color: var(--ink);
}

/* -------------------------------------------------------------- forms -- */

fieldset { border: 0; }

label {
  display: block; font-size: .82rem; font-weight: 500;
  margin-bottom: .4rem;
}

input[type="text"], input:not([type]), input[type="email"], textarea {
  width: 100%;
  padding: .62rem .7rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  outline: none;
  transition: border-color .12s;
}
textarea {
  font: 400 .82rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
}
input:focus, textarea:focus { border-color: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .65; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.row + .row, .row { margin-bottom: 1.3rem; }

details { margin: 0 0 1.4rem; }
summary {
  cursor: pointer; font-size: .82rem; color: var(--muted);
  padding: .3rem 0; user-select: none;
}
summary:hover { color: var(--ink); }
details[open] { padding-bottom: .2rem; }
details label { margin-top: .9rem; }

/* choices */
.choice {
  display: flex; gap: .7rem; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .85rem .9rem; margin-bottom: .6rem; cursor: pointer;
  font-weight: 400; transition: border-color .12s;
}
.choice:hover { border-color: var(--muted); }
.choice:has(input:checked) { border-color: var(--ink); background: var(--raised); }
.choice input { margin-top: .25rem; accent-color: var(--ink); }
.choice strong { display: block; font-size: .9rem; font-weight: 600; }
.choice em { font-style: normal; font-size: .82rem; color: var(--muted); }

#vps { margin: 1.2rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--line); }

/* alias */
.alias { display: flex; align-items: stretch; }
.alias input {
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
}
.zone {
  display: flex; align-items: center; padding: 0 .7rem;
  border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--raised); color: var(--muted);
  font: 400 .85rem ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

/* ------------------------------------------------------------ buttons -- */

.actions { display: flex; gap: .6rem; margin-top: 1.8rem; }

.btn, .ghost, a.btn {
  font: 500 .88rem/1 inherit;
  padding: .68rem 1.15rem;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--ink);
  transition: opacity .12s, border-color .12s;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn, a.btn { background: var(--ink); color: var(--paper); }
.btn:hover, a.btn:hover { opacity: .85; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.ghost { background: none; color: var(--ink); border-color: var(--line); }
.ghost:hover { border-color: var(--ink); }

/* ----------------------------------------------------------- progress -- */

.track {
  height: 2px; background: var(--line);
  border-radius: 2px; overflow: hidden; margin: 1.6rem 0 1rem;
}
.fill {
  height: 100%; width: 0%; background: var(--ink);
  transition: width .45s cubic-bezier(.22,.61,.36,1);
}
.status { color: var(--muted); font-size: .88rem; }

.log {
  list-style: none; margin-top: 1.8rem;
  font: 400 .8rem/1.9 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
}
.log li { display: flex; gap: .6rem; }
.log li::before { content: "·"; }
.log li.ok::before { content: "✓"; color: var(--ink); }

/* ------------------------------------------------------------- result -- */

.url {
  display: inline-block; font-size: 1.05rem; font-weight: 500;
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--ink); padding-bottom: 1px;
  margin-bottom: .3rem; word-break: break-all;
}
.url:hover { opacity: .7; }

.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem; margin: 2rem 0 1.6rem; background: var(--raised);
}
dl { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.2rem; font-size: .88rem; }
dt { color: var(--muted); }
dd { word-break: break-all; }
.mono { font: 400 .85rem ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 520px) {
  main { padding: 2.5rem 1.2rem 4rem; }
  h1 { font-size: 1.55rem; }
  .row { grid-template-columns: 1fr; }
  .steps { gap: .9rem; font-size: .76rem; }
}

/* Port detection note. Confidence is shown by weight rather than colour so it
   stays legible in a monochrome palette. */
.hint.detect { margin-top: -0.9rem; margin-bottom: 1.3rem; }
.hint.detect .tick { color: var(--ink); font-weight: 600; }
.hint.detect .guess { font-style: italic; }
