/* Isolated chat theme: never inherits a cached copy of the legacy purple CSS. */
:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  --gold: #e7bc58;
  --gold-soft: #f2d58b;
  --muted: #a6aaa4;
  --line: rgba(231, 188, 88, .2);
  color: #f3f0e8;
  background: #090b0c;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
button, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
::selection { color: #17120a; background: var(--gold-soft); }
.song-chat-body {
  background: radial-gradient(ellipse at 15% 0, rgba(164, 113, 35, .09), transparent 45%), #090b0c;
}
.sr-only, .chat-skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.chat-skip:focus { position: fixed; top: 10px; left: 10px; padding: 12px; background: var(--gold); color: #111; z-index: 30; }
.chat-top {
  width: min(1100px, calc(100% - 48px)); margin: auto; min-height: 86px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.chat-logo { color: var(--gold-soft); font: 26px Georgia, "Times New Roman", serif; letter-spacing: .12em; }
.chat-logo span { display: block; margin-top: 7px; text-align: center; font: 600 8px "Segoe UI", sans-serif; letter-spacing: .55em; }
.chat-top-actions { display: flex; align-items: center; gap: 26px; }
.chat-top-actions a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; color: #c0c0b7; }
.chat-top-actions a:hover { color: var(--gold-soft); }
.chat-shell { width: min(840px, calc(100% - 40px)); margin: auto; padding-bottom: 32px; }
.chat-heading { padding: 33px 0 23px; text-align: center; }
.chat-kicker { color: #b89a53; font-size: 10px; font-weight: 650; letter-spacing: .17em; }
.chat-heading h1 { font-size: clamp(27px, 4vw, 40px); line-height: 1.15; font-weight: 500; letter-spacing: -.03em; margin: 13px 0 10px; }
.chat-heading em { font-style: normal; color: var(--gold-soft); }
.chat-heading > p:last-child { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
.journey { display: flex; justify-content: center; align-items: center; gap: 13px; margin: 0 auto 23px; color: #93988f; font-size: 12px; }
.journey span { white-space: nowrap; }
.journey .active { color: var(--gold-soft); font-weight: 600; }
.journey .done { color: #b8a169; }
.journey b { width: 30px; height: 1px; background: var(--line); }
.chat-panel { border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(140deg, #121618, #0d1011); box-shadow: 0 20px 80px #0004; }
.chat-intro { display: flex; align-items: center; gap: 13px; padding: 19px 24px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.ai-avatar { width: 43px; height: 43px; flex: none; display: grid; place-items: center; border-radius: 13px; border: 1px solid rgba(231, 188, 88, .32); color: var(--gold); background: linear-gradient(145deg, #332a17, #191c18); }
.ai-avatar svg { width: 25px; height: 25px; }
.chat-intro b { display: block; font-size: 14px; letter-spacing: .07em; }
.chat-intro div > span { display: block; font-size: 12px; color: #a2a79e; margin-top: 4px; }
.chat-order-number { margin-left: auto; flex: none; font-size: 11px; color: #bda76f; padding: 8px 11px; border: 1px solid var(--line); border-radius: 20px; }
.messages { display: flex; flex-direction: column; gap: 18px; padding: 25px 24px 21px; min-height: 180px; }
.bubble { max-width: 86%; padding: 16px 19px; border-radius: 17px; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble small { display: block; font-size: 12px; color: #a5aaa1; line-height: 1.6; margin-top: 9px; }
.bubble.ai { align-self: flex-start; border: 1px solid rgba(231, 188, 88, .12); border-bottom-left-radius: 5px; background: #1a1e1f; }
.bubble.you { align-self: flex-end; border: 1px solid #c7a354; border-bottom-right-radius: 5px; background: linear-gradient(135deg, #ebc86f, #c9973e); color: #201a0e; }
.composer { margin: 0 22px 22px; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px 10px; border-radius: 16px; border: 1px solid rgba(231, 188, 88, .25); background: #090d0e; }
.composer:focus-within { border-color: #b39047; box-shadow: 0 0 0 3px rgba(231, 188, 88, .05); }
.composer textarea { display: block; width: 100%; min-width: 0; min-height: 48px; max-height: 180px; resize: none; overflow-y: auto; padding: 11px 7px; margin: 0; border: 0; border-radius: 6px; outline: none; background: transparent; color: #f2eee4; font-size: 16px; line-height: 1.55; }
.composer textarea::placeholder { color: #8d948d; }
.composer button, .confirm-actions button, .chat-checkout-btn { border: 1px solid #ecc76b; border-radius: 11px; background: linear-gradient(145deg, #f2d38a, #d8aa48); color: #201a0e; font-weight: 750; }
.composer button { height: 48px; padding: 0; font-size: 26px; align-self: end; }
.composer-hint { grid-column: 1 / -1; font-size: 11px; color: #91998f; padding-left: 7px; line-height: 1.5; }
.composer-error { display: none; grid-column: 1 / -1; color: #f2a898; font-size: 13px; line-height: 1.5; padding: 4px 7px; }
.composer-error.show { display: block; }
.composer.sending textarea, .composer.sending button { opacity: .6; }
.composer.sending button { pointer-events: none; }
.typing-bubble { display: none; align-items: center; flex-wrap: wrap; gap: 5px; }
.typing-bubble.show { display: flex; }
.typing-bubble i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); animation: chat-dot 1.2s ease-in-out infinite; }
.typing-bubble i:nth-child(2) { animation-delay: .15s; }
.typing-bubble i:nth-child(3) { animation-delay: .3s; }
.typing-bubble small { margin: 0 0 0 7px; }
@keyframes chat-dot { 0%, 70%, 100% { opacity: .4; } 35% { opacity: 1; } }
.brief-ready { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 15px; padding: 21px; border: 1px solid rgba(231, 188, 88, .32); border-radius: 17px; background: linear-gradient(145deg, #292517, #141817); overflow-wrap: anywhere; }
.ready-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); color: var(--gold); background: #252317; }
.brief-ready > div > span { color: #d6bb76; font-size: 11px; letter-spacing: .06em; }
.brief-ready h2 { font-size: 23px; line-height: 1.25; font-weight: 550; margin: 8px 0 18px; }
.brief-ready > div > p { font-size: 14px; line-height: 1.65; color: #c3c6bc; }
.brief-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.brief-summary p { margin: 0; padding: 14px; border-radius: 10px; background: #0003; font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.brief-summary p.wide { grid-column: 1 / -1; }
.brief-summary b { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 500; color: #a6aa9c; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.confirm-actions form { margin: 0; }
.confirm-actions button, .chat-checkout-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 18px; font-size: 14px; line-height: 1.5; }
.confirm-actions .ghost { background: #ffffff05; border-color: #ffffff26; color: #deded4; font-weight: 500; }
.chat-checkout-btn { margin-top: 8px; }
.chat-bottom { text-align: center; padding: 23px 0 0; font-size: 12px; line-height: 1.6; color: #a5aaa0; }
.chat-bottom strong { display: block; font-weight: 500; color: #cbbc94; }
.chat-bottom span { display: block; margin-top: 5px; }
.chat-bottom a { display: inline-flex; align-items: center; min-height: 44px; color: #dfc685; margin-top: 6px; }
@media (max-width: 600px) {
  .chat-top { width: calc(100% - 36px); min-height: 74px; gap: 14px; }
  .chat-logo { font-size: 24px; }
  .chat-top-actions { gap: 14px; }
  .chat-top-actions a { font-size: 12px; }
  .chat-shell { width: calc(100% - 28px); padding-bottom: env(safe-area-inset-bottom, 16px); }
  .chat-heading { padding: 26px 6px 21px; }
  .chat-heading h1 { font-size: 29px; }
  .chat-heading > p:last-child { font-size: 13px; }
  .chat-kicker { font-size: 9px; letter-spacing: .11em; }
  .journey { font-size: 11px; gap: 7px; margin-bottom: 20px; }
  .journey b { flex: 1; max-width: 16px; min-width: 4px; }
  .chat-panel { border-radius: 17px; }
  .chat-intro { padding: 16px 15px; gap: 10px; }
  .ai-avatar { width: 36px; height: 36px; border-radius: 10px; }
  .chat-intro b { font-size: 13px; }
  .chat-intro div > span { font-size: 11px; max-width: 145px; line-height: 1.5; }
  .chat-order-number { font-size: 10px; padding: 6px 8px; }
  .messages { padding: 20px 13px; gap: 16px; min-height: 0; }
  .bubble { max-width: 94%; padding: 14px 15px; font-size: 15px; }
  .composer { margin: 0 10px 12px; padding: 8px; gap: 7px; grid-template-columns: minmax(0, 1fr) 46px; }
  .composer textarea { padding-left: 6px; }
  .composer-hint { font-size: 10px; }
  .brief-ready { grid-template-columns: minmax(0, 1fr); padding: 17px 15px; gap: 13px; }
  .brief-summary { grid-template-columns: minmax(0, 1fr); }
  .brief-ready h2 { font-size: 22px; }
  .confirm-actions { flex-direction: column; }
  .confirm-actions form, .confirm-actions button, .chat-checkout-btn { width: 100%; }
  .chat-bottom { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; }
}
