:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5d6b7c;
  --line: #dde2e8;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --accent-soft: #e8f0fd;
  --good: #137a3f;
  --error: #b42318;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1b2129;
    --text: #e6eaf0;
    --muted: #9aa7b6;
    --line: #2d3540;
    --accent: #4c8dff;
    --accent-text: #0b1220;
    --accent-soft: #1d2b44;
    --good: #4ccb7f;
    --error: #ff7a6b;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

a { color: var(--accent); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { padding-top: 14px; padding-bottom: 14px; }
.logo { font-weight: 700; color: var(--text); text-decoration: none; }

.hero { padding: 32px 0 8px; }
.hero h1 { font-size: 28px; line-height: 1.25; margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 18px; margin: 0; }

h2 { font-size: 20px; margin: 24px 0 12px; }
h3 { font-size: 18px; margin: 20px 0 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 20px 20px;
  margin: 24px 0;
}

.field { margin: 14px 0; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field.check label { font-weight: 400; margin-bottom: 8px; }
.field small { display: block; color: var(--muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input:not([type="checkbox"]):not([type="radio"]), select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.btn {
  display: inline-block;
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: wait; }

.sum { font-size: 32px; font-weight: 700; color: var(--good); }
.note { color: var(--muted); font-size: 14px; }
.error { color: var(--error); }

.card ol { padding-left: 20px; }
.card li { margin-bottom: 8px; }

.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 16px 0 32px; color: var(--muted); font-size: 14px; }

@media (max-width: 520px) {
  .hero h1 { font-size: 23px; }
  .row { grid-template-columns: 1fr; }
}

/* --- Проверка оформления --- */
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.other { font-size: 14px; }
.muted { color: var(--muted); font-weight: 400; }
.good { color: var(--good); }
.sum.bad { color: var(--error); }
.tiers li { margin-bottom: 8px; }
.groups { list-style: none; padding: 0; margin: 0; }
.group { border-top: 1px solid var(--line); padding: 10px 0; }
.group-head { display: flex; justify-content: space-between; gap: 12px; }
.count { min-width: 2.5em; text-align: right; }
.group details { margin-top: 6px; }
.group summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.places { font-size: 14px; padding-left: 22px; margin: 8px 0 0; }
.places li { margin-bottom: 6px; word-break: break-word; }
.section { color: var(--muted); }
.detail { color: var(--error); }
.summary { width: 100%; border-collapse: collapse; font-size: 14px; }
.summary th, .summary td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-word; }.possible { margin-top: 20px; padding: 4px 14px 10px; border-left: 4px solid #d29922; background: var(--accent-soft); border-radius: 8px; }
.possible h3 { margin-top: 10px; }
.note.warn { border-left: 4px solid #d29922; padding-left: 10px; }
.offer { margin-top: 20px; padding: 12px 16px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.offer p:first-child { margin-top: 0; }
.offer-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.btn-light { color: var(--accent); background: var(--surface); border: 1px solid var(--accent); }
