/* Smart Profile V2.2 — роли + обучалка (референс aurora_roles_demo_v2.html) */

.smart-profile-v2 {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.smart-profile-v2 .v2-role-group { width: 100%; margin-bottom: 1.25rem; }
.smart-profile-v2 .v2-role-group > h2,
.smart-profile-v2 .v2-role-sec {
    font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: #948fae; margin: 1.5rem 0 .75rem;
}
.smart-profile-v2 .v2-role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
}
@media (max-width: 767px) {
    .smart-profile-v2 .v2-role-grid { grid-template-columns: 1fr; }
}

.smart-profile-v2 .v2-role-card {
    position: relative;
    display: flex; align-items: center; flex-wrap: wrap; gap: .55rem .7rem;
    text-align: left; padding: .85rem .75rem .85rem .9rem;
    border: 1px solid rgba(147,142,160,.22);
    border-radius: 1rem;
    background: rgba(55,51,62,.45);
    color: #e7e0ef;
    cursor: pointer;
    user-select: none;
    transition: background .16s, border-color .16s, transform .1s;
    min-height: 56px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.smart-profile-v2 .v2-role-card:hover { background: rgba(70,65,85,.5); }
.smart-profile-v2 .v2-role-card:active { transform: scale(.99); }

.smart-profile-v2 .v2-role-icon-dot,
.smart-profile-v2 .v2-role-icon {
    flex: none; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.smart-profile-v2 .v2-role-label {
    flex: 1 1 8rem; min-width: 0;
    font-size: .9rem; font-weight: 700; line-height: 1.3;
    overflow-wrap: anywhere;
}
.smart-profile-v2 .v2-role-label i { font-style: normal; font-weight: 600; font-size: .75rem; color: #6b6784; margin-left: .3rem; white-space: nowrap; }
.smart-profile-v2 .v2-role-count,
.smart-profile-v2 .v2-role-badge {
    flex: none; font-size: .7rem; font-weight: 800;
    padding: .3rem .6rem; border-radius: 999px; color: #cac3d7; background: rgba(55,51,62,.6);
    white-space: nowrap;
}
.smart-profile-v2 .v2-role-x {
    flex: none; width: 32px; height: 32px; border-radius: 50%; border: none;
    background: transparent; color: #6b6784; font-size: 16px; cursor: pointer;
    display: grid; place-items: center;
}
.smart-profile-v2 .v2-role-x:hover { background: rgba(248,113,113,.12); color: #f87171; }
.smart-profile-v2 .v2-role-info {
    flex: none; padding: .2rem; color: #ccbeff; cursor: pointer; font-size: .85rem;
}
.smart-profile-v2 .v2-role-ghost {
    flex: none; border: 1px solid rgba(147,142,160,.3); background: transparent;
    color: #e7e0ef; font: inherit; font-size: .75rem; font-weight: 700;
    padding: .4rem .85rem; border-radius: 999px; cursor: pointer;
    white-space: nowrap; flex-shrink: 0;
}
.smart-profile-v2 .v2-role-ghost:hover { border-color: #7b5cff; color: #b3a2ff; }

.smart-profile-v2 .v2-role-card.state-target {
    background: rgba(61,220,132,.10); border-color: rgba(61,220,132,.42);
}
.smart-profile-v2 .v2-role-card.state-target .v2-role-icon-dot,
.smart-profile-v2 .v2-role-card.state-target .v2-role-icon {
    background: #3ddc84; color: #062b16;
}
.smart-profile-v2 .v2-role-card.state-target .v2-role-badge { background: rgba(61,220,132,.12); color: #3ddc84; }
.smart-profile-v2 .v2-role-card.state-neutral .v2-role-icon-dot,
.smart-profile-v2 .v2-role-card.state-neutral .v2-role-icon {
    border: 2px solid #6b6784; background: transparent;
}
.smart-profile-v2 .v2-role-card.state-off,
.smart-profile-v2 .v2-role-card.state-ignored,
.smart-profile-v2 .v2-role-card.state-excluded {
    background: rgba(248,113,113,.09); border-color: rgba(248,113,113,.28);
    cursor: default; opacity: .85;
}
.smart-profile-v2 .v2-role-card.state-off .v2-role-label,
.smart-profile-v2 .v2-role-card.state-ignored .v2-role-label,
.smart-profile-v2 .v2-role-card.state-excluded .v2-role-label { color: #948fae; }
.smart-profile-v2 .v2-role-card.state-off .v2-role-icon-dot,
.smart-profile-v2 .v2-role-card.state-ignored .v2-role-icon-dot,
.smart-profile-v2 .v2-role-card.state-excluded .v2-role-icon-dot,
.smart-profile-v2 .v2-role-card.state-off .v2-role-icon,
.smart-profile-v2 .v2-role-card.state-ignored .v2-role-icon,
.smart-profile-v2 .v2-role-card.state-excluded .v2-role-icon {
    background: rgba(248,113,113,.12); color: #f87171; border: none;
}

.smart-profile-v2 .v2-role-legend {
    display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0 .35rem;
}
.smart-profile-v2 .v2-role-legend span {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .78rem; color: #948fae; background: rgba(55,51,62,.5);
    border: 1px solid rgba(147,142,160,.2); padding: .4rem .75rem; border-radius: 999px;
}
.smart-profile-v2 .v2-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.smart-profile-v2 .v2-dot.g { background: #3ddc84; }
.smart-profile-v2 .v2-dot.n { border: 2px solid #6b6784; }
.smart-profile-v2 .v2-dot.r { background: #f87171; }
.smart-profile-v2 .v2-role-hint { color: #6b6784; font-size: .78rem; text-align: center; margin: .5rem 0 0; }

.smart-profile-v2 .v2-fold {
    margin-top: 1.25rem; border: 1px solid rgba(147,142,160,.22);
    border-radius: 1rem; overflow: hidden;
}
.smart-profile-v2 .v2-fold-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1rem; cursor: pointer; background: rgba(55,51,62,.45);
}
.smart-profile-v2 .v2-fold-head h3 { font-size: .9rem; font-weight: 800; margin: 0; }
.smart-profile-v2 .v2-fold-head p { font-size: .78rem; color: #6b6784; margin: .2rem 0 0; }
.smart-profile-v2 .v2-fold-chev { color: #6b6784; transition: transform .2s; }
.smart-profile-v2 .v2-fold.open .v2-fold-chev { transform: rotate(180deg); }
.smart-profile-v2 .v2-fold-body { display: none; padding: .85rem; background: rgba(14,12,23,.35); }
.smart-profile-v2 .v2-fold.open .v2-fold-body { display: block; }

/* Нижний sticky footer не перекрывает сетку */
#rolesSection.smart-profile-v2 #rolesGrid {
    margin-bottom: 0;
    padding-bottom: 7.5rem;
}

.roles-help-btn {
    position: absolute; top: 0; right: 0; z-index: 6;
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid rgba(147,142,160,.3); background: rgba(55,51,62,.7);
    color: #948fae; font: inherit; font-weight: 800; cursor: pointer;
    display: grid; place-items: center;
}
.roles-help-btn:hover { color: #b3a2ff; border-color: #7b5cff; }
.rhead .roles-help-btn { top: 2px; right: 0; }

/*
 * Обучалка: fixed на весь viewport (как scrim в демо), поверх sticky footer (z-40).
 * absolute+inset:0 внутри rolesSection не закрывал fixed CTA и не блочил клики.
 */
.roles-coach {
    position: fixed; inset: 0; z-index: 55;
    background: rgba(9, 7, 16, 0.88);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 2rem 1.5rem; transition: opacity .3s;
    pointer-events: auto;
    overflow-y: auto;
}
.roles-coach.gone {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}
html.roles-coach-open,
html.roles-coach-open body {
    overflow: hidden;
}

.roles-coach h2 {
    font-size: clamp(1.25rem, 2.2vw, 1.5rem); font-weight: 800;
    text-align: center; margin: 0; color: #e7e0ef;
    max-width: 28rem;
}
.roles-coach-sub {
    color: #948fae; font-size: .9rem; text-align: center;
    margin: .55rem 0 1.75rem; max-width: 28rem;
}
.roles-coach-stage { position: relative; width: min(430px, 100%); }
.roles-coach-stage .v2-role-card {
    position: relative; display: flex; align-items: center; gap: .7rem;
    text-align: left; padding: .85rem .65rem .85rem .9rem;
    border: 1px solid rgba(147,142,160,.22); border-radius: 1rem;
    background: rgba(55,51,62,.45); color: #e7e0ef; min-height: 56px; width: 100%;
    cursor: default; pointer-events: none; flex-wrap: nowrap;
}
.roles-coach-stage .v2-role-icon-dot {
    flex: none; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; font-size: 13px; font-weight: 800;
    border: 2px solid #6b6784;
}
.roles-coach-stage .v2-role-label { flex: 1; font-size: .9rem; font-weight: 700; min-width: 0; }
.roles-coach-stage .v2-role-label i { font-style: normal; font-weight: 600; font-size: .75rem; color: #6b6784; margin-left: .3rem; }
.roles-coach-stage .v2-role-badge {
    flex: none; font-size: .7rem; font-weight: 800; padding: .3rem .6rem;
    border-radius: 999px; color: #cac3d7; background: rgba(55,51,62,.6); white-space: nowrap;
}
.roles-coach-stage .v2-role-x {
    flex: none; width: 32px; height: 32px; border-radius: 50%; border: none;
    background: transparent; color: #6b6784; font-size: 16px; display: grid; place-items: center;
}
.roles-coach-stage .state-target { background: rgba(61,220,132,.10); border-color: rgba(61,220,132,.42); }
.roles-coach-stage .state-target .v2-role-icon-dot { background: #3ddc84; color: #062b16; border: none; }
.roles-coach-stage .state-target .v2-role-badge { background: rgba(61,220,132,.12); color: #3ddc84; }
.roles-coach-stage .state-off { background: rgba(248,113,113,.09); border-color: rgba(248,113,113,.28); }
.roles-coach-stage .state-off .v2-role-icon-dot { background: rgba(248,113,113,.12); color: #f87171; border: none; }
.roles-coach-stage .state-off .v2-role-label { color: #948fae; }
.roles-coach-ptr {
    position: absolute; z-index: 4; pointer-events: none;
    transition: left .65s cubic-bezier(.4,0,.2,1), top .65s cubic-bezier(.4,0,.2,1), transform .16s;
}
.roles-coach-ptr.press { transform: scale(.8); }
.roles-coach-ptr svg { display: block; filter: drop-shadow(0 3px 6px rgba(0,0,0,.45)); }
.roles-coach-touch {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(123,92,255,.28); border: 2.5px solid #7b5cff;
    margin: -17px 0 0 -17px;
}
.roles-coach-ring {
    position: absolute; z-index: 3; width: 16px; height: 16px;
    margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid #7b5cff;
    opacity: 0; pointer-events: none;
}
.roles-coach-ring.go { animation: rolesCoachRng .55s ease-out; }
@keyframes rolesCoachRng {
    from { opacity: .9; transform: scale(.6); }
    to { opacity: 0; transform: scale(3.4); }
}
/* caption: БЛОЧНЫЙ (не flex!) — иначе inline-куски рвутся */
.roles-coach-cap {
    display: block; min-height: 72px; margin: 1.5rem auto .25rem;
    max-width: 46ch; width: 100%; text-align: center;
    font-size: clamp(.92rem, 1.6vw, 1rem); line-height: 1.55; font-weight: 600;
    color: #e7e0ef;
}
.roles-coach-cap b { color: #3ddc84; }
.roles-coach-cap .r { color: #f87171; }
.roles-coach-cap .a { color: #b3a2ff; }
.roles-coach-dots { display: flex; gap: .5rem; justify-content: center; margin-bottom: 1.5rem; }
.roles-coach-dots i { width: 7px; height: 7px; border-radius: 50%; background: #2e2a44; transition: .2s; display: block; }
.roles-coach-dots i.on { background: #7b5cff; transform: scale(1.3); }
.roles-coach-cta {
    display: flex; align-items: center; justify-content: center; text-align: center;
    width: 100%; max-width: 360px; margin: 0 auto; padding: 14px 20px;
    border: none; border-radius: 10px;
    background: linear-gradient(135deg, #4a7bff, #8b5cf6); color: #fff;
    font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
    transition: filter .2s, transform .16s;
}
.roles-coach-cta:hover { filter: brightness(1.09); }
.roles-coach-cta:active { transform: scale(.985); }
.roles-coach-skip {
    margin-top: .8rem; background: none; border: none; color: #6b6784;
    font: inherit; font-size: .85rem; cursor: pointer; text-align: center; width: 100%;
}
.roles-coach-skip:hover { color: #948fae; }
@media (prefers-reduced-motion: reduce) {
    .roles-coach-ptr { transition: none; }
    .roles-coach-ring.go { animation: none; }
}

/* Light theme tokens (кабинет data-theme / без .dark) */
html[data-theme="light"] .roles-coach,
html:not(.dark):not([data-theme="dark"]) .roles-coach {
    background: rgba(240, 238, 250, 0.92);
}
html[data-theme="light"] .roles-coach h2,
html:not(.dark):not([data-theme="dark"]) .roles-coach h2,
html[data-theme="light"] .roles-coach-cap,
html:not(.dark):not([data-theme="dark"]) .roles-coach-cap {
    color: #191627;
}
html[data-theme="light"] .roles-coach-sub,
html:not(.dark):not([data-theme="dark"]) .roles-coach-sub {
    color: #6c6884;
}
html[data-theme="light"] .roles-coach-cap b,
html:not(.dark):not([data-theme="dark"]) .roles-coach-cap b {
    color: #0e8b4c;
}
html[data-theme="light"] .roles-coach-cap .r,
html:not(.dark):not([data-theme="dark"]) .roles-coach-cap .r {
    color: #dc4b4b;
}
html[data-theme="light"] .roles-coach-cap .a,
html:not(.dark):not([data-theme="dark"]) .roles-coach-cap .a {
    color: #6a4df0;
}
html[data-theme="light"] .roles-coach-stage .v2-role-card,
html:not(.dark):not([data-theme="dark"]) .roles-coach-stage .v2-role-card {
    background: #fff;
    border-color: #e3e0ef;
    color: #191627;
}
html[data-theme="light"] .roles-coach-stage .v2-role-label,
html:not(.dark):not([data-theme="dark"]) .roles-coach-stage .v2-role-label {
    color: #191627;
}
html[data-theme="light"] .roles-coach-stage .v2-role-label i,
html:not(.dark):not([data-theme="dark"]) .roles-coach-stage .v2-role-label i {
    color: #6c6884;
}
html[data-theme="light"] .roles-coach-stage .state-target,
html:not(.dark):not([data-theme="dark"]) .roles-coach-stage .state-target {
    background: rgba(18,167,92,.09);
    border-color: rgba(18,167,92,.35);
}
html[data-theme="light"] .roles-coach-stage .state-target .v2-role-badge,
html:not(.dark):not([data-theme="dark"]) .roles-coach-stage .state-target .v2-role-badge {
    background: rgba(18,167,92,.12);
    color: #0e8b4c;
}
html[data-theme="light"] .roles-coach-stage .state-off .v2-role-label,
html:not(.dark):not([data-theme="dark"]) .roles-coach-stage .state-off .v2-role-label {
    color: #6c6884;
}
html[data-theme="light"] .roles-coach-dots i,
html:not(.dark):not([data-theme="dark"]) .roles-coach-dots i {
    background: #d8d4e8;
}
html[data-theme="light"] .roles-coach-dots i.on,
html:not(.dark):not([data-theme="dark"]) .roles-coach-dots i.on {
    background: #6a4df0;
}
html[data-theme="light"] .roles-coach-skip,
html:not(.dark):not([data-theme="dark"]) .roles-coach-skip {
    color: #6c6884;
}
html[data-theme="light"] .roles-help-btn,
html:not(.dark):not([data-theme="dark"]) .roles-help-btn {
    background: #fff;
    border-color: #e3e0ef;
    color: #6c6884;
}
html[data-theme="light"] .smart-profile-v2 .v2-role-card,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-card {
    background: #fff;
    border-color: #e3e0ef;
    color: #191627;
}
html[data-theme="light"] .smart-profile-v2 .v2-role-card:hover,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-card:hover {
    background: #f4f2fd;
}
html[data-theme="light"] .smart-profile-v2 .v2-role-label i,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-label i {
    color: #6c6884;
}
html[data-theme="light"] .smart-profile-v2 .v2-role-badge,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-badge,
html[data-theme="light"] .smart-profile-v2 .v2-role-count,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-count {
    background: #f1eef8;
    color: #6c6884;
}
html[data-theme="light"] .smart-profile-v2 .v2-role-card.state-target .v2-role-badge,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-card.state-target .v2-role-badge {
    background: rgba(18,167,92,.12);
    color: #0e8b4c;
}
html[data-theme="light"] .smart-profile-v2 .v2-role-sec,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-sec,
html[data-theme="light"] .smart-profile-v2 .v2-role-hint,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-hint {
    color: #6c6884;
}
html[data-theme="light"] .smart-profile-v2 .v2-role-legend span,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-legend span {
    background: #fff;
    border-color: #e3e0ef;
    color: #6c6884;
}
html[data-theme="light"] .smart-profile-v2 .v2-fold,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-fold {
    border-color: #e3e0ef;
}
html[data-theme="light"] .smart-profile-v2 .v2-fold-head,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-fold-head {
    background: #f4f2fd;
}
html[data-theme="light"] .smart-profile-v2 .v2-fold-head h3,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-fold-head h3 {
    color: #191627;
}
html[data-theme="light"] .smart-profile-v2 .v2-fold-head p,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-fold-head p,
html[data-theme="light"] .smart-profile-v2 .v2-fold-chev,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-fold-chev {
    color: #6c6884;
}
html[data-theme="light"] .smart-profile-v2 .v2-fold-body,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-fold-body {
    background: #f8f7fc;
}
html[data-theme="light"] .smart-profile-v2 .v2-fold-body .v2-role-hint,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-fold-body .v2-role-hint {
    color: #6c6884;
}
html[data-theme="light"] .smart-profile-v2 .v2-role-ghost,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-ghost {
    color: #191627;
    border-color: #cfcadf;
}
html[data-theme="light"] .smart-profile-v2 .v2-role-card.state-off .v2-role-label,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-card.state-off .v2-role-label,
html[data-theme="light"] .smart-profile-v2 .v2-role-card.state-ignored .v2-role-label,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-card.state-ignored .v2-role-label,
html[data-theme="light"] .smart-profile-v2 .v2-role-card.state-excluded .v2-role-label,
html:not(.dark):not([data-theme="dark"]) .smart-profile-v2 .v2-role-card.state-excluded .v2-role-label {
    color: #6c6884;
}

.roles-soft-narrow {
    margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 1rem;
    background: rgba(255,193,7,.08); border: 1px solid rgba(255,193,7,.28);
    text-align: left; font-size: .875rem; line-height: 1.5; color: #e7e0ef;
}
.roles-soft-narrow p { margin: 0 0 .75rem; }
.roles-soft-narrow-btn {
    display: inline-block; padding: .55rem 1rem; border-radius: 999px;
    border: 1px solid rgba(147,142,160,.35); color: #b3a2ff; font-weight: 700; font-size: .85rem;
    text-decoration: none;
}
.roles-soft-narrow-btn:hover { border-color: #7b5cff; }
html[data-theme="light"] .roles-soft-narrow,
html:not(.dark):not([data-theme="dark"]) .roles-soft-narrow {
    background: rgba(201,133,42,.1); border-color: rgba(201,133,42,.28); color: #191627;
}
html[data-theme="light"] .roles-soft-narrow-btn,
html:not(.dark):not([data-theme="dark"]) .roles-soft-narrow-btn {
    color: #6a4df0; border-color: #cfcadf;
}
