:root {
  --bg: #F6F5F2;
  --ink: #161616;
  --mute: #6B6A66;
  --soft: #3A3936;
  --line: #E4E2DC;
  --line-soft: #F0EEE9;
  --field: #D6D3CC;
  --off: #C9C6BF;
  --faint: #A5A39D;
  --pill: #ECEAE5;
  --track: #CFCCC5;
  --error: #B3261E;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Onest', system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--mute); }
input, select, button { font-family: inherit; }
button { cursor: pointer; color: var(--ink); }
[hidden] { display: none !important; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { max-width: 1200px; width: 100%; margin: 0 auto; padding-left: 32px; padding-right: 32px; }

/* Шапка */
.header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header .wrap { padding-top: 20px; padding-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand b { font-size: 17px; font-weight: 600; }
.brand span { font-size: 13px; color: var(--mute); }
.phone { font-size: 14px; font-weight: 500; padding: 10px 18px; border: 1px solid var(--ink); border-radius: 999px; }

/* Заголовок и вкладки */
.nav { padding-top: 40px; display: flex; flex-direction: column; gap: 28px; }
.nav h1 { margin: 0; font-size: 44px; font-weight: 400; letter-spacing: -.025em; line-height: 1.1; text-wrap: balance; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--pill); border-radius: 999px; align-self: flex-start; flex-wrap: wrap; }
.tab { border: 0; font-size: 14px; padding: 10px 20px; border-radius: 999px; background: transparent; color: var(--mute); }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

main { flex: 1; padding-top: 40px; padding-bottom: 96px; }

/* Раскладка «форма + карточка» */
.split { display: flex; gap: 40px; flex-wrap: wrap; align-items: flex-start; }
.col-main { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 48px; }
.col-form { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.aside { flex: 1 1 320px; max-width: 420px; position: sticky; top: 24px; }
.aside-memo { flex: 1 1 380px; max-width: 460px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 24px; }

.step { display: flex; flex-direction: column; gap: 16px; }
.kicker { font-size: 13px; color: var(--mute); }
.grid { display: grid; gap: 12px; }
.grid-220 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-200 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-180 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-160 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* Карточки выбора */
.tile { text-align: left; padding: 20px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; color: var(--ink); }
.tile.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tile-type { gap: 4px; }
.tile-type.on { background: #fff; color: var(--ink); }
.tile-type b { font-size: 16px; font-weight: 500; }
.tile-type span { font-size: 13px; color: var(--mute); }
.tile-pkg { gap: 10px; min-height: 128px; }
.tile-pkg .top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; opacity: .65; }
.tile-pkg .name { font-size: 16px; font-weight: 500; }
.tile-pkg .price { margin-top: auto; font-size: 20px; font-weight: 400; letter-spacing: -.01em; }
.tile-care { gap: 10px; min-height: 150px; }
.tile-care .name { font-size: 15px; font-weight: 500; line-height: 1.35; }
.tile-care .desc { font-size: 13px; line-height: 1.45; opacity: .7; }
.tile-care .price { margin-top: auto; font-size: 18px; }

/* Строки с радио и чекбоксами */
.group { display: flex; flex-direction: column; }
.group-title { font-size: 18px; font-weight: 500; padding-bottom: 12px; }
.opt { background: none; border: 0; border-top: 1px solid var(--line); padding: 16px 0; display: grid; grid-template-columns: 20px minmax(0,1fr) auto; gap: 14px; align-items: center; text-align: left; color: var(--soft); font-size: 15px; line-height: 1.4; }
.opt.on { color: var(--ink); }
.opt .p { white-space: nowrap; }
.opt-last { border-bottom: 1px solid var(--line); padding: 18px 0; gap: 16px; color: var(--ink); }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--off); display: flex; align-items: center; justify-content: center; }
.radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.on > .radio { border-color: var(--ink); }
.on > .radio::after { background: var(--ink); }
.check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--off); color: #fff; font-size: 12px; line-height: 15px; text-align: center; }
.on > .check { border-color: var(--ink); background: var(--ink); }
.on > .check::after { content: '✓'; }

.mon { padding: 22px 0; gap: 16px; align-items: start; color: var(--ink); }
.mon .radio { margin-top: 3px; }
.mon .info { display: flex; flex-direction: column; gap: 6px; }
.mon .info b { font-size: 17px; font-weight: 500; }
.mon .info span { font-size: 13px; color: var(--mute); line-height: 1.5; }
.mon .p { font-size: 17px; }

/* Состав пакета */
.pkg-desc { font-size: 15px; line-height: 1.55; color: var(--mute); max-width: 560px; }
.pkg-item { border-top: 1px solid var(--line); padding: 14px 0; display: grid; grid-template-columns: 28px minmax(0,1fr); font-size: 15px; line-height: 1.45; }
.pkg-item span:first-child { color: var(--faint); }
.link-btn { align-self: flex-start; background: none; border: 0; padding: 0; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }

/* Карточка итога */
.card { background: #fff; border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 24px; border: 1px solid var(--line); }
.total { display: flex; flex-direction: column; gap: 6px; }
.total-sum { font-size: 44px; font-weight: 400; letter-spacing: -.03em; line-height: 1; }
.lines { display: flex; flex-direction: column; }
.lines.scroll { max-height: 280px; overflow: auto; }
.line { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 1.4; }
.line span:first-child { color: var(--mute); }
.line span:last-child { white-space: nowrap; }
.benefit { text-align: left; background: var(--bg); border: 0; border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 12px; align-items: center; }
.switch { width: 34px; height: 20px; border-radius: 999px; background: var(--track); position: relative; display: block; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.benefit.on .switch { background: var(--ink); }
.benefit.on .switch::after { left: 16px; }
.benefit-text { display: flex; flex-direction: column; gap: 2px; }
.benefit-text b { font-size: 13px; font-weight: 500; }
.benefit-text span { font-size: 12px; color: var(--mute); }
.actions { display: flex; flex-direction: column; gap: 8px; }
.btn { border-radius: 999px; font-size: 14px; padding: 14px; border: 1px solid var(--field); background: #fff; }
.btn-dark { border: 0; background: var(--ink); color: #fff; padding: 16px; font-size: 15px; font-weight: 500; }
.note { font-size: 12px; line-height: 1.5; color: var(--mute); }

/* Памятка */
.lead { margin: 0; font-size: 15px; line-height: 1.55; color: var(--mute); max-width: 520px; text-wrap: pretty; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 13px; color: var(--mute); }
.input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--field); background: #fff; font-size: 15px; outline: none; color: var(--ink); min-height: 50px; }
.input:focus { border-color: var(--ink); }
.memo-card { padding: 36px; gap: 28px; }
.memo-head { display: flex; flex-direction: column; gap: 8px; }
.memo-name { font-size: 26px; font-weight: 400; letter-spacing: -.01em; line-height: 1.2; text-wrap: balance; overflow-wrap: anywhere; }
.memo-when { font-size: 15px; }
.memo-row { border-top: 1px solid var(--line-soft); padding: 14px 0; display: flex; flex-direction: column; gap: 4px; }
.memo-row .l { font-size: 12px; color: var(--mute); }
.memo-row .v { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.memo-row a { font-size: 13px; text-decoration: underline; text-underline-offset: 3px; color: var(--mute); }
.memo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.memo-actions .btn { padding: 16px; }
.memo-actions .btn-dark { font-size: 14px; }
.memo-note { font-size: 13px; line-height: 1.5; color: var(--mute); padding: 4px 8px; }
.memo-note a { text-decoration: underline; text-underline-offset: 3px; }

/* Шапка: действия */
.header-actions { display: flex; gap: 8px; align-items: center; }
.phone-dark { background: var(--ink); color: #fff; font-family: inherit; }
.phone .narrow { display: none; }
.phone-dark:hover { opacity: .85; }

/* Что делать сейчас */
.stack { display: flex; flex-direction: column; gap: 64px; }
.grid-320 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile-type.on b { color: var(--ink); }
.nstep { border-top: 1px solid var(--line); padding: 22px 0; display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 8px; }
.nstep-n { color: var(--faint); font-size: 15px; line-height: 1.4; }
.nstep-body { display: flex; flex-direction: column; gap: 8px; }
.nstep-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nstep-title { font-size: 17px; font-weight: 500; line-height: 1.35; }
.badge { font-size: 12px; color: var(--mute); padding: 3px 10px; border-radius: 999px; background: var(--pill); white-space: nowrap; }
.badge-hot { background: var(--ink); color: #fff; }
.nstep-desc { font-size: 15px; line-height: 1.55; color: var(--mute); max-width: 640px; }
.hotline { font-size: 34px; font-weight: 400; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.warn { border-top: 1px solid var(--line-soft); padding-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.warn b { font-size: 15px; font-weight: 500; line-height: 1.35; }
.warn p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--mute); }
.btn-link { text-align: center; }
.morgue { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.morgue-name { font-size: 16px; font-weight: 500; line-height: 1.35; }
.morgue-addr { font-size: 14px; line-height: 1.45; }
.morgue-sched { font-size: 13px; color: var(--mute); line-height: 1.5; }
.morgue-notes { font-size: 13px; color: var(--mute); line-height: 1.55; flex: 1; }
.morgue-foot { border-top: 1px solid var(--line-soft); padding-top: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.morgue-foot a:last-child { text-decoration: underline; text-underline-offset: 3px; color: var(--mute); font-size: 13px; }

/* Уход: состав выбранного тарифа */
.features { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; display: flex; flex-direction: column; }
.features .kicker { padding-bottom: 8px; }
.feature { border-top: 1px solid var(--line-soft); padding: 10px 0; font-size: 14px; line-height: 1.45; display: grid; grid-template-columns: 20px minmax(0,1fr); }
.feature::before { content: '—'; color: var(--faint); }

/* Памятка: цветы */
.flowers { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.flowers > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.flowers b { font-size: 14px; font-weight: 500; }
.flowers > span:first-child span { font-size: 13px; line-height: 1.45; color: var(--mute); }
.flowers-go { font-size: 13px; font-weight: 500; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; white-space: nowrap; }

/* Подвал */
.footer { border-top: 1px solid var(--line); }
.footer .wrap { padding-top: 40px; padding-bottom: 48px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.footer-col { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.5; color: var(--mute); }
.footer-col b { font-size: 14px; font-weight: 500; color: var(--ink); }
.footer-col a { color: var(--ink); }
.footer-col a[target] { text-decoration: underline; text-underline-offset: 3px; }
.footer-phone { font-size: 20px; letter-spacing: -.01em; }
.branch { display: flex; flex-direction: column; gap: 2px; }
.branch + .branch { margin-top: 10px; }

/* Окна */
.modal-body { display: flex; flex-direction: column; gap: 20px; }
.modal .opt { padding: 14px 0; font-size: 14px; }
body.locked { overflow: hidden; }

/* Ошибки полей */
.tel-wrap { display: flex; flex-direction: column; gap: 6px; }
.input.invalid { border-color: var(--error); }
.input.invalid:focus { border-color: var(--error); box-shadow: 0 0 0 3px rgba(179,38,30,.12); }
.field-error { font-size: 12px; line-height: 1.4; color: var(--error); }
.modal-body > .field-error { margin-top: -14px; }

/* Печатный бланк */
#print-sheet { display: none; }

/* Окно заявки и уведомление */
.overlay { position: fixed; inset: 0; background: rgba(22,22,22,.35); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.modal { background: #fff; border-radius: 20px; padding: 32px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.modal-sum { font-size: 32px; letter-spacing: -.02em; }
.modal-title { font-size: 22px; }
.modal-text { font-size: 14px; color: var(--mute); line-height: 1.5; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; z-index: 60; }

@media (max-width: 720px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .nav { padding-top: 28px; gap: 20px; }
  .nav h1 { font-size: 32px; }
  .header .wrap { padding-top: 14px; padding-bottom: 14px; flex-wrap: nowrap; }
  .brand { flex-direction: column; gap: 2px; }
  .phone { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
  .phone .wide { display: none; }
  .phone .narrow { display: inline; }
  .header-actions { gap: 6px; }
  .stack { gap: 48px; }
  .grid-320 { grid-template-columns: minmax(0, 1fr); }
  .grid-200.scenarios { grid-template-columns: minmax(0, 1fr); }
  .morgue { padding: 20px; }
  #panel-navigator .aside { order: -1; }
  .hotline { font-size: 30px; }
  .flowers { flex-direction: column; align-items: stretch; }
  .flowers-go { text-align: center; }
  .tabs { align-self: stretch; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; padding: 10px 14px; font-size: 13px; }
  .grid-180, .grid-200 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 16px; }
  .tile-pkg { min-height: 112px; }
  .tile-pkg .top { flex-direction: column; gap: 2px; }
  .tile-care .desc { font-size: 12px; }
  main { padding-top: 28px; }
  .col-main { gap: 40px; }
  .aside, .aside-memo { position: static; max-width: none; }
  .card { padding: 24px; }
  .memo-card { padding: 24px; }
  .total-sum { font-size: 36px; }
}

@media print {
  .header, .nav, .footer, .np { display: none !important; }
  body { background: #fff; }
  /* Смета печатается строгим бланком вместо страницы */
  body.print-estimate .page { display: none !important; }
  body.print-estimate #print-sheet { display: block; color: #000; font-size: 11pt; }
}
.ps-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 2px solid #000; padding-bottom: 10px; }
.ps-org { font-size: 15pt; font-weight: 600; }
.ps-sub { font-size: 9pt; color: #444; margin-top: 3px; }
.ps-right { text-align: right; font-size: 9pt; }
.ps-title { font-size: 12pt; font-weight: 600; text-align: center; margin: 18px 0 12px; text-transform: uppercase; }
.ps-table { width: 100%; border-collapse: collapse; font-size: 10pt; }
.ps-table th, .ps-table td { border: 1px solid #000; padding: 6px 8px; text-align: left; }
.ps-table th { background: #eee; }
.ps-table tbody td:first-child { text-align: center; }
.ps-table tfoot td { font-weight: 600; font-size: 11pt; }
.ps-note { font-size: 9pt; color: #333; line-height: 1.45; margin-top: 14px; }
.ps-sign { display: flex; justify-content: space-between; gap: 32px; margin-top: 40px; font-size: 10pt; }
