/* Публичные страницы. Только токены из tokens.css, никаких своих цветов. Мобильная версия первая. */

.local-strip { background: var(--amber-100); color: var(--ink); font-size: 13px; text-align: center; padding: 4px var(--space-2); }
.small { font-size: 14px; color: var(--slate-500); }

/* Шапка: логотип, пять главных пунктов, «Ещё», телефон, кнопка, тема. Телефон и планшет: логотип, тема, бургер. */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--white) 94%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--slate-200); }
.site-header .container.header-row { max-width: 1320px; display: flex; align-items: center; gap: var(--space-2); min-height: 68px; }
.brand { flex: none; }
.main-nav, .header-actions { display: none; }
.header-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; cursor: pointer; align-items: center; border-radius: var(--radius-s); }
.burger:hover { background: var(--slate-200); }
.burger span, .burger::before, .burger::after { content: ""; display: block; width: 22px; height: 2.5px; background: var(--ink); border-radius: 2px; }
.menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.btn--sm { min-height: 40px; padding: 0 var(--space-2); font-size: 15px; border-radius: 10px; }
.header-phone { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.header-phone svg { width: 18px; height: 18px; color: var(--amber-500); flex: none; }

.mobile-menu { display: none; border-top: 1px solid var(--slate-200); background: var(--white); }
.menu-toggle:checked ~ .mobile-menu { display: block; }
.mobile-menu .container { display: flex; flex-direction: column; padding-top: 6px; padding-bottom: var(--space-3); }
.mobile-menu .item { padding: 14px 4px; color: var(--ink); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--slate-200); }
.mobile-menu .item[aria-current="page"] { color: var(--ink); box-shadow: inset 3px 0 0 var(--amber-500); padding-left: 14px; }
.mobile-menu .nav-dev { color: var(--slate-500); font-weight: 400; }
.mobile-menu .btn-row { margin-top: var(--space-2); }
.mobile-menu .btn-row .btn { flex: 1; }

@media (min-width: 1160px) {
  .burger, .mobile-menu { display: none !important; }
  .main-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; margin-left: var(--space-1); }
  .main-nav > a, .nav-more > summary { display: inline-flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; cursor: pointer; list-style: none; }
  .nav-more > summary::-webkit-details-marker { display: none; }
  .main-nav > a:hover, .nav-more > summary:hover, .nav-more[open] > summary { background: var(--slate-200); }
  .main-nav > a[aria-current="page"] { background: var(--amber-100); box-shadow: inset 0 -2px 0 var(--amber-500); }
  .nav-more { position: relative; }
  .nav-more__panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; min-width: 320px; padding: 8px; background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius-m); box-shadow: 0 18px 40px rgba(15, 22, 28, 0.18); display: flex; flex-direction: column; }
  .nav-more__panel a { padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; }
  .nav-more__panel a:hover { background: var(--slate-200); }
  .nav-more__panel .nav-dev { color: var(--slate-500); border-top: 1px solid var(--slate-200); border-radius: 0 0 10px 10px; margin-top: 4px; }
  .header-actions { display: flex; align-items: center; gap: var(--space-2); }
  .header-tools { margin-left: 4px; }
  .header-tools { margin-left: 0; }
}
@media (min-width: 1160px) and (max-width: 1319px) { .header-phone span { display: none; } .header-phone { width: 40px; height: 40px; justify-content: center; border: 1px solid var(--slate-200); border-radius: 10px; } .header-phone:hover { background: var(--slate-200); } .main-nav > a, .nav-more > summary { padding: 9px 9px; font-size: 14px; } }

/* Нижняя панель на телефоне */
.cta-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: var(--space-1); padding: var(--space-1) var(--space-2); background: var(--white); border-top: 1px solid var(--slate-200); z-index: 20; }
.cta-bar .btn { flex: 1; min-height: 44px; padding: 0 var(--space-1); white-space: nowrap; font-size: 15px; }
body { padding-bottom: 68px; }
@media (min-width: 900px) { .cta-bar { display: none; } body { padding-bottom: 0; } }

/* Подвал */
.footer-grid { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
.footer-grid ul { list-style: none; padding: 0; margin: 8px 0 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-note { margin-top: var(--space-3); }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }

/* Хлебные крошки */
.crumbs { display: flex; flex-wrap: wrap; font-size: 14px; color: var(--slate-500); padding: var(--space-2) 0 0; }
.crumbs a { color: var(--slate-500); }
.crumbs > * + *::before { content: "›"; margin: 0 8px; }

/* Главная */
.hero { padding: var(--space-4) 0 var(--space-3); }
.hero h1 { max-width: 18ch; }
.hero .lead { font-size: 19px; max-width: 46ch; color: var(--slate-700); }
.hero-phone { margin-top: var(--space-2); color: var(--slate-500); }
.hero .lead, .hero-phone { background: var(--veil); border-radius: var(--radius-s); }
.band { margin: var(--space-4) 0; }
.band > h2 { margin-top: 0; }
.section-lead { color: var(--slate-500); max-width: 60ch; margin-top: 0; background: var(--veil); }

/* Плитки */
.tiles { display: grid; gap: var(--space-2); grid-template-columns: 1fr; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(3, 1fr); } .tiles--4 { grid-template-columns: repeat(4, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 6px; background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius-m); padding: var(--space-3); text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--slate-700); }
.tile h3 { margin: 0; }
.tile .count { color: var(--slate-500); font-size: 14px; }
.tile .dots { margin-bottom: 4px; }
.tile--door { border-width: 2px; }

/* Шаги */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
ol.steps li { counter-increment: step; position: relative; padding-left: 52px; }
ol.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--amber-500); color: var(--on-accent); font-family: var(--font-mono); font-weight: 500; display: grid; place-items: center; }

/* Текстовые страницы */
.prose { max-width: 72ch; background: var(--veil); border-radius: var(--radius-s); }
.prose h2 { margin-top: var(--space-4); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.prose .lead { font-size: 19px; color: var(--slate-700); }
.draft-note { background: var(--amber-100); border-radius: var(--radius-s); padding: var(--space-1) var(--space-2); font-size: 14px; margin-bottom: var(--space-2); }

/* Вопросы и ответы */
.faq details { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius-s); padding: 0 var(--space-2); margin-bottom: var(--space-1); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.faq details[open] summary { color: var(--slate-700); }
.faq .answer { padding-bottom: var(--space-1); }

/* Таблицы */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius-s); font-size: 15px; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--slate-200); vertical-align: top; }
table.data th { background: var(--paper); font-weight: 600; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
.price { white-space: nowrap; font-family: var(--font-mono); }
.price--ask { font-family: var(--font-sans); color: var(--slate-500); }

/* Группы блоков (раскрывающиеся) */
.group { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius-s); margin-bottom: var(--space-1); }
.group summary { cursor: pointer; padding: 12px var(--space-2); font-weight: 600; display: flex; justify-content: space-between; gap: var(--space-2); }
.group .table-wrap { padding: 0 var(--space-1) var(--space-1); }

/* Чипы и подбор */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--space-2); border-radius: var(--radius-s); border: 1px solid var(--slate-200); background: var(--white); color: var(--ink); text-decoration: none; font-weight: 600; }
.chip:hover { border-color: var(--slate-700); }
.chip small { color: var(--slate-500); font-weight: 400; }
.progress { display: flex; gap: var(--space-1); align-items: center; margin: var(--space-2) 0; color: var(--slate-500); font-size: 14px; }
.progress .dots { margin-right: 4px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-2); font-size: 14px; }
.choices a { color: var(--slate-500); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px var(--space-2); background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius-s); margin-bottom: 8px; cursor: pointer; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.message-box { background: var(--white); border: 1px dashed var(--slate-500); border-radius: var(--radius-s); padding: var(--space-2); font-size: 16px; white-space: pre-wrap; }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--error); font-size: 14px; }
.hp { position: absolute; left: -9999px; }
.search-form { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.search-form input { flex: 1; min-width: 220px; }
.test-banner { background: var(--amber-100); border-radius: var(--radius-s); padding: var(--space-1) var(--space-2); font-size: 14px; margin-bottom: var(--space-2); }
.two-col { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: 2fr 1fr; align-items: start; } }
.aside-card { position: sticky; top: var(--space-2); }
.contacts-list { list-style: none; padding: 0; }

/* Главная: слова слева, маскот справа */
.hero--split { display: grid; gap: var(--space-3); align-items: center; }
.hero-art { display: flex; justify-content: center; position: relative; }
.hero-art::before { content: ""; position: absolute; inset: 6% 12%; background: radial-gradient(circle, rgba(255, 138, 31, 0.22), transparent 64%); pointer-events: none; }
.hero-art img { display: block; width: 100%; height: auto; }
@media (min-width: 900px) { .hero--split { grid-template-columns: 1.2fr 1fr; padding: var(--space-5) 0; } .bot-live { width: min(100%, 400px); } }

/* Нижний призыв с Ежом */
.cta { display: grid; gap: var(--space-2); align-items: center; }
.cta img { width: 120px; height: auto; justify-self: center; }
@media (min-width: 720px) { .cta { grid-template-columns: 1fr auto; } .cta img { width: 140px; } }
.err-art { display: flex; justify-content: center; }
.err-art img { width: min(100%, 260px); height: auto; }

/* Внутренние страницы: содержимое на «листе» поверх бегущего кода, чтобы текст читался */
main.container:not(.main--bare) { background: var(--veil); border: 1px solid var(--slate-200); border-radius: 20px; margin-top: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-4); backdrop-filter: blur(3px); width: calc(100% - 16px); }
@media (min-width: 1160px) { main.container:not(.main--bare) { max-width: 1120px; padding: var(--space-4) var(--space-5) var(--space-5); } }
main.container:not(.main--bare) .crumbs { padding-top: 0; }
.passport-mascot { display: flex; align-items: center; gap: var(--space-2); }
.passport-mascot img { width: 110px; height: auto; flex: none; }

/* Живой бот (bot.js): наклон за курсором, покачивание, радость по клику */
.bot-live { position: relative; width: min(100%, 300px); transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); transition: transform 0.25s ease-out; }
.bot-live__body { position: relative; }
.bot-live canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bot-live.is-live { cursor: pointer; }
.bot-live.is-live .bot-live__body { animation: bot-float 3.6s ease-in-out infinite alternate; }
.bot-live.is-live.is-bounce .bot-live__body { animation: bot-bounce 0.6s ease-out; }
@keyframes bot-float { from { transform: translateY(0) scale(1); } to { transform: translateY(-7px) scale(1.012); } }
@keyframes bot-bounce { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-16px) scale(1.04, 0.97); } 70% { transform: translateY(0) scale(0.97, 1.03); } 100% { transform: translateY(0) scale(1); } }
.bot-spark { position: absolute; left: 50%; top: 42%; width: 9px; height: 9px; border-radius: 2px; background: var(--amber-500); pointer-events: none; animation: bot-spark 0.75s ease-out forwards; }
@keyframes bot-spark { from { transform: translate(-50%, -50%) rotate(var(--a)) translateX(0); opacity: 1; } to { transform: translate(-50%, -50%) rotate(var(--a)) translateX(var(--d)); opacity: 0; } }
.hero-art::before { animation: bot-glow 3.6s ease-in-out infinite alternate; }
@keyframes bot-glow { from { opacity: 0.7; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hero-art::before, .bot-live.is-live .bot-live__body { animation: none; } .bot-live { transform: none; } }

/* Бот злится после четвёртого тапа: красная аура, тряска, красные искры */
.bot-live::after { content: ""; position: absolute; inset: -14%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 40, 30, 0.6), rgba(255, 40, 30, 0) 66%); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.bot-live.is-angry::after { opacity: 1; animation: bot-aura 0.8s ease-in-out infinite alternate; }
.bot-live.is-angry { animation: bot-shake 0.14s linear infinite; }
.bot-live.is-angry .bot-live__body { filter: drop-shadow(0 0 14px rgba(255, 50, 40, 0.85)); }
.hero-art.is-angry::before { background: radial-gradient(circle, rgba(255, 40, 30, 0.35), transparent 64%); }
.bot-spark--red { background: #ff3b30; }
@keyframes bot-aura { from { transform: scale(0.94); } to { transform: scale(1.08); } }
@keyframes bot-shake { 0%, 100% { translate: 0 0; } 25% { translate: -2px 1px; } 75% { translate: 2px -1px; } }
@media (prefers-reduced-motion: reduce) { .bot-live.is-angry, .bot-live.is-angry::after { animation: none; } }

/* Малыш-спутник (buddy.js): уменьшенный бот у правого края подсказывает по разделам страницы */
.buddy { position: fixed; right: clamp(8px, 1.6vw, 28px); bottom: clamp(16px, 4vh, 44px); z-index: 25; width: clamp(76px, 7vw, 112px); pointer-events: none; opacity: 0; transform: translateX(140%); transition: transform 0.55s cubic-bezier(0.2, 1.25, 0.3, 1), opacity 0.3s; }
.buddy.is-on { opacity: 1; transform: none; }
.buddy__body { position: relative; pointer-events: auto; animation: bot-float 3.4s ease-in-out infinite alternate; }
.buddy.is-hop .buddy__body { animation: buddy-hop 0.55s ease-out; }
.buddy img { display: block; width: 100%; height: auto; }
.buddy__bubble { position: absolute; right: calc(100% - 4px); bottom: 62%; width: max-content; max-width: min(250px, 22vw); padding: 10px 12px; background: var(--white); color: var(--ink); border: 1px solid var(--slate-200); border-radius: 14px 14px 4px 14px; font: 500 14px/1.35 var(--font-sans); text-decoration: none; box-shadow: 0 10px 28px rgba(15, 22, 28, 0.18); opacity: 0; transform: translateY(6px) scale(0.96); transition: opacity 0.25s, transform 0.25s; pointer-events: none; }
.buddy.is-say .buddy__bubble { opacity: 1; transform: none; pointer-events: auto; }
a.buddy__bubble[href]:hover { border-color: var(--amber-500); }
.buddy__close { position: absolute; top: -6px; right: -2px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid var(--slate-200); background: var(--white); color: var(--slate-500); font: 600 15px/1 var(--font-sans); cursor: pointer; opacity: 0; transition: opacity 0.2s; }
.buddy__body:hover .buddy__close { opacity: 1; }
@keyframes buddy-hop { 0% { transform: translateY(0); } 40% { transform: translateY(-18px) scale(1.04); } 100% { transform: translateY(0); } }
@media (max-width: 1099px), (prefers-reduced-motion: reduce) { .buddy { display: none; } }
