
/* WED-AI SELECTED PRODUCT PANEL V031 */

.wd-sa-selected-product[hidden] {
    display: none !important;
}

.wd-sa-selected-product {
    display: flex;
    align-items: center;
    gap: 16px;

    width: 100%;
    box-sizing: border-box;

    margin: 14px 0 16px;
    padding: 13px 16px;

    background: #ffffff;
    border: 1px solid #dfe6ed;
    border-radius: 14px;

    box-shadow: 0 3px 14px rgba(24, 42, 59, 0.035);
    color: #172936;
}

.wd-sa-selected-product__visual {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 72px;
    width: 72px;
    height: 72px;

    border: 1px solid #edf0f4;
    border-radius: 11px;
    background: #fff;
    overflow: hidden;
}

.wd-sa-selected-product__visual img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wd-sa-selected-product__visual-fallback {
    display: grid;
    place-items: center;

    width: 100%;
    height: 100%;

    color: #c82043;
    background: #fcf4f6;

    font-size: 17px;
    font-weight: 800;
}

.wd-sa-selected-product__details {
    flex: 1 1 auto;
    min-width: 0;
}

.wd-sa-selected-product__eyebrow {
    margin-bottom: 5px;

    color: #7d8a98;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .065em;
}

.wd-sa-selected-product__name {
    display: block;

    font-size: 16px;
    font-weight: 750;
    line-height: 1.35;
}

.wd-sa-selected-product__metadata {
    margin-top: 5px;

    color: #728191;
    font-size: 12px;
    line-height: 1.45;
}

.wd-sa-selected-product__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;

    flex: 0 0 auto;
    gap: 9px;
}

.wd-sa-selected-product__context-status {
    font-size: 11px;
    font-weight: 650;
    color: #137c63;
    white-space: nowrap;
}

.wd-sa-selected-product__link {
    font-size: 12px;
    font-weight: 700;
    color: #d31637;
    text-decoration: none;
}

.wd-sa-selected-product__link:hover {
    text-decoration: underline;
}

.wd-sa-selected-product__notice {
    color: #607183;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .wd-sa-selected-product {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px;
    }

    .wd-sa-selected-product__visual {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
    }

    .wd-sa-selected-product__details {
        flex: 1 1 calc(100% - 80px);
    }

    .wd-sa-selected-product__actions {
        flex: 1 1 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding-top: 8px;
        border-top: 1px solid #eef1f4;
    }
}

/* END WED-AI SELECTED PRODUCT PANEL V031 */


/* WEDAI QUICK SELECTION LABEL V031UI1 */

.wd-sa-quick-start-label {
    margin: 0 0 8px 2px;
    padding: 0;

    color: #8390a0;
    font-family: inherit;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.35;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

/* END WEDAI QUICK SELECTION LABEL V031UI1 */

/* WEDAI CHAT CONTROLS V032 */

.wd-sa-avatar.wd-sa-avatar--image,
.wd-sa-welcome__mark.wd-sa-welcome__mark--image {
    padding: 0;
    overflow: hidden;
    background: #fff;
    color: inherit;
    box-shadow: none;
    border: 1px solid #edf0f4;
}

.wd-sa-avatar--image img,
.wd-sa-welcome__mark--image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wd-sa-chat__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.wd-sa-chat__actions .wd-sa-download-txt,
.wd-sa-chat__actions .wd-sa-new-conversation {
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid #dfe5ec;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.wd-sa-chat__actions .wd-sa-download-txt {
    color: #344a5e;
}

.wd-sa-chat__actions .wd-sa-new-conversation {
    color: #c72242;
    border-color: #f0d6dd;
}

.wd-sa-chat__actions button:hover {
    background: #f9fafc;
    border-color: #cbd5e0;
}

.wd-sa-chat__actions button:focus-visible {
    outline: 2px solid #c72242;
    outline-offset: 2px;
}

@media (max-width: 650px) {
    .wd-sa-chat__header {
        flex-wrap: wrap;
    }

    .wd-sa-chat__actions {
        flex: 1 1 100%;
        justify-content: flex-end;
    }
}

/* END WEDAI CHAT CONTROLS V032 */


/* =====================================================
   WEDAI CHAT SCROLL V034
   Internal conversation scrolling
   Frontend-only UI extension
   ===================================================== */

.wd-sa-workspace .wd-sa-chat {
    display: flex;
    flex-direction: column;

    height: clamp(540px, 72dvh, 760px);

    min-height: 0;
    max-height: none;

    overflow: hidden;
}

.wd-sa-workspace .wd-sa-chat__header {
    flex: 0 0 auto;
}

.wd-sa-workspace .wd-sa-chat .wd-sa-messages {
    flex: 1 1 0;

    min-height: 0;
    max-height: none;

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #bdc8d5 #f8fafc;

    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.wd-sa-workspace
.wd-sa-chat
.wd-sa-messages::-webkit-scrollbar {
    width: 8px;
}

.wd-sa-workspace
.wd-sa-chat
.wd-sa-messages::-webkit-scrollbar-track {
    background: #f8fafc;
}

.wd-sa-workspace
.wd-sa-chat
.wd-sa-messages::-webkit-scrollbar-thumb {
    background: #bdc8d5;
    border-radius: 8px;
    border: 2px solid #f8fafc;
}

.wd-sa-workspace
.wd-sa-chat
.wd-sa-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile / narrow screens */

@media (max-width: 720px) {

    .wd-sa-workspace .wd-sa-chat {
        height: clamp(440px, 67dvh, 680px);
    }

}

/* END WEDAI CHAT SCROLL V034 */


/* WEDAI RESPONSE FORMATTING V035 */
.wd-sa-workspace .wd-sa-chat .wd-sa-message--assistant
.wd-sa-message__bubble.wd-sa-md-ready {
    white-space: normal;
    overflow-wrap: anywhere;
}
.wd-sa-md-ready p { margin: 0 0 10px; }
.wd-sa-md-ready p:last-child { margin-bottom: 0; }
.wd-sa-md-ready h3,
.wd-sa-md-ready h4 {
    margin: 14px 0 7px;
    font-weight: 750;
    line-height: 1.35;
    color: #202938;
}
.wd-sa-md-ready h3 { font-size: 14px; }
.wd-sa-md-ready h4 { font-size: 13px; }
.wd-sa-md-ready h3:first-child,
.wd-sa-md-ready h4:first-child { margin-top: 0; }
.wd-sa-md-ready ul,
.wd-sa-md-ready ol {
    margin: 6px 0 12px;
    padding-left: 20px;
    list-style-position: outside;
}
.wd-sa-md-ready li { padding-left: 2px; }
.wd-sa-md-ready li + li { margin-top: 4px; }
.wd-sa-md-ready ul:last-child,
.wd-sa-md-ready ol:last-child { margin-bottom: 0; }
.wd-sa-md-ready strong { font-weight: 750; }
.wd-sa-md-ready code {
    padding: 1px 4px;
    border-radius: 4px;
    background: #eef1f5;
    font-size: .95em;
}
.wd-sa-md-ready pre {
    margin: 9px 0 12px;
    padding: 11px;
    overflow-x: auto;
    background: #eef1f5;
    border-radius: 8px;
    white-space: pre-wrap;
}
.wd-sa-md-ready pre code { padding: 0; background: transparent; }
.wd-sa-md-ready hr { border: 0; border-top: 1px solid #e0e5eb; margin: 12px 0; }
/* END WEDAI RESPONSE FORMATTING V035 */


/* WEDAI MARKDOWN TABLES V036 */
.wd-sa-workspace .wd-sa-chat .wd-sa-md-ready .wd-sa-md-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 12px 0 15px;
    border: 1px solid #e0e6ef;
    border-radius: 9px;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #bac6d4 #f7f9fc;
    overscroll-behavior-x: contain;
}
.wd-sa-md-ready .wd-sa-md-table-scroll:first-child { margin-top: 0; }
.wd-sa-md-ready .wd-sa-md-table-scroll:last-child { margin-bottom: 0; }
.wd-sa-md-ready .wd-sa-md-table-scroll:focus-visible {
    outline: 2px solid #d72641;
    outline-offset: 2px;
}
.wd-sa-workspace .wd-sa-chat .wd-sa-md-ready table.wd-sa-md-table {
    width: max-content;
    min-width: 100%;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #253145;
}
.wd-sa-md-ready .wd-sa-md-table th,
.wd-sa-md-ready .wd-sa-md-table td {
    padding: 9px 12px;
    min-width: 96px;
    max-width: 310px;
    border-right: 1px solid #ebeff5;
    border-bottom: 1px solid #ebeff5;
    vertical-align: top;
    overflow-wrap: anywhere;
    white-space: normal;
}
.wd-sa-md-ready .wd-sa-md-table th:last-child,
.wd-sa-md-ready .wd-sa-md-table td:last-child { border-right: 0; }
.wd-sa-md-ready .wd-sa-md-table tbody tr:last-child td { border-bottom: 0; }
.wd-sa-md-ready .wd-sa-md-table thead th {
    background: #f2f5f9;
    color: #1d2a3b;
    font-weight: 750;
}
.wd-sa-md-ready .wd-sa-md-table tbody tr:nth-child(even) td { background: #fbfcfe; }
.wd-sa-md-ready .wd-sa-md-table tbody tr:hover td { background: #f6f9fd; }
@media (max-width: 720px) {
    .wd-sa-md-ready .wd-sa-md-table th,
    .wd-sa-md-ready .wd-sa-md-table td { padding: 8px 10px; }
}
/* END WEDAI MARKDOWN TABLES V036 */


/* WEDAI PRODUCT VISUAL CARDS V037 — selected-product context only */
.wd-sa-verified-product-card {
    box-sizing: border-box;
    width: min(100%, 620px);
    max-width: 100%;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    margin: 11px 0 8px;
    padding: 12px;
    border: 1px solid #e2e8ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(33, 45, 60, 0.025);
}
.wd-sa-product-card__visual {
    width: 96px;
    height: 96px;
    border: 1px solid #edf0f4;
    border-radius: 9px;
    background: #fafbfc;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}
.wd-sa-product-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.wd-sa-product-card__fallback {
    color: #8b96a5;
    font-weight: 800;
    font-size: 17px;
}
.wd-sa-product-card__details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    gap: 5px;
}
.wd-sa-product-card__eyebrow {
    color: #8190a4;
    letter-spacing: .055em;
    font-size: 9px;
    font-weight: 800;
}
.wd-sa-product-card__name {
    color: #172033;
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.wd-sa-product-card__brand {
    color: #617084;
    font-size: 11px;
}
.wd-sa-product-card__verified {
    color: #167b59;
    font-size: 10px;
    font-weight: 600;
}
.wd-sa-product-card__link {
    color: #d32245;
    text-decoration: none;
    font-weight: 700;
    font-size: 11px;
    margin-top: 2px;
}
.wd-sa-product-card__link:hover { text-decoration: underline; }
.wd-sa-product-card__link:focus-visible {
    outline: 2px solid #d32245;
    outline-offset: 3px;
}
@media (max-width: 650px) {
    .wd-sa-message--assistant:has(.wd-sa-verified-product-card) {
        max-width: 96%;
    }
    .wd-sa-verified-product-card {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 10px;
        padding: 9px;
    }
    .wd-sa-product-card__visual { width: 76px; height: 76px; }
}
/* END WEDAI PRODUCT VISUAL CARDS V037 */


/* WEDAI MULTI PRODUCT CARDS V038 */
.wd-sa-recommended-products-v038 {
    width: min(100%, 760px); margin-top: 12px; padding: 12px;
    border: 1px solid #e3e8ee; border-radius: 12px; background: #fff;
}
.wd-sa-multi-product__heading {
    color: #75849a; font-size: 10px; letter-spacing: .085em;
    font-weight: 800; margin: 0 0 10px;
}
.wd-sa-multi-product__grid {
    display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px;
}
.wd-sa-multi-product__card {
    display: flex; gap: 10px; min-width: 0; padding: 10px;
    border: 1px solid #e6e9ef; border-radius: 10px;
    background: #fbfcfe; align-items: center;
}
.wd-sa-multi-product__visual {
    width: 80px; height: 80px; flex: 0 0 80px;
    background: #fff; border-radius: 8px; border: 1px solid #edf0f4;
    display: grid; place-items: center; overflow: hidden;
}
.wd-sa-multi-product__img {width: 100%; height: 100%; object-fit: contain;}
.wd-sa-multi-product__fallback {color: #d92749; font-weight: 800;}
.wd-sa-multi-product__details {display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0;}
.wd-sa-multi-product__name {font-size:12px;line-height:1.4;color:#1c2637;overflow-wrap:anywhere;}
.wd-sa-multi-product__brand {color:#6f7d91;font-size:11px;}
.wd-sa-multi-product__verified {color:#047857;font-size:10px;}
.wd-sa-multi-product__link {font-size:11px;font-weight:700;color:#cb2340;text-decoration:none;}
.wd-sa-multi-product__link:hover {text-decoration:underline;}
@media(max-width:850px) {
    .wd-sa-multi-product__grid {grid-template-columns:1fr;}
}
@media(max-width:420px) {
    .wd-sa-multi-product__visual {width:64px;height:64px;flex-basis:64px;}
}
/* END WEDAI MULTI PRODUCT CARDS V038 */
