/* Рацион. Все правила ограничены контейнером .rc, чтобы не конфликтовать с темой сайта. */
.rc:not(#_) {
  --bg: #FFFFFF; --card: #F6F6F7; --card2: #ECECEE; --ink: #0B0B0C; --muted: #6E6E78; --line: #E6E6EA;
  --accent: #1FA35B; --accent-ink: #14804A; --accent-soft: #E3F4EA; --warn: #E0892B; --red: #D9483B;
  --btn: #0B0B0C; --btn-ink: #FFFFFF;
  --glass: rgba(255, 255, 255, .62); --glass-edge: rgba(255, 255, 255, .9); --lens: rgba(11, 11, 12, .07);
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --spring: cubic-bezier(.32, 1.25, .45, 1); --ease: cubic-bezier(.25, .8, .3, 1);
  --tw: min(68px, calc((100vw - 36px) / 5));
  font: 500 15px/1.45 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; text-align: left; letter-spacing: 0;
}
.rc:not(#_)[data-theme="dark"] {
  --bg: #0A0A0B; --card: #151517; --card2: #202023; --ink: #F4F4F5; --muted: #9A9AA4; --line: #28282C;
  --accent: #3DDC84; --accent-ink: #62E6A0; --accent-soft: #11301F; --warn: #F0A24E; --red: #F0786B;
  --btn: #F4F4F5; --btn-ink: #0A0A0B;
  --glass: rgba(26, 26, 29, .6); --glass-edge: rgba(255, 255, 255, .16); --lens: rgba(255, 255, 255, .1);
}
.rc:not(#_).rc-root { background: var(--bg); min-height: calc(100vh + 1px); min-height: calc(100dvh + 1px); width: 100%; transition: background .35s, color .35s; }
.rc:not(#_) *, .rc:not(#_) *::before, .rc:not(#_) *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.rc:not(#_) button { appearance: none; -webkit-appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 0; box-shadow: none; text-transform: none; letter-spacing: inherit; min-height: 0; min-width: 0; width: auto; line-height: inherit; text-decoration: none; outline: none; }
.rc:not(#_) input, .rc:not(#_) textarea, .rc:not(#_) select { font: inherit; color: inherit; margin: 0; box-shadow: none; min-height: 0; max-width: none; letter-spacing: inherit; }
.rc:not(#_) h1, .rc:not(#_) h2, .rc:not(#_) h3, .rc:not(#_) p, .rc:not(#_) ol, .rc:not(#_) li { margin: 0; padding: 0; font-family: inherit; color: inherit; text-transform: none; letter-spacing: inherit; list-style: none; }
.rc:not(#_) label { margin: 0; font-weight: inherit; }
.rc:not(#_) b { font-weight: 600; }
.rc:not(#_) img { max-width: none; border: 0; box-shadow: none; }
.rc:not(#_) [hidden] { display: none !important; }
.rc:not(#_) svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.rc:not(#_) #rc-view { max-width: 520px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(124px + var(--kbh, 0px) + env(safe-area-inset-bottom)); }
.rc:not(#_) #rc-view.enter > * { animation: rc-rise .5s var(--ease) both; animation-delay: calc(var(--n, 0) * 50ms); }
.rc:not(#_) #rc-view.enter > :nth-child(2) { --n: 1 } .rc:not(#_) #rc-view.enter > :nth-child(3) { --n: 2 } .rc:not(#_) #rc-view.enter > :nth-child(4) { --n: 3 }
.rc:not(#_) #rc-view.enter > :nth-child(5) { --n: 4 } .rc:not(#_) #rc-view.enter > :nth-child(6) { --n: 5 } .rc:not(#_) #rc-view.enter > :nth-child(n+7) { --n: 6 }
@keyframes rc-rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes rc-pop { 40% { transform: scale(1.2); } }
@keyframes rc-fade { from { opacity: 0; } }
@keyframes rc-up { from { transform: translateY(100%); } }
@keyframes rc-down { to { transform: translateY(100%); } }
@keyframes rc-squish { 40% { scale: .9 .9; } }
@keyframes rc-blink { 0%, 80%, 100% { opacity: .25; transform: scale(.8) } 40% { opacity: 1; transform: scale(1) } }
@media (prefers-reduced-motion: reduce) { .rc:not(#_) *, .rc:not(#_) *::before { animation: none !important; transition: none !important; } }

/* Шапка */
.rc:not(#_) .top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.rc:not(#_) .logo { width: 38px; height: 38px; border-radius: 11px; display: block; }
.rc:not(#_) .grow { flex: 1; min-width: 0; }
.rc:not(#_) .eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rc:not(#_) .brand { font-size: 17px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.rc:not(#_) .icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); color: var(--ink); transition: transform .25s var(--spring), background .2s; flex: none; }
.rc:not(#_) .icon-btn:active { transform: scale(.88); background: var(--card); }
.rc:not(#_) .icon-btn svg.i { width: 19px; height: 19px; }
.rc:not(#_) .hello { font-size: 30px; font-weight: 700; line-height: 1.12; letter-spacing: -.035em; margin-bottom: 6px; text-wrap: balance; }
.rc:not(#_) .sub { color: var(--muted); margin-bottom: 20px; }
.rc:not(#_) h2.sec { font-size: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; margin: 30px 2px 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rc:not(#_) h2.sec small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* Карточки */
.rc:not(#_) .card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.rc:not(#_) .summary { display: flex; align-items: center; gap: 18px; }
.rc:not(#_) .ring { position: relative; width: 120px; height: 120px; flex: none; }
.rc:not(#_) .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.rc:not(#_) .ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.rc:not(#_) .ring .bg { stroke: var(--card2); }
.rc:not(#_) .ring .fg { stroke: var(--accent); transition: stroke-dashoffset 1.1s var(--ease), stroke .3s; }
.rc:not(#_) .ring .fg.over { stroke: var(--warn); }
.rc:not(#_) .ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.rc:not(#_) .ring b { font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; display: block; }
.rc:not(#_) .ring span { font-size: 11px; color: var(--muted); margin-top: 4px; display: block; }
.rc:not(#_) .stat-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.rc:not(#_) .stat-line span { color: var(--muted); } .rc:not(#_) .stat-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc:not(#_) .bar { height: 5px; border-radius: 3px; background: var(--card2); overflow: hidden; margin-bottom: 12px; }
.rc:not(#_) .bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); width: 0; transition: width 1s var(--ease); }
.rc:not(#_) .bar.clay i { background: var(--ink); }
.rc:not(#_) .macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.rc:not(#_) .macros b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.02em; } .rc:not(#_) .macros span { font-size: 11px; color: var(--muted); }

.rc:not(#_) .pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 24px; background: var(--btn); color: var(--btn-ink); font-weight: 600; font-size: 14px; cursor: pointer; transition: transform .25s var(--spring), opacity .2s; white-space: nowrap; }
.rc:not(#_) .pill:active { transform: scale(.96); } .rc:not(#_) .pill[disabled] { opacity: .35; }
.rc:not(#_) .pill.soft { background: var(--card2); color: var(--ink); }
.rc:not(#_) .pill.ghost { background: transparent; color: var(--muted); font-weight: 500; }
.rc:not(#_) .pill.wide { width: 100%; } .rc:not(#_) .pill.sm { height: 38px; padding: 0 15px; font-size: 13px; }
.rc:not(#_) .pill svg.i { width: 18px; height: 18px; }
.rc:not(#_) .row { display: flex; gap: 10px; align-items: center; }

/* Фото блюд */
.rc:not(#_) .ph { background: var(--card2) center/cover no-repeat; }
.rc:not(#_) .hero { position: relative; border-radius: 24px; overflow: hidden; display: block; width: 100%; text-align: left; transition: transform .35s var(--spring); }
.rc:not(#_) .hero:active { transform: scale(.975); }
.rc:not(#_) .hero .ph { aspect-ratio: 4 / 3.1; }
.rc:not(#_) .hero .cap { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 13px 16px; border-radius: 18px; color: var(--ink);
  background: var(--glass); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 1px rgba(255, 255, 255, .12); display: flex; align-items: center; gap: 10px; }
.rc:not(#_) .hero .cap h3 { font-size: 16px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; } .rc:not(#_) .hero .cap p { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.rc:not(#_) .hero .go { width: 36px; height: 36px; border-radius: 50%; background: var(--btn); color: var(--btn-ink); display: grid; place-items: center; flex: none; }
.rc:not(#_) .hero .go svg.i { width: 18px; height: 18px; }

.rc:not(#_) .list { display: grid; gap: 8px; }
.rc:not(#_) .meal { display: flex; align-items: center; gap: 13px; padding: 10px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); text-align: left; width: 100%; cursor: pointer; transition: transform .3s var(--spring), opacity .3s; }
.rc:not(#_) .meal:active { transform: scale(.98); }
.rc:not(#_) .meal .ph { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.rc:not(#_) .meal .ph.none { display: grid; place-items: center; color: var(--muted); }
.rc:not(#_) .meal h3 { font-size: 14.5px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; } .rc:not(#_) .meal p { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.rc:not(#_) .meal .k { font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.rc:not(#_) .meal.skipped { opacity: .45; } .rc:not(#_) .meal.skipped h3 { text-decoration: line-through; }
.rc:not(#_) .chk { width: 32px; height: 32px; border-radius: 50%; border: 1.6px solid var(--line); background: var(--bg); display: grid; place-items: center; color: transparent; flex: none; transition: background .25s, border-color .25s, color .25s; }
.rc:not(#_) .chk svg.i { width: 17px; height: 17px; stroke-width: 2.6; }
.rc:not(#_) .chk.on { background: var(--accent); border-color: var(--accent); color: #fff; animation: rc-pop .4s var(--spring); }
.rc:not(#_)[data-theme="dark"] .chk.on { color: #06210F; }
.rc:not(#_) .tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.rc:not(#_) .tag.off { background: var(--card2); color: var(--muted); }
.rc:not(#_) .empty { text-align: center; color: var(--muted); padding: 20px 10px; font-size: 13px; }

/* Навигация по неделям и дням */
.rc:not(#_) .nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.rc:not(#_) .nav .mid { flex: 1; text-align: center; } .rc:not(#_) .nav .mid b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.02em; } .rc:not(#_) .nav .mid span { font-size: 12px; color: var(--muted); }
.rc:not(#_) .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.rc:not(#_) .day { padding: 9px 0 8px; border-radius: 14px; text-align: center; background: var(--card); border: 1px solid var(--line); transition: transform .3s var(--spring), background .25s, color .25s; }
.rc:not(#_) .day:active { transform: scale(.9); }
.rc:not(#_) .day span { display: block; font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rc:not(#_) .day b { font-size: 16px; font-weight: 700; }
.rc:not(#_) .day.on { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); } .rc:not(#_) .day.on span { color: inherit; opacity: .65; }
.rc:not(#_) .day.today:not(.on) b { color: var(--accent-ink); }
.rc:not(#_) .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 16px; background: var(--card2); margin-bottom: 16px; }
.rc:not(#_) .seg button { height: 36px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background .25s, color .25s, box-shadow .25s; }
.rc:not(#_) .seg button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* Покупки */
.rc:not(#_) .group { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 4px 14px; margin-bottom: 12px; }
.rc:not(#_) .gtitle { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 20px 4px 8px; }
.rc:not(#_) .srow { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rc:not(#_) .srow:last-child { border-bottom: 0; }
.rc:not(#_) .srow .t { font-size: 14px; font-weight: 600; line-height: 1.25; transition: opacity .25s; } .rc:not(#_) .srow .s { font-size: 12px; color: var(--muted); margin-top: 1px; }
.rc:not(#_) .srow.done .t { opacity: .4; text-decoration: line-through; }
.rc:not(#_) .srow .chk { width: 28px; height: 28px; } .rc:not(#_) .srow .chk svg.i { width: 15px; height: 15px; }
.rc:not(#_) .price { display: flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 0 10px; height: 38px; flex: none; }
.rc:not(#_) .price input { width: 60px; height: auto; border: 0; padding: 0; border-radius: 0; background: none; text-align: right; outline: none; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; }
.rc:not(#_) .price span { color: var(--muted); font-size: 13px; }
.rc:not(#_) .del { color: var(--muted); width: 30px; height: 30px; display: grid; place-items: center; flex: none; } .rc:not(#_) .del svg.i { width: 17px; height: 17px; }
.rc:not(#_) .total { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rc:not(#_) .total b { font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; } .rc:not(#_) .total span:not(.tag) { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }

/* Статистика */
.rc:not(#_) .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.rc:not(#_) .tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 12px; }
.rc:not(#_) .tile b { display: block; font-size: 20px; font-weight: 700; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; } .rc:not(#_) .tile span { font-size: 11px; color: var(--muted); line-height: 1.3; display: block; margin-top: 5px; }
.rc:not(#_) .chart { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; height: 150px; align-items: end; margin-top: 14px; }
.rc:not(#_) .chart .col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.rc:not(#_) .chart .v { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc:not(#_) .chart .b { width: 100%; max-width: 28px; border-radius: 7px 7px 3px 3px; background: var(--accent); height: 0; transition: height .9s var(--ease); min-height: 3px; }
.rc:not(#_) .chart .b.zero { background: var(--card2); } .rc:not(#_) .chart .b.clay { background: var(--warn); }
.rc:not(#_) .chart .goal { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--muted); opacity: .45; pointer-events: none; }
.rc:not(#_) .xlabels { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; text-align: center; font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.rc:not(#_) .hbar { margin-bottom: 12px; } .rc:not(#_) .hbar:last-child { margin-bottom: 0; } .rc:not(#_) .hbar .bar { margin: 0; height: 7px; border-radius: 4px; }
.rc:not(#_) .note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* Нижнее меню — жидкое стекло */
.rc:not(#_) .tabbar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9990;
  display: flex; padding: 6px; margin: 0; border-radius: 34px; isolation: isolate; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 45%), var(--glass);
  backdrop-filter: blur(26px) saturate(190%) brightness(1.04); -webkit-backdrop-filter: blur(26px) saturate(190%) brightness(1.04);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .07),
    inset 0 1.5px 0 var(--glass-edge), inset 0 -1px 0 rgba(255, 255, 255, .1), inset 0 0 0 1px rgba(128, 128, 128, .16), inset 0 -10px 18px -12px rgba(255, 255, 255, .3); }
.rc:not(#_) .tabbar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(120% 70% at 20% -10%, rgba(255, 255, 255, .34), transparent 55%), radial-gradient(90% 60% at 90% 115%, rgba(255, 255, 255, .14), transparent 60%); mix-blend-mode: soft-light; }
.rc:not(#_) .tabbar .lens { position: absolute; z-index: 1; top: 6px; left: 6px; width: var(--tw); height: calc(100% - 12px); border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .1)), var(--lens);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 1px rgba(255, 255, 255, .25), inset 0 0 0 1px rgba(128, 128, 128, .12), 0 3px 10px rgba(0, 0, 0, .1);
  transform: translateX(calc(var(--i, 0) * var(--tw))); transition: transform .42s cubic-bezier(.3, .75, .25, 1); }
.rc:not(#_)[data-theme="dark"] .tabbar .lens { background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .03)), var(--lens); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .07); }
.rc:not(#_) .tabbar .lens.squish { animation: rc-squish .55s var(--ease); }
.rc:not(#_) .tab { position: relative; z-index: 2; width: var(--tw); height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 9.5px; font-weight: 600; transition: color .3s, transform .3s var(--spring); }
.rc:not(#_) .tab:active { transform: scale(.88); }
.rc:not(#_) .tab svg.i { width: 22px; height: 22px; transition: transform .45s var(--spring); }
.rc:not(#_) .tab.on { color: var(--ink); } .rc:not(#_) .tab.on svg.i { transform: translateY(-1px) scale(1.08); }

/* Шторка */
.rc:not(#_) .sheet-wrap { position: fixed; inset: 0; z-index: 9995; display: flex; align-items: flex-end; justify-content: center; padding-bottom: var(--kbh, 0px); transition: padding-bottom .25s; }
.rc:not(#_) .backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: rc-fade .3s both; }
.rc:not(#_) .sheet { position: relative; width: 100%; max-width: 520px; max-height: calc(92vh - var(--kbh, 0px)); max-height: calc(92dvh - var(--kbh, 0px)); overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); animation: rc-up .5s var(--spring) both; overscroll-behavior: contain; }
.rc:not(#_) .sheet-wrap.closing .sheet { animation: rc-down .28s ease-in both; } .rc:not(#_) .sheet-wrap.closing .backdrop { animation: rc-fade .28s reverse both; }
.rc:not(#_) .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.rc:not(#_) .sheet .head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; } .rc:not(#_) .sheet .head h2 { font-size: 22px; font-weight: 700; line-height: 1.15; letter-spacing: -.03em; flex: 1; }
.rc:not(#_) .sheet .cover { aspect-ratio: 16 / 10; border-radius: 20px; margin-bottom: 14px; }
.rc:not(#_) .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.rc:not(#_) .sheet h3.sub3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 22px 0 8px; display: flex; justify-content: space-between; align-items: baseline; }
.rc:not(#_) .sheet h3.sub3 small { font-size: 12px; font-weight: 500; color: var(--muted); }
.rc:not(#_) .ing { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; } .rc:not(#_) .ing span { color: var(--muted); }
.rc:not(#_) ol.steps { counter-reset: s; }
.rc:not(#_) ol.steps li { counter-increment: s; position: relative; padding: 2px 0 12px 38px; font-size: 14px; line-height: 1.5; }
.rc:not(#_) ol.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--card2); color: var(--ink); font-size: 12px; font-weight: 700; line-height: 26px; text-align: center; }
.rc:not(#_) .actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.rc:not(#_) .hidden-act { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .4s var(--ease), opacity .3s, margin .3s; }
.rc:not(#_) .hidden-act.show { max-height: 60px; opacity: 1; margin-top: 10px; }

.rc:not(#_) .field { display: block; margin-bottom: 12px; } .rc:not(#_) .field > span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 0 4px 6px; }
.rc:not(#_) .input { display: block; width: 100%; height: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px; outline: none; font-size: 16px; font-weight: 500; line-height: 1.3; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
.rc:not(#_) .input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--card2); }
.rc:not(#_) .input::placeholder { color: var(--muted); opacity: .7; }
.rc:not(#_) textarea.input { min-height: 92px; resize: none; }
.rc:not(#_) .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rc:not(#_) .check { display: flex; align-items: center; gap: 12px; padding: 14px 15px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); margin-bottom: 12px; cursor: pointer; }
.rc:not(#_) .check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }
.rc:not(#_) .check b { display: block; font-size: 14px; } .rc:not(#_) .check small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.rc:not(#_) .pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.rc:not(#_) .pcell { display: block; cursor: pointer; transition: transform .25s var(--spring); } .rc:not(#_) .pcell:active { transform: scale(.94); }
.rc:not(#_) .pcell .ph { aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line); }
.rc:not(#_) .pcell span { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.25; }
.rc:not(#_) .shot { position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 12px; } .rc:not(#_) .shot img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.rc:not(#_) .shot .icon-btn { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; }
.rc:not(#_) .drop { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.rc:not(#_) .drop label { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 8px; border-radius: 20px; background: var(--card); border: 1.5px dashed var(--line); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; transition: transform .25s var(--spring); }
.rc:not(#_) .drop label:active { transform: scale(.95); }
.rc:not(#_) .thinking { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 13px; margin-top: 12px; }
.rc:not(#_) .dots i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 4px; animation: rc-blink 1.2s infinite both; }
.rc:not(#_) .dots i:nth-child(2) { animation-delay: .2s } .rc:not(#_) .dots i:nth-child(3) { animation-delay: .4s }
.rc:not(#_) .err { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); font-size: 13px; margin-top: 12px; }
.rc:not(#_) .result { animation: rc-rise .5s var(--ease) both; margin-top: 14px; }
.rc:not(#_) .result .big { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.04em; } .rc:not(#_) .result .big small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.rc:not(#_) .toast { position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 9999; background: var(--btn); color: var(--btn-ink); padding: 11px 18px; border-radius: 22px; font-size: 13px; font-weight: 600; animation: rc-rise .35s var(--ease) both; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }

/* Чат с помощником */
.rc:not(#_) .sheet.chat { display: flex; flex-direction: column; height: calc(92vh - var(--kbh, 0px)); height: calc(92dvh - var(--kbh, 0px)); overflow: hidden; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.rc:not(#_) .sheet.chat .head { margin-bottom: 8px; }
.rc:not(#_) .msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 0 12px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.rc:not(#_) .msg { max-width: 86%; padding: 11px 14px; border-radius: 20px; font-size: 14px; line-height: 1.45; animation: rc-rise .35s var(--ease) both; flex: none; }
.rc:not(#_) .msg.me { align-self: flex-end; background: var(--btn); color: var(--btn-ink); border-bottom-right-radius: 6px; }
.rc:not(#_) .msg.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.rc:not(#_) .msg img { display: block; width: 190px; max-width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; margin-bottom: 8px; }
.rc:not(#_) .msg img:last-child { margin-bottom: 0; }
.rc:not(#_) .msg .bad { color: var(--red); }
.rc:not(#_) .food { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); min-width: 228px; }
.rc:not(#_) .food b { font-size: 14px; display: block; }
.rc:not(#_) .food .big { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 8px; }
.rc:not(#_) .food .big small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.rc:not(#_) .food .pill { margin-top: 10px; }
.rc:not(#_) .chat-empty { margin: auto; text-align: center; padding: 10px 14px; color: var(--muted); font-size: 13px; }
.rc:not(#_) .chat-empty svg.i { width: 30px; height: 30px; color: var(--ink); margin: 0 auto 10px; display: block; }
.rc:not(#_) .chat-empty b { display: block; color: var(--ink); font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.rc:not(#_) .hints { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; }
.rc:not(#_) .hints button { padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 12px; font-weight: 500; transition: transform .2s var(--spring); }
.rc:not(#_) .hints button:active { transform: scale(.94); }
.rc:not(#_) .composer { border-top: 1px solid var(--line); padding-top: 10px; flex: none; }
.rc:not(#_) .composer .row { align-items: flex-end; gap: 8px; }
.rc:not(#_) .composer textarea.input { min-height: 44px; height: 44px; max-height: 110px; padding: 11px 15px; border-radius: 22px; font-size: 15px; flex: 1; }
.rc:not(#_) .composer .icon-btn { width: 44px; height: 44px; cursor: pointer; }
.rc:not(#_) .composer .send { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.rc:not(#_) .shot.sm { width: 64px; height: 64px; border-radius: 14px; margin: 0 0 8px 52px; }
.rc:not(#_) .shot.sm img { width: 100%; height: 100%; max-height: none; }
.rc:not(#_) .shot.sm button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.rc:not(#_) .shot.sm button svg.i { width: 12px; height: 12px; }

/* Вода */
.rc:not(#_) .water { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 14px 16px; }
.rc:not(#_) .water .wi { width: 38px; height: 38px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.rc:not(#_) .water .wi svg.i { width: 18px; height: 18px; }
.rc:not(#_) .water .icon-btn { width: 36px; height: 36px; }

/* Клавиатура приложения */
.rc:not(#_) .kb { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9997; padding: 8px 3px calc(8px + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%); border-top: 1px solid var(--line); animation: rc-up .28s var(--ease) both; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.rc:not(#_) .kb-in { max-width: 520px; margin: 0 auto; }
.rc:not(#_) .kb-row { display: flex; justify-content: center; gap: 4px; margin-bottom: 7px; padding: 0 2px; }
.rc:not(#_) .kb-row:last-child { margin-bottom: 0; }
.rc:not(#_) .kb-row.mid { padding: 0 14px; }
.rc:not(#_) .key { flex: 1 1 0; max-width: 40px; height: 44px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 17px; font-weight: 500; display: grid; place-items: center; transition: transform .1s, background .1s; }
.rc:not(#_) .key.fn { flex: 1.5 1 0; max-width: none; background: var(--card2); font-size: 13px; font-weight: 600; }
.rc:not(#_) .key.fn svg.i { width: 20px; height: 20px; }
.rc:not(#_) .key.space { flex: 5 1 0; max-width: none; font-size: 13px; color: var(--muted); }
.rc:not(#_) .key.act { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.rc:not(#_) .key.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.rc:not(#_) .key.hit { transform: scale(.9); background: var(--card2); }
.rc:not(#_) .key.act.hit { background: var(--btn); opacity: .8; }
.rc:not(#_) .kb-num { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 6px; margin-bottom: 7px; }
.rc:not(#_) .kb-num .key { max-width: none; height: 50px; font-size: 22px; font-weight: 600; }
.rc:not(#_) .kb-num + .kb-row { padding: 0 6px; }
