/* ============================================================
   Verse Studio › AI tools (studio-ai.js): the hub, the eight task pages, the confirm sheet,
   the compare stage, the light rig and the sketch stage. The makers' own pages come from
   studio-ad.css / studio-scene3d.css.
   Tokens come from studio.css :root; nothing new is declared here. The pages reuse the Create
   workspace's classes (cr-page, cr-split, cr-panel, cr-chip, cr-toggle, cr-ref, cr-card…) and add
   only what the AI tools need. Rules: the accent is the primary action, the active state, focus
   and the drawn motion arrows; radii 10 (panels, sheets, the stage) / 6 (rows, cards, controls) /
   999 (chips); no shadows or gradients; Barlow Condensed for the page headline only.
   The memorable element is the stage. One orchestrated motion: the divider sweeping in on a
   fresh result (studio-ai.js), never with reduced motion.
   ============================================================ */

/* ---------- page frame ---------- */
.ai-page { max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.ai-page > .card { margin-bottom: 0; }
.ai-head { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ai-line { font-size: 14px; line-height: 1.5; font-weight: 500; max-width: 62ch; }
.ai-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; padding: 2px 6px 2px 0; border-radius: 6px; font-size: 13.5px; line-height: 1.5; font-weight: 500; color: var(--text-muted); text-decoration: none; }
.ai-back:hover { color: var(--text); }
.ai-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-page .st-headline:focus { outline: none; }
.ai-page .st-headline:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.ai-h2 { font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--text); }
.ai-issue { color: var(--red-soft); }
.ai-from { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ai-file-btn { position: relative; cursor: pointer; }
.ai-file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-page .btn { gap: 6px; }

/* ---------- the hub: a list of rows, each with its own small picture ---------- */
.ai-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ai-rows > li + li { border-top: 1px solid var(--gray-mid); }
.ai-row {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto 20px; gap: 16px; align-items: center;
  padding: 14px 12px; margin: 2px 0; border-radius: 6px; color: inherit; text-decoration: none;
  transition: background-color .15s;
}
.ai-row:hover { background: var(--gray-dark); }
.ai-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.ai-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-row-title { font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--text); }
.ai-row-line { font-size: 13.5px; line-height: 1.5; font-weight: 500; color: var(--text-muted); max-width: 62ch; }
.ai-row-keys { font-size: 12.5px; line-height: 1.45; color: var(--text-dim); overflow-wrap: anywhere; }
.ai-row-price { font-size: 13.5px; line-height: 1.5; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-row-off { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; line-height: 1.5; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.ai-row-go { color: var(--text-dim); display: flex; }
.ai-row:hover .ai-row-go, .ai-row:focus-visible .ai-row-go { color: var(--text); }
.ai-row.is-off .ai-row-title { color: var(--text-soft); }
.ai-illo { width: 72px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--gray-mid); background: var(--gray-dark); color: var(--text-muted); }
.ai-row.is-off .ai-illo { opacity: .6; }
.ai-illo-accent { stroke: var(--accent); }
circle.ai-illo-accent { fill: var(--accent); }
.ai-illo-svg { overflow: visible; }
.ai-hub-note .card-content { padding: 16px; }
.ai-hub-foot { font-size: 13.5px; line-height: 1.5; font-weight: 500; }
.ai-hub-foot a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ai-hub-foot a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
/* The pictures move only while their row is hovered or focused, and only when motion is welcome. */
@media (prefers-reduced-motion: no-preference) {
  .ai-row:hover .ai-illo-spark, .ai-row:focus-visible .ai-illo-spark { animation: ai-twinkle 1.2s ease-in-out infinite; transform-origin: 54px 15px; }
  .ai-row:hover .ai-illo-slide, .ai-row:focus-visible .ai-illo-slide { animation: ai-slide 1.4s ease-in-out infinite alternate; }
  .ai-row:hover .ai-illo-orbit, .ai-row:focus-visible .ai-illo-orbit { animation: ai-orbit 2.4s linear infinite; transform-origin: 28px 25px; }
  .ai-row:hover .ai-illo-wave, .ai-row:focus-visible .ai-illo-wave { animation: ai-wave .9s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
  .ai-row:hover .ai-illo-draw, .ai-row:focus-visible .ai-illo-draw { stroke-dasharray: 48; animation: ai-draw 1.6s ease-in-out infinite; }
}
@keyframes ai-twinkle { 50% { transform: scale(.6) rotate(45deg); opacity: .6; } }
@keyframes ai-slide { to { transform: translateX(4px); } }
@keyframes ai-orbit { to { transform: rotate(-360deg); } }
@keyframes ai-wave { to { transform: scaleY(.45); } }
@keyframes ai-draw { from { stroke-dashoffset: 48; } to { stroke-dashoffset: 0; } }

/* ---------- task pages: the Create › Video columns (340 px panel beside the stage and History) ---------- */
/* The panel is a scrolling flex column: a child that clips its own overflow (the tab row, the language list) would
   otherwise be allowed to shrink to nothing when the panel is shorter than its content. */
.ai-panel > * { flex-shrink: 0; }
.ai-panel .cr-tabs { margin: -4px 0 0; }
.ai-page a.btn { text-decoration: none; }
.ai-tabs { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.ai-tabs .cr-tab { white-space: nowrap; }
.ai-model-note { margin-top: 2px; }
.ai-promptblock { display: flex; flex-direction: column; gap: 8px; }
.ai-insert { margin-top: -4px; }
.ai-vfx .cr-optrow { gap: 6px; }
.ai-go-wrap .cr-submit { gap: 8px; }
.ai-go-wrap .btn-primary { color: var(--accent-ink); }
.ai-go-wrap .btn-primary:hover:not(:disabled), .ai-go-wrap .btn-primary:focus-visible { background: var(--accent-light); }
.ai-go-wrap .btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.ai-breakdown { flex-direction: column; gap: 2px; }
.ai-breakdown-line { display: block; }
.ai-go-wrap .ai-error, .ai-panel .ai-error { margin-bottom: 4px; }

/* input slots: the Create reference slots, wider for a clip or a sound */
.ai-slot .cr-ref-items { align-items: flex-start; }
.ai-slot-item { position: relative; width: 72px; height: 72px; border-radius: 6px; overflow: hidden; border: 1px solid var(--gray-light); background: var(--black); display: flex; align-items: center; justify-content: center; }
.ai-slot-item.is-wide { width: 128px; }
.ai-slot-item img, .ai-slot-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-slot-audio { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 8px; font-size: 12.5px; line-height: 1.45; color: var(--text-soft); text-align: center; overflow: hidden; }
.ai-slot-audio span { max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-slot-dur { position: absolute; left: 4px; bottom: 4px; padding: 0 6px; border-radius: 6px; background: rgba(18,18,18,.82); color: var(--white); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.ai-slot-add[disabled] { opacity: .5; cursor: not-allowed; }
.ai-slot.is-over .cr-ref-add, .ai-stage.is-over { border-color: var(--text-soft); border-style: solid; }

/* ---------- the stage: the page's one loud element ---------- */
.ai-main { gap: 20px; }
.ai-stage-wrap { min-width: 0; }
.ai-stage { position: relative; border: 1px solid var(--gray-mid); border-radius: 10px; background: var(--black); overflow: hidden; }
.ai-stage-empty { aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; line-height: 1.5; font-weight: 500; }
.ai-stage-empty .ai-illo-svg { width: 128px; height: 88px; color: var(--gray-light); }
.ai-stage-empty p { max-width: 46ch; }
.ai-stage-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ai-stage-figure { margin: 0; display: flex; flex-direction: column; }
.ai-stage-media { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--black); }
.ai-stage-audio { aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; color: var(--text-muted); }
.ai-stage-audio audio { width: min(100%, 420px); }
.ai-stage-cap { padding: 10px 14px; border-top: 1px solid var(--gray-mid); font-size: 12.5px; line-height: 1.45; color: var(--text-muted); }
.ai-stage-cap:empty { display: none; }
.ai-stage-run { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; background: rgba(18,18,18,.78); color: var(--text-soft); font-size: 13.5px; line-height: 1.5; font-weight: 500; }
.ai-elapsed { font-variant-numeric: tabular-nums; color: var(--text-soft); }
.ai-stage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 14px; border-top: 1px solid var(--gray-mid); font-size: 13.5px; line-height: 1.5; }
.ai-stage-title { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ai-stage-acts { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ai-compare-host { min-width: 0; }

/* compare: before on the left of the divider, after on the right; the full-size range under the grip takes drags and keys */
.ai-compare { position: relative; aspect-ratio: 16 / 9; background: var(--black); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.ai-stage .ai-compare { border-radius: 0; }
.ai-compare-layer { position: absolute; inset: 0; }
.ai-compare-media { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.ai-compare-before { clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0); }
.ai-compare-divider { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); z-index: 2; width: 2px; margin-left: -1px; background: var(--text); pointer-events: none; }
.ai-compare-grip { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 999px; border: 2px solid var(--text); background: var(--gray-dark); color: var(--text); }
.ai-compare-grip .icon { margin: 0 -3px; }
.ai-compare-tag { position: absolute; top: 10px; z-index: 2; padding: 1px 10px; border-radius: 999px; background: rgba(18,18,18,.82); color: var(--text); font-size: 12.5px; line-height: 1.6; font-weight: 600; pointer-events: none; }
.ai-compare-tag-before { left: 10px; }
.ai-compare-tag-after { right: 10px; }
.ai-compare-range { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; background: transparent; }
.ai-compare-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 40px; height: 100vh; }
.ai-compare-range::-moz-range-thumb { width: 40px; height: 100vh; border: 0; }
.ai-compare-range:focus-visible ~ .ai-compare-divider .ai-compare-grip { outline: 2px solid var(--accent); outline-offset: 3px; }
.ai-compare-range:focus-visible ~ .ai-compare-divider { background: var(--accent); }
.ai-compare-transport { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--gray-mid); }
.ai-compare-seek { flex: 1 1 auto; min-width: 0; }
.ai-compare-time { font-size: 12.5px; line-height: 1.45; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-compare-play:focus-visible, .ai-compare-seek:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-compare-audio { aspect-ratio: auto; display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.ai-compare-track { display: flex; align-items: center; gap: 12px; }
.ai-compare-track .ai-compare-tag { position: static; flex: 0 0 auto; }
.ai-compare-track audio { flex: 1 1 auto; min-width: 0; }

/* ---------- the light rig ---------- */
/* The widget takes its size from the host's width: a square sphere as wide as the host (240 px at most), then the help,
   the readout and the sliders flowing underneath. It never relies on the host being a fixed square, and lightRig()
   releases a host's own height / aspect ratio / overflow while it is mounted, so nothing is clipped. */
.ai-rig-host { min-width: 0; }
.ai-rig-mounted { min-width: 0; }
.ai-rig { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; box-sizing: border-box; }
.ai-rig-sphere { position: relative; box-sizing: border-box; width: 100%; max-width: 240px; aspect-ratio: 1 / 1; height: auto; flex: 0 0 auto; margin: 0 auto; border-radius: 10px; background: var(--black); border: 1px solid var(--gray-mid); cursor: grab; touch-action: none; }
.ai-rig-slider { width: 100%; min-width: 0; }
.ai-rig-sphere:active { cursor: grabbing; }
.ai-rig-sphere:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-rig-canvas { display: block; width: 100%; height: 100%; border-radius: 10px; }
.ai-rig-handle { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 999px; border: 3px solid var(--accent); background: var(--accent); pointer-events: none; }
.ai-rig-handle.is-behind { background: var(--black); }
.ai-rig-readout { font-size: 12.5px; line-height: 1.45; color: var(--text-soft); text-align: center; min-height: 2.9em; }
.ai-rig-help { text-align: center; margin: 0 auto; }

/* ---------- the sketch stage (Draw to video) ---------- */
.ai-sketch-wrap { display: flex; align-items: center; justify-content: center; min-height: 240px; padding: 0; }
.ai-sketch { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; cursor: crosshair; touch-action: none; }
.ai-sketch:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ai-sketch-src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-blank { display: inline-flex; align-items: center; gap: 4px; }
.ai-blank input[type="color"] { width: 32px; height: 32px; padding: 2px; border: 1px solid var(--gray-light); border-radius: 6px; background: var(--black); cursor: pointer; }
.ai-blank input[type="color"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-sketch-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ai-tool.active { color: var(--accent-ink); background: var(--accent); }
.ai-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-sketch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-sketch-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px; border: 1px solid var(--gray-mid); border-radius: 6px; background: var(--black); }
.ai-sketch-num { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; margin-top: 4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ai-sketch-num.is-note, .ai-sketch-num.is-mark { background: var(--gray-mid); color: var(--text-soft); }
.ai-sketch-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ai-sketch-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px; }
.ai-sketch-fields .input { height: 34px; padding: 4px 10px; font-size: 13.5px; }
.ai-sketch-mark { font-size: 13.5px; line-height: 1.5; color: var(--text-soft); align-self: center; }

/* ---------- History ---------- */
.ai-history { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ai-history-head { align-items: center; }
.ai-card .cr-card-media video { display: block; width: 100%; height: auto; background: var(--black); }
.ai-card .cr-card-actions { gap: 4px; }
.ai-card-btn { height: 30px; padding: 4px 10px; font-size: 12.5px; }
.ai-chip-refunded { display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(34,197,94,.45); color: var(--green); font-size: 12.5px; line-height: 1.6; font-weight: 600; }

/* ---------- the confirm sheet ---------- */
.ai-sheet .modal-body { gap: 12px; }
.ai-sheet-detail { font-size: 13.5px; line-height: 1.5; font-weight: 500; }
.ai-sheet-price { display: flex; align-items: baseline; gap: 8px; }
.ai-sheet-vxt { font-size: 28px; line-height: 1.2; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ai-sheet-breakdown { display: block; }
.ai-sheet-balance { font-size: 13.5px; line-height: 1.5; font-weight: 500; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.ai-sheet-actions { padding-top: 4px; }
.ai-sheet .btn-primary { color: var(--accent-ink); }
.ai-sheet .btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.ai-sheet .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The heading takes the sheet's first focus (tabindex -1, so a held key cannot pay); it is not a control, so no ring. */
.ai-sheet .modal-title:focus { outline: none; }
.ai-quote-wait { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }

/* ---------- Translate ---------- */
.ai-langs { display: flex; flex-wrap: wrap; gap: 6px; max-height: 176px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; scrollbar-width: thin; }
.ai-lang { position: relative; display: inline-flex; align-items: center; min-height: 32px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--gray-light); font-size: 13.5px; line-height: 1.5; font-weight: 500; color: var(--text-soft); cursor: pointer; }
.ai-lang input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ai-lang:hover { border-color: var(--border-soft); color: var(--text); }
.ai-lang.active { background: var(--gray-light); border-color: var(--gray-light); color: var(--white); font-weight: 600; }
.ai-lang:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-tx { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--gray-mid); }
.ai-tx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-tx-out { display: flex; flex-direction: column; gap: 8px; }
.ai-tx-text { max-height: 220px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--gray-mid); border-radius: 6px; background: var(--gray-dark); font-size: 13.5px; line-height: 1.6; color: var(--text-soft); white-space: pre-wrap; }
.ai-tx-lang { width: auto; height: 32px; padding: 4px 10px; font-size: 13.5px; }

/* ---------- Voice lab ---------- */
.ai-voices, .ai-previews { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ai-voice-list, .ai-samples { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ai-voice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--gray-mid); border-radius: 6px; background: var(--gray-dark); }
.ai-voice-main { flex: 1 1 260px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12.5px; line-height: 1.45; }
.ai-voice-main audio { flex: 1 1 220px; min-width: 0; height: 36px; }
.ai-voice-name { font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--text); }
.ai-voice-input { width: 180px; height: 32px; padding: 4px 10px; font-size: 13.5px; }
.ai-sample { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border: 1px solid var(--gray-mid); border-radius: 6px; font-size: 13.5px; line-height: 1.5; color: var(--text-soft); }
.ai-sample span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-sample-add { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-sample-add .is-rec { border-color: var(--text); color: var(--text); }
.ai-consent { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--gray-mid); border-radius: 6px; font-size: 13.5px; line-height: 1.5; font-weight: 500; color: var(--text); cursor: pointer; }
.ai-consent input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--accent); }
.ai-consent:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- makers while their code loads ---------- */
.ai-maker-wait { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) { .ai-history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .ai-stage-acts { margin-left: 0; }
}
@media (max-width: 640px) {
  .ai-row { grid-template-columns: 56px minmax(0, 1fr) 16px; gap: 4px 12px; padding: 12px 8px; }
  .ai-illo { width: 56px; height: 44px; grid-row: 1 / span 2; }
  .ai-illo-svg { width: 48px; height: 33px; }
  .ai-row-text { grid-column: 2; grid-row: 1; }
  .ai-row-price, .ai-row-off { grid-column: 2; grid-row: 2; white-space: normal; }
  .ai-row-go { grid-column: 3; grid-row: 1 / span 2; }
  .ai-two { grid-template-columns: minmax(0, 1fr); }
  .ai-sketch-row { grid-template-columns: minmax(0, 1fr); }
  .ai-compare-grip { width: 34px; height: 34px; }
  .ai-voice-input { width: 100%; }
}
@media (max-width: 760px) { .ai-history-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 400px) {
  .ai-slot-item.is-wide { width: 112px; }
  .ai-compare-tag { top: 6px; padding: 0 8px; }
  .ai-compare-tag-before { left: 6px; }
  .ai-compare-tag-after { right: 6px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ai-row, .ai-page .spin { transition: none; animation: none; }
  .ai-page .cr-ring { animation: none; }
}
