/* ═══════════════════════════════════════════════════════════════════════
   MyWay Pro — дизайн-система «лайм + чёрный» (стиль VK × Telegram × iOS)
   Подключается ПОСЛЕ app.css и переопределяет токены и компоненты.
   Спецификация: docs/superpowers/specs/2026-10-29-redesign-lime-design.md
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Токены: тёмная тема (по умолчанию) ── */
:root {
    --lime: #B6F400;
    --accent: #B6F400;
    --accent-2: #8FD000;
    --accent-grad: linear-gradient(135deg, #C8FF2E, #A5E600);
    --on-accent: #0B0B0C;
    --accent-text: #B6F400;
    --danger: #FF453A;
    --bg: #0B0B0C;
    --bg-glow: #0B0B0C;
    --card: #151517;
    --card-2: #1E1E21;
    --border: #2A2A2E;
    --text: #F5F5F7;
    --muted: #9A9AA2;
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -14px rgba(0,0,0,.7);
    --glow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 30px -16px rgba(182,244,0,.28);
    --radius-card: 22px;
    --radius-ctl: 15px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: dark;
}
/* Прежние цветовые схемы-акценты больше не используются: бренд один */
[data-theme="green"], [data-theme="purple"], [data-theme="orange"], [data-theme="blue"] {
    --accent: #B6F400; --accent-2: #8FD000; --accent-grad: linear-gradient(135deg, #C8FF2E, #A5E600);
}

/* ── Токены: светлая тема — те же цвета ── */
[data-mode="light"] {
    --accent-text: #4F7A00;
    --danger: #E5352B;
    --bg: #F4F6EF;
    --bg-glow: #F4F6EF;
    --card: #FFFFFF;
    --card-2: #ECEFE6;
    --border: #E1E5D8;
    --text: #0B0B0C;
    --muted: #6B6F66;
    --shadow: 0 1px 2px rgba(11,11,12,.04), 0 10px 28px -16px rgba(11,11,12,.18);
    --glow: 0 1px 2px rgba(11,11,12,.05), 0 14px 32px -16px rgba(120,170,0,.40);
    color-scheme: light;
}

/* ── База ── */
body {
    background: var(--bg) !important;
    font-family: var(--font);
    font-size: 16px; line-height: 1.4;
    letter-spacing: 0;
}
body::before, body::after { display: none !important; }              /* без «северного сияния» */
a { color: var(--accent-text); }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Крупные заголовки как в iOS: никаких градиентов в тексте */
h1, h2, h3, .badge-name, .path-title, .day-label, .comment-head, .sphere-name {
    font-family: var(--font-display); letter-spacing: -0.02em;
}
h1 {
    font-size: 32px; line-height: 1.1; font-weight: 600; margin: 2px 0 14px;
    background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--text);
}
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
.muted { color: var(--muted); }

/* ── Карточки: плоские поверхности, крупное скругление ── */
.card {
    background: var(--card) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow) !important;
    padding: 18px;
}
.card-flat { background: var(--card-2); border-radius: 16px; }
@media (hover: hover) {
    .card:hover { border-color: var(--border); }
}

/* ── Кнопки ── */
.btn {
    border-radius: var(--radius-ctl); font-weight: 600; font-size: 16px; padding: 13px 20px;
    letter-spacing: 0; transition: transform .12s ease, filter .15s ease, background .15s ease;
}
.btn::after { display: none !important; }                            /* без блика */
.btn-primary { background: var(--accent) !important; color: var(--on-accent) !important; box-shadow: none !important; }
.btn-primary:active { transform: scale(.98); filter: brightness(.95); }
@media (hover: hover) { .btn-primary:hover { transform: none; filter: brightness(1.06); } }
.btn-outline { background: var(--card-2) !important; color: var(--text); border: 0 !important; }
.btn-outline:active { filter: brightness(.95); }
.btn-danger { background: var(--danger) !important; color: #fff !important; box-shadow: none !important; }
.btn-danger-outline { color: var(--danger) !important; background: color-mix(in srgb, var(--danger) 10%, var(--card-2)) !important; }
.btn-vk { background: #0077FF !important; color: #fff !important; }
.btn[disabled], .btn:disabled { opacity: .45; }
.btn-sm { padding: 9px 16px; font-size: 14px; border-radius: 13px; }

/* ── Поля ввода ── */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="file"],
.form-control, .form-select, textarea.form-control, select.form-select, textarea {
    background: var(--card-2) !important; border: 1.5px solid transparent !important;
    border-radius: var(--radius-ctl) !important; color: var(--text); font-size: 16px; padding: 13px 15px;
}
input:focus, .form-control:focus, .form-select:focus, textarea:focus {
    border-color: var(--accent) !important; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent) !important;
}
label { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 7px; }

/* ── Шапка главной и аватар ── */
.top-header { gap: 14px; margin-bottom: 18px; }
.top-header h2 { font-size: 21px; font-weight: 600; margin: 0; line-height: 1.2; }
.avatar-circle {
    width: 56px; height: 56px; padding: 0; box-shadow: none !important;
    background: var(--card-2) !important; border: 2px solid var(--accent); font-size: 24px;
}
a:hover > .avatar-circle { transform: none; }

/* ── Истории: круги с лаймовым кольцом и подписью (как у VK и Telegram) ── */
.stories-row { gap: 14px; padding: 4px 2px 6px; margin-bottom: 14px; }
.story-item { flex: 0 0 auto; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.story-item-title {
    width: 100%; text-align: center; font-size: 12px; line-height: 1.2; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.story-circle, .story-add { width: 72px !important; height: 72px !important; border-radius: 50% !important; box-shadow: none !important; }
.story-circle {
    padding: 3px; border: 0 !important;
    background: var(--accent) !important;
    display: flex; align-items: center; justify-content: center; overflow: visible; position: relative;
}
.story-circle img {
    position: static !important; width: 100%; height: 100%; border-radius: 50% !important; object-fit: cover;
    border: 3px solid var(--bg); box-sizing: border-box;
}
.story-circle::after { display: none !important; }
.story-circle span { display: none !important; }
.story-circle:not(:has(img))::before {   /* история без фото: внутри — её собственный градиент */
    content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 3px solid var(--bg); box-sizing: border-box;
    background: linear-gradient(135deg, var(--g1, #D6FF5C), var(--g2, #A5E600));
}
.story-circle.viewed { background: var(--border) !important; }
.story-circle.viewed img { opacity: .8; }
.story-circle:hover { transform: none; }
.story-add {
    border: 2px dashed color-mix(in srgb, var(--accent) 70%, var(--border)) !important;
    background: color-mix(in srgb, var(--accent) 10%, transparent) !important;
    color: var(--accent-text) !important; font-size: 30px; font-weight: 300;
    display: flex; align-items: center; justify-content: center;
}
.story-add:hover { transform: none; }
.stories-nav-btn { background: var(--card); }

/* ── Плитки статистики ── */
.stat-row { gap: 10px; }
.stat-tile {
    background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 16px 8px;
    box-shadow: var(--shadow); text-decoration: none; color: var(--text);
}
.stat-tile:hover { transform: none; box-shadow: var(--shadow); }
.stat-tile i { background: var(--accent) !important; color: var(--on-accent) !important; box-shadow: none !important; border-radius: 10px; }
.stat-tile .val { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }

/* ── Кольцо прогресса и недельные точки ── */
.ring {
    background: conic-gradient(from -90deg, var(--accent) calc(var(--pct, 0) * 1%), var(--border) 0) !important;
    filter: none !important;
}
.ring::after { background: var(--card); }
.ring .ring-text > div:first-child { font-family: var(--font-display); letter-spacing: -0.03em; }
.week-dot.active { background: var(--accent) !important; box-shadow: none !important; }
.week-dot.today { outline-color: var(--accent); }

/* ── Списки как в Telegram: склеенные строки с цветной иконкой, шевроном и разделителем ── */
.list-item {
    background: var(--card); border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
    margin: 0; padding: 13px 16px; box-shadow: none; color: var(--text); gap: 12px; min-height: 58px;
}
.list-item:first-child, :not(.list-item) + .list-item {
    border-top-left-radius: var(--radius-card); border-top-right-radius: var(--radius-card);
}
.list-item:last-child, .list-item:has(+ :not(.list-item)) {
    border-bottom-left-radius: var(--radius-card); border-bottom-right-radius: var(--radius-card);
    border-bottom-color: transparent; margin-bottom: 14px;
}
.list-item:active { transform: none; background: var(--card-2); }
a.list-item:hover { border-color: var(--border); border-bottom-color: var(--border); background: var(--card); }
a.list-item:hover i.bi-chevron-right { transform: none; color: var(--muted); }
.list-item > div:first-child { min-width: 0; }
.list-item > div:first-child > i:first-child {
    width: 34px; height: 34px; margin-right: 12px; border-radius: 10px; font-size: 17px;
    background: var(--accent) !important; color: var(--on-accent) !important;
}
.list-item h3 { margin: 0; }
.list-item i.bi-chevron-right { color: var(--muted); font-size: 14px; }
.list-item-danger > div:first-child > i:first-child { background: var(--danger) !important; color: #fff !important; }
@media (hover: hover) and (min-width: 900px) {
    .card:hover, .list-item:hover { box-shadow: var(--shadow); }
}

/* ── Статусы ── */
.badge-status { padding: 4px 11px; font-size: 12px; font-weight: 600; }
.badge-approved { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent-text); }
.badge-pending  { background: rgba(255,214,10,.16); color: #FFD60A; }
.badge-rejected { background: rgba(255,69,58,.16); color: #FF6B61; }
[data-mode="light"] .badge-approved { background: #E6F9A8; color: #3F6400; }
[data-mode="light"] .badge-pending  { background: #FFF2C2; color: #8A6500; }
[data-mode="light"] .badge-rejected { background: #FFE0DD; color: #B3261E; }

/* ── Кнопка «+» ── */
.fab { background: var(--accent) !important; color: var(--on-accent) !important; box-shadow: var(--shadow); }

/* ── Нижняя панель (телефон): стеклянная капсула, лаймовая «таблетка» выбранной вкладки ── */
.bottom-nav { color: var(--text); }
.bottom-nav a { color: var(--muted); font-weight: 600; }
.bottom-nav a.active { background: var(--accent) !important; color: var(--on-accent) !important; box-shadow: none !important; }
[data-mode="light"] .bottom-nav a.active { color: var(--on-accent) !important; }
@media (max-width: 899px) {
    .bottom-nav {
        background: color-mix(in srgb, var(--card) 80%, transparent) !important;
        border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
        border-radius: 28px; backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
        box-shadow: 0 16px 38px -16px rgba(0,0,0,.55);
    }
    [data-mode="light"] .bottom-nav { box-shadow: 0 16px 38px -18px rgba(11,11,12,.30); }
    .bottom-nav a { border-radius: 20px; padding: 7px 12px; }
}
/* Компьютер: боковое меню как в Telegram Desktop */
@media (min-width: 900px) {
    body { background: var(--bg) !important; }
    .bottom-nav { background: var(--card) !important; border-right: 1px solid var(--border); backdrop-filter: none; }
    .bottom-nav a { padding: 11px 14px; border-radius: 13px; font-size: 15px; }
    .bottom-nav a:hover { transform: none; }
    .side-nav-logo { font-family: var(--font-display); letter-spacing: -0.02em; }
}
@media (hover: hover) and (min-width: 900px) {
    .bottom-nav a:hover { background: var(--card-2); color: var(--text); }
    .bottom-nav a.active:hover { background: var(--accent); color: var(--on-accent); }
}

/* ── Сообщения ── */
.messages li { background: var(--card-2); border-left: 0; border-radius: 16px; box-shadow: none; padding: 12px 16px; }

/* ── Переключатель темы ── */
.mode-switch { background: var(--card-2); border: 0; padding: 4px; border-radius: 15px; }
.mode-switch button { border-radius: 12px; }
.mode-switch button.active { background: var(--accent) !important; color: var(--on-accent) !important; box-shadow: none !important; }

/* ── Вход / регистрация ── */
.auth-hero img { box-shadow: none; border-radius: 24px; width: 84px; height: 84px; }
.auth-hero h1 { font-size: 30px; margin: 14px 0 4px; }
.auth-divider, .or-line { color: var(--muted); }

/* ── Загрузка фото ── */
.avatar-upload-circle { border: 2px solid var(--accent); box-shadow: none; }
.avatar-upload-badge { background: var(--accent) !important; color: var(--on-accent) !important; border-color: var(--bg); }
.avatar-upload-label { color: var(--accent-text); }
.photo-upload-box { border: 2px dashed var(--border); border-radius: 18px; background: var(--card-2); }
.photo-upload-box.has-image { border-color: var(--accent); }

/* ── Тест профориентации ── */
.quiz-scale-opt { border: 1.5px solid transparent; border-radius: 14px; background: var(--card-2); }
.quiz-scale-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--card-2)); box-shadow: none; color: var(--text); }
.quiz-scale-opt input { accent-color: var(--accent); }
.comment-card, .event-photo-note { background: var(--card); border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--border)); }
.comment-head i, .event-photo-note-head i { color: var(--accent-text); }

/* ── Профессии и сферы ── */
.sphere-num { background: var(--accent) !important; color: var(--on-accent) !important; box-shadow: none !important; border-radius: 12px; }
.profession-option { border: 1.5px solid transparent; border-radius: 16px; background: var(--card-2); }
.profession-option:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: none; }
.profession-option.is-chosen { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--card-2)); }
.profession-radio { border-color: var(--muted); }
.profession-radio::after { background: var(--on-accent); }
.profession-option.is-chosen .profession-radio { background: var(--accent); border-color: var(--accent); }
.pick-bar { background: color-mix(in srgb, var(--card) 86%, transparent); border-radius: 22px; }

/* ── Блоки заданий, дни, «путь к профессии» ── */
.block-card { background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.block-card-num, .day-label i { color: var(--accent-text); }
.block-card-days { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-text); }
.path-chip { background: var(--card-2); border: 0; }
.path-chip.active { background: var(--accent) !important; color: var(--on-accent) !important; box-shadow: none !important; }

/* ── Значки (цветные медали остаются фирменными для каждого значка) ── */
.badge-tile { border-radius: var(--radius-card); box-shadow: var(--shadow); }
.badge-tile.earned { border-color: var(--border); }
.badge-tile.earned:hover { transform: none; box-shadow: var(--shadow); }
.badge-state.ok { color: var(--accent-text); }
.badge-progress i { background: var(--accent); }

/* ── Анимация перед сферами ── */
.sphere-intro { background: var(--bg); }
.sphere-intro-orb > i { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.sphere-intro-orb > span { border-color: var(--accent); }
.sphere-intro-text { background: none; -webkit-text-fill-color: currentColor; color: var(--text); }
.sphere-intro-dots i.on { background: var(--accent); }

/* ── Фото и видео задания ── */
.task-media-image, .task-media-video { border-radius: 20px; }

/* ── Кнопка техподдержки (красная) ── */
.support-btn { border-radius: var(--radius-ctl); }

/* ── Мелочи ── */
.empty-state .icon { filter: none; }
.legal-table th, .legal-table td { border-bottom-color: var(--border); }
.code-row .btn { padding: 13px 14px; }
.danger-card { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.danger-head { color: var(--danger); }

/* Строка списка с иконкой: иконка слева, название и подпись одним столбцом (как в «Настройках» Telegram) */
.list-item > div:first-child:has(> i:first-child) {
    display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; row-gap: 1px; align-items: center;
}
.list-item > div:first-child:has(> i:first-child) > i:first-child { grid-row: 1 / span 2; margin-right: 0; }
.list-item > div:first-child:has(> i:first-child) > .small { grid-column: 2; }

/* ── Нижняя панель на телефоне: кнопки равной ширины — одинаковые промежутки между всеми вкладками ── */
@media (max-width: 899px) {
    .bottom-nav { justify-content: stretch; gap: 4px; }
    .bottom-nav a { flex: 1 1 0; min-width: 0; padding-left: 2px; padding-right: 2px; text-align: center; }
    .bottom-nav a i { margin: 0; }
}


/* ═══════════════════════════════════════════════════════════════════════
   ДВИЖЕНИЕ — единые правила анимаций (одна «физика» на весь сайт)
   Кривые: --ease-out — спокойное затухание, --spring — лёгкая «пружина» для нажатий и значков.
   Всё выключается при «уменьшить движение» в системе.
   ═══════════════════════════════════════════════════════════════════════ */
:root {
    --ease-out: cubic-bezier(.22, .8, .24, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --t-fast: .16s;
    --t-base: .38s;
}

/* ── Переходы между страницами (браузер сам плавно «перетекает» с экрана на экран) ── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .16s ease-in both; }
::view-transition-new(root) { animation: vt-in .34s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
/* Нижняя панель/боковое меню не мигают при смене страницы — остаются на месте */
.bottom-nav { view-transition-name: main-nav; }
::view-transition-group(main-nav) { animation-duration: .3s; animation-timing-function: var(--ease-out); }
::view-transition-old(main-nav), ::view-transition-new(main-nav) { animation-duration: .3s; }

/* ── Появление карточек каскадом ── */
@keyframes rise-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.container-app > * { animation: rise-in var(--t-base) var(--ease-out) both; }
.container-app > *:nth-child(2) { animation-delay: .04s; }
.container-app > *:nth-child(3) { animation-delay: .08s; }
.container-app > *:nth-child(4) { animation-delay: .12s; }
.container-app > *:nth-child(5) { animation-delay: .16s; }
.container-app > *:nth-child(6) { animation-delay: .20s; }
.container-app > *:nth-child(7) { animation-delay: .24s; }
.container-app > *:nth-child(n+8) { animation-delay: .28s; }
.container-app > .stories-row-wrap, .container-app > .messages { animation-name: rise-in; }

/* ── Нажатия: пружинистый отклик на всём, что нажимается ── */
.btn, .list-item, .stat-tile, .path-chip, .profession-option, .quiz-scale-opt, .story-item, .bottom-nav a, .mode-switch button, .badge-tile {
    transition: transform var(--t-fast) var(--spring), background-color var(--t-fast) ease, border-color var(--t-fast) ease,
                filter var(--t-fast) ease, box-shadow .25s ease, opacity .2s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.stat-tile:active, .path-chip:active, .quiz-scale-opt:active, .badge-tile:active { transform: scale(.96); }
.story-item:active { transform: scale(.94); }
.list-item:active { transform: scale(.992); }
.bottom-nav a:active { transform: scale(.92); }
.btn-primary { transition: transform var(--t-fast) var(--spring), filter var(--t-fast) ease, box-shadow .3s ease; }
@media (hover: hover) {
    a.list-item:hover i.bi-chevron-right { transform: translateX(3px); }
    .stat-tile:hover, .badge-tile.earned:hover { transform: translateY(-3px); }
}
.list-item i.bi-chevron-right { transition: transform .2s var(--ease-out), color .2s ease; }

/* ── Нижняя панель: «таблетка» выбранной вкладки появляется с пружинкой, значок подпрыгивает ── */
@keyframes nav-pill { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes icon-pop { 0% { transform: translateY(4px) scale(.7); } 60% { transform: translateY(-2px) scale(1.18); } 100% { transform: none; } }
.bottom-nav a.active { animation: nav-pill .45s var(--spring) both; }
.bottom-nav a.active i { animation: icon-pop .55s var(--spring) .05s both; }

/* ── Истории: кольцо акцентного цвета, нажатие — пружина ── */
.story-circle:not(.viewed) {
    background: var(--accent) !important;
}
@keyframes story-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.stories-row .story-item { animation: story-in .45s var(--spring) both; }
.stories-row .story-item:nth-child(2) { animation-delay: .05s; }
.stories-row .story-item:nth-child(3) { animation-delay: .10s; }
.stories-row .story-item:nth-child(4) { animation-delay: .15s; }
.stories-row .story-item:nth-child(5) { animation-delay: .20s; }
.stories-row .story-item:nth-child(n+6) { animation-delay: .25s; }

/* ── Прогресс: кольцо заполняется, полоски растут, точки недели «выскакивают» ── */
@property --pct { syntax: "<number>"; inherits: true; initial-value: 0; }
@keyframes ring-fill { from { --pct: 0; } }
.ring { animation: ring-fill 1.1s var(--ease-out) .15s both; }
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: none; } }
.badge-progress i, .week-row .week-dot[style*="flex"].active { transform-origin: left center; animation: bar-grow .8s var(--ease-out) .25s both; }
.week-row .week-dot[style*="flex"]:nth-child(2).active { animation-delay: .33s; }
.week-row .week-dot[style*="flex"]:nth-child(3).active { animation-delay: .41s; }
.week-row .week-dot[style*="flex"]:nth-child(4).active { animation-delay: .49s; }
.week-row .week-dot[style*="flex"]:nth-child(5).active { animation-delay: .57s; }
@keyframes dot-pop { 0% { transform: scale(.2); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
.week-day .week-dot.active { animation: dot-pop .5s var(--spring) .3s both; }
.week-day:nth-child(2) .week-dot.active { animation-delay: .36s; }
.week-day:nth-child(3) .week-dot.active { animation-delay: .42s; }
.week-day:nth-child(4) .week-dot.active { animation-delay: .48s; }
.week-day:nth-child(5) .week-dot.active { animation-delay: .54s; }
.week-day:nth-child(6) .week-dot.active { animation-delay: .60s; }
.week-day:nth-child(7) .week-dot.active { animation-delay: .66s; }
.progress-fill, .gradient-progress i { transform-origin: left center; animation: bar-grow .8s var(--ease-out) .2s both; }

/* ── Сообщения и уведомления выезжают сверху ── */
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
.messages li { animation: toast-in .4s var(--spring) both; }
.messages li:nth-child(2) { animation-delay: .06s; }

/* ── Поля, переключатель темы, выбор профессии ── */
input, textarea, select, .form-control { transition: border-color .18s ease, box-shadow .22s ease, background-color .18s ease; }
.mode-switch button { transition: background-color .2s ease, color .2s ease, transform var(--t-fast) var(--spring); }
.profession-option.is-chosen .profession-radio::after { animation: dot-pop .35s var(--spring) both; }
.quiz-scale-opt:has(input:checked) { animation: dot-pop .28s var(--spring) both; }

/* ── Значки: полученные «вспыхивают» при открытии вкладки ── */
@keyframes medal-in { 0% { opacity: 0; transform: scale(.5) rotate(-12deg); } 70% { transform: scale(1.1) rotate(3deg); } 100% { opacity: 1; transform: none; } }
.badge-tile.earned .badge-medal { animation: medal-in .65s var(--spring) both; }
.badge-grid .badge-tile:nth-child(2) .badge-medal { animation-delay: .06s; }
.badge-grid .badge-tile:nth-child(3) .badge-medal { animation-delay: .12s; }
.badge-grid .badge-tile:nth-child(4) .badge-medal { animation-delay: .18s; }
.badge-grid .badge-tile:nth-child(n+5) .badge-medal { animation-delay: .24s; }


/* ── Кнопка при отправке формы ── */
.btn.is-loading { pointer-events: none; opacity: .75; }

/* ── Уважаем «уменьшить движение» ── */
@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
    .story-circle:not(.viewed) { animation: none !important; }
}

/* ── Анимация вердикта проверки задания (галочка + конфетти / мягкий отказ) ── */
body.vd-open { overflow: hidden; }
.vd-backdrop { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s ease; }
.vd-backdrop.is-in { opacity: 1; }
.vd-box { position: relative; width: 100%; max-width: 380px; text-align: center; padding: 34px 26px 24px; border-radius: 28px;
    background: var(--card); border: 1px solid var(--border); box-shadow: 0 30px 80px -30px rgba(0,0,0,.8);
    transform: translateY(24px) scale(.92); transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.vd-backdrop.is-in .vd-box { transform: none; }
.vd-box.is-no { animation: vd-shake .5s .35s ease both; }
.vd-icon { position: relative; width: 92px; height: 92px; margin: 0 auto 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.vd-box.is-ok .vd-icon { background: var(--accent); color: var(--on-accent); animation: vd-pop .55s cubic-bezier(.34,1.56,.64,1) both, vd-pulse 1.4s .5s ease-out 2; }
.vd-box.is-no .vd-icon { background: color-mix(in srgb, var(--danger) 16%, var(--card-2)); color: var(--danger); animation: vd-pop .5s cubic-bezier(.34,1.56,.64,1) both; }
.vd-icon svg { width: 60px; height: 60px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.vd-mark { stroke-dasharray: 60; stroke-dashoffset: 60; animation: vd-draw .5s .25s cubic-bezier(.4,0,.2,1) forwards; }
.vd-title { font: 600 22px/1.2 var(--font-display); letter-spacing: -.02em; margin-bottom: 6px; }
.vd-box.is-ok .vd-title { animation: vd-rise .4s .3s both; }
.vd-points { display: inline-block; margin: 2px 0 8px; padding: 6px 14px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 15px; animation: vd-rise .4s .45s both; }
.vd-text { color: var(--muted); font-size: 15px; line-height: 1.5; margin-bottom: 20px; animation: vd-rise .4s .5s both; }
.vd-confetti { position: absolute; left: 50%; top: 50%; width: 8px; height: 12px; border-radius: 2px; opacity: 0; pointer-events: none;
    animation: vd-burst 1.1s var(--delay, 0s) cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes vd-pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes vd-draw { to { stroke-dashoffset: 0; } }
@keyframes vd-pulse { 0% { box-shadow: 0 0 0 0 rgba(182,244,0,.45); } 100% { box-shadow: 0 0 0 28px rgba(182,244,0,0); } }
@keyframes vd-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes vd-shake { 0%,100% { transform: none; } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes vd-burst { 0% { opacity: 1; transform: translate(-50%,-50%) scale(.6) rotate(0); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); } }
@media (prefers-reduced-motion: reduce) {
    .vd-box, .vd-backdrop { transition: none; transform: none; }
    .vd-box, .vd-box * { animation: none !important; }
    .vd-mark { stroke-dashoffset: 0; }
    .vd-confetti { display: none; }
}

/* Значок в строке списка никогда не сжимается: рядом с длинным текстом (например, причина закрытия профессии) он оставался овалом */
.avatar-circle { flex: 0 0 auto; aspect-ratio: 1 / 1; }
.u-9cc5e9c > div:last-child { min-width: 0; }
.profession-locked .avatar-circle { opacity: .92; }

/* Кнопка «Установить на iPhone» на странице входа */
.install-ios { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.install-ios .bi-apple { font-size: 1.15em; }

/* ── Телефон: ничто не бывает шире экрана (длинные названия, имена, слова без пробелов) ── */
html, body { max-width: 100%; }
body { overflow-wrap: anywhere; overflow-x: clip; }
.card, .card-flat, .list-item, .list-item > div, .list-item > a, .top-header > div, .story-item, .stat-tile, .profession-option,
.u-9cc5e9c > div, .path-chip, .auth-hero { min-width: 0; }
.list-item h3, .list-item .small, .card h3, h1, h2, h3 { overflow-wrap: anywhere; }
.list-item > div:first-child { flex: 1 1 0; }
.badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.badge-tile { min-width: 0; overflow: hidden; }
.badge-name, .badge-desc { overflow-wrap: anywhere; }
.btn { max-width: 100%; }
img, video, iframe, svg { max-width: 100%; }

/* ── Экран задания: «Описание» отдельно от «Задание» ── */
.task-sec { border-radius: var(--radius-card); padding: 18px; margin: 0 0 14px; }
.task-label { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-family: var(--font-display); font-weight: 800; }
.task-label i { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.task-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.task-desc { background: var(--card); border: 1px solid var(--border); }
.task-desc .task-label { font-size: 17px; color: var(--muted); }
.task-desc .task-label i { background: var(--card-2); color: var(--muted); }
.task-desc .task-text { font-size: 16px; line-height: 1.55; }
.task-main { background: color-mix(in srgb, var(--accent) 12%, var(--card)); border: 2px solid var(--accent); }
.task-main .task-label { font-size: 22px; color: var(--text); }
.task-main .task-label i { background: var(--accent); color: var(--on-accent); }
.task-main .task-text { font-size: 18px; line-height: 1.5; font-weight: 700; }
.task-reward { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px; }
.task-note { background: var(--card-2); border-radius: 16px; padding: 14px 16px; margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.task-note-title { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 4px; color: var(--muted); }
.task-reward-note { margin: -4px 4px 14px; }

/* ── Разбор теста ── */
.quiz-review-title { font-size: 20px; margin: 18px 0 10px; }
.qr { border-left: 4px solid var(--border); }
.qr-ok { border-left-color: var(--success, #22a559); }
.qr-bad { border-left-color: var(--danger, #e5484d); }
.qr-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.qr-badge { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.qr-badge-ok { background: color-mix(in srgb, var(--success, #22a559) 18%, transparent); color: var(--success, #22a559); }
.qr-badge-bad { background: color-mix(in srgb, var(--danger, #e5484d) 18%, transparent); color: var(--danger, #e5484d); }
.qr-opt { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; margin-top: 6px; border-radius: 12px; background: var(--card-2); color: var(--text); }
.qr-opt i { flex: none; margin-top: 2px; color: var(--muted); }
.qr-opt em { margin-left: auto; flex: none; font-size: 12px; font-style: normal; font-weight: 700; padding-left: 8px; }
.qr-opt-right { background: color-mix(in srgb, var(--success, #22a559) 16%, var(--card-2)); outline: 1.5px solid var(--success, #22a559); }
.qr-opt-right i, .qr-opt-right em { color: var(--success, #22a559); }
.qr-opt-wrong { background: color-mix(in srgb, var(--danger, #e5484d) 16%, var(--card-2)); outline: 1.5px solid var(--danger, #e5484d); }
.qr-opt-wrong i, .qr-opt-wrong em { color: var(--danger, #e5484d); }

/* Окно результата: между кнопками небольшой отступ, чтобы они не залезали друг на друга */
.vd-box .btn + .btn { margin-top: 12px; }

/* Кнопки друг под другом на странице: небольшой отступ */
.btn-block + .btn-block { margin-top: 12px; }

/* Кнопка «Следующее задание» над карточкой с ответом (пока ИИ проверяет): не склеивать с карточкой */
.btn-block + .card { margin-top: 16px; }

/* Форма ответа на задание: отступ между полем ввода и кнопкой «Отправить на проверку» */
.task-answer-form textarea { display: block; margin-bottom: 16px; }

/* Счётчик знаков под полем ответа */
.answer-counter { margin: -8px 0 12px; text-align: right; }
.answer-counter-over { color: var(--danger, #e5484d); }

/* Окно «Зачем тебе это?» */
.why-open { margin-bottom: 12px; }
body.why-open-body { overflow: hidden; }
.why-backdrop { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-end; justify-content: center; padding: 0;
    background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.why-backdrop[hidden] { display: none; }
.why-box { width: 100%; max-width: 520px; padding: 22px 20px 20px; border-radius: 28px 28px 0 0; background: var(--card); border: 1px solid var(--border); }
.why-title { font: 600 24px/1.2 var(--font-display); letter-spacing: -.02em; margin: 0 0 14px; }
.why-video { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; margin-bottom: 14px;
    border: 1px solid var(--border); border-radius: 18px; background: #000; }
.why-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (min-width: 640px) { .why-backdrop { align-items: center; padding: 20px; } .why-box { border-radius: 28px; } }
