/* Digital Twin Chat Section */

#digital-twin {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    width: 100%;
}

#digital-twin.section.active {
    display: flex;
    height: calc(100vh - 6rem);
    height: calc(100dvh - 6rem);
    min-height: 420px;
    overflow: hidden;
}


/* Header */

#digital-twin .header-container {
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.digital-twin-title-stack {
    text-align: left;
}

.digital-twin-icon {
    height: 125px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

#digital-twin .header {
    font-size: 2rem;
    margin: 0;
}

#digital-twin .digital-twin-title-stack .subtitle {
    font-size: 0.95rem;
    margin: 0.2rem 0 1rem 0;
}


/* Chat */

.chat-wrap {
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.chat-suggestions {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding: 0.1rem 0.2rem 1.3rem 0.8rem;
    flex-shrink: 0;
    scrollbar-width: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.chat-suggestions.changing {
    opacity: 0;
    transform: translateY(4px);
}

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

.chat-suggestion {
    position: relative;
    flex: 0 0 auto;

    padding: 0.58rem 0.85rem;

    border: 1px solid rgba(93, 0, 247, 0.12);
    border-radius: 24px;

    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    color: #526078;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;

    box-shadow:
        0 5px 18px rgba(31, 38, 135, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);

    animation: suggestionFloat 3.5s ease-in-out infinite;

    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.chat-suggestion::before {
    content: "";
    position: absolute;

    left: 38px;
    bottom: -9px;

    width: 15px;
    height: 15px;

    background: rgba(255, 255, 255, 0.82);
    border-right: 1px solid rgba(93, 0, 247, 0.12);
    border-bottom: 1px solid rgba(93, 0, 247, 0.12);

    transform: rotate(45deg);

    border-radius: 0 0 8px 0;
}

.chat-suggestion:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 25px rgba(31, 38, 135, 0.13),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

@keyframes suggestionFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.chat-suggestion:nth-child(2) {
    animation-delay: 0.7s;
}

.chat-suggestion:nth-child(3) {
    animation-delay: 1.4s;
}

.chat-suggestion:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 24px rgba(31, 38, 135, 0.12);
}


.chat-messages {
    position: relative;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(31, 38, 135, 0.08),
        inset 0 0 0 1px rgba(0,0,0,0.03);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    text-align: left;
}

.chat-msg {
    max-width: 78%;
    padding: 0.7rem 1rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-msg p {
    margin: 0;
}

.chat-msg-bot {
    position: relative;
    align-self: flex-start;

    background: rgba(255, 255, 255, 0.72);

    border: 1px solid rgba(123, 44, 255, 0.12);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);

    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

.chat-msg-bot a {
    color: #0A66C2;
    text-decoration: underline;
}

.chat-msg-bot a:hover {
    opacity: 1;
}

.link-preview {
    display: block;
    width: 300px;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 0.7rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(248, 248, 248, 0.9);
    color: var(--text-color);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.link-preview:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);
}

.link-preview:active {
    transform: scale(1.1);
}

.link-preview-image {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: contain;
    background: #f5f5f5;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
}

.link-preview-image.loaded {
    opacity: 1;
}

@keyframes previewImageIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.link-preview-content {
    padding: 0.7rem 0.8rem;
    text-align: left;
}

.link-preview-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
}

.link-preview-description {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    opacity: 0.7;
}

.link-preview-domain {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    opacity: 0.5;
}

.chat-reply-quote {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--secondary-text-color);
    background: rgba(93, 0, 247, 0.06);
    border-left: 3px solid var(--highlight-color);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.85;
}

.chat-msg-user {
    align-self: flex-end;

    background: #bda3e8;

    color: #2f1d5c;

    border-bottom-right-radius: 4px;

    box-shadow: 0 4px 12px rgba(99, 52, 216, 0.16);
}
.chat-msg-user {
    position: relative;
}

.chat-msg-user::selection {
    background: #6334d8;
    color: #ffffff;
}

.chat-msg-user *::selection {
    background: #6334d8;
    color: #ffffff;
}


.chat-reaction {
    position: absolute;
    right: -8px;
    bottom: -12px;

    width: 24px;
    height: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 0.82rem;
    line-height: 1;

    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);

    animation: chatReactionIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2;
}

@keyframes chatReactionIn {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(4px);
    }

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

.chat-msg-error {
    align-self: flex-start;

    display: flex;
    align-items: center;
    gap: 0.9rem;

    max-width: 78%;

    padding: 0.8rem 1rem;

    background: rgba(255, 255, 255, 0.72);

    border: 1px solid rgba(123, 44, 255, 0.12);

    border-radius: 16px;
    border-bottom-left-radius: 4px;

    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);

    color: var(--text-color);
}


.chat-error-image {
    width: 100px;
    height: 100px;

    flex-shrink: 0;

    object-fit: contain;

    border-radius: 12px;
}

/* Typing */

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 0.4rem 0 0 0.2rem;
    align-items: center;
    flex-shrink: 0;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--highlight-color);
    opacity: 0.4;
    animation: chatTypingBounce 1.2s infinite ease-in-out;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.chat-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes chatTypingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}
.chat-input-row {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    margin-top: 0.9rem;
    flex-shrink: 0;
}

/* Input */


/* Reserve space for the floating Send + Stop controls */
.chat-input-row.voice-active {
    padding-right: 56px;
    box-sizing: border-box;
}

.chat-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.chat-input {
    width: 100%;
    min-width: 0;
    height: 2.75rem;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 22px;
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.4;
    color: var(--text-color);
    caret-color: var(--highlight-color);
    outline: none;
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, height 0.1s ease;
}

.chat-input-placeholder {
    position: absolute;
    left: 1.2rem;
    top: 50%;

    transform: translateY(-50%) scale(1);
    transform-origin: left center;

    color: var(--secondary-text-color);
    opacity: 0.65;

    pointer-events: none;

    transition:
        opacity 0.22s ease,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Animate placeholder away when user types */
.chat-input-wrap:has(.chat-input:not(:placeholder-shown))
.chat-input-placeholder {
    opacity: 0;

    transform:
        translateY(-70%)
        scale(0.78);
}

.chat-input:focus {
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 4px rgba(93, 0, 247, 0.1);
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* Normal mic/send button */

.chat-send-btn {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: #6334d8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 52, 216, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-send-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(99, 52, 216, 0.38);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}


/* Mic <-> send */

.chat-action-icon {
    position: absolute;
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

#chatMicIcon,
#chatSendIcon {
    opacity: 0;
}

.chat-send-btn.mic-mode #chatMicIcon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.chat-send-btn.mic-mode #chatSendIcon {
    opacity: 0;
    transform: scale(0.55) rotate(30deg);
}

.chat-send-btn.send-mode #chatMicIcon {
    opacity: 0;
    transform: scale(0.55) rotate(-30deg);
}

.chat-send-btn.send-mode #chatSendIcon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}


/* Recording indicator */

.chat-recording {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.55rem;
    font-size: 0.78rem;
    color: var(--highlight-color);
    user-select: none;
}

.chat-recording.active {
    display: flex;
}

.chat-recording-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff3b30;
    animation: recordingDotPulse 1s infinite ease-in-out;
}

@keyframes recordingDotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.55;
    }

    50% {
        transform: scale(1.35);
        opacity: 1;
    }
}


/* Floating recording controls */

.chat-voice-controls {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 20;

    display: flex;
    flex-direction: column;
    gap: 5px;

    padding: 5px;
    border-radius: 30px;

    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border: 1px solid rgba(255, 255, 255, 0.7);

    box-shadow: 0 10px 28px rgba(31, 38, 135, 0.16);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(8px) scale(0.96);

    transition:
        opacity 0.18s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
}

.chat-voice-controls.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.chat-voice-control {
    width: 46px;
    height: 46px;
    flex-shrink: 0;

    border: none;
    border-radius: 50%;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    background: #6334d8;

    color: white;

    box-shadow: 0 4px 14px rgba(99, 52, 216, 0.3);

    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.chat-voice-control:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(93, 0, 247, 0.4);
}

.chat-voice-control:active {
    transform: scale(0.94);
}


/* Remaining */

.chat-remaining {
    font-size: 0.78rem;
    color: var(--secondary-text-color);
    opacity: 0.65;
    margin-top: 0.6rem;
    text-align: center;
    flex-shrink: 0;
}
.chat-share-card {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 1.2rem;

    width: min(100%, 520px);
    box-sizing: border-box;

    margin-top: 0.15rem;
    padding: 1rem 1.2rem;

    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border: 1px solid rgba(123, 44, 255, 0.12);
    border-radius: 20px;

    box-shadow:
        0 8px 28px rgba(31, 38, 135, 0.09),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);

    opacity: 0;
    transform: translateY(8px);
    animation: chatShareCardIn 0.4s ease forwards;
}

.chat-share-image {
    width: 225px;
    height: 225px;
    flex-shrink: 0;
    object-fit: contain;
}

.chat-share-content {
    min-width: 0;
    flex: 1;
}

.chat-share-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.chat-share-description {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--secondary-text-color);
    opacity: 0.72;
}

.chat-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;

    margin-top: 0.8rem;
    padding: 0.58rem 1rem;

    border: none;
    border-radius: 11px;

    background: #6334d8;
    color: #fff;

    font: inherit;
    font-size: 0.78rem;
    font-weight: 650;

    cursor: pointer;

    box-shadow: 0 5px 16px rgba(99, 52, 216, 0.24);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.chat-share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 20px rgba(99, 52, 216, 0.32);
}

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

@keyframes chatShareCardIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

@media (max-width: 768px) {
    .chat-share-card {
        width: 100%;
        gap: 0.9rem;
        padding: 0.85rem;
    }

    .chat-share-image {
        width: 135px;
        height: 135px;
    }
}

.chat-limit-bubble {
    background-color: #E8E8E8;
}

.chat-email-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 0.45rem;
    padding: 0.5rem 0.9rem;

    border-radius: 10px;

    background: transparent;
    border: 1px solid rgba(99, 52, 216, 0.18);

    color: #6334d8;

    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;

    text-decoration: none;

    transition: background 0.18s ease;
}

.chat-email-btn:hover {
    background: rgba(99, 52, 216, 0.06);
}

/* Scrollbar */

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(93, 0, 247, 0.3);
    border-radius: 20px;
}


/* Mobile */

@media (max-width: 768px) {

    html:has(#digital-twin.section.active),
    body:has(#digital-twin.section.active) {
        overflow: hidden;
    }

    #digital-twin.section.active {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;

        height: 100svh;
        min-height: 0;

        box-sizing: border-box;

        padding-top: 1.2rem;
        padding-bottom: 1rem;

        z-index: 999;
    }

    #digital-twin .header-container {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 0.2rem;
        margin-bottom: 0.5rem;
        padding-left: 0.95rem;
    }

    .digital-twin-title-stack {
        text-align: left;
        min-width: 0;
    }

    .digital-twin-icon {
        height: 105px;
    }

    #digital-twin .header {
        font-size: 1.45rem;
        line-height: 1.15;
    }

    #digital-twin .digital-twin-title-stack .subtitle {
        font-size: 0.78rem;
        margin: 0.15rem 0 0 0;
    }

    .chat-wrap {
        max-width: 100%;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    .chat-messages {
        padding: 1.1rem;
        border-radius: 16px;
    }

    .chat-msg {
        max-width: 88%;
        font-size: 0.9rem;
    }
}


/* Streaming cursor */

.stream-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--highlight-color);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 0.8s infinite;
}

@keyframes cursorBlink {
    0%, 50% {
        opacity: 1;
    }

    51%, 100% {
        opacity: 0;
    }
}


.chat-messages-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chat-scroll-bottom-btn {
    position: absolute;
    right: 0.9rem;
    bottom: 0.9rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #6334d8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 52, 216, 0.3);
    opacity: 0;
    transform: translateY(8px) scale(0.85);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 5;
}

.chat-scroll-bottom-btn.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chat-scroll-bottom-btn:hover {
    transform: scale(1.08);
}

/* Calendar event preview */
.calendar-preview {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 300px;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 0.7rem;
    padding: 0.8rem;
    border: 1px solid rgba(93, 0, 247, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-color);
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(31, 38, 135, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.calendar-preview:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 9px 24px rgba(31, 38, 135, 0.12);
}

.calendar-preview:active {
    transform: scale(0.98);
}

.calendar-preview-image {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
    border-radius: 10px;
}

.calendar-preview-content {
    min-width: 0;
    flex: 1;
    text-align: left;
}

.calendar-preview-title {
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.3;
}

.calendar-preview-description,
.calendar-preview-time {
    margin-top: 0.15rem;
    font-size: 0.74rem;
    opacity: 0.68;
}

.calendar-preview-arrow {
    flex-shrink: 0;
    font-size: 1rem;
    opacity: 0.5;
}


.digital-twin-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
}

@media (max-width: 768px) {

    .digital-twin-title-row {
        gap: 0.3rem;
    }

    .digital-twin-info-btn {
        width: 30px;
        height: 30px;
        margin-top: -1px;
    }

    .digital-twin-info-btn svg {
        width: 18px;
        height: 18px;
    }

}

@media (max-width: 768px) {

    .chat-suggestion {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

}

/* Digital Twin photo preview */

.digital-twin-photo {
    display: block;
    width: 300px;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 0.7rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(248, 248, 248, 0.9);
    color: var(--text-color);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.06);

    opacity: 0;
    transform: translateY(6px);

    animation: digitalTwinPhotoIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.digital-twin-photo-image {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #f5f5f5;

    opacity: 0;
    transition: opacity 0.7s ease-in-out;
}

.digital-twin-photo-image.loaded {
    opacity: 1;
}

.digital-twin-photo-info {
    padding: 0.7rem 0.8rem;
    text-align: left;
}

.digital-twin-photo-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
}

.digital-twin-photo-caption {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    opacity: 0.7;
    line-height: 1.4;
}

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

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

@media (max-width: 768px) { 
    .digital-twin-photo {
        width: 100%;
        max-width: 300px;
    }

    .digital-twin-photo-image {
        height: 200px;
    }
}


.chat-suggestions-wrap {
    position: relative;
    flex-shrink: 0;
}

.chat-suggestions {
    overflow-x: auto;
    padding: 0.1rem 0.2rem 1.3rem 0.8rem;
    scrollbar-width: none;
}

.chat-suggestions-wrap::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;

    width: 18px;
    height: 2px;
    border-radius: 999px;

    background: rgba(93, 0, 247, 0.35);
    box-shadow: 0 0 8px rgba(93, 0, 247, 0.15);

    pointer-events: none;
    opacity: 0;                      /* hidden by default — you start at the left */
    transition: opacity 0.25s ease;
    z-index: 10;
}

.chat-suggestions-wrap.scrolled-start::before {
    opacity: 1;
}

.chat-suggestions-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;

    width: 24px;
    height: 2px;
    border-radius: 999px;

    background: rgba(93, 0, 247, 0.35);
    box-shadow: 0 0 8px rgba(93, 0, 247, 0.15);

    pointer-events: none;
    opacity: 1;
    transition: opacity 0.25s ease;
    z-index: 10;
}

.chat-suggestions-wrap.scrolled-end::after {
    opacity: 0;
}

@media (max-width: 768px) {
    .chat-suggestions-wrap {
        margin-left: -0.7rem;
    }

    .chat-suggestions {
        padding-left: 0.3rem;
        gap: 0.1rem;
    }
}


/* Chat Voice Note */
.chat-voice-note {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    width: fit-content;
    margin-top: 0.5rem;
    margin-right: 5.4rem;   /* reserves space for the label sitting outside, to the right */
    padding: 0.4rem 0.85rem 0.4rem 0.4rem;

    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;

    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.06),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    -webkit-tap-highlight-color: #f3eefb /* light lavender tap flash instead of default blue */
}

.chat-voice-play {
    width: 40px;
    height: 40px;
    flex-shrink: 0;

    border: none;
    border-radius: 50%;

    background: var(--highlight-color);
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    font-size: 0.78rem;
    line-height: 1;
}

.chat-voice-note::after {
    content: "Voice note";

    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);

    margin-left: 0.55rem;

    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;

    color: var(--secondary-text-color);
    opacity: 0.5;
    line-height: 1;

    white-space: nowrap;
    pointer-events: none;
}

.voice-preparing {
    display: inline-block;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--secondary-text-color);
    opacity: 0.4;
    animation: voicePreparingPulse 1.3s ease-in-out infinite;
}

@keyframes voicePreparingPulse {
    0%, 100% {
        opacity: 0.35;
    }
    50% {
        opacity: 0.9;
    }
}


.chat-voice-progress {
    width: 120px;
    height: 3px;
    margin: 0;

    -webkit-appearance: none;
    appearance: none;

    background: linear-gradient(
        to right,
        #808080 0%,
        #808080 var(--voice-progress, 0%),
        #e5e5e5 var(--voice-progress, 0%),
        #e5e5e5 100%
    );
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.chat-voice-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 9px;
    height: 9px;
    background: var(--highlight-color);
    border-radius: 50%;
    cursor: pointer;
}

.chat-voice-progress::-moz-range-thumb {
    width: 9px;
    height: 9px;
    background: var(--highlight-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

@media (max-width: 768px) {

    .chat-voice-note {
        width: 165px;
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 1.1rem;   /* reserves space for the label sitting below */
        padding: 0.45rem 0.7rem 0.45rem 0.45rem;
        gap: 0.55rem;
        box-sizing: border-box;
    }

    .chat-voice-play {
        width: 34px;
        height: 34px;
        font-size: 0.7rem;
    }

    .chat-voice-progress {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    .chat-voice-note::after {
        top: 100%;
        left: auto;
        right: 0;
        transform: none;

        margin-left: 0;
        margin-top: 0.3rem;

        font-size: 0.6rem;
    }
}

