/* ============================================================
 * cs-ui.css — Customer Success Engine 共通スタイル
 *
 * shared.css のデザイントークンに準拠。個別ページでの上書き禁止。
 * ============================================================ */

/* ---------------- Modal ---------------- */
.cs-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    animation: cs-fade-in 0.25s forwards;
}

.cs-modal-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    transform: translateY(16px) scale(0.98);
    animation: cs-card-in 0.3s 0.05s forwards cubic-bezier(0.2, 0.9, 0.3, 1.2);
    border: 1px solid var(--border-color);
}

.cs-modal-card__body {
    padding: 28px 26px 24px;
}

.cs-modal-card__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.cs-modal-card__close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.cs-modal-card__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary);
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.cs-modal-card__lead {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 18px;
    line-height: 1.65;
}

.cs-modal-card__cta-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.cs-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 13px 18px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    text-align: center;
    line-height: 1.4;
}
.cs-btn--primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.25);
}
.cs-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(108, 99, 255, 0.35);
}
.cs-btn--ghost {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.cs-btn--ghost:hover { background: var(--bg-hover); }
.cs-btn--text {
    background: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px;
    font-size: 13px;
}
.cs-btn--text:hover { color: var(--text-primary); }

/* ---------------- Welcome demo (CSS only animation) ----------------
 * 注: app.html はインラインチャット型 (FABなし)。デモも同じレイアウトで表示し、
 *     ユーザーが「下の入力欄に話しかける」イメージを直感的に掴めるようにする。
 */
.cs-demo {
    width: 100%;
    height: 184px;
    margin: 4px auto 18px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

/* チャットエリア（上側）— 吹き出しが順番に現れる */
.cs-demo__chat {
    flex: 1;
    padding: 16px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-end;
    min-height: 0;
}

.cs-demo__bubble {
    max-width: 78%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0;
}
.cs-demo__bubble--user {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    animation: cs-demo-user 6s infinite ease-in-out;
}
.cs-demo__bubble--ai {
    background: var(--bg-card);
    color: var(--text-primary);
    align-self: flex-start;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    animation: cs-demo-ai 6s infinite ease-in-out;
}

/* 入力欄バー（下側）— 実際の app.html と同じレイアウト */
.cs-demo__input-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}
.cs-demo__input-field {
    flex: 1;
    height: 26px;
    padding: 0 10px;
    border-radius: 13px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    font-size: 11px;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    animation: cs-demo-field-pulse 6s infinite ease-in-out;
}
.cs-demo__input-field::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 13px;
    box-shadow: 0 0 0 0 var(--accent-primary);
    animation: cs-demo-field-glow 6s infinite ease-in-out;
}
.cs-demo__input-text {
    animation: cs-demo-typing 6s infinite ease-in-out;
}
.cs-demo__input-placeholder {
    color: var(--text-muted);
    animation: cs-demo-placeholder 6s infinite ease-in-out;
    position: absolute;
    left: 10px;
}
.cs-demo__send {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    animation: cs-demo-send 6s infinite ease-in-out;
}
.cs-demo__send svg { width: 12px; height: 12px; }

@keyframes cs-demo-placeholder {
    0%, 8%   { opacity: 1; }
    10%, 100%{ opacity: 0; }
}
@keyframes cs-demo-typing {
    0%, 8%   { opacity: 0; }
    12%, 28% { opacity: 1; }
    32%, 100%{ opacity: 0; }
}
@keyframes cs-demo-send {
    0%, 25%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(108, 99, 255, 0); }
    30%       { transform: scale(0.85); box-shadow: 0 0 0 6px rgba(108, 99, 255, 0); }
    35%, 100% { transform: scale(1); }
}
@keyframes cs-demo-field-pulse {
    0%, 4%   { border-color: var(--border-color); }
    6%, 28%  { border-color: var(--accent-primary); }
    32%, 100%{ border-color: var(--border-color); }
}
@keyframes cs-demo-field-glow {
    0%, 4%   { box-shadow: 0 0 0 0 rgba(108, 99, 255, 0); }
    6%       { box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.4); }
    28%      { box-shadow: 0 0 0 4px rgba(108, 99, 255, 0); }
    32%, 100%{ box-shadow: 0 0 0 0 rgba(108, 99, 255, 0); }
}
@keyframes cs-demo-user {
    0%, 32%  { opacity: 0; transform: translateY(6px); }
    38%, 60% { opacity: 1; transform: translateY(0); }
    92%, 100%{ opacity: 0; transform: translateY(-6px); }
}
@keyframes cs-demo-ai {
    0%, 60%  { opacity: 0; transform: translateY(6px); }
    66%, 88% { opacity: 1; transform: translateY(0); }
    94%, 100%{ opacity: 0; transform: translateY(-6px); }
}

/* ---------------- NBM Card (sidebar resident) ---------------- */
.cs-nbm-card {
    margin: 12px 12px 8px;
    padding: 14px 14px 12px;
    background: linear-gradient(135deg, var(--accent-soft), var(--bg-card));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.cs-nbm-card__step {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.cs-nbm-card__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.45;
    margin-bottom: 4px;
}

.cs-nbm-card__body {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 10px;
}

.cs-nbm-card__cta {
    width: 100%;
    appearance: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.cs-nbm-card__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}
.cs-nbm-card__cta svg { width: 14px; height: 14px; }

.cs-nbm-card__dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 14px;
    line-height: 1;
}
.cs-nbm-card__dismiss:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.cs-nbm-card[hidden] { display: none; }

/* 6段階プログレスバー */
.cs-nbm-card__progress {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    margin: 6px 0 10px;
    position: relative;
}
.cs-nbm-card__progress::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 8%;
    right: 8%;
    height: 2px;
    background: var(--border-color, rgba(0,0,0,0.08));
    z-index: 0;
}
.cs-nbm-card__progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: 1;
}
.cs-nbm-card__progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-card, #fff);
    border: 2px solid var(--border-color, rgba(0,0,0,0.18));
    box-sizing: border-box;
    transition: var(--transition);
}
.cs-nbm-card__progress-step--done .cs-nbm-card__progress-dot {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}
.cs-nbm-card__progress-step--active .cs-nbm-card__progress-dot {
    background: var(--bg-card, #fff);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.18);
}
.cs-nbm-card__progress-label {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0;
    font-weight: 500;
}
.cs-nbm-card__progress-step--done .cs-nbm-card__progress-label,
.cs-nbm-card__progress-step--active .cs-nbm-card__progress-label {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ---------------- Animations ---------------- */
@keyframes cs-fade-in {
    to { opacity: 1; }
}
@keyframes cs-card-in {
    to { transform: translateY(0) scale(1); }
}

/* ---------------- Modal close transition ---------------- */
.cs-modal-backdrop.cs-closing {
    animation: cs-fade-out 0.2s forwards;
}
.cs-modal-backdrop.cs-closing .cs-modal-card {
    animation: cs-card-out 0.2s forwards;
}
@keyframes cs-fade-out {
    to { opacity: 0; }
}
@keyframes cs-card-out {
    to { transform: translateY(8px) scale(0.98); opacity: 0; }
}

/* ============================================================
 * Phase C — Celebrate / Hint / Banner
 * ============================================================ */

/* ---------------- Celebrate (milestone toast) ----------------
 * 紙吹雪はカードの外側まで広がる必要があるため、root を全画面サイズにして
 * カード自身は overflow:visible で confetti をはみ出させる。
 */
/* ============= Celebrate: Toast (lightweight) ============= */
.cs-celebrate-root {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.cs-celeb-toast {
    pointer-events: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(108, 99, 255, 0.12);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100vw - 48px);
    width: 340px;
    margin-top: 24px;
    animation: cs-celeb-toast-in 0.5s cubic-bezier(0.16, 1.2, 0.3, 1) forwards;
}
.cs-celeb-toast--closing {
    animation: cs-celeb-toast-out 0.3s ease-in forwards;
}
.cs-celeb-toast__icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.cs-celeb-toast__icon svg { width: 18px; height: 18px; }
.cs-celeb-toast__body { flex: 1; min-width: 0; }
.cs-celeb-toast__title { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.4; }
.cs-celeb-toast__sub { font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin-top: 2px; }

@keyframes cs-celeb-toast-in {
    0%   { opacity: 0; transform: translateY(-20px) scale(0.92); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cs-celeb-toast-out {
    to { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

/* ============= Celebrate: Fullscreen Modal ============= */
.cs-celeb-overlay {
    position: fixed;
    inset: 0;
    z-index: 13000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cs-celeb-overlay-in 0.4s ease-out forwards;
}
.cs-celeb-overlay--closing {
    animation: cs-celeb-overlay-out 0.35s ease-in forwards;
}

@keyframes cs-celeb-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes cs-celeb-overlay-out {
    to { opacity: 0; }
}

/* Confetti — 画面全体に降り注ぐ */
.cs-celeb-confetti-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.cs-celeb-confetti {
    position: absolute;
    border-radius: 1px;
    opacity: 0;
    animation: cs-celeb-confetti-fall ease-out forwards;
    will-change: transform, opacity;
}
.cs-celeb-confetti--circle { border-radius: 50%; }
.cs-celeb-confetti--rect   { border-radius: 2px; }
.cs-celeb-confetti--strip  { border-radius: 1px; }
.cs-celeb-confetti::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    animation: cs-celeb-confetti-wobble var(--cs-wobble-dur, 0.35s) ease-in-out infinite alternate;
}

@keyframes cs-celeb-confetti-fall {
    0%   { opacity: 0; transform: translate(0, 0) rotate(0deg); }
    5%   { opacity: 1; }
    85%  { opacity: 0.8; }
    100% { opacity: 0; transform: translate(var(--cs-drift, 0), 110vh) rotate(var(--cs-rot, 360deg)); }
}
@keyframes cs-celeb-confetti-wobble {
    from { transform: rotateY(0deg) rotateX(0deg); }
    to   { transform: rotateY(var(--cs-wobble-amp, 4deg)) rotateX(calc(var(--cs-wobble-amp, 4deg) * 0.7)); }
}

/* Modal card */
.cs-celeb-modal {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3), 0 0 80px rgba(108, 99, 255, 0.15);
    padding: 40px 36px 32px;
    width: 440px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    text-align: center;
    animation: cs-celeb-modal-in 0.6s 0.1s cubic-bezier(0.16, 1.2, 0.3, 1) both;
}

@keyframes cs-celeb-modal-in {
    0%   { opacity: 0; transform: translateY(30px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.cs-celeb-modal__close {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    border: none; background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    z-index: 2;
}
.cs-celeb-modal__close:hover { background: var(--bg-hover); color: var(--text-secondary); }

/* Achievement icon */
.cs-celeb-modal__achievement { margin-bottom: 24px; }
.cs-celeb-modal__icon-wrap {
    position: relative;
    width: 72px; height: 72px;
    margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
}
.cs-celeb-modal__icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(108, 99, 255, 0.4);
    animation: cs-celeb-icon-in 0.7s 0.2s cubic-bezier(0.2, 1.6, 0.3, 1) both,
               cs-celeb-icon-glow 2s 1s ease-in-out 2;
    position: relative;
    z-index: 2;
}
.cs-celeb-modal__icon svg { width: 32px; height: 32px; }

.cs-celeb-modal__burst {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    opacity: 0;
    z-index: 1;
    animation: cs-celeb-burst 1.2s ease-out forwards;
}
.cs-celeb-modal__burst--1 { animation-delay: 0.3s; }
.cs-celeb-modal__burst--2 { animation-delay: 0.5s; border-color: var(--accent-secondary); }
.cs-celeb-modal__burst--3 { animation-delay: 0.7s; }

.cs-celeb-modal__sparkle {
    position: absolute;
    width: 8px; height: 8px;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
}
.cs-celeb-modal__sparkle::before,
.cs-celeb-modal__sparkle::after {
    content: '';
    position: absolute;
    background: var(--accent-primary);
    border-radius: 1px;
}
.cs-celeb-modal__sparkle::before { width: 100%; height: 2px; top: 50%; left: 0; transform: translateY(-50%); }
.cs-celeb-modal__sparkle::after  { width: 2px; height: 100%; left: 50%; top: 0; transform: translateX(-50%); }
.cs-celeb-modal__sparkle--1 { top: -8px; right: -4px; animation: cs-celeb-sparkle 0.6s 0.6s ease-out forwards; }
.cs-celeb-modal__sparkle--2 { bottom: -6px; left: -6px; animation: cs-celeb-sparkle 0.6s 0.8s ease-out forwards; }
.cs-celeb-modal__sparkle--3 { top: 0; left: -10px; animation: cs-celeb-sparkle 0.6s 1.0s ease-out forwards; --cs-sparkle-scale: 0.7; }
.cs-celeb-modal__sparkle--4 { bottom: -4px; right: -8px; animation: cs-celeb-sparkle 0.6s 1.2s ease-out forwards; --cs-sparkle-scale: 0.6; }

@keyframes cs-celeb-icon-in {
    0%   { transform: scale(0) rotate(-30deg); }
    50%  { transform: scale(1.2) rotate(8deg); }
    70%  { transform: scale(0.92) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}
@keyframes cs-celeb-icon-glow {
    0%, 100% { box-shadow: 0 8px 24px rgba(108, 99, 255, 0.4); }
    50%      { box-shadow: 0 8px 32px rgba(108, 99, 255, 0.6), 0 0 48px rgba(108, 99, 255, 0.25); }
}
@keyframes cs-celeb-burst {
    0%   { opacity: 0.7; transform: scale(1); }
    70%  { opacity: 0; transform: scale(3); border-width: 0.5px; }
    100% { opacity: 0; transform: scale(3); }
}
@keyframes cs-celeb-sparkle {
    0%   { opacity: 0; transform: scale(0) rotate(0deg); }
    50%  { opacity: 1; transform: scale(var(--cs-sparkle-scale, 1)) rotate(20deg); }
    100% { opacity: 0; transform: scale(0) rotate(45deg); }
}

.cs-celeb-modal__title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.02em;
    opacity: 0;
    animation: cs-celeb-text-in 0.5s 0.35s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.cs-celeb-modal__sub {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 6px;
    opacity: 0;
    animation: cs-celeb-text-in 0.5s 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes cs-celeb-text-in {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Progress bar */
.cs-celeb-progress {
    margin: 24px 0 20px;
    opacity: 0;
    animation: cs-celeb-text-in 0.5s 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.cs-celeb-progress__track {
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}
.cs-celeb-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.2, 0.9, 0.3, 1);
    animation: cs-celeb-fill-in 1s 0.8s ease-out both;
}
@keyframes cs-celeb-fill-in {
    from { width: 0 !important; }
}
.cs-celeb-progress__steps {
    display: flex;
    justify-content: space-between;
}
.cs-celeb-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.cs-celeb-progress__dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 2px solid var(--border-default);
    transition: all 0.3s;
}
.cs-celeb-progress__step.done .cs-celeb-progress__dot {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}
.cs-celeb-progress__step.current .cs-celeb-progress__dot {
    background: #fff;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}
.cs-celeb-progress__label {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}
.cs-celeb-progress__step.done .cs-celeb-progress__label,
.cs-celeb-progress__step.current .cs-celeb-progress__label {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Score gauge (for score threshold celebrations) */
.cs-celeb-score {
    margin: 20px 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: cs-celeb-text-in 0.5s 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.cs-celeb-score__ring {
    position: relative;
    width: 120px;
    height: 120px;
}
.cs-celeb-score__ring svg { width: 100%; height: 100%; }
.cs-celeb-score__arc {
    animation: cs-celeb-score-draw 1.2s 0.8s ease-out both;
}
@keyframes cs-celeb-score-draw {
    from { stroke-dashoffset: 327; }
}
.cs-celeb-score__value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.cs-celeb-score__unit {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 2px;
}
.cs-celeb-score__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
}

/* Next action section */
.cs-celeb-modal__next {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 0 0 16px;
    text-align: left;
    opacity: 0;
    animation: cs-celeb-text-in 0.5s 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.cs-celeb-modal__next-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-primary);
    margin-bottom: 6px;
}
.cs-celeb-modal__next-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
}
.cs-celeb-modal__next-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* CTA button */
.cs-celeb-modal__cta {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
    opacity: 0;
    animation: cs-celeb-text-in 0.5s 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.cs-celeb-modal__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}
.cs-celeb-modal__cta:active { transform: translateY(0); }

/* Later link */
.cs-celeb-modal__later {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
    opacity: 0;
    animation: cs-celeb-text-in 0.5s 0.9s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.cs-celeb-modal__later:hover { color: var(--text-secondary); }

@media (max-width: 600px) {
    .cs-celeb-modal { padding: 32px 20px 24px; width: calc(100vw - 24px); }
    .cs-celeb-modal__title { font-size: 18px; }
    .cs-celeb-toast { width: calc(100vw - 32px); }
}

/* ---------------- Hint (contextual tooltip) ---------------- */
.cs-hint {
    position: absolute;
    z-index: 11500;
    background: var(--text-primary);
    color: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 10px 32px 10px 14px;
    max-width: 280px;
    font-size: 12px;
    line-height: 1.55;
    box-shadow: var(--shadow-lg);
    animation: cs-hint-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
    transform-origin: center;
}
.cs-hint--closing { animation: cs-hint-out 0.18s forwards; }

.cs-hint__body {
    color: inherit;
}
.cs-hint__close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}
.cs-hint__close:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.cs-hint__arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    transform: rotate(45deg);
}
.cs-hint[data-cs-hint-side="bottom"] .cs-hint__arrow { top: -4px; left: 50%; margin-left: -5px; }
.cs-hint[data-cs-hint-side="top"] .cs-hint__arrow    { bottom: -4px; left: 50%; margin-left: -5px; }
.cs-hint[data-cs-hint-side="left"] .cs-hint__arrow   { right: -4px; top: 50%; margin-top: -5px; }
.cs-hint[data-cs-hint-side="right"] .cs-hint__arrow  { left: -4px; top: 50%; margin-top: -5px; }

@keyframes cs-hint-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes cs-hint-out {
    to { opacity: 0; transform: scale(0.96); }
}

/* ---------------- Banner (top notice) ---------------- */
.cs-banner {
    position: sticky;
    top: 0;
    z-index: 9500;
    background: linear-gradient(135deg, var(--accent-soft), var(--bg-card));
    border-bottom: 1px solid var(--border-accent);
    color: var(--text-primary);
    font-size: 13px;
    animation: cs-banner-in 0.3s ease-out forwards;
}
.cs-banner--warning {
    background: linear-gradient(135deg, rgba(255, 159, 10, 0.12), var(--bg-card));
    border-bottom-color: rgba(255, 159, 10, 0.35);
}
.cs-banner--closing { animation: cs-banner-out 0.2s forwards; }
.cs-banner__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.cs-banner__icon {
    flex-shrink: 0;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
}
.cs-banner--warning .cs-banner__icon { color: var(--warning); }
.cs-banner__icon svg { width: 18px; height: 18px; }
.cs-banner__message { flex: 1; line-height: 1.5; }
.cs-banner__cta {
    appearance: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: var(--transition);
}
.cs-banner__cta:hover { transform: translateY(-1px); }
.cs-banner__close {
    appearance: none;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}
.cs-banner__close:hover { background: var(--bg-hover); color: var(--text-secondary); }

@keyframes cs-banner-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes cs-banner-out {
    to { opacity: 0; transform: translateY(-8px); }
}

@media (max-width: 600px) {
    .cs-banner__inner { padding: 8px 12px; gap: 8px; font-size: 12px; }
    .cs-banner__cta { padding: 6px 10px; font-size: 11px; }
    .cs-celebrate { width: calc(100vw - 32px); }
}
