.ai-assistant {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-assistant__top {
    display: flex;
    gap: 16px;
    align-items: stretch;
    flex-wrap: wrap;
}

.ai-assistant__balance {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 16px;
    min-width: 220px;
}

.ai-assistant__balance-label {
    font-weight: 700;
    margin-bottom: 6px;
}

.ai-assistant__balance-value {
    font-size: 20px;
    font-weight: 800;
}

.ai-assistant__hint {
    flex: 1;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 16px;
    color: rgba(0, 0, 0, 0.7);
}

.ai-assistant__block {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 20px;
}

.ai-assistant__block--hidden {
    display: none;
}

.ai-assistant__title {
    font-weight: 800;
    font-size: 22px;
    margin: 0 0 8px;
}

.ai-assistant__text {
    color: #64748b;
    line-height: 1.5;
}

.ai-assistant__row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.ai-assistant__row + .ai-assistant__row {
    margin-top: 12px;
}

.ai-assistant--page {
    gap: 24px;
}

.ai-questionnaire {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 32px 32px;
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

.ai-questionnaire .ai-stepper__progress {
    height: 6px;
}

.ai-questionnaire .ai-stepper__labels {
    gap: 12px;
}

.ai-questionnaire .ai-stepper__label {
    flex: 1 1 180px;
    justify-content: center;
}

.ai-assistant__header {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.ai-assistant__meta {
    min-width: 240px;
    flex: 1 1 320px;
}

.ai-assistant__desc {
    margin: 6px 0 0;
    color: rgba(15, 23, 42, 0.7);
    line-height: 1.5;
    max-width: 520px;
}

.ai-assistant__stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.ai-stat {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    min-width: 80px;
}

.ai-stat__value-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.ai-stat__icon {
    width: 18px;
    height: 18px;
    display: block;
}

.ai-stat__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(15, 23, 42, 0.65);
}

.ai-stat__value {
    font-weight: 800;
    font-size: 18px;
}

.ai-stat__topup {
    margin-left: auto;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: #ffffff;
    color: #0f172a;
    font-weight: 700;
    line-height: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ai-stat__topup:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, 0.32);
}

.ai-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    background: #0f172a;
    color: #ffffff;
}

.ai-btn:hover {
    transform: translateY(-1px);
}

.ai-btn--ghost {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
}

.ai-btn--primary {
    background: #0f172a;
    color: #ffffff;
}

.ai-btn--danger {
    background: #ef4444;
    color: #ffffff;
}

.ai-btn__icon {
    font-size: 18px;
}

.ai-chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 16px;
    position: relative;
}

.ai-chat__top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.ai-chat__more {
    appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 700;
    color: #000000;
    background: #ffffff;
    cursor: pointer;
}

.ai-chat__prompts-toggle {
    appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
    cursor: pointer;
}

.ai-chat__messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.ai-chat__message {
    display: flex;
}

.ai-chat__message--user {
    justify-content: flex-end;
}

.ai-chat__message--assistant {
    justify-content: flex-start;
}

.ai-chat__bubble {
    max-width: min(90%, 720px);
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.08);
    line-height: 1.4;
    white-space: normal;
}

.ai-chat__message--user .ai-chat__bubble {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.ai-chat__typing {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(15, 23, 42, 0.6);
}

.ai-chat__prompts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px dashed rgba(15, 23, 42, 0.2);
    position: absolute;
    right: 16px;
    top: 56px;
    width: min(280px, 100%);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
    z-index: 5;
}

.ai-chat__prompts[hidden],
.ai-chat__prompts-toggle[hidden] {
    display: none;
}

.ai-chat__prompts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ai-chat__prompts-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(15, 23, 42, 0.7);
}

.ai-chat__prompts-close {
    border: none;
    background: transparent;
    color: rgba(15, 23, 42, 0.6);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.ai-chat__prompts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-chat__prompt {
    border: 1px solid rgba(15, 23, 42, 0.15);
    background: #ffffff;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.ai-chat__prompt:hover {
    border-color: rgba(15, 23, 42, 0.35);
    transform: translateY(-1px);
}

.ai-typing__dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.4);
    animation: ai-typing 1s infinite ease-in-out;
}

.ai-typing__dot:nth-child(2) {
    animation-delay: 0.15s;
}

.ai-typing__dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes ai-typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.ai-chat__composer {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: #f8fafc;
    border-radius: 14px;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.ai-chat__composer-note {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(15, 23, 42, 0.6);
}

.ai-chat__message-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-chat__input {
    flex: 1;
    border: none;
    background: transparent;
    height: 44px;
    font-size: 15px;
    line-height: 1.4;
    outline: none;
}

.ai-chat__quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-chat__quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.ai-chat__date {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    color: rgba(15, 23, 42, 0.7);
}

.ai-chat__date-input {
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 8px 10px;
}

.ai-chat__cost {
    font-weight: 700;
    opacity: 0.7;
}

.ai-chip {
    appearance: none;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.ai-chip:hover {
    transform: translateY(-1px);
}

.ai-chip.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.ai-q {
    padding: 16px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}

.ai-q + .ai-q {
    margin-top: 14px;
}

.ai-q__label {
    font-weight: 800;
    margin-bottom: 10px;
    color: #0f172a;
}

.ai-q__options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ai-q__input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.ai-q__range {
    width: 100%;
}

.ai-q__range-value {
    font-weight: 700;
    margin-top: 8px;
    color: rgba(15, 23, 42, 0.7);
}

.ai-stepper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-stepper__eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(15, 23, 42, 0.6);
}

.ai-stepper__progress {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.ai-stepper__progress-fill {
    height: 100%;
    background: #0ea5e9;
    border-radius: inherit;
    transition: width 0.2s ease;
}

.ai-stepper__labels {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-stepper__label {
    appearance: none;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-stepper__label-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.ai-stepper__label-text {
    font-size: 14px;
    font-weight: 700;
}

.ai-stepper__label.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.ai-stepper__label.is-active .ai-stepper__label-index {
    background: #ffffff;
    color: #0f172a;
}

.ai-stepper__content {
    min-width: 0;
    margin-top: 6px;
}

.ai-stepper__controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.ai-output {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: #f8fafc;
    white-space: pre-wrap;
    margin-top: 12px;
}

.ai-output__title {
    font-weight: 800;
    margin-bottom: 8px;
}

.ai-output__meta {
    color: rgba(0, 0, 0, 0.65);
    margin-bottom: 10px;
}

.ai-output__list {
    margin: 0;
    padding-left: 18px;
}

.ai-output__list strong{
    font-weight: 500;
}

.ai-error {
    padding: 12px;
    border-radius: 14px;
    background: #fff1f2;
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #9f1239;
    font-weight: 700;
}

.ai-q__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-q__toggle-label {
    font-weight: 700;
    color: rgba(15, 23, 42, 0.8);
}

.ai-q__switch {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ai-q__switch input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.ai-q__switch-track {
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #e2e8f0;
    border: 1px solid rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    padding: 2px;
    transition: background 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.ai-q__switch-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s ease;
}

.ai-q__switch input:checked + .ai-q__switch-track {
    background: #0f172a;
    border-color: #0f172a;
}

.ai-q__switch input:checked + .ai-q__switch-track .ai-q__switch-thumb {
    transform: translateX(20px);
}

.ai-q__switch input:focus-visible + .ai-q__switch-track {
    outline: 2px solid rgba(5, 134, 199, 0.45);
    outline-offset: 2px;
}

/* Modal */
.ai-modal[hidden] {
    display: none;
}

.ai-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.ai-modal__overlay,
.ai-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.ai-modal__dialog,
.ai-modal__panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(720px, calc(100% - 24px));
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.ai-modal__header,
.ai-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ai-modal__title {
    font-weight: 800;
}

.ai-modal__close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    cursor: pointer;
    font-size: 18px;
    color: #000;
}

.ai-modal__body {
    padding: 16px;
    max-height: 66vh;
    overflow: auto;
}

.ai-modal__footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.dashboard-ai .dashboard-view::after{
    display: none;
}

.dashboard-view__ai{
    display: flex;
    margin-bottom: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

@media (max-width: 1024px) {
    .dashboard-view__ai, 
    .ai-assistant__header{
        padding: 0 6px;
    }
}

@media (max-width: 860px) {
    .ai-stepper {
        gap: 10px;
    }
}

.ai-assistant__top--coach {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.ai-settings-card {
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-settings-card__section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-settings-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.ai-settings-card__text {
    margin: 0;
    color: rgba(15, 23, 42, 0.6);
}

.ai-settings-card__textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    padding: 12px 14px;
    font-size: 14px;
    resize: vertical;
}

.ai-settings-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ai-settings-card__input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ai-settings-card__input {
    flex: 1 1 260px;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    padding: 10px 12px;
    font-size: 14px;
}

.ai-settings-card__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-settings-card__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #f8fafc;
}

.ai-settings-card__item-text {
    flex: 1;
    font-weight: 600;
}

.ai-settings-card__item-remove,
.ai-settings-card__item-add {
    border: none;
    background: transparent;
    color: #2563eb;
    font-weight: 700;
    cursor: pointer;
}

.ai-settings-card__item-remove {
    color: #ef4444;
}

.ai-settings-card__empty {
    color: rgba(15, 23, 42, 0.6);
    margin: 0;
}

.ai-settings-card__actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 720px) {
    .ai-assistant__header {
        align-items: flex-start;
    }
    
    .ai-chat__bubble{
        padding: 8px 8px;
    }

    .ai-assistant__stats {
        width: 100%;
        justify-content: flex-start;
    }

    .ai-assistant__stats .ai-btn,
    .ai-assistant__stats .ai-stat {
        justify-content: center;
        font-size: 14px;
        padding: 6px 8px;
        line-height: 18px;
    }

    .ai-chat__composer {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-chat__input {
        height: 40px;
    }

    .ai-chat__message{
        font-size: 14px;
    }

    .ai-chat__prompts {
        left: 12px;
        right: 12px;
        width: auto;
        top: 52px;
    }

    .ai-assistant__desc{
        font-size: 14px;
    }
}
