:root {
  color-scheme: light;
  --background: #f7f8fa;
  --surface: #fff;
  --subtle: #f1f2f4;
  --selected: #e9f2ff;
  --text: #172b4d;
  --muted: #44546f;
  --brand: #0c66e4;
  --brand-hover: #0055cc;
  --border: #dcdfe4;
  --field-border: #8590a2;
  --focus: #388bff;
  --success-bg: #dcfff1;
  --success-text: #216e4e;
  --warning-bg: #fff7d6;
  --warning-text: #713f12;
  --error-bg: #ffeceb;
  --error-text: #ae2e24;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font: 100%/1.5 var(--font);
  color: var(--text);
  background: var(--background);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 17.5rem; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--brand-hover); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: .15rem solid var(--focus); outline-offset: 2px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.2; }
h2 { font-size: 1.125rem; font-weight: 650; line-height: 1.3; letter-spacing: -.015em; }
svg { display: inline-block; width: 1.15rem; height: 1.15rem; vertical-align: middle; flex: none; }
.skip { position: fixed; inset: .5rem auto auto .5rem; z-index: 5; padding: .5rem; background: white; transform: translateY(-160%); }
.skip:focus { transform: translateY(0); }

.topbar { min-height: 4.125rem; padding: .55rem clamp(.85rem, 3vw, 1.6rem); display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-top: 3px solid var(--brand); border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: .94rem; letter-spacing: -.012em; line-height: 1.2; }
.brand img { flex: none; }
.top-actions, .account { display: flex; align-items: center; gap: .6rem; }
.account { display: none; color: var(--muted); font-size: .875rem; }
.account b { width: 1.75rem; height: 1.75rem; display: grid; place-items: center; background: var(--selected); color: var(--brand-hover); border-radius: 50%; }
.shell { min-height: calc(100svh - 4.125rem); }
.sidebar { padding: .35rem .7rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.sidebar nav { display: flex; gap: .3rem; }
.nav-heading { display: none; color: var(--muted); font-size: .8125rem; font-weight: 670; padding: .5rem .7rem; }
.sidebar a { display: flex; align-items: center; gap: .55rem; padding: .55rem .75rem; min-height: 2.75rem; border-radius: .3rem; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 600; }
.sidebar a:hover { background: var(--subtle); }
.sidebar a[aria-current] { color: var(--brand-hover); background: var(--selected); }
.main { min-width: 0; width: 100%; max-width: 87rem; margin-inline: auto; padding: clamp(1.1rem, 4vw, 2.7rem); }
.page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-block: 0 1.4rem; }
.page-heading p, .card-heading p, .login-card p, .job-summary p { color: var(--muted); margin-top: .4rem; }
.back-link { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; margin-block: -.6rem .45rem; text-decoration: none; font-size: .9rem; color: var(--muted); }
.back-link:hover, .record-link:hover { text-decoration: underline; }

.surface { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: .65rem; box-shadow: 0 1px 2px #091e4210; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.75rem; border: 1px solid transparent; border-radius: .35rem; font-size: .9rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.button { padding: .48rem .85rem; }
.button.primary { background: var(--brand); color: white; }
.button.primary:hover { background: var(--brand-hover); }
.button.secondary { color: var(--text); background: var(--subtle); }
.button.secondary:hover, .icon-button:hover { background: #dcdfe4; }
.button:disabled { cursor: wait; background: var(--subtle); color: var(--field-border); }
.button:disabled:hover { background: var(--subtle); }
.icon-button { width: 2.75rem; padding: .25rem; flex: none; color: var(--muted); background: var(--subtle); }
.icon-button.plain, .icon-button.password-toggle { background: transparent; }
.icon-button.plain:hover, .icon-button.password-toggle:hover { background: var(--subtle); }
.icon-button.copied { color: var(--success-text); background: var(--success-bg); }
.feature-icon { display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: .8rem; border-radius: .65rem; background: var(--selected); color: var(--brand); }
.feature-icon svg { width: 1.5rem; height: 1.5rem; }

.login-main { display: grid; justify-content: center; padding: clamp(2rem, 9vw, 5.5rem) 1rem; }
.login-card { width: min(100%, 28rem); padding: clamp(1.25rem, 5vw, 2.25rem); }
.login-card h1 { font-size: clamp(1.55rem, 6vw, 2rem); }
.login-form { display: grid; gap: .4rem; margin-top: 1.4rem; }
.login-form label:not(:first-of-type) { margin-top: .45rem; }
.login-form .button { margin-top: .65rem; }
label, .mail-row label > span:first-child { font-size: .875rem; font-weight: 650; color: var(--muted); }
input:not([type="hidden"]):not([type="checkbox"]) { width: 100%; min-width: 0; min-height: 2.75rem; padding: .47rem .65rem; background: var(--surface); border: 1px solid var(--field-border); border-radius: .35rem; color: var(--text); font-size: 1rem; }
input::placeholder { color: #626f86; }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) 2.75rem; min-width: 0; align-items: center; }
.password-field input { grid-area: 1/1/2/3; padding-inline-end: 3rem !important; }
.password-field button { grid-area: 1/2/2/3; margin-inline-end: .15rem; width: 2.6rem; min-height: 2.6rem; z-index: 1; }
.notice { display: flex; align-items: flex-start; gap: .65rem; border-radius: .35rem; padding: .75rem .9rem; font-size: .9rem; }
.notice svg { margin-top: .1rem; }
.notice.error { background: var(--error-bg); color: var(--error-text); }
.notice.warning { background: var(--warning-bg); color: var(--warning-text); }
.login-card .notice { margin-top: 1rem; }

.new-grid { display: grid; gap: 1rem; align-items: start; }
.card-heading, .card-footer { padding: 1rem clamp(.9rem, 3vw, 1.35rem); }
.card-heading + .card-heading { padding-top: 0; }
.card-heading p, .domain-instruction { font-size: .9rem; }
.mail-rows { display: grid; gap: .9rem; padding: .35rem clamp(.9rem, 3vw, 1.35rem) 1rem; }
.mail-row { display: grid; grid-template-columns: minmax(0, 1fr) 2.75rem; gap: .5rem; align-items: end; }
.mail-row + .mail-row { padding-top: .85rem; border-top: 1px solid var(--border); }
.mail-row label { display: grid; min-width: 0; gap: .32rem; }
.mail-password { grid-column: 1 / -1; }
.row-action { color: var(--brand-hover); }
.input-note { padding: 0 1.35rem .9rem; font-size: .875rem; color: var(--muted); }
.form-alert { margin: 0 1.35rem .8rem; }
.card-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; border-top: 1px solid var(--border); }
.next-card { padding: 1.15rem 1.25rem; }
.next-card ul { display: grid; gap: .95rem; list-style: none; margin: .95rem 0 0; padding: 0; }
.next-card li { display: flex; gap: .56rem; align-items: flex-start; color: var(--brand-hover); }
.next-card li svg { margin-top: .16rem; }
.next-card b { display: block; color: var(--text); font-size: .875rem; font-weight: 650; }
.next-card small { display: block; margin-top: .1rem; color: var(--muted); font-size: .875rem; }

.empty { display: grid; justify-items: center; padding: clamp(2rem, 5vw, 4.2rem) 1.5rem; text-align: center; }
.empty p { color: var(--muted); margin-top: .35rem; max-width: 26rem; }
.job-body { display: grid; gap: 1rem; }
.job-summary { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; padding: 1.15rem 1.35rem; }
.summary-head, .summary-actions, .domain-heading { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.domain-heading { justify-content: space-between; }
.domain-heading svg { color: var(--brand-hover); margin-right: .2rem; }
.domain-alert { margin: 0 1.35rem 1rem; }
.domain-alert p { margin: .25rem 0 .6rem; }
.check-line { display: flex; align-items: center; gap: .4rem; min-height: 2.75rem; }
.check-line input { width: 1rem; height: 1rem; flex: none; }
.domain-instruction { color: var(--muted); padding: 0 1.35rem .85rem; }
.badge { display: inline-block; border-radius: .25rem; padding: .15rem .4rem; background: var(--subtle); color: var(--muted); font-size: .78rem; font-weight: 650; line-height: 1.35; white-space: nowrap; }
.badge.created, .badge.ready, .badge.passed, .badge.completed, .badge.verified { background: var(--success-bg); color: var(--success-text); }
.badge.queued, .badge.running, .badge.creating, .badge.preparing { background: var(--selected); color: var(--brand-hover); }
.badge.attention, .badge.blocked, .badge.propagating, .badge.waiting_dns { background: var(--warning-bg); color: var(--warning-text); }
.badge.error, .badge.failed, .badge.mismatch, .badge.missing { background: var(--error-bg); color: var(--error-text); }
.table-shell { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
th { background: var(--background); color: var(--muted); font-weight: 650; white-space: nowrap; }
th, td { padding: .72rem .85rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
td { vertical-align: top; }
.record-link { font-weight: 650; text-decoration: none; }
.table-note { color: var(--muted); font-size: .82rem; margin-top: .3rem; min-width: 5rem; overflow-wrap: anywhere; }
.dns-table th:last-child { min-width: 10rem; }
.copy-field { display: flex; align-items: start; gap: .4rem; min-width: 10rem; }
.copy-field code { overflow-wrap: anywhere; white-space: normal; min-width: 0; }
code { display: inline-block; padding: .2rem .36rem; border-radius: .25rem; background: var(--subtle); color: var(--text); font: .825rem/1.45 ui-monospace, Consolas, monospace; }

@media (min-width: 38rem) {
  .account { display: inline-flex; }
  .mail-row { grid-template-columns: minmax(10rem, 1.2fr) 2.75rem minmax(9rem, .85fr); }
  .mail-password { grid-column: auto; }
  th, td { padding-inline: 1.35rem; }
}
@media (min-width: 55rem) {
  .shell { display: grid; grid-template-columns: 14rem minmax(0, 1fr); }
  .sidebar { padding: 1.25rem .7rem; border: 0; border-right: 1px solid var(--border); }
  .sidebar nav { display: grid; }
  .nav-heading { display: block; }
}
@media (min-width: 69rem) {
  .new-grid { grid-template-columns: minmax(0, 2.25fr) minmax(15rem, 1fr); }
}
