:root {
  --ink: #17202e; --muted: #5d6676; --line: #e2e5ea; --soft: #f5f6f8; --panel: #fff;
  --brand: #1f5eff; --brand-ink: #fff; --ok: #137a3f; --ok-bg: #e5f5eb; --warn: #8a5a00; --warn-bg: #fff3d6;
  --bad: #b42318; --bad-bg: #fdecea; --info-bg: #eaf0ff; --radius: 10px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--soft); font-size: 15px; line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.boot { padding: 40px; color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: 13px; }

.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: #101826; color: #cfd6e3; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.side .logo { color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 16px; }
.side .logo span { color: #8fb0ff; font-weight: 500; }
.side a { color: #cfd6e3; padding: 8px 10px; border-radius: 8px; display: block; }
.side a:hover { background: #1b2638; text-decoration: none; }
.side a.on { background: #243350; color: #fff; }
.side .grow { flex: 1; }
.side .who { font-size: 12px; padding: 10px; color: #93a0b6; border-top: 1px solid #243045; word-break: break-all; }
.main { padding: 28px 32px 60px; max-width: 1120px; width: 100%; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: block; color: inherit; }
.tile:hover { border-color: #b9c6e4; text-decoration: none; box-shadow: 0 2px 8px rgba(20, 40, 80, .06); }
.tile .name { font-weight: 600; font-size: 16px; margin-bottom: 2px; word-break: break-all; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge.ok, .badge.active { background: var(--ok-bg); color: var(--ok); }
.badge.awaiting_dns, .badge.missing, .badge.activating, .badge.unknown { background: var(--warn-bg); color: var(--warn); }
.badge.wrong, .badge.needs_attention, .badge.failed { background: var(--bad-bg); color: var(--bad); }
.badge.running { background: var(--info-bg); color: var(--brand); }

button, .button { font: inherit; font-weight: 600; font-size: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button:hover { border-color: #b9c3d3; }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.primary:hover { background: #1a50db; }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; color: var(--brand); padding: 2px 4px; font-weight: 600; }
.tiny, button.tiny { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

label { display: block; font-weight: 600; font-size: 13px; margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select {
  min-height: 38px;
  font: inherit; padding: 8px 10px; border: 1px solid #cdd3dd; border-radius: 8px; width: 100%; background: #fff; color: var(--ink); }
input:focus, select:focus, button:focus-visible { outline: 2px solid #9db7ff; outline-offset: 1px; }
select { width: auto; }
.row input[type=number] { width: 90px; }
input[type=checkbox] { width: 16px; height: 16px; vertical-align: -3px; }
.check { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; font-size: 14px; }
.field-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; margin-bottom: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.value { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.copy { margin-left: 6px; }
.req { font-size: 11px; font-weight: 700; color: var(--bad); text-transform: uppercase; }
.opt { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.hint { font-size: 12px; color: var(--warn); margin-top: 3px; }
.found { font-size: 12px; color: var(--muted); margin-top: 3px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs .tab { border-bottom: 2px solid transparent; padding: 10px 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs .tab:hover { color: var(--ink); text-decoration: none; }
.tabs .tab.on { color: var(--ink); border-bottom-color: var(--brand); }

.note { background: var(--info-bg); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.note.warn { background: var(--warn-bg); }
.note.bad { background: var(--bad-bg); }
.note.ok { background: var(--ok-bg); }
pre.log { background: #0f1724; color: #d5dceb; border-radius: 8px; padding: 12px; font-size: 12.5px; max-height: 320px; overflow: auto; white-space: pre-wrap; margin: 8px 0 0; }

.login { max-width: 400px; margin: 9vh auto; }
.login .card { padding: 28px; }
.login h1 { margin-bottom: 14px; }
.secret { font-family: var(--mono); font-size: 18px; letter-spacing: .06em; background: var(--soft); border-radius: 8px; padding: 10px; text-align: center; margin: 8px 0; word-break: break-all; }

.modal-back { position: fixed; inset: 0; background: rgba(10, 16, 28, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal { background: #fff; border-radius: 12px; max-width: 560px; width: 100%; padding: 22px; max-height: 90vh; overflow: auto; }
.modal h2 { margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; margin: 10px 0; }
.kv div:nth-child(odd) { color: var(--muted); }
.kv .mono { word-break: break-all; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #101826; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; z-index: 20; }
#toast.show { opacity: 1; }
#toast.bad { background: var(--bad); }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .side .logo { padding: 6px 10px; width: 100%; }
  .side .grow, .side .who { display: none; }
  .main { padding: 18px 14px 50px; }
  .field-row { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  table { font-size: 13px; }
}

/* -- guided flows ------------------------------------------------------------- */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.gap { margin-top: 16px; } .gap-sm { margin-top: 6px; }
.pad { padding: 16px 20px; margin: 0; }
.right { text-align: right; } .row.end { justify-content: flex-end; }
.grow-1 { flex: 1; min-width: 160px; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.field { margin-bottom: 12px; }
.dialog-form label:not(.check) { margin-top: 0; }
.modal-actions { margin-top: 18px; }
.with-suffix { display: flex; align-items: stretch; }
.with-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; min-width: 0; }
.with-suffix .suffix { display: flex; align-items: center; padding: 0 10px; border: 1px solid #cdd3dd; border-left: 0; border-radius: 0 8px 8px 0; background: var(--soft); color: var(--muted); font-size: 14px; white-space: nowrap; }
.with-suffix.narrow { max-width: 160px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
input.search { max-width: 320px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 20px; }
.card.flush table th:last-child, .card.flush table td:last-child { padding-right: 20px; }
.card.empty { text-align: center; padding: 36px; }
.card-head { margin-bottom: 8px; } .card-head h2 { margin: 0; }
.narrow-card { max-width: 520px; }
button.big { padding: 12px 20px; font-size: 15px; }
button.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.tile-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.tile-foot .next.ok { color: var(--ok); }
.tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #f8f9fc; }
tr.removed td { opacity: .6; }
.meter { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-bottom: 4px; max-width: 160px; }
.meter span { display: block; height: 100%; background: var(--brand); }
.meter.big { height: 10px; max-width: none; }
.stepper { display: flex; list-style: none; padding: 0; margin: 0 0 18px; gap: 6px; flex-wrap: wrap; counter-reset: s; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 600; }
.stepper .dot { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); font-size: 12px; }
.stepper li.on { border-color: var(--brand); color: var(--ink); } .stepper li.on .dot { background: var(--brand); color: #fff; }
.stepper li.done { color: var(--ok); } .stepper li.done .dot { background: var(--ok-bg); color: var(--ok); }
.mailbox-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; margin-bottom: 8px; }
.stat .big-number { font-size: 30px; font-weight: 700; margin: 4px 0 10px; }
.stat .stat-line { margin: 8px 0 4px; }
.stat .row { margin-top: 10px; }
.tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
button.task { flex-direction: column; align-items: flex-start; text-align: left; gap: 4px; padding: 14px; font-weight: 500; }
button.task strong { font-size: 15px; }
.mailbox-head { margin-bottom: 12px; } .mailbox-title { font-size: 20px; margin: 6px 0 2px; word-break: break-all; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: 3px 4px 3px 10px; font-size: 13px; }
.chip button.link { font-size: 15px; padding: 0 6px; color: var(--muted); }
ul.people { margin: 0 0 12px; padding-left: 18px; } ul.people li { margin: 4px 0; }
ol.steps { margin: 0; padding-left: 20px; } ol.steps li { margin: 6px 0; }
.danger-zone { border-color: #f3c3bd; } .danger-zone h2 { color: var(--bad); }
pre.welcome { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; margin: 6px 0 8px; }
.handover { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.alias-form { display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr) auto; gap: 10px; align-items: center; }
.alias-form .arrow { color: var(--muted); font-size: 13px; }
.picks { display: grid; gap: 8px; }
.faq h3 { margin-top: 14px; } .faq:first-child h3 { margin-top: 0; }
.signout { color: #8fb0ff; padding: 4px 0; }
table.dns td:first-child { width: 70px; }
@media (max-width: 900px) { .columns { grid-template-columns: 1fr; } .alias-form { grid-template-columns: 1fr; } .mailbox-row { grid-template-columns: 1fr auto auto; } .mailbox-row button { grid-column: 1 / -1; justify-self: start; } }

/* -- info tags ------------------------------------------------------------------ */
.info-wrap { position: relative; display: inline-block; vertical-align: middle; }
button.info { width: 18px; height: 18px; padding: 0; border-radius: 50%; font: italic 700 11px/1 Georgia, serif; justify-content: center;
  color: var(--brand); border-color: #b9c8f5; background: #f3f6ff; }
button.info[aria-expanded="true"] { background: var(--brand); color: #fff; }
.info-pop { position: absolute; z-index: 30; top: 24px; left: -8px; width: 280px; max-width: 80vw; background: #101826; color: #f2f5fb;
  font: 400 13px/1.45 "Segoe UI", system-ui, sans-serif; text-transform: none; letter-spacing: 0; text-align: left;
  padding: 10px 12px; border-radius: 8px; box-shadow: 0 6px 20px rgba(10, 16, 28, .25); white-space: normal; }
.check-info { display: inline-flex; align-items: center; gap: 4px; }
.setup-block { margin-top: 14px; }
@media (max-width: 600px) {
  .info-pop { left: auto; right: -8px; }
  table.dns thead { display: none; }
  table.dns tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.dns td { display: block; border: 0; padding: 3px 0; width: auto !important; }
  table.dns td.value { word-break: normal; overflow-wrap: anywhere; }
}
