:root {
  --bg: #F5F6F2;
  --card: #FFFFFF;
  --line: #E3E7E2;
  --line-soft: #EEF1ED;
  --ink: #1B2421;
  --ink-2: #56605A;
  --ink-3: #5E6862;
  --green: #1F7A5C;
  --green-dark: #14533E;
  --green-soft: #E6F4EC;
  --green-ink: #1A6B50;
  --yellow: #C28A00;
  --yellow-soft: #FFF4D6;
  --yellow-ink: #6E4E00;
  --orange: #D2691E;
  --orange-soft: #FDEBDD;
  --orange-ink: #8A3F10;
  --red-soft: #FCE8E6;
  --red-ink: #8A1F18;
  --blue: #2D6FB0;
  --star: #E8A317;
  --radius: 20px;
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); text-decoration: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.screen { padding: 18px 16px 100px; display: flex; flex-direction: column; gap: 14px; max-width: 560px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.3px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

.btn { border: 0; border-radius: 14px; min-height: 48px; padding: 12px 16px; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn-primary { background: var(--green); color: #FFFFFF; }
.btn-soft { background: var(--green-soft); color: var(--green); }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.link-btn { border: 0; background: none; color: var(--green); font-weight: 700; padding: 10px 0; min-height: 44px; }

/* главная */
.hero { display: flex; gap: 16px; align-items: center; background: var(--green); color: #FFFFFF; border-radius: var(--radius); padding: 20px; }
.hero-icon { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,0.16); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-icon svg { width: 30px; height: 30px; stroke: #FFFFFF; fill: none; stroke-width: 2; stroke-linecap: round; }
.hero-title { font-size: 18px; font-weight: 800; }
.hero-text { font-size: 14px; line-height: 1.35; color: #E3F2EC; margin-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); position: relative; }
.tile[aria-disabled="true"] { opacity: 0.6; }
.tile-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.tile-icon svg { width: 22px; height: 22px; fill: none; stroke-width: 2; stroke-linecap: round; }
.tile-title { font-size: 15px; font-weight: 700; }
.badge-soon { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; color: var(--ink-3); background: var(--line-soft); border-radius: 999px; padding: 3px 8px; }
.notice { display: flex; flex-direction: column; gap: 10px; }
.notice p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }

.family-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; color: var(--ink); }
.family-card .tile-icon svg { width: 22px; height: 22px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.family-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.chev { font-size: 22px; color: var(--green); font-weight: 800; }

/* профили семьи */
.member { display: flex; flex-direction: column; gap: 12px; }
.member-top { display: flex; justify-content: space-between; align-items: center; }
.member-name { font-size: 17px; font-weight: 800; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { border: 1px solid var(--line); background: #FFFFFF; border-radius: 999px; padding: 8px 12px; min-height: 40px; font-size: 13px; font-weight: 700; }
.opt[aria-pressed="true"] { background: var(--red-soft); border-color: #E9B4AE; color: var(--red-ink); }
.profile-alert { background: var(--red-soft); color: var(--red-ink); border: 2px solid #E9B4AE; border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 700; line-height: 1.45; }
.profile-alert a { color: var(--red-ink); text-decoration: underline; font-weight: 600; }

/* сканер */
.scanner { min-height: 100vh; background: #111614; color: #FFFFFF; padding: 16px 20px 110px; display: flex; flex-direction: column; gap: 16px; }
.seg { display: flex; align-self: center; background: #26302C; border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { border: 0; border-radius: 999px; padding: 10px 18px; min-height: 44px; font-weight: 700; font-size: 14px; background: transparent; color: #D5DDD9; }
.seg button[aria-pressed="true"] { background: #FFFFFF; color: var(--ink); }
.frame { position: relative; height: min(56vh, 470px); border-radius: 24px; background: #2A3330; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.frame .corner { position: absolute; width: 44px; height: 44px; border: 4px solid #6EE7B7; }
.corner.tl { left: 20px; top: 20px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.corner.tr { right: 20px; top: 20px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.corner.bl { left: 20px; bottom: 20px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.corner.br { right: 20px; bottom: 20px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.frame-hint { font-size: 15px; line-height: 1.5; color: #D5DDD9; max-width: 260px; }
.frame-hint b { color: #FFFFFF; }
.shutter-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 24px 0; }
.round-btn { width: 52px; height: 52px; border-radius: 16px; background: #26302C; display: flex; align-items: center; justify-content: center; color: #FFFFFF; cursor: pointer; }
.round-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shutter { width: 84px; height: 84px; border-radius: 50%; background: #FFFFFF; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 6px rgba(255,255,255,0.18); cursor: pointer; }
.shutter span { width: 66px; height: 66px; border-radius: 50%; background: var(--green); display: block; }
.frame { overflow: hidden; }
.cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #2A3330; }
.frame .corner { z-index: 1; }
.frame-hint { position: relative; z-index: 1; }
.frame.live { align-items: flex-end; }
.frame.live .frame-hint { background: rgba(17,22,20,0.72); border-radius: 12px; padding: 8px 12px; font-size: 13px; max-width: none; }
.round-spacer { width: 52px; height: 52px; }
button.shutter { border: 0; padding: 0; }
button.shutter:disabled { opacity: 0.5; }
button.round-btn { border: 0; }
.round-btn[aria-pressed="true"] { background: #F6C945; color: #111614; }
.phone-cam { align-self: center; color: #6EE7B7; font-weight: 700; font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; position: relative; cursor: pointer; }
.shutter-label { text-align: center; font-size: 13px; color: #AEB8B3; }
.file-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.reading { position: fixed; inset: 0; background: rgba(17,22,20,0.92); color: #FFFFFF; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px; text-align: center; font-size: 16px; z-index: 20; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.2); border-top-color: #6EE7B7; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.scan-error { background: #2A3330; border-radius: 16px; padding: 14px 16px; font-size: 14px; line-height: 1.45; color: #F1EADB; }

/* разбор */
.result-head { display: flex; flex-direction: column; gap: 10px; }
.result-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.product { font-size: 13px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 4px; min-width: 0; }
.product span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-btn { border: 0; background: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); flex-shrink: 0; }
.edit-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fav-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; background: #FFFFFF; padding: 8px 12px; min-height: 40px; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.star { width: 18px; height: 18px; fill: none; stroke: #8A948E; stroke-width: 2; stroke-linejoin: round; }
.star.on { fill: var(--star); stroke: var(--yellow); }
.summary { font-size: 21px; font-weight: 800; line-height: 1.25; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.chip.green { background: var(--green-soft); color: var(--green-ink); }
.chip.yellow { background: var(--yellow-soft); color: #7A5600; }
.chip.orange { background: var(--orange-soft); color: #9C4612; }

.score { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.score-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.score-top b { font-size: 20px; color: var(--ink); }
.score-bar { position: relative; height: 12px; border-radius: 999px; background: linear-gradient(90deg, #C9372C 0%, #E07B22 30%, #E3B21B 50%, #8DBA3F 72%, #2E8B57 100%); }
.score-dot { position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; border: 4px solid var(--ink); transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.score-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }

.name-form { display: flex; flex-direction: column; gap: 10px; }
.name-label { font-size: 14px; line-height: 1.45; color: var(--ink-2); font-weight: 600; }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; min-height: 48px; border: 1px solid #D5DBD6; border-radius: 14px; padding: 0 14px; font-size: 15px; background: #FFFFFF; }
.name-row input:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }

.warn { background: var(--yellow-soft); color: var(--yellow-ink); border-radius: 16px; padding: 14px 16px; font-size: 14px; line-height: 1.45; }
.allergen-box { background: var(--red-soft); border-radius: 16px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.allergen-box svg { width: 24px; height: 24px; flex-shrink: 0; fill: none; stroke: #A3261E; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.allergen-box .t { font-size: 15px; font-weight: 800; color: var(--red-ink); }
.allergen-box .d { font-size: 14px; color: #6B2520; line-height: 1.45; margin-top: 4px; }

.group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.group-head { padding: 14px 16px; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; }
.group-head .dot { width: 12px; height: 12px; border-radius: 50%; }
.group.controversial .group-head { background: var(--orange-soft); color: var(--orange-ink); }
.group.controversial .dot { background: var(--orange); }
.group.limit .group-head { background: var(--yellow-soft); color: var(--yellow-ink); }
.group.limit .dot { background: var(--yellow); }
.group.green .group-head { background: var(--green-soft); color: var(--green-ink); }
.group.green .dot { background: #2E8B57; }
.group.unknown .group-head { background: var(--line-soft); color: var(--ink-2); }
.group.unknown .dot { background: #9AA39E; }
.item { width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line-soft); background: #FFFFFF; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-height: 48px; }
.item-name { display: flex; justify-content: space-between; gap: 10px; width: 100%; font-size: 15px; font-weight: 700; }
.item-name span:last-child { color: var(--ink-3); font-weight: 600; }
.item-note { font-size: 14px; line-height: 1.45; color: #4A544F; }
.unknown-list { padding: 12px 16px 14px; font-size: 14px; line-height: 1.5; color: var(--ink-2); border-top: 1px solid var(--line-soft); }
details.raw { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; }
details.raw summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; font-size: 14px; cursor: pointer; }
details.raw pre { white-space: pre-wrap; font: 13px/1.5 Manrope, sans-serif; color: var(--ink-2); margin: 0 0 12px; }
.disclaimer { font-size: 12px; color: var(--ink-3); line-height: 1.45; padding: 0 4px; }

/* история */
.tabs { display: flex; background: #E8ECE7; border-radius: 14px; padding: 4px; gap: 4px; }
.tabs button { flex: 1; border: 0; border-radius: 11px; padding: 10px; min-height: 44px; font-weight: 700; font-size: 14px; background: transparent; }
.tabs button[aria-pressed="true"] { background: #FFFFFF; }
.search { display: flex; align-items: center; gap: 10px; background: #FFFFFF; border: 1px solid #D5DBD6; border-radius: 14px; padding: 0 14px; min-height: 48px; }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.search input { border: 0; outline: none; font-weight: 500; font-size: 15px; flex: 1; min-height: 44px; background: transparent; min-width: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { background: #FFFFFF; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 40px; font-size: 13px; font-weight: 700; }
.filters button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 16px; border-top: 1px solid var(--line-soft); }
.row:first-child { border-top: 0; }
.row .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.row a { flex: 1; display: flex; flex-direction: column; gap: 3px; color: var(--ink); min-width: 0; padding: 4px 0; }
.row .name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.star-btn { width: 44px; height: 44px; border: 0; background: none; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.star-btn .star { width: 24px; height: 24px; }
.empty { padding: 28px 20px; text-align: center; font-size: 14px; color: var(--ink-2); line-height: 1.45; }

/* нижняя навигация */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: #FFFFFF; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px 4px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); min-height: 44px; justify-content: center; }
.nav a[aria-current="page"] { color: var(--green); font-weight: 700; }
.nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav.dark { background: #111614; border-top-color: #26302C; }
.nav.dark a { color: #AEB8B3; }
.nav.dark a[aria-current="page"] { color: #6EE7B7; }

.center-msg { padding: 48px 24px; text-align: center; color: var(--ink-2); line-height: 1.5; }
.own-form { display: flex; gap: 8px; }
.own-form input { flex: 1; min-width: 0; min-height: 44px; border: 1px solid #D5DBD6; border-radius: 12px; padding: 0 12px; font-size: 14px; background: #FFFFFF; }
.own-form input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.link-btn.danger { color: #A3261E; }

/* удаление из списка */
.row-wrap { position: relative; overflow: hidden; border-top: 1px solid var(--line-soft); transition: max-height .25s ease, opacity .25s ease; max-height: 120px; }
.row-wrap:first-child { border-top: 0; }
.row-wrap .row { border-top: 0; background: #FFFFFF; position: relative; z-index: 1; transition: transform .2s ease; }
.row-wrap.gone { max-height: 0; opacity: 0; }
.row-del { position: absolute; top: 0; right: 0; bottom: 0; width: 96px; border: 0; background: #C9372C; color: #FFFFFF; font-weight: 700; font-size: 14px; }
.trash-btn { width: 40px; height: 44px; border: 0; background: none; display: flex; align-items: center; justify-content: center; color: #8A948E; flex-shrink: 0; }
.trash-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trash-btn:hover { color: #A3261E; }
.touch .trash-btn { display: none; }        /* на телефоне — свайп влево */
html:not(.touch) .row-del { display: none; }

/* «Капа пишет» */
.nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.occasions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.occasions button { border: 1px solid var(--line); background: #FFFFFF; border-radius: 14px; min-height: 48px; padding: 10px 12px; font-weight: 700; font-size: 14px; text-align: left; }
.occasions button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.field { width: 100%; min-height: 48px; border: 1px solid #D5DBD6; border-radius: 14px; padding: 0 14px; font-size: 15px; background: #FFFFFF; }
.field:focus, .card-view textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.card-view { display: flex; flex-direction: column; gap: 12px; }
.card-view img { width: 100%; height: auto; border-radius: 14px; display: block; border: 1px solid var(--line); }
.card-view textarea { width: 100%; border: 1px solid #D5DBD6; border-radius: 14px; padding: 12px 14px; font: 15px/1.45 Lora, Georgia, serif; resize: vertical; }
.variant { display: flex; flex-direction: column; gap: 12px; }
.variant-text { font-size: 15px; line-height: 1.5; white-space: normal; }
.busy { background: rgba(17,22,20,0.82); }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #1B2421; color: #FFFFFF; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; z-index: 30; max-width: calc(100% - 32px); text-align: center; transition: opacity .3s ease; }
.toast.hide { opacity: 0; }

/* верхняя полоса «‹ Назад» */
.topbar { position: sticky; top: 0; z-index: 15; height: 52px; display: grid; grid-template-columns: 96px 1fr 96px; align-items: center;
  background: #FFFFFF; border-bottom: 1px solid var(--line); padding: 0 8px; }
.topbar.dark { background: #111614; border-bottom-color: #26302C; color: #FFFFFF; }
.back-btn { border: 0; background: none; color: var(--green); font-weight: 700; font-size: 16px; min-height: 44px; padding: 0 8px;
  display: inline-flex; align-items: center; gap: 4px; justify-self: start; }
.back-btn span { font-size: 26px; line-height: 1; margin-top: -3px; }
.topbar.dark .back-btn { color: #6EE7B7; }
.topbar-title { text-align: center; font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scanner { min-height: calc(100vh - 52px); }

/* «Готовые» открытки: сетка маленьких картинок */
.tabs-small button { min-height: 40px; padding: 8px; font-size: 13px; }
.ready-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ready-item { border: 1px solid var(--line); background: #FFFFFF; border-radius: 16px; padding: 0; overflow: hidden;
  display: flex; flex-direction: column; text-align: left; }
.ready-item img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; background: #EEF1ED; }
.ready-item span { padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--muted, #5E6B64); }
.ready-item:active { transform: scale(.98); }

/* «Как получить больше?» — бонусы */
.bonus-card { display: flex; flex-direction: column; gap: 12px; }
.bonus-limit { background: #FFF6E0; border-radius: 12px; padding: 12px 14px; font-weight: 600; line-height: 1.45; }
.bonus-title { font-weight: 800; font-size: 16px; }
.bonus-row { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.45; }
/* серия: 7 кружков-дней; сегодняшний, если ещё не отмечен, — кнопка */
.streak { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.streak .day { aspect-ratio: 1; max-width: 100%; border-radius: 50%; border: 2px solid #E3E7E2; background: #F5F6F2; color: #7A847F;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; font: inherit; line-height: 1; }
.streak .day b { font-size: 14px; font-weight: 800; }
.streak .day small { font-size: 8px; font-weight: 700; margin-top: 1px; }
.streak .day.on { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.streak .day.prize { border-color: #F2B8C6; background: #FCE6EC; color: #D23F66; }
.streak .day-today { border: 2px dashed var(--green); background: #FFFFFF; color: var(--green); cursor: pointer; animation: dayPulse 1.6s ease-in-out infinite; }
.streak .day-today:active { transform: scale(.92); }
@keyframes dayPulse { 50% { box-shadow: 0 0 0 4px rgba(31,122,92,.18); } }
@media (prefers-reduced-motion: reduce) { .streak .day-today { animation: none; } }
.bonus-balance { display: flex; align-items: baseline; gap: 8px; font-weight: 700; color: var(--green-dark, #14533E); }
.bonus-balance span { font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* кругляшок с бонусами в правом верхнем углу главной */
.home-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bonus-badge { flex: none; width: 64px; height: 64px; border-radius: 50%; background: #E8577A; color: #FFFFFF;   /* розовый, как щёчки Капы */
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none;
  box-shadow: 0 4px 12px rgba(232, 87, 122, .35); }
.bonus-badge:active { transform: scale(.95); }
.bonus-num { font-size: 22px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.bonus-cap { font-size: 10px; font-weight: 700; letter-spacing: .04em; margin-top: 3px; opacity: .9; }
/* рецепты */
.recipe-photo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recipe-photo .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.prod-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.prod-chip { display: inline-flex; align-items: center; gap: 2px; background: #FFFFFF; border: 1px solid var(--line);
  border-radius: 20px; padding: 0 0 0 12px; font-size: 14px; font-weight: 600; min-height: 36px; }
.prod-chip button { border: 0; background: none; width: 36px; height: 36px; font-size: 18px; color: #6B756F; }
.prod-add { display: flex; gap: 8px; }
.prod-add .field { flex: 1; min-width: 0; }
.recipe { display: flex; flex-direction: column; gap: 8px; }
.recipe-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.recipe-head h2 { margin: 0; font-size: 20px; line-height: 1.3; text-wrap: balance; }
.recipe-head .icon-btn { border: 0; background: none; width: 44px; height: 44px; flex: none; }
.recipe-head .star { width: 26px; height: 26px; }
.recipe ul, .recipe ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.recipe-steps li::marker { font-weight: 800; color: var(--green); }
.recipe-avoid { color: #8A3B12; font-weight: 600; }
.recipe-tip { background: #FFF6E0; border-radius: 12px; padding: 10px 12px; line-height: 1.45; }
.row-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.recipe-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-decoration: none; color: inherit; }
.recipe-row .star { width: 20px; height: 20px; flex: none; }
.btn:disabled { opacity: .45; }
.recipe-kcal { font-size: 15px; }
.recipe .score { margin: 4px 0 6px; }
/* вода */
.water-today { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.water-count { font-size: 18px; font-weight: 700; }
.water-count b { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.water-btns { display: grid; grid-template-columns: 64px 1fr; gap: 10px; width: 100%; margin-top: 4px; }
.water-btns .btn { font-size: 18px; }
.water-plus { background: #2D6FB0; }
.water-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; margin-top: 10px; height: 100px; }
.wk { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.wk-n { font-size: 11px; color: var(--ink-3, #6B756F); font-variant-numeric: tabular-nums; min-height: 14px; }
.wk-bar { width: 100%; max-width: 28px; border-radius: 6px 6px 3px 3px; background: #CFE3F3; }
.wk-bar.met { background: #2E8B57; }
.wk-d { font-size: 12px; color: var(--ink-3, #6B756F); }
.wk-d.today { color: var(--ink, #1E2A24); font-weight: 800; }
.water-ch { display: flex; flex-direction: column; gap: 8px; }
.ch-cells { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.ch-cells span { aspect-ratio: 1; border-radius: 6px; background: #EEF1ED; border: 1px solid var(--line); }
.ch-cells span.on { background: #4AA3DF; border-color: #4AA3DF; }
.ch-cells span.miss { background: #F6E3DC; border-color: #EBC9BD; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.4; }
.toggle { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; flex: none; border-radius: 15px; background: #D5DBD6; position: relative; transition: background .2s; margin: 0; cursor: pointer; }
.toggle::before { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.toggle:checked { background: var(--green); }
.toggle:checked::before { transform: translateX(20px); }
.toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
/* живая Капа на экране «Вода» */
.kapa-wrap { position: relative; width: 120px; height: 150px; display: flex; align-items: flex-end; justify-content: center; }
.water-kapa { width: 120px; height: 140px; animation: kapa-bob 2.8s ease-in-out infinite; transform-origin: 50% 100%; overflow: visible; }
.water-level { transition: transform 1s cubic-bezier(.3, 1.3, .5, 1); }
.wave { animation: wave-move 3.2s linear infinite; }
.wave.back { animation-duration: 5s; animation-direction: reverse; opacity: .9; }
.eyes { transform-box: fill-box; transform-origin: center; animation: kapa-blink 4.5s infinite; }
.kapa-wrap.add .water-kapa, .kapa-wrap.minus .water-kapa { animation: kapa-plop .6s ease-out .25s, kapa-bob 2.8s ease-in-out .85s infinite; }
.kapa-wrap.joy .water-kapa { animation: kapa-joy 1s ease-out .25s 2, kapa-bob 2.8s ease-in-out 2.25s infinite; }
.drip { position: absolute; left: 50%; top: -18px; width: 14px; height: 18px; margin-left: -7px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: #4AA3DF; opacity: 0; animation: drip-fall .45s ease-in forwards; }
.spark { position: absolute; color: #F4B740; font-size: 18px; opacity: 0; animation: spark 1.4s ease-out .5s forwards; }
.spark.s1 { left: -6px; top: 30px; } .spark.s2 { right: -6px; top: 20px; animation-delay: .65s; }
.spark.s3 { left: 6px; top: 90px; animation-delay: .8s; } .spark.s4 { right: 4px; top: 86px; animation-delay: .95s; }
@keyframes kapa-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes wave-move { from { transform: translateX(0); } to { transform: translateX(120px); } }
@keyframes kapa-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes kapa-plop { 0% { transform: scale(1, 1); } 30% { transform: scale(1.08, .9); } 60% { transform: scale(.95, 1.06); } 100% { transform: scale(1, 1); } }
@keyframes kapa-joy { 0% { transform: translateY(0) scale(1, 1); } 20% { transform: translateY(0) scale(1.08, .9); }
  50% { transform: translateY(-22px) scale(.96, 1.05); } 80% { transform: translateY(0) scale(1.06, .94); } 100% { transform: translateY(0) scale(1, 1); } }
@keyframes drip-fall { 0% { opacity: 0; transform: translateY(-10px); } 20% { opacity: 1; } 100% { opacity: 1; transform: translateY(40px) scale(.6); } }
@keyframes spark { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0; transform: translateY(-14px) scale(.8); } }
.wk.future .wk-bar { background: #F0F2EF; }
.wk.future .wk-d { opacity: .5; }
@media (prefers-reduced-motion: reduce) {
  .water-kapa, .wave, .eyes, .drip, .spark, .kapa-wrap.add .water-kapa, .kapa-wrap.minus .water-kapa, .kapa-wrap.joy .water-kapa { animation: none; }
  .drip, .spark { display: none; }
  .water-level { transition: none; }
}

/* «Для ПП» — калорийность */
.pp { display: flex; flex-direction: column; gap: 8px; }
.pp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pp-title { font-weight: 700; }
.pp-kcal { color: #4A5550; }
.pp-kcal b { font-size: 20px; color: #1D2621; }
.pp-level { font-weight: 600; }
.pp-low .pp-level { color: #1F7A5C; }
.pp-moderate .pp-level { color: #C28A00; }
.pp-high .pp-level { color: #D2691E; }
.pp-very_high .pp-level { color: #C0392B; }
.pp-macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pp-macros span { background: #F5F6F2; border-radius: 12px; padding: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.pp-macros small { display: block; color: #6B756F; font-size: 12px; }
.pp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-tags span { background: #FFF1E6; color: #A34E12; border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.pp-tip { margin: 0; color: #4A5550; font-size: 14px; }

/* кабинет партнёра (шапка тёмно-зелёная #14533E — как в макете) */
.cab-card { background: var(--green); border-color: var(--green); color: #FFFFFF; }   /* как «Проверить состав» — решение Дмитрия */
.cab-card .tile-icon { background: rgba(255,255,255,.14); }
.cab-card .family-sum { color: #E3F2EC; }
.cab-card .chev { color: #E3F2EC; }
.cab-head { background: #14533E; color: #FFFFFF; border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.cab-team { font-weight: 800; font-size: 15px; }
.cab-tabs { display: flex; gap: 4px; background: rgba(255,255,255,.12); border-radius: 12px; padding: 4px; }
.cab-tabs button { flex: 1; border: 0; border-radius: 9px; padding: 10px 4px; min-height: 44px; font: 700 14px Manrope, system-ui, sans-serif; background: transparent; color: #E3F2EC; cursor: pointer; }
.cab-tabs button[aria-pressed="true"] { background: #FFFFFF; color: #14533E; font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cab-n { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 99px; background: #D2691E; color: #FFFFFF; font-size: 12px; font-weight: 800; }
.tm-up, .tm-ch, .tm-msg { gap: 8px; }
.ct-wrap { display: flex; flex-direction: column; gap: 12px; }
.ct-wrap:empty { display: none; }
.ct-card { gap: 8px; }
.ct-card .cab-bar, .tm-ch .cab-bar { display: block; }
.ct-prize { background: #FFF7E6; border-color: #F3DDA8; }
.ct-head { display: flex; gap: 10px; align-items: center; }
.ct-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; background: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.ct-ico svg { width: 24px; height: 24px; fill: none; stroke: #9C6A00; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ct-from { color: #6B4E00; }
.ct-task { font-weight: 800; font-size: 15px; }
.ct-gift { color: #6B4E00; }
.ct-box { background: #E6F2EC; color: #14533E; border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.ct-win { text-align: center; }
.ct-rules summary { cursor: pointer; font-weight: 700; font-size: 13px; color: #1F7A5C; min-height: 32px; display: flex; align-items: center; }
.ct-rules p { margin: 0 0 6px; }
.ct-video { width: 100%; max-width: 360px; border-radius: 14px; align-self: center; }
.ct-num { max-width: 140px; }
.tm-ch label.small { display: block; margin-top: 4px; }
.tm-ch > .small:not(.muted):not(.cab-rem):not(.tm-wait) { margin-top: 4px; }
.ct-claim { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid #EEF1ED; font-weight: 700; }
.ct-list { overflow-wrap: anywhere; }
.tm-up .cab-bar, .tm-ch .cab-bar { display: block; }
.cab-tabs button { white-space: nowrap; font-size: 13px; padding-inline: 2px; }
.cab-n { min-width: 18px; padding: 0 5px; font-size: 11px; vertical-align: 1px; }
.tm-up { background: #EAF4EF; border-color: #CFE6DA; }
.tm-off .btn[disabled] { opacity: .45; }
.tm-wait { font-weight: 700; color: #9C4612; }
.tm-line { margin-top: 4px; }
.tm-ok { font-size: 12px; font-weight: 800; color: #1F7A5C; }
.tm-write { flex: none; min-width: 0; padding-inline: 12px; }
.tm-last { color: #56605A; overflow-wrap: anywhere; }
.tm-opt { padding: 0 4px; }
.td-item { gap: 10px; }
.td-top { display: flex; gap: 12px; align-items: center; }
.td-why { font-weight: 700; color: #56605A; }
.td-remind { color: #9C4612; }
.td-new { color: #1F7A5C; }
.td-active { color: #2D6FB0; }
.td-note { background: #FDF6E3; color: #6B4E00; border-radius: 10px; padding: 8px 10px; }
.td-draft { resize: vertical; line-height: 1.45; }
.td-done { width: 100%; }
.td-ask { display: flex; flex-direction: column; gap: 6px; }
.td-ask .btn { min-width: 0; }
.cab-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; }
.cab-funnel b { display: block; font-size: 22px; color: #14533E; font-variant-numeric: tabular-nums; }
.cab-funnel span { font-size: 12px; font-weight: 700; color: #56605A; }
.cab-list { padding: 0; overflow: hidden; gap: 0; }
.cab-person { border-top: 1px solid #EEF1ED; }
.cab-person:first-child { border-top: 0; }
.cab-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.cab-av { width: 40px; height: 40px; flex: none; border-radius: 50%; background: #FDEEE3; color: #9C4612; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.cab-info { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 2px; font: inherit; color: inherit; cursor: pointer; min-height: 44px; justify-content: center; }
.cab-name { font-weight: 800; font-size: 15px; }
.cab-inv { color: #24507E; font-weight: 700; }
.cab-rem { color: #9C4612; font-weight: 700; }
.cab-st { flex: none; border: 0; border-radius: 999px; padding: 8px 12px; min-height: 36px; font: 800 12px Manrope, system-ui, sans-serif; cursor: pointer; }
.cab-more { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.cab-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cab-actions .btn { flex: 1; min-width: 140px; text-align: center; }
.cab-src { display: grid; grid-template-columns: 110px 1fr 28px; gap: 10px; align-items: center; font-size: 13px; font-weight: 700; }
.cab-src span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab-src b { text-align: right; font-variant-numeric: tabular-nums; }
.cab-bar { height: 12px; background: #EEF1ED; border-radius: 99px; overflow: hidden; }
.cab-bar i { display: block; height: 12px; background: #1F7A5C; border-radius: 99px; }
.cab-link { align-items: center; text-align: center; }
.cab-qr svg { width: 180px; height: 180px; display: block; }
.cab-url { font-size: 13px; color: #56605A; word-break: break-all; }
textarea.field { padding: 10px 14px; font: inherit; resize: vertical; min-height: 64px; }
.card > .switch-row:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* путь в партнёры и заявки в кабинете */
.pp-step { display: flex; flex-direction: column; gap: 12px; }
.pp-step .btn { text-align: center; }
.pp-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.pp-consent input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--green); }
.cab-req { gap: 10px; }
.cab-req-row { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid #EEF1ED; }
.cab-req .tile-title + .cab-req-row { border-top: 0; padding-top: 0; }
.cab-scope { display: flex; gap: 4px; background: #E8ECE7; border-radius: 14px; padding: 4px; }
.cab-scope button { flex: 1; border: 0; border-radius: 11px; padding: 10px; min-height: 44px; font: 700 14px Manrope, system-ui, sans-serif; background: transparent; color: #1B2421; cursor: pointer; }
.cab-scope button[aria-pressed="true"] { background: #FFFFFF; }
.cab-pick { display: flex; flex-direction: column; gap: 10px; }

/* достижения: второй кружок на главной (золотой — как кубок) и экран */
.home-badges { display: flex; gap: 8px; flex: none; }
.ach-badge { background: linear-gradient(135deg, #5FCB45, #2E9A3A); }   /* зелёный, как «Огород Капы» — решение Дмитрия */
.ach-head { align-items: center; text-align: center; }
.ach-big { font-size: 22px; }
.ach-big b { font-size: 30px; font-variant-numeric: tabular-nums; }
.ach-group { display: flex; justify-content: space-between; align-items: baseline; }
.ach-count { color: #7A847F; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.medals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 8px; }
.medal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.medal-date { font-size: 11px; color: #7A847F; min-height: 14px; }
.medal-svg { width: 96px; height: 96px; max-width: 100%; display: block; }
.medal-title { font-size: 13px; font-weight: 800; line-height: 1.25; }
.medal-sub { font-size: 12px; color: #56605A; font-variant-numeric: tabular-nums; }
.medal-sub.ok { color: #2D6FB0; font-weight: 700; }
.ach-cup { width: 18px; height: 18px; fill: none; stroke: #FFFFFF; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 2px; }

/* «Огород Капы»: карточка на главной и игра на весь экран под полосой «Назад» */
.farm-card { background: linear-gradient(135deg, #5FCB45, #2E9A3A); border-color: #2E9A3A; color: #FFFFFF; }
.farm-card .tile-icon { background: rgba(255,255,255,.22); }
.farm-card .tile-icon svg { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.family-card.farm-card .family-sum, .family-card.farm-card .chev { color: #EAF8E4; }
.farm-frame { position: fixed; left: 0; right: 0; top: 52px; bottom: 0; width: 100%; height: calc(100% - 52px); border: 0; display: block; background: #3C8F2E; }

/* «Проверить состав» на 3/4 и «Аллергии» на 1/4 в одном ряду — решение Дмитрия */
.hero-row { display: grid; grid-template-columns: 3fr 1fr; gap: 8px; }
.hero-row .hero { padding: 16px; gap: 12px; min-width: 0; }
.hero-row .hero-icon { width: 48px; height: 48px; }
.allergy-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 4px; color: var(--ink); text-align: center; }
.allergy-tile:active { transform: scale(.97); }
.allergy-tile .tile-icon { position: relative; }
.allergy-tile .tile-icon svg { width: 22px; height: 22px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.allergy-num { position: absolute; top: -7px; right: -9px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #E8577A; color: #FFFFFF; font-size: 12px; font-weight: 800; line-height: 20px; font-variant-numeric: tabular-nums; }
.allergy-cap { font-size: 12px; font-weight: 700; line-height: 1.2; }
.farm-card-wrap .family-sum { white-space: normal; line-height: 1.35; }   /* «Мои бонусы»: подпись про обмен видна целиком */
.checkin-done { color: var(--green); font-weight: 700; }   /* «Сегодня день засчитан ✓» */

/* «ПП-блюдо» в рецептах */
.pp-toggle { display: flex; gap: 12px; align-items: flex-start; background: #FFFFFF; border: 1px solid #E3E7E2; border-radius: 16px; padding: 12px 14px; cursor: pointer; }
.pp-toggle input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: #1F7A5C; flex: none; }
.pp-badge { display: inline-block; vertical-align: 3px; background: #E6F2EC; color: #14533E; border-radius: 99px; padding: 2px 8px; font-size: 12px; font-weight: 800; }

/* «Написать за меня»: поле темы поста */
.w-area { min-height: 84px; padding: 12px 14px; line-height: 1.45; resize: vertical; font: inherit; }

/* поддержка */
.support-link { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; color: #56605A; font-weight: 700; font-size: 14px; text-decoration: none; border: 1px solid #D5DBD6; border-radius: 16px; }   /* рамка, как у карточек (просьба Дмитрия) */
.invite-link { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-bottom: 10px; color: #8A6100; background: #FFF4D6; font: inherit; font-weight: 700; font-size: 14px; border: 1px solid #F0D58C; border-radius: 16px; cursor: pointer; }
.invite-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.support-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sup-auto { background: #E6F2EC; color: #14533E; border-radius: 12px; padding: 8px 12px; }
.sup-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sup-thumb { position: relative; width: 72px; height: 72px; }
.sup-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; display: block; }
.sup-thumb button { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #1B2421; color: #FFFFFF; font-size: 16px; line-height: 1; cursor: pointer; }
.sup-add { min-height: 44px; }
.sup-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid #EEF1ED; color: inherit; text-decoration: none; }
.sup-row:first-child { border-top: 0; }
.sup-prev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-st { flex: none; font-size: 12px; font-weight: 800; border-radius: 99px; padding: 4px 10px; background: #FDF6E3; color: #6B4E00; }
.sup-st.sup-ok { background: #E6F2EC; color: #14533E; }
.sup-thread { display: flex; flex-direction: column; gap: 10px; }
.sup-msg { max-width: 88%; border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.sup-me { align-self: flex-end; background: #E6F2EC; color: #14533E; }
.sup-them { align-self: flex-start; background: #FFFFFF; border: 1px solid #E3E7E2; }
.sup-who { font-weight: 800; color: #1F7A5C; }
.sup-img { width: 100%; max-width: 260px; border-radius: 10px; min-height: 40px; background: #EEF1ED; }
.sup-add svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Капа-ассистент */
.as-card { background: linear-gradient(135deg, #2D6FB0, #4A8FD0); border-color: #2D6FB0; color: #FFFFFF; }
.as-card .tile-icon { background: rgba(255,255,255,.18); }
.as-card .tile-icon svg { fill: #FFFFFF; stroke: none; }
.as-card .family-sum, .as-card .chev { color: #E3EEFA; }
/* нет доступа к ассистенту — серая плитка с замочком */
.as-card.as-locked { background: #ECEEEA; border-color: #E3E7E2; color: #6B746E; }
.as-card.as-locked .tile-icon { background: #DADFD9; }
.as-card.as-locked .tile-icon svg { fill: none; stroke: #6B746E; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.as-card.as-locked .family-sum, .as-card.as-locked .chev { color: #8A938D; }
.as-lock-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.4; }
.perks-link { display: block; font-size: 14px; font-weight: 600; color: #1F7A5C; text-decoration: none; line-height: 1.4; }
.as-screen { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }   /* поле ввода «висит» над меню на 72px — конец переписки не должен прятаться под ним */
.as-compose { position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 72px); background: #F5F6F2; display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.as-row { display: flex; gap: 8px; align-items: center; }
.as-ico { width: 48px; min-width: 48px; height: 48px; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.as-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.as-rec { background: #FCE6EC; color: #D23F66; }
.as-send { flex: 1; }
.as-voice { font-size: 14px; font-weight: 700; color: #14533E; background: #E6F2EC; border-radius: 12px; padding: 8px 12px; }
.as-pic { display: flex; flex-direction: column; gap: 6px; }
.as-video { position: relative; cursor: pointer; max-width: 320px; }
.as-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 50%; background: rgba(20, 83, 62, 0.85); color: #FFFFFF; font-size: 22px; display: flex; align-items: center; justify-content: center; padding-left: 4px; }
.as-pic img, .as-pic video { width: 100%; max-width: 320px; border-radius: 12px; background: #EEF1ED; min-height: 60px; display: block; }
.as-copy { align-self: flex-start; }
/* Капа думает — пузырь в переписке с бегущими точками */
.as-thinking .sup-body { color: #5B6B63; }
.as-dots { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 4px; }
.as-dots i { width: 7px; height: 7px; border-radius: 50%; background: #2D6FB0; animation: as-dot 1.2s infinite ease-in-out; }
.as-dots i:nth-child(2) { animation-delay: .15s; }
.as-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes as-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .as-dots i { animation: none; opacity: .7; } }
.as-send:disabled { opacity: .5; }

/* «Ответить» на картинку в переписке с Капой */
.as-pic-row { display: flex; gap: 6px; flex-wrap: wrap; }
.as-pic img { cursor: pointer; }
.as-picked img { outline: 3px solid #2D6FB0; outline-offset: 2px; }
.as-quote { display: flex; align-items: center; gap: 8px; background: #E9F0F8; border-left: 3px solid #2D6FB0; border-radius: 10px; padding: 6px 8px; }
.as-quote img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: #EEF1ED; flex: none; }
.as-quote .small { flex: 1; min-width: 0; color: #24456B; }
.as-quote .link-btn { font-size: 22px; line-height: 1; padding: 4px 8px; min-height: 44px; }
.sup-me .as-quote { margin-bottom: 6px; }

/* Галерея «Шаблоны» в Капе-ассистенте */
.tpl-open { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
.tpl-open svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tpl-sheet { position: fixed; inset: 0; z-index: 60; background: #F5F6F2; overflow-y: auto; padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 24px); }
.tpl-head { display: flex; align-items: center; justify-content: space-between; }
.tpl-head h2 { margin: 0; font-size: 22px; }
.tpl-head .link-btn { font-size: 30px; line-height: 1; min-width: 44px; min-height: 44px; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tpl-card { display: flex; flex-direction: column; gap: 6px; text-align: left; background: #FFFFFF; border: 1px solid #E3E7E2; border-radius: 16px; padding: 10px; font: inherit; color: #1B2421; cursor: pointer; min-width: 0; }
.tpl-card b { font-size: 15px; }
.tpl-imgs { display: flex; gap: 4px; }
.tpl-imgs img { flex: 1; min-width: 0; height: 150px; object-fit: cover; object-position: top; border-radius: 10px; background: #EEF1ED; }
.tpl-photos { color: #1F7A5C; }

/* «Выдать кабинет» в карточке человека */
.cab-grant { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cab-grant-ok { color: #14533E; background: #E6F4EC; border-radius: 10px; padding: 8px 10px; margin-top: 8px; }

/* «Что Капа обо мне помнит» */
.as-mem { align-self: flex-start; min-height: 44px; font-size: 14px; color: #1F7A5C; }
.mem-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.mem-row { display: flex; align-items: center; gap: 8px; background: #FFFFFF; border: 1px solid #E3E7E2; border-radius: 14px; padding: 10px 12px; }
.mem-row span { flex: 1; min-width: 0; }
.mem-row .link-btn { font-size: 22px; min-width: 44px; min-height: 44px; color: #8A948F; }
.mem-sum { margin: 12px 0; line-height: 1.5; }

/* «Подбор ухода» */
.care-progress { height: 6px; border-radius: 999px; background: #E3E7E2; overflow: hidden; }
.care-progress span { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .25s; }
.care-q { font-size: 20px; line-height: 1.3; text-wrap: balance; }
.care-opts { display: flex; flex-direction: column; gap: 8px; }
.care-opts button { border: 1px solid var(--line); background: #FFFFFF; border-radius: 14px; min-height: 52px; padding: 12px 14px; font-weight: 700; font-size: 15px; text-align: left; color: var(--ink); }
.care-opts button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.care-photo-btn { position: relative; display: flex; align-items: center; justify-content: center; }
.care-type-title { font-size: 26px; font-weight: 800; color: #14533E; }
.care-type .chips { margin-top: 4px; }
.care-part, .care-type { display: flex; flex-direction: column; gap: 10px; }
.care-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.care-steps li { line-height: 1.4; }
.care-steps b { display: block; }
.care-steps span { color: #4B5651; }
.care-prod, .care-set { margin-top: 6px; padding: 8px 10px; background: var(--green-soft); border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.care-prod img, .care-set img { width: 52px; height: 52px; object-fit: contain; background: #FFFFFF; border-radius: 10px; flex: none; }
.care-prod-name { font-weight: 700; line-height: 1.3; color: var(--ink); }
.care-set { background: #FFF4D6; }

/* кабинет: статус человека — явными кнопками */
.cab-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cab-stats button { border: 1px solid var(--line); background: #FFFFFF; border-radius: 12px; min-height: 44px; padding: 6px 4px; font-weight: 700; font-size: 13px; color: var(--ink); }

/* главная: «Капа пишет» + «Капа-ассистент» в одну строку (8.11.2026) */
.home-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; color: var(--ink); }
.pair-title { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pair-title svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pair-title svg.fill { fill: currentColor; stroke: none; }
.pair-sub { font-size: 13px; color: var(--muted, #6B746E); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pair-write .pair-title svg { stroke: #8A6100; }
.pair-as { background: #FFF6DE; border-color: #F3E3B5; color: #6B4B00; }   /* нежно-жёлтая — выбор Дмитрия 8.11.2026 (синий выпадал); «Капа пишет» рядом белая */
.pair-as .pair-title svg.fill { fill: #8A6100; }
.pair-as .pair-sub { color: #8A6E2E; }
.pair-as.pair-locked { background: #ECEEEA; border-color: #E3E7E2; color: #6B746E; }
.pair-as.pair-locked .pair-sub { color: #8A938D; }
@media (max-width: 350px) { .pair-card { padding: 11px 10px; } .pair-title { font-size: 14px; gap: 5px; } .pair-sub { font-size: 12px; } }
.as-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }   /* быстрые ответы под сообщением Капы (8.11.2026) */
.as-choices .btn { min-height: 44px; padding: 0 16px; }
/* кабинет: что человек делал в приложении — плитки с числами (8.11.2026) */
.cab-act { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cab-act div { display: flex; flex-direction: column; gap: 2px; background: #F5F6F2; border-radius: 10px; padding: 7px 6px; text-align: center; min-width: 0; }
.cab-act b { font-size: 17px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.cab-act span { font-size: 11px; line-height: 1.2; color: #6B746E; overflow-wrap: anywhere; }
.cab-act .zero b { color: #A9B0AB; }
@media (max-width: 360px) { .cab-act { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
