:root {
    --kafu-sky: #2BAAE2;
    --kafu-blue: #1691D0;
    --kafu-navy: #15508A;
    --kafu-indigo: #283A83;
    --kafu-teal: #057590;
    --kafu-aqua: #3AC0C3;
    --kafu-green: #48AD48;
    --kafu-lime: #9ECC3B;
    --kafu-gold: #C9A437;
    --kafu-gold-dark: #8A6A16;

    --kafu-bg: #F4F8FB;
    --kafu-card: #FFFFFF;
    --kafu-text: #0A1A2C;
    --kafu-muted: #6B85A0;
    --kafu-border: #E2ECF4;

    --kafu-danger: #B42318;
    --kafu-danger-bg: #FEF3F2;
    --kafu-danger-border: #FECDCA;

    --kafu-success: #027A48;
    --kafu-success-bg: #ECFDF3;
    --kafu-success-border: #D1FADF;

    --kafu-shadow-sm: 0 4px 18px rgba(10, 38, 71, .05);
    --kafu-shadow-md: 0 12px 34px rgba(10, 38, 71, .09);
}

@font-face {
    font-family: 'Noto Kufi Arabic';
    src: url('../fonts/noto-kufi-arabic/NotoKufiArabic-400-arabic.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Noto Kufi Arabic';
    src: url('../fonts/noto-kufi-arabic/NotoKufiArabic-700-arabic.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Noto Kufi Arabic';
    src: url('../fonts/noto-kufi-arabic/NotoKufiArabic-900-arabic.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body.assistant-mobile-body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background: var(--kafu-bg);
    color: var(--kafu-text);
    font-family: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 13px;
}

button,
textarea,
input {
    font-family: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

button {
    -webkit-tap-highlight-color: transparent;
}

textarea::placeholder {
    color: #95ABBF;
}

/* =========================================================
   Assistant Layout
   ========================================================= */

.assistant-page {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 95% 3%, rgba(43, 170, 226, .12), transparent 32%),
        radial-gradient(circle at 5% 92%, rgba(201, 164, 55, .12), transparent 30%),
        var(--kafu-bg);
}

.phone-shell {
    width: min(100%, 560px);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(244, 248, 251, .96);
    border-left: 1px solid var(--kafu-border);
    border-right: 1px solid var(--kafu-border);
    box-shadow: var(--kafu-shadow-md);
}

.phone-shell::before {
    content: "";
    position: absolute;
    inset: 64px 0 118px;
    pointer-events: none;
    background:
        linear-gradient(rgba(244, 248, 251, .93), rgba(244, 248, 251, .93)),
        radial-gradient(circle at 15% 18%, rgba(58, 192, 195, .08), transparent 28%),
        radial-gradient(circle at 90% 85%, rgba(201, 164, 55, .08), transparent 30%);
}

/* =========================================================
   Top Bar
   ========================================================= */

.top-bar {
    height: 64px;
    flex: 0 0 64px;
    position: relative;
    z-index: 20;
    background: rgba(255, 255, 255, .97);
    border-bottom: 0;
    box-shadow: 0 8px 22px rgba(10, 38, 71, .055);
    padding: 0 12px;
}

.top-bar::after {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        #15508A,
        #1691D0,
        #3AC0C3,
        #48AD48,
        #C9A437
    );
}

.nav-container {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.brand-logo-img {
    display: block;
    width: auto;
    height: 42px;
    max-width: 105px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-separator {
    width: 1px;
    height: 34px;
    background: var(--kafu-border);
    flex-shrink: 0;
}

.nav-brand-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-brand-text strong {
    display: block;
    color: var(--kafu-navy);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-brand-text span {
    display: block;
    color: var(--kafu-muted);
    font-size: 9px;
    font-weight: 800;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.nav-status {
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--kafu-success-bg);
    color: var(--kafu-success);
    border: 1px solid rgba(72, 173, 72, .20);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--kafu-green);
    box-shadow: 0 0 0 4px rgba(72, 173, 72, .12);
    flex-shrink: 0;
}

.nav-status.is-offline {
    background: var(--kafu-danger-bg);
    color: var(--kafu-danger);
    border-color: rgba(184, 50, 50, .22);
}

.nav-status.is-offline .status-dot {
    background: var(--kafu-danger);
    box-shadow: 0 0 0 4px rgba(184, 50, 50, .12);
}

.nav-end-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #FFD7D7;
    background: #FFF1F1;
    color: var(--kafu-danger);
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.nav-end-btn svg {
    width: 16px;
    height: 16px;
}

.nav-end-btn:hover {
    background: #FFE4E4;
}

.nav-end-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* =========================================================
   Chat Body
   ========================================================= */

.chat-body {
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    padding: 16px 12px 135px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-body::-webkit-scrollbar {
    display: none;
}

.day-chip {
    width: fit-content;
    margin: 0 auto 14px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--kafu-border);
    color: var(--kafu-muted);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 900;
    box-shadow: var(--kafu-shadow-sm);
}

/* =========================================================
   Messages
   ========================================================= */

.message-row {
    display: flex;
    margin-bottom: 10px;
    animation: bubbleIn .20s ease both;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateY(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-row.user {
    justify-content: flex-start;
}

.message-row.bot {
    justify-content: flex-end;
}

.message-stack {
    max-width: 86%;
    display: flex;
    flex-direction: column;
}

.message-bubble {
    padding: 11px 13px;
    border-radius: 20px;
    font-size: 13px;
    line-height: 1.9;
    white-space: pre-line;
    word-break: break-word;
    box-shadow: var(--kafu-shadow-sm);
    position: relative;
}

.message-row.user .message-bubble {
    background: var(--kafu-navy);
    color: #fff;
    border: 1px solid rgba(21, 80, 138, .16);
    border-top-left-radius: 6px;
}

.message-row.bot .message-bubble {
    background: #fff;
    color: var(--kafu-text);
    border: 1px solid var(--kafu-border);
    border-top-right-radius: 6px;
}

.message-meta {
    margin-top: 4px;
    color: #95ABBF;
    font-size: 10px;
    font-weight: 700;
}

.message-row.user .message-meta {
    text-align: left;
    padding-left: 4px;
}

.message-row.bot .message-meta {
    text-align: right;
    padding-right: 4px;
}

/* =========================================================
   Typing
   ========================================================= */

.typing-row {
    display: none;
    justify-content: flex-end;
    margin: 6px 0 10px;
}

.typing-row.show {
    display: flex;
}

.typing-bubble {
    background: #fff;
    border: 1px solid var(--kafu-border);
    border-radius: 20px;
    border-top-right-radius: 6px;
    padding: 10px 13px;
    box-shadow: var(--kafu-shadow-sm);
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--kafu-muted);
    font-size: 12px;
    font-weight: 900;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    direction: ltr;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--kafu-muted);
    display: inline-block;
    animation: typingBlink 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: .15s;
}

.typing-dots span:nth-child(3) {
    animation-delay: .30s;
}

@keyframes typingBlink {
    0%,
    80%,
    100% {
        opacity: .25;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* =========================================================
   Category / Options Messages
   ========================================================= */

.category-message-stack {
    width: min(100%, 620px);
    max-width: 92%;
}

.category-message-bubble {
    width: 100%;
}

.category-message-bubble .quick-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--kafu-text);
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.category-message-bubble .quick-title::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--kafu-gold);
    box-shadow: 0 0 0 4px rgba(201, 164, 55, .12);
    flex-shrink: 0;
}

.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.category-btn {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(22, 145, 208, .18);
    background: #fff;
    color: var(--kafu-navy);
    border-radius: 14px;
    padding: 10px 13px;
    font-size: 11.5px;
    font-weight: 900;
    cursor: pointer;
    text-align: right;
    line-height: 1.6;
    transition: .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}

.category-btn:hover {
    background: rgba(22, 145, 208, .08);
    transform: translateY(-1px);
}

.category-btn.disabled,
.category-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.category-name {
    width: 100%;
    display: block;
    line-height: 1.6;
}

/* الأسئلة المرقمة تكون حسب المحتوى */
.category-message-stack:has(.classic-numbered-questions) {
    width: auto;
    max-width: 92%;
}

.category-message-bubble:has(.classic-numbered-questions) {
    width: auto;
    display: inline-block;
    max-width: 100%;
}

.classic-numbered-questions {
    display: block;
    width: auto;
    max-width: 100%;
    margin: 6px 0 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    list-style-position: inside;
    direction: rtl;
    text-align: right;
}

.classic-numbered-questions li {
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 3px 0;
    color: var(--kafu-text);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.8;
    white-space: normal;
    text-align: right;
}

.classic-numbered-questions li + li {
    border-top: 0;
}

.classic-numbered-questions li::marker {
    font-weight: 400;
    color: var(--kafu-navy);
}

.question-number-hint {
    width: fit-content;
    max-width: 100%;
    margin-top: 8px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: var(--kafu-muted);
    font-size: 10.8px;
    font-weight: 600;
    line-height: 1.6;
}

.question-number-hint strong {
    font-size: 11px;
    font-weight: 900;
    color: var(--kafu-navy);
}

.empty-category-questions {
    padding: 10px 12px;
    border-radius: 14px;
    background: #F8FBFE;
    border: 1px solid var(--kafu-border);
    color: var(--kafu-muted);
    font-size: 11.5px;
    font-weight: 800;
}

/* =========================================================
   Composer
   ========================================================= */

.composer {
    position: fixed;
    right: 50%;
    bottom: 0;
    transform: translateX(50%);
    width: min(100%, 560px);
    z-index: 10;
    background: rgba(244, 248, 251, .96);
    border-top: 1px solid var(--kafu-border);
    backdrop-filter: blur(12px);
    padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
}

.composer-card {
    background: #fff;
    border: 1px solid var(--kafu-border);
    border-radius: 20px;
    padding: 6px;
    box-shadow: var(--kafu-shadow-sm);
}

.composer-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}

.show-categories-btn,
.request-meeting-btn,
.popular-questions-btn {
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    border: 1px solid #DBEAFE;
    background: #EFF6FF;
    color: var(--kafu-navy);
    transition: .15s ease;
}

.show-categories-btn:hover {
    background: #DBEAFE;
}

.request-meeting-btn {
    background: #F0FDF4;
    border-color: #BBF7D0;
    color: #16803A;
}

.request-meeting-btn:hover {
    background: #DCFCE7;
}

.popular-questions-btn {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: var(--kafu-gold-dark);
}

.popular-questions-btn:hover {
    background: #FEF3C7;
}

.show-categories-btn.disabled,
.request-meeting-btn.disabled,
.popular-questions-btn.disabled,
.show-categories-btn:disabled,
.request-meeting-btn:disabled,
.popular-questions-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.composer-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.chat-input {
    flex: 1;
    min-height: 38px;
    height: 38px;
    max-height: 92px;
    resize: none;
    overflow-y: auto;
    border: 1px solid var(--kafu-border);
    outline: none;
    background: #F8FBFD;
    color: var(--kafu-text);
    border-radius: 15px;
    padding: 8px 11px;
    font-size: 16px;
    line-height: 1.45;
}

.chat-input:focus {
    border-color: rgba(22, 145, 208, .35);
    box-shadow: 0 0 0 4px rgba(22, 145, 208, .08);
}

.send-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 0;
    border-radius: 14px;
    background: var(--kafu-navy);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(21, 80, 138, .22);
    transition: .15s ease;
}

.send-btn:hover {
    transform: translateY(-1px);
    background: var(--kafu-blue);
}

.send-btn:disabled,
.chat-input:disabled {
    opacity: .55;
    cursor: default;
}

.send-btn svg {
    width: 19px;
    height: 19px;
}

/* =========================================================
   Feedback
   ========================================================= */

.bubble-feedback {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(226, 236, 244, .9);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bubble-feedback-label {
    color: var(--kafu-muted);
    font-size: 10.5px;
    font-weight: 800;
}

.bubble-feedback-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--kafu-border);
    background: #fff;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bubble-feedback-btn.selected {
    border-color: var(--kafu-blue);
    background: #EFF6FF;
}

.bubble-feedback.submitted .bubble-feedback-label {
    color: var(--kafu-success);
}

/* =========================================================
   Appointment
   ========================================================= */

.appointment-suggestion-box {
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
}

.appointment-suggestion-text {
    display: none;
}
.appointment-suggestion-btn:hover {
    background: #DCFCE7;
}

.appointment-suggestion-btn,
.appointment-cancel-btn {
    min-height: 32px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid #BBF7D0;
    background: #F0FDF4;
    color: #16803A;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.appointment-cancel-after-booking {
    margin-top: 10px;
}

.appointment-cancel-btn {
    border-color: #FECACA;
    background: #FEF2F2;
    color: #B91C1C;
}

.appointment-cancel-btn.disabled,
.appointment-cancel-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* =========================================================
   Session Rating
   ========================================================= */

.session-rating-box {
    display: flex;
    justify-content: center;
    margin: 12px 0;
}

.session-rating-card {
    width: min(100%, 360px);
    padding: 14px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--kafu-border);
    box-shadow: var(--kafu-shadow-sm);
    text-align: center;
}

.session-rating-title {
    color: var(--kafu-navy);
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 4px;
}

.session-rating-sub {
    color: var(--kafu-muted);
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 9px;
}

.session-stars {
    display: flex;
    justify-content: center;
    gap: 4px;
    direction: ltr;
}

.session-star-btn {
    border: 0;
    background: transparent;
    color: #CBD5E1;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.session-star-btn.active {
    color: var(--kafu-gold);
}

.session-star-btn:disabled {
    cursor: default;
}

.session-rating-thanks {
    margin-top: 8px;
    color: var(--kafu-success);
    font-size: 11px;
    font-weight: 900;
}

/* =========================================================
   Welcome Screen
   ========================================================= */

.welcome-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    overflow: hidden;
    background: #F8FBFE;
}

.welcome-bg-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(43, 170, 226, .16), transparent 32%),
        radial-gradient(circle at 80% 30%, rgba(72, 173, 72, .12), transparent 30%),
        radial-gradient(circle at 50% 90%, rgba(21, 80, 138, .10), transparent 34%),
        linear-gradient(180deg, #FFFFFF 0%, #F4F9FD 100%);
}

.welcome-shell {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    min-height: min(620px, calc(100dvh - 44px));
    display: grid;
    align-content: center;
    gap: 14px;
}

.welcome-brand-card {
    width: 100%;
    padding: clamp(28px, 5vw, 54px);
    border-radius: clamp(24px, 4vw, 36px);
    background: rgba(255, 255, 255, .92);
    border: 1px solid #E5EAF0;
    box-shadow: 0 24px 70px rgba(21, 80, 138, .12);
    text-align: center;
    backdrop-filter: blur(10px);
}

.welcome-logo-wrap {
    width: clamp(92px, 14vw, 132px);
    height: clamp(92px, 14vw, 132px);
    margin: 0 auto 18px;
    border-radius: 30px;
    background: #FFFFFF;
    border: 1px solid #E5EAF0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 34px rgba(21, 80, 138, .10);
}

.welcome-logo-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 78%;
    max-height: 78%;
    object-fit: contain;
}

.welcome-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 13px;
    margin-bottom: 13px;
    border-radius: 999px;
    background: #EFF6FF;
    border: 1px solid #DBEAFE;
    color: var(--kafu-navy);
    font-size: clamp(11px, 1.6vw, 13px);
    font-weight: 900;
    line-height: 1.5;
}

.welcome-title {
    color: #111827;
    font-size: clamp(25px, 4.8vw, 44px);
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.welcome-sub {
    max-width: 580px;
    margin: 0 auto;
    color: #64748B;
    font-size: clamp(13px, 2vw, 17px);
    font-weight: 700;
    line-height: 2;
    white-space: pre-line;
}

.welcome-status {
    width: fit-content;
    margin: 22px auto 0;
    min-height: 34px;
    padding: 6px 13px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 900;
}

.welcome-status span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.welcome-status.online {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #16803A;
}

.welcome-status.online span {
    background: #22C55E;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, .12);
}

.welcome-status.offline {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
}

.welcome-status.offline span {
    background: #EF4444;
    box-shadow: 0 0 0 5px rgba(239, 68, 68, .12);
}

.welcome-hint-card {
    padding: 13px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .86);
    border: 1px solid #E5EAF0;
    display: flex;
    align-items: center;
    gap: 11px;
    box-shadow: 0 12px 34px rgba(21, 80, 138, .08);
    backdrop-filter: blur(8px);
}

.welcome-hint-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: #EFF6FF;
    border: 1px solid #DBEAFE;
    color: var(--kafu-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.welcome-hint-icon svg {
    width: 19px;
    height: 19px;
}

.welcome-hint-card strong {
    display: block;
    color: #111827;
    font-size: 12.5px;
    font-weight: 900;
    line-height: 1.6;
}

.welcome-hint-card span {
    display: block;
    color: #64748B;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.7;
}

.welcome-screen.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .45s ease, visibility .45s ease;
}

.welcome-screen.hide-done {
    display: none;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 560px) {
    .phone-shell {
        width: 100%;
        border: 0;
        box-shadow: none;
    }

    .top-bar {
        height: 68px;
        flex-basis: 68px;
        padding: 0 8px;
    }

    .nav-container {
        height: 68px;
        gap: 6px;
    }

    .brand-logo-img {
        height: 34px;
        max-width: 78px;
    }

    .brand-separator {
        height: 30px;
    }

    .nav-brand-text strong {
        font-size: 11px;
        max-width: 135px;
    }

    .nav-brand-text span {
        display: block;
        font-size: 7.5px;
        line-height: 1.5;
        max-width: 145px;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .nav-status {
        height: 23px;
        padding: 0 7px;
        font-size: 7.5px;
        gap: 4px;
    }

    .phone-shell::before {
        inset: 68px 0 160px;
    }

    .message-stack {
        max-width: 90%;
    }

    .message-bubble {
        font-size: 12px;
        line-height: 1.85;
        padding: 10px 12px;
    }

    .category-message-stack {
        width: 100%;
        max-width: 100%;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-message-stack:has(.classic-numbered-questions) {
        width: auto;
        max-width: 96%;
    }

    .category-message-bubble:has(.classic-numbered-questions) {
        width: auto;
        max-width: 100%;
    }

    .classic-numbered-questions {
        width: auto;
        max-width: 100%;
    }

    .classic-numbered-questions li {
        width: auto;
        max-width: 100%;
    }

    .chat-body {
        padding: 14px 10px 155px;
    }

    .composer {
        width: 100%;
        padding: 8px 9px calc(env(safe-area-inset-bottom, 0px) + 10px);
    }

    .composer-card {
        border-radius: 18px;
    }

    .send-btn {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }
}

@media (max-width: 640px) {
    .welcome-screen {
        padding: 14px;
        align-items: stretch;
    }

    .welcome-shell {
        min-height: calc(100dvh - 28px);
        align-content: center;
    }

    .welcome-brand-card {
        padding: 30px 18px;
        border-radius: 26px;
    }

    .welcome-hint-card {
        align-items: flex-start;
    }
}

@media (max-height: 620px) {
    .welcome-shell {
        min-height: auto;
    }

    .welcome-brand-card {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .welcome-logo-wrap {
        width: 82px;
        height: 82px;
        margin-bottom: 12px;
    }

    .welcome-title {
        margin-bottom: 8px;
    }

    .welcome-status {
        margin-top: 14px;
    }
}

/* منع الفراغات الكبيرة داخل رسائل الخيارات */
.category-message-bubble {
    white-space: normal;
}

/* ضبط العنوان داخل الخيارات */
.category-message-bubble .quick-title {
    margin: 0 0 9px;
    padding: 0;
    line-height: 1.6;
}

/* منع أي مسافة زائدة قبل الخيارات */
.category-message-bubble .category-grid {
    margin: 0;
}

/* ضبط قائمة الأسئلة */
.category-message-bubble .classic-numbered-questions {
    margin: 8px 0 0;
}

/* ضبط تلميح رقم السؤال */
.category-message-bubble .question-number-hint {
    margin-top: 8px;
}

.appointment-self-service-note {
    margin: 12px 0 0;
    padding: 11px 12px;
    border-radius: 14px;
    background: #F8FBFE;
    border: 1px solid var(--kafu-border);
    color: var(--kafu-muted);
    font-size: 10.8px;
    font-weight: 700;
    line-height: 1.9;
}

.appointment-self-service-note strong {
    display: block;
    margin-bottom: 3px;
    color: var(--kafu-navy);
    font-size: 11px;
    font-weight: 900;
}

.appointment-self-service-note span {
    display: block;
}

.appointment-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.appointment-flow-head span {
  flex: 1;
}

.appointment-flow-cancel-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(220, 38, 38, 0.18);
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  font-family: inherit;
}

.appointment-flow-cancel-btn:hover {
  background: rgba(220, 38, 38, 0.14);
}

.appointment-flow-cancel-btn.disabled,
.appointment-flow-cancel-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.appointment-prompt-text {
  line-height: 1.8;
}


.nav-home-btn {
	width: 30px;
	height: 30px;
	border: 1px solid rgba(21, 80, 138, 0.16);
	border-radius: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(21, 80, 138, 0.08);
	color: #15508A;
	text-decoration: none;
	cursor: pointer;
	transition: 0.2s ease;
}

.nav-home-btn:hover {
	background: rgba(21, 80, 138, 0.14);
	color: #15508A;
	transform: translateY(-1px);
}

.nav-home-btn svg {
	width: 18px;
	height: 18px;
}