/* Assistant v3 — the answer in the AI dock (Components/Ambient/AssistantAnswerView.razor), the
   port of the app's components/v2/ai/v3/{AnswerV3,Blocks}.tsx. Tokens from css/base.css only.
   The dock's own chrome (surface, wine cards .amb-wine*) lives in AmbientDock.razor. */

.as3 { display: flex; flex-direction: column; gap: 14px; }

/* ── While it streams ── */
.as3-status { display: flex; flex-direction: column; gap: 6px; }
.as3-progress { position: relative; display: block; height: 3px; border-radius: 3px; overflow: hidden; background: var(--color-brand-soft); }
.as3-progress > span {
    position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; border-radius: 3px;
    background: var(--color-brand); animation: as3-slide 1.3s ease-in-out infinite;
}
@keyframes as3-slide { 0% { left: -40%; } 100% { left: 100%; } }
.as3-status-text { font-size: 0.78rem; color: var(--color-muted); font-family: var(--font-body); }

.as3-skeleton { border-radius: 14px; background: var(--color-stone); animation: as3-pulse 1.4s ease-in-out infinite; }
@keyframes as3-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.as3-skeleton--story { height: 72px; }
.as3-skeleton--wine_hero { height: 128px; }
.as3-skeleton--wine_list { height: 150px; }
.as3-skeleton--glance { height: 150px; }
.as3-skeleton--chart { height: 120px; }
.as3-skeleton--stats { height: 56px; }
.as3-skeleton--compare { height: 160px; }
.as3-skeleton--taste { height: 96px; }
.as3-skeleton--actions { height: 40px; }

@media (prefers-reduced-motion: reduce) {
    .as3-progress > span, .as3-skeleton { animation: none; }
    .as3-progress > span { left: 0; width: 100%; opacity: 0.4; }
}

/* ── Text ── */
.as3-headline { margin: 0; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.25; font-weight: 600; color: var(--color-dark-text); }
.as3-message { margin: 0; font-size: 0.95rem; line-height: 1.5; color: var(--color-dark-text); }

.as3-story { display: flex; flex-direction: column; gap: 10px; }
.as3-story-text { margin: 0; font-size: 0.97rem; line-height: 1.55; color: var(--color-dark-text); white-space: pre-line; }
.as3-cite {
    display: inline; padding: 0 1px; border: none; background: none; cursor: pointer;
    font: inherit; font-size: 0.9em; font-weight: 700; color: var(--color-brand); text-decoration: none;
}
.as3-cite.on { text-decoration: underline; }
.as3-cite:focus-visible, .as3-source:focus-visible, .as3-chip:focus-visible, .as3-action:focus-visible {
    outline: 2px solid var(--color-brand); outline-offset: 2px;
}
.as3-sources { display: flex; flex-wrap: wrap; gap: 6px; }
.as3-source {
    display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
    padding: 4px 10px; border: 1px solid transparent; border-radius: 999px; background: var(--color-stone);
    font-family: var(--font-body); font-size: 0.74rem; color: var(--color-muted); text-decoration: none; cursor: pointer;
}
.as3-source.on { border-color: var(--color-brand); }
.as3-source.as3-plain { cursor: default; }
.as3-source-n { font-weight: 700; color: var(--color-brand); }
.as3-source-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as3-credit { margin: 0; font-size: 0.68rem; line-height: 1.4; color: var(--color-muted); }

/* A footnote's evidence: its glance square, opened, under the text. */
.as3-evidence { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--color-line); border-radius: 16px; background: var(--color-card-bg); }
.as3-evidence-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.as3-evidence-kicker { font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 700; color: var(--color-muted); }
.as3-evidence-title { font-size: 0.92rem; font-weight: 600; color: var(--color-dark-text); }
.as3-link { align-self: flex-start; font-size: 0.85rem; font-weight: 600; color: var(--color-brand); text-decoration: none; }
.as3-link:hover { text-decoration: underline; }

/* ── The wine ── */
.as3-hero {
    display: flex; gap: 14px; padding: 14px; border: 1px solid var(--color-line); border-radius: var(--radius-plinth);
    background: var(--color-mist); color: inherit; text-decoration: none;
}
a.as3-hero:hover { border-color: var(--color-line-strong); }
.as3-hero-media { flex: 0 0 72px; display: flex; align-items: center; justify-content: center; }
.as3-hero-bottle { height: 120px; width: auto; display: block; }
.as3-hero-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.as3-hero-producer { font-size: 0.7rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--color-muted); }
.as3-hero-name { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.25; font-weight: 600; color: var(--color-dark-text); }
.as3-hero-meta { font-size: 0.8rem; color: var(--color-muted); margin-bottom: 4px; }
.as3-hero-line { font-size: 0.8rem; color: var(--color-muted); }
.as3-hero-line--strong { font-weight: 600; color: var(--color-brand); }
.as3-hero-reason { margin: 6px 0 0; font-size: 0.88rem; line-height: 1.45; color: var(--color-dark-text); }

.as3-section { display: flex; flex-direction: column; gap: 8px; }
.as3-section-title { margin: 0; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: var(--color-muted); }
.amb-wine-where { color: var(--color-brand); font-weight: 600; }

.as3-glance { min-width: 0; }

/* ── Data ── */
.as3-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.as3-bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.as3-bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.as3-bar { width: 100%; border-radius: 3px; background: var(--color-line-strong); }
.as3-bar-value, .as3-bar-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.6rem; color: var(--color-muted); }
.as3-bar-col.on .as3-bar { background: var(--color-brand); }
.as3-bar-col.on .as3-bar-value, .as3-bar-col.on .as3-bar-label { font-weight: 700; color: var(--color-brand); }

.as3-stats { display: flex; gap: 8px; }
.as3-stat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: var(--color-stone); }
.as3-stat-value { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--color-dark-text); }
.as3-stat-label { font-size: 0.7rem; color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.as3-compare { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.as3-compare table { border-collapse: collapse; min-width: 100%; }
.as3-compare th, .as3-compare td { padding: 8px 10px 8px 0; text-align: left; vertical-align: top; font-size: 0.8rem; }
.as3-compare thead th { min-width: 140px; }
.as3-compare thead th:first-child { min-width: 88px; }
.as3-compare tbody th { font-weight: 400; color: var(--color-muted); white-space: nowrap; }
.as3-compare tbody td { color: var(--color-dark-text); }
.as3-compare tbody tr { border-top: 1px solid var(--color-line); }
.as3-compare-head { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.as3-compare-accent { width: 28px; height: 4px; border-radius: 2px; margin-bottom: 4px; }
.as3-compare-producer { font-size: 0.68rem; font-weight: 400; color: var(--color-muted); }
.as3-compare-name { font-size: 0.86rem; line-height: 1.25; font-weight: 700; color: var(--color-dark-text); }
.as3-compare-pick { font-size: 0.68rem; font-weight: 700; color: var(--color-brand); }

.as3-taste { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: var(--color-stone); }
.as3-taste-text { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--color-dark-text); }
.as3-taste-stated { margin: 0; font-size: 0.8rem; line-height: 1.45; color: var(--color-muted); }
.as3-notes { display: flex; flex-wrap: wrap; gap: 6px; }
.as3-note { padding: 4px 9px; border: 1px solid var(--color-line); border-radius: 999px; background: var(--color-card-bg); font-size: 0.76rem; color: var(--color-muted); }

/* ── Buttons, follow-ups ── */
.as3-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.as3-action {
    display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px;
    border: 1px solid var(--color-line-strong); border-radius: 999px; background: var(--color-card-bg);
    font-family: var(--font-body); font-size: 0.84rem; font-weight: 600; color: var(--color-brand);
    text-decoration: none; cursor: pointer;
}
.as3-action:hover { background: var(--color-brand-soft); }
.as3-action:disabled { cursor: default; opacity: 0.7; background: var(--color-brand-soft); }

.as3-remembered { margin: 0; font-size: 0.78rem; color: var(--color-muted); }

.as3-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.as3-chip {
    padding: 7px 12px; border: none; border-radius: 999px; background: var(--color-brand-soft);
    font-family: var(--font-body); font-size: 0.82rem; color: var(--color-brand); cursor: pointer; text-align: left;
}
.as3-chip:hover { background: var(--color-line-strong); }
