/* Card */
.card {
    background: linear-gradient(180deg, var(--surface-panel-strong), var(--surface-panel));
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: 24px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
    transition: box-shadow var(--ease), transform var(--ease), border-color var(--ease), background var(--ease);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, .52), transparent 36%);
    opacity: .9;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(114, 147, 197, .42);
    transform: translateY(-2px);
}

/* Button: Primary */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-s);
    padding: 12px 22px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-500) 68%, var(--cyan-500));
    color: var(--text-inv);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    min-height: 44px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(53, 107, 231, .18);
    transition: box-shadow var(--ease), transform 120ms ease, filter var(--ease);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .18), transparent 60%);
    opacity: 0;
    transition: opacity var(--ease);
}

.btn:hover {
    box-shadow: 0 18px 30px rgba(53, 107, 231, .24), 0 0 0 1px rgba(255, 255, 255, .18) inset;
    transform: translateY(-1px);
    filter: saturate(108%);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 8px 16px rgba(53, 107, 231, .18);
}

.btn:focus-visible {
    outline: 2px solid var(--blue-400);
    outline-offset: 2px;
}

.btn:disabled,
.btn[disabled] {
    background: linear-gradient(180deg, #cbd7eb, #c2cfe4);
    color: var(--text-3);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn:disabled::before,
.btn[disabled]::before {
    display: none;
}

/* Button: Glass */
.btn-glass {
    background: rgba(255, 255, 255, .16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .24);
    color: var(--text-inv);
    box-shadow: none;
}

.btn-glass::before { display: none; }

.btn-glass:hover {
    background: rgba(255, 255, 255, .24);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    border-color: rgba(255, 255, 255, .38);
}

.btn-glass:active {
    background: rgba(255, 255, 255, .08);
    transform: scale(0.97);
}

/* Button: Outline */
.btn-outline {
    background: rgba(255, 255, 255, .52);
    border: 1.5px solid rgba(125, 163, 224, .45);
    color: var(--blue-600);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 18px rgba(53, 107, 231, .05);
}

.btn-outline::before { display: none; }

.btn-outline:hover {
    background: rgba(240, 247, 255, .94);
    border-color: var(--blue-400);
    box-shadow: 0 10px 22px rgba(53, 107, 231, .08);
    transform: translateY(-1px);
}

.btn-outline:active {
    background: var(--blue-100);
    transform: translateY(0);
}

/* Button: Danger */
.btn-danger {
    background: linear-gradient(135deg, var(--red-600), #b91c1c);
    color: var(--text-inv);
}

.btn-danger:hover {
    box-shadow: 0 14px 26px rgba(220, 38, 38, .22);
}

.btn-danger:active {
    transform: scale(0.97);
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    padding: 0;
    border: none;
    background: none;
    cursor: default;
}

.form-label:hover {
    background: none;
    border: none;
    box-shadow: none;
}

.form-hint {
    font-size: 12px;
    color: var(--text-3);
}

/* Input / Select */
.input {
    width: 100%;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-s);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-1);
    background: rgba(255, 255, 255, .84);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 2px 8px rgba(53, 107, 231, .03);
}

.input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(79, 134, 247, .12), 0 12px 20px rgba(53, 107, 231, .08);
    background: rgba(255, 255, 255, .96);
}

.input::placeholder {
    color: var(--text-3);
}

/* Member Card */
#memberList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
}

.member-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-m);
    padding: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .74), rgba(235, 244, 255, .56));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease), transform var(--ease);
}

.member-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(53, 107, 231, .08);
}

.member-card.speaking {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(79, 134, 247, .12), 0 16px 28px rgba(79, 134, 247, .14);
    background: linear-gradient(180deg, rgba(245, 250, 255, .92), rgba(219, 234, 254, .78));
    animation: speaking-glow 2s ease-in-out infinite;
}

@keyframes speaking-glow {
    0% { box-shadow: 0 0 0 2px rgba(79, 134, 247, .08); }
    50% { box-shadow: 0 0 0 6px rgba(79, 134, 247, .14), 0 0 16px rgba(79, 134, 247, .12); }
    100% { box-shadow: 0 0 0 2px rgba(79, 134, 247, .08); }
}

@keyframes warning-flash {
    0% { background-color: var(--red-500); opacity: 1; }
    50% { background-color: var(--red-400); opacity: 0.6; }
    100% { background-color: var(--red-500); opacity: 1; }
}

.warning-flash {
    animation: warning-flash 1.5s infinite;
}

.member-name {
    margin-bottom: 0;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Avatar */
.avatar-line {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-inv);
    background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(53, 107, 231, .18), 0 0 0 2px rgba(255, 255, 255, .65);
    transition: transform var(--ease), box-shadow var(--ease);
    overflow: hidden;
}

.avatar-badge img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.avatar-badge.avatar-animal {
    border-radius: 18px;
    padding: 4px;
    background:
        radial-gradient(circle at 28% 24%, rgba(255, 255, 255, .96), rgba(255, 255, 255, .84) 56%, rgba(214, 231, 255, .82));
    box-shadow:
        0 10px 24px rgba(53, 107, 231, .14),
        inset 0 1px 0 rgba(255, 255, 255, .92),
        0 0 0 1px rgba(137, 177, 255, .24);
}

.avatar-badge.avatar-animal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
}

.member-card.speaking .avatar-badge {
    animation: avatar-pulse 2s ease-in-out infinite;
}

.avatar-badge.personality-e {
    background: linear-gradient(135deg, #4f86f7, #a66df4);
    box-shadow: 0 8px 16px rgba(102, 111, 240, .18), 0 0 0 2px rgba(255, 255, 255, .65);
}

.avatar-badge.personality-i {
    background: linear-gradient(135deg, #29addf, #4f86f7);
    box-shadow: 0 8px 16px rgba(41, 173, 223, .16), 0 0 0 2px rgba(255, 255, 255, .65);
}

/* Progress Bar */
.progress {
    height: 10px;
    background: rgba(212, 228, 255, .6);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan-400), var(--blue-500), var(--blue-600));
    border-radius: var(--radius-pill);
    transition: width 600ms ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

/* Ranking Item */
.ranking-item {
    padding: 10px 14px;
    border-radius: var(--radius-s);
    background: linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(236, 244, 255, .62));
    border: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.5;
    transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ranking-item:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(228, 239, 255, .76));
    transform: translateX(2px);
}

.ranking-item.rank-1 {
    background: linear-gradient(135deg, rgba(224, 239, 255, .92), rgba(214, 228, 255, .72));
    border-color: rgba(79, 134, 247, .26);
    font-weight: 600;
}

.ranking-item.rank-2 {
    background: linear-gradient(135deg, rgba(240, 246, 255, .92), rgba(226, 235, 255, .72));
    border-color: rgba(97, 198, 244, .26);
    font-weight: 600;
}

.ranking-item.rank-3 {
    background: linear-gradient(135deg, rgba(246, 241, 255, .94), rgba(232, 224, 255, .74));
    border-color: rgba(166, 109, 244, .28);
    font-weight: 600;
}

/* Status Chip */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.status-chip::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-active {
    color: var(--green-fg);
    background: var(--green-bg);
    border-color: rgba(23, 98, 79, .08);
}

.status-active::before {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, .50);
    animation: dot-pulse 2s ease-in-out infinite;
}

.status-warning {
    color: var(--amber-fg);
    background: var(--amber-bg);
    border-color: rgba(139, 92, 18, .08);
}

.status-warning::before {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, .50);
}

.status-ended {
    color: var(--text-3);
    background: rgba(238, 244, 252, .94);
    border-color: rgba(135, 152, 179, .12);
}

.status-ended::before {
    background: var(--text-3);
}

/* Chart: Horizontal Bar */
.chart-row {
    display: grid;
    grid-template-columns: 120px 1fr 64px;
    align-items: center;
    gap: 12px;
}

.chart-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
}

.chart-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    text-align: right;
}

.chart-bar-track {
    height: 16px;
    border-radius: var(--radius-pill);
    background: rgba(211, 228, 255, .48);
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--cyan-400), var(--blue-500), var(--blue-700));
    transition: width 600ms ease;
}

/* Radio Label Card */
label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: var(--radius-s);
    border: 1.5px solid var(--border-strong);
    background: rgba(255, 255, 255, .62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background var(--ease), border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

label:hover {
    background: rgba(247, 251, 255, .9);
    border-color: var(--blue-200);
    transform: translateY(-1px);
}

label:has(input:checked) {
    background: linear-gradient(180deg, rgba(239, 247, 255, .96), rgba(230, 240, 255, .82));
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(79, 134, 247, .10);
}

.personality-option {
    min-height: 76px;
    align-items: center;
    overflow: hidden;
    color: var(--text-1);
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .90), rgba(246, 251, 255, .78)),
        url('../images/playful/firework.png') right 14px center / 82px auto no-repeat;
}

.personality-option:hover {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .94), rgba(239, 247, 255, .82)),
        url('../images/playful/firework.png') right 12px center / 90px auto no-repeat;
}

.personality-option:has(input:checked) {
    background:
        linear-gradient(90deg, rgba(240, 247, 255, .94), rgba(232, 245, 255, .78)),
        url('../images/playful/firework.png') right 12px center / 94px auto no-repeat;
}

.profile-card {
    gap: 20px;
}

.profile-title-block {
    display: grid;
    gap: 6px;
    text-align: center;
}

.profile-title-block h1 {
    margin: 0;
    color: var(--text-1);
    font-size: 34px;
    line-height: 1.05;
}

.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.profile-avatar {
    width: 104px;
    height: 104px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    box-shadow: 0 16px 34px rgba(79, 134, 247, .16);
}

.profile-name-block {
    text-align: center;
}

.profile-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.02em;
}

.profile-email {
    font-size: 14px;
    color: var(--text-2);
    margin-top: 4px;
}

.profile-info-grid {
    display: grid;
    gap: 12px;
}

.profile-info-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .68);
    border: 1px solid rgba(126, 163, 227, .2);
}

.profile-info-item .detail-metric-value {
    margin-top: 6px;
    font-size: 16px;
    line-height: 1.35;
    word-break: break-word;
}

.profile-coin-item {
    background: linear-gradient(135deg, rgba(255, 248, 220, .84), rgba(255, 255, 255, .72));
    border-color: rgba(245, 184, 58, .28);
}

.profile-coin-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8a5a08;
    font-weight: 900;
}

.profile-coin-value img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.profile-avatar-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

input[type="radio"] {
    accent-color: var(--blue-600);
    width: 18px;
    height: 18px;
    margin: 0;
}

/* AI Guide Bubble */
.ai-guide-bubble {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 900;
    background: linear-gradient(135deg, rgba(251, 248, 255, .92), rgba(242, 236, 255, .86));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1.5px solid rgba(166, 109, 244, .24);
    border-radius: var(--radius-l);
    padding: 16px 22px;
    max-width: 480px;
    width: calc(100% - 48px);
    box-shadow: 0 20px 34px rgba(138, 78, 226, .16), 0 0 0 1px rgba(255, 255, 255, .56) inset;
    animation: bubble-in 400ms cubic-bezier(.34, 1.56, .64, 1);
}

.ai-guide-bubble-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ai-robot-avatar {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(138, 78, 226, .22));
    animation: robot-bounce 2s ease-in-out infinite;
}

@keyframes robot-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.ai-guide-bubble-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--violet-600);
    margin-bottom: 0;
}

.ai-guide-bubble-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-2);
    padding-left: 50px;
}

.ai-guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-guide-btn img {
    flex-shrink: 0;
}

/* Speak Button */
.speak-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    -webkit-user-select: none;
    transition: all 200ms ease;
}

.speak-btn.active {
    background: var(--red-500);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .2), 0 4px 16px rgba(239, 68, 68, .25);
    transform: scale(1.04);
}

/* Voice Input Overlay */
.voice-overlay {
    position: fixed;
    inset: 0;
    z-index: 950;
    background:
        radial-gradient(circle at center, rgba(64, 142, 235, .18) 0%, rgba(15, 32, 70, .72) 46%, rgba(8, 16, 37, .9) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlay-in 200ms ease;
}

.voice-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 44px 52px;
    background: rgba(250, 253, 255, .08);
    border: 1px solid rgba(121, 170, 252, .24);
    border-radius: 28px;
    box-shadow: 0 0 60px rgba(79, 134, 247, .12), 0 0 120px rgba(166, 109, 244, .08);
}

.voice-wave {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 64px;
}

.voice-wave span {
    display: block;
    width: 6px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--cyan-400), var(--blue-500), var(--violet-500));
    box-shadow: 0 0 8px rgba(97, 198, 244, .36);
    animation: voice-bar 1.2s ease-in-out infinite;
}

.voice-wave span:nth-child(1) { height: 20px; animation-delay: 0s; }
.voice-wave span:nth-child(2) { height: 35px; animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { height: 50px; animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { height: 40px; animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { height: 55px; animation-delay: 0.15s; }
.voice-wave span:nth-child(6) { height: 38px; animation-delay: 0.25s; }
.voice-wave span:nth-child(7) { height: 48px; animation-delay: 0.35s; }
.voice-wave span:nth-child(8) { height: 30px; animation-delay: 0.05s; }
.voice-wave span:nth-child(9) { height: 22px; animation-delay: 0.4s; }

@keyframes voice-bar {
    0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

.voice-timer {
    font-size: 38px;
    font-weight: 700;
    color: #f8fbff;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    text-shadow: 0 0 16px rgba(79, 134, 247, .4), 0 2px 8px rgba(0, 0, 0, .3);
}

.voice-hint {
    font-size: 14px;
    color: rgba(220, 233, 255, .76);
    font-weight: 500;
}

/* Notification Overlay */
.notification-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(16, 28, 53, .42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlay-in 300ms ease;
}

.notification-box {
    background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(243, 248, 255, .88));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    max-width: 460px;
    width: calc(100% - 32px);
    border: 1px solid rgba(125, 163, 224, .22);
    box-shadow: var(--shadow-float), 0 0 0 1px rgba(255, 255, 255, .52) inset;
    text-align: center;
    animation: box-in 300ms cubic-bezier(.34, 1.56, .64, 1);
}

.notification-box .notification-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.notification-box .notification-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 8px;
}

.notification-box .notification-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-2);
}

/* Floating AI Assistant */
.floating-ai {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1100;
    font-family: inherit;
}

.floating-ai-toggle {
    width: 76px;
    height: 76px;
    border: none;
    border-radius: 24px;
    padding: 7px;
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 20px 44px rgba(53, 107, 231, .22), 0 0 0 1px rgba(255, 255, 255, .66) inset;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.floating-ai.dragging .floating-ai-toggle {
    cursor: grabbing;
    transform: scale(1.04);
}

.floating-ai-toggle:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 24px 50px rgba(53, 107, 231, .28), 0 0 0 1px rgba(255, 255, 255, .76) inset;
}

.floating-ai-toggle img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 18px;
    object-fit: cover;
}

.floating-ai-panel {
    position: absolute;
    right: 0;
    bottom: 92px;
    width: min(360px, calc(100vw - 32px));
    height: min(520px, calc(100vh - 130px));
    display: none;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    border-radius: 24px;
    background: rgba(248, 251, 255, .96);
    border: 1px solid rgba(180, 197, 235, .64);
    box-shadow: 0 28px 70px rgba(39, 72, 178, .24);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.floating-ai.align-left .floating-ai-panel {
    left: 0;
    right: auto;
}

.floating-ai-panel.open {
    display: grid;
}

.floating-ai-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(180, 197, 235, .46);
}

.floating-ai-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-1);
    font-weight: 800;
}

.floating-ai-title img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
}

.floating-ai-close {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(180, 197, 235, .7);
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    color: var(--text-2);
    cursor: pointer;
    font-weight: 800;
}

.floating-ai-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    overflow-y: auto;
}

.floating-ai-message {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 16px;
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.45;
}

.floating-ai-message.bot {
    align-self: flex-start;
    background: rgba(232, 240, 255, .88);
}

.floating-ai-message.user {
    align-self: flex-end;
    color: #fff;
    background: linear-gradient(135deg, var(--blue-600), var(--cyan-500));
}

.floating-ai-message.error {
    color: var(--red-600);
}

.floating-ai-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(180, 197, 235, .46);
}

.floating-ai-input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid rgba(191, 205, 237, .88);
    border-radius: 16px;
    padding: 11px 12px;
    font: inherit;
    color: var(--text-1);
    background: rgba(255, 255, 255, .86);
}

.floating-ai-input:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(79, 134, 247, .12);
}

.floating-ai-send {
    border: none;
    border-radius: 16px;
    padding: 0 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue-600), var(--cyan-500));
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 640px) {
    .floating-ai {
        right: 14px;
        bottom: 14px;
    }

    .floating-ai-toggle {
        width: 66px;
        height: 66px;
        border-radius: 22px;
    }
}
