:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --border: #e2e5ea;
    --text: #1c2027;
    --muted: #666e7b;
    --accent: #1f5fd0;
    --accent-text: #ffffff;
    --ok: #17784a;
    --ok-bg: #e7f5ed;
    --warn: #8a5a00;
    --warn-bg: #fdf3e0;
    --err: #b3261e;
    --err-bg: #fdecea;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171c;
        --surface: #1c2027;
        --surface-2: #22272f;
        --border: #2f3641;
        --text: #e6e9ee;
        --muted: #9aa3b0;
        --accent: #6ea1ff;
        --accent-text: #0f1319;
        --ok: #6ddc9f;
        --ok-bg: #16281f;
        --warn: #f0c07a;
        --warn-bg: #2b2318;
        --err: #ff938c;
        --err-bg: #2e1b1a;
        --shadow: none;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.25rem;
}

.topbar-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 58px;
    flex-wrap: wrap;
}

.brand {
    font-weight: 650;
    letter-spacing: -.01em;
    text-decoration: none;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.brand-mark {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--accent);
    color: var(--accent-text);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
}

.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.topbar nav a { text-decoration: none; font-size: .92rem; }
.topbar .who { color: var(--muted); font-size: .85rem; }

.wrap { max-width: 900px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.wrap-narrow { max-width: 420px; }

h1 { font-size: 1.5rem; margin: 0 0 .35rem; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; letter-spacing: -.01em; }
h3 { font-size: .9rem; margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.lead { color: var(--muted); margin: 0 0 1.5rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.card-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.card-head h2 { margin: 0; }
.card-head .spacer { margin-left: auto; }

.pill {
    display: inline-block;
    padding: .12rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err-bg); color: var(--err); }
.pill.neutral { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

.grid { display: grid; gap: 1.25rem; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

label { display: block; font-weight: 550; margin-bottom: .3rem; font-size: .9rem; }
.field { margin-bottom: 1rem; }
.hint { color: var(--muted); font-size: .84rem; margin: .3rem 0 0; }

input[type=text], input[type=email], input[type=password], input[type=file], textarea, select {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

textarea { min-height: 70px; resize: vertical; }

.btn {
    display: inline-block;
    padding: .5rem .95rem;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--accent-text);
    font: inherit;
    font-weight: 550;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover { filter: brightness(1.07); }
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.danger { background: transparent; color: var(--err); border-color: var(--border); }
.btn.small { padding: .3rem .65rem; font-size: .85rem; }
.btn-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash.success { background: var(--ok-bg); color: var(--ok); border-color: currentColor; }
.flash.error { background: var(--err-bg); color: var(--err); border-color: currentColor; }
.flash.info { background: var(--surface); color: var(--muted); border-color: var(--border); }

.issues { list-style: none; margin: .75rem 0 0; padding: 0; }
.issues li {
    display: flex;
    gap: .6rem;
    align-items: baseline;
    padding: .45rem 0;
    border-top: 1px solid var(--border);
    font-size: .92rem;
}
.issues li:first-child { border-top: 0; }
.issues .tag { flex: none; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; min-width: 5.5em; }
.issues .is-error .tag, .issues li.is-error .tag { color: var(--err); }
.issues li.is-warning .tag { color: var(--warn); }
.issues li.is-notice .tag { color: var(--muted); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: .5rem 0 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }

.mono, code, pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .86rem;
}

pre.record {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .7rem .8rem;
    overflow-x: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.logo-preview {
    width: 96px;
    height: 96px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #fff;
    padding: .5rem;
    object-fit: contain;
    flex: none;
}

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.domain-list { list-style: none; margin: 0; padding: 0; }
.domain-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 0;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.domain-list li:first-child { border-top: 0; }
.domain-list .name { font-weight: 600; }
.domain-list .meta { color: var(--muted); font-size: .84rem; }
.domain-list .spacer { margin-left: auto; }

.empty { color: var(--muted); font-style: italic; margin: 0; }
footer.site { text-align: center; color: var(--muted); font-size: .82rem; padding: 0 1rem 2rem; }
.meta { color: var(--muted); font-size: .84rem; }
