/* Asset-reference generation uses the existing shell palette, isolated from storyboard layout. */
.avw { color: var(--shell-text); font-size: 14px; line-height: 1.55; }
.avw *, .avw *::before, .avw *::after { box-sizing: border-box; }
.avw h2, .avw h3, .avw p, .avw figure { margin: 0; }
.avw h2 { font-size: 20px; font-weight: 700; text-wrap: balance; }
.avw h3 { font-size: 14px; font-weight: 650; }
.avw-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0 16px; }
.avw-heading p { color: var(--shell-muted); margin-top: 4px; }
.avw-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avw button, .avw select, .avw textarea { font: inherit; }
.avw button, .avw select { min-height: 44px; }
.avw button { cursor: pointer; }
.avw button:disabled { cursor: not-allowed; opacity: .55; }
.avw button:focus-visible, .avw textarea:focus-visible, .avw select:focus-visible, .avw input:focus-visible, .avw summary:focus-visible { outline: 2px solid var(--shell-accent); outline-offset: 3px; }
.avw button.secondary { background: var(--shell-panel-2); color: var(--shell-text); border: 1px solid color-mix(in srgb, var(--shell-text) 16%, transparent); border-radius: 8px; padding: 8px 12px; box-shadow: none; }
.avw button.primary { background: var(--shell-accent); color: var(--shell-accent-ink); border: 1px solid transparent; border-radius: 8px; padding: 8px 16px; font-weight: 700; box-shadow: none; }
.avw button.secondary:hover { border-color: var(--shell-accent); }
.avw-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 20px; align-items: start; }
.avw-sources { position: sticky; top: 16px; max-height: calc(100dvh - 48px); overflow-y: auto; padding: 16px; background: var(--shell-panel); border: 1px solid color-mix(in srgb, var(--shell-text) 10%, transparent); border-radius: 12px; }
.avw label { display: block; color: var(--shell-text); font-weight: 600; }
.avw select { display: block; width: 100%; margin-top: 8px; padding: 8px; border: 1px solid color-mix(in srgb, var(--shell-text) 18%, transparent); border-radius: 8px; background: var(--shell-panel-2); color: var(--shell-text); }
.avw-sources .avw-note { margin: 12px 0; }
.avw .avw-sources > [data-avw-batch] { width: 100%; margin-top: 10px; padding-inline: 6px; font-weight: 650; }
.avw .avw-sources > [data-avw-batch]:not(:disabled) { border-color: color-mix(in srgb, var(--shell-accent) 45%, transparent); }
.avw-sources nav { display: grid; gap: 6px; }
.avw .avw-segment { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--shell-text); min-width: 0; }
.avw-segment span, .avw-segment small { color: var(--shell-muted); font-size: 12px; font-weight: 400; }
.avw-segment-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.avw-segment-line > span { min-width: 0; }
.avw-segment-state { flex-shrink: 0; padding: 2px 6px; border: 1px solid color-mix(in srgb, var(--shell-text) 18%, transparent); border-radius: 999px; color: var(--shell-muted); font-size: 10px; font-style: normal; font-weight: 650; line-height: 1.4; }
.avw-segment-state[data-state="ready"] { color: var(--shell-success); border-color: color-mix(in srgb, var(--shell-success) 38%, transparent); }
.avw-segment-state[data-state="failed"], .avw-segment-state[data-state="error"] { color: var(--shell-danger); border-color: color-mix(in srgb, var(--shell-danger) 38%, transparent); }
.avw-segment-state[data-state="outdated"], .avw-segment-state[data-state="incomplete"], .avw-segment-state[data-state="unknown"] { color: var(--shell-warning); border-color: color-mix(in srgb, var(--shell-warning) 38%, transparent); }
.avw-segment-state[data-state="loading"], .avw-segment-state[data-state="running"], .avw-segment-state[data-state="pending_confirmation"] { color: var(--shell-accent); border-color: color-mix(in srgb, var(--shell-accent) 38%, transparent); }
.avw-segment strong { font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.avw-segment small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.avw .avw-segment.is-selected { border-color: var(--shell-accent); background: color-mix(in srgb, var(--shell-accent) 9%, transparent); }
.avw-segment.is-selected span { color: var(--shell-accent); }
.avw-work { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 16px; align-items: start; min-width: 0; }
.avw-edit-column { display: grid; gap: 16px; min-width: 0; }
.avw-prompt-section, .avw-references, .avw-source, .avw-advanced, .avw-summary { padding: 18px; background: var(--shell-panel); border: 1px solid color-mix(in srgb, var(--shell-text) 10%, transparent); border-radius: 12px; min-width: 0; }
.avw summary { min-height: 44px; display: list-item; align-content: center; cursor: pointer; font-weight: 600; }
.avw-source, .avw-advanced { padding-block: 8px; }
.avw summary span { color: var(--shell-muted); margin-left: 8px; font-size: 12px; font-weight: 400; }
.avw pre { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 12px; margin: 0 0 12px; }
.avw-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.avw-section-head label, .avw-section-head h3 { font-size: 15px; }
.avw-section-head label span, .avw-section-head h3 span { font-size: 12px; color: var(--shell-muted); font-weight: 400; margin-left: 4px; }
.avw-note { color: var(--shell-muted); font-size: 12px; line-height: 1.65; text-wrap: pretty; }
.avw textarea { width: 100%; resize: vertical; padding: 14px; border: 1px solid color-mix(in srgb, var(--shell-text) 18%, transparent); background: var(--shell-bg); color: var(--shell-text); border-radius: 8px; line-height: 1.8; margin-top: 12px; min-height: 140px; }
.avw #avw-prompt { height: clamp(560px, 65dvh, 820px); min-height: 560px; font-size: 15px; }
.avw-save-line { display: flex; justify-content: space-between; gap: 12px; color: var(--shell-muted); font-size: 12px; margin-top: 6px; }
.avw-save-line > :last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.avw-ref-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; margin-top: 14px; }
.avw-ref { min-width: 0; }
.avw-ref > div { height: 80px; display: grid; place-items: center; overflow: hidden; background: var(--shell-bg); border: 1px solid color-mix(in srgb, var(--shell-text) 10%, transparent); border-radius: 8px; }
.avw-ref img { width: 100%; height: 80px; object-fit: contain; }
.avw-ref img[hidden] { display: none; }
.avw-ref-missing { color: var(--shell-warning); padding: 10px; font-size: 12px; text-align: center; }
.avw-ref figcaption { display: grid; gap: 2px; padding-top: 6px; }
.avw-ref strong { font-size: 12px; overflow-wrap: anywhere; }
.avw-ref figcaption span { font-size: 12px; color: var(--shell-muted); }
.avw-reference-picker { border-top: 1px solid color-mix(in srgb, var(--shell-text) 10%, transparent); margin-top: 16px; padding-top: 4px; }
.avw-reference-picker > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px 0; }
.avw .avw-asset-choice { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px; background: var(--shell-panel-2); border-radius: 8px; font-size: 12px; cursor: pointer; }
.avw input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--shell-accent); margin: 0; flex-shrink: 0; }
.avw-asset-choice small { display: block; color: var(--shell-muted); font-weight: 400; }
.avw-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-block: 12px; }
.avw .avw-checkbox { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.avw-actions { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; position: sticky; bottom: 0; background: var(--shell-bg); border-top: 1px solid color-mix(in srgb, var(--shell-text) 14%, transparent); z-index: 2; }
.avw .avw-actions[hidden] { display: none; }
.avw-summary { position: sticky; top: 16px; }
.avw-summary dl { margin: 12px 0 16px; }
.avw-summary dl > div { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--shell-text) 10%, transparent); }
.avw-summary dt { font-size: 12px; color: var(--shell-muted); }
.avw-summary dd { margin: 0; font-size: 14px; }
.avw-check { margin: 10px 0; font-size: 12px; overflow-wrap: anywhere; }
.avw-check strong { font-weight: 500; }
.avw-check.is-blocked, .avw-alert { color: var(--shell-danger); }
.avw-check.is-ready { color: var(--shell-success); }
.avw-advisory { color: var(--shell-warning); font-size: 12px; }
.avw-check button { display: block; color: var(--shell-accent); background: transparent; border: 0; padding: 4px 0; font-size: 12px; text-align: left; }
.avw-warnings { margin-block: 12px; color: var(--shell-warning); font-size: 12px; }
.avw-warnings p { padding: 6px 0; }
.avw [data-avw-plan-status] pre { max-height: 320px; overflow-y: auto; padding: 12px; color: var(--shell-text); background: var(--shell-bg); border-radius: 8px; font-size: 12px; }
.avw-summary > .avw-note { margin-top: 16px; }
.avw-text-policy { margin-block: 4px 12px; border-bottom: 1px solid color-mix(in srgb, var(--shell-text) 10%, transparent); }
.avw-text-policy > summary { color: var(--shell-muted); font-size: 12px; font-weight: 500; }
.avw-text-policy > p { padding-bottom: 10px; overflow-wrap: anywhere; }
.avw-alert { font-size: 12px; grid-column: 1 / -1; }
.avw-empty, .avw-loading { grid-column: 1 / -1; padding: 32px; border: 1px solid color-mix(in srgb, var(--shell-text) 12%, transparent); border-radius: 12px; background: var(--shell-panel); }
.avw-empty p, .avw-loading p { color: var(--shell-muted); margin: 12px 0 20px; }
.avw-loading > div { background: var(--shell-panel-2); height: 80px; border-radius: 8px; margin-top: 16px; }
.avw-loading > div + div { height: 180px; }
.avw-submitted { margin-top: 16px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--shell-text) 12%, transparent); overflow-wrap: anywhere; }
.avw-submitted strong { color: var(--shell-success); }
.avw-submitted p { font-size: 12px; margin: 8px 0; }
.avw-recovery { margin-top: 12px; color: var(--shell-warning); }
.avw-prompt-section > section.avw-recovery { display: grid; gap: 10px; padding: 14px; border: 1px solid color-mix(in srgb, var(--shell-warning) 30%, transparent); border-radius: 8px; }
.avw-prompt-section > section.avw-recovery details, .avw-prompt-section > section.avw-recovery li { overflow-wrap: anywhere; }
.avw-batch { margin: 0 0 20px; padding: 18px; border: 1px solid color-mix(in srgb, var(--shell-text) 14%, transparent); border-radius: 12px; background: var(--shell-panel); }
.avw-batch[hidden] { display: none; }
.avw-work[hidden], .avw-outcome[hidden] { display: none; }
.avw-batch { min-width: 0; }
.avw-batch-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; border-bottom: 1px solid var(--shell-border); }
.avw-batch-modes button { min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-radius: 6px 6px 0 0; background: transparent; color: var(--shell-muted); }
.avw-batch-modes button[aria-pressed="true"] { border-bottom-color: var(--shell-accent); color: var(--shell-text); }
.avw .avw-batch-opt-in { display: flex; align-items: center; gap: 9px; min-height: 44px; margin: 8px 0; font-size: 13px; }
.avw-batch-opt-in input { width: 16px; height: 16px; accent-color: var(--shell-accent); }
.avw-batch-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.avw-batch-controls > .avw-note { flex-basis: 100%; }
.avw-batch-selection { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 18px 0; padding: 12px; border: 1px solid color-mix(in srgb, var(--shell-text) 14%, transparent); border-radius: 8px; }
.avw-batch-selection legend { padding-inline: 6px; }
.avw-batch-selection > span { flex-basis: 100%; color: var(--shell-muted); font-size: 12px; }
.avw-batch-selection label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.avw-batch-selection input { width: 18px; height: 18px; }
.avw-batch-submit { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.avw-batch-submit label { display: grid; gap: 8px; }
.avw-batch-policy { margin-top: 18px; color: var(--shell-muted); }
.avw-batch-policy summary { min-height: 44px; display: list-item; align-content: center; cursor: pointer; }
.avw-batch > .avw-note { margin-top: 6px; }
.avw-batch-details { margin-block: 8px; }
.avw-batch-details ol { padding: 0; margin: 0; list-style: none; }
.avw-batch-details li { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--shell-text) 10%, transparent); }
.avw-batch-details li > div { min-width: 0; }
.avw-batch-row-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.avw-batch-row-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; flex-shrink: 0; max-width: 50%; }
@media (max-width: 520px) { .avw-batch-row-actions { max-width: 100%; justify-content: flex-start; } }
.avw-batch-details li strong { font-size: 13px; overflow-wrap: anywhere; }
.avw-batch-details li button { flex-shrink: 0; }
.avw-batch-state { font-size: 12px; color: var(--shell-muted); }
.avw-batch [data-status="running"] .avw-batch-state, .avw-batch [data-status="processing"] .avw-batch-state { color: var(--shell-accent); }
.avw-batch [data-status="ready"] .avw-batch-state, .avw-batch [data-status="succeeded"] .avw-batch-state { color: var(--shell-success); }
.avw-batch [data-status="validation_failed"] .avw-batch-state, .avw-batch [data-status="blocked"] .avw-batch-state { color: var(--shell-warning); }
.avw-batch [data-status="paused_unknown"] .avw-batch-state, .avw-batch [data-status="unknown"] .avw-batch-state, .avw-batch [data-status="failed"] .avw-batch-state { color: var(--shell-danger); }
@media (max-width: 520px) { .avw-batch { padding: 14px; } .avw-batch-details li { align-items: start; flex-direction: column; gap: 8px; } .avw-batch-submit { align-items: stretch; flex-direction: column; } }
.avw-editor-dialog { width: min(1440px, calc(100vw - 48px)); height: calc(100dvh - 48px); max-width: none; max-height: none; margin: auto; padding: 24px; color: var(--shell-text); background: var(--shell-panel); border: 1px solid color-mix(in srgb, var(--shell-text) 20%, transparent); border-radius: 12px; }
.avw-editor-dialog[open] { display: flex; flex-direction: column; gap: 12px; }
.avw-editor-dialog::backdrop { background: color-mix(in srgb, var(--shell-bg) 85%, transparent); }
.avw-editor-dialog [data-avw-editor-slot] { min-height: 0; flex: 1; display: flex; }
.avw-editor-body { min-width: 0; }
.avw-editor-dialog .avw-editor-body { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.avw .avw-editor-dialog #avw-prompt { height: auto; min-height: 0; flex: 1; resize: none; margin-top: 0; }
.avw-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.avw-editor-footer button, .avw-editor-dialog .avw-section-head > button { flex-shrink: 0; }
.avw-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.avw-outcome { display: grid; gap: 14px; margin-top: 16px; padding: 16px; background: var(--shell-bg); border: 1px solid color-mix(in srgb, var(--shell-text) 12%, transparent); border-radius: 10px; }
.avw-step-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: avw-step; }
.avw-step-strip li { position: relative; min-width: 0; padding: 8px 8px 8px 30px; color: var(--shell-muted); background: var(--shell-panel-2); border: 1px solid color-mix(in srgb, var(--shell-text) 10%, transparent); border-radius: 7px; font-size: 11px; overflow-wrap: anywhere; }
.avw-step-strip li::before { counter-increment: avw-step; content: counter(avw-step); position: absolute; left: 9px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid currentColor; border-radius: 50%; font-size: 9px; font-variant-numeric: tabular-nums; }
.avw-step-strip li[data-state="done"] { color: var(--shell-success); background: color-mix(in srgb, var(--shell-success) 7%, transparent); }
.avw-step-strip li[data-state="current"] { color: var(--shell-accent); border-color: color-mix(in srgb, var(--shell-accent) 34%, transparent); background: color-mix(in srgb, var(--shell-accent) 8%, transparent); }
.avw-step-strip li[data-state="blocked"] { color: var(--shell-warning); border-color: color-mix(in srgb, var(--shell-warning) 30%, transparent); background: color-mix(in srgb, var(--shell-warning) 7%, transparent); }
.avw-assistant-copy { display: grid; gap: 4px; }
.avw-assistant-copy > span { color: var(--shell-accent); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.avw-assistant-copy > strong { display: block; font-size: 17px; font-weight: 700; line-height: 1.4; text-wrap: balance; }
.avw-assistant-copy > p { color: var(--shell-muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; text-wrap: pretty; }
.avw-outcome[data-assistant-state="blocked"] .avw-assistant-copy > strong { color: var(--shell-danger); }
.avw-outcome[data-assistant-state="paused"] .avw-assistant-copy > strong { color: var(--shell-warning); }
.avw-outcome[data-assistant-state="ready"] .avw-assistant-copy > strong { color: var(--shell-success); }
.avw-outcome[data-assistant-state="working"] .avw-assistant-copy > strong { color: var(--shell-text); }
.avw-validation-summary { display: grid; gap: 3px; margin-top: 10px; padding: 9px 10px; color: var(--shell-warning); background: color-mix(in srgb, var(--shell-warning) 9%, transparent); border: 1px solid color-mix(in srgb, var(--shell-warning) 28%, transparent); border-radius: 8px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.avw-validation-summary strong { font-weight: 650; }
.avw-validation-summary small { color: var(--shell-muted); font-size: inherit; }
.avw-next-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--shell-text) 12%, transparent); }
.avw-next-action > span { color: var(--shell-muted); font-size: 12px; font-weight: 600; }
.avw-next-action > button { min-height: 44px; }
.avw-next-action > small { color: var(--shell-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.avw-action-consequence { color: var(--shell-muted); font-size: 12px; line-height: 1.6; }
.avw .avw-text-action { justify-self: start; min-height: 44px; padding: 0; color: var(--shell-muted); background: transparent; border: 0; text-decoration: underline; text-underline-offset: 3px; }
.avw .avw-text-action:hover { color: var(--shell-text); }
.avw-outcome-record { border-top: 1px solid color-mix(in srgb, var(--shell-text) 10%, transparent); font-size: 12px; }
.avw-outcome-record > summary { min-height: 36px; color: var(--shell-muted); font-weight: 500; }
.avw-outcome-record > div { display: grid; gap: 5px; padding-bottom: 4px; }
.avw-outcome-record p { color: var(--shell-muted); overflow-wrap: anywhere; }
.avw-effect-summary { display: grid; gap: 3px; padding: 9px 10px; color: var(--shell-text); background: color-mix(in srgb, var(--shell-accent) 6%, transparent); border: 1px solid color-mix(in srgb, var(--shell-accent) 22%, transparent); border-radius: 8px; line-height: 1.55; overflow-wrap: anywhere; }
.avw-effect-summary strong { color: var(--shell-accent); font-weight: 650; }
.avw-effect-summary small { color: var(--shell-muted); font-size: inherit; }
.avw-effect-summary[data-verdict="mixed_with_regression"], .avw-effect-summary[data-verdict="regressed"], .avw-effect-summary[data-verdict="no_validation_progress"], .avw-effect-summary[data-verdict="incomparable"] { background: color-mix(in srgb, var(--shell-warning) 7%, transparent); border-color: color-mix(in srgb, var(--shell-warning) 28%, transparent); }
.avw-effect-summary[data-verdict="mixed_with_regression"] strong, .avw-effect-summary[data-verdict="regressed"] strong, .avw-effect-summary[data-verdict="no_validation_progress"] strong, .avw-effect-summary[data-verdict="incomparable"] strong { color: var(--shell-warning); }
.avw-root-causes { margin-block: 8px 12px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--shell-warning) 28%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--shell-warning) 6%, transparent); }
.avw-root-causes > summary { color: var(--shell-warning); }
.avw-root-causes ul { display: grid; gap: 10px; margin: 0; padding: 0 0 12px; list-style: none; }
.avw-root-causes li { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--shell-text) 10%, transparent); overflow-wrap: anywhere; }
.avw-root-causes li strong { color: var(--shell-warning); font-size: 11px; }
.avw-root-causes li[data-kind="local_policy"] strong { color: var(--shell-success); }
.avw-root-causes li span, .avw-root-causes li small { font-size: 12px; }
.avw-root-causes li small { color: var(--shell-muted); }
.avw-plan-details { margin-block: 4px 12px; font-size: 12px; }
.avw-plan-details > summary { color: var(--shell-muted); font-weight: 500; }
.avw-stop-guidance { display: grid; gap: 8px; margin: 4px 0 14px; padding: 12px; border: 1px solid color-mix(in srgb, var(--shell-warning) 30%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--shell-warning) 6%, transparent); }
.avw-stop-guidance > strong { color: var(--shell-warning); font-size: 13px; }
.avw-stop-guidance > p { color: var(--shell-muted); }
.avw-stop-guidance > button { justify-self: start; }
.avw-issue-groups { margin: 4px 0 16px; padding-left: 18px; }
.avw-issue-groups > li { padding: 6px 0; overflow-wrap: anywhere; }
.avw-issue-groups small { display: block; color: var(--shell-muted); margin-top: 2px; }
.avw-editor-origin { padding-top: 8px; color: var(--shell-muted); font-size: 12px; }
.avw-editor-origin button { margin-top: 8px; }
.avw-api-preview { margin-block: 12px; font-size: 12px; }
.avw-api-preview > ol { margin: 0; padding: 0; list-style: none; max-height: 330px; overflow-y: auto; }
.avw-api-preview > ol > li { padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--shell-text) 10%, transparent); overflow-wrap: anywhere; }
.avw-api-preview strong { font-variant-numeric: tabular-nums; }
.avw-api-preview ul { margin: 4px 0; padding-left: 18px; }
.avw-reset-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 24px; margin: auto; border: 1px solid color-mix(in srgb, var(--shell-text) 20%, transparent); border-radius: 12px; color: var(--shell-text); background: var(--shell-panel); }
.avw-reset-dialog::backdrop { background: color-mix(in srgb, var(--shell-bg) 85%, transparent); }
.avw-reset-dialog p { margin-top: 12px; }
.avw-duration-dialog label { display: grid; gap: 8px; margin-top: 18px; font-weight: 600; }
.avw-duration-dialog select { min-height: 44px; }
.avw-reset-dialog footer { margin-top: 20px; justify-content: flex-end; }
@media (max-width: 1350px) { .avw-work { grid-template-columns: minmax(0, 1fr); } .avw-summary { position: static; } .avw-summary dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } }
@media (max-width: 900px) { .avw-layout { grid-template-columns: minmax(0, 1fr); } .avw-sources { position: static; max-height: none; } .avw-sources nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 210px; overflow-y: auto; } .avw-heading { align-items: flex-start; } }
@media (max-width: 520px) { .avw { font-size: 14px; } .avw-heading { flex-direction: column; } .avw-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } .avw-section-head { flex-wrap: wrap; } .avw-reference-picker > div { grid-template-columns: minmax(0, 1fr); } .avw-settings { grid-template-columns: minmax(0, 1fr); } .avw-actions { display: grid; grid-template-columns: minmax(0, 1fr); } .avw-actions button { width: 100%; } .avw-prompt-section, .avw-references, .avw-summary { padding: 14px; } .avw #avw-prompt { height: 55dvh; min-height: 420px; max-height: 620px; } .avw-batch-state { display: block; margin-left: 0; } .avw-editor-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); padding: 14px; } .avw .avw-editor-dialog #avw-prompt { height: auto; min-height: 0; max-height: none; } .avw-editor-footer { align-items: flex-start; } .avw-step-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .avw-next-action { align-items: stretch; flex-direction: column; } .avw-next-action > button { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .avw *, .avw *::before, .avw *::after { scroll-behavior: auto; animation: none; transition: none; } }
/* Prompt-first operates on one visible text source, without the legacy editor grid. */
.avw-work.avw-prompt-first, [data-avw-work].avw-prompt-first { display: block; min-width: 0; }
.avw-prompt-first .avw-edit-column { width: 100%; min-width: 0; }
.avw-prompt-first .avw-summary { position: static; margin-top: 16px; }
.avw-prompt-first .avw-summary dl { display: flex; flex-wrap: wrap; gap: 16px 32px; }
.avw-prompt-first #avw-prompt { display: block; width: 100%; min-height: clamp(380px, 55dvh, 640px); line-height: 1.8; resize: vertical; }
.avw-generation-controls {
  min-width: 0;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--shell-text) 16%, transparent);
}
.avw .avw-generation-controls .avw-advanced { padding: 0; border: 0; background: transparent; }
.avw-generation-controls .avw-advanced summary { min-height: 36px; padding-block: 7px; }
.avw-generation-controls .avw-settings { margin-top: 4px; }
.avw-generation-controls .pvr-settings { margin-bottom: 6px; }
.avw-medium-summary { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted, #a4afbb); font-size: .875rem; margin-bottom: 8px; }
.avw-medium-summary:empty { display: none; }
.avw-medium-summary strong { color: var(--shell-text); }
.avw-medium-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding: 0 12px 12px; }
.avw-medium-row label { flex: 1 1 150px; }
.avw-generation-controls .pvr-records summary { min-height: 36px; padding-block: 7px; }
.avw-prompt-first .avw-actions { position: static; padding: 14px 0; margin-top: 12px; background: transparent; border-top: 1px solid color-mix(in srgb, var(--shell-text) 16%, transparent); }
.avw-prompt-status { margin: 8px 0 16px; padding: 12px 0; }
.avw-prompt-status p { margin-top: 6px; font-size: 13px; color: var(--shell-muted); line-height: 1.6; }
.avw-prompt-instructions, .avw-prompt-history { padding: 16px 0; }
.avw-prompt-instructions label { display: block; margin: 12px 0 8px; }
.avw-prompt-instructions textarea { width: 100%; min-height: 96px; }
.avw-prompt-history li { overflow-wrap: anywhere; line-height: 1.8; }
.avw-editor-body { position: relative; }
.avw-mention-menu { position: absolute; z-index: 30; max-width: 100%; overflow-y: auto; padding: 5px; border: 1px solid var(--shell-border, #3c5c60); border-radius: 10px; background: var(--shell-panel, #182126); box-shadow: 0 12px 36px #0008; }
.avw-mention-menu[hidden] { display: none; }
.avw-mention-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; text-align: left; border: 0; border-radius: 6px; background: transparent; color: var(--shell-text, #edf3f3); }
.avw-mention-menu button[aria-selected="true"], .avw-mention-menu button:hover { background: color-mix(in srgb, var(--shell-accent, #6bbac0) 20%, transparent); }
.avw-mention-menu img { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 5px; object-fit: contain; background: #080c0e; }
.avw-mention-menu span { min-width: 0; }
.avw-mention-menu strong, .avw-mention-menu small { display: block; overflow-wrap: anywhere; }
.avw-mention-menu small { margin-top: 4px; color: var(--shell-muted, #a5b3b9); }
.avw-mention-menu p { padding: 10px; font-size: 13px; color: var(--shell-muted, #a5b3b9); }
.avw-reference-tag { border: 0; padding: 0; text-align: left; color: var(--shell-text, #edf3f3); background: transparent; font-weight: 700; overflow-wrap: anywhere; }
.avw-reference-tag:hover { text-decoration: underline; }
.avw-ref figcaption small { color: var(--shell-muted, #a5b3b9); overflow-wrap: anywhere; }
.avw-reference-order { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.avw-reference-order button { min-width: 0; min-height: 32px; padding: 4px 7px; font-size: 12px; }
.avw-prompt-first .avw-ref-list { display: flex; flex-wrap: wrap; align-items: flex-start; }
.avw-prompt-first .avw-ref { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: start; width: min(100%, 280px); margin: 0; }
.avw-prompt-first .avw-ref > div, .avw-prompt-first .avw-ref img { width: 56px; height: 56px; }
.avw-prompt-first .avw-ref figcaption { padding-top: 0; }
.avw-prompt-first .avw-reference-tag { font-size: 13px; line-height: 1.5; }
.avw-technical-issues { color: var(--shell-warning); padding-left: 20px; line-height: 1.8; }
@media (max-width: 640px) {
  .avw-prompt-first .avw-section-head, .avw-prompt-first .avw-actions { flex-wrap: wrap; }
  .avw-prompt-first .avw-actions button { flex: 1 1 140px; min-height: 44px; }
  .avw-prompt-first .avw-summary dl { display: grid; grid-template-columns: 1fr 1fr; }
}
