
/* =========================================================
   PRIVATE AI — BUNDLED BENGALI PDF FONT
========================================================= */
@font-face {
    font-family: 'PrivateAINotoBangla';
    src: url('/assets/fonts/NotoSansBengali-Regular.ttf') format('truetype');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'PrivateAINotoBangla';
    src: url('/assets/fonts/NotoSansBengali-Bold.ttf') format('truetype');
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #ffffff;
    color: #000000;
}


/* =========================================================
   LOGIN PAGE
========================================================= */

.login-page {
    min-height: 100vh;

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

    padding: 20px;
}


.login-card {
    width: 100%;
    max-width: 480px;

    padding: 45px 35px;

    background: #ffffff;

    border: 1px solid #e4e4e4;

    border-radius: 20px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   BRAND
========================================================= */

.brand {
    text-align: center;

    margin-bottom: 35px;
}


.brand-icon {
    width: 72px;
    height: 72px;

    margin: 0 auto 18px;

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

    border-radius: 20px;

    background:
        linear-gradient(
            145deg,
            #0057b8,
            #3ea6ff,
            #0066cc,
            #8dccff,
            #00458f
        );

    color: #ffffff;

    font-size: 38px;

    font-weight: 900;

    box-shadow:
        0 10px 30px rgba(0, 102, 204, 0.25);
}


.brand h1 {
    font-size: 28px;

    font-weight: 800;

    background:
        linear-gradient(
            90deg,
            #404040,
            #a9a9a9,
            #202020,
            #c8c8c8,
            #404040
        );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    background-clip: text;
}


.brand p {
    margin-top: 8px;

    color: #777777;

    font-size: 14px;

    line-height: 1.5;
}


/* =========================================================
   EMAIL OPTIONS
========================================================= */

.email-options {
    display: flex;

    flex-direction: column;

    gap: 12px;

    margin-bottom: 22px;
}


.email-option {
    position: relative;

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 16px;

    background: #ffffff;

    border: 1px solid #dddddd;

    border-radius: 12px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.email-option:hover {
    background: #fafafa;

    border-color: #999999;

    transform: translateY(-1px);
}


.email-option input {
    position: absolute;

    opacity: 0;

    pointer-events: none;
}


.radio-custom {
    width: 19px;
    height: 19px;

    flex-shrink: 0;

    border: 2px solid #999999;

    border-radius: 50%;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}


.email-option input:checked
~ .radio-custom {
    background: #111111;

    border-color: #111111;

    box-shadow:
        inset 0 0 0 4px #ffffff;
}


.email-text {
    color: #111111;

    font-size: 14px;

    word-break: break-word;
}


/* =========================================================
   GO BUTTON
========================================================= */

.go-button {
    width: 100%;

    padding: 15px;

    border: none;

    border-radius: 12px;

    background: #111111;

    color: #ffffff;

    font-size: 16px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.go-button:hover {
    background: #303030;

    transform: translateY(-1px);
}


.go-button:active {
    transform: translateY(0);
}


/* =========================================================
   OTP PAGE
========================================================= */

.otp-page {
    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;
}


.otp-card {
    width: 100%;

    max-width: 480px;

    padding: 45px 35px;

    background: #ffffff;

    border: 1px solid #e4e4e4;

    border-radius: 20px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   OTP FORM
========================================================= */

.otp-form {
    width: 100%;
}


.otp-input {
    display: block;

    width: 100%;

    height: 52px;

    padding: 0 16px;

    margin-bottom: 14px;

    border: 1px solid #dddddd;

    border-radius: 12px;

    background: #ffffff;

    color: #111111;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 18px;

    font-weight: 600;

    text-align: center;

    letter-spacing: 4px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.otp-input::placeholder {
    color: #999999;

    font-size: 14px;

    font-weight: 400;

    letter-spacing: 0;

    text-align: center;
}


.otp-input:focus {
    border-color: #111111;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   OTP VERIFY BUTTON
========================================================= */

.verify-button {
    display: block;

    width: 100%;

    height: 48px;

    padding: 0 16px;

    border: none;

    border-radius: 12px;

    background: #111111;

    color: #ffffff;

    font-size: 16px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.verify-button:hover {
    background: #303030;

    transform: translateY(-1px);
}


.verify-button:active {
    transform: translateY(0);
}


/* =========================================================
   OTP EMAIL TEXT
========================================================= */

.otp-email {
    color: #111111;

    font-weight: 700;

    word-break: break-word;
}


/* =========================================================
   CHAT PAGE
========================================================= */

body.chat-page {
    min-height: 100vh;

    overflow-x: hidden;

    background: #ffffff;
}


main.chat-page {
    width: 100%;

    min-height: 100vh;

    display: flex;

    flex-direction: column;
}


/* =========================================================
   CHAT HEADER
========================================================= */

.chat-header {
    width: 100%;

    height: 72px;

    padding:
        0 28px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    background: #ffffff;

    border-bottom: 1px solid #eeeeee;

    position: sticky;

    top: 0;

    z-index: 100;
}


.chat-brand {
    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;
}


.chat-brand-icon {
    width: 40px;
    height: 40px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            #0057b8,
            #3ea6ff,
            #0066cc,
            #8dccff,
            #00458f
        );

    color: #ffffff;

    font-size: 21px;

    font-weight: 900;

    box-shadow:
        0 6px 18px
        rgba(0, 102, 204, 0.20);
}


.chat-brand-text {
    display: flex;

    flex-direction: column;

    justify-content: center;

    min-width: 0;
}


.chat-brand-text strong {
    color: #111111;

    font-size: 17px;

    line-height: 1.2;

    font-weight: 800;
}


.chat-brand-text span {
    margin-top: 2px;

    color: #888888;

    font-size: 11px;

    line-height: 1.2;
}


.chat-user {
    display: flex;

    align-items: center;

    gap: 7px;

    flex-shrink: 0;

    color: #555555;

    font-size: 13px;

    font-weight: 600;
}


.chat-user-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #2aa84a;

    box-shadow:
        0 0 0 3px
        rgba(42, 168, 74, 0.10);
}


/* =========================================================
   CHAT CONTAINER
========================================================= */

.chat-container {
    width: 100%;

    max-width: 1050px;

    margin: 0 auto;

    flex: 1 1 auto;

    height: calc(100vh - 72px);
    min-height: 0;
    max-height: calc(100vh - 72px);

    display: flex;

    flex-direction: column;

    padding: 0 28px 28px;

    overflow: hidden;
}


/* =========================================================
   MM NOTE
========================================================= */

.mm-note {
    width: 100%;

    padding:
        16px 0 10px;

    text-align: center;

    color: #111111;

    font-size: 13px;

    line-height: 1.4;
}


.mm-note strong {
    font-weight: 800;
}


/* =========================================================
   CHAT MESSAGES
========================================================= */

.chat-messages {
    width: 100%;

    flex: 1 1 auto;
    min-height: 0;

    overflow-y: auto;

    padding: 20px 10px 145px;

    scroll-behavior: smooth;
}


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


.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}


.chat-messages::-webkit-scrollbar-thumb {
    background: #dddddd;

    border-radius: 20px;
}


.chat-empty {
    width: 100%;

    min-height: 55vh;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    padding:
        30px 20px;
}


.chat-empty-icon {
    width: 64px;
    height: 64px;

    margin-bottom: 20px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            #0057b8,
            #3ea6ff,
            #0066cc,
            #8dccff,
            #00458f
        );

    color: #ffffff;

    font-size: 32px;

    font-weight: 900;

    box-shadow:
        0 10px 30px
        rgba(0, 102, 204, 0.18);
}


.chat-empty h2 {
    color: #151515;

    font-size: 27px;

    line-height: 1.25;

    font-weight: 800;
}


.chat-empty p {
    margin-top: 9px;

    color: #777777;

    font-size: 14px;

    line-height: 1.5;
}


/* =========================================================
   CHAT FORM
========================================================= */

.chat-form {
    position: fixed;

    left: 50%;

    bottom: 22px;

    transform: translateX(-50%);

    width: min(
        calc(100% - 40px),
        1000px
    );

    min-height: 68px;

    display: flex;

    align-items: flex-end;

    gap: 9px;

    padding: 9px;

    background: #ffffff;

    border: 1px solid #dcdcdc;

    border-radius: 18px;

    box-shadow:
        0 12px 40px
        rgba(0, 0, 0, 0.10);

    z-index: 200;
}


/* =========================================================
   ATTACH WRAPPER
========================================================= */

.attach-wrapper {
    position: relative;

    flex-shrink: 0;
}


/* =========================================================
   PLUS BUTTON
========================================================= */

.attach-button {
    width: 46px;
    height: 46px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: none;

    border-radius: 13px;

    background: #f3f3f3;

    color: #111111;

    font-size: 29px;

    font-weight: 400;

    line-height: 1;

    cursor: pointer;

    transition:
        background 0.18s ease,
        transform 0.18s ease;
}


.attach-button:hover {
    background: #e8e8e8;

    transform: translateY(-1px);
}


.attach-button:active {
    transform: translateY(0);
}


/* =========================================================
   ATTACHMENT MENU
   Opens ABOVE the + button
========================================================= */

.attach-menu {
    position: absolute;

    left: 0;

    bottom: calc(100% + 10px);

    width: 205px;

    padding: 7px;

    background: #ffffff;

    border: 1px solid #dedede;

    border-radius: 15px;

    box-shadow:
        0 15px 40px
        rgba(0, 0, 0, 0.13);

    z-index: 500;
}


.attach-menu[hidden] {
    display: none !important;
}


.attach-menu-item {
    width: 100%;

    min-height: 48px;

    display: flex;

    align-items: center;

    gap: 11px;

    padding: 9px 11px;

    border: none;

    border-radius: 10px;

    background: transparent;

    color: #111111;

    text-decoration: none;

    cursor: pointer;

    font-family: inherit;

    text-align: left;

    transition:
        background 0.18s ease;
}


.attach-menu-item:hover {
    background: #f5f5f5;
}


.attach-menu-icon {
    width: 28px;
    height: 28px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 19px;
}


.attach-menu-title {
    font-size: 13px;

    font-weight: 700;

    white-space: nowrap;
}


/* =========================================================
   CHAT INPUT WRAPPER
========================================================= */

.chat-input-wrapper {
    position: relative;

    flex: 1;

    min-width: 0;

    display: flex;

    align-items: flex-end;
}


/* =========================================================
   CHAT INPUT
========================================================= */

.chat-input {
    width: 100%;

    min-height: 48px;

    max-height: 180px;

    resize: none;

    overflow-y: auto;

    padding:
        13px 58px 13px 15px;

    border: 1px solid #dddddd;

    border-radius: 14px;

    outline: none;

    background: #ffffff;

    color: #111111;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 15px;

    line-height: 22px;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}


.chat-input::placeholder {
    color: #999999;
}


.chat-input:focus {
    border-color: #bdbdbd;

    box-shadow:
        0 0 0 3px
        rgba(0, 0, 0, 0.045);
}


.chat-input::-webkit-scrollbar {
    width: 5px;
}


.chat-input::-webkit-scrollbar-thumb {
    background: #d7d7d7;

    border-radius: 20px;
}


/* =========================================================
   VOICE BUTTON
   Fixed inside input area
========================================================= */

.voice-button {
    position: absolute;

    right: 8px;

    bottom: 7px;

    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: none;

    border-radius: 11px;

    background: #f3f3f3;

    color: #111111;

    cursor: pointer;

    z-index: 5;

    transition:
        background 0.18s ease,
        transform 0.18s ease;
}


.voice-button:hover {
    background: #e7e7e7;

    transform: translateY(-1px);
}


.voice-button:active {
    transform: translateY(0);
}


.voice-button[aria-pressed="true"] {
    background: #111111;

    color: #ffffff;
}


.voice-icon {
    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 18px;

    line-height: 1;
}


/* =========================================================
   SEND BUTTON
========================================================= */

.send-button {
    width: 72px;
    min-height: 46px;

    flex-shrink: 0;

    border: none;

    border-radius: 13px;

    background: #111111;

    color: #ffffff;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.18s ease,
        transform 0.18s ease;
}


.send-button:hover {
    background: #303030;

    transform: translateY(-1px);
}


.send-button:active {
    transform: translateY(0);
}


.send-button:disabled {
    background: #cfcfcf;

    color: #ffffff;

    cursor: not-allowed;

    transform: none;
}


/* =========================================================
   FUTURE CHAT MESSAGE STRUCTURE
========================================================= */

.chat-message {
    width: 100%;

    margin-bottom: 30px;
}


.chat-message-user {
    width: 100%;

    display: flex;

    justify-content: flex-start;

    padding-right: 12%;
}


.chat-message-user-content {
    max-width: 82%;

    color: #111111;

    font-size: 15px;

    line-height: 1.65;

    white-space: pre-wrap;

    overflow-wrap: anywhere;
}


.chat-message-ai {
    width: 100%;

    display: flex;

    justify-content: flex-start;

    padding-left: 8%;

    margin-top: 22px;
}


.chat-message-ai-content {
    max-width: 84%;

    color: #222222;

    font-size: 15px;

    line-height: 1.7;

    white-space: pre-wrap;

    overflow-wrap: anywhere;
}


/* =========================================================
   ERROR MESSAGE
========================================================= */

.error-message {
    margin-bottom: 15px;

    padding: 12px 14px;

    border: 1px solid #f0b5b5;

    border-radius: 10px;

    background: #fff5f5;

    color: #a00000;

    font-size: 14px;

    line-height: 1.5;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    .chat-header {
        height: 64px;

        padding:
            0 15px;
    }


    .chat-brand-icon {
        width: 36px;
        height: 36px;

        border-radius: 10px;

        font-size: 19px;
    }


    .chat-brand-text strong {
        font-size: 15px;
    }


    .chat-brand-text span {
        font-size: 10px;
    }


    .chat-user {
        font-size: 11px;
    }


    .chat-container {
        min-height:
            calc(100vh - 64px);

        padding:
            0 12px 20px;
    }


    .mm-note {
        padding-top: 12px;

        font-size: 12px;
    }


    .chat-empty {
        min-height: 48vh;

        padding:
            25px 12px;
    }


    .chat-empty-icon {
        width: 56px;
        height: 56px;

        border-radius: 16px;

        font-size: 28px;
    }


    .chat-empty h2 {
        font-size: 22px;
    }


    .chat-empty p {
        font-size: 13px;
    }


    .chat-form {
        bottom: 12px;

        width:
            calc(100% - 20px);

        min-height: 62px;

        padding: 7px;

        gap: 6px;

        border-radius: 16px;
    }


    .attach-button {
        width: 42px;
        height: 42px;

        border-radius: 12px;

        font-size: 26px;
    }


    .attach-menu {
        width: 190px;

        bottom: calc(100% + 9px);
    }


    .chat-input {
        min-height: 44px;

        padding:
            11px 52px 11px 13px;

        border-radius: 13px;

        font-size: 14px;

        line-height: 21px;
    }


    .voice-button {
        right: 6px;

        bottom: 5px;

        width: 34px;
        height: 34px;

        border-radius: 10px;
    }


    .voice-icon {
        font-size: 16px;
    }


    .send-button {
        width: 62px;

        min-height: 42px;

        border-radius: 12px;

        font-size: 13px;
    }


    .chat-messages {
        padding:
            15px 4px 125px;
    }


    .chat-message-user {
        padding-right: 5%;
    }


    .chat-message-user-content {
        max-width: 92%;

        font-size: 14px;
    }


    .chat-message-ai {
        padding-left: 5%;

        margin-top: 18px;
    }


    .chat-message-ai-content {
        max-width: 92%;

        font-size: 14px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .chat-user {
        max-width: 125px;

        overflow: hidden;

        text-overflow: ellipsis;

        white-space: nowrap;
    }


    .chat-brand-text span {
        display: none;
    }


    .chat-form {
        width:
            calc(100% - 12px);

        bottom: 7px;
    }


    .attach-button {
        width: 40px;
        height: 40px;
    }


    .send-button {
        width: 58px;
    }

}

/* =========================================================
   PERMANENT AI WORK PROGRESS
========================================================= */

.ai-work-progress {
    width: 100%;
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 9px 0 5px;
    text-align: center;
}

.ai-work-progress strong {
    color: #111111;
    font-size: 13px;
    font-weight: 800;
}

.progress-ring {
    position: relative;
    width: 62px;
    height: 62px;
    flex-shrink: 0;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    display: block;
    transform: rotate(-90deg);
}

.progress-ring circle {
    fill: none;
    stroke-width: 5;
}

.progress-ring-track {
    stroke: #e6e6e6;
}

.progress-ring-value {
    stroke: #111111;
    stroke-linecap: round;
    stroke-dasharray: 169.646;
    stroke-dashoffset: 169.646;
    transition: stroke-dashoffset .25s ease, stroke .25s ease;
}


.progress-ring > span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111111;
    font-size: 13px;
    font-weight: 800;
}


.ai-progress-complete {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    text-align: center;
    color: #111111;
    font-size: 8px;
    line-height: 1;
    font-weight: 800;
}


/* =========================================================
   FILE UPLOAD PROGRESS
========================================================= */

.file-upload-progress {
    width: min(100%, 760px);
    margin: 0 auto 10px;
    padding: 10px 13px;
    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .07);
}

.file-upload-progress[hidden] {
    display: none !important;
}

.file-progress-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 7px;
}

.file-progress-top strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #222222;
    font-size: 12px;
}

.file-progress-top span {
    flex-shrink: 0;
    color: #555555;
    font-size: 12px;
    font-weight: 800;
}

.file-progress-speed {
    margin-top: 6px;
    color: #555555;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.file-progress-track {
    width: 100%;
    height: 6px;
    overflow: hidden;
    background: #e8e8e8;
    border-radius: 20px;
}

.file-progress-bar {
    width: 0%;
    height: 100%;
    background: #111111;
    border-radius: inherit;
    transition: width .12s linear, background .2s ease;
}

.file-upload-progress.complete .file-progress-bar {
    background: #1b9a48;
}

.file-upload-progress.error {
    border-color: #d55a5a;
}

.file-upload-progress.error .file-progress-bar {
    background: #c62828;
}

@media (max-width: 520px) {

    .ai-work-progress {
        min-height: 78px;
        padding-top: 7px;
    }

    .progress-ring {
        width: 56px;
        height: 56px;
    }

    .progress-ring > span {
        font-size: 12px;
    }

    .ai-work-progress strong {
        font-size: 12px;
    }

    .file-upload-progress {
        width: calc(100% - 20px);
    }
}

/* AI work meter is never green. */
.ai-work-progress .progress-ring-value {
    stroke: #111111;
}

/* Keep completion text hidden until JavaScript reports 100%. */
.ai-progress-complete[hidden] {
    display: none !important;
}


/* FINAL AI METER LAYOUT — exact centered position */
.ai-progress-widget {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.ai-progress-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.ai-progress-meter {
    position: relative;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
}

.ai-progress-meter .progress-ring {
    width: 58px;
    height: 58px;
    display: block;
}

.ai-progress-row .mm-note {
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.ai-progress-widget > #aiProgressLabel {
    margin-top: 4px;
    font-size: 9px;
    font-weight: 700;
}

.ai-progress-complete {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    text-align: center;
    font-size: 7px;
    line-height: 1;
    font-weight: 800;
}


/* =========================================================
   FINAL EXACT AI METER POSITION
   One horizontal line: MM | meter | MM
========================================================= */

.ai-work-row {
    width: 100%;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 0;
    text-align: center;
}

.mm-note-side {
    flex: 0 0 auto;
    color: #111111;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 800;
    white-space: nowrap;
}

.ai-work-row .progress-ring {
    position: relative;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
}

.ai-work-row .progress-ring svg {
    width: 48px;
    height: 48px;
    display: block;
    transform: rotate(-90deg);
}

.ai-work-row .progress-ring circle {
    fill: none;
    stroke-width: 3;
}

.ai-work-row .progress-ring-track {
    stroke: #e6e6e6;
}

.ai-work-row .progress-ring-value {
    stroke: #111111;
    stroke-linecap: round;
    stroke-dasharray: 169.646;
    stroke-dashoffset: 169.646;
    transition: stroke-dashoffset .12s linear;
}

.ai-work-row .progress-ring > span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111111;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
}

.ai-work-row .ai-progress-complete {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    text-align: center;
    color: #111111;
    font-size: 6px;
    line-height: 1;
    font-weight: 800;
}


/* =========================================================
   FINAL AI METER — EXACT CENTERED LAYOUT
   Left MM | Center Meter | Right MM
========================================================= */

.ai-work-row {
    width: 100%;
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    column-gap: 12px;
    margin: 0;
    padding: 6px 12px;
    position: relative;
}

.ai-work-row .mm-note-side {
    white-space: nowrap;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
}

.ai-work-row .mm-left {
    text-align: right;
}

.ai-work-row .mm-right {
    text-align: left;
}

.ai-work-row .progress-ring-ai {
    position: relative;
    width: 64px;
    height: 64px;
    justify-self: center;
    flex: none;
}

.ai-work-row .progress-ring-ai svg {
    width: 64px;
    height: 64px;
    display: block;
    transform: rotate(-90deg);
}

.ai-work-row .progress-ring-track {
    fill: none;
    stroke: #e5e5e5;
    stroke-width: 4;
}

.ai-work-row .progress-ring-value {
    fill: none;
    stroke: #111111;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 169.646;
    stroke-dashoffset: 169.646;
    transition: stroke-dashoffset 0.18s linear;
}

.ai-work-row .progress-ring-ai > #aiProgressPercent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 6px;
    color: #111111;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
}

.ai-work-row .ai-progress-complete {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 11px;
    text-align: center;
    color: #111111;
    font-size: 6px;
    line-height: 1;
    font-weight: 800;
}

@media (max-width: 640px) {
    .ai-work-row {
        grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
        column-gap: 7px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .ai-work-row .progress-ring-ai,
    .ai-work-row .progress-ring-ai svg {
        width: 58px;
        height: 58px;
    }

    .ai-work-row .mm-note-side {
        font-size: 8px;
    }
}


/* =========================================================
   FINAL METER POSITION / SIZE — v2
   Meter sits ABOVE the existing separator line.
   The line remains directly underneath it.
========================================================= */
.ai-work-row {
    width: 100%;
    height: 112px;
    min-height: 112px;
    margin: 0;
    padding: 0 12px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
    align-items: end;
    justify-items: stretch;
    column-gap: 18px;
    position: relative;
    border-bottom: 1px solid #eeeeee;
    box-sizing: border-box;
}

.ai-work-row .mm-note-side {
    align-self: end;
    margin-bottom: 31px;
    white-space: nowrap;
    color: #111111;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
}

.ai-work-row .mm-left { text-align: right; }
.ai-work-row .mm-right { text-align: left; }

.ai-work-row .progress-ring-ai {
    width: 92px;
    height: 92px;
    flex: 0 0 92px;
    justify-self: center;
    align-self: end;
    position: relative;
    margin-bottom: 10px;
}

.ai-work-row .progress-ring-ai svg {
    width: 92px;
    height: 92px;
    display: block;
    transform: rotate(-90deg);
}

.ai-work-row .progress-ring-ai .progress-ring-track,
.ai-work-row .progress-ring-ai .progress-ring-value {
    stroke-width: 4;
}

.ai-work-row .progress-ring-ai > #aiProgressPercent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #111111;
    font-size: 15px;
    line-height: 1;
    font-weight: 800;
}

.ai-work-row .ai-progress-complete {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 17px;
    text-align: center;
    color: #111111;
    font-size: 7px;
    line-height: 1;
    font-weight: 800;
}

@media (max-width: 640px) {
    .ai-work-row {
        height: 106px;
        min-height: 106px;
        grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr);
        column-gap: 7px;
        padding-left: 4px;
        padding-right: 4px;
        padding-bottom: 8px;
    }

    .ai-work-row .progress-ring-ai {
        width: 82px;
        height: 82px;
        flex-basis: 82px;
        margin-bottom: 8px;
    }

    .ai-work-row .progress-ring-ai svg {
        width: 82px;
        height: 82px;
    }

    .ai-work-row .mm-note-side {
        margin-bottom: 29px;
        font-size: 8px;
    }

    .ai-work-row .progress-ring-ai > #aiProgressPercent {
        font-size: 14px;
    }
}


/* =========================================================
   TWO-LANGUAGE VOICE CONTROL — BANGla / ENGLISH
========================================================= */
.voice-language-button {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid #dedede;
    border-radius: 9px;
    background: #f7f7f7;
    color: #111111;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}
.voice-language-button:hover {
    background: #eeeeee;
}
.voice-language-button[aria-pressed="true"] {
    background: #111111;
    color: #ffffff;
}
@media (max-width: 520px) {
    .voice-language-button {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        font-size: 9px;
    }
}

/* =========================================================
   GLASS DOWNLOAD CARD — ADDITIVE ONLY
   Small glass card for every generated download.
========================================================= */

.glass-download-card {
    --download-progress: 0%;
    position: relative;
    width: min(100%, 360px);
    min-height: 64px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    grid-template-rows: auto 6px;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
    margin: 8px 0;
    border: 1px solid rgba(255,255,255,.92);
    border-radius: 16px;
    background: rgba(255,255,255,.62);
    box-shadow:
        0 10px 28px rgba(26, 30, 48, .10),
        inset 0 1px 0 rgba(255,255,255,.95);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    overflow: hidden;
}

.glass-download-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg,
        rgba(255,255,255,.46),
        rgba(255,255,255,.10) 45%,
        rgba(255,255,255,.34));
}

.glass-download-icon,
.glass-download-info,
.glass-download-button,
.glass-download-progress,
.glass-download-state {
    position: relative;
    z-index: 1;
}

.glass-download-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(255,255,255,.95);
    box-shadow: 0 5px 15px rgba(80, 70, 180, .10);
    color: #6b46ff;
    font-size: 21px;
    font-weight: 800;
}

.glass-download-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.glass-download-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #171717;
    font-size: 12px;
    font-weight: 800;
}

.glass-download-meta {
    color: #747474;
    font-size: 10px;
    font-weight: 600;
}

.glass-download-button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(105, 75, 255, .20);
    border-radius: 10px;
    background: rgba(255,255,255,.74);
    color: #6844ff;
    cursor: pointer;
    font-size: 19px;
    font-weight: 800;
    box-shadow: 0 5px 14px rgba(90, 70, 180, .10);
    transition: transform .15s ease, box-shadow .15s ease;
}

.glass-download-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(90, 70, 180, .16);
}

.glass-download-button:disabled {
    opacity: .5;
    cursor: default;
}

.glass-download-progress {
    grid-column: 1 / -1;
    width: 100%;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(218,218,226,.72);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}

.glass-download-progress-bar {
    width: var(--download-progress);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg,
        #ff3b30 0%,
        #ffb000 18%,
        #dfff00 34%,
        #21e6a8 50%,
        #16bfff 66%,
        #6957ff 82%,
        #ef36ff 100%);
    background-size: 220% 100%;
    box-shadow:
        0 0 7px rgba(91, 72, 255, .35),
        0 0 14px rgba(35, 215, 190, .18);
    transition: width .10s linear;
}

.glass-download-card.is-downloading .glass-download-progress-bar {
    animation: glassDownloadRGB 1.25s linear infinite;
}

.glass-download-card.is-complete .glass-download-progress-bar {
    animation: none;
    width: 100%;
}

.glass-download-card.is-error .glass-download-progress-bar {
    background: #d33a3a;
    animation: none;
}

.glass-download-state {
    position: absolute;
    right: 12px;
    bottom: 0;
    transform: translateY(120%);
    font-size: 9px;
    font-weight: 700;
    color: #168447;
    opacity: 0;
    pointer-events: none;
}

.glass-download-card.is-complete .glass-download-state {
    opacity: 1;
}

.glass-download-card.is-error .glass-download-state {
    opacity: 1;
    color: #c42c2c;
}

@keyframes glassDownloadRGB {
    from { background-position: 0% 50%; }
    to { background-position: 220% 50%; }
}

@media (max-width: 520px) {
    .glass-download-card {
        width: min(100%, 320px);
        grid-template-columns: 34px minmax(0, 1fr) 32px;
        padding: 9px 10px;
        border-radius: 14px;
    }

    .glass-download-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .glass-download-button {
        width: 32px;
        height: 32px;
    }
}


/* =========================================================
   FINAL FIX — AI meter stays fixed above the message scroll area
   The page itself does not scroll; only chat messages scroll.
========================================================= */
.ai-work-row {
    position: sticky;
    top: 0;
    z-index: 95;
    flex: 0 0 112px;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

@media (max-width: 640px) {
    .ai-work-row {
        flex-basis: 106px;
    }
}


/* =========================================================
   FINAL VOICE CONTROL FIX
   Keep BN/EN and microphone inside the message field.
   No black shadow/offset behind the controls.
========================================================= */
.chat-input-wrapper {
    position: relative;
}

.chat-input {
    padding-right: 92px;
}

.voice-language-button {
    position: absolute;
    right: 50px;
    bottom: 7px;
    z-index: 6;
    box-shadow: none !important;
}

.voice-language-button[aria-pressed="true"] {
    background: #f7f7f7;
    color: #111111;
    border-color: #d6d6d6;
    box-shadow: none !important;
}

.voice-button {
    position: absolute;
    right: 7px;
    bottom: 7px;
    z-index: 6;
    box-shadow: none !important;
}

.voice-button[aria-pressed="true"] {
    background: #f3f3f3;
    color: #111111;
    border: 1px solid #d6d6d6;
    box-shadow: none !important;
}

@media (max-width: 520px) {
    .chat-input {
        padding-right: 76px;
    }

    .voice-language-button {
        right: 43px;
        bottom: 5px;
    }

    .voice-button {
        right: 5px;
        bottom: 5px;
    }
}

/* =========================================================
   FINAL FIXED AI METER
   Only the message list scrolls; the meter stays under header.
========================================================= */
.ai-work-row {
    position: fixed !important;
    top: 72px;
    left: 0;
    right: 0;
    width: 100%;
    height: 112px;
    min-height: 112px;
    z-index: 150;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
    box-shadow: none;
}

.chat-container {
    padding-top: 112px;
}

@media (max-width: 640px) {
    .ai-work-row {
        top: 72px;
        height: 106px;
        min-height: 106px;
    }

    .chat-container {
        padding-top: 106px;
    }
}


/* -------------------------------------------------------------------------
   User question card — light orange, compact, non-intrusive
   ------------------------------------------------------------------------- */
.chat-message-user .user-question-card {
    display: inline-block;
    max-width: min(86%, 760px);
    padding: 10px 14px;
    border: 1px solid rgba(245, 158, 11, 0.20);
    border-radius: 14px;
    background: rgba(255, 247, 237, 0.92);
    color: #3f2a16;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.06);
    line-height: 1.55;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.chat-message-user {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

@media (max-width: 640px) {
    .chat-message-user .user-question-card {
        max-width: 88%;
        padding: 9px 12px;
        border-radius: 13px;
    }
}
