* {
    box-sizing: border-box;
}

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

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #ffffff;
    color: #202123;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.oabd-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.oabd-sidebar {
    position: fixed;
    inset: 0 auto 0 0;

    display: flex;
    flex-direction: column;

    width: 260px;
    height: 100vh;

    padding: 12px;

    background: #f7f7f8;
    border-right: 1px solid #ececec;

    z-index: 50;
}

.oabd-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 48px;
    padding: 4px 6px 12px;
}

.oabd-brand {
    display: flex;
    align-items: center;
    gap: 10px;

    font-weight: 650;
}

.oabd-brand-mark,
.oabd-welcome-logo {
    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #111111;
    color: #ffffff;

    font-weight: 700;
}

.oabd-brand-mark {
    width: 30px;
    height: 30px;
}

.oabd-brand-name {
    font-size: 15px;
}

.oabd-sidebar-close {
    display: none;

    width: 36px;
    height: 36px;

    background: transparent;
    border-radius: 8px;

    font-size: 24px;
    cursor: pointer;
}

.oabd-navigation {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.oabd-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    min-height: 42px;

    padding: 9px 11px;

    border-radius: 9px;

    background: transparent;
    color: #303030;

    text-align: left;
    font-size: 14px;

    cursor: pointer;
}

.oabd-nav-item:hover,
.oabd-nav-item.is-active {
    background: #ececed;
}

.oabd-nav-item > span:first-child {
    display: inline-flex;
    justify-content: center;

    width: 20px;

    font-size: 18px;
}

.oabd-sidebar-section {
    flex: 1;

    margin-top: 22px;

    overflow: hidden;
}

.oabd-section-title {
    padding: 8px 10px;

    color: #777777;

    font-size: 12px;
    font-weight: 600;
}

.oabd-empty-recent {
    padding: 7px 10px;

    color: #999999;

    font-size: 13px;
}

.oabd-sidebar-bottom {
    padding-top: 10px;

    border-top: 1px solid #e7e7e7;
}

.oabd-account {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;

    padding: 8px;

    background: transparent;
    border-radius: 9px;

    text-align: left;

    cursor: pointer;
}

.oabd-account:hover {
    background: #ececed;
}

.oabd-account-avatar {
    display: grid;
    place-items: center;

    width: 32px;
    height: 32px;

    flex: 0 0 32px;

    border-radius: 50%;

    background: #111111;
    color: #ffffff;

    font-size: 13px;
    font-weight: 700;
}

.oabd-account-name {
    overflow: hidden;

    font-size: 14px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.oabd-login-button {
    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 40px;

    border-radius: 9px;

    background: #111111;
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;
}

.oabd-main {
    display: flex;
    flex-direction: column;

    width: calc(100% - 260px);
    min-height: 100vh;

    margin-left: 260px;
}

.oabd-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    min-height: 58px;

    padding: 0 18px;

    border-bottom: 1px solid #eeeeee;

    background: rgba(255, 255, 255, .96);
}

.oabd-menu-button {
    display: none;

    justify-self: start;

    width: 38px;
    height: 38px;

    background: transparent;
    border-radius: 8px;

    font-size: 20px;

    cursor: pointer;
}

.oabd-header-title {
    grid-column: 2;

    font-size: 15px;
    font-weight: 650;
}

.oabd-header-right {
    grid-column: 3;

    justify-self: end;
}

.oabd-header-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;

    padding: 0 16px;

    border-radius: 18px;

    background: #111111;
    color: #ffffff;

    font-size: 13px;
    font-weight: 600;
}

.oabd-content {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 1;

    min-height: 0;

    padding: 40px 24px;
}

.oabd-welcome {
    width: 100%;
    max-width: 680px;

    text-align: center;
}

.oabd-welcome-logo {
    width: 52px;
    height: 52px;

    margin: 0 auto 18px;

    font-size: 22px;
}

.oabd-welcome h1 {
    margin: 0;

    font-size: clamp(28px, 5vw, 38px);
    font-weight: 650;

    letter-spacing: -0.03em;
}

.oabd-welcome p {
    margin: 10px 0 0;

    color: #777777;

    font-size: 15px;
}

.oabd-sidebar-overlay {
    display: none;
}

@media (max-width: 800px) {

    .oabd-sidebar {
        transform: translateX(-100%);

        transition: transform .2s ease;

        box-shadow:
            10px 0 30px rgba(0, 0, 0, .08);
    }

    body.oabd-sidebar-open .oabd-sidebar {
        transform: translateX(0);
    }

    .oabd-sidebar-close {
        display: block;
    }

    .oabd-main {
        width: 100%;
        margin-left: 0;
    }

    .oabd-menu-button {
        display: block;
    }

    .oabd-sidebar-overlay {
        position: fixed;
        inset: 0;

        z-index: 40;

        background: rgba(0, 0, 0, .28);
    }

    body.oabd-sidebar-open
    .oabd-sidebar-overlay {
        display: block;
    }

}

@media (max-width: 520px) {

    .oabd-header {
        padding: 0 10px;
    }

    .oabd-content {
        padding: 30px 18px;
    }

}


/* =========================================================
   OPENAI BD STEP 4 - TEXT CHAT
   ========================================================= */

.oabd-main {
    min-height: 100dvh;
    position: relative;
}

.oabd-content {
    padding-bottom: 150px;
}

.oabd-chat-thread {
    width: min(820px, 100%);
    margin: 0 auto;
}

.oabd-message {
    display: flex;
    width: 100%;
    margin: 18px 0;
}

.oabd-message-user {
    justify-content: flex-end;
}

.oabd-message-assistant {
    justify-content: flex-start;
}

.oabd-message-bubble {
    max-width: min(680px, 88%);
    padding: 13px 16px;
    border-radius: 18px;
    line-height: 1.55;
    font-size: 16px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.oabd-message-user .oabd-message-bubble {
    background: #f0f0f0;
    color: #171717;
}

.oabd-message-assistant .oabd-message-bubble {
    background: transparent;
    color: #171717;
    padding-left: 4px;
}

.oabd-composer-area {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding:
        12px
        16px
        calc(12px + env(safe-area-inset-bottom));
    background:
        linear-gradient(
            to top,
            #ffffff 75%,
            rgba(255,255,255,0)
        );
}

.oabd-composer {
    width: min(780px, 100%);
    margin: 0 auto;
    min-height: 58px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 9px 10px 9px 16px;
    border: 1px solid #dedede;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.oabd-composer textarea {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    max-height: 180px;
    resize: none;
    border: 0;
    outline: 0;
    background: transparent;
    color: #171717;
    font: inherit;
    font-size: 16px;
    line-height: 1.45;
    padding: 8px 2px;
}

.oabd-composer textarea::placeholder {
    color: #8a8a8a;
}

.oabd-send-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #111111;
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
}

.oabd-send-button:disabled {
    opacity: .45;
    cursor: default;
}

.oabd-chat-error,
.oabd-guest-status {
    width: min(760px, calc(100% - 24px));
    margin: 7px auto 0;
    font-size: 13px;
}

.oabd-chat-error {
    color: #b42318;
}

.oabd-guest-status {
    color: #666666;
    text-align: center;
}

.oabd-account-required {
    width: min(680px, 100%);
    margin: 16px auto;
    padding: 16px;
    border: 1px solid #dedede;
    border-radius: 16px;
    text-align: center;
}

.oabd-account-required a {
    display: inline-flex;
    margin-top: 10px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #111111;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

@media (min-width: 900px) {
    .oabd-composer-area {
        left: 280px;
    }
}



/* =========================================================
   OPENAI BD STEP 5 - ATTACHMENT PLUS BUTTON
   ========================================================= */

.oabd-composer {
    position: relative;
}

.oabd-attach-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: transparent;
    color: #222;
    font-size: 32px;
    line-height: 1;
    font-weight: 300;
    cursor: pointer;
}

.oabd-attach-button:hover {
    background: #f2f2f2;
}

.oabd-attach-menu {
    position: absolute;
    left: 4px;
    bottom: calc(100% + 12px);
    width: 190px;
    padding: 7px;
    border: 1px solid #e1e1e1;
    border-radius: 16px;
    background: #ffffff;
    box-shadow:
        0 12px 35px
        rgba(0, 0, 0, .13);
    z-index: 60;
}

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

.oabd-attach-menu button {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 11px;
    padding: 8px 11px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    color: #222222;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.oabd-attach-menu button:hover {
    background: #f3f3f3;
}

.oabd-attach-menu button span {
    width: 24px;
    text-align: center;
    font-size: 21px;
    font-weight: 400;
}

.oabd-attach-menu button strong {
    font-size: 15px;
    font-weight: 500;
}

@media (max-width: 520px) {
    .oabd-composer {
        padding-left: 8px;
    }

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



/* =========================================================
   OPENAI BD STEP 5.2 - VOICE BUTTON
   ========================================================= */

.oabd-voice-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    border: 0;
    border-radius: 50%;

    display: grid;
    place-items: center;

    background: transparent;
    color: #222222;

    cursor: pointer;
}

.oabd-voice-button:hover {
    background: #f2f2f2;
}

.oabd-voice-button svg {
    width: 23px;
    height: 23px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.oabd-voice-button:active {
    transform: scale(.95);
}

@media (max-width: 520px) {

    .oabd-voice-button {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .oabd-voice-button svg {
        width: 22px;
        height: 22px;
    }

}



/* =========================================================
   OPENAI BD STEP 6 - ATTACHMENT PREVIEW
   ========================================================= */

.oabd-attachment-preview {
    width: min(760px, calc(100% - 24px));
    margin: 0 auto 8px;

    min-height: 68px;
    padding: 8px 10px;

    display: flex;
    align-items: center;
    gap: 11px;

    border: 1px solid #dedede;
    border-radius: 16px;

    background: #ffffff;

    box-shadow:
        0 4px 18px
        rgba(0, 0, 0, .06);
}

.oabd-attachment-preview[hidden] {
    display: none;
}

.oabd-preview-thumbnail {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;

    display: grid;
    place-items: center;

    overflow: hidden;

    border-radius: 11px;
    background: #f1f1f1;

    font-size: 12px;
    font-weight: 700;
    color: #555;
}

.oabd-preview-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.oabd-preview-info {
    min-width: 0;
    flex: 1;
}

.oabd-preview-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #1d1d1f;
    font-size: 14px;
    font-weight: 600;
}

.oabd-preview-meta {
    margin-top: 4px;

    color: #777;
    font-size: 12px;
}

.oabd-preview-remove {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 50%;

    background: #f1f1f1;
    color: #222;

    font-size: 23px;
    line-height: 1;

    cursor: pointer;
}

.oabd-preview-remove:hover {
    background: #e6e6e6;
}


/* =========================================
   OPENAI BD STEP 8.6
   Sent attachment inside conversation
   ========================================= */

.oabd-message-attachment-row {
    display: flex;
    justify-content: flex-end;
}

.oabd-sent-attachment {
    width: min(360px, 82vw);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid #e5e5e5;
    border-radius: 18px;
    background: #f4f4f4;
    box-sizing: border-box;
}

.oabd-sent-attachment-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #e8e8e8;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
}

.oabd-sent-attachment-info {
    min-width: 0;
    flex: 1;
}

.oabd-sent-attachment-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: 600;
}

.oabd-sent-attachment-meta {
    margin-top: 3px;
    font-size: 13px;
    color: #777;
}

