/* Оформление сайта ambassador.my. Основа — сетка, кнопки, шапка и меню телефона сайта-образца; цвета — только
   из tokens.css, шрифт — свой Onest (fonts.css). Тема — системная, только CSS. Встроенных style="" нет — CSP. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
h1, h2, h3, p, figure { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
p a, li a, .faq-answer a { color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
code { font-family: var(--font-mono); font-size: .88em; padding: 1px 5px; border-radius: 4px; background: var(--bg-subtle); border: 1px solid var(--border); }
button, a, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:where(a, button, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--brand-soft); color: var(--text); }
.container { width: min(var(--max), calc(100% - 96px)); margin-inline: auto; }
.narrow { max-width: 880px; }
.icon { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }

/* ---------------------------------------------------------------- шапка */
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); }
.header-row { position: relative; height: 76px; display: flex; align-items: center; gap: 32px; }
.brand { flex: none; display: inline-flex; align-items: center; gap: 10px; border-radius: 6px; color: var(--text); }
.brand-icon { width: 32px; height: 32px; }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
/* Шапка — в одну строку на всех языках (LP1j): пункты меню не переносятся. */
.desktop-nav { display: flex; gap: 28px; margin-left: auto; font-size: 15px; color: var(--text-muted); }
.desktop-nav a { white-space: nowrap; transition: color var(--speed) var(--ease); }
.desktop-nav a:hover { color: var(--brand-text); }
.header-actions { display: flex; align-items: center; gap: 20px; margin-left: 12px; }
/* Значки шапки — бот и «Войти» (LP1k, как на iec9.com) — один компонент: 44×44 на всех ширинах, подсказка своя: по
   наведению и фокусу, справа от значка не выходит — на узком экране не даёт горизонтальной прокрутки (владелец 29.10). */
.header-bot, .header-login { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 10px; color: var(--text-muted); transition: color var(--speed) var(--ease), background var(--speed) var(--ease); }
.header-bot:hover, .header-bot:focus-visible, .header-login:hover, .header-login:focus-visible { color: var(--brand-text); background: var(--brand-soft); }
.header-bot::after, .header-login::after { content: attr(data-tip); display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; padding: 6px 10px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 13px; line-height: 18px; white-space: nowrap; pointer-events: none; }
.header-bot:hover::after, .header-bot:focus-visible::after, .header-login:hover::after, .header-login:focus-visible::after { display: block; }
.mobile-nav { display: none; }
/* Список языков (владелец 30.10, LP1i): кнопка — значок, код и шеврон, ширина одна на всех языках (код — в ячейке
   постоянной ширины); список — под кнопкой по её правому краю, поверх содержимого, как раскрытое меню телефона. */
.lang-menu { position: relative; flex: none; }
.lang-menu > summary { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted); font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: .02em; list-style: none; cursor: pointer; transition: color var(--speed) var(--ease), background var(--speed) var(--ease); }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover, .lang-menu[open] > summary { color: var(--text); background: var(--bg-subtle); }
.lang-menu > summary > .icon { width: 18px; height: 18px; }
.lang-menu > summary > .icon:last-child { width: 16px; height: 16px; transition: transform var(--speed) var(--ease); }
.lang-menu[open] > summary > .icon:last-child { transform: rotate(180deg); }
.lang-menu__code { width: 22px; text-align: center; }
.lang-menu__name { display: none; }
.lang-menu__list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; display: flex; flex-direction: column; min-width: 180px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.lang-menu__list a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; padding: 8px 12px; border-radius: 8px; font-size: 15px; line-height: 24px; transition: background var(--speed) var(--ease); }
.lang-menu__list a:hover { background: var(--bg-subtle); }
.lang-menu__list .icon { width: 18px; height: 18px; color: var(--brand-text); }

/* ---------------------------------------------------------------- кнопки и ссылки */
.button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; min-height: 52px; padding: 12px 22px; border: 1px solid transparent; border-radius: 10px; font-size: 16px; font-weight: 500; line-height: 24px; text-align: center; transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease), transform var(--speed) var(--ease); }
.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--button); color: var(--button-text); }
.button--primary:hover { background: var(--button-hover); }
.button--outline { border-color: var(--border-strong); background: var(--surface); }
.button--outline:hover { border-color: var(--brand); background: var(--brand-soft); }
.button--small { min-height: 44px; padding: 8px 16px; font-size: 14px; }
.text-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--brand-text); font-size: 15px; font-weight: 500; }
.text-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.text-link .icon { width: 18px; height: 18px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 32px; }

/* ---------------------------------------------------------------- общие блоки */
h1 { font-size: clamp(40px, 5vw, 64px); font-weight: 600; line-height: 1.08; letter-spacing: -.04em; text-wrap: balance; }
h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 600; line-height: 1.2; letter-spacing: -.03em; }
.section { padding: 88px 0; }
.section--subtle { background: var(--bg-subtle); border-block: 1px solid var(--border); }
.section--tight { padding-top: 0; }
.section-text { max-width: 760px; margin-top: 20px; color: var(--text-muted); font-size: 17px; line-height: 1.75; }
.section-text + .text-link { margin-top: 12px; }
.text-links { display: flex; flex-wrap: wrap; column-gap: 32px; margin-top: 12px; }
.page-head { padding: 72px 0 40px; }
.hero-lead { margin-top: 24px; color: var(--text-muted); font-size: 18px; line-height: 1.75; text-wrap: pretty; }
.note { margin-top: 20px; color: var(--text-muted); font-size: 15px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }

.marks { display: grid; gap: 14px; margin-top: 24px; }
.marks li { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; line-height: 1.6; }
.marks .icon { margin-top: 2px; color: var(--brand); }
/* Список на всю ширину — в две колонки на широком экране, в одну на узком. Колонки газетные, а не сетка: в сетке
   короткий пункт ждёт высокого соседа по строке, и под ним остаётся дыра (владелец 29.10). */
.marks--columns { display: block; columns: 2; column-gap: 48px; }
.marks--columns li { break-inside: avoid; margin-bottom: 14px; }
.marks--columns li:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- главная: первый экран */
.hero { padding: 80px 0 88px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
.hero-note { margin-top: 20px; color: var(--text-muted); font-size: 14px; }

/* Макет сообщения бота — вёрсткой: текст из словаря, переводится вместе со страницей. */
.tg-mock { padding: 20px; border-radius: 20px; background: var(--tg-bg); box-shadow: var(--shadow); min-width: 0; }
.tg-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 600; }
.tg-top img { width: 36px; height: 36px; border-radius: 50%; }
.tg-bubble { display: grid; gap: 10px; padding: 14px 16px; border-radius: 14px 14px 14px 4px; background: var(--tg-bubble); box-shadow: var(--shadow-small); font-size: 15px; line-height: 1.5; }
.tg-head { font-weight: 600; }
.tg-quote { padding-left: 10px; border-left: 3px solid var(--brand); font-style: italic; }
.tg-muted { color: var(--text-muted); font-size: 14px; }
.tg-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.tg-keys span { display: grid; place-items: center; min-height: 40px; padding: 8px; border-radius: 10px; background: var(--tg-key); color: var(--text); font-size: 14px; font-weight: 500; text-align: center; }
.tg-keys--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tg-keys + .tg-bubble { margin-top: 12px; }

/* ---------------------------------------------------------------- как это работает */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 40px; }
.steps li { padding-top: 20px; border-top: 2px solid var(--brand); }
.steps p { color: var(--text-muted); font-size: 16px; line-height: 1.7; }
.steps h3 { margin-bottom: 6px; color: var(--text); font-size: 19px; font-weight: 600; line-height: 1.35; }

/* ---------------------------------------------------------------- финал */
.closing-panel { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 48px; border: 1px solid var(--border); border-radius: 20px; background: var(--closing); }
.closing-panel p { margin-top: 14px; color: var(--text-muted); font-size: 17px; }
.closing-panel .actions { flex: none; margin-top: 0; }

/* ---------------------------------------------------------------- цены */
.price-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.price-table th, .price-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.price-table thead th { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.price-table tbody th { font-weight: 600; }
.price-blocks { display: grid; gap: 48px; margin-top: 56px; }
.price-table--spaced { margin-top: 28px; }

/* ---------------------------------------------------------------- вопросы */
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 44px; padding: 20px 0; font-size: 18px; font-weight: 500; }
.faq-item summary:hover { color: var(--brand-text); }
.faq-item summary .icon { color: var(--text-muted); transition: transform var(--speed) var(--ease); }
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-answer { padding: 0 40px 24px 0; color: var(--text-muted); font-size: 16px; line-height: 1.75; }

/* ---------------------------------------------------------------- контакты, юридические, 404 */
.seller { margin-top: 56px; }
.seller p { margin-top: 12px; }
.todo { margin-top: 16px; padding: 14px 18px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--text-muted); }
.legal { font-size: 16px; line-height: 1.75; }
.legal h2 { margin: 40px 0 12px; font-size: 24px; }
.legal p, .legal ul, .legal ol { margin-top: 12px; }
.legal ul { list-style: disc; padding-left: 24px; }
.legal ol { list-style: decimal; padding-left: 24px; }
.legal li + li { margin-top: 8px; }
.nf { padding: 72px 0; }
.nf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.nf-block h1 { font-size: 32px; }
.nf-block p { margin-top: 12px; color: var(--text-muted); }
.nf-block .text-link { margin-top: 8px; }

/* ---------------------------------------------------------------- подвал */
.site-footer { margin-top: 24px; border-top: 1px solid var(--border); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding: 32px 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-left: auto; font-size: 15px; color: var(--text-muted); }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-nav a:hover { color: var(--brand-text); }
.footer-copy { color: var(--text-muted); font-size: 14px; }

/* ---------------------------------------------------------------- адаптивность */
@media (max-width: 1099px) {
  .container { width: calc(100% - 64px); }
  .header-row { gap: 20px; }
  .desktop-nav { gap: 20px; }
  .hero-grid { gap: 40px; }
  .split { gap: 40px; }
  .closing-panel { flex-direction: column; align-items: stretch; }
}

/* Узкая шапка: разделы и список языков — в меню, в шапке остаются значки бота и «Войти». Правила меню —
   только для его кнопки (.mobile-nav > summary) и прямых строк (nav > a): иначе они задели бы список языков в меню. */
@media (max-width: 959px) {
  .desktop-nav, .header-actions > .lang-menu { display: none; }
  .header-actions { gap: 12px; margin-left: auto; }
  .mobile-nav { display: block; }
  .mobile-nav > summary { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px; }
  .header-bot, .header-login { border: 1px solid var(--border); }
  .mobile-nav > summary > .icon:last-child { display: none; }
  .mobile-nav[open] > summary > .icon:first-child { display: none; }
  .mobile-nav[open] > summary > .icon:last-child { display: block; }
  .mobile-nav nav { position: absolute; left: 0; right: 0; top: calc(100% + 8px); display: flex; flex-direction: column; padding: 8px 16px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
  .mobile-nav nav > a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 16px; }
  .mobile-nav nav .icon { width: 16px; height: 16px; color: var(--text-muted); }
  /* Список языков в меню — последней строкой меню (без разделителя снизу): значок, название, шеврон справа на месте
     стрелки; раскрывается под строкой в потоке меню, строки — с отступом под название (значок 16 + зазор 12),
     галочка — цветом бренда, как в шапке. */
  .mobile-nav .lang-menu > summary { gap: 12px; height: auto; min-height: 48px; padding: 10px 0; border: 0; border-radius: 0; background: none; color: inherit; font-size: 16px; font-weight: 400; line-height: 1.6; letter-spacing: normal; }
  .mobile-nav .lang-menu > summary > .icon { width: 16px; height: 16px; }
  .mobile-nav .lang-menu__code { display: none; }
  .mobile-nav .lang-menu__name { display: block; flex: 1; }
  .mobile-nav .lang-menu__list { position: static; min-width: 0; padding: 0 0 8px; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .mobile-nav .lang-menu__list a { min-height: 48px; padding: 10px 0 10px 28px; border-radius: 0; font-size: 16px; }
  .mobile-nav .lang-menu__list .icon { color: var(--brand-text); }
  .hero-grid { grid-template-columns: 1fr; }
  .tg-mock { max-width: 520px; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .split { grid-template-columns: 1fr; }
  .marks--columns { columns: 1; }
  .nf-grid { grid-template-columns: 1fr; }
}

@media (max-width: 719px) {
  .container { width: calc(100% - 32px); }
  .header-row { height: 64px; gap: 12px; }
  .brand-name { font-size: 17px; }
  .hero { padding: 40px 0 56px; }
  h1 { font-size: clamp(32px, 9.5vw, 44px); }
  .hero-lead { font-size: 16px; }
  .section { padding: 56px 0; }
  .section--tight { padding-top: 0; }
  .page-head { padding: 40px 0 28px; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .button { width: 100%; }
  .tg-mock { padding: 14px; }
  .closing-panel { padding: 28px 20px; }
  .faq-item summary { font-size: 16px; }
  .faq-answer { padding-right: 0; font-size: 15px; }
  /* Таблица цен на телефоне — карточками: строка — страна, ячейка — подпись столбца и значение. */
  .price-table thead { display: none; }
  .price-table, .price-table tbody, .price-table tr, .price-table th, .price-table td { display: block; width: 100%; }
  .price-table tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .price-table th, .price-table td { padding: 4px 0; border: 0; }
  .price-table td { display: flex; justify-content: space-between; gap: 16px; }
  .price-table td { white-space: nowrap; }
  .price-table td::before { content: attr(data-label); color: var(--text-muted); white-space: normal; }
  .footer-nav { margin-left: 0; width: 100%; }
}
