/* ============================================================
   Ask JD — Shopping Assistant UI  ·  "Kiwi Deal Discovery" (purple)
   Source: Stitch project "AI Deal Search Assistant" (purple screen).
   Tokens below are taken from that design system:
     primary container #6b3ba7 · deep purple #4a2782 · coral deal signal #ef7171
     AI cyan #00c2cb · ink #2d1852 / #230d48 · surface #fef7ff
     success #10b981 · Plus Jakarta Sans · 16px cards / 8px controls / pill chips
   Rules of the system:
     - purple = actions, active states, brand
     - coral  = deal signals only (prices, discount badges, "Get deal")
     - cyan   = AI markers only (online dot, typing dots, AI tags)
   Header and footer are the shared site partials and are NOT restyled here.
   Class names are unchanged so js/shopping-assistant.js keeps working.
   ============================================================ */
:root {
    --p: #6b3ba7;            /* primary container */
    --p-d: #4a2782;          /* deep purple – hover / strong text */
    --p-soft: #f4eaff;       /* surface-container */
    --p-softer: #f9f0ff;     /* surface-container-low */
    --p-line: rgba(107,59,167,.14);
    --p-line-soft: rgba(107,59,167,.08);
    --ink: #2d1852;
    --ink-2: #230d48;
    --muted: #6b617a;
    --coral: #ef7171;
    --coral-d: #d95555;
    --ai: #00c2cb;
    --ai-d: #008a91;
    --ok: #10b981;
    --canvas: #fef7ff;
    --shadow-1: 0 2px 8px -2px rgba(45,24,82,.06), 0 1px 4px -1px rgba(45,24,82,.04);
    --shadow-2: 0 12px 24px -6px rgba(45,24,82,.12), 0 4px 8px -2px rgba(45,24,82,.06);
    --font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

    /* legacy names used by older markup/JS */
    --jd-accent: var(--p); --jd-accent-d: var(--p-d); --jd-ink: var(--ink);
    --jd-muted: var(--muted); --jd-bg: var(--p-softer); --jd-teal: var(--ai-d);
}

@keyframes jdFadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes jdPopIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes jdMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes jdDot { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@keyframes jdPulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); } 70% { box-shadow: 0 0 0 7px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
@media (prefers-reduced-motion: reduce) {
    .assistant-wrap, .assistant-wrap * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- canvas ---- */
body.ask-jd-page .content-block { background: var(--canvas); }
body.ask-jd-page .gap { height: 0; min-height: 0; }
.assistant-wrap,
.assistant-wrap button, .assistant-wrap input, .assistant-wrap select, .assistant-wrap textarea { font-family: var(--font); }
.assistant-wrap {
    max-width: 1180px; margin: 18px auto 72px; padding: 0 16px;
    color: var(--ink-2); font-size: 15px; line-height: 1.55; animation: jdFadeUp .4s ease both;
}
.assistant-wrap :focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }

/* ---- Hero ---- */
.jd-hero {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 24px;
    background: linear-gradient(135deg, #4a2782 0%, #6b3ba7 60%, #7a4ab8 100%);
    border-radius: 20px; color: #fff; padding: 30px 34px; margin-bottom: 20px;
    box-shadow: 0 16px 36px -10px rgba(74,39,130,.5);
}
.jd-hero::before, .jd-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.jd-hero::before { right: -80px; top: -100px; width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(239,113,113,.34), rgba(239,113,113,0) 68%); }
.jd-hero::after { left: 30%; bottom: -130px; width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(0,194,203,.26), rgba(0,194,203,0) 68%); }
.jd-hero .jd-avatar {
    position: relative; z-index: 1; flex: none; width: 70px; height: 70px; border-radius: 20px;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
    display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px);
}
.jd-hero .jd-avatar .fa { font-size: 30px; color: #fff; }
.jd-hero-body { position: relative; z-index: 1; min-width: 0; }
.jd-hero-eyebrow {
    display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
    color: #f1e6ff; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
    padding: 5px 12px; border-radius: 999px;
}
.jd-hero-eyebrow .fa { color: #6bf6ff; }
.jd-hero h2 { color: #fff; font-weight: 800; margin: 0 0 8px; font-size: 32px; line-height: 1.15; letter-spacing: -.02em; }
.jd-hero .jd-hero-name { color: #ffb3b1; white-space: nowrap; }
.jd-hero p { margin: 0; font-size: 15.5px; max-width: 640px; line-height: 1.6; color: #e8d9ff; }
.jd-hero-tries { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.jd-hero-try-lbl { font-size: 13px; font-weight: 700; color: #cdb4f5; }
.jd-hero-try {
    border: 2px solid #a883e9; background: transparent; color: #fff; cursor: pointer;
    border-radius: 20px 20px 20px 0; padding: 7px 16px; min-height: 40px; font-size: 13.5px; font-weight: 600;
    transition: background .4s, border-color .4s, transform .15s;
}
.jd-hero-try:hover { background: var(--coral); border-color: transparent; color: #fff; transform: translateY(-2px); }
@media (max-width: 640px) {
    .jd-hero { flex-direction: column; text-align: center; padding: 26px 20px; }
    .jd-hero h2 { font-size: 26px; }
    .jd-hero-tries { justify-content: center; }
    .jd-hero p { font-size: 14.5px; }
}

/* ---- layout ---- */
.assistant-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 920px) { .assistant-grid { grid-template-columns: 1fr; } }

.card-panel {
    background: #fff; border: 1px solid var(--p-line-soft); border-radius: 16px;
    box-shadow: var(--shadow-1); padding: 22px; margin-bottom: 22px; animation: jdFadeUp .4s ease both;
}
.card-panel.d2 { animation-delay: .05s; }
.card-panel h3 {
    display: flex; align-items: center; gap: 10px; margin: 0 0 4px;
    font-size: 18px; font-weight: 800; letter-spacing: -.01em; color: var(--p-d);
}
.card-panel h3 .fa { color: var(--p); }
.card-panel .muted { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin-bottom: 16px; }
.card-panel .muted a { color: var(--p); font-weight: 700; text-decoration: none; }
.card-panel .muted a:hover { color: var(--p-d); text-decoration: underline; }

/* "AI" tag next to the chat heading */
.ai-tag {
    margin-left: auto; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
    color: var(--ai-d); background: rgba(0,194,203,.12); border: 1px solid rgba(0,194,203,.35);
    padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
}
.ai-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: jdPulse 2s infinite; }

/* ---- identify bar ---- */
.identify-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; padding: 12px 16px;
    background: #fff; border: 1px solid var(--p-line-soft); border-radius: 16px; box-shadow: var(--shadow-1);
    animation: jdFadeUp .4s ease both;
}
.identify-bar .lbl { color: var(--p-d); font-weight: 700; font-size: 14px; white-space: nowrap; }
.identify-bar .lbl .fa { color: var(--p); margin-right: 4px; }
.identify-bar input {
    flex: 1; min-width: 220px; min-height: 46px; padding: 10px 14px; font-size: 16px; color: var(--ink-2);
    background: var(--p-softer); border: 1.5px solid transparent; border-radius: 10px; transition: border-color .2s, background .2s, box-shadow .2s;
}
.identify-bar input::placeholder { color: #9a8fb0; }
.identify-bar input:focus { outline: none; background: #fff; border-color: var(--p); box-shadow: 0 0 0 3px rgba(107,59,167,.15); }

/* ---- chat ---- */
.chat-shell { display: flex; flex-direction: column; }
.chat-window {
    height: auto; min-height: 260px; max-height: 460px; overflow-y: auto; padding: 18px; margin-bottom: 14px;
    background: var(--p-softer); border: 1px solid var(--p-line-soft); border-radius: 14px; scroll-behavior: smooth;
}
.chat-window::-webkit-scrollbar { width: 8px; }
.chat-window::-webkit-scrollbar-thumb { background: #d9c6f2; border-radius: 8px; }

.chat-msg { display: flex; align-items: flex-end; gap: 9px; margin-bottom: 14px; animation: jdMsgIn .3s ease both; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant::before {
    content: "\f0d0"; font-family: FontAwesome; flex: none; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 13px;
    background: #eedcff; color: var(--p);
}
.chat-bubble { max-width: 80%; padding: 12px 16px; font-size: 15px; line-height: 1.55; border-radius: 16px; }
.chat-msg.assistant .chat-bubble { background: #fff; color: var(--ink-2); border: 1px solid var(--p-line-soft); border-bottom-left-radius: 4px; box-shadow: var(--shadow-1); }
.chat-msg.user .chat-bubble { background: var(--p-d); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble a { color: var(--p); font-weight: 700; }
.chat-bubble i { opacity: .85; }

.chat-typing { display: inline-flex; align-items: center; gap: 5px; padding: 4px 2px; }
.chat-typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--ai); animation: jdDot 1.3s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .18s; }
.chat-typing span:nth-child(3) { animation-delay: .36s; }

/* chips inside chat */
.chat-ideas { margin-top: 10px; }
.chat-chip {
    display: inline-flex; align-items: center; gap: 6px; margin: 4px 6px 0 0; padding: 7px 14px; min-height: 36px;
    font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer;
    background: var(--p-soft); color: var(--p-d); border: 1px solid var(--p-line); border-radius: 999px;
    transition: background .15s, transform .15s, box-shadow .15s;
}
.chat-chip:hover { background: #ebdcff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(74,39,130,.16); color: var(--p-d); }
.chat-chip.primary, .chat-chip.dr-save { background: var(--p); border-color: var(--p); color: #fff; }
.chat-chip.primary:hover, .chat-chip.dr-save:hover { background: var(--p-d); color: #fff; }

/* quick-start suggestions – header-button look: lavender outline, drop corner, coral on hover */
.suggest-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; }
.suggest-pill {
    border: 2px solid #a883e9; background: #fff; color: var(--p-d); cursor: pointer;
    border-radius: 20px 20px 20px 0; padding: 7px 15px; min-height: 40px; font-size: 13.5px; font-weight: 600;
    transition: background .4s, border-color .4s, color .4s, transform .15s;
}
.suggest-pill:hover { background: var(--coral); border-color: transparent; color: #fff; transform: translateY(-2px); }
.suggest-pill .fa { margin-right: 7px; color: var(--p); }
.suggest-pill:hover .fa { color: #fff; }

/* chat input */
.chat-input-row { display: flex; gap: 10px; }
.chat-input-row .inp-wrap { position: relative; flex: 1; }
.chat-input-row input {
    width: 100%; min-height: 50px; padding: 12px 16px; font-size: 16px; color: var(--ink-2);
    background: var(--p-softer); border: 1.5px solid transparent; border-radius: 12px; transition: border-color .2s, background .2s, box-shadow .2s;
}
.chat-input-row input::placeholder { color: #9a8fb0; }
.chat-input-row input:focus { outline: none; background: #fff; border-color: var(--p); box-shadow: 0 0 0 3px rgba(107,59,167,.15); }

/* buttons: purple = action */
.assistant-btn, .jd-btn {
    position: relative; overflow: hidden; cursor: pointer; white-space: nowrap;
    min-height: 46px; padding: 12px 22px; border: none; border-radius: 12px; color: #fff;
    font-size: 15px; font-weight: 700; background: var(--p);
    transition: background .15s, transform .15s, box-shadow .15s;
}
.assistant-btn:hover, .jd-btn:hover { background: var(--p-d); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(74,39,130,.32); }
.assistant-btn:active, .jd-btn:active { transform: translateY(0) scale(.98); }
.assistant-btn:disabled, .jd-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.jd-btn.full { width: 100%; }

/* ---- simple deal rows (inbox + fallback renderer); results grid is further below ---- */
#chatDealsPanel { animation: jdPopIn .35s ease both; }
.notif-deal, .deal-card {
    display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 10px 12px;
    background: #fff; border: 1px solid var(--p-line-soft); border-radius: 14px; box-shadow: var(--shadow-1);
    color: var(--ink-2); text-decoration: none; animation: jdMsgIn .35s ease both;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.notif-deal:hover, .deal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--p-line); text-decoration: none; color: var(--ink-2); }
.notif-deal img, .deal-card img { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 10px; background: var(--p-softer); }
.notif-deal strong { font-size: 14px; color: var(--p-d); }

/* ---- right column: tools ---- */
.tool-tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 5px; background: var(--p-softer); border-radius: 12px; }
.tool-tab {
    flex: 1; min-height: 54px; padding: 8px 6px; border: none; border-radius: 9px; background: transparent; cursor: pointer;
    color: var(--muted); font-size: 13px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    transition: background .18s, color .18s, box-shadow .18s;
}
.tool-tab:hover { color: var(--p-d); }
.tool-tab .fa { font-size: 16px; }
.tool-tab.active { background: #fff; color: var(--p); box-shadow: 0 2px 8px rgba(74,39,130,.14); }
.tool-tab .pip { display: none; padding: 0 6px; border-radius: 10px; background: var(--coral); color: #fff; font-size: 10px; }
.tool-pane { display: none; animation: jdFadeUp .3s ease both; }
.tool-pane.active { display: block; }

/* ---- fields ---- */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--p-d); }
.field input, .field select, .field textarea {
    width: 100%; min-height: 46px; padding: 10px 13px; font-size: 16px; color: var(--ink-2);
    background: var(--p-softer); border: 1.5px solid transparent; border-radius: 10px; transition: border-color .2s, background .2s, box-shadow .2s;
}
.field input::placeholder, .field textarea::placeholder { color: #9a8fb0; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: #fff; border-color: var(--p); box-shadow: 0 0 0 3px rgba(107,59,167,.15); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }
@media (max-width: 420px) { .field-row { flex-direction: column; gap: 0; } }

/* lists */
.occasion-item, .notif-item {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 12px 14px;
    background: #fff; border: 1px solid var(--p-line-soft); border-radius: 12px; animation: jdMsgIn .3s ease both;
}
.occasion-item h6, .notif-item h6 { margin: 0 0 3px; font-size: 15px; font-weight: 700; color: var(--p-d); }
.occasion-item small { color: var(--muted); }
.occasion-item .assistant-btn { min-height: 34px; border-radius: 9px; }
.occasion-del { min-width: 32px; min-height: 32px; border: none; background: none; cursor: pointer; font-size: 22px; line-height: 1; color: var(--muted); transition: color .15s, transform .15s; }
.occasion-del:hover { color: var(--coral-d); transform: scale(1.15); }
.notif-item { flex-direction: column; }
.notif-item.unread { background: var(--p-softer); border-color: var(--p-line); box-shadow: inset 3px 0 0 var(--p); }
.notif-item p { margin: 0; font-size: 13.5px; color: var(--muted); }
.notif-deals { width: 100%; margin-top: 10px; }

.status-line { min-height: 18px; margin-top: 10px; font-size: 13.5px; font-weight: 600; transition: opacity .2s; }
.status-line.ok { color: #0b7a55; }
.status-line.err { color: #ba1a1a; }

.jd-empty { padding: 24px 12px; text-align: center; font-size: 14px; color: var(--muted); }
.jd-empty .fa { display: block; margin-bottom: 8px; font-size: 28px; color: #d3bff0; }

/* ---- credits ---- */
.jd-credits { display: none; align-items: center; gap: 10px; margin-left: auto; padding: 6px 8px 6px 12px; background: var(--p-softer); border-radius: 10px; animation: jdPopIn .35s ease both; }
.jd-credits .cred-count { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 800; color: var(--p-d); }
.jd-credits .cred-count .fa { color: var(--ai-d); }
.jd-credits .buy-btn {
    min-height: 38px; padding: 8px 14px; border: none; border-radius: 9px; background: var(--p); color: #fff; cursor: pointer; white-space: nowrap;
    font-size: 13.5px; font-weight: 700; transition: background .15s, transform .15s, box-shadow .15s;
}
.jd-credits .buy-btn:hover { background: var(--p-d); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(74,39,130,.3); }
@media (max-width: 600px) { .jd-credits { margin-left: 0; width: 100%; justify-content: space-between; } }

@media (max-width: 560px) {
    .chat-window { padding: 14px; }
    .chat-bubble { max-width: 88%; }
    .chat-input-row { flex-direction: column; }
    .chat-input-row .assistant-btn { width: 100%; }
    .card-panel { padding: 18px 16px; }
}

/* ============================================================
   Additions: live status, suggested label, alerts extras, tool footer
   and the "Verified Deals" results section (grid / list / sort / filters / pager)
   ============================================================ */
.jd-hero-try--extra { display: none; }
@media (min-width: 700px) { .jd-hero-try--extra { display: inline-flex; align-items: center; } }

.suggest-label { margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #9a8fb0; }

.live-status {
    display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 10px 14px;
    font-size: 13.5px; color: var(--ink-2); background: #f0fdf8; border: 1px solid #bff0dd; border-radius: 12px;
}
.live-status b { color: var(--ink); }
.live-status strong { color: #0b7a55; }
.live-status em { color: var(--coral-d); font-style: normal; font-weight: 800; }
.live-status a { color: var(--p); font-weight: 700; white-space: nowrap; }
.live-status .ls-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--ok); animation: jdPulse 2s infinite; }

.check-row { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 14px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.check-row input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--p); }

.tool-foot {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px;
    border-top: 1px solid var(--p-line-soft); font-size: 12px; color: #9a8fb0;
}
.tool-foot .fa-magic { color: var(--p); margin-right: 4px; }
.tool-live { color: #0b7a55; font-weight: 700; white-space: nowrap; }

.status-line.ok::before { content: "\f058"; font-family: FontAwesome; margin-right: 6px; }
.status-line.err::before { content: "\f06a"; font-family: FontAwesome; margin-right: 6px; }

/* ---- results section ---- */
.deals-section { padding: 18px 20px 20px; }
.deals-toolbar h3 { margin: 0 6px 0 0; }
.count-pill { margin-left: 6px; padding: 3px 10px; font-size: 12px; font-weight: 700; color: var(--p-d); background: var(--p-soft); border-radius: 999px; }
.query-pill { display: inline-flex; align-items: center; max-width: 280px; padding: 4px 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 700; color: var(--ai-d); background: rgba(0,194,203,.1); border: 1px solid rgba(0,194,203,.35); border-radius: 999px; }
.filter-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 13px; cursor: pointer;
    font-size: 12.5px; font-weight: 700; color: var(--p-d); background: #fff; border: 1.5px solid var(--p-line); border-radius: 999px;
    transition: background .15s, color .15s, border-color .15s;
}
.filter-chip:hover { background: var(--p-soft); }
.filter-chip.on { background: var(--p); border-color: var(--p); color: #fff; }
.filter-chip.clear { color: var(--muted); border-style: dashed; }
.sort-wrap { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.sort-wrap select, .deals-pager select {
    min-height: 38px; padding: 6px 28px 6px 12px; font-size: 13px; font-weight: 700; color: var(--ink-2);
    background-color: var(--p-softer); border: 1.5px solid transparent; border-radius: 9px;
}
.sort-wrap select:focus, .deals-pager select:focus { outline: none; border-color: var(--p); background-color: #fff; }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; background: var(--p-softer); border-radius: 9px; }
.view-toggle button { width: 36px; height: 34px; border: none; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.view-toggle button.on { background: #fff; color: var(--p); box-shadow: 0 1px 4px rgba(74,39,130,.18); }

.deals-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .deals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px)  { .deals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px)  { .deals-grid { grid-template-columns: 1fr; } }
.deals-grid > div:not(.deal-tile):not(.deals-empty) { grid-column: 1 / -1; }
.deals-empty { grid-column: 1 / -1; padding: 28px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.deals-empty .fa { display: block; margin-bottom: 8px; font-size: 26px; color: #d3bff0; }
.link-btn { border: none; background: none; padding: 0; color: var(--p); font-weight: 700; text-decoration: underline; cursor: pointer; }

.deal-tile {
    display: flex; flex-direction: column; justify-content: space-between; padding: 12px;
    background: #fff; border: 1px solid var(--p-line-soft); border-radius: 14px; box-shadow: var(--shadow-1);
    transition: transform .15s, box-shadow .2s, border-color .2s; animation: jdMsgIn .3s ease both;
}
.deal-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--p-line); }
.dt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.dt-badge { padding: 3px 9px; font-size: 11px; font-weight: 800; letter-spacing: .02em; color: #fff; background: var(--coral); border-radius: 7px; white-space: nowrap; }
.dt-badge--plain { background: var(--p-soft); color: var(--p-d); }
.dt-store { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: 11.5px; font-weight: 700; color: var(--p); }
.dt-fav { flex: none; width: 30px; height: 30px; border: none; border-radius: 50%; background: transparent; color: #9a8fb0; cursor: pointer; transition: color .15s, transform .15s, background .15s; }
.dt-fav:hover { color: var(--coral-d); background: var(--p-softer); transform: scale(1.1); }
.dt-fav.on { color: var(--coral-d); }
.dt-media { position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 10px; overflow: hidden; background: var(--p-softer); border-radius: 10px; }
.dt-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.deal-tile:hover .dt-media img { transform: scale(1.05); }
.dt-cat { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 2px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 700; color: var(--ink); background: rgba(255,255,255,.92); border-radius: 6px; }
.dt-body { flex: 1; }
.dt-title { margin: 0 0 4px; font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.dt-title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); text-decoration: none; }
.deal-tile:hover .dt-title a { color: var(--p); }
.dt-rating { font-size: 12.5px; color: var(--muted); }
.dt-rating .fa { color: #f59e0b; }
.dt-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--p-line-soft); }
.dt-prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 10px; }
.dt-price { font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: var(--coral-d); font-variant-numeric: tabular-nums; }
.dt-was { font-size: 12.5px; color: #9a8fb0; text-decoration: line-through; font-variant-numeric: tabular-nums; }
.dt-save { margin-left: auto; padding: 2px 8px; font-size: 11.5px; font-weight: 700; color: #0b7a55; background: #e7f9f1; border-radius: 6px; }
.dt-actions { display: flex; gap: 8px; }
.dt-cta {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 12px;
    font-size: 13.5px; font-weight: 700; color: #fff; background: var(--coral); border-radius: 10px; text-decoration: none;
    transition: background .15s, transform .15s;
}
.dt-cta:hover { background: var(--coral-d); color: #fff; transform: translateY(-1px); text-decoration: none; }
.dt-track { flex: none; width: 40px; min-height: 40px; border: 1.5px solid var(--p-line); border-radius: 10px; background: #fff; color: var(--p); cursor: pointer; transition: background .15s; }
.dt-track:hover { background: var(--p-soft); }

/* list layout */
.deals-grid.is-list { grid-template-columns: 1fr; }
.deals-grid.is-list .deal-tile { display: grid; grid-template-columns: 120px 1fr auto; grid-template-areas: "media body foot"; align-items: center; gap: 14px; padding: 10px 14px; }
.deals-grid.is-list .dt-top { position: static; margin: 0; padding: 0; height: 0; }
.deals-grid.is-list .deal-tile { position: relative; }
.dt-storeline { display: none; margin-bottom: 2px; font-size: 12px; font-weight: 700; color: var(--p); }
.deals-grid.is-list .dt-storeline { display: block; }
.deals-grid.is-list .dt-top .dt-badge { position: absolute; top: 14px; left: 14px; z-index: 2; }
.deals-grid.is-list .dt-top .dt-store { display: none; }
.deals-grid.is-list .dt-top .dt-fav { position: absolute; top: 8px; right: 8px; z-index: 2; }
.deals-grid.is-list .dt-media { grid-area: media; margin: 0; aspect-ratio: 1 / 1; }
.deals-grid.is-list .dt-body { grid-area: body; }
.deals-grid.is-list .dt-foot { grid-area: foot; min-width: 230px; margin: 0; padding: 0; border: none; }
@media (max-width: 700px) {
    .deals-grid.is-list .deal-tile { grid-template-columns: 90px 1fr; grid-template-areas: "media body" "foot foot"; }
    .deals-grid.is-list .dt-foot { min-width: 0; }
}

/* pager */
.deals-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--p-line-soft); font-size: 13px; color: var(--muted); }
.deals-pager b { color: var(--ink-2); }
.pg-nums { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pg-btn, .pg-num { min-width: 36px; min-height: 36px; padding: 0 12px; border: 1.5px solid var(--p-line); border-radius: 9px; background: #fff; color: var(--p-d); font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s; }
.pg-btn:hover:not(:disabled), .pg-num:hover { background: var(--p-soft); }
.pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.pg-num { padding: 0; }
.pg-num.on { background: var(--p); border-color: var(--p); color: #fff; }
.pg-gap { padding: 0 4px; color: #9a8fb0; }
.pg-per { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
@media (max-width: 640px) { .deals-pager { justify-content: center; } }

/* ---- demo-mode banner (sample page only) ---- */
.demo-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; padding: 10px 14px;
    font-size: 13px; line-height: 1.5; color: var(--ink-2); background: #fff8e1; border: 1px dashed #f0b429; border-radius: 12px;
}
.demo-banner .db-tag { flex: none; padding: 2px 9px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: #7a4b00; background: #ffe08a; border-radius: 999px; }
.demo-banner em { font-style: normal; font-weight: 700; color: var(--p-d); }
.demo-banner a { margin-left: auto; color: var(--p); font-weight: 700; white-space: nowrap; }

/* ============================================================
   Shell (from the Stitch design): sticky sub-nav + docked concierge bar,
   collapsible hub, floating mini-dock, richer results toolbar
   ============================================================ */
/* ---- sticky stack (sits under the fixed site header) ---- */
.jd-stack { position: sticky; top: 80px; z-index: 90; background: rgba(254,247,255,.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 1px 8px rgba(45,24,82,.07); }
.jd-subnav { border-bottom: 1px solid var(--p-line-soft); }
.sn-inner, .dock-inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sn-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; }
.sn-links { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.sn-links::-webkit-scrollbar { display: none; }
.sn-links a, .sn-links > .sn-wrap > button {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: none; border-radius: 9px; background: transparent; cursor: pointer;
    font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--muted); text-decoration: none; transition: background .15s, color .15s;
}
.sn-links a:hover, .sn-links > .sn-wrap > button:hover, .sn-links > .sn-wrap > button[aria-expanded=true] { background: var(--p-soft); color: var(--p-d); text-decoration: none; }
.sn-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; font-size: 11px; font-weight: 800; color: #fff; background: var(--coral); border-radius: 999px; }
.sn-wrap { position: relative; display: inline-block; }
.trend-menu {
    position: absolute; left: 0; top: calc(100% + 8px); z-index: 5; min-width: 240px; padding: 8px; display: none;
    background: #fff; border: 1px solid var(--p-line); border-radius: 14px; box-shadow: var(--shadow-2);
}
.trend-menu.open { display: block; animation: jdPopIn .16s ease both; }
.tm-title { padding: 6px 10px 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #9a8fb0; }
.tm-empty { padding: 10px; font-size: 13px; color: var(--muted); }
.tm-item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: none; border-radius: 9px; background: transparent; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); text-align: left; }
.tm-item b { padding: 1px 8px; font-size: 11.5px; color: var(--p-d); background: var(--p-soft); border-radius: 999px; }
.tm-item:hover, .tm-item.on { background: var(--p-soft); color: var(--p-d); }
.sn-right { display: flex; align-items: center; gap: 10px; flex: none; }
.cur-toggle { display: inline-flex; padding: 3px; background: var(--p-softer); border-radius: 999px; }
.cur-toggle button { padding: 4px 11px; border: none; border-radius: 999px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
.cur-toggle button.on { background: #fff; color: var(--p); box-shadow: 0 1px 4px rgba(74,39,130,.18); }
.ask-pill {
    position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: none; border-radius: 999px; cursor: pointer;
    font-size: 13.5px; font-weight: 700; color: var(--p-d); background: var(--p-soft); transition: background .15s, transform .15s;
}
.ask-pill .fa { color: var(--p); }
.ask-pill:hover { background: #ebdcff; transform: translateY(-1px); }
.ask-pill[aria-expanded=true] { background: var(--p); color: #fff; }
.ask-pill[aria-expanded=true] .fa { color: #fff; }
.ap-dot { position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; display: none; background: var(--coral); border: 2px solid #fff; border-radius: 50%; }
.ask-pill.has-unread .ap-dot { display: block; animation: jdPulse 1.6s infinite; }
.user-pill { display: inline-flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; border: none; border-radius: 999px; background: var(--p-softer); cursor: pointer; transition: background .15s; }
.user-pill:hover { background: var(--p-soft); }
.up-av { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; font-size: 12px; font-weight: 800; color: #fff; background: var(--p); border-radius: 50%; }
.up-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.up-txt b { font-size: 12.5px; color: var(--ink-2); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-txt small { font-size: 10.5px; color: var(--muted); }

/* ---- docked concierge bar ---- */
.jd-dock { padding: 8px 0 10px; }
.dock-inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
    padding: 9px 14px; color: #fff; background: var(--p-d); border-radius: 12px; box-shadow: 0 6px 16px -6px rgba(74,39,130,.55);
}
.jd-dock { padding-left: 16px; padding-right: 16px; }
.jd-dock .dock-inner { max-width: 1148px; padding-left: 14px; padding-right: 14px; }
.dock-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 260px; }
.dock-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; color: #6bf6ff; background: rgba(255,255,255,.14); border-radius: 8px; }
.dock-lbl { flex: none; font-size: 14px; font-weight: 800; }
.dock-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: #e4d2ff; }
.dock-txt b { color: #fff; }
.dock-n { color: #cdb4f5; }
.dock-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dock-chips { display: flex; gap: 6px; }
.dock-chips button {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: none; border-radius: 999px; cursor: pointer;
    font-size: 12px; font-weight: 700; color: #f1e6ff; background: rgba(255,255,255,.14); transition: background .15s;
}
.dock-chips button:hover { background: rgba(255,255,255,.26); }
.dock-chips button.on { color: var(--p-d); background: #fff; }
.dock-chips .dc-i { font-size: 10px; }
.dock-toggle {
    display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border: none; border-radius: 9px; cursor: pointer;
    font-size: 12.5px; font-weight: 800; color: #fff; background: var(--coral); box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: background .15s, transform .15s;
}
.dock-toggle:hover { background: var(--coral-d); transform: translateY(-1px); }

/* ---- collapsible hub (animated) ---- */
.concierge-hub {
    display: grid; grid-template-rows: 1fr; opacity: 1; margin-bottom: 0;
    transition: grid-template-rows .55s cubic-bezier(.22,.8,.3,1), opacity .4s ease, visibility 0s linear 0s;
}
.concierge-hub > .concierge-inner { min-height: 0; overflow: hidden; }
.concierge-hub.is-collapsed { grid-template-rows: 0fr; opacity: 0; visibility: hidden; pointer-events: none; transition: grid-template-rows .55s cubic-bezier(.22,.8,.3,1), opacity .35s ease, visibility 0s linear .55s; }
/* give card shadows room while open, but clip while animating */
.concierge-hub:not(.is-collapsed) > .concierge-inner { padding: 4px 4px 0; margin: -4px -4px 0; }
@media (prefers-reduced-motion: reduce) { .concierge-hub, .concierge-hub.is-collapsed { transition: none !important; } }

.hub-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 0 0 14px; }
.hub-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hub-status .ai-tag { margin-left: 0; }
.hub-sub { font-size: 13px; color: var(--muted); }
.hub-hide { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border: none; background: none; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--p); }
.hub-hide:hover { color: var(--p-d); text-decoration: underline; }

/* ---- floating Ask JD button (compact circle, like the site's Ask JD widget) ---- */
.float-dock {
    position: fixed; right: 22px; bottom: 22px; z-index: 95; width: 56px; height: 56px; padding: 0;
    display: flex; align-items: center; justify-content: center; border: none; border-radius: 50%; cursor: pointer;
    color: #fff; font-size: 22px; background: linear-gradient(135deg, var(--p) 0%, var(--p-d) 100%);
    box-shadow: 0 8px 22px rgba(74,39,130,.45);
    opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; transition: opacity .25s, transform .2s, box-shadow .2s;
}
.float-dock.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.float-dock:hover { transform: scale(1.08); box-shadow: 0 10px 26px rgba(74,39,130,.55); }
.float-dock:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--p); }
.fd-badge {
    position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; line-height: 1; color: #fff; background: var(--coral); border: 2px solid #fff; border-radius: 999px;
}

/* ---- results toolbar (Stitch layout) ---- */
.deals-toolbar { display: block; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--p-line-soft); scroll-margin-top: 190px; }
.dt-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; }
.dt-head h3 { margin: 0; }
.dt-updated { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.dt-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.dt-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.filter-chip .fa-times { font-size: 10px; opacity: .85; }
.deep-btn {
    display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 14px; cursor: pointer;
    font-size: 13px; font-weight: 700; color: var(--p-d); background: #fff; border: 1.5px solid var(--p); border-radius: 9px; transition: background .15s, color .15s;
}
.deep-btn:hover { background: var(--p); color: #fff; }
.deals-section { scroll-margin-top: 190px; }

/* ---- responsive shell ---- */
@media (max-width: 900px) {
    .dock-chips { display: none; }
    .up-txt { display: none; }
    .user-pill { padding: 4px; }
}
@media (max-width: 640px) {
    .jd-stack { top: 70px; }
    .sn-inner { gap: 8px; padding: 0 10px; }
    .cur-toggle { display: none; }
    .dock-txt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    #toggleLabel { display: none; }
    .float-dock { right: 14px; bottom: 14px; width: 52px; height: 52px; }
}
