:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1b2330; --muted: #5b6678; --line: #d8dde6;
  --accent: #1f6feb; --accent-ink: #fff; --ok: #1a7f37; --bad: #c62828; --changed: #fff8e1;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
.top { background: #16202e; color: #fff; padding: 20px max(20px, calc((100% - 960px) / 2)); }
.top h1 { margin: 0 0 4px; font-size: 22px; }
.top p { margin: 0; color: #c8d1e0; max-width: 70ch; }
.top code { background: #2b3a52; color: #fff; }
main { max-width: 960px; margin: 0 auto; padding: 8px 20px 60px; }
section { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin: 18px 0; }
h2 { font-size: 17px; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
h3 { font-size: 15px; margin: 18px 0 2px; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hint { color: var(--muted); margin: 0 0 10px; max-width: 80ch; }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-size: 13px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.card { position: relative; border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: #fff; text-align: left; font: inherit; color: inherit; }
.card:hover:not([aria-disabled="true"]) { border-color: #9db8e8; }
.card[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px #1f6feb26; }
.card[aria-disabled="true"] { opacity: .55; cursor: not-allowed; background: #f2f3f6; }
.card b { display: block; font-size: 16px; }
.card > span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.badge { display: inline-block; font-size: 11px; background: #e5e8ee; color: var(--muted); border-radius: 10px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }

.fields { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: minmax(200px, 1.1fr) minmax(180px, 1fr) minmax(120px, .8fr); gap: 6px 12px; align-items: start; padding: 4px 6px; border-radius: 6px; }
.row.changed { background: var(--changed); }
.row label { font-weight: 500; padding-top: 6px; }
.row .help { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; margin-top: -4px; }
.row .info { color: var(--muted); font-size: 12.5px; padding-top: 7px; }
.row .err { grid-column: 2 / -1; color: var(--bad); font-size: 13px; }
.row .err:empty { display: none; }
input[type="text"] { width: 100%; padding: 6px 9px; border: 1px solid #b9c1cf; border-radius: 6px; font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; background: #fff; }
input[type="text"]:focus-visible, button:focus-visible, .file-btn:focus-within, .card:focus-visible, pre:focus-visible { outline: 3px solid #1f6feb66; outline-offset: 1px; }
select { width: 100%; padding: 6px 9px; border: 1px solid #b9c1cf; border-radius: 6px; font: inherit; background: #fff; }
select:focus-visible { outline: 3px solid #1f6feb66; outline-offset: 1px; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); background: #fff5f5; }

.group { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 4px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.group-head small { color: var(--muted); font-weight: 400; margin-left: 8px; }
.subs { margin-top: 4px; }

button { font: inherit; }
button.link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 2px 4px; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 6px; }
.actions button, .file-btn { border: 1px solid #b9c1cf; background: #fff; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.actions button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.actions button:disabled { opacity: .5; cursor: not-allowed; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn { position: relative; }

.status { font-weight: 600; margin: 0; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.message { min-height: 1.4em; color: var(--muted); margin: 4px 0; }
.steps { color: var(--ink); padding-left: 20px; }
details summary { cursor: pointer; margin: 8px 0; }
pre { background: #0f1722; color: #d6e2f5; padding: 12px 14px; border-radius: 8px; overflow: auto; max-height: 360px; font-size: 12.5px; }

@media (max-width: 720px) {
  .row { grid-template-columns: 1fr; }
  .row .err { grid-column: 1; }
  .row label, .row .info { padding-top: 0; }
}

.plan { background: #f3f7ff; border: 1px solid #cfdcf5; border-radius: 8px; padding: 6px 14px 10px; margin: 6px 0 4px; }
.plan h3 { margin-top: 8px; }
.row .tag { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600; line-height: 1.6; padding: 0 7px; border-radius: 9px; background: #e6ebf5; color: #46546b; vertical-align: middle; }
.row .tag.custom { background: #ffe9b8; color: #7a4b00; }
.note { color: #7a4b00; }
.note:empty { display: none; }

.names { grid-column: 1 / -1; margin: 2px 0 4px; font-size: 13px; }
.names summary { cursor: pointer; color: var(--accent); }
.names summary:focus-visible { outline: 3px solid #1f6feb66; outline-offset: 1px; border-radius: 4px; }
.names-body { margin-top: 6px; padding: 8px 12px; background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; max-height: 320px; overflow: auto; }
.n-group { margin-bottom: 8px; }
.n-group b { font-size: 12px; color: var(--muted); font-weight: 600; }
.n-list { list-style: none; margin: 2px 0 0; padding: 0; }
.n-list li { display: flex; gap: 10px; align-items: baseline; padding: 1px 0; }
.n-type { flex: 0 0 150px; color: var(--muted); font-size: 12px; }
.n-list code { background: #e9edf5; word-break: break-all; }
