:root {
  --bg: #f7f2ec;
  --card: #ffffff;
  --ink: #2b2321;
  --ink-2: #5a4f4a;
  --muted: #8b7f78;
  --line: #ece3da;
  --accent: #c2554b;
  --accent-ink: #ffffff;
  --accent-soft: #f6e3de;
  --sage: #5f8470;
  --sage-soft: #e4eee7;
  --amber: #b97d22;
  --amber-soft: #f6ead3;
  --danger: #b4443a;
  --danger-soft: #f7dfdb;
  --shadow: 0 1px 2px rgba(43, 35, 33, .04), 0 10px 28px rgba(43, 35, 33, .06);
  --radius: 22px;
  --serif: 'Lora', Georgia, serif;
  --sans: 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root.dark {
  --bg: #1c1816;
  --card: #26211e;
  --ink: #f2ebe5;
  --ink-2: #cfc4bc;
  --muted: #a3968d;
  --line: #3a322d;
  --accent: #e0786c;
  --accent-ink: #1c1816;
  --accent-soft: #3d2925;
  --sage: #8fb49f;
  --sage-soft: #26332c;
  --amber: #dcaa5c;
  --amber-soft: #3a2f1e;
  --danger: #e57b70;
  --danger-soft: #3f2422;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 10px 28px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }

.screen { max-width: 560px; margin: 0 auto; padding: 18px 18px calc(110px + var(--safe-b)); animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 24px; line-height: 1.2; }
h3 { font-size: 19px; line-height: 1.25; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lead { color: var(--ink-2); font-size: 16px; margin: 8px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack > * + * { margin-top: 12px; }
.gap-l > * + * { margin-top: 22px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.tint { background: var(--accent-soft); box-shadow: none; }
.card.sage { background: var(--sage-soft); box-shadow: none; }
.card + .card { margin-top: 12px; }

/* Шапка */
.brand { display: flex; align-items: center; gap: 10px; }
.mark { box-shadow: 13px 0 0 -3px var(--sage-soft); margin-right: 12px; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 600 16px/1 var(--serif); position: relative; }
.brand b { font: 600 17px var(--serif); }

.hero { padding: 26px 4px 8px; }
.hero h1 { font-size: 34px; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 500; }

/* Шаги на главной */
.steps { counter-reset: s; display: grid; gap: 10px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 600 14px var(--serif); }
.step b { display: block; font-weight: 600; }

/* Кнопки */
.btn { appearance: none; border: 0; border-radius: 16px; padding: 15px 18px; font-weight: 600; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s ease, opacity .12s ease, background .2s; width: 100%; text-align: center; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.sage { background: var(--sage); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { padding: 10px 14px; font-size: 14px; border-radius: 12px; width: auto; }
.btn.link { background: none; color: var(--accent); padding: 8px 0; width: auto; font-size: 15px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-row.three { grid-template-columns: repeat(3, 1fr); }

.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 18px calc(12px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 5; }
.dock > * { max-width: 524px; margin: 0 auto; display: flex; }

/* Чипы и выбор */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .15s; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.options { display: grid; gap: 10px; }
.option { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--card); border: 1.5px solid transparent; border-radius: 18px; box-shadow: var(--shadow); cursor: pointer; text-align: left; width: 100%; transition: border-color .15s, transform .12s; }
.option:active { transform: scale(.99); }
.option.on { border-color: var(--accent); }
.option .ico { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; font-size: 22px; }
.option b { display: block; font-weight: 600; font-size: 16px; }
.option span { color: var(--muted); font-size: 13.5px; }
.option .tick { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; }
.option.on .tick { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--card); }

.progress { display: flex; gap: 6px; margin: 6px 0 22px; }
.progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .3s; }
.progress i.on { background: var(--accent); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--line); border-radius: 14px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 9px 8px; border-radius: 11px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* Поля */
.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px 2px; }
.input, textarea.input { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 13px 14px; outline: none; font-size: 16px; transition: border-color .15s; }
.input:focus { border-color: var(--accent); }
textarea.input { resize: none; min-height: 120px; line-height: 1.5; }

/* Карточка места */
.place .kind { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .03em; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.place h3 { margin: 10px 0 2px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: 13.5px; margin: 10px 0 12px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.forecast { border-top: 1px dashed var(--line); padding-top: 12px; margin-bottom: 14px; }
.forecast .eyebrow { margin-bottom: 6px; }
.forecast li { list-style: none; position: relative; padding-left: 16px; margin: 3px 0; font-size: 14.5px; }
.forecast li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--sage); }
.forecast ul { margin: 0; padding: 0; }

/* Премиум-маршрут */
.premium { position: relative; overflow: hidden; background: var(--ink); color: var(--bg); }
.premium .eyebrow { color: var(--amber); }
.premium p { color: color-mix(in srgb, var(--bg) 75%, transparent); margin: 6px 0 14px; }
.premium .btn.primary { background: var(--bg); color: var(--ink); }
.route { position: relative; padding-left: 26px; }
.route::before { content: ''; position: absolute; left: 9px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.route .pt { position: relative; padding: 4px 0 16px; }
.route .pt::before { content: ''; position: absolute; left: -22px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--card); }
.route .walk { font-size: 13px; color: var(--muted); margin: -6px 0 10px; }

/* Список плана */
.plan-head { display: flex; gap: 14px; align-items: center; }
.plan-date { flex: none; width: 58px; height: 62px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; text-align: center; line-height: 1.05; }
.plan-date b { font: 600 22px var(--serif); display: block; }
.plan-date small { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tasks { display: grid; gap: 10px; }
.task { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); cursor: pointer; border: 0; width: 100%; text-align: left; }
.task .n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 15px var(--serif); background: var(--line); color: var(--ink-2); }
.task.done .n { background: var(--sage); color: #fff; }
.task.warn .n { background: var(--amber); color: #fff; }
.task b { display: block; font-weight: 600; }
.task span { color: var(--muted); font-size: 13.5px; }
.task .arr { margin-left: auto; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--line); color: var(--ink-2); }
.pill.good { background: var(--sage-soft); color: var(--sage); }
.pill.mid { background: var(--amber-soft); color: var(--amber); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* Проверка */
.facts { display: grid; gap: 2px; }
.fact { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.fact:last-child { border-bottom: 0; }
.fact .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; transform: translateY(-1px); }
.fact .dot.good { background: var(--sage); }
.fact .dot.mid { background: var(--amber); }
.fact .dot.bad { background: var(--danger); }
.fact b { font-weight: 600; min-width: 96px; }
.photo-drop { display: grid; place-items: center; text-align: center; border: 1.5px dashed var(--line); border-radius: 18px; padding: 26px 16px; cursor: pointer; background: var(--card); }
.photo-drop img { width: 120px; height: 120px; object-fit: cover; border-radius: 16px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle:last-child { border-bottom: 0; }
.switch { flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch.on { background: var(--sage); }
.switch.on::after { transform: translateX(18px); }

.safety-card { border-radius: var(--radius); padding: 20px; }
.safety-card.l0 { background: var(--sage-soft); }
.safety-card.l1 { background: var(--amber-soft); }
.safety-card.l2 { background: var(--danger-soft); }
.safety-card p { margin: 8px 0 0; font-size: 15.5px; }

/* Страховка */
.shield { text-align: center; padding: 26px 18px; }
.ring { width: 168px; height: 168px; margin: 6px auto 16px; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .t { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.ring .t b { font: 600 34px var(--serif); display: block; }
.ring .t small { color: var(--muted); font-size: 12.5px; }
.sos { position: relative; overflow: hidden; }
.sos .fill { position: absolute; inset: 0; background: rgba(255, 255, 255, .22); transform-origin: left; transform: scaleX(0); }
.sos.holding .fill { transition: transform 1.6s linear; transform: scaleX(1); }

/* Прочее */
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; opacity: 0; transition: all .25s; z-index: 20; max-width: calc(100% - 36px); text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 50%, var(--card)) 50%, var(--line) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); height: 200px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.note { font-size: 13px; color: var(--muted); line-height: 1.45; }
.footer-links { text-align: center; margin-top: 26px; font-size: 13px; }
.footer-links a { color: var(--muted); }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.center { text-align: center; }
