/* ===== «Щепотка» — тёплый кулинарный дизайн, светлая и тёмная тема ===== */
:root {
  --brand: #f2542d; --brand-2: #ff7d54; --brand-dark: #d63f1a; --herb: #2f9e5b; --herb-soft: #e7f6ec;
  --brand-soft: #fff0eb; --brand-ring: rgba(242, 84, 45, .25);
  --bg: #ffffff; --bg-2: #f6f6f8; --surface: #ffffff; --surface-2: #f2f2f5; --surface-3: #ebebef;
  --text: #17171c; --text-2: #55555f; --text-3: #8b8b96; --border: #ececf0;
  --green: #22a55a; --yellow: #e9a100; --red: #e5484d;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 8px 24px rgba(20, 20, 30, .06);
  --shadow-lg: 0 24px 60px rgba(20, 20, 30, .18);
  --r: 20px; --r-sm: 12px;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --brand-soft: #2c1912; --brand-ring: rgba(242, 84, 45, .35); --herb-soft: #13291c;
  --bg: #111113; --bg-2: #161619; --surface: #1c1c20; --surface-2: #232328; --surface-3: #2c2c32;
  --text: #f3f3f5; --text-2: #b4b4be; --text-3: #7c7c88; --border: #2a2a30;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; transition: background .25s, color .25s; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 900; letter-spacing: -.01em; }
.container { max-width: 1720px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 56px); }
.muted { color: var(--text-3); }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 800; font-size: 14px; background: var(--surface-2); color: var(--text); transition: transform .15s, background .2s, box-shadow .2s, opacity .2s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(242, 84, 45, .3); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: var(--brand-soft); filter: brightness(.97); }
.btn-danger { background: rgba(229, 72, 77, .12); color: var(--red); }
.btn-danger:hover { background: rgba(229, 72, 77, .2); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 15px; }
.btn-icon { width: 42px; padding: 0; }
.btn-sm.btn-icon { width: 34px; }
.btn .plus { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--brand); display: grid; place-items: center; margin-left: -8px; }
.btn.active { background: var(--brand); color: #fff; }

/* ---------- Шапка ---------- */
.header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.header > .container { max-width: none; }
.header-top { display: grid; grid-template-columns: 1fr minmax(280px, 640px) 1fr; align-items: center; gap: 24px; height: 72px; }
.header-top .logo { justify-self: start; }
.header-top .search { justify-self: center; width: 100%; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 22px; letter-spacing: -.02em; flex: none; }
.logo-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(242, 84, 45, .35); }
.logo-mark svg { width: 22px; height: 22px; stroke-width: 2.4; }
.search { position: relative; }
.search input { width: 100%; height: 44px; border-radius: 999px; border: 1.5px solid transparent; background: var(--surface-2); padding: 0 70px 0 44px; outline: none; transition: border .2s, background .2s; }
.search input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-ring); }
.search > svg { position: absolute; left: 16px; top: 13px; color: var(--text-3); }
.search kbd { position: absolute; right: 12px; top: 11px; font: 700 11px var(--font); padding: 3px 7px; border-radius: 7px; background: var(--surface); color: var(--text-3); border: 1px solid var(--border); }
.search-drop { position: absolute; top: 52px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 8px; display: none; max-height: 420px; overflow: auto; }
.search-drop.open { display: block; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; cursor: pointer; }
.search-item:hover, .search-item.sel { background: var(--surface-2); }
.search-item .cover { width: 46px; height: 46px; border-radius: 10px; flex: none; font-size: 22px; }
.search-item b { display: block; font-size: 14px; }
.search-item small { color: var(--text-3); }
.header-actions { display: flex; align-items: center; gap: 10px; justify-self: end; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); cursor: pointer; font-weight: 800; font-size: 14px; position: relative; border: 0; }
.user-chip:hover { background: var(--surface-3); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60; text-align: left; }
.menu.open { display: block; animation: pop .15s ease; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: none; cursor: pointer; font-weight: 700; font-size: 14px; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.nav { display: flex; gap: 3px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 8px 11px; border-radius: 999px; font-weight: 800; font-size: 13.5px; color: var(--text-2); white-space: nowrap; display: flex; align-items: center; gap: 6px; transition: background .2s, color .2s; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(242, 84, 45, .3); }
.nav .sep { width: 1px; background: var(--border); margin: 6px 4px; flex: none; }

/* ---------- Аватар и обложки ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 13px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; font-size: 36px; border: 4px solid var(--surface); }
.avatar.md { width: 42px; height: 42px; font-size: 16px; }
.cover { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--g, linear-gradient(135deg, #ffd5b8, #ff8f5a)); font-size: 64px; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .emo { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .22)); transition: transform .4s; }
.cover::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .35), transparent 50%); pointer-events: none; }
.cover:has(img)::after { display: none; }
.cover img { z-index: 1; }

/* ---------- Главная ---------- */
.main { min-height: 70vh; padding: 24px 0 64px; }
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; width: 130px; height: 156px; border-radius: 22px; padding: 3px; background: linear-gradient(160deg, var(--brand-2), var(--brand), #ffb199); transition: transform .2s; }
.story:hover { transform: translateY(-3px) rotate(-1deg); }
.story-in { height: 100%; border-radius: 19px; overflow: hidden; border: 3px solid var(--bg); position: relative; }
.story .cover { height: 100%; font-size: 52px; }
.story .ttl { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2; font-size: 12px; font-weight: 800; color: #fff; line-height: 1.2; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.story-in::before { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); z-index: 1; }

.hero { margin: 24px 0 48px; background: var(--bg-2); border-radius: 32px; padding: 48px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, var(--brand-ring), transparent 70%); right: -80px; top: -120px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; }
.hero h1 { font-size: clamp(32px, 4.4vw, 52px); margin: 18px 0 16px; max-width: 520px; }
.hero p { color: var(--text-2); font-size: 16px; max-width: 460px; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-card { background: var(--surface); border-radius: 26px; padding: 12px; box-shadow: var(--shadow-lg); transform: rotate(1.5deg); transition: transform .3s; position: relative; z-index: 1; }
.hero-card:hover { transform: rotate(0) translateY(-4px); }
.hero-card .cover { height: 280px; border-radius: 18px; font-size: 120px; }
.hero-card-body { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 4px; gap: 10px; }
.hero-card-body h3 { font-size: 19px; }

.section { margin-top: 48px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: 28px; }
.link-more { color: var(--brand); font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.link-more:hover { gap: 8px; }

/* ---------- Карточки рецептов ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card { background: var(--surface); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; border: 1px solid var(--border); position: relative; }
[data-theme="dark"] .card { border-color: transparent; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card:hover .emo { transform: scale(1.1) rotate(-4deg); }
.card .cover { aspect-ratio: 4 / 3; font-size: 76px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; gap: 6px; }
.card-title { font-size: 17px; font-weight: 900; }
.card-desc { color: var(--text-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.dot.Средне { background: var(--yellow); } .dot.Сложно { background: var(--red); }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 8px; }
.time { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; }
.fav-btn { position: absolute; top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: #17171c; display: grid; place-items: center; cursor: pointer; transition: transform .2s; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.fav-btn:hover { transform: scale(1.1); }
.fav-btn.on { color: var(--brand); }
.fav-btn.on svg { fill: var(--brand); }
.status { position: absolute; top: 12px; left: 12px; z-index: 3; }
.st { white-space: nowrap; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.st-published { background: rgba(34, 165, 90, .14); color: var(--green); }
.st-pending { background: rgba(233, 161, 0, .16); color: var(--yellow); }
.st-rejected { background: rgba(229, 72, 77, .14); color: var(--red); }

/* ---------- Лента репостов ---------- */
.feed { display: grid; gap: 16px; }
.feed.cols { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.post-head b { font-weight: 800; }
.post-text { margin: 0 0 12px; }
.post-recipe { display: flex; gap: 14px; align-items: center; background: var(--surface-2); border-radius: 14px; padding: 10px; transition: background .2s; }
.post-recipe:hover { background: var(--surface-3); }
.post-recipe .cover { width: 72px; height: 72px; border-radius: 12px; font-size: 34px; flex: none; }

/* ---------- Списки/фильтры ---------- */
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 14px; }
.crumbs a:hover { color: var(--brand); }
.page-title { text-align: center; margin: 12px 0 28px; }
.page-title h1 { font-size: clamp(30px, 4vw, 42px); }
.page-title p { color: var(--text-2); margin: 8px 0 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-bottom: 28px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: none; height: 34px; padding: 0 14px; border-radius: 999px; font-weight: 800; font-size: 13px; cursor: pointer; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.select { height: 42px; border-radius: 999px; border: 0; background: var(--surface-2); padding: 0 16px; font-weight: 700; font-size: 13px; cursor: pointer; outline: none; }
.empty { text-align: center; padding: 64px 20px; color: var(--text-2); }
.empty .big { font-size: 64px; margin-bottom: 12px; }
.empty h3 { margin-bottom: 8px; color: var(--text); }
.more-wrap { display: flex; justify-content: center; margin-top: 32px; }

/* ---------- Страница рецепта ---------- */
.recipe-top { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: start; }
.recipe-cover { border-radius: 28px; aspect-ratio: 4 / 3; font-size: 160px; box-shadow: var(--shadow); }
.recipe-info h1 { font-size: clamp(30px, 3.6vw, 44px); margin: 12px 0 12px; }
.recipe-info .lead { color: var(--text-2); font-size: 16px; margin: 0 0 20px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.stat { background: var(--surface-2); border-radius: 16px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 18px; font-weight: 900; }
.stat small { color: var(--text-3); font-size: 12px; font-weight: 700; }
.author-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.author-row b { display: block; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.act.on { background: var(--brand-soft); color: var(--brand); }
.act.on svg { fill: currentColor; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag { padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--border); font-size: 13px; font-weight: 700; color: var(--text-2); }
.tag:hover { border-color: var(--brand); color: var(--brand); }
.recipe-body { display: grid; grid-template-columns: 380px 1fr; gap: 40px; margin-top: 48px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 22px; }
.ingr-panel { position: sticky; top: 140px; }
.panel h2 { font-size: 22px; margin-bottom: 14px; }
.servings { display: flex; align-items: center; justify-content: space-between; background: var(--brand-soft); border-radius: 16px; padding: 10px 10px 10px 16px; margin-bottom: 14px; }
.servings b { font-weight: 800; color: var(--brand); }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 999px; padding: 4px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; font-size: 18px; font-weight: 900; display: grid; place-items: center; }
.stepper button:hover { background: var(--brand); color: #fff; }
.stepper span { min-width: 44px; text-align: center; font-weight: 900; font-size: 16px; }
.ingr { list-style: none; padding: 0; margin: 0; }
.ingr li { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px dashed var(--border); cursor: pointer; user-select: none; }
.ingr li:last-child { border-bottom: 0; }
.ingr .chk { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--surface-3); flex: none; display: grid; place-items: center; transition: .2s; }
.ingr .chk svg { width: 12px; height: 12px; stroke-width: 3; opacity: 0; }
.ingr li.done .chk svg { opacity: 1; }
.ingr li.done .chk { background: var(--green); border-color: var(--green); color: #fff; }
.ingr li.done .nm { text-decoration: line-through; color: var(--text-3); }
.ingr .nm { flex: 1; }
.ingr .am { font-weight: 800; white-space: nowrap; transition: color .3s; }
.ingr .am.flash { color: var(--brand); }
.steps-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.steps-head h2 { font-size: 26px; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 20px; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); width: 0; transition: width .3s; }
.step { display: flex; gap: 16px; padding: 18px; border-radius: 20px; margin-bottom: 10px; background: var(--surface-2); cursor: pointer; transition: opacity .2s, background .2s; }
.step:hover { background: var(--surface-3); }
.step .n { width: 38px; height: 38px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 900; display: grid; place-items: center; flex: none; }
.step.done { opacity: .5; }
.step.done .n { background: var(--green); }
.step p { margin: 6px 0 0; font-size: 16px; }
.step img { border-radius: 14px; margin-top: 12px; max-height: 280px; object-fit: cover; }

.comments { margin-top: 48px; max-width: 820px; }
.comment-form { display: flex; gap: 12px; margin: 16px 0 24px; align-items: flex-start; }
.comment-form textarea { flex: 1; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment.reply { margin-left: 52px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: 13px; color: var(--text-3); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.comment-meta b { color: var(--text); font-size: 14px; }
.comment p { margin: 4px 0 6px; white-space: pre-wrap; word-wrap: break-word; }
.link-btn { border: 0; background: none; padding: 0; color: var(--text-3); font-weight: 800; font-size: 12px; cursor: pointer; }
.link-btn:hover { color: var(--brand); }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 800; font-size: 13px; color: var(--text-2); }
.input, textarea.input, select.input { width: 100%; min-height: 50px; border-radius: 14px; border: 1.5px solid transparent; background: var(--surface-2); padding: 12px 16px; outline: none; transition: border .2s, background .2s, box-shadow .2s; resize: vertical; }
.input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-ring); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.pass-wrap { position: relative; }
.pass-wrap button { position: absolute; right: 10px; top: 9px; width: 32px; height: 32px; border: 0; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.editor { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.editor .panel + .panel { margin-top: 20px; }
.upload { border: 2px dashed var(--surface-3); border-radius: 20px; aspect-ratio: 4 / 3; display: grid; place-items: center; text-align: center; cursor: pointer; overflow: hidden; position: relative; color: var(--text-3); font-weight: 700; transition: border .2s; }
.upload:hover { border-color: var(--brand); color: var(--brand); }
.upload img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dyn-row { display: grid; grid-template-columns: 1fr 90px 100px 40px; gap: 8px; margin-bottom: 8px; align-items: center; }
.dyn-row .input { min-height: 44px; padding: 10px 12px; }
.step-row { display: grid; grid-template-columns: 34px 1fr 40px; gap: 10px; margin-bottom: 10px; align-items: start; }
.step-row .n { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 900; display: grid; place-items: center; margin-top: 6px; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 40px; height: 40px; border-radius: 12px; border: 2px solid transparent; background: var(--surface-2); font-size: 20px; cursor: pointer; }
.emoji-pick button.on { border-color: var(--brand); background: var(--brand-soft); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.switch b { display: block; }
.switch small { color: var(--text-3); }
.toggle { width: 48px; height: 28px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; border: 0; flex: none; transition: background .2s; }
.toggle::after { content: ''; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.toggle.on { background: var(--brand); }
.toggle.on::after { transform: translateX(20px); }

/* ---------- Модалки ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 15, 20, .45); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px; animation: fade .2s ease; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; padding: 28px; position: relative; animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
.modal h2 { font-size: 24px; margin-bottom: 6px; }
.modal .sub { color: var(--text-2); margin: 0 0 22px; font-size: 14px; }
.modal-close { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; z-index: 2; }
.modal-close:hover { background: var(--surface-3); }
.auth { max-width: 940px; padding: 12px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 12px; }
.auth-side { background: linear-gradient(150deg, var(--brand-2), var(--brand) 55%, var(--brand-dark)); color: #fff; border-radius: 20px; padding: 36px; display: flex; flex-direction: column; position: relative; overflow: hidden; min-height: 460px; }
.auth-side::after { content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .08); right: -120px; top: -100px; }
.auth-side .logo-mark { background: #fff; color: var(--brand); }
.auth-side h3 { font-size: 26px; margin: auto 0 22px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; font-weight: 700; }
.auth-side li { display: flex; align-items: center; gap: 12px; }
.auth-side li span { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; }
.auth-form { padding: 32px 28px; }
.auth-form h2 { font-size: 28px; }
.auth-switch { text-align: center; margin-top: 16px; color: var(--text-2); font-size: 14px; }
.auth-switch a, .forgot { color: var(--brand); font-weight: 800; cursor: pointer; }
.forgot { display: block; text-align: right; font-size: 14px; margin: -6px 0 18px; }
.demo-hint { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--text-2); margin-top: 16px; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.share-grid a, .share-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 16px; background: var(--surface-2); font-size: 12px; font-weight: 800; border: 0; cursor: pointer; }
.share-grid a:hover, .share-grid button:hover { background: var(--surface-3); }
.share-grid .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 900; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { min-height: 44px; }

/* ---------- Тосты ---------- */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 800; font-size: 14px; box-shadow: var(--shadow-lg); animation: up .3s ease; display: flex; gap: 8px; align-items: center; }
.toast.err { background: var(--red); color: #fff; }

/* ---------- Профиль ---------- */
.profile-head { background: var(--bg-2); border-radius: 32px; overflow: hidden; margin-bottom: 28px; }
.profile-banner { height: 140px; background: linear-gradient(120deg, var(--brand-2), var(--brand), #ff9b72); position: relative; }
.profile-banner::after { content: '🍳 🥗 🍰 🍲 🥐 🍝 🍹 🥞'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; letter-spacing: 18px; opacity: .25; }
.profile-info > :not(.avatar) { margin-top: 60px; }
.profile-info { display: flex; align-items: flex-start; gap: 20px; padding: 0 32px 24px; margin-top: -48px; position: relative; flex-wrap: wrap; }
.profile-info h1 { font-size: 30px; }
.profile-stats { display: flex; gap: 24px; margin-left: auto; }
.profile-stats div { text-align: center; }
.profile-stats b { display: block; font-size: 22px; font-weight: 900; }
.profile-stats small { color: var(--text-3); font-weight: 700; }
.tabs { display: flex; gap: 6px; margin-bottom: 24px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 12px 16px; font-weight: 800; color: var(--text-3); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--text); border-color: var(--brand); }

/* ---------- Админка ---------- */
.admin { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.admin-side { position: sticky; top: 140px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 12px; }
.admin-side .t { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 10px 12px 6px; }
.admin-side a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; font-weight: 800; font-size: 14px; color: var(--text-2); }
.admin-side a:hover { background: var(--surface-2); color: var(--text); }
.admin-side a.on { background: var(--brand-soft); color: var(--brand); }
.admin-side .cnt { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 99px; }
.admin h1 { font-size: 28px; margin-bottom: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; }
.kpi small { color: var(--text-3); font-weight: 800; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.kpi b { display: block; font-size: 30px; font-weight: 900; margin-top: 6px; }
.kpi.accent { background: var(--brand); color: #fff; border-color: transparent; }
.kpi.accent small { color: rgba(255, 255, 255, .8); }
.chart { display: flex; align-items: end; gap: 6px; height: 160px; padding-top: 10px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 6px; height: 100%; }
.chart .bar div { width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: linear-gradient(var(--brand-2), var(--brand)); min-height: 3px; transition: height .5s; }
.chart .bar small { font-size: 10px; color: var(--text-3); font-weight: 700; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 900; padding: 14px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--bg-2); }
.t-recipe { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.t-recipe .cover { width: 48px; height: 48px; border-radius: 12px; font-size: 24px; flex: none; }
.t-recipe b { display: block; }
.t-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar .input { min-height: 42px; max-width: 280px; border-radius: 999px; }

/* ---------- Подвал ---------- */
.footer { border-top: 1px solid var(--border); padding: 36px 0; color: var(--text-3); font-size: 14px; }
.footer .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer .logo { color: var(--text); font-size: 18px; }
.footer .logo-mark { width: 30px; height: 30px; border-radius: 9px; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer nav a:hover { color: var(--brand); }

.loader { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 120px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }
@keyframes up { from { opacity: 0; transform: translateY(16px); } }
.fade-in { animation: up .35s ease both; }

/* ---------- Адаптив ---------- */
@media (max-width: 1000px) {
  .recipe-body, .editor { grid-template-columns: 1fr; }
  .ingr-panel { position: static; }
  .admin { grid-template-columns: 1fr; }
  .admin-side { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .admin-side .t { display: none; }
  .admin-side a { white-space: nowrap; }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding: 28px; }
  .recipe-top { grid-template-columns: 1fr; gap: 24px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { min-height: 0; padding: 24px; }
  .auth-side h3 { margin-top: 24px; font-size: 22px; }
  .auth-side ul { display: none; }
  .header-top { grid-template-columns: auto 1fr; height: auto; padding: 12px 0; gap: 12px; }
  .header-top .search { grid-column: 1 / -1; grid-row: 2; }
  .btn-add-text { display: none; }
  .btn .plus { margin: 0; }
  .user-chip .nm { display: none; }
  .profile-stats { margin-left: 0; }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card .cover { font-size: 52px; }
  .card-body { padding: 10px 12px 12px; }
  .card-title { font-size: 15px; }
  .card-desc, .card .badges .badge:nth-child(n+2), .card-foot .btn { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dyn-row { grid-template-columns: 1fr 70px 80px 36px; }
  .feed.cols { grid-template-columns: 1fr; }
  .share-grid { grid-template-columns: repeat(2, 1fr); }
  .section-head h2 { font-size: 22px; }
}
@media print {
  .header, .footer, .actions, .comments, .fav-btn, .similar { display: none !important; }
  .recipe-body { grid-template-columns: 1fr; }
}

/* ===== Новые элементы «Щепотки» ===== */
.nav-cnt { background: var(--brand); color: #fff; font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; }
.nav a.active .nav-cnt { background: #fff; color: var(--brand); }
.badge.rate { background: #fff6e0; color: #b7791f; }
[data-theme="dark"] .badge.rate { background: #2e2512; color: #f5c451; }
.credit { display: block; font-size: 11px; color: var(--text-3); margin-top: 8px; text-align: right; }
.credit:hover { color: var(--brand); }
.cook-btn { width: 100%; margin-bottom: 12px; }
.rate-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 16px; background: var(--surface-2); border-radius: 16px; }
.stars { display: flex; align-items: center; }
.stars button { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--surface-3); cursor: pointer; padding: 0 2px; transition: transform .15s, color .15s; }
.stars button.on { color: #f5b301; }
.stars:hover button { color: #f5b301; }
.stars button:hover ~ button { color: var(--surface-3); }
.stars button:hover { transform: scale(1.2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--border); font-weight: 800; font-size: 13px; cursor: pointer; color: var(--text-2); transition: .2s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand-soft); border-color: transparent; color: var(--brand); padding-right: 6px; }
.chip.on button { border: 0; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.chip.on button:hover { background: rgba(0,0,0,.08); }
.chip.on button svg { width: 14px; height: 14px; }
.timer-chips { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.timer-chip { padding: 5px 12px; background: var(--surface); }
.timer-chip svg { width: 15px; height: 15px; }
svg.big-ic { width: 36px; height: 36px; vertical-align: -5px; color: var(--brand); }
.btn-green { background: var(--herb); color: #fff; box-shadow: 0 6px 16px rgba(47, 158, 91, .3); }
.btn-green:hover { background: #26864c; }
.pill.green { background: var(--herb); }

.fridge-promo { display: flex; align-items: center; justify-content: space-between; gap: 28px; background: var(--herb-soft); border-radius: 32px; padding: 36px 40px; flex-wrap: wrap; position: relative; overflow: hidden; }
.fridge-promo::after { content: '🥕🧀🥚🍅'; position: absolute; right: 30px; bottom: -14px; font-size: 64px; opacity: .14; letter-spacing: 8px; pointer-events: none; }
.fridge-promo > div { flex: 1; min-width: 260px; position: relative; z-index: 1; }
.fridge-promo h2 { font-size: 30px; margin: 14px 0 8px; }
.fridge-promo p { color: var(--text-2); margin: 0 0 16px; }
.fridge-box { max-width: 880px; margin: 0 auto; }
.fridge-input { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 18px; padding: 10px; border: 1.5px solid transparent; }
.fridge-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); background: var(--surface); }
.fridge-input input { flex: 1; min-width: 200px; border: 0; background: none; outline: none; height: 34px; padding: 0 6px; }
.match { position: absolute; top: 12px; left: 12px; z-index: 3; background: rgba(255,255,255,.95); color: #17171c; font-weight: 900; font-size: 13px; padding: 5px 11px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.match.full { background: var(--herb); color: #fff; }
.meter { height: 6px; background: var(--surface-2); border-radius: 9px; overflow: hidden; margin: 2px 0 6px; }
.meter div { height: 100%; background: linear-gradient(90deg, var(--herb), #6fcf7f); border-radius: 9px; }
.ingr.shop li { padding: 12px 4px; }
.ingr.shop small { font-weight: 600; }

#timers { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: grid; gap: 10px; }
.timer { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 10px 10px 10px 12px; box-shadow: var(--shadow-lg); min-width: 280px; }
.timer-ring { width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(var(--brand) var(--p), var(--surface-2) 0); display: grid; place-items: center; position: relative; flex: none; }
.timer-ring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.timer-ring svg { position: relative; color: var(--brand); }
.timer-txt { flex: 1; min-width: 0; }
.timer-txt b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.timer-txt small { color: var(--text-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.timer.ring { border-color: var(--brand); animation: shake .5s ease infinite; }
.timer.ring b { color: var(--brand); }
@keyframes shake { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }

.cook { position: fixed; inset: 0; z-index: 120; background: var(--bg); display: flex; flex-direction: column; animation: fade .2s; }
.cook-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; gap: 12px; }
.cook-top .logo { font-size: 18px; min-width: 0; }
.cook-top .logo span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook-bar { height: 6px; background: var(--surface-2); }
.cook-bar div { height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .3s; }
.cook-body { flex: 1; overflow: auto; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px; max-width: 900px; margin: 0 auto; width: 100%; }
.cook-n { color: var(--brand); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: 14px; }
.cook-text { font-size: clamp(22px, 3.4vw, 36px); font-weight: 800; line-height: 1.35; margin: 16px 0 24px; }
.cook-img { max-height: 300px; border-radius: 20px; margin-bottom: 20px; }
.cook .timer-chips { justify-content: center; }
.cook .timer-chip { font-size: 16px; padding: 10px 20px; border-color: var(--brand); color: var(--brand); }
.cook-done .big { font-size: 80px; }
.cook-done h2 { font-size: 36px; margin: 10px 0; }
.cook-ing { max-width: 900px; margin: 0 auto 8px; width: calc(100% - 48px); background: var(--surface-2); border-radius: 16px; padding: 12px 16px; }
.cook-ing summary { cursor: pointer; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.cook-ing ul { list-style: none; padding: 0; margin: 10px 0 0; columns: 2; column-gap: 28px; }
.cook-ing li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; break-inside: avoid; font-size: 14px; }
.cook-nav { display: flex; justify-content: space-between; gap: 12px; padding: 16px 24px 24px; max-width: 900px; margin: 0 auto; width: 100%; }
.cook-nav .btn { flex: 1; max-width: 260px; }
@media (max-width: 560px) {
  .cook-ing ul { columns: 1; }
  #timers { left: 12px; right: 12px; bottom: 12px; }
  .timer { min-width: 0; }
  .fridge-promo { padding: 26px; }
  .fridge-promo h2 { font-size: 24px; }
}
@media print { #timers, .cook-btn, .rate-box { display: none !important; } }

body.cooking #timers { bottom: 104px; }
@media (max-width: 820px) { #random-btn { display: none; } }

/* ===== КБЖУ ===== */
.nutri { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.nutri-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.nutri-head h3 { font-size: 16px; }
.seg.sm button { height: 28px; padding: 0 10px; font-size: 12px; }
.nutri-kcal { font-size: 15px; color: var(--text-2); font-weight: 700; }
.nutri-kcal b { font-size: 34px; color: var(--text); font-weight: 900; transition: .2s; }
.nutri-bar { display: flex; height: 8px; border-radius: 9px; overflow: hidden; margin: 10px 0 12px; gap: 2px; }
.nutri-bar i { width: var(--w); transition: width .3s; }
.nutri-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.nutri-grid div { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; font-size: 12px; color: var(--text-3); font-weight: 700; }
.nutri-grid span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.nutri-grid b { display: block; color: var(--text); font-size: 16px; font-weight: 900; }
.nutri small { font-size: 11px; display: block; }
.nutri-live { display: flex; gap: 10px; align-items: flex-start; background: var(--brand-soft); color: var(--text); border-radius: 14px; padding: 10px 14px; margin: 4px 0 14px; font-size: 14px; }
.nutri-live:empty { display: none; }
.nutri-live svg { color: var(--brand); margin-top: 2px; }
.nutri-live small { color: var(--text-2); }
.mini-check { float: right; font-weight: 700; font-size: 12px; color: var(--text-3); display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.ed-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.modal.wide { max-width: 680px; }

/* ===== Профиль: обложка и аватар ===== */
.profile-banner { height: 220px; }
.profile-banner.has-img::after { display: none; }
.profile-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-btn { position: absolute; right: 16px; top: 16px; z-index: 2; background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(6px); }
.cover-btn:hover { background: rgba(0,0,0,.65); }
.av-wrap { position: relative; flex: none; }
.av-btn { position: absolute; right: 2px; bottom: 2px; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--bg-2); background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .2s; }
.av-btn:hover { transform: scale(1.1); }
.av-btn svg { width: 15px; height: 15px; }
.profile-info > :not(.av-wrap):not(.avatar) { margin-top: 60px; }
.profile-info > .av-wrap { margin-top: 0; }
.cover-prev { height: 120px; border-radius: 16px; background: linear-gradient(120deg, var(--brand-2), var(--brand)) center / cover; display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; padding: 10px; }
.cover-prev .btn { background: rgba(0,0,0,.45); color: #fff; }
@media (max-width: 560px) { .profile-banner { height: 140px; } .profile-info { padding: 0 18px 18px; } .nutri-kcal b { font-size: 28px; } }
@media (min-width: 1500px) { .hero { padding: 64px 72px; } .hero-card .cover { height: 340px; } }

/* ===== Анимированный логотип ===== */
.logo-mark.anim { width: 44px; height: 44px; border-radius: 14px; position: relative; overflow: hidden;
  background: linear-gradient(145deg, var(--brand-2), var(--brand) 55%, var(--brand-dark));
  box-shadow: 0 6px 18px rgba(242, 84, 45, .4), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.logo-mark.anim::after { content: ''; position: absolute; inset: -50%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.45) 50%, transparent 60%); transform: translateX(-70%); animation: lm-sheen 5s ease-in-out infinite; }
.logo:hover .logo-mark.anim { transform: rotate(-8deg) scale(1.08); }
.lm { width: 32px !important; height: 32px !important; overflow: visible; }
.lm-bowl, .lm-handle { fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; }
.lm-bowl { fill: rgba(255,255,255,.14); }
.lm-shine { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 1.6; stroke-linecap: round; }
.lm-spoon { transform-origin: 15px 36px; animation: lm-scoop 2.8s ease-in-out infinite; }
.lm-salt circle { fill: #fff; transform-box: fill-box; transform-origin: center; animation: lm-fall 2.8s cubic-bezier(.5,0,.8,.6) infinite; }
.lm-salt circle:nth-child(2) { animation-delay: .18s; }
.lm-salt circle:nth-child(3) { animation-delay: .36s; }
.lm-salt circle:nth-child(4) { animation-delay: .54s; }
.lm-spark path { fill: none; stroke: #ffe3a3; stroke-width: 1.8; stroke-linecap: round; transform-box: fill-box; transform-origin: center; animation: lm-spark 2.8s ease-in-out infinite; }
.logo:hover .lm-spoon, .logo:hover .lm-salt circle, .logo:hover .lm-spark path { animation-duration: 1.2s; }
.logo-word { background: linear-gradient(90deg, var(--text) 0%, var(--text) 40%, var(--brand) 50%, var(--text) 60%, var(--text) 100%); background-size: 300% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent; animation: lm-word 5s ease-in-out infinite; }
.header .logo { font-size: 24px; gap: 12px; }
@keyframes lm-fall {
  0%, 8% { transform: translate(0, -10px) scale(.4); opacity: 0; }
  20% { opacity: 1; transform: translate(-2px, -4px) scale(1); }
  55% { transform: translate(-13px, 6px) scale(.9); opacity: 1; }
  68%, 100% { transform: translate(-15px, 9px) scale(.2); opacity: 0; }
}
@keyframes lm-scoop { 0%, 100% { transform: rotate(-4deg); } 45% { transform: rotate(-4deg); } 62% { transform: rotate(7deg) translateY(1px); } 78% { transform: rotate(-2deg); } }
@keyframes lm-spark { 0%, 55% { transform: scale(0) rotate(0); opacity: 0; } 68% { transform: scale(1.2) rotate(45deg); opacity: 1; } 85%, 100% { transform: scale(0) rotate(90deg); opacity: 0; } }
@keyframes lm-sheen { 0%, 70% { transform: translateX(-70%); } 85%, 100% { transform: translateX(70%); } }
@keyframes lm-word { 0%, 70% { background-position: 100% 0; } 90%, 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .lm-spoon, .lm-salt circle, .lm-spark path, .logo-mark.anim::after, .logo-word { animation: none !important; } .lm-salt circle { opacity: 1; } }
.auth-side .logo-mark.anim { background: #fff; }
.auth-side .lm-bowl, .auth-side .lm-handle { stroke: var(--brand); }
.auth-side .lm-bowl { fill: var(--brand-soft); }
.auth-side .lm-salt circle { fill: var(--brand); }
.auth-side .lm-shine { stroke: var(--brand-2); }

@media (max-width: 820px) {
  .header-top .search kbd { display: none; }
  .header-top .search input { padding-right: 16px; }
  .header-actions { gap: 6px; }
  .header-actions .btn { width: 42px; padding: 0; }
  .header .logo { font-size: 20px; gap: 8px; }
  .logo-mark.anim { width: 40px; height: 40px; }
}
@media (max-width: 380px) { .header .logo-word { display: none; } }
.lm-salt circle { r: 2px; }

/* ===== Центрированное меню и главная на всю ширину ===== */
.nav > :first-child { margin-left: auto; }
.nav > :last-child { margin-right: auto; }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feed.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.g4, .feed.g4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .grid.g4, .feed.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .feed.g4 { grid-template-columns: 1fr; } }
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.cat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 22px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; transition: transform .25s, box-shadow .25s, border-color .25s; }
[data-theme="dark"] .cat-tile { border-color: transparent; }
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.cat-tile:hover .cat-emo { transform: scale(1.15) rotate(-6deg); }
.cat-emo { font-size: 48px; line-height: 1.1; transition: transform .3s; }
.cat-tile b { font-size: 16px; }
.cat-tile small { color: var(--text-3); font-weight: 700; font-size: 12px; }
.stories-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; }
.stories-head b { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 900; }
.stories-head b svg { color: var(--brand); }
.stories-head span { font-size: 13px; }
.story { flex: 1 0 128px; max-width: 170px; width: auto; }
.post-recipe > div { min-width: 0; }
.post-recipe b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ===== Исправления для телефона ===== */
.admin > div, .editor > div, .recipe-body > *, .recipe-top > * { min-width: 0; }
@media (max-width: 560px) {
  .panel { padding: 16px; }
  .panel .btn-sm { white-space: normal; height: auto; min-height: 34px; padding-top: 6px; padding-bottom: 6px; text-align: left; }
  .toolbar .input { max-width: none; flex: 1 1 100%; }
  .admin h1 { font-size: 24px; }
  .row { grid-template-columns: 1fr; }
}

/* ===== Карусель «Популярное сейчас» ===== */
.carousel { position: relative; }
.carousel .stories { scroll-snap-type: x proximity; overscroll-behavior-x: contain; cursor: grab; user-select: none; -webkit-user-select: none; scroll-padding: 0 4px; }
.carousel .story { scroll-snap-align: start; -webkit-user-drag: none; }
.carousel .story img { -webkit-user-drag: none; pointer-events: none; }
.carousel .stories.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.carousel .stories.dragging .story { pointer-events: none; }
.car-btn { position: absolute; top: calc(50% - 26px); z-index: 5; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--surface); color: var(--text); box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: opacity .25s, transform .2s, background .2s; }
.car-btn:hover { background: var(--brand); color: #fff; transform: scale(1.08); }
.car-btn svg { width: 22px; height: 22px; stroke-width: 2.6; }
.car-btn.prev { left: -14px; } .car-btn.next { right: -14px; }
.car-btn.hide { opacity: 0; pointer-events: none; }
.carousel::before, .carousel::after { content: ''; position: absolute; top: 0; bottom: 12px; width: 70px; z-index: 4; pointer-events: none; opacity: 0; transition: opacity .25s; }
.carousel::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.carousel::after { right: 0; background: linear-gradient(-90deg, var(--bg), transparent); }
.carousel.fade-l::before, .carousel.fade-r::after { opacity: 1; }
@media (hover: none) { .car-btn { width: 38px; height: 38px; } .car-btn.prev { left: 2px; } .car-btn.next { right: 2px; } }

.warn-box { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; border-color: var(--yellow); background: rgba(233,161,0,.08); flex-wrap: wrap; }
.warn-box > svg { color: var(--yellow); width: 28px; height: 28px; }
.warn-box > div { flex: 1; min-width: 200px; }

.hero.solo { grid-template-columns: 1fr; }
.first-run { text-align: center; padding: 48px 24px; }
.first-run .big { font-size: 64px; }
.first-run h2 { font-size: 28px; margin: 8px 0; }
.first-run p { max-width: 560px; margin: 0 auto 20px; }
