:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #677085; --border: #dde1e8;
  --accent: #2856d6; --accent-text: #fff; --ok: #1d7a46; --ok-bg: #e5f5ec;
  --warn: #8a5a00; --warn-bg: #fff4dc; --error: #b42318; --error-bg: #fdecea;
  --info: #1f4fa8; --info-bg: #e8effc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --card: #1b2029; --text: #e6e9ef; --muted: #98a1b3; --border: #2c3340;
    --accent: #6d8ff0; --accent-text: #0b0e14; --ok: #6fd39b; --ok-bg: #173226;
    --warn: #f1c46a; --warn-bg: #352a12; --error: #ff8a80; --error-bg: #3a1a18;
    --info: #9ab6ff; --info-bg: #1b2643;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--card); flex-wrap: wrap; }
.brand { font-weight: 600; }
main { max-width: 1040px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
h1 { font-size: 1.3rem; margin: 0 0 8px; }
h2 { font-size: 1.1rem; margin: 0 0 4px; }
label { display: block; font-weight: 500; margin-bottom: 10px; }
input[type=text], input[type=password] { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
button, .button { display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); font: inherit; cursor: pointer; text-decoration: none; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.danger { background: var(--error); border-color: var(--error); color: #fff; }
button.link, a.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.danger-text { color: var(--error) !important; }
.inline { display: inline; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.rows .row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.rows .row .remove { margin-top: 32px; }
.row.has-error input { border-color: var(--error); }
.field-error, .error-text { color: var(--error); font-weight: 400; font-size: .85rem; }
.notice { padding: 10px 12px; border-radius: 8px; margin: 0 0 12px; }
.notice.success { background: var(--ok-bg); color: var(--ok); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.error { background: var(--error-bg); color: var(--error); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
td.domain { font-weight: 600; word-break: break-all; }
.row-actions { white-space: nowrap; }
.row-actions form, .row-actions a { margin-right: 10px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .85rem; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.error { background: var(--error-bg); color: var(--error); }
.badge.muted { background: var(--bg); color: var(--muted); }
@media (max-width: 640px) {
  .rows .row { grid-template-columns: 1fr; }
  .rows .row .remove { margin-top: 0; justify-self: start; }
}
textarea.code { width: 100%; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); word-break: break-all; }
code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; }
