* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
    background-color: #3b1b68;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Screen Wrapper */
.chat-app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    background-color: #7A59B4;
    position: relative;
    box-shadow: 0 14px 45px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

/* Full bleed on mobile screens */
@media (max-width: 540px) {
    .chat-app-container {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }
}

/* Ambient Artwork Patterns (#885BB8) */
.pattern-dots {
    position: absolute;
    top: 60px;
    left: 0;
    width: 140px;
    height: 180px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.75;
}

.pattern-leaves {
    position: absolute;
    bottom: 45px;
    right: 0;
    width: 170px;
    height: 230px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.55;
}

/* Top Header Bar */
.chat-header {
    position: relative;
    z-index: 50;
    background: linear-gradient(180deg, #4A2490 0%, #5B2EB5 100%);
    min-height: 62px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.btn-back {
    background: none;
    border: none;
    font-size: 20px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background 0.2s;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-back:hover,
.btn-back:active {
    background: rgba(255, 255, 255, 0.15);
}

.avatar-wrap {
    width: 42px;
    height: 42px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.avatar-flower {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
}

.header-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    background: #22c55e;
    color: #ffffff;
    border-radius: 50%;
    font-size: 9.5px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.header-right {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.hand-pointer-icon {
    font-size: 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    user-select: none;
    cursor: pointer;
    animation: handPointPulse 1.4s ease-in-out infinite alternate;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
    transition: transform 0.15s ease;
}

.hand-pointer-icon:hover,
.hand-pointer-icon:active {
    transform: scale(1.15) translateX(2px);
}

@keyframes handPointPulse {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(4px);
    }
}

.btn-menu-dots {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 60;
    outline: none;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-menu-dots .dots-icon,
.btn-menu-dots svg {
    display: block;
    width: 20px;
    height: 20px;
    pointer-events: none;
}



.btn-menu-dots:hover,
.btn-menu-dots:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Menu Dropdown Modal / Popup */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
    width: 255px;
    display: none;
    flex-direction: column;
    padding: 8px 6px;
    z-index: 99999;
    border: 1px solid rgba(0, 0, 0, 0.06);
    animation: fadeInMenu 0.18s ease-out;
}

@keyframes fadeInMenu {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

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

.dropdown-menu.show {
    display: flex !important;
}

.dropdown-item {
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    border-radius: 10px;
    transition: background 0.15s;
}

.dropdown-item:hover,
.dropdown-item:active {
    background: #f1f5f9;
}

.menu-icon-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.menu-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 8px;
}

/* Chat Scroll Area */
.chat-body {
    position: relative;
    z-index: 10;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.chat-body::-webkit-scrollbar {
    width: 4px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

/* Encryption Notice Banner */
.encryption-banner {
    background: #fff9e6;
    border-radius: 16px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin: 2px 2px 4px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.encryption-banner .enc-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #5B2EB5;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    margin-top: 1px;
}

.encryption-banner a {
    color: #5B2EB5;
    text-decoration: none;
    font-weight: 600;
}

/* Quick Suggestions Chips */
.quick-suggestions {
    display: flex;
    gap: 8px;
    margin: 4px 0 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 2px 6px;
    flex-shrink: 0;
}

.quick-suggestions::-webkit-scrollbar {
    display: none;
}

.chip-btn {
    background: rgba(255, 255, 255, 0.94);
    border: none;
    color: #4A2490;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.chip-btn:hover,
.chip-btn:active {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Message Bubbles */
.msg-row {
    display: flex;
    margin-bottom: 2px;
    width: 100%;
}

.msg-row.user {
    justify-content: flex-end;
}

.msg-row.bot {
    justify-content: flex-start;
}

.msg-bubble {
    max-width: 90%;
    padding: 12px 14px 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.48;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    animation: fadeInMsg 0.25s ease-out;
}

@keyframes fadeInMsg {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.msg-bubble.bot-bubble {
    background: #ffffff;
    color: #1e293b;
    border-top-left-radius: 4px;
}

.msg-bubble.user-bubble {
    background: #ffffff;
    color: #1e293b;
    border-top-right-radius: 4px;
    border-left: 3px solid #5B2EB5;
}

.msg-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 10.5px;
    color: #94a3b8;
    margin-top: 6px;
    margin-left: 10px;
    float: right;
}

.msg-footer .ticks {
    color: #8b5cf6;
    font-size: 11.5px;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    padding: 9px 14px;
    border-radius: 16px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 4px;
}

.typing-indicator.active {
    display: flex;
}

.typing-indicator span {
    font-size: 12px;
    color: #64748b;
    margin-right: 4px;
    font-weight: 500;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #5B2EB5;
    border-radius: 50%;
    animation: bounceDot 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounceDot {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Bottom Input Bar */
.chat-input-bar {
    position: relative;
    z-index: 30;
    background: transparent;
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)) 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.input-pill {
    flex: 1;
    background: #ffffff;
    border-radius: 28px;
    display: flex;
    align-items: center;
    padding: 4px 10px 4px 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    min-height: 48px;
    min-width: 0;
}

.input-icon-btn {
    background: none;
    border: none;
    color: #5B2EB5;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.15s, color 0.15s;
    flex-shrink: 0;
}

.input-icon-btn:hover,
.input-icon-btn:active {
    color: #4A2490;
    transform: scale(1.1);
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #1e293b;
    padding: 7px 8px;
    background: transparent;
    min-width: 0;
}

.message-input::placeholder {
    color: #94a3b8;
    font-size: 14.5px;
}

.right-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Circular Purple Mic / Send Button */
.btn-action-circle {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: #5B2EB5;
    border-radius: 50%;
    border: none;
    color: #ffffff;
    font-size: 19px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(91, 46, 181, 0.45);
    transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.btn-action-circle:hover {
    background: #4A2490;
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(74, 36, 144, 0.55);
}

.btn-action-circle:active {
    transform: scale(0.95);
}

.btn-action-circle.recording {
    background: #ef4444;
    animation: pulse-record 1s infinite alternate;
}

@keyframes pulse-record {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    100% {
        transform: scale(1.08);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Responsive Tweaks */
@media (max-width: 360px) {
    .chat-header {
        padding-left: 6px;
        padding-right: 6px;
    }

    .header-title {
        font-size: 17px;
    }

    .avatar-wrap {
        width: 36px;
        height: 36px;
    }

    .btn-action-circle {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 17px;
    }

    .input-pill {
        min-height: 44px;
        padding-left: 8px;
    }

    .dropdown-menu {
        width: 230px;
    }
}

/* Toast Alert */
.toast-msg {
    position: absolute;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 27, 75, 0.95);
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    display: none;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

#hiddenFileInput {
    display: none;
}

/* ==========================================================================
   About Riya Screen (Matching Exact Layout & Aesthetic from Image)
   ========================================================================== */
.about-riya-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ede3fd;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
    overflow: hidden;
}

.about-riya-screen.show {
    transform: translateX(0);
}

/* Header */
.about-header {
    background: linear-gradient(180deg, #6c2eb9 0%, #7A59B4 100%);
    min-height: 64px;
    display: flex;
    align-items: center;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 12px 10px;
    gap: 8px;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.about-back-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 19px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.about-back-btn:hover,
.about-back-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.about-header-titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.about-header-main {
    font-size: 19.5px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.2px;
}

.about-info-icon {
    font-size: 15px;
    opacity: 0.9;
}

.about-subtitle-text {
    font-size: 12.5px;
    color: #e9d5ff;
    font-weight: 500;
    margin-top: 1px;
}

/* Scrollable Content Body */
.about-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px 28px 14px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.about-body::-webkit-scrollbar {
    width: 4px;
}

.about-body::-webkit-scrollbar-thumb {
    background: rgba(122, 89, 180, 0.3);
    border-radius: 4px;
}

/* White Cards */
.about-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 18px;
    box-shadow: 0 2px 10px rgba(109, 40, 217, 0.07);
    border: 1px solid rgba(220, 205, 248, 0.5);
    animation: fadeInAboutCard 0.3s ease-out;
}

@keyframes fadeInAboutCard {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-headline {
    font-size: 18px;
    font-weight: 800;
    color: #6d28d9;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.card-intro {
    font-size: 14px;
    line-height: 1.52;
    color: #334155;
    font-weight: 500;
}

.card-subhead {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-top: 14px;
    margin-bottom: 8px;
}

.card-feature-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-feature-list li {
    font-size: 13.5px;
    color: #334155;
    line-height: 1.55;
    position: relative;
    padding-left: 16px;
    font-weight: 500;
}

.card-feature-list li::before {
    content: "•";
    position: absolute;
    left: 2px;
    color: #1e293b;
    font-size: 18px;
    line-height: 1.2;
}

/* Voice Card & Purple Audio Player */
.purple-audio-player {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(109, 40, 217, 0.35);
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.2s;
}

.purple-audio-player:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(109, 40, 217, 0.45);
}

.purple-audio-player:active {
    transform: scale(0.98);
}

.audio-play-circle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: #ffffff;
    color: #7c3aed;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s, background 0.15s;
    flex-shrink: 0;
}

.purple-audio-player.playing .audio-play-circle {
    background: #ede9fe;
    color: #5b21b6;
    animation: audioPulse 1.2s infinite ease-in-out;
}

@keyframes audioPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

.audio-text-wrap {
    flex: 1;
    min-width: 0;
}

.audio-heading {
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-subheading {
    font-size: 12px;
    color: #e9d5ff;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.voice-hint {
    font-size: 13.5px;
    line-height: 1.5;
    color: #334155;
    margin-top: 12px;
    font-weight: 500;
}

/* Brand Card */
.brand-title {
    font-size: 18px;
    font-weight: 800;
    color: #6d28d9;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.brand-tagline {
    font-size: 13.5px;
    color: #475569;
    font-weight: 500;
    margin-bottom: 6px;
}

.brand-contact {
    font-size: 13px;
    color: #334155;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.contact-link {
    color: #334155;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s;
}

.contact-link:hover {
    color: #6d28d9;
    text-decoration: underline;
}

.contact-sep {
    color: #cbd5e1;
}