/* WRYEDGE DIRECT 2.0 - Product Selection Workspace v0.3.9-alpha1 */
.wd-sa-selection-v039__main {
    display:flex; flex-direction:column; align-items:stretch;
    gap:16px; min-width:0; width:100%;
    grid-column:1; grid-row:1;
}
.wd-sa-selection-v039__main > .wd-sa-chat {min-width:0; width:100%;}
.wd-sa-selection-v039 {
    min-width:0; width:100%; background:#fff;
    border:1px solid #dfe5ed; border-radius:16px;
    box-shadow:0 8px 26px rgba(20,35,59,.04);
    overflow:hidden;
}
.wd-sa-selection-v039__head {
    display:flex; align-items:center; justify-content:space-between;
    gap:12px; padding:17px 19px;
    border-bottom:1px solid #e9edf2;
}
.wd-sa-selection-v039__eyebrow {
    display:block; color:#7a899d; letter-spacing:.11em;
    font-size:10px; font-weight:800; margin-bottom:5px;
}
.wd-sa-selection-v039__head h2 {
    margin:0; color:#182332; font-size:18px; line-height:1.3;
}
.wd-sa-selection-v039__counter {
    flex:0 0 auto; color:#526078; background:#f5f7fa;
    border-radius:30px; font-size:11px; padding:7px 11px;
}
.wd-sa-selection-v039__empty {
    color:#748399; font-size:13px; text-align:center;
    padding:28px 20px 20px; margin:0;
}
.wd-sa-selection-v039__cards {
    display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px; padding:16px;
}
.wd-sa-selection-v039__cards:empty {display:none;}
.wd-sa-selection-v039__item {
    min-width:0; display:flex; flex-direction:column; gap:9px;
    padding:10px; background:#fff;
    border:1px solid #e2e7ef; border-radius:12px;
    transition:border-color .16s,box-shadow .16s;
}
.wd-sa-selection-v039__item.is-selected {
    border-color:#d92847; box-shadow:0 0 0 2px rgba(217,40,71,.09);
}
.wd-sa-selection-v039__visual {
    height:142px; width:100%; display:flex; align-items:center;
    justify-content:center; background:#f8fafc; border-radius:9px;
    overflow:hidden;
}
.wd-sa-selection-v039__visual img {
    max-width:100%; max-height:100%; width:100%; height:100%; object-fit:contain;
}
.wd-sa-selection-v039__fallback {font-weight:800;font-size:22px;color:#d92749;}
.wd-sa-selection-v039__meta {display:flex;flex-direction:column;gap:5px;flex:1;min-width:0;}
.wd-sa-selection-v039__name {
    font-size:12px; line-height:1.45; color:#1f2937;
    overflow-wrap:anywhere;
}
.wd-sa-selection-v039__brand {color:#708199; font-size:11px;}
.wd-sa-selection-v039__verified {color:#05805b;font-size:10px;}
.wd-sa-selection-v039__link {
    color:#d52643;font-size:11px;font-weight:700;
    text-decoration:none;overflow-wrap:anywhere;
}
.wd-sa-selection-v039__link:hover {text-decoration:underline;}
.wd-sa-selection-v039__check {
    display:flex;align-items:center;gap:7px;padding:8px 0 1px;
    border-top:1px solid #edf0f4;
    font-size:12px;color:#29364a;cursor:pointer;
}
.wd-sa-selection-v039__check input {width:16px;height:16px;accent-color:#d52643;cursor:pointer;}
.wd-sa-selection-v039__footer {
    border-top:1px solid #e9edf2;padding:12px 18px;
    display:flex;gap:16px;align-items:center;justify-content:space-between;
}
.wd-sa-selection-v039__note {color:#77859a;font-size:11px;line-height:1.5;}
.wd-sa-selection-v039__compare {
    appearance:none;border:none;border-radius:8px;background:#d62643;color:#fff;
    font-size:12px;font-weight:700;padding:11px 15px;cursor:pointer;
    white-space:nowrap;
}
.wd-sa-selection-v039__compare:disabled {background:#dce2e9;color:#728095;cursor:not-allowed;}
/* Preserve the v0.3.8 renderer for rollback and metadata, but avoid inline cards. */
.wd-sa-messages .wd-sa-recommended-products-v038 {display:none!important;}
@media(max-width:1180px) {
    .wd-sa-selection-v039__cards {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:700px) {
    .wd-sa-selection-v039__cards {grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:10px;}
    .wd-sa-selection-v039__visual {height:116px;}
    .wd-sa-selection-v039__head {padding:15px 13px;align-items:flex-start;}
    .wd-sa-selection-v039__head h2 {font-size:16px;}
    .wd-sa-selection-v039__footer {flex-direction:column;align-items:stretch;gap:10px;}
    .wd-sa-selection-v039__compare {width:100%;}
}
@media(max-width:430px) {
    .wd-sa-selection-v039__cards {grid-template-columns:1fr;}
}

/* WED-AI Product Selection live updates v0.3.9-fix2 */
.wd-sa-selection-v039__status {
    color:#586780; font-size:11px; line-height:1.4;
    margin-left:auto; display:inline-flex; align-items:center; gap:8px;
}
.wd-sa-selection-v039__status[hidden] {display:none!important;}
.wd-sa-selection-v039__status:not([hidden])::before {
    content:""; width:10px; height:10px; flex:0 0 10px;
    border-radius:50%; border:2px solid #e7cbd2;
    border-top-color:#d62643; animation:wd-sa-selection-fix2-spin .85s linear infinite;
}
@keyframes wd-sa-selection-fix2-spin {to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce) {
    .wd-sa-selection-v039__status::before {animation:none!important;}
}
@media(max-width:520px) {
    .wd-sa-selection-v039__head {flex-wrap:wrap;}
    .wd-sa-selection-v039__status {order:3; flex-basis:100%; margin-left:0;}
}
/* END WED-AI selection live updates v0.3.9-fix2 */

/* WED-AI Product Selection Workspace v0.3.10: full-row, white compact cards */
.wd-sa-workspace > .wd-sa-selection-v039 {
    grid-column:1 / -1;
    grid-row:2;
    width:100%;
    min-width:0;
    background:#fff;
}
.wd-sa-workspace > .wd-sa-selection-v039__main {
    grid-column:1;
    grid-row:1;
}
.wd-sa-selection-v039__cards {
    grid-template-columns:repeat(auto-fill,minmax(190px,1fr));
    gap:10px;
    padding:14px;
    background:#fff;
}
.wd-sa-selection-v039__item {
    background:#fff;
    padding:8px;
    gap:7px;
    border-radius:10px;
}
.wd-sa-selection-v039__visual {
    background:#fff;
    height:116px;
}
.wd-sa-selection-v039__visual img {
    object-fit:contain;
}
.wd-sa-selection-v039__name {font-size:11.5px;line-height:1.35;}
.wd-sa-selection-v039__meta {gap:3px;}
.wd-sa-selection-v039__check {padding-top:7px;}
@media(max-width:690px) {
    .wd-sa-selection-v039__cards {
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:8px;
        padding:10px;
    }
    .wd-sa-selection-v039__visual {height:100px;}
}
@media(max-width:420px) {
    .wd-sa-selection-v039__cards {grid-template-columns:1fr;}
}
/* END WED-AI Product Selection Workspace v0.3.10 */
