.ai-catalog { margin-bottom: 13px; }
.ai-catalog-art { position: relative; min-height: 130px; overflow: hidden; background: #ffe3dd; }
.ai-catalog-art img { position: absolute; width: 65%; height: 150%; right: 10%; bottom: -34%; object-fit: contain; }
.ai-catalog-art span { position: absolute; display: grid; place-items: center; width: 54px; height: 54px; top: 37px; left: 15%; border-radius: 15px; color: #a42a23; background: #fff2ee; }

.ai-main { min-height: 100%; color: var(--ink); --gutter: var(--bank-pad); }
.ai-main h1, .ai-main h2 { font-family: inherit; letter-spacing: -.025em; line-height: 1.13; }
.ai-main h1 { font-size: clamp(24px, 6vw, 29px); text-wrap: balance; }
.ai-main h2 { font-size: 19px; }
.ai-main :is(h1, [tabindex="-1"]):focus { outline: none; }
.ai-main .button { min-height: 46px; border-radius: 13px; white-space: normal; text-align: center; }
.ai-primary { margin-top: 12px; }
.ai-text-button { display: flex; width: fit-content; margin: 5px auto 0; background: transparent; color: var(--muted); }
.ai-text-button:hover { color: var(--ink); background: #eeeef1; }

.ai-cover { position: relative; display: grid; align-items: center; min-height: 137px; overflow: hidden; padding: 15px; border-radius: 17px; background: #ffe3dd; color: #391f1c; }
.ai-cover h1 { z-index: 1; width: 58%; font-size: clamp(23px, 6vw, 29px); }
.ai-cover img { position: absolute; width: 55%; height: 127%; right: -2%; bottom: -24%; object-fit: contain; }
.ai-overview-copy { margin: 12px 0 15px; color: var(--muted); line-height: 1.42; font-size: 14px; }
.ai-route-title { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 8px; }
.ai-xp { flex: none; padding: 5px 8px; border-radius: 8px; color: #7e251e; background: #fee5df; font-size: 12px; font-weight: 740; }
.ai-route { display: grid; gap: 2px; list-style: none; padding: 0; margin: 0; }
.ai-route li { display: flex; align-items: center; min-height: 43px; padding: 4px 7px; gap: 9px; border-radius: 11px; line-height: 1.2; font-size: 14px; }
.ai-route li[aria-current] { background: #f0f0f2; }
.ai-route li span { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 9px; background: #efeff1; color: #34343a; }
.ai-route li[aria-current] span { background: var(--red); color: #fff; }

.ai-main:has(.ai-play) { padding-top: 0; }
.ai-progress { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 11px; margin-inline: calc(0px - var(--gutter)); padding: 9px var(--gutter); border-bottom: 1px solid #ececee; background: #fcfcfc; font-size: 13px; }
.ai-segments { display: flex; flex: 1; gap: 4px; max-width: 119px; }
.ai-segments i { height: 5px; flex: 1; border-radius: 9px; background: #dedee2; }
.ai-segments i.complete { background: var(--red); }
.ai-segments i.current { background: #eb9a93; }
.ai-play h1 { margin: 13px 0 12px; }
.ai-thread { display: grid; gap: 8px; }
.ai-message { display: flex; align-items: flex-start; gap: 7px; margin-right: 19px; }
.ai-message img, .ai-avatar { width: 29px; height: 29px; flex: 0 0 29px; object-fit: contain; }
.ai-avatar { display: grid; place-items: center; border-radius: 10px; background: #ffe5df; color: #9d251f; }
.ai-bubble { min-width: 0; padding: 8px 10px; border-radius: 5px 13px 13px; background: #f0f0f2; font-size: 14px; line-height: 1.36; overflow-wrap: anywhere; }
.ai-bubble > strong { display: block; margin-bottom: 2px; font-size: 12px; }
.ai-user { justify-content: flex-end; margin: 0 0 0 31px; }
.ai-user .ai-bubble { border-radius: 13px 5px 13px 13px; background: #ffe9e5; }
.ai-assistant .ai-bubble { background: #fff; border: 1px solid #e9e9ed; }
.ai-builder { display: grid; gap: 6px; margin: 5px 0 0; }
.ai-builder div { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 5px; }
.ai-builder dt { font-weight: 740; font-size: 12px; padding-top: 2px; }
.ai-builder dd { margin: 0; }
.ai-inline { display: flex; align-items: center; gap: 5px; width: fit-content; margin-top: 5px; padding: 6px 8px; min-height: 44px; border: 0; border-radius: 9px; font: inherit; font-weight: 730; background: #f6d8d1; color: #75231c; text-align: left; }
.ai-assistant .ai-inline { background: #ffe9e5; }
.ai-inline:hover, .ai-time:hover { background: #f6c9c2; }
.ai-attachment { width: fit-content; margin-top: 5px; padding-inline: 6px; border-radius: 8px; background: #fff7f4; color: #75231c; font-size: 12px; font-weight: 700; }
.ai-attachment summary { min-height: 44px; padding-block: 9px; cursor: pointer; }
.ai-attachment summary svg { vertical-align: middle; }
.ai-attachment ul { margin: 0 0 5px; padding: 0 0 5px 17px; }
.ai-attachment li + li { margin-top: 3px; }
.ai-attachment svg, .ai-inline svg { flex-shrink: 0; }
.ai-plan, .ai-voice-answer { list-style: none; padding: 0; margin: 0; }
.ai-plan li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 9px; }
.ai-plan li + li, .ai-voice-answer li + li { margin-top: 4px; padding-top: 4px; border-top: 1px solid #e9e9ed; }
.ai-time { min-height: 44px; padding: 4px; border: 0; border-radius: 8px; background: #f2f1f4; color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.ai-source, .ai-takeaway { margin-left: 36px; padding: 9px 11px; background: #f0f0f2; border-radius: 12px; font-size: 13px; line-height: 1.35; scroll-margin: 52px 0 8px; }
.ai-source strong { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.ai-source.missing { color: #762a25; background: #ffe6e2; }
.ai-source.verified { color: #21523d; background: #e2f1e8; }
.ai-source-name { display: block; margin-top: 5px; color: #625c66; font-size: 12px; }
.ai-takeaway { margin: 12px 0 0; background: #f1edf8; color: #382d48; }
.ai-takeaway div { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.ai-takeaway span { font-weight: 700; }
.ai-hint { margin-top: 8px; padding: 8px 10px; border-radius: 9px; color: #63401b; background: #ffedd2; scroll-margin: 52px 0 8px; font-size: 13px; }
.ai-composer { margin-top: 10px; }
.ai-composer label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; }
.ai-composer label span { margin-left: 4px; color: var(--muted); font-weight: 500; }
.ai-composer div { display: flex; gap: 5px; padding: 3px; border: 1px solid #dcdce2; border-radius: 11px; background: #fff; }
.ai-composer input { width: 100%; min-width: 0; padding: 6px; border: 0; background: #fff; color: var(--ink); font: inherit; font-size: 16px; }
.ai-composer button { display: grid; place-items: center; flex: 0 0 43px; height: 43px; border: 0; border-radius: 8px; background: var(--red); color: #fff; }
.ai-template { margin: 0; padding: 13px; border-radius: 12px; background: #f0f0f2; line-height: 1.4; }
.ai-saved { display: flex; align-items: center; gap: 5px; margin-top: 9px; color: #21523d; font-size: 13px; }
.ai-arrived { scroll-margin: 52px 0 8px; }

@media (max-width: 370px) {
  .ai-plan li { grid-template-columns: 1fr; gap: 0; }
  .ai-time { min-height: 44px; }
}
@media (prefers-reduced-motion: no-preference) {
  .ai-arrived { animation: ai-arrive 230ms cubic-bezier(.2,.7,.2,1) both; }
  @keyframes ai-arrive { from { opacity: .55; transform: translateY(4px); } }
}
