:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #14181f;
  --muted: #5b6472;
  --line: #dfe3ea;
  --accent: #0b57d0;
  --accent-ink: #ffffff;
  --ok: #137a3f;
  --warn: #b26a00;
  --bad: #b3261e;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(20 24 31 / 6%), 0 8px 24px rgb(20 24 31 / 6%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b;
    --card: #171c24;
    --ink: #e8edf4;
    --muted: #9aa4b2;
    --line: #2b3340;
    --accent: #7aa7ff;
    --accent-ink: #0b1220;
    --ok: #6bd39a;
    --warn: #f0b45a;
    --bad: #ff8a80;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 35%);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", "Noto Sans SC", "PingFang SC",
        "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.sr {
  position: absolute;
  clip-path: inset(50%);
  width: 1px; height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.head { margin-bottom: 2rem; }
.eyebrow {
  margin: 0 0 .5rem;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
h1 { margin: 0 0 .75rem; font-size: clamp(1.6rem, 4vw, 2rem); line-height: 1.2; }
.lede { margin: 0; color: var(--muted); max-width: 40rem; }
.lede strong { color: var(--ink); font-weight: 600; }

/* progress */
.steps ol {
  display: flex;
  gap: .5rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.steps li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .875rem;
  color: var(--muted);
  background: var(--card);
}
.steps li .n {
  display: grid;
  place-items: center;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 600;
}
.steps li[aria-current="step"] {
  border-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}
.steps li[aria-current="step"] .n { background: var(--accent); color: var(--accent-ink); }
.steps li.done .n { background: var(--ok); color: #fff; }

/* form */
form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

fieldset.step { border: 0; margin: 0; padding: 0; min-inline-size: 0; }

legend:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

legend {
  font-size: 1.15rem;
  font-weight: 650;
  padding: 0;
  margin: 0 0 1.25rem;
}

.hint-block {
  margin: -.75rem 0 1.5rem;
  color: var(--muted);
  font-size: .9rem;
}

.field { margin: 0 0 1.25rem; display: flex; flex-direction: column; gap: .35rem; }

label { font-weight: 550; font-size: .95rem; }
.req { color: var(--bad); }

input, select, textarea {
  font: inherit;
  font-size: max(1rem, 1em);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .8rem;
  min-height: 48px;
  width: 100%;
}
textarea { min-height: 5.5rem; resize: vertical; }

input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

input:user-invalid, select:user-invalid, textarea:user-invalid {
  border-color: var(--bad);
  background: color-mix(in oklab, var(--bad) 6%, var(--bg));
}

.hint { color: var(--muted); font-size: .85rem; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
}
@media (min-width: 34rem) {
  .grid2 { grid-template-columns: 1fr 1fr; }
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

details.advanced { margin: 0 0 1.25rem; }
details.advanced summary {
  cursor: pointer;
  color: var(--accent);
  font-size: .9rem;
  padding: .4rem 0;
}

.actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

button {
  font: inherit;
  font-weight: 600;
  border-radius: 9px;
  padding: .75rem 1.15rem;
  min-height: 48px;
  cursor: pointer;
  border: 1px solid transparent;
}
button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:hover { filter: brightness(1.06); }
button.primary:disabled { opacity: .6; cursor: progress; }
button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

/* preview */
.preview {
  margin: 1.5rem 0 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--accent) 4%, var(--card));
}
.preview h2 { margin: 0 0 .85rem; font-size: 1rem; }
.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem .9rem;
  margin: 0;
}
@media (max-width: 26rem) { .kv { grid-template-columns: 1fr; } }
.kv div { display: flex; flex-direction: column; }
.kv dt { color: var(--muted); font-size: .82rem; }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

/* status + result */
.status { margin: 1.25rem 0 0; min-height: 1.5rem; color: var(--muted); }
.status.error { color: var(--bad); font-weight: 600; }

.result {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.result h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.downloads { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .75rem; }
.downloads a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.downloads a:hover { background: color-mix(in oklab, var(--accent) 8%, var(--card)); }
.downloads a .meta { font-weight: 400; color: var(--muted); font-size: .85rem; }

.annual { margin-top: 1rem; }
.annual summary { cursor: pointer; color: var(--accent); font-size: .9rem; padding: .4rem 0; }

table { border-collapse: collapse; width: 100%; margin-top: .75rem; font-size: .875rem; }
th, td { text-align: right; padding: .45rem .5rem; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; }
td { font-variant-numeric: tabular-nums; }

.foot { margin-top: 2.5rem; color: var(--muted); font-size: .8rem; text-align: center; }
.foot p { margin: 0; }
