/* ===== Кафе-Хан — минималистичная дизайн-система ===== */

:root {
  --bg: #f6f5f1;
  --surface: #ecebe5;
  --header-bg: #eeece6;
  --surface-2: #e2e0d9;
  --text: #151515;
  --muted: #6e6c68;
  --dim: #a3a09a;
  --line: #e0ddd5;
  --accent: #e4572e;
  --accent-ink: #ffffff;
  --accent-soft: #fcebe5;
  --green: #2f8a4c;
  --green-soft: #e6f3ea;
  --blue: #2f6fb5;
  --blue-soft: #e7eff8;
  --amber: #a86a00;
  --amber-soft: #fbf1dc;
  /* Цвета графиков в админке (проверены на различимость, в т. ч. при дальтонизме). */
  --viz-1: #e4572e;
  --viz-2: #2a78d6;
  --shadow: 0 12px 40px rgba(20, 20, 20, .08);
  --radius: 16px;
  --radius-sm: 10px;
  /* Inter — хорошо читается на экране, в том числе кириллица и цифры. */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --header-h: 76px;
  --tabbar-h: 0px;
  color-scheme: light;
}

/* Тёмная тема — по выбору пользователя (переключатель в шапке). */
:root[data-theme="dark"] {
  --bg: #222226;
  --surface: #2e2e33;
  --header-bg: #1c1c1f;
  --surface-2: #3a3a40;
  --text: #f6f5f2;
  --muted: #bcbab5;
  --dim: #918f8a;
  --line: #414147;
  --accent: #f37448;
  --accent-soft: rgba(243, 116, 72, .16);
  --green: #5cc27c;
  --green-soft: rgba(92, 194, 124, .13);
  --blue: #6aa6e8;
  --blue-soft: rgba(106, 166, 232, .13);
  --amber: #e3a948;
  --amber-soft: rgba(227, 169, 72, .14);
  --viz-1: #d95926;
  --viz-2: #3987e5;
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

@media (max-width: 860px) {
  :root { --header-h: 62px; --tabbar-h: calc(62px + env(safe-area-inset-bottom)); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; font-feature-settings: 'cv11', 'ss01'; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.022em; line-height: 1.15; }
h1 { font-size: clamp(2.1rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.1rem; letter-spacing: -0.015em; }
p { margin: 0; }
[v-cloak] { display: none; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 28px; } }

.page { padding: 36px 0 72px; min-height: 60vh; }
.page-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }
.label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 640px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.accent { color: var(--accent); }
.small { font-size: .9rem; }
.section { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.link { background: none; border: none; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: .875rem; }
.link:hover { color: var(--text); }
.more { font-weight: 700; font-size: .92rem; display: inline-flex; align-items: center; gap: 6px; }
.more:hover { color: var(--accent); }

/* Кнопки */
.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(--surface); font-weight: 600; font-size: .98rem; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s, transform .1s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); opacity: .92; }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover { background: var(--text); opacity: .88; }
.btn-outline { background: transparent; border-color: var(--line); }
.btn-outline:hover { background: transparent; border-color: var(--text); }
.btn-danger { background: transparent; border-color: var(--line); color: #c43d2b; }
.btn-sm { min-height: 38px; padding: 0 15px; font-size: .9rem; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; background: transparent; border: 1px solid var(--line); flex: none; transition: border-color .15s; }
.icon-btn:hover { border-color: var(--text); }

/* Поверхности */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.panel { background: var(--surface); border-radius: var(--radius); }
.pad { padding: 24px; }
@media (max-width: 640px) { .pad { padding: 18px; } }

/* Формы */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .88rem; font-weight: 600; color: var(--muted); }
.input { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--text); }
textarea.input { min-height: 88px; resize: vertical; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: .94rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.error-box { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: .9rem; font-weight: 600; }

/* Чипы и бейджи */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; background: transparent; border: 1px solid var(--line); font-weight: 600; font-size: .92rem; white-space: nowrap; transition: all .15s; }
.chip:hover { border-color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--surface); color: var(--muted); white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.price { font-weight: 800; white-space: nowrap; letter-spacing: -0.01em; }

.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty .big { font-size: 2.6rem; margin-bottom: 8px; }
.skeleton { background: var(--surface); border-radius: var(--radius); animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .5; } }

.fade-enter-active, .fade-leave-active { transition: opacity .15s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ===== Шапка ===== */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.app > main { flex: 1; padding-top: var(--header-h); padding-bottom: var(--tabbar-h); }
.app.is-admin > main { padding-bottom: 0; }
.header { position: fixed; inset: 0 0 auto; height: var(--header-h); z-index: 50; background: color-mix(in srgb, var(--header-bg) 92%, transparent); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); }
/* Шапка шире основного контента, чтобы разделы, переключатели и корзина помещались в одну строку. */
.header .inner { max-width: 1480px; height: 100%; display: flex; align-items: center; gap: clamp(12px, 1.6vw, 24px); }
/* Логотип — Unbounded: современный, хорошо читается и в кириллице. */
/* Логотип в одну строку: круглый знак и название. */
.logo { flex: none; display: inline-flex; align-items: center; gap: .35em; font-family: 'Unbounded', var(--font); font-weight: 600; font-size: 1.45rem; line-height: 1; letter-spacing: -0.02em; }
.logo-word { display: inline-flex; align-items: center; gap: 3px; }
.logo i { width: .24em; height: .24em; border-radius: 50%; background: var(--accent); display: inline-block; margin: 0 2px; }
/* Знак: корона — акцент, казан — цветом текста, пар — полупрозрачный. */
.logo-mark { width: 2.3em; height: auto; flex: none; overflow: visible; margin-top: -.1em; }
.logo-mark .kazan { fill: currentColor; }
.logo-mark .crown { fill: var(--accent); transform-box: view-box; transform-origin: 32px 30px; transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.logo-mark .steam { fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.logo-mark .steam path { opacity: 0; transform-box: view-box; }
.logo-mark .kazan { transform-box: view-box; transform-origin: 32px 46px; }

/* Наведение / фокус: корона приподнимается как крышка, из казана идёт пар. */
.logo:hover .logo-mark .crown, .logo:focus-visible .logo-mark .crown { transform: translateY(-7px) rotate(-9deg); }
.logo:hover .logo-mark .steam path, .logo:focus-visible .logo-mark .steam path { animation: steam 1.5s ease-out infinite; }
.logo:hover .logo-mark .steam path:nth-child(2), .logo:focus-visible .logo-mark .steam path:nth-child(2) { animation-delay: .25s; }
.logo:hover .logo-mark .steam path:nth-child(3), .logo:focus-visible .logo-mark .steam path:nth-child(3) { animation-delay: .5s; }
.logo:hover .logo-mark .kazan { animation: wobble .6s ease; }
/* Нажатие (и касание на телефоне): корона подпрыгивает. */
.logo:active .logo-mark .crown { transform: translateY(-11px) rotate(8deg) scale(1.08); transition-duration: .15s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(4px); } 35% { opacity: .9; } 100% { opacity: 0; transform: translateY(-7px); } }
@keyframes wobble { 25% { transform: rotate(-3deg); } 60% { transform: rotate(2deg); } }
@media (prefers-reduced-motion: reduce) {
  .logo-mark .crown { transition: none; }
  .logo:hover .logo-mark .crown, .logo:active .logo-mark .crown { transform: none; }
  .logo:hover .logo-mark .steam path, .logo:hover .logo-mark .kazan { animation: none; }
}
/* Разделы — по центру шапки, между логотипом и кнопками. */
.nav { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 2px; }
/* Разделы — крупно и жирно, чтобы не терялись рядом с большим логотипом. */
/* Размер разделов плавно подстраивается под ширину окна — корзина справа никогда не уезжает за край. */
.nav a { padding: 9px clamp(5px, 0.8vw, 15px); border-radius: 999px; font-weight: 700; font-size: clamp(.9rem, 0.2rem + 0.95vw, 1.3rem); letter-spacing: -0.015em; white-space: nowrap; color: var(--muted); transition: color .15s; }
.nav a:hover, .nav a.router-link-active { color: var(--text); }
.nav a.router-link-active { background: var(--surface); }
.header .actions { flex: none; display: flex; align-items: center; gap: 10px; }
.header .phone { font-weight: 700; font-size: 1.05rem; color: var(--text); margin-right: 4px; white-space: nowrap; }
.cart-btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 1.08rem; }
.cart-btn b { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .78rem; display: grid; place-items: center; }
.mobile-only { display: none !important; }
@media (max-width: 1960px) { .header .phone { display: none; } }
@media (max-width: 1180px) { .cart-btn { padding: 0 14px; } .cart-btn .txt { display: none; } .header .actions { gap: 6px; } }
@media (max-width: 1100px) { .logo { font-size: 1.15rem; } }
/* Узкие ноутбуки: всё в шапке компактнее, чтобы все разделы и корзина помещались в одну строку. */
@media (min-width: 861px) and (max-width: 1000px) {
  .logo { font-size: .92rem; }
  .header .inner { gap: 8px; padding: 0 20px; }
  .header .actions { gap: 4px; }
  .nav { gap: 0; }
  .nav a { padding: 8px 4px; font-size: .86rem; }
  .lang-switch button { padding: 4px 6px; }
  .header .icon-btn, .switchers .icon-btn { width: 34px; height: 34px; }
  .cart-btn { height: 40px; padding: 0 10px; }
}
@media (max-width: 860px) {
  .logo { font-size: 1.2rem; }
  .header .inner { gap: 10px; }
  .header .actions { margin-left: auto; gap: 6px; }
  .header .icon-btn, .switchers .icon-btn { width: 34px; height: 34px; }
  .cart-btn { height: 36px; padding: 0 10px; }
  .nav, .desktop-only { display: none !important; }
  .mobile-only { display: inline-grid !important; }
  .cart-btn { padding: 0 12px; }
  .cart-btn .txt { display: none; }
}

/* Нижняя навигация на телефоне */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; inset: auto 0 0; z-index: 60; height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { position: relative; border: none; background: none; padding: 0; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--dim); font-size: .72rem; font-weight: 600; }
  .tabbar a.active, .tabbar button.active { color: var(--text); }
  .tabbar button { font-size: .72rem; font-weight: 600; cursor: pointer; }
  .more-backdrop { position: fixed; inset: 0; z-index: 58; background: rgba(0, 0, 0, .25); }
  .more-sheet { position: fixed; z-index: 59; right: 10px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); min-width: 220px; padding: 8px; border-radius: 18px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, .18); display: flex; flex-direction: column; }
  .more-sheet a { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 12px; font-weight: 700; color: var(--text); }
  .more-sheet a.active { background: var(--surface); }
  .more-sheet .more-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .74rem; display: grid; place-items: center; }
  .tabbar b { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .64rem; display: grid; place-items: center; }
}

/* Подвал */
.footer { border-top: 1px solid var(--line); padding: 44px 0 28px; margin-top: 24px; }
.footer .grid { display: grid; gap: 28px; grid-template-columns: 2fr 1fr 1fr; }
.footer h4 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.footer .stack { gap: 8px; }
.footer .logo { font-size: 1.25rem; align-self: flex-start; }
.footer a, .footer span { color: var(--muted); font-size: .94rem; }
.footer a:hover { color: var(--text); }
.footer .copy { margin-top: 32px; font-size: .82rem; color: var(--dim); }
@media (max-width: 720px) { .footer .grid { grid-template-columns: 1fr 1fr; } .footer .grid > :first-child { grid-column: 1 / -1; } }

/* Уведомления */
.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 18px); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 420px; }
.toast { padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-weight: 600; font-size: .9rem; text-align: center; }
.toast.error { background: var(--accent); color: #fff; border-radius: 14px; }
.toast-enter-active, .toast-leave-active { transition: all .2s; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translateY(8px); }

/* ===== Фото блюда ===== */
.dish-img { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--surface); }
.dish-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s, transform .4s; }
.dish-img img.loaded { opacity: 1; }
.dish-img .fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(2.2rem, 7vw, 3.4rem); }

/* Количество */
.qty { display: inline-flex; align-items: center; background: var(--surface); border-radius: 999px; padding: 3px; font-weight: 800; }
.qty button { width: 34px; height: 34px; border: none; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.qty button:hover { background: var(--bg); }
.qty button:disabled { opacity: .35; }
.qty span { min-width: 22px; text-align: center; font-size: .92rem; }

/* Карточка блюда */
.grid-dishes { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
@media (max-width: 600px) { .grid-dishes { grid-template-columns: 1fr 1fr; gap: 12px; } }
@media (max-width: 370px) { .grid-dishes { grid-template-columns: 1fr; } }
.dish { display: flex; flex-direction: column; padding: 10px; border-radius: 22px; background: var(--surface); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.dish:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.dish .media { position: relative; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; }
.dish:hover .media img.loaded { transform: scale(1.04); }
.dish .tags { position: absolute; top: 10px; left: 10px; right: 54px; display: flex; gap: 5px; flex-wrap: wrap; }
.dish .tags .badge { background: rgba(255, 255, 255, .92); color: #151515; backdrop-filter: blur(6px); }
.dish .tags .badge-fav { background: var(--accent); color: #fff; }
/* Сердечко «В избранное» — в правом верхнем углу фото. */
.like-btn { position: absolute; top: 8px; right: 8px; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; border: none; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #151515; backdrop-filter: blur(6px); cursor: pointer; transition: transform .15s, color .15s; }
.like-btn:hover { transform: scale(1.08); }
.like-btn.on { color: #e5484d; }
.like-btn.on svg { animation: like-pop .3s ease; }
.like-btn.in-modal { top: 14px; right: 62px; width: 40px; height: 40px; }
@keyframes like-pop { 50% { transform: scale(1.3); } }
.header .liked-link { position: relative; color: #e5484d; }
.header .liked-link b { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .68rem; display: grid; place-items: center; }
.dish .price-chip { position: absolute; left: 10px; bottom: 10px; padding: 5px 12px; border-radius: 999px; background: rgba(21, 21, 21, .82); color: #fff; font-weight: 700; font-size: .98rem; backdrop-filter: blur(6px); letter-spacing: -0.01em; }
.dish .body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 14px 6px 4px; }
.dish .title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dish h3 { font-size: 1.12rem; font-weight: 700; line-height: 1.25; }
.dish .weight { flex: none; color: var(--muted); font-size: .86rem; font-weight: 500; }
.dish .ingredients { color: var(--muted); font-size: .9rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dish .foot { margin-top: auto; padding-top: 6px; }
.add-wide { width: 100%; min-height: 44px; border: none; border-radius: 14px; background: var(--bg); color: var(--text); font-weight: 600; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, color .15s; }
.add-wide:hover { background: var(--accent); color: #fff; }
.dish .qty { width: 100%; justify-content: space-between; background: var(--bg); border-radius: 14px; padding: 4px; }
.dish .qty button:hover { background: var(--surface); }

/* КБЖУ: на порцию крупно, на 100 г мелко */
.macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.macros > div { display: flex; flex-direction: column; align-items: center; padding: 7px 4px; border-radius: 12px; background: var(--bg); text-align: center; line-height: 1.2; }
.macros b { font-size: .96rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.macros span { font-size: .7rem; color: var(--muted); }
.macros small { font-size: .68rem; color: var(--dim); margin-top: 2px; font-variant-numeric: tabular-nums; }
.macros-caption { display: flex; justify-content: space-between; gap: 6px; font-size: .74rem; color: var(--dim); white-space: nowrap; }
@media (max-width: 600px) {
  .dish { padding: 7px; border-radius: 18px; }
  .dish .media { border-radius: 13px; }
  .dish .body { padding: 10px 3px 2px; gap: 6px; }
  .dish h3 { font-size: .98rem; }
  .dish .title-row { flex-direction: column; gap: 0; }
  .dish .ingredients { font-size: .82rem; -webkit-line-clamp: 2; line-clamp: 2; }
  .dish .price-chip { font-size: .88rem; padding: 4px 10px; left: 7px; bottom: 7px; }
  .dish .tags .badge:nth-child(n+2) { display: none; }
  .dish .tags { top: 7px; left: 7px; right: 44px; }
  .like-btn:not(.in-modal) { top: 6px; right: 6px; width: 32px; height: 32px; }
  .like-btn:not(.in-modal) svg { width: 17px; height: 17px; }
  .macros { grid-template-columns: 1fr 1fr; gap: 4px; }
  .macros > div { padding: 5px 2px; }
  .macros b { font-size: .86rem; }
  .add-wide .txt { display: none; }
}

/* Таблица КБЖУ в окне блюда */
.nutrition { border-radius: 16px; background: var(--surface); padding: 14px 16px; }
.nutrition table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.nutrition th { text-align: right; font-size: .78rem; font-weight: 600; color: var(--muted); padding: 0 0 8px; }
.nutrition th:first-child, .nutrition td:first-child { text-align: left; }
.nutrition td { text-align: right; padding: 7px 0; border-top: 1px solid var(--line); }
.nutrition td b { font-weight: 700; }
.ingredients-full { font-size: .98rem; line-height: 1.55; }
.ingredients-full b { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin-bottom: 4px; }

/* Модальное окно */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(10, 10, 10, .45); display: grid; place-items: center; padding: 16px; animation: fadein .15s; }
.modal { width: 100%; max-width: 600px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--bg); border-radius: 22px; box-shadow: var(--shadow); animation: rise .2s ease-out; }
@keyframes fadein { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
@media (max-width: 640px) {
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-height: 92dvh; }
}
.dish-modal .media { position: relative; aspect-ratio: 16 / 11; }
.dish-modal .close { position: absolute; top: 14px; right: 14px; background: var(--bg); border: none; }
.dish-modal .content { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.dish-modal h2 { font-size: 1.7rem; }
.dish-modal .foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 6px; padding-bottom: env(safe-area-inset-bottom); }
.quote { margin: 0; padding: 14px 16px; border-left: 2px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .95rem; }
.quote cite { display: block; margin-top: 6px; font-style: normal; font-size: .82rem; color: var(--muted); font-weight: 600; }

/* ===== Главная ===== */
.hero { padding: 44px 0 24px; }
.hero .grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero .text { display: flex; flex-direction: column; gap: 22px; }
.hero h1 span { color: var(--accent); }
.hero .photo { aspect-ratio: 4 / 4.4; border-radius: 28px; overflow: hidden; }
.hero .facts { display: flex; gap: 28px; flex-wrap: wrap; padding-top: 10px; }
.hero .facts div { display: flex; flex-direction: column; }
.hero .facts b { font-size: 1.15rem; letter-spacing: -0.02em; }
.hero .facts span { font-size: .82rem; color: var(--muted); }
@media (max-width: 860px) {
  .hero { padding-top: 24px; }
  .hero .grid { grid-template-columns: 1fr; gap: 24px; }
  .hero .photo { aspect-ratio: 16 / 11; border-radius: 20px; order: -1; }
}

/* ===== Главная: кафе (слайдер) ===== */
.visit { padding: 16px 0 0; }
.visit-frame { position: relative; margin: 0 auto; width: calc(100% - 32px); max-width: 1360px; height: min(78vh, 720px); min-height: 460px; border-radius: 28px; overflow: hidden; background: #1d1d21; color: #fff; outline: none; }
.visit-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 1s ease, transform 6s ease-out; }
.visit-img.on { opacity: 1; transform: scale(1); }
.visit-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 10, 12, .78) 0%, rgba(10, 10, 12, .45) 45%, rgba(10, 10, 12, .05) 100%), linear-gradient(0deg, rgba(10, 10, 12, .55), transparent 40%); }
.visit-text { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding-top: 30px; padding-bottom: 70px; max-width: 1200px; }
.visit-text h1 { color: #fff; max-width: 640px; font-size: clamp(2.1rem, 5vw, 3.8rem); }
.visit-sub { font-size: 1.15rem; max-width: 560px; color: rgba(255, 255, 255, .86); }
.visit-eyebrow { font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.visit-cta { margin-top: 8px; }
.btn-light { background: #fff; color: #151515; }
.btn-light:hover { background: #fff; opacity: .9; }
.visit-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .95rem; color: rgba(255, 255, 255, .85); }
.visit-facts a:hover { color: #fff; text-decoration: underline; }
.visit-arrow { position: absolute; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; backdrop-filter: blur(8px); transition: background .15s; }
.visit-arrow:hover { background: rgba(255, 255, 255, .3); }
.visit-arrow.prev { right: 74px; }
.visit-arrow.next { right: 22px; }
.visit-dots { position: absolute; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; gap: 8px; }
.visit-dots button { width: 34px; height: 4px; padding: 0; border: none; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.visit-dots button i { display: block; height: 100%; width: 0; background: #fff; }
.visit-dots button.on i { width: 100%; }
.visit-dots button.on i[style] { width: 0; animation: dot linear forwards; }
@keyframes dot { to { width: 100%; } }
@media (max-width: 860px) {
  .visit { padding-top: 8px; }
  .visit-frame { width: calc(100% - 20px); border-radius: 22px; height: min(74vh, 620px); min-height: 440px; }
  .visit-shade { background: linear-gradient(0deg, rgba(10, 10, 12, .85) 10%, rgba(10, 10, 12, .35) 60%, rgba(10, 10, 12, .1)); }
  .visit-text { justify-content: flex-end; padding-bottom: 54px; }
  .visit-sub { font-size: 1rem; }
  .visit-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { .visit-img { transition: opacity .3s; transform: none !important; } }

/* Два способа: в кафе или доставка */
.ways { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.way { display: flex; flex-direction: column; gap: 12px; padding: 28px; border-radius: 24px; background: var(--surface); }
.way h3 { font-size: 1.5rem; }
.way-icon { font-size: 2.2rem; }
.way-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.way .btn { margin-top: auto; }
.way-accent { background: var(--text); color: var(--bg); }
.way-accent p { opacity: .8; }
@media (max-width: 760px) { .ways { grid-template-columns: 1fr; } .way { padding: 22px; } }

.cats { display: grid; gap: 10px; grid-template-columns: repeat(7, 1fr); }
.cat { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px; border-radius: var(--radius); background: var(--surface); text-align: center; font-weight: 700; font-size: .86rem; transition: background .15s; }
.cat:hover { background: var(--surface-2); }
.cat .e { font-size: 1.9rem; line-height: 1; }
@media (max-width: 960px) { .cats { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .cats { grid-template-columns: repeat(3, 1fr); } }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.chef-card { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; padding: 0; border: none; background: none; text-align: left; scroll-snap-align: start; color: #fff; }
.chef-card .over { position: absolute; inset: auto 0 0; padding: 20px; background: linear-gradient(0deg, rgba(0, 0, 0, .72), transparent); display: flex; flex-direction: column; gap: 4px; }
.chef-card .over h3 { font-size: 1.25rem; }
.chef-card .over .badge { align-self: flex-start; background: rgba(255, 255, 255, .92); color: #151515; }
@media (max-width: 860px) { .rail { grid-auto-columns: 74%; } }

.promo-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.promo-card { padding: 24px; border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.promo-card .e { font-size: 1.8rem; }
.promo-card p { color: var(--muted); font-size: .92rem; }
.code-btn { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 10px; border: 1.5px dashed var(--accent); background: transparent; color: var(--accent); font-weight: 800; letter-spacing: .1em; font-size: .9rem; }
.code-btn:hover { background: var(--accent-soft); }

.band { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 36px; border-radius: 24px; background: var(--text); color: var(--bg); }
.band p { opacity: .7; max-width: 560px; margin-top: 8px; }
.band .btn { background: var(--bg); color: var(--text); }
.band-steps { margin: 10px 0 0; padding-left: 1.4em; max-width: 560px; opacity: .7; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 720px) { .band { flex-direction: column; align-items: flex-start; padding: 26px; } }

/* ===== Меню ===== */
.menu-bar { position: sticky; top: var(--header-h); z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); padding: 12px 0; border-bottom: 1px solid var(--line); }
.menu-bar .tools { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 5px 0 14px; height: 44px; border-radius: 999px; background: var(--surface); color: var(--muted); flex: 0 1 380px; border: 1px solid transparent; transition: border-color .15s; }
.search:focus-within { border-color: var(--line); }
.search input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 1rem; }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { flex: none; width: 30px; height: 30px; border: none; border-radius: 50%; background: none; color: var(--dim); display: grid; place-items: center; }
.search .clear:hover { color: var(--text); }
.search .go { flex: none; height: 34px; padding: 0 16px; border: none; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: .9rem; animation: fadein .15s; }
.search .go:hover { opacity: .9; }
.menu-section { padding-top: 40px; scroll-margin-top: calc(var(--header-h) + 120px); }
.menu-section h2 { margin-bottom: 20px; font-size: clamp(1.35rem, 2.6vw, 1.7rem); }
@media (max-width: 720px) {
  .menu-bar .tools { flex-direction: column; align-items: stretch; gap: 8px; }
  .search { flex: none; }
  .menu-section { padding-top: 30px; }
}

/* ===== Шеф ===== */
.chef-intro { display: grid; grid-template-columns: 400px 1fr; gap: 40px; align-items: center; }
.chef-intro .photo { aspect-ratio: 4 / 5; border-radius: 24px; overflow: hidden; }
.chef-intro .stats { display: flex; gap: 32px; flex-wrap: wrap; }
.chef-intro .stats b { display: block; font-size: 1.8rem; letter-spacing: -0.03em; }
.chef-intro .stats span { font-size: .84rem; color: var(--muted); }
.special { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; padding: 28px 0; border-top: 1px solid var(--line); }
.special .photo { aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; padding: 0; border: none; background: none; }
.special.rev .photo { order: 2; }
.special .stack { gap: 14px; }
.special h3 { font-size: 1.6rem; letter-spacing: -0.03em; }
@media (max-width: 860px) {
  .chef-intro, .special { grid-template-columns: 1fr; gap: 20px; }
  .chef-intro .photo { aspect-ratio: 4 / 3; }
  .special.rev .photo { order: 0; }
  .special h3 { font-size: 1.35rem; }
}

/* ===== Акции и доставка ===== */
.bonus-band { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 30px; border-radius: 24px; background: var(--surface); margin-bottom: 20px; }
.bonus-band ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.bonus-band li::before { content: '—'; color: var(--accent); margin-right: 10px; font-weight: 800; }
.balance { text-align: center; padding: 24px 32px; border-radius: 20px; background: var(--bg); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.balance b { font-size: 3rem; letter-spacing: -0.04em; line-height: 1; }
@media (max-width: 720px) { .bonus-band { grid-template-columns: 1fr; padding: 22px; } }

.info-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.info-grid > div { padding: 22px; border-radius: var(--radius); background: var(--surface); }
.info-grid b { display: block; font-size: 1.45rem; letter-spacing: -0.03em; margin-bottom: 2px; }
.info-grid span { color: var(--muted); font-size: .88rem; }
.two-col { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: baseline; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); font-weight: 800; font-size: .82rem; }
@media (max-width: 860px) { .info-grid { grid-template-columns: 1fr 1fr; } .two-col { grid-template-columns: 1fr; } }

/* ===== Корзина ===== */
.cart-layout { display: grid; grid-template-columns: 1fr 370px; gap: 28px; align-items: start; }
.cart-layout .main { display: flex; flex-direction: column; gap: 28px; }
/* «Итого» едет вместе со страницей, но никогда не выше экрана: на невысоких ноутбуках прокручивается внутри, кнопка заказа всегда достижима. */
.summary { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 20px; background: var(--surface); }
.summary > * { flex-shrink: 0; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: grid; grid-template-columns: 60px 1fr auto 90px; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.lines .thumb { width: 60px; height: 60px; border-radius: 12px; overflow: hidden; }
.lines .thumb .fallback { font-size: 1.6rem; }
.lines .info { display: flex; flex-direction: column; min-width: 0; }
.lines .total { text-align: right; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--surface); }
.segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border: none; border-radius: 999px; background: none; font-weight: 700; color: var(--muted); }
.segmented button.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.pay-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-options.three { grid-template-columns: repeat(3, 1fr); }
.pay { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); cursor: pointer; font-weight: 600; font-size: .94rem; }
.pay.active { border-color: var(--text); }
.pay input { accent-color: var(--accent); }
.summary dl { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: .94rem; }
.summary dl div { display: flex; justify-content: space-between; gap: 12px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 700; }
.summary .grand { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.summary .grand b { font-size: 1.6rem; letter-spacing: -0.03em; transition: opacity .15s; }
.summary .promo-row { display: flex; gap: 8px; }
.summary .promo-row .input { min-height: 44px; text-transform: uppercase; }
.applied { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green); font-weight: 700; font-size: .88rem; }
.hint { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); color: var(--muted); font-size: .86rem; }
.hint.warn { color: var(--accent); }
.green { color: var(--green); }
.success { max-width: 560px; margin: 24px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.success .big { font-size: 3rem; }
.success .sum { padding: 18px 28px; border-radius: 18px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.success .sum b { font-size: 1.9rem; letter-spacing: -0.03em; }
@media (max-width: 960px), (max-height: 620px) { .summary { position: static; max-height: none; overflow: visible; } }
@media (max-width: 960px) { .cart-layout { grid-template-columns: 1fr; } }
@media (max-width: 1180px) and (min-width: 961px) { .cart-layout { grid-template-columns: 1fr 330px; gap: 22px; } .summary { padding: 20px; } }
@media (max-width: 560px) {
  .lines li { grid-template-columns: 52px 1fr auto; row-gap: 4px; }
  .lines .thumb { width: 52px; height: 52px; }
  .lines .total { grid-column: 2; text-align: left; font-size: .92rem; }
  .lines .qty { grid-column: 3; grid-row: 1 / span 2; }
  .pay-options { grid-template-columns: 1fr; }
}

/* ===== Яндекс Карты ===== */
.address-row { display: flex; gap: 8px; }
.address-row .input { flex: 1; }
.address-row .btn { flex: none; }
.map-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--green); font-weight: 600; }
.map-modal { max-width: 760px; display: flex; flex-direction: column; overflow: hidden; }
.map-search { display: flex; gap: 8px; padding: 0 20px 12px; }
.map-search .input { flex: 1; min-height: 44px; }
.map-box { position: relative; background: var(--surface); }
.map-modal .map-box { height: min(56vh, 460px); }
.map-canvas { position: absolute; inset: 0; }
.map-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); font-size: .95rem; }
.map-locate { position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: none; border-radius: 999px; background: #fff; color: #151515; font-weight: 600; font-size: .88rem; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.map-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); }
.map-foot p { flex: 1; min-width: 0; }
.cafe-map { height: 300px; border-radius: var(--radius); overflow: hidden; margin-top: 20px; }
@media (max-width: 640px) {
  .map-modal { max-height: 100dvh; border-radius: 22px 22px 0 0; }
  .map-modal .map-box { height: 52dvh; }
  .map-foot { flex-direction: column; align-items: stretch; }
}

/* Поле фото в админке */
.image-row { display: flex; gap: 12px; align-items: flex-start; }
.image-preview { flex: none; width: 88px; height: 66px; border-radius: 10px; overflow: hidden; background: var(--surface); display: grid; place-items: center; color: var(--dim); font-size: 1.4rem; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Обратная связь */
.container.narrow { max-width: 760px; }
.input.input-sm { min-height: 36px; padding: 6px 10px; font-size: .88rem; width: auto; }
.wrap-chips { flex-wrap: wrap; overflow: visible; }
.btn-lg { min-height: 54px; font-size: 1.05rem; }
.fb-label { font-size: .88rem; font-weight: 600; color: var(--muted); }
.fb-to { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); }
.fb-to-label { font-size: .88rem; font-weight: 600; color: var(--muted); }
.fb-to-who { display: inline-flex; align-items: center; gap: 8px; }
.fb-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-size: 1rem; }
.fb-to-via { margin-left: auto; font-size: .85rem; color: var(--dim); }
.fb-text { min-height: 170px; resize: vertical; line-height: 1.5; }
.fb-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.fb-photo, .fb-add { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; }
.fb-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-photo-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.fb-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed var(--line); background: transparent; color: var(--muted); font-size: .82rem; font-weight: 600; transition: border-color .15s, color .15s; }
.fb-add:hover { border-color: var(--text); color: var(--text); }
.fb-done { align-items: center; text-align: center; gap: 14px; padding: 48px 24px; }
.fb-done-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; }
@media (max-width: 640px) { .fb-to-via { margin-left: 0; width: 100%; } }
.fb-admin-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-admin-photos img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; display: block; }
.fb-msg { white-space: pre-wrap; line-height: 1.55; }
.fb-report { white-space: pre-line; font-size: .85rem; color: var(--muted); background: var(--surface); padding: 8px 12px; border-radius: 10px; }
.fb-new { box-shadow: inset 3px 0 0 var(--accent); }
.side-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: .78rem; font-weight: 700; display: inline-grid; place-items: center; }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--text); }
.link-btn { border: none; background: none; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; cursor: pointer; }
.channel-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Админка: слайды и тексты */
.slides-admin { display: flex; flex-direction: column; gap: 10px; }
.slide-row { display: flex; align-items: center; gap: 14px; padding: 10px; }
.slide-thumb { width: 150px; height: 84px; object-fit: cover; border-radius: 10px; flex: none; }
.slide-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.texts-table tr { cursor: pointer; }
.texts-table tr:hover td { background: var(--surface); }
.texts-table tr.changed td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.texts-table td { max-width: 420px; }
@media (max-width: 700px) { .slide-row { flex-wrap: wrap; } .slide-thumb { width: 100%; height: 140px; } .slide-actions { width: 100%; justify-content: flex-start; } }

/* ===== Вход ===== */
.auth-box { width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.auth-box h1 { font-size: 2.2rem; }

/* ===== Кабинет ===== */
.profile-layout { display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: start; }
.profile-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.bonus-card { padding: 24px; border-radius: 20px; background: var(--text); color: var(--bg); display: flex; flex-direction: column; gap: 2px; }
.bonus-card b { font-size: 3rem; letter-spacing: -0.04em; line-height: 1.05; }
.bonus-card span { opacity: .65; font-size: .86rem; }
.tg-card { display: flex; flex-direction: column; gap: 10px; }
.tg-card .messenger { padding-top: 10px; border-top: 1px solid var(--line); min-height: 46px; }
.data { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.data dt { font-size: .76rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.data dd { margin: 0; word-break: break-word; }
.order { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.order .items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .92rem; color: var(--muted); }
.order .items li { display: flex; justify-content: space-between; gap: 12px; }
.order .foot { padding-top: 12px; border-top: 1px solid var(--line); }
.progress { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.progress li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .72rem; color: var(--dim); text-align: center; font-weight: 600; }
.progress li::before { content: ''; position: absolute; top: 5px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.progress li:first-child::before { display: none; }
.progress li.done::before { background: var(--text); }
.progress i { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
.progress li.done i { background: var(--text); border-color: var(--text); }
.progress li.now i { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.progress li.done span { color: var(--text); }
@media (max-width: 900px) { .profile-layout { grid-template-columns: 1fr; } .profile-side { position: static; } }

/* ===== Админка ===== */
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - var(--header-h)); }
.admin .side { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); padding: 24px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.admin .side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .94rem; }
.admin .side a:hover { color: var(--text); }
.admin .side a.active { background: var(--surface); color: var(--text); }
.admin .side .back { margin-top: auto; }
.admin .content { padding: 28px clamp(16px, 3vw, 36px) 60px; min-width: 0; }
.admin h1 { font-size: 1.9rem; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); }
.tile { padding: 20px; border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.tile span { color: var(--muted); font-size: .86rem; }
.tile b { font-size: 1.9rem; letter-spacing: -0.03em; line-height: 1.1; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 36px; gap: 12px; align-items: center; font-size: .9rem; }
.bar { height: 8px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--text); }
.bar-row b { text-align: right; }

/* ===== Обзор в админке: метрики и графики ===== */
.dash-period { grid-template-columns: repeat(3, auto); }
.dash-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; }
.dash-range { margin: 4px 0 0; }
.dash-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-btn { height: 44px; white-space: nowrap; }
.dash-pop-wrap { position: relative; }
.dash-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: min(360px, calc(100vw - 32px)); padding: 16px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.dash-menu { width: 300px; padding: 6px; gap: 0; }
.dash-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 12px; border: none; border-radius: 10px; background: none; text-align: left; color: var(--text); cursor: pointer; }
.dash-menu button:hover, .dash-menu button:focus-visible { background: var(--surface); }
.dash-menu span { font-size: .8rem; color: var(--muted); }
.dash-loading { opacity: .55; transition: opacity .15s; pointer-events: none; }
.chart.dense .chart-cols, .chart.dense .chart-x { gap: 0; }
.chart.dense .chart-col > i { border-radius: 2px 2px 0 0; }
@media (max-width: 560px) { .dash-pop { right: auto; left: 0; } .dash-controls > .dash-pop-wrap:last-child .dash-pop { left: auto; right: 0; } }
/* PDF: «Скачать → PDF» открывает печать — оставляем только отчёт. */
@media print {
  .header, .tabbar, .admin .side, .no-print, .toasts { display: none !important; }
  .admin { display: block; }
  .admin .content { padding: 0; }
  body { background: #fff; }
  .card, .tile { break-inside: avoid; box-shadow: none; }
  .chart-col > i, .split i, .hbar-track i, .meter i { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
.dash-period button { padding: 0 16px; height: 36px; font-size: .9rem; }
.dash .tile { min-width: 0; }
.dash .tile b { font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-accent b { color: var(--accent); }
.delta { font-size: .82rem; font-weight: 700; color: var(--muted); }
.delta span { font-weight: 500; color: var(--dim); }
.delta.up { color: var(--green); }
.delta.down { color: var(--accent); }
.meter { display: flex; gap: 2px; height: 8px; margin: 4px 0 2px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; }
.meter .ok { background: var(--green); border-radius: 999px 0 0 999px; }
.meter .bad { background: var(--dim); }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dash-head p { margin: 2px 0 0; }
.dash-sum { font-size: 1.35rem; letter-spacing: -0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.chart-axis { height: var(--h); display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: .72rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.chart-axis span { line-height: 1; transform: translateY(-50%); }
.chart-axis span:first-child { transform: none; }
.chart-axis span:last-child { transform: translateY(0); }
.chart-plot { position: relative; min-width: 0; }
.chart-grid { position: absolute; inset: 0 0 auto; height: var(--h); display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid i { border-top: 1px dashed var(--line); }
.chart-grid i:last-child { border-top: 1px solid var(--line); }
.chart-cols { position: relative; height: var(--h); display: flex; align-items: flex-end; gap: 2px; }
.chart-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; }
.chart-col > i { display: block; width: min(100%, 28px); min-height: 0; background: var(--c); border-radius: 4px 4px 0 0; transition: opacity .12s; }
.chart-col.dim > i { opacity: .45; }
.chart-col.on::before { content: ''; position: absolute; inset: 0; background: var(--text); opacity: .05; border-radius: 6px; }
.chart-col:focus-visible::before { content: ''; position: absolute; inset: 0; outline: 2px solid var(--text); border-radius: 6px; }
.chart-tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 3; padding: 8px 11px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: .8rem; line-height: 1.35; white-space: nowrap; box-shadow: var(--shadow); display: flex; flex-direction: column; pointer-events: none; }
.chart-tip.left { left: auto; right: 0; transform: none; }
.chart-tip.right { left: 0; transform: none; }
.chart-tip b { font-weight: 700; }
.chart-x { display: flex; gap: 2px; margin-top: 6px; }
.chart-x span { flex: 1; min-width: 0; text-align: center; font-size: .72rem; color: var(--dim); white-space: nowrap; overflow: visible; }
.chart-empty { position: absolute; inset: 0 0 auto; height: var(--h); margin: 0; display: grid; place-items: center; color: var(--dim); font-size: .9rem; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 40px 88px; gap: 10px; align-items: center; font-size: .9rem; }
.hbar > b { text-align: right; font-variant-numeric: tabular-nums; }
.hbar > span:last-child { text-align: right; white-space: nowrap; }
.hbar > span:first-child { line-height: 1.3; }
.hbar .badge { justify-self: start; }
.hbar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.hbar-track i { display: block; height: 100%; min-width: 0; border-radius: 999px; background: var(--text); }
.hbar-track i.st-COMPLETED { background: var(--green); }
.hbar-track i.st-CANCELLED { background: var(--dim); }
.hbar-track i.st-NEW { background: var(--accent); }
.split { display: flex; gap: 2px; height: 16px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.split i { display: block; height: 100%; }
.split-legend { display: flex; flex-direction: column; gap: 8px; }
.split-legend > div { display: grid; grid-template-columns: 12px 1fr auto; column-gap: 10px; align-items: center; font-size: .92rem; }
.split-legend > div > i { width: 12px; height: 12px; border-radius: 3px; }
.split-legend > div > .small { grid-column: 2 / 4; }
.top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: top; }
.top-list li { display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.top-list .hbar-track i { background: var(--viz-1); }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .hbar { grid-template-columns: 100px 1fr 30px; }
  .hbar > span:last-child { display: none; }
  .dash .tile b { font-size: 1.5rem; }
}
.orders-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); align-items: start; }
.a-order { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.a-order.fresh { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.a-order .client { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.a-order .client a { font-weight: 700; color: var(--accent); }
.a-order .comment { padding: 8px 12px; border-radius: 10px; background: var(--surface); color: var(--muted); }
.a-order .items { list-style: none; margin: 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.a-order .items li { display: flex; justify-content: space-between; gap: 10px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .thumb { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; }
.table .thumb .fallback { font-size: 1.3rem; }
.table tr.off td:not(:nth-last-child(-n+2)) { opacity: .45; }
.switch { width: 42px; height: 24px; border-radius: 999px; border: none; background: var(--surface-2); position: relative; transition: background .15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch.on { background: var(--green); }
.switch.on i { transform: translateX(18px); }
.form-modal { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1000px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .admin .side { position: sticky; top: var(--header-h); z-index: 20; height: auto; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 8px 12px; border-right: none; border-bottom: 1px solid var(--line); background: var(--bg); }
  .admin .side a { flex: none; font-size: .86rem; padding: 8px 12px; }
  .admin .side .back { display: none; }
  .admin .content { padding: 20px 16px 48px; }
  .orders-grid { grid-template-columns: 1fr; }
}

/* ===== Переключатели языка и темы ===== */
.switchers { display: flex; align-items: center; gap: 6px; }
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); }
.lang-switch button { border: none; background: none; padding: 5px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; color: var(--dim); letter-spacing: .02em; }
.lang-switch button.active { background: var(--text); color: var(--bg); }
@media (max-width: 860px) { .lang-switch button { padding: 4px 7px; } .switchers .icon-btn { width: 36px; height: 36px; } }

/* ===== Лояльность ===== */
.guest-cta { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: var(--radius); background: var(--accent-soft); }
.guest-cta h3 { color: var(--accent); }
.guest-cta p { font-size: .92rem; }
.level-card { display: flex; flex-direction: column; gap: 8px; }
.level-card .name { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.level-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.level-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s; }
.perk-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
.perk-grid ul { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.perk-grid li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .94rem; }
.perk-grid li b { white-space: nowrap; }
@media (max-width: 860px) { .perk-grid { grid-template-columns: 1fr; } }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.form-section { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); padding-top: 6px; }

/* Самые узкие телефоны: шапка в одну строку. Стоит в конце, чтобы перекрыть правила для 860 px. */
@media (max-width: 400px) { .logo { font-size: 1.05rem; } .lang-switch button { padding: 4px 6px; } .header .inner { gap: 6px; } .header .actions { gap: 4px; } .header .icon-btn, .switchers .icon-btn { width: 32px; height: 32px; } .header .admin-link { display: none !important; } }
