/* Полка — бело-зелёное «жидкое стекло» */
:root {
  color-scheme: light;
  --bg: #f3f8f4;
  --ink: #0f2419;
  --muted: #56685e;
  --line: rgba(15, 36, 25, .09);
  --green: #0a8040;          /* текст и кнопки: контраст с белым ≥ 4,5 */
  --green-2: #19a65a;        /* декоративный: кольца, полосы */
  --green-3: #7fd9a1;
  --green-soft: #e2f4e9;
  --green-tint: rgba(25, 166, 90, .1);
  --danger: #c62f2f;
  --danger-soft: #fde8e6;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --glass: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .72));
  --glass-strong: rgba(255, 255, 255, .86);
  --glass-border: rgba(255, 255, 255, .92);
  --shadow: inset 0 1px 1px rgba(255, 255, 255, .95), 0 18px 48px -24px rgba(8, 72, 38, .28), 0 2px 6px -2px rgba(8, 72, 38, .08);
  --shadow-hover: inset 0 1px 1px rgba(255, 255, 255, .95), 0 28px 60px -24px rgba(8, 72, 38, .36), 0 2px 6px -2px rgba(8, 72, 38, .1);
  --r: 26px;
  --side-w: 264px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.6, .5, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 500 16px/1.5 var(--body); overflow-x: hidden;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 52px); letter-spacing: -.03em; }
h2 { font-size: clamp(20px, 2.6vw, 26px); }
h3 { font-size: 18px; font-weight: 500; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.num { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.green { color: var(--green); }
.red { color: var(--danger); }
.ic { flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Фон: мягкие зелёные пятна --- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .7; will-change: transform; }
.bg i:nth-child(1) { width: 620px; height: 620px; left: -220px; top: -200px; background: #bfeccf; animation: f1 26s ease-in-out infinite; }
.bg i:nth-child(2) { width: 520px; height: 520px; right: -180px; top: 120px; background: #d9f3c9; animation: f2 30s ease-in-out infinite; }
.bg i:nth-child(3) { width: 560px; height: 560px; left: 30%; bottom: -260px; background: #b5e8db; animation: f3 34s ease-in-out infinite; }
@keyframes f1 { 50% { transform: translate(140px, 90px) scale(1.12); } }
@keyframes f2 { 50% { transform: translate(-120px, 140px) scale(.9); } }
@keyframes f3 { 33% { transform: translate(90px, -80px) scale(1.1); } 66% { transform: translate(-80px, 40px) scale(.95); } }

/* --- Стекло --- */
.glass, .card {
  position: relative; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: var(--shadow);
}
.card { padding: 24px; overflow: hidden; transition: translate .5s var(--ease), box-shadow .5s var(--ease); }
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .55) 50%, transparent 62%);
  transform: translateX(-130%); animation: sheen 9s ease-in-out infinite;
}
.card.hover:hover, a.card:hover { translate: 0 -4px; box-shadow: var(--shadow-hover); text-decoration: none; }
.card.flat::before { display: none; }
.card.dark { background: #0f2419; color: #fff; border-color: #0f2419; }
.card.dark .muted { color: #b5c9bd; }
.card.green { background: linear-gradient(150deg, #13a356, #0a7a3c); color: #fff; border-color: rgba(255, 255, 255, .25); }
.card.green .muted { color: #d8f5e3; }
.card.pad-lg { padding: 30px; }
.card.pad-sm { padding: 16px; border-radius: 22px; }
.inset { background: rgba(255, 255, 255, .72); border-radius: 20px; padding: 14px 16px; }
@keyframes sheen { 0%, 75% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }

/* --- Сетки --- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.bento { display: grid; gap: 18px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.bento > * { grid-column: span 12; min-width: 0; }
@media (min-width: 1100px) {
  .s3 { grid-column: span 3 !important; } .s4 { grid-column: span 4 !important; } .s5 { grid-column: span 5 !important; }
  .s6 { grid-column: span 6 !important; } .s7 { grid-column: span 7 !important; } .s8 { grid-column: span 8 !important; }
  .r2 { grid-row: span 2; }
}
@media (min-width: 640px) and (max-width: 1099px) { .bento > .m6 { grid-column: span 6; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.stack > * + * { margin-top: 12px; }
.gap-s { gap: 6px; } .gap-l { gap: 18px; }
.mt { margin-top: 22px; } .mt-s { margin-top: 10px; } .mt-l { margin-top: 40px; }
.grow-1 { flex: 1; min-width: 0; }
.section { margin-top: 40px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 28px 0 22px; }
.page-head p { margin-top: 8px; max-width: 44em; }
.eyebrow { font-weight: 700; color: var(--muted); font-size: 15px; }

/* --- Кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent; background: var(--green); color: #fff;
  font: 700 15px/1 var(--body); cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .35), 0 10px 24px -12px rgba(10, 128, 64, .8);
  transition: transform .35s var(--spring), box-shadow .35s var(--ease), background .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px) scale(1.02); }
.btn:active { transform: scale(.95); }
.btn.ghost { background: var(--glass-strong); color: var(--ink); border-color: var(--glass-border); box-shadow: var(--shadow); }
.btn.ghost:hover { background: #fff; }
.btn.light { background: var(--green-soft); color: var(--green); box-shadow: none; }
.btn.dark { background: var(--ink); color: #fff; box-shadow: 0 10px 24px -12px rgba(15, 36, 25, .7); }
.btn.white { background: #fff; color: var(--green); box-shadow: none; }
.btn.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn.xs { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn.icon { width: 46px; padding: 0; }
.btn.sm.icon { width: 38px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 6px; border-radius: 10px; display: inline-flex; }
button.link:hover { color: var(--danger); background: var(--danger-soft); }
form.inline { display: inline; }

/* --- Формы --- */
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; font: 600 16px var(--body); color: var(--ink); background: rgba(255, 255, 255, .85);
  border: 1px solid rgba(15, 36, 25, .12); border-radius: 16px; padding: 12px 14px; min-height: 48px;
  transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green-2); box-shadow: 0 0 0 4px var(--green-tint); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--green); margin: 0; flex: none; }
input[type=file] { padding: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 15px; cursor: pointer; }
.field { margin-bottom: 14px; }
.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); }
.search input { padding-left: 42px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .72); border: 1px solid var(--glass-border); color: var(--ink);
  font-size: 14px; font-weight: 700; cursor: pointer; transition: background .2s, color .2s, transform .3s var(--spring);
}
a.chip:hover { text-decoration: none; background: #fff; }
.chip:active { transform: scale(.95); }
.chip.on, .chip:has(input:checked) { background: var(--green); color: #fff; border-color: var(--green); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .6); border: 1px solid var(--glass-border); gap: 2px; }
.seg a, .seg label { white-space: nowrap; margin: 0; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink); cursor: pointer; }
.seg a.on, .seg label:has(input:checked) { background: var(--ink); color: #fff; text-decoration: none; }
.seg input { position: absolute; opacity: 0; }

/* ================= Оболочка приложения ================= */
.shell { max-width: 1320px; margin: 0 auto; padding: 0 16px; min-width: 0; }
@media (min-width: 700px) { .shell { padding: 0 28px; } }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 600 21px var(--display); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none;
  background: linear-gradient(150deg, #1fb864, #0a7a3c); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .5), 0 6px 14px -6px rgba(10, 128, 64, .9);
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--green-soft); color: var(--green); font: 700 16px var(--display); border: 1px solid #fff;
}
.avatar.sm { width: 38px; height: 38px; font-size: 14px; }
.avatar:hover { text-decoration: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; padding: 6px 12px; border-radius: 999px; background: var(--green-soft); color: var(--green); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Сайдбар ПК --- */
.side {
  position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: var(--side-w); display: flex; flex-direction: column; gap: 14px;
  padding: 22px 14px 14px; background: rgba(255, 255, 255, .72); border-right: 1px solid rgba(15, 36, 25, .06);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
}
.side .logo { padding: 0 8px; }
.side-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 18px;
  background: var(--green); color: #fff; font-weight: 800; font-size: 14px; transition: transform .3s var(--spring), filter .2s;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .35), 0 10px 22px -14px rgba(10, 128, 64, .9);
}
.qa + .qa { background: var(--ink); box-shadow: 0 10px 22px -14px rgba(15, 36, 25, .9); }
.qa:hover { text-decoration: none; transform: translateY(-2px); }
.side-nav { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.side-title { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: var(--ink); font-weight: 700; font-size: 15px; transition: background .2s; }
.side-nav a .ic { color: var(--muted); transition: color .2s; }
.side-nav a:hover { background: rgba(10, 128, 64, .07); text-decoration: none; }
.side-nav a:hover .ic { color: var(--green); }
.side-nav a.on { background: var(--green-soft); color: var(--green); }
.side-nav a.on .ic { color: var(--green); }
.side-nav .new { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 800; padding: 3px 7px; border-radius: 999px; background: var(--ink); color: #fff; }
.side-foot { display: flex; flex-direction: column; gap: 8px; }
.side-premium {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 18px; color: #fff;
  background: linear-gradient(150deg, #13a356, #0a6e37); position: relative; overflow: hidden;
}
.side-premium::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.side-premium b { font: 600 16px var(--display); }
.side-premium .tiny { color: #d8f5e3; font-weight: 700; line-height: 1.35; }
.side-premium:hover { text-decoration: none; filter: brightness(1.05); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; color: var(--ink); }
.side-user:hover, .side-user.on { background: rgba(10, 128, 64, .07); text-decoration: none; }
.side-user > .ic { color: var(--muted); }

/* --- Верхняя строка ПК (в приложении) --- */
.appbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.appbar::before { content: ""; position: absolute; inset: 0 -28px; z-index: -1; background: linear-gradient(var(--bg) 55%, rgba(243, 248, 244, 0)); }
.appbar-search { flex: 1; max-width: 520px; }
.appbar-search input { border-radius: 999px; background: #fff; border-color: rgba(15, 36, 25, .08); min-height: 46px; box-shadow: 0 6px 18px -14px rgba(8, 72, 38, .4); }
.btn.ai-btn { background: linear-gradient(120deg, #0f2419, #1d4a33); box-shadow: 0 10px 24px -12px rgba(15, 36, 25, .8); }
.btn.ai-btn .ic { color: #8ff0b6; }

/* --- Шапка гостя --- */
.topbar { position: sticky; top: 12px; z-index: 40; margin-top: 12px; }
.topbar .glass { border-radius: 999px; padding: 8px 8px 8px 20px; display: flex; align-items: center; gap: 18px; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; }
.nav a { color: var(--ink); padding: 10px 14px; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap; transition: background .2s; }
.nav a:hover { background: rgba(255, 255, 255, .8); text-decoration: none; }
.nav a.on { background: var(--ink); color: #fff; }
.nav-right { display: flex; align-items: center; gap: 8px; }

/* --- Шапка телефона --- */
.topbar-m { display: none; }

/* --- Нижнее меню телефона --- */
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); align-items: flex-end; justify-content: space-around;
  background: rgba(255, 255, 255, .94); border-top: 1px solid rgba(15, 36, 25, .07);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
}
.tabbar a, .tabbar button {
  flex: 1; max-width: 84px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px;
  background: none; border: 0; font: 700 11px var(--body); color: var(--muted); cursor: pointer; border-radius: 14px;
  -webkit-tap-highlight-color: transparent; transition: color .2s, transform .3s var(--spring);
}
.tabbar a:hover { text-decoration: none; }
.tabbar a:active, .tabbar button:active { transform: scale(.92); }
.tabbar .on { color: var(--green); }
.tabbar .on .ic { background: var(--green-soft); border-radius: 999px; padding: 3px 14px; width: 54px; height: 29px; box-sizing: border-box; }
.tabbar .fab {
  flex: none; width: 58px; height: 58px; max-width: none; margin: -24px 4px 4px; padding: 0; border-radius: 20px; justify-content: center;
  color: #fff; background: linear-gradient(150deg, #1fb864, #0a7a3c); border: 3px solid #fff;
  box-shadow: 0 14px 28px -10px rgba(10, 128, 64, .85);
}

/* --- Нижние листы (dialog) --- */
.sheet {
  border: 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); margin: auto auto 0; width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto; border-radius: 28px 28px 0 0; background: #fbfdfb; color: var(--ink);
  box-shadow: 0 -20px 60px -20px rgba(8, 40, 24, .35);
}
.sheet[open] { animation: sheetUp .45s var(--ease) both; }
.sheet::backdrop { background: rgba(10, 30, 20, .38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .3s both; }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-grip { width: 44px; height: 5px; border-radius: 999px; background: rgba(15, 36, 25, .15); margin: 0 auto 14px; }
.sheet h3 { font-family: var(--display); margin-bottom: 14px; }
.sheet .side-title { margin: 14px 4px 8px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.sheet-actions a { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 22px; background: #fff; border: 1px solid rgba(15, 36, 25, .07); color: var(--ink); }
.sheet-actions a:hover { text-decoration: none; border-color: var(--green-2); }
.sheet-actions b { font-size: 15px; margin-top: 4px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 14px 6px; border-radius: 20px; background: #fff; border: 1px solid rgba(15, 36, 25, .07); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.2; }
.sheet-grid a .ic { color: var(--green); }
.sheet-grid a.on { background: var(--green-soft); border-color: transparent; color: var(--green); }
.sheet-grid a:hover { text-decoration: none; }
@media (min-width: 1024px) { .sheet { margin: auto; border-radius: 28px; } }

/* --- Раскладка: ПК с сайдбаром / телефон и планшет --- */
@media (min-width: 1024px) {
  body.app .shell { margin-left: var(--side-w); max-width: calc(1320px + 56px); padding: 0 32px; }
  body.app main { min-height: calc(100vh - 160px); }
}
@media (min-width: 1024px) and (max-width: 1180px) { :root { --side-w: 232px; } .side-nav a { font-size: 14px; } }
@media (max-width: 1023px) {
  .side, .appbar { display: none; }
  .topbar { display: none; }
  .topbar-m {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 40;
    margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: rgba(243, 248, 244, .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
  }
  .topbar-m.scrolled { border-color: rgba(15, 36, 25, .07); box-shadow: 0 6px 20px -16px rgba(8, 40, 24, .5); }
  .topbar-m .logo { font-size: 19px; }
  .topbar-m .logo-mark { width: 32px; height: 32px; border-radius: 11px; }
  body.app .tabbar { display: flex; }
  body.app { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@media (min-width: 700px) and (max-width: 1023px) { .topbar-m { margin: 0 -28px; padding-left: 28px; padding-right: 28px; } }

/* --- Уведомления --- */
.toasts { position: fixed; top: 16px; left: 50%; translate: -50% 0; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100% - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 20px; font-weight: 700;
  background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow-hover);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  animation: toastIn .6s var(--spring) both, toastOut .5s var(--ease) 5.5s forwards;
}
.toast .ic { color: var(--green); }
.toast.error .ic { color: var(--danger); }
.toast.info .ic { color: var(--warn); }
.toast button { margin-left: auto; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-20px); visibility: hidden; } }
.demo-banner { text-align: center; font-size: 13px; font-weight: 700; color: var(--warn); padding: 8px 16px 0; }

/* --- Показатели --- */
.big { font-family: var(--display); font-weight: 600; letter-spacing: -.04em; line-height: 1; font-size: clamp(44px, 6vw, 72px); }
.mid { font-family: var(--display); font-weight: 600; letter-spacing: -.03em; line-height: 1.05; font-size: clamp(26px, 3vw, 34px); }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat b { font-family: var(--display); font-weight: 600; font-size: 28px; letter-spacing: -.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; font-weight: 600; }
.stat .ic-box { margin-bottom: 6px; }
.ic-box { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: none; }
.ic-box.lg { width: 56px; height: 56px; border-radius: 18px; }
.ic-box.white { background: rgba(255, 255, 255, .2); color: #fff; }
.ic-box.danger { background: var(--danger-soft); color: var(--danger); }
.ic-box.warn { background: var(--warn-soft); color: var(--warn); }
.ic-box.dark { background: var(--ink); color: #fff; }

.price { display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 12px; border-radius: 999px; background: var(--green-soft); color: var(--green); font: 600 15px var(--display); white-space: nowrap; }
.price small { font: 700 12px var(--body); color: var(--green); opacity: .85; }
.price.lg { font-size: 26px; padding: 10px 18px; }
.price.dark { background: var(--ink); color: #fff; }
.price.dark small { color: #cfe3d6; }

.kbju { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.kbju div { background: rgba(255, 255, 255, .72); border-radius: 18px; padding: 12px 4px; }
.kbju b { display: block; font: 600 20px var(--display); letter-spacing: -.02em; }
.kbju span { font-size: 12px; color: var(--muted); font-weight: 700; }

.bar { height: 10px; background: rgba(15, 36, 25, .07); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green-2), var(--green-3)); transform-origin: left; animation: grow 1.4s var(--ease) both; }
.bar.over i { background: linear-gradient(90deg, #e56a5a, var(--danger)); }
.bar.lg { height: 18px; }
.bar.liquid i { background-image: linear-gradient(90deg, #0d8c46, #3cc77a, #0d8c46); background-size: 200% 100%; animation: grow 1.4s var(--ease) .3s both, flow 3.5s linear infinite; }
.card.green .kbju div { background: rgba(255, 255, 255, .16); }
.card.green .kbju span { color: #d8f5e3; }
.card.green .bar { background: rgba(255, 255, 255, .22); }
.card.green .bar i { background: #fff; }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes flow { to { background-position: -200% 0; } }
.meter { display: flex; flex-direction: column; gap: 7px; }
.meter .row { font-weight: 700; font-size: 14px; }

.hbar { display: grid; grid-template-columns: minmax(90px, 190px) minmax(0, 1fr) 76px; gap: 12px; align-items: center; }
.hbar .track { height: 28px; border-radius: 10px; background: rgba(15, 36, 25, .06); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--green-2), var(--green-3)); transform-origin: left; animation: grow 1.4s var(--ease) both; }
.hbar .track i.bad { background: linear-gradient(90deg, #f0a093, var(--danger)); }
.hbar .val { text-align: right; font: 600 15px var(--display); }
@media (max-width: 520px) { .hbar { grid-template-columns: 96px minmax(0, 1fr) 56px; gap: 8px; } .hbar .track { height: 22px; } }

.ring { position: relative; display: grid; place-items: center; flex: none; }
.ring svg { display: block; }
.ring .arc { animation: arc 2s var(--ease) .3s both; }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
@keyframes arc { from { stroke-dashoffset: 100; } }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgba(15, 36, 25, .06); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.dark { background: var(--ink); color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.dot.pulse { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(198, 47, 47, .5); } 100% { box-shadow: 0 0 0 10px rgba(198, 47, 47, 0); } }

/* --- Таблицы --- */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.r, th.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: rgba(255, 255, 255, .55); }
.table-wrap { overflow-x: auto; margin: 0 -10px; }
.locked { position: relative; max-height: 200px; overflow: hidden; }
.locked::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent, rgba(255, 255, 255, .95) 85%); pointer-events: none; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 20px; background: rgba(255, 255, 255, .7); }
.list-row + .list-row { margin-top: 8px; }
a.list-row { color: var(--ink); transition: background .2s, transform .3s var(--spring); }
a.list-row:hover { background: #fff; text-decoration: none; transform: translateX(3px); }

/* --- Рецепты --- */
.recipe-card { display: flex; flex-direction: column; gap: 14px; color: var(--ink); }
.recipe-card h3 { font-size: 18px; line-height: 1.25; }
.food {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; flex: none; color: var(--green);
  background: radial-gradient(circle at 30% 25%, #ffffff, #d8f3e2 60%, #bfe9cf);
  box-shadow: inset 0 1px 1px #fff, 0 8px 18px -10px rgba(10, 128, 64, .6);
}
.food.lg { width: 84px; height: 84px; border-radius: 26px; }
.meta { display: flex; gap: 14px; font-size: 14px; color: var(--muted); font-weight: 700; flex-wrap: wrap; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }

/* --- Лендинг --- */
.hero { padding: 48px 0 24px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: center; }
.hero h1 { font-size: clamp(36px, 6vw, 66px); line-height: 1.02; }
.hero .lead { font-size: 19px; color: var(--muted); max-width: 30em; margin-top: 18px; font-weight: 600; }
@media (max-width: 960px) { .hero { grid-template-columns: 1fr; padding-top: 20px; } }
.receipt { font: 600 14px/1.7 ui-monospace, "SFMono-Regular", Menlo, monospace; }
.receipt .line { display: flex; justify-content: space-between; gap: 12px; }
.receipt .sep { border-top: 1.5px dashed rgba(15, 36, 25, .2); margin: 10px 0; }

/* --- Дневник / полка --- */
.water { position: relative; width: 70px; height: 116px; flex: none; border-radius: 12px 12px 28px 28px; border: 2px solid #fff; background: rgba(255, 255, 255, .45); overflow: hidden; box-shadow: inset 0 2px 8px rgba(255, 255, 255, .8), 0 10px 22px -14px rgba(10, 128, 64, .6); }
.water .fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #8fe3b4, #1aa65b); transition: height .9s var(--ease); }
.water .fill svg { position: absolute; left: 0; top: -9px; width: 200%; height: 10px; animation: wave 3.2s linear infinite; }
@keyframes wave { to { transform: translateX(-50%); } }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.day-grid div { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: rgba(255, 255, 255, .7); color: var(--muted); }
.day-grid .ok { background: var(--green); color: #fff; }
.day-grid .miss { background: var(--danger); color: #fff; }
.day-grid .today { outline: 2px solid var(--green); outline-offset: 2px; }

/* --- Режим готовки --- */
.cook .step { min-height: 46vh; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.cook .step-text { font: 500 clamp(22px, 3.6vw, 34px)/1.35 var(--display); letter-spacing: -.02em; }
.timer { font: 600 52px var(--display); letter-spacing: -.03em; }
#scanner { width: 100%; max-width: 440px; border-radius: 20px; overflow: hidden; }
#scanner:empty { display: none; }

/* --- План --- */
.meal-line { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.meal-line:last-of-type { border-bottom: 0; }
.meal-line .food { width: 44px; height: 44px; border-radius: 14px; }

/* --- Админка --- */
.admin { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-top: 24px; }
.admin-side { flex: 1 1 230px; max-width: 260px; padding: 14px; border-radius: 26px; position: sticky; top: 96px; }
.admin-side a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; color: var(--ink); font-weight: 700; font-size: 15px; }
.admin-side a:hover { background: rgba(255, 255, 255, .8); text-decoration: none; }
.admin-side a.on { background: var(--ink); color: #fff; }
.admin-side .count { margin-left: auto; font-size: 12px; background: var(--danger); color: #fff; border-radius: 999px; padding: 1px 7px; }
.admin-main { flex: 999 1 560px; min-width: 0; }
@media (max-width: 1279px) {
  .admin-side { max-width: none; flex-basis: 100%; position: static; display: flex; overflow-x: auto; gap: 4px; padding: 8px; border-radius: 999px; }
  .admin-side a { white-space: nowrap; }
  .admin-side .side-title { display: none; }
}
.spark { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.spark i { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--green-3), var(--green-2)); min-height: 3px; transform-origin: bottom; animation: rise-y 1.2s var(--ease) both; position: relative; }
.spark i:hover { background: var(--green); }
@keyframes rise-y { from { transform: scaleY(0); } }

/* --- Появление --- */
.rise { animation: rise .9s var(--ease) both; }
.rise:nth-child(2) { animation-delay: .06s; } .rise:nth-child(3) { animation-delay: .12s; } .rise:nth-child(4) { animation-delay: .18s; }
.rise:nth-child(5) { animation-delay: .24s; } .rise:nth-child(6) { animation-delay: .3s; } .rise:nth-child(7) { animation-delay: .36s; }
.rise:nth-child(8) { animation-delay: .42s; } .rise:nth-child(n+9) { animation-delay: .48s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.98); } }

footer { margin: 56px 0 28px; color: var(--muted); font-size: 14px; font-weight: 600; }
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
@media print {
  .topbar, .topbar-m, .tabbar, .side, .appbar, .sheet, .noprint, footer, .bg, .toasts, .demo-banner { display: none !important; }
  body { background: #fff; padding: 0; }
  body.app .shell { margin: 0; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  .card::before { display: none; }
}

/* --- Телефон: плотнее --- */
@media (max-width: 640px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .g4 > .card { padding: 16px; border-radius: 22px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 13px; }
  .card { padding: 18px; }
  .card.pad-lg { padding: 20px; }
  .hbar { grid-template-columns: 110px minmax(0, 1fr) 58px; }
  .hbar .tiny { display: none; }
  .page-head { margin: 18px 0 16px; }
  .section { margin-top: 30px; }
}

/* --- Карточка рецепта --- */
.rcard { display: flex; flex-direction: column; padding: 0; color: var(--ink); overflow: hidden; }
.rcard:hover { text-decoration: none; }
.cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 22px; margin: 8px 8px 0; isolation: isolate; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.rcard:hover .cover img { transform: scale(1.05); }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 36, 25, .28), transparent 34%, transparent 58%, rgba(15, 36, 25, .5)); pointer-events: none; }
.cover.ph { display: grid; place-items: center; color: var(--green); }
.cover.ph::after { background: none; }
.cover.ph > svg { width: 34%; height: auto; opacity: .85; filter: drop-shadow(0 10px 18px rgba(10, 128, 64, .25)); transition: transform .8s var(--ease); }
.rcard:hover .cover.ph > svg { transform: scale(1.08) rotate(-4deg); }
.ph-breakfast { background: radial-gradient(circle at 25% 20%, #fff 0, transparent 40%), linear-gradient(150deg, #f1f9df, #cfeeb4); }
.ph-lunch { background: radial-gradient(circle at 25% 20%, #fff 0, transparent 40%), linear-gradient(150deg, #e6f6ec, #b9e7cc); }
.ph-dinner { background: radial-gradient(circle at 25% 20%, #fff 0, transparent 40%), linear-gradient(150deg, #e3f3f0, #b3e0d6); }
.ph-snack { background: radial-gradient(circle at 25% 20%, #fff 0, transparent 40%), linear-gradient(150deg, #f3f8e3, #d9efbb); }
.cover-top { position: absolute; z-index: 2; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 6px; }
.cover-bottom { position: absolute; z-index: 2; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; }
.gchip {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap;
  background: rgba(255, 255, 255, .78); color: var(--ink); border: 1px solid rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
}
.gchip.dark { background: rgba(15, 36, 25, .72); color: #fff; border-color: rgba(255, 255, 255, .18); }
.gchip.green { background: var(--green); color: #fff; border-color: transparent; }
.cover-price { display: inline-flex; flex-direction: column; line-height: 1.05; padding: 8px 12px; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 8px 20px -10px rgba(15, 36, 25, .5); }
.cover-price b { font: 600 19px var(--display); letter-spacing: -.02em; }
.cover-price small { font-size: 11px; font-weight: 800; color: var(--muted); }
.rcard-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.rcard-body h3 { font-size: 17px; line-height: 1.25; font-weight: 600; }
.rcard-sub { font-size: 12.5px; font-weight: 800; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.split { display: flex; height: 8px; border-radius: 999px; overflow: hidden; gap: 2px; background: rgba(15, 36, 25, .05); }
.split i { display: block; height: 100%; transform-origin: left; animation: grow 1.2s var(--ease) both; }
.split .p { background: #0a8040; } .split .f { background: #49c27c; } .split .c { background: #b4e6c6; }
.macros { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.macros b { color: var(--ink); font: 600 16px var(--display); }
.macros .key { display: inline-flex; align-items: center; gap: 4px; }
.macros .key i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.rcard-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
.mini-ava { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--green-soft); color: var(--green); font: 700 11px var(--display); flex: none; }
.have { height: 5px; border-radius: 999px; background: rgba(15, 36, 25, .07); overflow: hidden; width: 56px; display: inline-block; vertical-align: middle; }
.have i { display: block; height: 100%; background: var(--green-2); border-radius: 999px; }

/* --- Страница рецепта: фото и видео --- */
.hero-photo { position: relative; border-radius: 32px; overflow: hidden; aspect-ratio: 21 / 9; box-shadow: var(--shadow-hover); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; animation: zoomIn 1.6s var(--ease) both; }
.hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(10, 30, 20, .78)); }
.hero-photo .over { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: clamp(18px, 3vw, 36px); color: #fff; }
.hero-photo .over h1 { color: #fff; font-size: clamp(26px, 4.4vw, 52px); }
.hero-photo .over .eyebrow { color: #d9efe2; }
@media (max-width: 700px) { .hero-photo { aspect-ratio: 4 / 5; border-radius: 26px; } }
@keyframes zoomIn { from { transform: scale(1.08); } }
.video-box { position: relative; aspect-ratio: 16 / 9; border-radius: 24px; overflow: hidden; background: #0f2419; }
.video-box iframe, .video-box video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --- Загрузка медиа --- */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 200px; padding: 20px;
  border-radius: 22px; border: 2px dashed rgba(10, 128, 64, .3); background: rgba(255, 255, 255, .6); cursor: pointer; overflow: hidden; margin: 0; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--green-2); background: #fff; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img, .drop video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.drop .drop-label { position: relative; z-index: 1; }
.drop.filled .drop-label { background: rgba(255, 255, 255, .88); padding: 8px 14px; border-radius: 999px; margin-top: auto; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* --- Специалисты --- */
.ava { position: relative; width: 64px; height: 64px; border-radius: 22px; flex: none; overflow: visible; }
.ava img, .ava .ini { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: grid; place-items: center; }
.ava .ini { font: 600 24px var(--display); color: #fff; background: linear-gradient(150deg, #2cc06e, #0a6e37); box-shadow: inset 0 1px 1px rgba(255,255,255,.5); }
.ava .ini.t1 { background: linear-gradient(150deg, #45b8a0, #0b6b5a); }
.ava .ini.t2 { background: linear-gradient(150deg, #8fcf5a, #3b8a22); }
.ava .ini.t3 { background: linear-gradient(150deg, #0f2419, #2f5a43); }
.ava .tick { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; border: 3px solid #fff; }
.ava.lg { width: 120px; height: 120px; border-radius: 36px; }
.ava.lg .ini { font-size: 44px; }
.ava.lg .tick { width: 34px; height: 34px; right: -6px; bottom: -6px; }
.ava.sm { width: 40px; height: 40px; border-radius: 14px; }
.ava.sm .ini { font-size: 15px; }
.ava.sm .tick { width: 16px; height: 16px; border-width: 2px; right: -3px; bottom: -3px; }

.stars { display: inline-flex; gap: 1px; color: #f0a91b; vertical-align: -2px; }
.stars .off { color: rgba(15, 36, 25, .15); }
.rating { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.rating b { font: 600 16px var(--display); }

.xbadge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; background: rgba(15, 36, 25, .05); color: var(--ink); white-space: nowrap; }
.xbadge.ok { background: var(--green-soft); color: var(--green); }
.xbadge.dark { background: linear-gradient(150deg, #1d3a2b, #0f2419); color: #ffd56b; }

.ecard { display: flex; flex-direction: column; gap: 14px; color: var(--ink); }
.ecard:hover { text-decoration: none; }
.ecard .who h3 { font-size: 18px; }
.ecard .role { font-size: 13.5px; font-weight: 800; color: var(--green); }
.ecard .headline { font-weight: 600; font-size: 15px; line-height: 1.45; }
.ecard .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.from { font: 600 20px var(--display); letter-spacing: -.02em; white-space: nowrap; }
.rating { white-space: nowrap; flex-wrap: nowrap; }
.gx { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.from small { font: 700 12px var(--body); color: var(--muted); }

.ehero { position: relative; overflow: hidden; }
.ehero::after { content: ""; position: absolute; right: -120px; top: -140px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(25, 166, 90, .22), transparent 65%); pointer-events: none; }
.estats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.estats div { background: rgba(255, 255, 255, .72); border-radius: 20px; padding: 14px; }
.estats b { display: block; font: 600 24px var(--display); letter-spacing: -.02em; }
.estats span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
@media (max-width: 640px) { .estats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.svc { display: flex; flex-direction: column; gap: 14px; }
.svc .incl { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.svc .incl li { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; font-size: 14.5px; }
.svc .incl li .ic { color: var(--green); margin-top: 2px; }
.svc details summary { list-style: none; cursor: pointer; }
.svc details summary::-webkit-details-marker { display: none; }
.svc details[open] summary { display: none; }
.svc .order-form { animation: rise .5s var(--ease) both; }

.rbar { display: grid; grid-template-columns: 34px minmax(0, 1fr) 30px; gap: 10px; align-items: center; font-size: 13px; font-weight: 800; }
.review { padding: 16px 0; border-top: 1px solid var(--line); }
.review:first-child { border-top: 0; padding-top: 0; }
.reply { margin-top: 10px; padding: 12px 14px; border-radius: 16px; background: var(--green-soft); font-size: 14px; }

/* чат заказа */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; padding: 4px; }
.msg { max-width: 78%; padding: 11px 14px; border-radius: 18px; font-size: 15px; font-weight: 600; line-height: 1.45; white-space: pre-line; background: rgba(255, 255, 255, .85); border: 1px solid var(--glass-border); }
.msg.me { align-self: flex-end; background: var(--green); color: #fff; border-color: transparent; border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.sys { align-self: center; max-width: 92%; background: transparent; border: 1px dashed rgba(15, 36, 25, .15); color: var(--muted); font-size: 13px; text-align: center; }
.msg .meta-t { display: block; font-size: 11px; font-weight: 700; opacity: .7; margin-top: 4px; }
.steps-line { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.steps-line div { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.steps-line i { height: 6px; border-radius: 999px; background: rgba(15, 36, 25, .08); }
.steps-line .on i { background: var(--green-2); }
.steps-line .on { color: var(--ink); }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { margin: 0; cursor: pointer; color: rgba(15, 36, 25, .18); transition: color .15s, transform .25s var(--spring); }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f0a91b; }
.star-input label:hover { transform: scale(1.15); }

/* плавные переходы между страницами (Chrome, Edge, Safari 18) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .25s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .35s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
:focus-visible { outline: 3px solid rgba(25, 166, 90, .55); outline-offset: 2px; border-radius: 12px; }

/* --- Телефон и планшет: легче и быстрее --- */
@media (max-width: 1023px) {
  .card { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 255, 255, .92); }
  .card::before { display: none; }
  .bg i { animation: none; opacity: .5; }
  .card.green { background: linear-gradient(150deg, #13a356, #0a7a3c); }
  .card.dark { background: #0f2419; }
  /* ряды чипов и сегменты листаются по горизонтали, а не переносятся */
  .chips.scroll, .page-head .chips, .section-head .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; scroll-snap-type: x proximity; }
  .chips.scroll::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
  .chips.scroll > *, .page-head .chips > * { flex: none; scroll-snap-align: start; }
  .page-head h1 { font-size: clamp(26px, 7vw, 36px); }
  .page-head > .row { width: 100%; }
  .table-wrap { margin: 0 -18px; padding: 0 8px; }
}
/* Липкая панель действий снизу на телефоне: <div class="sticky-cta"> */
.sticky-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.sticky-cta > form { flex: 1 1 200px; }
@media (max-width: 1023px) {
  .sticky-cta {
    display: flex; gap: 8px; position: fixed; z-index: 48; left: 0; right: 0; bottom: calc(70px + env(safe-area-inset-bottom));
    padding: 10px 16px; background: rgba(255, 255, 255, .95); border-top: 1px solid rgba(15, 36, 25, .07);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); animation: sheetUp .5s var(--ease) both;
  }
  body.site .sticky-cta { bottom: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .sticky-cta > * { flex: 1; }
  .has-cta { padding-bottom: 76px; }
}

/* ================= ИИ-нутрициолог ================= */
.ai-hero { background: linear-gradient(140deg, #0f2419 0%, #16402b 60%, #0f5a33 100%); color: #fff; border: 0; }
.ai-hero .muted { color: #b9d6c5; }
.ai-hero::after { content: ""; position: absolute; right: -80px; top: -100px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(127, 217, 161, .35), transparent 65%); pointer-events: none; }
.ai-orb { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; flex: none; color: #0f2419;
  background: conic-gradient(from 200deg, #7fd9a1, #e9ffb8, #42c07a, #7fd9a1); box-shadow: 0 0 0 4px rgba(127, 217, 161, .18), 0 10px 30px -8px rgba(127, 217, 161, .7);
  animation: orb 6s linear infinite; }
.ai-orb .ic { animation: orb 6s linear infinite reverse; }
.ai-orb.sm { width: 34px; height: 34px; border-radius: 12px; box-shadow: none; }
@keyframes orb { to { transform: rotate(360deg); } }
.ai-chat { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 8px; }
.bubble { max-width: min(720px, 88%); padding: 13px 16px; border-radius: 22px; font-size: 15.5px; line-height: 1.55; font-weight: 600; animation: rise .5s var(--ease) both; }
.bubble p + p, .bubble p + ul, .bubble ul + p, .bubble p + ol, .bubble ol + p { margin-top: 8px; }
.bubble ul, .bubble ol { margin: 4px 0 0; padding-left: 20px; }
.bubble li + li { margin-top: 4px; }
.bubble.me { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 8px; white-space: pre-line; }
.bubble.bot { align-self: flex-start; background: #fff; border: 1px solid rgba(15, 36, 25, .07); border-bottom-left-radius: 8px; box-shadow: 0 10px 30px -22px rgba(8, 72, 38, .5); }
.bot-row { display: flex; gap: 10px; align-items: flex-end; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-2); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.composer { position: sticky; bottom: 16px; z-index: 30; display: flex; gap: 8px; align-items: flex-end; padding: 8px; border-radius: 26px; background: #fff; border: 1px solid rgba(15, 36, 25, .08); box-shadow: 0 18px 40px -22px rgba(8, 72, 38, .55); }
.composer textarea { border: 0; min-height: 46px; max-height: 180px; resize: none; background: transparent; padding: 12px 10px; box-shadow: none !important; }
.composer .btn { flex: none; }
@media (max-width: 1023px) { .composer { bottom: calc(80px + env(safe-area-inset-bottom)); } }
.qchips { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1023px) { .qchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; } .qchips > * { flex: none; } }
.qchip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 16px; background: #fff; border: 1px solid rgba(15, 36, 25, .08); font: 700 14px var(--body); color: var(--ink); cursor: pointer; text-align: left; transition: border-color .2s, transform .3s var(--spring); }
.qchip .ic { color: var(--green); }
.qchip:hover { border-color: var(--green-2); }
.qchip:active { transform: scale(.96); }
.tip-card { display: flex; gap: 14px; align-items: flex-start; }
.tip-card .tip-text { font-weight: 700; font-size: 15.5px; line-height: 1.5; }
.skeleton { display: block; height: 14px; border-radius: 8px; background: linear-gradient(90deg, rgba(15,36,25,.06), rgba(15,36,25,.12), rgba(15,36,25,.06)); background-size: 200% 100%; animation: flow 1.4s linear infinite; }
.skeleton + .skeleton { margin-top: 8px; width: 70%; }
.badge.green { background: var(--green-soft); color: var(--green); }
.btn .typing i { background: #fff; }

@media (max-width: 1023px) { .hide-m { display: none !important; } }
@media (min-width: 1024px) { .hide-d { display: none !important; } }
.ai-hero .skeleton { background-image: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.22), rgba(255,255,255,.08)); }
a.card.ai-hero:hover { translate: 0 -3px; }

@media (min-width: 1024px) { .ai-main { min-height: calc(100vh - 200px); } }
.side-nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Фильтры: на телефоне без карточки, поиск во всю ширину, чипы листаются */
@media (max-width: 1023px) {
  .filters { background: none !important; border: 0; box-shadow: none; padding: 0; overflow: visible; }
  .filters > .row { flex-wrap: wrap; }
  .filters .search { flex: 1 1 100%; }
  .filters select { max-width: none !important; flex: 1; min-width: 0; }
  .filters .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
  .filters .chips::-webkit-scrollbar { display: none; }
  .filters .chips > * { flex: none; }
  .filters .chip:not(.on):not(:has(input:checked)) { background: #fff; }
  .page-head > .row .btn { min-height: 42px; padding: 0 16px; font-size: 14px; }
}
@media (max-width: 640px) { .g4.one-m { grid-template-columns: 1fr; gap: 0; } }
