:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1d2125;
  --muted: #5d6670;
  --line: #dfe2e0;
  --accent: #1f5f8b;
  --accent-text: #ffffff;
  --ok: #1e7a46;
  --warn: #9a5b00;
  --error: #b42318;
  --radius: 10px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181b;
    --surface: #1e2226;
    --text: #e8eaec;
    --muted: #a3abb3;
    --line: #343a40;
    --accent: #6cb4e4;
    --accent-text: #0d1a24;
    --ok: #5fcf8e;
    --warn: #e7b04b;
    --error: #ff8a80;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
header.site .brand { font-weight: 700; text-decoration: none; color: var(--text); }
header.site nav { display: flex; gap: 16px; font-size: 0.95rem; }

footer.site { margin-top: 64px; padding: 24px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
footer.site nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }

h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; margin: 40px 0 12px; }
h2 { font-size: 1.35rem; margin: 36px 0 12px; }
h3 { font-size: 1.05rem; margin: 20px 0 8px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.button, button {
  display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  padding: 10px 18px; border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.button.secondary, button.secondary { background: transparent; color: var(--accent); }
button.link { background: none; border: none; color: var(--accent); padding: 0; font-weight: 500; text-decoration: underline; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.price { font-size: 1.6rem; font-weight: 700; }

label { display: block; font-weight: 600; font-size: 0.95rem; margin: 12px 0 4px; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input[type=text], input[type=number], input[type=date], select {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit;
}
.hint { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0 8px; padding: 0; list-style: none; }
.steps li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.steps li.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.person { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.person:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; align-items: center; }

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.notice { border-left: 4px solid var(--warn); padding: 10px 14px; background: var(--surface); margin: 16px 0; }
.error { border-left: 4px solid var(--error); padding: 10px 14px; background: var(--surface); margin: 16px 0; }
.error ul { margin: 6px 0 0; padding-left: 20px; }
.ok { color: var(--ok); font-weight: 600; }
ol.howto li { margin-bottom: 6px; }
[hidden] { display: none !important; }
