/* Structured product cards and report views. Page layout: conversation.css. */
.product-cards { display: grid; gap: 8px; width: 304px; max-width: 100%; }
.product-card { min-width: 0; background: #fafafa; border: 1px solid #e9e9eb; border-radius: 12px; overflow: hidden; }
.product-main { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.product-image { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 6px; background: #f0f0f2; overflow: hidden; flex: 0 0 52px; }
.product-image-placeholder { position: absolute; color: #a8a8b0; font-size: 13px; letter-spacing: 2px; }
.product-image img { position: relative; width: 100%; height: 100%; object-fit: contain; color: #82917f; font-size: 10px; background: #f1f1f3; }
.product-overview { flex: 1; min-width: 0; }
.product-number { position: absolute; top: 6px; left: 10px; color: #92929c; font-size: 9px; font-variant-numeric: tabular-nums; line-height: 20px; }
.product-number::before { content: '#'; }
.platform-tag, .coupon-tag { font-size: 10px; color: #74747d; background: #efeff2; border-radius: 4px; padding: 2px 5px; line-height: 1.6; white-space: nowrap; }
.coupon-tag { background: transparent; padding-right: 0; }
.coupon-tag.has-coupon { color: #ad572b; background: #fff0e5; padding: 1px 5px; }
.product-title { font-size: 13px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.product-tags { position: absolute; top: 6px; left: 33px; max-width: calc(100% - 94px); display: flex; gap: 5px; align-items: center; pointer-events: none; }
.product-tags .coupon-tag { overflow: hidden; text-overflow: ellipsis; }
.product-reason { margin-top: 4px; color: #90909a; font-size: 10px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-facts > div { display: flex; gap: 12px; align-items: baseline; min-width: 0; }
.product-footer { display: flex; align-items: baseline; margin-top: 7px; }
.product-price-block { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 6px; }
.product-price { font-size: 20px; color: #ce6647; font-weight: 650; letter-spacing: -.5px; font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: anywhere; }
.product-price small { font-size: 12px; font-weight: 500; margin-right: 2px; }
.price-caption { font-size: 9px; color: #90909a; line-height: 1.6; }
.product-original-price { color: #90909a; font-size: 10px; line-height: 1.6; white-space: nowrap; font-variant-numeric: tabular-nums; }
.product-price-note { color: #946c46; font-size: 10px; line-height: 1.5; margin-top: 3px; }
.product-unit-price { color: #84623f; font-size: 11px; line-height: 1.5; margin: 3px 0 0; font-variant-numeric: tabular-nums; }
.product-unit-price.is-unknown { color: #90909a; font-size: 10px; }
.price-unknown { color: #80808a; font-size: 14px; }
.product-link { display: block; padding: 10px 10px 8px; color: var(--ink); border-radius: 11px 11px 0 0; }
a.product-link:hover { background: #f4f4f6; }
.product-link:focus-visible { outline-offset: -3px; }
.link-unavailable { display: block; margin-top: 4px; font-size: 10px; color: #9999a2; }
.product-bottom { position: relative; border-top: 1px solid #ebebef; }
.product-bottom .reply-details { margin: 0; padding: 0 10px; border: 0; font-size: 10px; }
.product-bottom .reply-details > summary { text-align: right; list-style-position: inside; min-height: 32px; padding: 6px 0 6px 36px; line-height: 20px; }
.product-bottom .detail-sections { padding-top: 5px; }
.reply-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(135px, 100%), 1fr)); gap: 9px; margin: 12px 0; }
.metric-card { padding: 16px; background: #f7f7f9; border: 1px solid #e9e9ee; border-radius: 12px; min-width: 0; }
.metric-label { display: block; color: #85858f; font-size: 11px; }
.metric-value { display: block; color: #363640; font-size: 23px; font-weight: 600; letter-spacing: -.5px; line-height: 1.5; margin-top: 4px; overflow-wrap: anywhere; }
.table-scroll { max-width: 100%; min-width: 0; max-height: 380px; overflow: auto; margin: 12px 0; border: 1px solid var(--border); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.report-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.8; text-align: left; }
.report-table th { position: sticky; top: 0; color: #85858f; background: #f8f8fa; font-size: 11px; font-weight: 500; white-space: nowrap; }
.report-table td, .report-table th { padding: 11px 14px; min-width: 82px; vertical-align: top; }
.report-table td { border-top: 1px solid #ededf0; max-width: 280px; overflow-wrap: anywhere; }
.reply-budget_list .reply-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reply-budget_list .metric-card { padding: 12px; background: #fff7ed; border-color: #fae9d6; }
.reply-budget_list .product-cards { margin-top: 16px; }
.budget-retry { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.budget-retry small { color: #85858f; font-size: 12px; }
.preference-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 600px) {
  .reply-budget_list .table-scroll { border: 0; background: transparent; max-height: none; overflow: visible; }
  .reply-budget_list .report-table thead { display: none; }
  .reply-budget_list .report-table, .reply-budget_list .report-table tbody { display: block; }
  .reply-budget_list .report-table tr { display: block; margin: 8px 0; padding: 9px 12px; border: 1px solid #e9e9ee; border-radius: 12px; background: #fff; }
  .reply-budget_list .report-table td { display: flex; justify-content: space-between; gap: 12px; min-width: 0; max-width: none; border: 0; padding: 3px 0; text-align: right; }
  .reply-budget_list .report-table td::before { content: attr(data-label); flex: 0 0 5em; color: #85858f; text-align: left; }
  .reply-budget_list .report-table td:last-child { display: block; text-align: left; padding-top: 6px; margin-top: 4px; border-top: 1px solid #ededf0; }
  .reply-budget_list .report-table td:last-child::before { display: block; margin-bottom: 3px; }
}
.reply-facts { display: grid; gap: 10px; margin: 12px 0; padding: 16px; border-radius: 12px; background: #fafafa; border: 1px solid #ededf0; font-size: 13px; }
.reply-facts dt { color: #85858f; min-width: 5em; max-width: 8em; flex-shrink: 0; }
.reply-facts dd { color: #494951; margin: 0; min-width: 0; }
.reply-details { margin-top: 10px; border-top: 1px solid #ededf0; font-size: 12px; color: #85858f; }
.reply-details > summary { min-height: 44px; padding: 11px 0; cursor: pointer; color: #85858f; line-height: 1.8; }
.reply-details[open] > summary { color: #3d3d48; }
.detail-sections { padding: 0 0 3px; }
.detail-heading { color: #646471; font-size: 11px; font-weight: 600; margin-bottom: 5px; }
.detail-section + .detail-section { margin-top: 14px; }
.detail-items { margin: 0 0 12px; padding-left: 19px; display: grid; gap: 7px; color: #74747e; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-notice { margin-top: 12px; color: #9999a3; font-size: 11px; line-height: 1.8; }

/* Small portraits stay lightweight. Large characters have a transparent full-body stage. */
.mascot { display: inline-block; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background-color: #fff1e5; background-image: url("/static/brand/nezha-shop-avatar.webp?v=2"); background-size: cover; background-position: center; background-repeat: no-repeat; transform-origin: 50% 75%; animation: mascot-breathe 4.5s ease-in-out infinite; }
.mascot[data-state="listening"] { animation: mascot-listen 3.8s ease-in-out infinite; }
.mascot[data-state="thinking"] { animation: mascot-think 2.8s ease-in-out infinite; }
.mascot[data-state="speaking"] { animation: mascot-breathe 3.8s ease-in-out infinite; }
@keyframes mascot-breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.012); } }
@keyframes mascot-listen { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(-5deg) translateY(-2px); } }
@keyframes mascot-think { 0%, 100% { transform: rotate(0); } 45% { transform: rotate(3deg) translateY(-3px); } 75% { transform: rotate(-1deg); } }
.sidebar-mascot { width: 28px; height: 28px; flex-basis: 28px; }
.sidebar-brand { font-size: 16px; gap: 8px; padding-left: 5px; }
.header-left { flex: 1; min-width: 0; }
.feedback-card { margin: 12px 0; border: 1px solid #ebe7e4; border-radius: 16px; padding: 16px; background: #fff; }
.feedback-card > strong { font-size: 14px; }
.feedback-card > p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.9; margin: 10px 0; }
.feedback-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.product-feedback-note { color: #95613c; background: #fff5e9; border-radius: 8px; padding: 7px 9px; font-size: 11px; line-height: 1.6; margin: 8px 0 0; overflow-wrap: anywhere; }
.product-comparison { margin: 14px 0 18px; padding: 14px; background: #fff; border: 1px solid #e9e7e4; border-radius: 18px; min-width: 0; }
.product-comparison h3 { font-size: 16px; margin: 0 0 10px; }
.difference-products { padding-bottom: 10px; font-size: 12px; line-height: 1.6; }
.difference-products p { margin: 5px 0; overflow-wrap: anywhere; }
.difference-products small { color: #787782; }
.difference-row { border-top: 1px solid #ecebef; padding: 12px 0; }
.difference-heading { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 8px; }
.difference-badge { flex-shrink: 0; border-radius: 5px; padding: 1px 6px; background: #f1f0f4; color: #646170; font-size: 11px; }
.difference-different .difference-badge { background: #fff0e4; color: #a54314; }
.difference-conflict .difference-badge { background: #fff0ee; color: #b43732; }
.difference-same .difference-badge { background: #edf7f0; color: #35754a; }
.difference-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.difference-cell { min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.difference-cell strong { font-size: 13px; font-weight: 500; line-height: 1.6; white-space: pre-wrap; }
.difference-number, .difference-cell small { font-size: 11px; color: #7a7885; line-height: 1.5; }
.difference-notice { font-size: 11px; color: #797681; line-height: 1.7; margin: 10px 0 0; }
.product-comparison details > summary { cursor: pointer; padding: 10px 0; color: #6d6575; font-size: 12px; }
.comparison-action { margin: 4px 0 12px; }
.header-titles { min-width: 0; }
.conversation-title { display: block; max-width: 100%; }
.header-subtitle { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.start-voice-call { color: #474650; }
.mascot.mascot-3d { position: relative; display: block; width: 100%; height: 100%; flex: none; overflow: visible; border-radius: 0; background: none; box-shadow: none; animation: none; transform: none; isolation: isolate; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: pan-y pinch-zoom; }
.mascot-3d:focus-visible { outline: 2px solid #c18a69; outline-offset: 2px; border-radius: 16px; }
.mascot-3d > .mascot-fallback { position: absolute; inset: 0; display: block; background: url("/static/brand/nezha-shop-poster.webp?v=2") center / contain no-repeat; transform-origin: 50% 90%; animation: none; }
.mascot-3d[data-renderer="ready"] > .mascot-fallback { visibility: hidden; }
.mascot-3d[data-state="listening"] > .mascot-fallback { animation: none; }
.mascot-3d[data-state="thinking"] > .mascot-fallback { animation: none; }
.mascot-3d[data-greeting="true"] > .mascot-fallback { animation: mascot-body-greet .7s ease-in-out 2; }
@keyframes mascot-body-greet { 0%, 100% { filter:brightness(1); } 50% { filter:brightness(1.08); } }
.welcome-card { max-width: 590px; margin-top: clamp(2px, 1.5vh, 18px); padding-bottom: 8px; }
.welcome-avatar-stage { display: grid; place-items: center; width: min(270px, 100%); height: 250px; margin: 0 auto 3px; }
.welcome-card > .welcome-eyebrow { color: #aa7960; font-size: 11px; letter-spacing: 2px; margin: 0 0 5px; }
.welcome-title { font-size: clamp(24px, 3vw, 29px); letter-spacing: -.7px; line-height: 1.4; }
.welcome-card > .welcome-description { color: #84848f; line-height: 1.7; font-size: 13px; white-space: pre-line; margin-top: 7px; }
.welcome-card .example-queries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 410px; margin: 16px auto 0; }
.welcome-card .prompt-chip { min-width: 0; min-height: 48px; border: 1px solid #efeff2; border-radius: 14px; justify-content: flex-start; padding: 11px 15px; background: #fafafb; font-size: 12px; gap: 10px; }
.welcome-card .prompt-chip:hover { background: #fff5ed; border-color: #f2e4d8; }
.welcome-card .prompt-chip .ui-icon { color: #ab8068; flex-shrink: 0; }

/* A real call controller opens this dialog and updates its state/subtitles. */
.voice-call-dialog { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; width: 100%; height: 100vh; height: var(--app-height, 100dvh); min-width: 0; overflow: hidden; color: #f7f4f0; background: radial-gradient(ellipse at 50% 34%, #48313488 0, #1d1d2980 35%, transparent 64%), #13151c; color-scheme: dark; }
.voice-call-dialog[hidden] { display: none !important; }
.call-header { flex: 0 0 auto; padding: max(26px, env(safe-area-inset-top)) 24px 8px; text-align: center; }
.call-eyebrow { color: #9794a4; font-size: 11px; letter-spacing: 3px; margin-bottom: 9px; }
.call-header h2 { color: #f5f1ed; font-size: 22px; font-weight: 500; letter-spacing: 1px; line-height: 1.5; }
.call-duration { display: block; min-height: 22px; margin-top: 5px; color: #b1a9b3; font-size: 12px; line-height: 22px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.call-content { flex: 1 1 auto; min-height: 0; min-width: 0; width: min(100%, 630px); margin: 0 auto; padding: 0 28px 16px; overflow-x: hidden; overflow-y: auto; text-align: center; scrollbar-width: thin; scrollbar-color: #ffffff25 transparent; -webkit-overflow-scrolling: touch; }
.call-avatar-stage { display: grid; place-items: center; width: min(340px, 100%); height: clamp(260px, 39vh, 320px); height: clamp(260px, 39dvh, 320px); margin: 0 auto; }
.call-status { min-height: 30px; margin: 3px 0 16px; color: #e3d2c9; font-size: 16px; line-height: 1.8; }
.call-captions { display: grid; gap: 16px; max-width: 500px; margin: 0 auto; text-align: left; }
.call-caption { min-width: 0; }
.call-caption-label { display: block; color: #9d91a3; font-size: 10px; margin-bottom: 5px; }
.call-caption-text { color: #ece6ed; font-size: 15px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.call-caption-user .call-caption-text { color: #aba3b2; font-size: 13px; }
.call-caption-text:empty { display: none; }
.call-caption:has(.call-caption-text:empty) { display: none; }
.call-footer { flex: 0 0 auto; padding: 8px 24px max(24px, env(safe-area-inset-bottom)); text-align: center; }
.call-controls { display: flex; justify-content: center; gap: 24px; width: 100%; }
.call-control { display: flex; flex-direction: column; align-items: center; gap: 11px; width: 76px; min-width: 0; min-height: 94px; padding: 0 0 8px; color: #d5cfd9; font-size: 12px; border-radius: 18px; }
.call-control:hover { background: transparent; color: #fff; }
.call-control-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; color: #e3dce6; background: #ffffff10; border: 1px solid #ffffff08; transition: background .15s; }
.call-control:hover .call-control-icon { background: #ffffff1e; }
.call-control .ui-icon { width: 23px; height: 23px; }
.call-control[aria-pressed="true"] .call-control-icon { background: #e8e1e8; color: #29232d; }
.call-control-hangup .call-control-icon { background: #e45159; color: #fff; border-color: transparent; }
.call-control-hangup:hover .call-control-icon { background: #f0646b; }
.call-return-hint { color: #8d8595; font-size: 11px; line-height: 1.7; margin: 12px auto 0; }
.call-retry { display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin: 0 auto 16px; padding: 9px 19px; border: 1px solid #f0c3a944; border-radius: 22px; color: #edc6ad; background: #ffffff08; font-size: 13px; }
.call-retry:hover { background: #ffffff14; }
.voice-call-dialog :focus-visible { outline: 2px solid #f1c09f; outline-offset: 5px; }
@media (max-width: 767px) {
  .app-header { gap: 3px; }
  .header-left { gap: 6px; }
  .header-actions { gap: 0; }
  .mascot.assistant-avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .header-titles { flex: 1; }
  .header-titles .conversation-title { font-size: 14px; max-width: 100%; }
  .header-subtitle { font-size: 9px; }
  .welcome-card { margin-top: 2px; }
  .welcome-avatar-stage { width: min(260px, 100%); height: 240px; margin-bottom: 3px; }
  .welcome-title { font-size: 25px; }
  .welcome-card > .welcome-description { font-size: 12px; }
  .welcome-card .example-queries { margin-top: 14px; gap: 8px; }
  .welcome-card .prompt-chip { padding: 10px 12px; min-height: 46px; }
  .call-header { padding-top: max(22px, env(safe-area-inset-top)); }
  .call-header h2 { font-size: 21px; }
  .call-content { padding: 0 20px 14px; }
  .call-avatar-stage { width: min(320px, 100%); }
  .call-status { margin-top: 3px; margin-bottom: 14px; font-size: 15px; }
  .call-controls { gap: 20px; }
  .call-control { width: 70px; }
  .call-control-icon { width: 58px; height: 58px; }
}
@media (max-width: 359px) {
  .app-header { padding-left: 5px; padding-right: 5px; }
  .header-left { gap: 4px; }
  .header-titles .conversation-title { font-size: 13px; }
  .header-subtitle { font-size: 8px; }
  .welcome-card .prompt-chip { font-size: 11px; padding-left: 10px; gap: 7px; }
  .welcome-title { font-size: 24px; }
  .call-controls { gap: 16px; }
  .call-control { width: 65px; }
  .call-content { padding-left: 20px; padding-right: 20px; }
  .call-caption-text { font-size: 14px; }
}
@media (max-height: 620px) {
  .welcome-avatar-stage { width: 190px; height: 158px; margin-bottom: 0; }
  .welcome-card { margin-top: 0; margin-bottom: 8px; }
  .welcome-card > .welcome-eyebrow { display: none; }
  .welcome-title { font-size: 23px; }
  .welcome-card > .welcome-description { margin-top: 4px; font-size: 11px; }
  .welcome-card .example-queries { margin-top: 10px; gap: 6px; }
  .welcome-card .prompt-chip { min-height: 40px; padding: 8px 10px; }
  .call-header { padding-top: max(10px, env(safe-area-inset-top)); }
  .call-eyebrow { margin-bottom: 3px; }
  .call-avatar-stage { width: min(260px, 100%); height: clamp(170px, 37vh, 225px); height: clamp(170px, 37dvh, 225px); }
  .call-status { margin-top: 3px; margin-bottom: 10px; }
  .call-footer { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .call-controls { gap: 20px; }
  .call-control { min-height: 79px; gap: 7px; }
  .call-control-icon { width: 50px; height: 50px; }
  .call-return-hint { margin-top: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot, .mascot[data-state] { animation: none !important; transform: none !important; background-position: 0% 0% !important; }
  .mascot-3d > .mascot-fallback { animation: none !important; transform: none !important; }
}
.advisor-blocks { display: grid; gap: 10px; margin: 14px 0; min-width: 0; }
.advisor-block, .advisor-message { background: #fff; border: 1px solid #e7e7ef; border-radius: 16px; padding: 14px; min-width: 0; }
.advisor-block h4 { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.advisor-block-text, .advisor-copy-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: 14px; line-height: 1.8; }
.advisor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.advisor-actions .quick-action { white-space: normal; text-align: left; max-width: 100%; }
.advisor-message { background: #fff9f3; margin: 12px 0; }
.advisor-message .quick-action { margin-top: 10px; }
.quick-action.shortcut-unavailable { opacity: .58; border-style: dashed; }
.quick-action.shortcut-unavailable:hover { opacity: .8; }
