/* Uspica smart search ("AI Match") panel */
.uss-panel {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 60;
    background: rgba(255, 255, 255, 0.97); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.9); border-radius: 20px; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
    padding: 14px; text-align: left; color: #1e293b; box-sizing: border-box; max-height: min(70vh, 560px); overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased;
    animation: ussIn .25s cubic-bezier(0.16, 1, 0.3, 1);
}
.uss-panel[hidden] { display: none !important; }
.uss-panel *, .uss-panel *::before, .uss-panel *::after { box-sizing: border-box; }
@keyframes ussIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.uss-panel.uss-busy { opacity: .7; }

.uss-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.uss-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: #c2410c; background: #fff7ed; border: 1px solid #ffedd5; border-radius: 999px; padding: 4px 10px; letter-spacing: .2px; }
.uss-panel .uss-x { width: 32px; height: 32px; min-height: 32px; padding: 0 !important; border: none !important; border-radius: 50% !important; background: #f1f5f9 !important; color: #64748b !important; font-size: 18px !important; line-height: 1; cursor: pointer; box-shadow: none !important; }
.uss-panel .uss-x:hover { background: #e2e8f0 !important; color: #1e293b !important; }

.uss-label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .4px; }
.uss-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 10px; }
.uss-chips .uss-label { margin-right: 2px; }
.uss-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-size: 13px; font-weight: 700; }
.uss-best { display: block; margin: 6px 2px 6px; }

.uss-list { list-style: none; margin: 0; padding: 0; }
.uss-list li { margin: 0; padding: 0; }
.uss-panel a.uss-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; text-decoration: none !important; color: #1e293b !important; min-height: 60px; transition: background .2s ease; }
.uss-panel a.uss-item:hover, .uss-panel a.uss-item:focus { background: #f1f5f9; outline: none; }
.uss-thumb { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; background-size: cover; background-position: center; }
.uss-thumb.offer { background-color: #fff7ed; } .uss-thumb.request { background-color: #ecfdf5; }
.uss-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.uss-title { font-size: 14px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.uss-meta { font-size: 12px; color: #64748b; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.uss-type { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: #fff; padding: 2px 7px; border-radius: 999px; }
.uss-type.offer { background: #f28500; } .uss-type.request { background: #047857; }
.uss-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.uss-price { font-size: 13px; font-weight: 800; color: #047857; white-space: nowrap; }
.uss-fit { font-size: 11px; font-weight: 700; color: #475569; background: #f1f5f9; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }

.uss-hint { font-size: 14px; line-height: 1.55; color: #475569; margin: 4px 2px 8px; }
.uss-panel a.uss-link { color: #047857 !important; font-weight: 700; text-decoration: underline !important; }
.uss-panel a.uss-all { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; border-radius: 12px; background: #047857; color: #fff !important; font-size: 14px; font-weight: 700; text-decoration: none !important; }
.uss-panel a.uss-all:hover { background: #065f46; }

/* Homepage AI Match button when smart mode is on */
#uspica-ai-btn.uss-on { background: #f28500 !important; border-color: #f28500 !important; color: #fff !important; }
#uspica-ai-btn.uss-on svg { stroke: #fff !important; }

/* Trade Board "Did you mean" */
.uspica-smart-dym { font-size: 15px; color: #475569; margin: -8px 0 20px; }
.uspica-smart-dym a { color: #047857; font-weight: 700; text-decoration: underline; }

@media (max-width: 680px) {
    .uss-panel { padding: 10px; border-radius: 18px; max-height: 65vh; }
    .uss-price { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .uss-panel { animation: none; } }
