/* ============ многостраничный сайт ============ */
/* плавные переходы между страницами (View Transitions API; где не поддерживается — обычный переход) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .42s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px) scale(.99); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
.topbar { view-transition-name: topbar; }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--ease); }

.nav a.on { color: var(--text); background: var(--surface-2); }
a.who { text-decoration: none; }
.burger { display: none; width: 40px; height: 40px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); cursor: pointer; position: relative; margin-left: 4px; flex: none; }
.burger span { position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .35s var(--ease), top .35s var(--ease); }
.burger span:first-child { top: 15px; }
.burger span:last-child { top: 23px; }
.menu-open .burger span:first-child { top: 19px; transform: rotate(45deg); }
.menu-open .burger span:last-child { top: 19px; transform: rotate(-45deg); }
.mnav { display: grid; gap: 4px; max-height: 0; overflow: hidden; padding: 0 16px; transition: max-height .45s var(--ease), padding .45s var(--ease); }
.mnav a { text-decoration: none; padding: 12px; border-radius: 12px; font-weight: 600; opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s var(--ease), background .2s; }
.mnav a:hover { background: var(--surface-2); }
.menu-open .mnav { max-height: 360px; padding: 6px 16px 16px; }
.menu-open .mnav a { opacity: 1; transform: none; }
.menu-open .mnav a:nth-child(2) { transition-delay: .04s; }
.menu-open .mnav a:nth-child(3) { transition-delay: .08s; }
.menu-open .mnav a:nth-child(4) { transition-delay: .12s; }
.mnav .btn { margin-top: 6px; justify-content: center; }

.page-head { padding: 36px 0 10px; }
.page-head h1 { font-size: clamp(32px, 4.6vw, 52px); letter-spacing: -.035em; line-height: 1.06; margin: 10px 0 14px; font-weight: 800; }
.page-head.narrow { max-width: 780px; }
.page-head .cta { margin-top: 6px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); }
.crumbs a { color: var(--muted); text-decoration: none; transition: color .2s; }
.crumbs a:hover { color: var(--text); }
.crumbs i { font-style: normal; opacity: .6; }
.hint { color: var(--muted); font-size: 14px; margin: 18px 0 0; }
.hint a:not(.btn), .prose a:not(.btn), .facts a:not(.btn), .note-card a:not(.btn), .note a:not(.btn), .warn a:not(.btn), .empty a:not(.btn) { color: #ff9aa6; text-decoration: none; border-bottom: 1px solid rgba(255, 150, 160, .3); transition: border-color .2s, color .2s; }
.hint a:not(.btn):hover, .prose a:not(.btn):hover, .facts a:not(.btn):hover, .note-card a:not(.btn):hover, .note a:not(.btn):hover, .empty a:not(.btn):hover { color: #ffc4cb; border-color: currentColor; }
.warn { margin-top: 18px; padding: 12px 14px; border-radius: 14px; font-size: 14px; color: #ffd59a; background: rgba(255, 181, 71, .08); border: 1px solid rgba(255, 181, 71, .25); max-width: 760px; }

/* страница приложения */
.app-hero { display: flex; align-items: center; gap: 20px; margin: 14px 0 18px; }
.app-hero h1 { margin: 0 0 8px; }
.app-hero-icon { width: 96px; height: 96px; border-radius: 24px; flex: none; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-size: 40px; font-weight: 800; box-shadow: 0 20px 40px -14px rgba(0, 0, 0, .7), 0 0 60px -20px rgba(244, 80, 100, .6); }
.tag-cat { display: inline-block; font-size: 13px; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 820px; }
.facts li { position: relative; padding: 14px 16px 14px 46px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: #d6d9e8; }
.facts li::before { content: ""; position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; border-radius: 50%; background: rgba(244, 63, 94, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 7v6M12 16.5v.5' fill='none' stroke='%23a9b2ff' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; }

/* плитки приложений (главная, похожие) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px 14px; border-radius: 18px; text-decoration: none; text-align: center; background: var(--surface); border: 1px solid var(--border); transition: transform .35s var(--ease), border-color .3s, background .3s; overflow: hidden; }
.tile::before, .how-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(200px circle at var(--mx, 50%) var(--my, 0%), rgba(244, 90, 110, .16), transparent 60%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.tile:hover { transform: translateY(-4px); border-color: rgba(244, 90, 110, .35); }
.tile:hover::before, .how-card:hover::before { opacity: 1; }
.tile-icon { width: 58px; height: 58px; border-radius: 15px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .7); transition: transform .45s var(--spring); }
.tile:hover .tile-icon { transform: scale(1.1) rotate(-4deg); }
.tile span { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.more { text-align: center; margin-top: 24px; }
.note-card { display: flex; gap: 16px; align-items: flex-start; margin-top: 26px; padding: 20px; border-radius: 20px; background: linear-gradient(135deg, rgba(244, 63, 94, .1), rgba(251, 138, 92, .06)); border: 1px solid rgba(244, 90, 110, .25); }
.note-card p { margin: 6px 0 0; color: var(--muted); }
.note-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); flex: none; }
.note-ico svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }

/* призыв к действию */
.cta-card { position: relative; margin: 80px 0 10px; padding: 48px 28px; border-radius: 28px; text-align: center; overflow: hidden; background: radial-gradient(120% 140% at 50% 0%, rgba(244, 63, 94, .22), transparent 60%), var(--surface); border: 1px solid rgba(244, 90, 110, .3); }
.cta-card::after { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, rgba(244, 80, 100, .18), transparent 30%); animation: rot 12s linear infinite; pointer-events: none; }
.cta-card > * { position: relative; z-index: 1; }
.cta-card h2 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.03em; margin: 0 0 10px; }
.cta-card p { color: var(--muted); margin: 0 0 24px; }
.cta-card .cta { justify-content: center; }

/* каталог: карточка — ссылка */
a.card { text-decoration: none; color: inherit; }
.card[hidden] { display: none; }
.card .btn { margin-top: auto; }

/* текстовые страницы */
.doc { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 20px; }
.doc.single { grid-template-columns: minmax(0, 780px); }
.toc { position: sticky; top: 84px; display: grid; gap: 2px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.toc a { font-size: 14px; color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 10px; transition: background .2s, color .2s; }
.toc a:hover, .toc a.on { color: var(--text); background: var(--surface-2); }
.prose { max-width: 780px; }
.prose section { padding: 22px 24px; margin-bottom: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); scroll-margin-top: 90px; transition: border-color .4s, box-shadow .4s; }
.prose section:target { border-color: rgba(244, 90, 110, .5); box-shadow: 0 0 0 4px rgba(244, 63, 94, .12); }
.prose h2 { font-size: 20px; margin: 0 0 10px; letter-spacing: -.01em; }
.prose p, .prose li { color: #cfd2e2; }
.prose p { margin: 0 0 10px; }
.prose p:last-child { margin-bottom: 0; }
.prose ol, .prose ul { margin: 0 0 10px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: #ff8f9c; font-weight: 700; }

/* кабинет: шаги */
.flow { list-style: none; margin: 18px 0 8px; padding: 0; display: grid; gap: 10px; }
.flow li { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); transition: border-color .4s, background .4s, opacity .4s; opacity: .65; }
.flow li b { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border-2); transition: all .4s var(--spring); }
.flow li div { flex: 1; min-width: 0; }
.flow li strong { display: block; }
.flow li span { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.flow li.cur { opacity: 1; border-color: rgba(244, 90, 110, .4); background: linear-gradient(135deg, rgba(244, 63, 94, .12), rgba(251, 138, 92, .05)); }
.flow li.cur b { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 0 0 6px rgba(244, 63, 94, .15); }
.flow li.done { opacity: 1; }
.flow li.done b { border-color: transparent; color: transparent; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4 8-9' fill='none' stroke='%23062a14' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.flow li.done span { color: var(--ok); }

/* 404 */
.nf { padding: 90px 0 40px; text-align: center; }
.nf-code { font-size: clamp(90px, 18vw, 180px); font-weight: 800; letter-spacing: -.06em; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* подвал */
.footer { padding: 0; margin-top: 70px; border-top: 1px solid var(--border); text-align: left; }
.footer-in { max-width: 1200px; margin: 0 auto; padding: 44px 20px 24px; display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; }
.footer-in a { overflow-wrap: anywhere; }
.footer-brand p { color: var(--muted); font-size: 14px; max-width: 300px; }
.footer h4 { margin: 4px 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.footer-in > div:not(.footer-brand) a { display: block; color: var(--muted); text-decoration: none; font-size: 14px; padding: 4px 0; transition: color .2s; }
.footer-in a:hover { color: var(--text); }
.footer-copy { max-width: 1200px; margin: 0 auto; padding: 18px 20px 34px; color: var(--dim); font-size: 12.5px; border-top: 1px solid var(--border); }

@media (max-width: 960px) {
  .burger { display: block; }
  .doc { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; overflow-x: auto; scrollbar-width: none; }
  .toc a { white-space: nowrap; }
  .footer-in { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
/* кнопка «Личный кабинет» и её меню */
.acc { position: relative; }
.acc-btn { display: flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); transition: border-color .2s, background .2s; }
.acc-btn:hover, .acc.open .acc-btn { border-color: color-mix(in srgb, var(--a1) 45%, transparent); background: var(--surface-2); }
.acc-label .short { display: none; }
.acc-chev { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.acc.open .acc-chev { transform: rotate(180deg); }
.acc-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 260px; padding: 6px; border-radius: 18px; background: rgba(24, 24, 30, .98); border: 1px solid var(--border-2); box-shadow: 0 24px 60px -15px rgba(0, 0, 0, .85); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right; transition: opacity .2s, transform .25s var(--ease), visibility .2s; }
.acc.open .acc-menu { opacity: 1; visibility: visible; transform: none; }
.acc-email { display: grid; gap: 2px; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.acc-email small { font-size: 12px; color: var(--muted); }
.acc-email b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-menu a, .acc-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; font: inherit; font-size: 14.5px; font-weight: 500; color: var(--text); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; transition: background .15s; }
.acc-menu a:hover, .acc-menu button:hover { background: var(--surface-2); }
.acc-menu svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.acc-menu .danger { color: #ff8a95; }
.acc-menu .danger svg { stroke: #ff8a95; }
@media (max-width: 560px) {
  .acc-label .full { display: none; }
  .acc-label .short { display: inline; }
  .acc-btn { padding: 3px 8px 3px 3px; font-size: 13px; gap: 6px; }
  .acc-menu { position: fixed; right: 12px; left: 12px; top: 64px; width: auto; }
}

/* выход в мобильном меню */
.mnav-logout { font: inherit; font-weight: 600; text-align: left; color: #ff8a95; background: none; border: 0; padding: 12px; border-radius: 12px; cursor: pointer; display: grid; gap: 2px; opacity: 0; transform: translateY(-6px); transition: opacity .3s .16s, transform .3s .16s var(--ease), background .2s; }
.mnav-logout span { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.menu-open .mnav-logout { opacity: 1; transform: none; }
.mnav-logout:hover { background: rgba(255, 93, 108, .08); }
.menu-open .mnav { max-height: 460px; }
@media (max-width: 560px) {
  .account .btn-sm { padding: 8px 12px; font-size: 13px; }
  /* в шапке на телефоне — только значок аккаунта; выход — в меню */
  .account-box .who, .account-box #logout { display: none; }
  .account-box { padding: 3px; }
  .app-hero { flex-direction: column; align-items: flex-start; gap: 14px; }
  .app-hero-icon { width: 80px; height: 80px; border-radius: 20px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 14px 6px 12px; }
  .tile-icon { width: 50px; height: 50px; border-radius: 13px; }
  .tile span { font-size: 12px; }
  .flow li { flex-wrap: wrap; }
  .flow li .btn { width: 100%; }
  .cta-card { padding: 36px 18px; margin-top: 56px; }
  .prose section { padding: 18px; }
  .page-head { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ============ кабинет: вкладки и история ============ */
.tabs { position: relative; display: inline-flex; gap: 0; padding: 4px; margin: 22px 0 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.tabs button { position: relative; z-index: 1; font: inherit; font-weight: 600; font-size: 15px; color: var(--muted); background: none; border: 0; padding: 10px 20px; border-radius: 12px; cursor: pointer; transition: color .3s; display: inline-flex; align-items: center; gap: 8px; }
.tabs button.on { color: #fff; }
.tabs-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 12px; background: var(--grad); box-shadow: 0 6px 20px -6px var(--glow); transition: transform .45s var(--spring), width .45s var(--spring); }
.tabs-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 12px; display: inline-grid; place-items: center; background: rgba(255, 255, 255, .16); }
.tabs-n:empty { display: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }

.history { margin-top: 18px; scroll-margin-top: 170px; }
/* заголовок истории: текст слева, «Очистить» справа сверху — не съезжает на телефоне */
.history-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 6px 14px; margin-bottom: 16px; }
.history-head > div { min-width: 0; }
.history-head #histClear { margin-top: 2px; }
.history-head h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.history-head p { margin: 0; }
.hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hist-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); animation: card-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); transition: border-color .3s, transform .3s var(--ease); }
.hist-row:hover { border-color: var(--border-2); transform: translateX(3px); }
.hist-icon { width: 52px; height: 52px; border-radius: 13px; flex: none; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 20px; color: var(--muted); }
.hist-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hist-meta b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-meta span { font-size: 13px; color: var(--muted); }
.hist-meta small { font-size: 12.5px; color: #ffb3ba; }
.hist-status { flex: none; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.hist-status.ok { color: var(--ok); background: rgba(61, 220, 132, .1); }
.hist-status.bad { color: #ff8a95; background: rgba(255, 93, 108, .1); }
.hist-status.muted { color: var(--muted); background: var(--surface-2); }
.hist-status.run { color: var(--a2); background: color-mix(in srgb, var(--a1) 14%, transparent); }
.hist-status.run::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; animation: ping-c 1.4s infinite; vertical-align: 1px; }
@keyframes ping-c { 50% { opacity: .3; } }
.hist-empty { text-align: center; padding: 50px 20px; border-radius: 24px; background: var(--surface); border: 1px dashed var(--border-2); }
.hist-empty b { display: block; font-size: 18px; margin: 14px 0 6px; }
.hist-empty .btn { margin-top: 14px; }
.hist-empty-ico { width: 56px; height: 56px; margin: 0 auto; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--a1) 15%, transparent); }
.hist-empty-ico svg { width: 26px; height: 26px; fill: none; stroke: var(--a1); stroke-width: 1.8; stroke-linecap: round; }
@media (max-width: 560px) {
  .tabs { display: flex; }
  .tabs button { flex: 1; justify-content: center; }
  /* иконка | название | статус — в строку, кнопка — на всю ширину ниже */
  .hist-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: start; gap: 10px 12px; padding: 12px; }
  .hist-icon { width: 48px; height: 48px; }
  .hist-status { align-self: start; margin-top: 2px; font-size: 12px; padding: 4px 9px; }
  .hist-row .btn { grid-column: 1 / -1; width: 100%; }
  .hist-meta b { white-space: normal; }
  .history-head h2 { font-size: 21px; }
}

/* на телефоне счётчик в поле поиска скрываем — место для подсказки */
@media (max-width: 560px) { .searchbar .count { display: none; } }

/* информер Яндекс Метрики в подвале */
.footer-informer { display: flex; justify-content: center; padding: 6px 0 2px; opacity: .55; transition: opacity .2s; }
.footer-informer:hover { opacity: 1; }
.footer-informer img { display: block; border: 0; border-radius: 4px; }
