:root {
  --bg: #fdf7f5;
  --surface: #ffffff;
  --surface-2: #f8eeeb;
  --text: #2b1d21;
  --muted: #7a6a6e;
  --border: #ead9d5;
  --accent: #d6456b;
  --accent-text: #ffffff;
  --accent-soft: #fbe3ea;
  --ok: #2f8f5b;
  --warn: #c7771a;
  --danger: #c53b3b;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(60 20 30 / 6%), 0 6px 20px rgb(60 20 30 / 6%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1416;
    --surface: #251b1e;
    --surface-2: #2f2326;
    --text: #f3e9eb;
    --muted: #b09ea3;
    --border: #3d2e32;
    --accent: #ef6b8e;
    --accent-text: #1b1416;
    --accent-soft: #3b2229;
    --ok: #5cc28a;
    --warn: #e7a24c;
    --danger: #ef7a7a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

.container { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }

h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: 1.25rem; margin: 28px 0 12px; }
.card h2 { margin-top: 0; }
a { color: var(--accent); }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.error { color: var(--danger); }
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin: 0 0 8px; }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 20px; }
.hint { background: var(--accent-soft); padding: 10px 14px; border-radius: 10px; }
.label { font-weight: 600; margin: 16px 0 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* кнопки */
button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid transparent; padding: 10px 16px; }
.primary { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.primary:hover { filter: brightness(1.05); }
.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.secondary:hover { background: var(--surface-2); }
.link { background: none; border: none; padding: 0 4px; color: var(--accent); text-decoration: underline; }
.big { padding: 14px 24px; font-size: 1.1rem; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* лендинг */
.hero { padding-top: 6vh; }
.features { list-style: none; padding: 0; margin: 32px 0 20px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.features li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; }
.features span { color: var(--muted); font-size: .92rem; }

/* мастер */
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 16px; overflow-x: auto; }
.steps li { flex: 1; min-width: 0; font-size: .78rem; color: var(--muted); border-top: 3px solid var(--border); padding-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps li.done { border-color: var(--accent); }
.steps li.current { border-color: var(--accent); color: var(--text); font-weight: 600; }

.field { display: grid; gap: 4px; margin: 12px 0; }
.field > span { font-weight: 500; font-size: .95rem; }
input, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0;
}
.check { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.pets { border: 1px solid var(--border); border-radius: 10px; padding: 4px 14px; margin: 12px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.pets legend { font-weight: 500; padding: 0 6px; }

.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 8px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice {
  display: flex; gap: 12px; align-items: center; text-align: left;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px; color: var(--text);
}
.choice input { position: absolute; opacity: 0; }
.choice small { display: block; color: var(--muted); }
.choice .icon { font-size: 1.6rem; }
.choice.selected { border-color: var(--accent); background: var(--accent-soft); }
label.choice { cursor: pointer; position: relative; }

.row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.row input, .row .field { flex: 1; min-width: 180px; }
.loc { display: grid; gap: 8px; }
.picked { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; }
.results, .cities { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 6px; }
.results button, .cities button {
  width: 100%; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.results button:hover, .cities button:hover { border-color: var(--accent); }
.cities button { display: grid; gap: 2px; }
.cities span { color: var(--muted); font-size: .9rem; }

.nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* план */
.plan-head { margin-bottom: 16px; }
.banner {
  display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap;
  background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; font-size: .92rem;
}
.banner .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.banner button { padding: 8px 12px; }

.budget { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.budget div { display: grid; }
.budget b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.budget progress { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); height: 8px; }
.fact { color: var(--ok); }
.est { color: var(--muted); }

.tasks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.task {
  display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.task.done { opacity: .78; }
.task.done .title > span:first-child { text-decoration: line-through; text-decoration-color: var(--muted); }
.tick input { width: 22px; height: 22px; accent-color: var(--ok); margin-top: 2px; cursor: pointer; }
.task .body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.title { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; flex-wrap: wrap; }
.price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.price.est { font-weight: 500; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge { font-size: .8rem; background: var(--surface-2); border-radius: 999px; padding: 2px 10px; }
.badge.soon { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.late { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.links { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .92rem; }
.fact-details { margin: 0; font-size: .92rem; background: color-mix(in srgb, var(--ok) 10%, transparent); padding: 6px 10px; border-radius: 8px; }
.task .link { justify-self: start; font-size: .9rem; }

.timeline { list-style: none; margin: 0; padding: 8px 20px; }
.timeline li { display: grid; grid-template-columns: 9.5rem 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.timeline li:last-child { border-bottom: none; }
.timeline time { font-variant-numeric: tabular-nums; color: var(--muted); }
.timeline .exact time { color: var(--ok); font-weight: 600; }

/* диалог факта */
dialog {
  border: none; border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 10px 40px rgb(0 0 0 / 30%);
}
dialog::backdrop { background: rgb(20 10 14 / 50%); }
.fact-form { padding: 20px; max-height: 85vh; overflow: auto; }
.fact-form h2 { margin-top: 0; font-size: 1.15rem; }

@media (max-width: 520px) {
  .choices.two { grid-template-columns: 1fr 1fr; }
  .pets { grid-template-columns: 1fr 1fr 1fr; }
  .timeline li { grid-template-columns: 1fr auto; }
  .timeline time { grid-column: 1 / -1; }
}

@media print {
  .no-print, button, .tick { display: none !important; }
  body { background: #fff; color: #000; }
  .task, .card { box-shadow: none; break-inside: avoid; }
  .links a::after { content: " (" attr(href) ")"; font-size: .7rem; word-break: break-all; }
}
