.wbk-assistance {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-height: calc(100vh - 120px);
    margin: 0;
    padding: 24px 24px 32px;
    box-sizing: border-box;

    &__content {
        display: flex;
        flex: 1;
        gap: 24px;
        min-height: 0;
        align-items: stretch;
    }

    &__main {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-width: 0;
        min-height: 0;
    }

    &__header {
        margin-bottom: 20px;

        h1 {
            margin: 0 0 8px;
            font-size: 24px;
            font-weight: 500;
            color: #1a1a1a;
        }

        p {
            margin: 0;
            color: #5c5c5c;
            font-size: 14px;
            line-height: 1.5;
        }
    }

    &__sidebar {
        display: flex;
        flex-direction: column;
        flex: 0 0 340px;
        width: 340px;
        min-width: 300px;
        max-width: 380px;
        min-height: 0;
        overflow: hidden;
    }

    &__config-panel {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
        padding: 20px 24px 24px;
        background: #fff;
        overflow-y: auto;
    }

    &__chat {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        min-height: 0;
        padding: 20px 24px 24px;
        background: #fff;
    }

    &__config-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;

        h2 {
            margin: 0;
            font-size: 18px;
            font-weight: 500;
            color: #1a1a1a;
        }
    }

    &__config-intro {
        margin: 0 0 14px;
        font-size: 12px;
        line-height: 1.5;
        color: #5c5c5c;
    }

    &__config-mode {
        margin: 0 0 10px;
        font-size: 13px;
        font-weight: 500;
        color: #1f8f55;
    }

    &__config-pending {
        margin: 0 0 14px;
        padding: 12px;
        font-size: 13px;
        line-height: 1.5;
        color: #5c5c5c;
        background: #f7f8fa;
        border: 1px dashed #d0d5dd;
        border-radius: 8px;
    }

    &__config-progress {
        flex-shrink: 0;
        font-size: 12px;
        font-weight: 500;
        color: #1f8f55;
        background: #e8f5ee;
        padding: 4px 8px;
        border-radius: 999px;
    }

    &__config-fields {
        margin: 0;
        padding: 0;
        list-style: none;
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    &__config-field {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 10px 12px;
        border-radius: 8px;
        background: #f7f8fa;
        border: 1px solid #e8eaed;

        &--set {
            background: #f3faf6;
            border-color: #c8e6d4;
        }

        &--missing {
            .wbk-assistance__config-field-value {
                color: #8a8a8a;
                font-style: italic;
            }
        }
    }

    &__config-field-label {
        font-size: 11px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #5c5c5c;
    }

    &__config-field-value {
        font-size: 13px;
        line-height: 1.4;
        color: #1a1a1a;
        word-break: break-word;
    }

    &__config-services {
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid #e8eaed;

        h3 {
            margin: 0 0 8px;
            font-size: 11px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #5c5c5c;
        }

        ul {
            margin: 0;
            padding: 0;
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        li {
            font-size: 13px;
            line-height: 1.4;
            color: #1a1a1a;
            padding: 8px 10px;
            background: #f7f8fa;
            border-radius: 6px;
        }
    }

    &__config-section {
        margin-bottom: 20px;

        &:last-child {
            margin-bottom: 0;
        }
    }

    &__config-sectionTitle {
        margin: 0 0 12px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #6b7280;
    }

    &__config-cards {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    &__config-entityCard {
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        background: #fff;
        overflow: hidden;

        &--complete {
            border-color: #c8e6d4;
            background: #f9fcfa;
        }
    }

    &__config-entityCard-header {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 14px;
        border-bottom: 1px solid #eef0f3;
        background: #f9fafb;
    }

    &__config-entityCard-badge {
        flex-shrink: 0;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #6b7280;
        background: #eef0f3;
        padding: 2px 6px;
        border-radius: 999px;
    }

    &__config-entityCard-title {
        margin: 0;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.3;
        color: #111827;
    }

    &__config-entityCard-properties {
        margin: 0;
        padding: 10px 14px 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    &__config-entityCard-row {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    &__config-entityCard-label {
        margin: 0;
        font-size: 11px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #6b7280;
    }

    &__config-entityCard-value {
        margin: 0;
        font-size: 13px;
        line-height: 1.45;
        color: #111827;
        word-break: break-word;
    }

    &__config-entityCard-row--missing {
        .wbk-assistance__config-entityCard-value {
            color: #9ca3af;
            font-style: italic;
        }
    }

    &__messages {
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 0;
        min-height: 280px;
    }

    &__empty {
        margin: auto;
        text-align: center;
        color: #8a8a8a;
        font-size: 14px;
        max-width: 420px;
        line-height: 1.6;
    }

    &__message {
        max-width: 88%;
        padding: 12px 16px;
        border-radius: 12px;
        font-size: 14px;
        line-height: 1.5;
        word-break: break-word;

        &--user {
            align-self: flex-end;
            background: #1f8f55;
            color: #fff;
        }

        &--reply {
            align-self: flex-start;
            background: #fff;
            border: 1px solid #e0e3e8;
            color: #1a1a1a;
        }

        &--clarify {
            border-color: #c5d9f0;
            background: #f3f8ff;
        }

        &--error {
            align-self: stretch;
            background: #fdecea;
            border: 1px solid #f5c6c2;
            color: #842029;
        }
    }

    &__clarify-label {
        display: block;
        margin-bottom: 6px;
        font-size: 11px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #3d6b9e;
    }

    &__message-text,
    &__message-formatted {
        white-space: pre-wrap;
    }

    &__summary-heading {
        margin: 0 0 8px;
        font-size: 13px;
        font-weight: 500;
        color: inherit;
    }

    &__summary-list {
        margin: 0 0 12px;
        padding-left: 18px;
        list-style: disc;

        li {
            margin-bottom: 4px;
        }

        li:last-child {
            margin-bottom: 0;
        }

        li strong {
            font-weight: 600;
        }
    }

    &__summary-warning-icon {
        display: inline-flex;
        flex: 0 0 16px;
        width: 16px;
        height: 16px;
        margin-top: 2px;
        color: #eab308;
    }

    &__pro-skipped {
        margin-top: 8px;
    }

    &__pro-skipped-intro {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        margin: 0;
        font-size: 14px;
        line-height: 1.5;
        color: #1a1a1a;
    }

    &__pro-skipped-toggle {
        padding: 0;
        border: none;
        background: none;
        color: #1a1a1a;
        font-family: inherit;
        font-size: inherit;
        line-height: inherit;
        text-decoration: underline;
        cursor: pointer;

        &:hover {
            color: #000;
        }
    }

    &__pro-skipped-list {
        margin: 8px 0 0;
        padding-left: 24px;
        list-style: disc;
        color: #1a1a1a;

        li {
            margin-bottom: 4px;
            font-size: 14px;
            line-height: 1.5;
        }

        li:last-child {
            margin-bottom: 0;
        }
    }

    &__pro-skipped-upgrade {
        margin: 12px 0 0;
        padding-left: 24px;
        font-size: 14px;
        line-height: 1.5;

        a {
            color: #1f8f55;
            text-decoration: underline;
            font-weight: 500;

            &:hover {
                color: #187a48;
            }
        }
    }

    &__summary-question {
        margin: 0;
        padding-top: 12px;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

    &__clarify-question {
        font-size: 16px;
        font-style: italic;
        line-height: 1.5;
        color: #1a1a1a;
    }

    &__booking-page-link {
        margin: 20px 0 12px;
        font-size: 13px;
        line-height: 1.5;

        a {
            color: #1f8f55;
            text-decoration: underline;
            font-weight: 500;

            &:hover {
                color: #187a48;
            }
        }
    }

    &__apply-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-top: 16px;
        padding: 12px 14px;
        border: 1px solid #c8e6d4;
        border-radius: 10px;
        background: #f3faf6;

        p {
            margin: 0;
            font-size: 13px;
            line-height: 1.4;
            color: #1a1a1a;
        }
    }

    &__apply {
        flex-shrink: 0;
        height: 36px;
        padding: 0 16px;
        border: none;
        border-radius: 8px;
        background: #1f8f55;
        color: #fff;
        font-family: inherit;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;

        &:hover:not(:disabled) {
            background: #187a48;
        }

        &:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
    }

    &__composer {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 16px;
    }

    &__input-wrap {
        position: relative;
        width: 100%;
    }

    &__input-typewriter {
        position: absolute;
        inset: 0;
        padding: 12px 14px;
        font-family: inherit;
        font-size: 14px;
        line-height: 1.4;
        color: #8a8a8a;
        pointer-events: none;
        white-space: pre-wrap;
        word-break: break-word;
        z-index: 1;
    }

    &__input-typewriter-cursor {
        display: inline-block;
        width: 2px;
        height: 1em;
        margin-left: 1px;
        vertical-align: text-bottom;
        background: #8a8a8a;
        animation: wbk-assistance-typewriter-cursor 1s step-end infinite;
    }

    &__input {
        width: 100%;
        box-sizing: border-box;
        min-height: 48px;
        max-height: 160px;
        resize: vertical;
        padding: 12px 14px;
        border: 1px solid #d0d5dd;
        border-radius: 10px;
        font-family: inherit;
        font-size: 14px;
        line-height: 1.4;

        &:focus {
            outline: none;
            border-color: #1f8f55;
            box-shadow: 0 0 0 2px rgba(31, 143, 85, 0.15);
        }

        &:disabled {
            background: #f5f5f5;
            cursor: not-allowed;
        }
    }

    &__send {
        align-self: flex-end;
        flex-shrink: 0;
        min-width: 100px;
        height: 40px;
        padding: 0 20px;
        border: none;
        border-radius: 10px;
        background: #1f8f55;
        color: #fff;
        font-family: inherit;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;

        &:hover:not(:disabled) {
            background: #187a48;
        }

        &:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
    }

    &__loading {
        align-self: flex-start;
        color: #5c5c5c;
        font-size: 14px;
        font-style: italic;
    }

    &__loading-phrase {
        display: inline-block;
        animation: wbk-assistance-loading-phrase 0.45s ease-out;
    }

    &--wizard,
    &--checklist {
        min-height: 0;
        height: 100%;
        padding: 0;
        margin: 0 auto;

        .wbk-assistance__content {
            min-height: 0;
            height: 100%;
        }

        .wbk-assistance__main {
            min-height: 0;
        }

        .wbk-assistance__chat {
            flex: 1;
            min-height: 0;
            padding: 0;
            background: transparent;
        }

        .wbk-assistance__messages {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
        }

        .wbk-assistance__sidebar {
            flex: 0 0 320px;
            width: 100%;
            min-width: 40%;
            max-width: 512px;
        }

        .wbk-assistance__config-panel {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
        }
    }

    &__wizardIntro {
        margin-bottom: 20px;
        text-align: center;
    }

    &__wizardTitle {
        margin: 0 0 8px;
        font-size: 30px;
        font-weight: 600;
        line-height: 36px;
        color: #111827;
    }

    &__wizardDescription {
        margin: 0;
        font-size: 16px;
        line-height: 24px;
        color: #6b7280;
    }
}

@keyframes wbk-assistance-loading-phrase {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wbk-assistance-typewriter-cursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@media (max-width: 960px) {
    .wbk-assistance {
        padding: 24px;

        &__content {
            flex-direction: column;
        }

        &__main {
            flex: none;
        }

        &__chat {
            flex: none;
        }

        &__sidebar {
            flex: none;
            width: 100%;
            max-width: none;
            min-height: auto;
            overflow: visible;
        }

        &__config-panel {
            flex: none;
            min-height: auto;
            max-height: none;
            overflow: visible;
        }
    }
}