/* zerolegacy – white and blue, accounting-software calm */
:root {
  --blue: #0078c8;        /* actions, links */
  --blue-hover: #0063a6;
  --navy: #0c3557;        /* top bar */
  --sky: #e8f3fb;         /* tints, info */
  --canvas: #f4f6f8;      /* page background */
  --white: #ffffff;
  --ink: #1b2a38;
  --muted: #5e6e7d;
  --line: #dbe2e8;
  --green: #12804a;  --green-bg: #e5f5ec;
  --amber: #925f00;  --amber-bg: #fdf3dc;
  --red: #c4262e;    --red-bg: #fdecec;
  --radius: 8px;
  --font: "Figtree", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--canvas);
       min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.125rem; font-weight: 600; }
code, pre, .value, .domain-title { font-family: var(--mono); }
:focus-visible { outline: 3px solid #7cc0ef; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* top bar */
.topbar { background: var(--navy); color: var(--white); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 32px; }
.brand { color: var(--white); font-weight: 700; font-size: 1.125rem; display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); display: grid; place-items: center;
              font-size: .95rem; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.nav { display: flex; height: 100%; }
.nav a { color: rgba(255,255,255,.8); display: flex; align-items: center; padding: 0 14px; height: 100%;
         font-weight: 500; border-bottom: 3px solid transparent; }
.nav a:hover { color: var(--white); text-decoration: none; }
.nav a.active { color: var(--white); border-bottom-color: #4fb3f0; }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-user { color: rgba(255,255,255,.7); font-size: .875rem; }
.nav-link { background: none; border: 0; color: var(--white); font: inherit; cursor: pointer; padding: 0; }
.nav-link:hover { text-decoration: underline; }

/* layout */
.page { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; }
.page-narrow { max-width: 440px; }
.page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.back { display: inline-block; margin-bottom: 8px; font-size: .875rem; }
.back::before { content: "‹ "; }
.footer { text-align: center; color: var(--muted); font-size: .8125rem; padding: 20px; border-top: 1px solid var(--line); background: var(--white); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.narrow { max-width: 480px; }

/* cards */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.card-pad { padding: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 0; }
.card-head h2 { margin: 0; }
.empty { padding: 40px; text-align: center; }
.empty p { max-width: 52ch; margin: 0 auto; color: var(--muted); }
.empty-inline { padding: 0 24px 20px; color: var(--muted); margin: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px;
       border-radius: 6px; border: 1px solid transparent; font: 600 .9375rem var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-hover); }
.btn-ghost { background: var(--white); color: var(--blue); border-color: #b9d6ec; }
.btn-ghost:hover { background: var(--sky); }
.btn-danger { background: var(--white); color: var(--red); border-color: #efb7ba; }
.btn-danger:hover { background: var(--red-bg); }
.btn-on-dark { background: var(--white); color: var(--navy); }
.btn-lg { height: 46px; padding: 0 22px; font-size: 1rem; }
.btn-small { height: 30px; padding: 0 10px; font-size: .8125rem; }
.btn-block { width: 100%; margin-top: 8px; }
.link-danger { background: none; border: 0; padding: 0; color: var(--red); font: inherit; cursor: pointer; }
.link-danger:hover { text-decoration: underline; }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field > span { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.field small { color: var(--muted); font-size: .8125rem; }
input, select { height: 38px; padding: 0 10px; border: 1px solid #c3ced8; border-radius: 6px; font: inherit;
                color: var(--ink); background: var(--white); width: 100%; min-width: 0; }
input:focus, select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,120,200,.18); }
.suffix-input { display: flex; align-items: stretch; }
.suffix-input input { border-radius: 6px 0 0 6px; }
.suffix { display: flex; align-items: center; padding: 0 10px; background: var(--canvas); border: 1px solid #c3ced8;
          border-left: 0; border-radius: 0 6px 6px 0; color: var(--muted); font-family: var(--mono); font-size: .8125rem;
          max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-card { padding: 32px; margin-top: 24px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 20px; }
.add-domain { margin-left: auto; display: flex; gap: 8px; }
.add-domain input { width: 260px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; flex: 1; min-width: 180px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

.record-form { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.card-pad .record-form { padding: 0; border: 0; }
.record-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.f-type { flex: 0 0 110px; }
.f-name { flex: 1.2 1 200px; }
.f-prio { flex: 0 0 90px; }
.f-value { flex: 2 1 240px; }
.f-ttl { flex: 0 0 100px; }
.record-fields .field { margin-bottom: 0; }
.record-fields .field[hidden] { display: none; }
.hint { color: var(--muted); font-size: .8125rem; margin: 8px 0 12px; }

/* notices */
.notice { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; border-left: 4px solid; background: var(--white); }
.notice-success { border-color: var(--green); background: var(--green-bg); }
.notice-error { border-color: var(--red); background: var(--red-bg); }
.notice-info { border-color: var(--blue); background: var(--sky); }
.error-output { white-space: pre-wrap; font-size: .8125rem; margin: 8px 0 0; }

/* status pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 600; }
.pill-active { background: var(--green-bg); color: var(--green); }
.pill-pending { background: var(--amber-bg); color: var(--amber); }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8125rem; font-weight: 600; color: var(--muted); padding: 12px 24px;
            border-bottom: 1px solid var(--line); background: #fafbfc; }
.table td { padding: 12px 24px; border-bottom: 1px solid #edf1f4; vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #f8fbfe; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-link { font-weight: 600; }
.records { min-width: 680px; }
.records td { font-size: .875rem; }
.records .value { overflow-wrap: anywhere; max-width: 460px; }
.records .prio { color: var(--muted); margin-right: 8px; }
.type { display: inline-block; min-width: 52px; text-align: center; padding: 1px 6px; border-radius: 4px;
        background: var(--sky); color: var(--blue-hover); font-weight: 600; font-size: .75rem; }
.system-row td { color: var(--muted); }
.actions { white-space: nowrap; text-align: right; }
.actions form { display: inline; margin-left: 14px; }

/* domain page */
.domain-title { font-size: 1.5rem; font-weight: 600; letter-spacing: 0; word-break: break-all; }
.activate { padding: 24px; border-top: 4px solid var(--blue); }
.steps { margin: 0 0 16px; padding-left: 1.25em; }
.steps li { margin-bottom: 10px; padding-left: 4px; }
.ns-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ns { display: flex; align-items: center; gap: 12px; background: var(--sky); border: 1px solid #c4e0f4;
      border-radius: 6px; padding: 8px 8px 8px 14px; }
.ns code { font-size: 1rem; font-weight: 600; color: var(--navy); }
.activate-foot { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }
.activate-foot p { margin: 0; flex: 1; min-width: 240px; font-size: .875rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 20px 0 0; font-size: .875rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-family: var(--mono); }
.danger-zone h2 { color: var(--red); }
.zonefile { margin: 0; padding: 20px 24px; overflow-x: auto; font-size: .8125rem; line-height: 1.6; }

/* landing */
.page-landing { max-width: 880px; }
.hero { padding: 56px 0 40px; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; letter-spacing: -.02em; max-width: 18ch; color: var(--navy); }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 60ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.how { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; }
.how .steps { margin: 0; max-width: 68ch; }

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-user { display: none; }
}
@media (max-width: 600px) {
  .topbar-inner { gap: 12px; padding: 0 16px; }
  .nav a { padding: 0 8px; }
  .page { padding: 20px 16px 40px; }
  .add-domain { width: 100%; margin-left: 0; }
  .add-domain input { width: auto; flex: 1; }
  .table th, .table td { padding: 10px 14px; }
  .record-form, .card-head { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 420px) {
  .brand-text { display: none; }
}

/* activation progress */
.activate > p.muted { margin-top: 0; max-width: 70ch; }
.progress { list-style: none; counter-reset: step; margin: 20px 0; padding: 0; }
.progress > li { counter-increment: step; position: relative; padding: 0 0 20px 44px; }
.progress > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px;
  border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .875rem;
  background: var(--white); border: 2px solid var(--line); color: var(--muted); }
.progress > li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px; width: 2px; background: var(--line); }
.progress > li.is-current::before { border-color: var(--blue); color: var(--blue); }
.progress > li.is-done::before { content: "✓"; background: var(--green); border-color: var(--green); color: var(--white); }
.progress h3 { font-size: 1rem; font-weight: 600; margin: 3px 0 6px; display: flex; gap: 10px; align-items: center; }
.progress > li.is-todo h3 { color: var(--muted); }
.progress p { margin: 0 0 8px; }
.copy-fields { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; align-items: center; margin: 10px 0; }
.copy-fields dt { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.copy-fields dd { margin: 0; display: flex; align-items: center; gap: 10px; background: var(--sky);
  border: 1px solid #c4e0f4; border-radius: 6px; padding: 6px 6px 6px 12px; min-width: 0; }
.copy-fields code { flex: 1; overflow-wrap: anywhere; color: var(--navy); font-weight: 600; }
.hint code { font-size: .8125rem; }
