/* Личный кабинет. Палитра — из modern.css; бирюзовое свечение разрешено только здесь и только на фигуре.
   Семь цветов чакр — только для графики: картинка чакры, её точка на фигуре, её кружок и маркеры в карточке. Текст ими не красим. */
.kab-page { --kab-light: 94, 234, 212; --kab-line: rgba(var(--accent-rgb), .22);
    --kab-c1: 204, 84, 68; --kab-c2: 221, 130, 64; --kab-c3: 236, 208, 100; --kab-c4: 124, 188, 144; --kab-c5: 104, 198, 210; --kab-c6: 122, 132, 226; --kab-c7: 180, 142, 222; }
.kab-page [data-kab-chakra="1"] { --kab-c: var(--kab-c1); }
.kab-page [data-kab-chakra="2"] { --kab-c: var(--kab-c2); }
.kab-page [data-kab-chakra="3"] { --kab-c: var(--kab-c3); }
.kab-page [data-kab-chakra="4"] { --kab-c: var(--kab-c4); }
.kab-page [data-kab-chakra="5"] { --kab-c: var(--kab-c5); }
.kab-page [data-kab-chakra="6"] { --kab-c: var(--kab-c6); }
.kab-page [data-kab-chakra="7"] { --kab-c: var(--kab-c7); }
.kab-page [hidden] { display: none !important; }
.kab-page p { margin: 0; }
.kab-page button { font-family: var(--font-primary); }
.kab-hero { padding: calc(var(--header-height) + 28px) 0 48px; }
.kab-hero__grid { display: grid; grid-template-columns: clamp(400px, 40vw, 520px) minmax(0, 1fr); gap: 48px clamp(36px, 6vw, 88px); align-items: center; }
.kab-side { display: grid; gap: 22px; align-content: center; min-width: 0; }
.kab-title { margin: 0; font-size: clamp(32px, 4vw, 48px); line-height: 1.1; letter-spacing: -.025em; }
.kab-lead { font-size: 18px; line-height: 1.6; color: var(--text-soft); max-width: 52ch; }
.kab-note { font-size: 15px; line-height: 1.55; color: var(--text-soft); max-width: 60ch; }
.kab-note a { white-space: nowrap; }
.kab-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--secondary-color); font: inherit; cursor: pointer; }
.kab-link:hover { color: var(--accent-hover); }
.kab-page :is(button, a, summary):focus-visible { outline: 2px solid var(--secondary-color); outline-offset: 3px; border-radius: 6px; }
.kab-status { min-height: 1.6em; font-size: 15px; color: var(--text-soft); }

/* Фигура */
.kab-figure-wrap { min-width: 0; }
.kab-figure { position: relative; --kab-edge: 0%; --kab-power: 0; }
.kab-figure__stage { position: relative; aspect-ratio: 1086 / 1448; border-radius: 40px; overflow: hidden; background: #00202b; }
.kab-figure:has(.kab-ring) { padding: 2.6%; }
.kab-figure:has(.kab-ring) .kab-figure__stage { border-radius: 9.2% / 6.9%; }
.kab-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.kab-ring path { fill: none; stroke: rgba(var(--accent-rgb), .28); stroke-width: 9; stroke-linecap: round; transition: stroke .8s ease; }
.kab-ring path.is-lit { stroke: rgb(var(--accent-color-rgb)); }
.kab-figure__layer, .kab-figure__layer img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.kab-figure__layer--lit { opacity: var(--kab-power); -webkit-mask-image: linear-gradient(to top, #000 calc(var(--kab-edge) - 4%), transparent calc(var(--kab-edge) + 12%)); mask-image: linear-gradient(to top, #000 calc(var(--kab-edge) - 4%), transparent calc(var(--kab-edge) + 12%)); }
.kab-figure__points { position: absolute; inset: 0; width: 100%; height: 100%; }
.kab-axis { stroke: rgba(170, 214, 208, .28); stroke-width: 2; }
.kab-beam { stroke: rgb(214, 255, 247); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 0 200; opacity: 0; filter: drop-shadow(0 0 10px rgba(var(--kab-light), .95)) drop-shadow(0 0 26px rgba(var(--kab-light), .6)); }
.kab-dot__halo, .kab-dot__bloom { transform-box: fill-box; transform-origin: center; }
.kab-dot__halo { fill: rgba(var(--kab-light), 0); transition: fill .7s ease; }
.kab-dot__bloom { fill: none; stroke: rgb(var(--kab-c)); stroke-width: 5; opacity: 0; }
.kab-dot__core { fill: rgba(6, 34, 42, .75); stroke: rgba(170, 214, 208, .6); stroke-width: 3; transition: fill .7s ease, stroke .7s ease; }
.kab-dot.is-lit .kab-dot__halo { fill: rgba(var(--kab-light), .3); }
.kab-dot.is-lit .kab-dot__core { fill: #f2fffc; stroke: rgb(var(--kab-light)); filter: drop-shadow(0 0 9px rgba(var(--kab-light), 1)); }
.kab-dot.is-current .kab-dot__halo { fill: rgba(var(--kab-light), .42); }
.kab-dot--chakra.is-lit .kab-dot__halo { fill: rgba(var(--kab-c), .4); }
.kab-dot--chakra.is-lit .kab-dot__core { stroke: rgb(var(--kab-c)); filter: drop-shadow(0 0 9px rgba(var(--kab-c), 1)); }
.kab-dot--chakra.is-current .kab-dot__halo { fill: rgba(var(--kab-c), .55); }
.kab-dot.is-open .kab-dot__core { stroke: rgb(var(--accent-color-rgb)); stroke-width: 6; }
.kab-hit { position: absolute; left: 50%; width: 64px; height: 44px; transform: translate(-50%, -50%); border: 0; background: none; cursor: pointer; }
.kab-year { min-height: 3.2em; margin-top: 14px !important; text-align: center; font-size: 15px; color: var(--text-soft); text-wrap: balance; }

/* Счёт и описание точки. Панели лежат в одной ячейке: смена текста не двигает соседей. */
.kab-score { display: grid; gap: 6px; }
.kab-score__count { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; font-weight: 600; color: var(--text-color); font-variant-numeric: tabular-nums; }
.kab-score__text { min-height: 3.3em; color: var(--text-soft); line-height: 1.65; max-width: 56ch; }
.kab-retry-slot:not(:has(button:not([hidden]))) { display: none; }
.kab-panel { border-top: 1px solid var(--kab-line); border-bottom: 1px solid var(--kab-line); padding: 22px 0 16px; display: grid; gap: 16px; }
.kab-panel__list { display: grid; list-style: none; margin: 0; padding: 0; }
.kab-panel__item { grid-area: 1 / 1; visibility: hidden; opacity: 0; transition: opacity .25s ease; display: grid; grid-template-columns: clamp(148px, 36%, 208px) minmax(0, 1fr); gap: 18px 24px; align-content: start; align-items: start; }
.kab-panel__item.is-active { visibility: visible; opacity: 1; }
.kab-panel__item p { line-height: 1.6; color: var(--text-soft); max-width: 60ch; }
.kab-panel__meta { font-size: 15px; }
.kab-panel__title { margin: 0; font-size: 22px; line-height: 1.3; }
.kab-panel__title span { font-weight: 400; color: var(--secondary-color); }
.kab-panel__watch strong { font-weight: 600; color: var(--text-color); }
.kab-panel__head { display: grid; gap: 10px; min-width: 0; }
.kab-panel__item .kab-panel__key { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--text-color); }
.kab-panel__key::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--kab-c)); }
.kab-panel__more { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; padding-top: 16px; border-top: 1px solid var(--kab-line); }
.kab-panel__gives { display: grid; gap: 8px; align-content: start; }
.kab-panel__item .kab-panel__sub { font-weight: 600; color: var(--text-color); }
.kab-gives { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kab-gives li { position: relative; padding-left: 18px; line-height: 1.5; color: var(--text-soft); }
.kab-gives li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--kab-c)); }
/* Картинка чакры. Пока свет до точки не дошёл, она приглушена; состояние повторяет подпись на картинке. */
.kab-art { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #00202b; }
.kab-art picture, .kab-art img { display: block; width: 100%; height: 100%; }
.kab-art img { object-fit: cover; filter: grayscale(.85) brightness(.6); transition: filter 1.2s ease; }
.kab-panel__item.is-lit .kab-art:not(.kab-art--next) img { filter: none; }
/* Переход пройден: картинка следующей чакры начинает проявляться. */
.kab-panel__item.is-lit .kab-art--next img { filter: grayscale(.45) brightness(.8); }
.kab-panel__item .kab-art__lock { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 4px 10px; border-radius: 999px; background: rgba(var(--bg-rgb), .8); font-size: 14px; line-height: 1.4; white-space: nowrap; color: var(--text-color); font-variant-numeric: tabular-nums; }
.kab-art__lock:empty { display: none; }
/* Переход: две соседние чакры, по нажатию открывается их описание. */
.kab-way { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 64px; padding: 8px; border: 1px solid var(--kab-line); border-radius: 14px; background: none; color: var(--text-color); text-align: left; cursor: pointer; transition: border-color .2s ease, transform .12s ease; }
.kab-way:hover { border-color: var(--secondary-color); }
.kab-way:active { transform: scale(.98); }
.kab-way picture, .kab-way img { display: block; width: 64px; height: 64px; }
.kab-way img { object-fit: cover; border-radius: 10px; filter: grayscale(.85) brightness(.6); transition: filter 1.2s ease; }
.kab-way.is-lit img { filter: none; }
.kab-way__text { display: grid; gap: 2px; min-width: 0; }
.kab-way__label { font-size: 14px; color: var(--text-light); }
.kab-way__name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.kab-panel__nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 520px; }
.kab-chips { display: flex; flex: 1; justify-content: space-between; gap: 4px; }
.kab-round, .kab-chip { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; border: 1px solid var(--kab-line); background: none; color: var(--text-color); font: 500 16px/1 var(--font-primary); cursor: pointer; transition: background-color .2s ease, border-color .2s ease, box-shadow .5s ease, color .5s ease, transform .12s ease; }
.kab-round { font-size: 22px; border-color: transparent; }
.kab-chip { color: var(--text-light); }
.kab-chip.is-lit { color: var(--text-color); border-color: transparent; box-shadow: inset 0 0 0 2px rgb(var(--kab-c)); }
.kab-chip:active, .kab-round:active:not(:disabled) { transform: scale(.94); }
.kab-round:disabled { opacity: .3; cursor: default; }
.kab-chip:hover, .kab-round:hover:not(:disabled) { border-color: var(--secondary-color); }
.kab-chip.is-active { background: var(--primary-color); border-color: var(--secondary-color); color: var(--text-color); }
.kab-actions { display: grid; justify-items: start; gap: 8px; }
.kab-actions__links { display: flex; flex-wrap: wrap; gap: 0 24px; }

/* Ступени */
.kab-section .section__title { text-align: left; }
.kab-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.kab-stage { display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 10px; padding: 24px; border-radius: 14px; background: rgba(var(--surface-rgb), .6); border: 1px solid var(--kab-line); }
.kab-stage h3 { margin: 0; }
.kab-stage p { color: var(--text-soft); line-height: 1.6; }
.kab-stage .kab-stage__goal { color: var(--secondary-color); font-size: 15px; }
.kab-stage .kab-stage__state { font-size: 15px; font-variant-numeric: tabular-nums; }
.kab-stage.is-done { border-color: rgba(var(--accent-color-rgb), .55); }
.kab-stage.is-done .kab-stage__state { color: var(--accent-color); }
.kab-bar { position: relative; height: 6px; margin-top: 8px; border-radius: 3px; background: rgba(var(--accent-rgb), .18); overflow: hidden; }
.kab-bar span { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--secondary-color); transition: width 1s ease; }
.kab-stage.is-done .kab-bar span { background: var(--accent-color); }

/* Записи, абонементы, сертификаты, история */
.kab-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; margin-top: 8px; }
.kab-card { padding: 24px; border-radius: 14px; border: 1px solid var(--kab-line); }
.kab-card h3 { margin: 0 0 14px; }
.kab-card__body { min-height: 120px; }
.kab-row { padding: 14px 0; border-top: 1px solid var(--kab-line); }
.kab-card .kab-row:first-child { border-top: 0; padding-top: 0; }
.kab-row__title { font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.kab-row__meta { margin-top: 4px !important; font-size: 15px; line-height: 1.5; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.kab-empty { color: var(--text-soft); line-height: 1.6; }
.kab-empty a { white-space: nowrap; color: var(--secondary-color); }
.kab-row + .kab-empty { padding-top: 14px; border-top: 1px solid var(--kab-line); font-size: 15px; }
.kab-history { min-height: 80px; }
.kab-history__list { columns: 2; column-gap: 48px; }
.kab-history .kab-row { break-inside: avoid; }
.kab-history .kab-row--light .kab-row__title::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 10px; border-radius: 50%; background: rgb(var(--kab-light)); }
.kab-history .button { margin-top: 24px; }
.kab-why p { max-width: 70ch; line-height: 1.7; color: var(--text-soft); }
.kab-why p + p { margin-top: 14px; }
.kab-exit { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--kab-line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.kab-exit .kab-status { flex: 1 1 100%; margin: 0; }

/* Движение. Только transform, opacity и filter: соседей оно не двигает. */
@keyframes kab-art-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes kab-line-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes kab-drift { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes kab-halo { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.16); } }
@keyframes kab-bloom { from { opacity: .9; transform: scale(.5); } to { opacity: 0; transform: scale(2.6); } }
@keyframes kab-pop { 50% { transform: scale(1.14); } }
@keyframes kab-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.kab-panel__item.is-active .kab-art { animation: kab-art-in .55s cubic-bezier(.2, .7, .2, 1) backwards; }
.kab-panel__item.is-active :is(.kab-panel__head, .kab-panel__more) > * { animation: kab-line-in .45s ease backwards; }
.kab-panel__item.is-active .kab-panel__head > :nth-child(1) { animation-delay: .06s; }
.kab-panel__item.is-active .kab-panel__head > :nth-child(2) { animation-delay: .1s; }
.kab-panel__item.is-active .kab-panel__head > :nth-child(3) { animation-delay: .14s; }
.kab-panel__item.is-active .kab-panel__head > :nth-child(4) { animation-delay: .18s; }
.kab-panel__item.is-active .kab-panel__more > :nth-child(1) { animation-delay: .22s; }
.kab-panel__item.is-active .kab-panel__more > :nth-child(2) { animation-delay: .26s; }
/* Зациклены только два элемента: ореол выбранной точки и медленное приближение картинки открытой чакры. */
.kab-dot.is-open .kab-dot__halo { animation: kab-halo 5s ease-in-out infinite; }
.kab-panel__item.is-active.is-lit .kab-art:not(.kab-art--next) img { animation: kab-drift 9s ease-in-out 1s infinite alternate; }
/* Разовые: точка чакры загорелась при этом визите, ступень закрыта этим визитом. */
.kab-dot.is-fresh .kab-dot__bloom { animation: kab-bloom 1.1s ease-out both; }
.kab-chip.is-fresh { animation: kab-pop .6s ease; }
.kab-stage.is-fresh.is-seen .kab-bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 244, 214, .9), transparent); animation: kab-sweep 1.6s ease-out .6s 2 both; }

/* Страница с кнопкой в MAX */
.kab-enter { display: grid; gap: 24px; padding: 24px 0; border-top: 1px solid var(--kab-line); border-bottom: 1px solid var(--kab-line); }
.kab-enter__main { display: grid; gap: 14px; justify-items: start; }
.kab-enter__qr { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px; align-items: center; }
.kab-qr { width: 132px; height: 132px; padding: 6px; border-radius: 10px; background: #fff; }
.kab-qr svg { display: block; width: 100%; height: 100%; }

@media (max-width: 1000px) {
    .kab-hero { padding-top: calc(var(--header-height) + 28px); }
    .kab-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .kab-figure-wrap, .kab-hero__grid > .kab-figure { width: min(100%, 520px); margin: 0 auto; }
    .kab-stages, .kab-cards { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .kab-card__body { min-height: 0; }
    .kab-history__list { columns: 1; }
    /* На входе сначала кнопка, потом картинка. */
    [data-kab="login"] .kab-side { order: -1; }
    [data-kab="login"] .kab-hero__grid > .kab-figure { width: min(100%, 360px); }
}
@media (max-width: 560px) {
    .kab-actions .button, .kab-enter .button { width: 100%; }
    .kab-enter__qr { display: none; }
    /* Семь кругов по 44px занимают всю строку, стрелки встают на картинку чакры. */
    .kab-panel { position: relative; padding-top: 18px; }
    .kab-panel__item, .kab-panel__more { grid-template-columns: minmax(0, 1fr); }
    .kab-panel__item { gap: 16px; }
    .kab-art { aspect-ratio: 16 / 10; }
    .kab-round { position: absolute; z-index: 1; top: 26px; right: 8px; background: rgba(var(--bg-rgb), .72); }
    .kab-round[data-kab-prev] { right: 60px; }
    .kab-chips { gap: 2px; }
    .kab-score__text { min-height: 4.95em; }
}
@media (prefers-reduced-motion: reduce) {
    .kab-page *, .kab-page *::before, .kab-page *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 355px) {
    .kab-chips { gap: 0; }
    .kab-chip { width: 40px; height: 40px; }
}
