/* AI assistant: isolated page and reusable chat components. */
.assistant-entry {
  flex: 0 0 auto; display: flex; align-items: center; gap: 14px;
  margin: 0 14px 12px; padding: 12px 16px; width: calc(100% - 28px);
  border: 1px solid #243951; border-radius: 18px; text-align: left;
  background: linear-gradient(110deg, #0b1928, #101b2b); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.assistant-entry:hover { border-color: #19b9b7; background: #102334; }
.assistant-entry__copy { display: grid; gap: 3px; min-width: 0; }
.assistant-entry__copy strong { font-size: 15px; }
.assistant-entry__copy small { color: #a4bddb; font-size: 12px; }
.assistant-entry__arrow { margin-left: auto; color: #02d9d3; }
.assistant-entry__arrow svg { width: 20px; height: 20px; }
.assistant-icon { display: inline-flex; flex: 0 0 auto; width: 38px; height: 38px; color: #0aebe1; }
.assistant-icon svg { width: 100%; height: 100%; stroke-width: 2; overflow: visible; }
.assistant-spark { stroke: none; fill: currentColor; transform-origin: 25px 25px; }
.assistant-icon--animated { animation: assistant-glow 3.6s ease-in-out infinite; }
.assistant-icon--animated .assistant-spark { animation: assistant-shimmer 3.6s ease-in-out infinite; }
/* Avoid continuously rebuilding filter layers inside the iOS scroll view. */
@supports (-webkit-touch-callout: none) {
  .assistant-entry .assistant-icon--animated,
  .assistant-entry .assistant-icon--animated .assistant-spark { animation: none; }
}
@keyframes assistant-glow { 0%, 100% { filter: drop-shadow(0 0 2px #00d8d330); } 50% { filter: drop-shadow(0 0 9px #00d8d380); } }
@keyframes assistant-shimmer { 0%, 100% { opacity: .78; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.08) rotate(8deg); } }
.assistant-page {
  --assistant-height: 100dvh; width: min(100%, 560px); height: var(--assistant-height);
  margin: 0 auto; display: flex; flex-direction: column; overflow: hidden;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: radial-gradient(ellipse at 50% 25%, #0c203036, transparent 60%), #080f1c;
  border-inline: 1px solid #192c41;
}
.assistant-header { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; min-height: 76px; padding: 14px 14px; border-bottom: 1px solid #1b3047; }
.assistant-back { display: flex; align-items: center; gap: 5px; padding: 8px 0; border: 0; background: none; color: #a9d2f5; cursor: pointer; width: 83px; }
.assistant-back svg { width: 20px; height: 24px; }
.assistant-heading { display: grid; gap: 4px; text-align: center; flex: 1; }
.assistant-heading strong { font-size: 16px; }
.assistant-heading small { color: #a4c9ec; font-size: 12px; }
.assistant-history { width: 44px; height: 44px; margin-left: 39px; padding: 8px; color: #9ec7ee; background: none; border: 0; border-radius: 12px; cursor: pointer; }
.assistant-history:hover { background: #132137; }
.assistant-history svg { width: 28px; height: 28px; }
.assistant-content { flex: 1; min-height: 0; padding: 24px 20px 12px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #233d54 transparent; }
.assistant-welcome { text-align: center; padding: clamp(20px, 6vh, 65px) 10px 24px; }
.assistant-icon--hero { width: 82px; height: 82px; margin-bottom: 28px; }
.assistant-welcome h1 { margin: 0 0 10px; font-size: clamp(26px, 6vw, 34px); letter-spacing: -.025em; }
.assistant-welcome p { color: #98b5d9; font-size: 18px; line-height: 1.5; max-width: 320px; margin: 0 auto; }
.assistant-prompts { display: grid; gap: 14px; margin-top: 8px; }
.assistant-prompt { width: 100%; display: flex; align-items: center; gap: 17px; min-height: 72px; padding: 16px 18px; text-align: left; border: 1px solid #234461; border-radius: 15px; background: linear-gradient(120deg, #0b1a2a, #101a2c); cursor: pointer; }
.assistant-prompt strong { flex: 1; font-size: 15px; line-height: 1.5; }
.assistant-prompt__icon { color: #13dcd7; }
.assistant-prompt__icon svg { width: 27px; height: 27px; }
.assistant-prompt__arrow { color: #9bc7ed; }
.assistant-prompt__arrow svg { width: 17px; height: 22px; }
.assistant-composer { display: flex; align-items: flex-end; gap: 12px; flex: 0 0 auto; margin: 12px 14px 0; padding: 10px; border: 1px solid #28415f; border-radius: 18px; background: linear-gradient(120deg, #0e1a2a, #101b2d); }
.assistant-composer:focus-within { border-color: #0dbbb9; }
.assistant-composer textarea { flex: 1; min-width: 0; resize: none; min-height: 48px; max-height: 110px; background: none; border: 0; outline: none; color: #eff5ff; font: inherit; font-size: 16px; line-height: 24px; padding: 12px 6px; }
.assistant-composer textarea::placeholder { color: #97b8dd; }
.assistant-composer button { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; border: 1px solid #18fff0; background: linear-gradient(130deg, #00e5df, #02bcb7); color: #032332; cursor: pointer; box-shadow: 0 0 18px #00d9d31a; }
.assistant-composer button svg { width: 24px; height: 24px; margin: auto; stroke: none; fill: currentColor; }
.assistant-composer button:disabled { opacity: .45; cursor: default; }
.assistant-footnote { flex: 0 0 auto; font-size: 10px; color: #6e8aa5; text-align: center; margin: 7px 0 9px; }
.assistant-message { max-width: 100%; margin-bottom: 25px; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.assistant-message--user { max-width: 87%; width: fit-content; margin-left: auto; background: #043341; border: 1px solid #0b5366; border-radius: 19px 19px 5px 19px; padding: 13px 18px 9px; }
.assistant-message--user p { margin: 0; white-space: pre-wrap; }
.assistant-message time { color: #9ac0e1; font-size: 11px; font-weight: 400; }
.assistant-message--user time { display: block; text-align: right; margin-top: 4px; }
.assistant-message__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; color: #acd7ff; font-size: 13px; }
.assistant-message__meta .assistant-icon { width: 32px; height: 32px; }
.assistant-message__meta time { margin-left: 3px; }
.assistant-bubble { margin-left: 44px; padding: 14px 16px; background: linear-gradient(125deg, #152136, #192437); border: 1px solid #304966; border-radius: 19px 19px 19px 5px; }
.assistant-bubble p { margin: 0 0 12px; }
.assistant-bubble p:last-child { margin-bottom: 0; }
.assistant-bubble ul, .assistant-bubble ol { padding-left: 20px; margin: 8px 0; }
.assistant-bubble li + li { margin-top: 6px; }
.assistant-bubble a { color: #1de1d8; text-underline-offset: 3px; }
.assistant-bubble em { color: #c5d6e9; }
.assistant-feedback { display: flex; gap: 12px; margin: 10px 0 0 43px; }
.assistant-feedback__button { color: #9fc3e7; width: 38px; height: 36px; border: 1px solid transparent; border-radius: 10px; background: none; padding: 7px; cursor: pointer; }
.assistant-feedback__button svg { width: 23px; height: 23px; }
.assistant-feedback__button[aria-pressed="true"] { color: #0febd8; background: #063a40; border-color: #167b80; }
.assistant-feedback__button:disabled { opacity: .5; }
.assistant-followups { display: grid; gap: 10px; margin-left: 44px; }
.assistant-followup { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #294a68; border-radius: 20px; padding: 12px 15px; background: #0c192a; color: #abd4f7; text-align: left; cursor: pointer; }
.assistant-followup svg { width: 15px; height: 20px; flex-shrink: 0; }
.assistant-typing { width: 90px; display: flex; gap: 7px; align-items: center; min-height: 48px; }
.assistant-typing span { height: 6px; width: 6px; border-radius: 50%; background: #10d9d3; animation: assistant-dot 1.2s ease-in-out infinite; }
.assistant-typing span:nth-child(2) { animation-delay: .15s; }
.assistant-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes assistant-dot { 0%, 70%, 100% { opacity: .3; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-4px); } }
.assistant-notice { margin: 8px 16px 0; padding: 10px 12px; border: 1px solid #794d41; color: #ffd5bf; border-radius: 12px; font-size: 12px; background: #291b20; }
.assistant-history-heading { display: grid; gap: 16px; margin-bottom: 24px; }
.assistant-history-heading h1 { margin: 0; font-size: 24px; }
.assistant-new, .assistant-earlier, .assistant-retry { border: 1px solid #23606a; border-radius: 12px; color: #25e6d7; background: #0c2733; padding: 11px 15px; cursor: pointer; }
.assistant-earlier { display: block; margin: 0 auto 20px; font-size: 12px; }
.assistant-history-empty { color: #96b1d0; text-align: center; padding: 30px 0; }
.assistant-conversation { width: 100%; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 14px; background: #101d2f; border: 1px solid #28415c; border-radius: 16px; text-align: left; cursor: pointer; }
.assistant-conversation__copy { flex: 1; min-width: 0; display: grid; gap: 5px; }
.assistant-conversation__copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-conversation__copy small { color: #89a9cc; }
.assistant-conversation > span:last-child svg { width: 16px; height: 22px; color: #97c1e5; }
@media (max-width: 360px) {
  .assistant-content { padding-inline: 12px; }
  .assistant-heading strong { font-size: 14px; }
  .assistant-history { margin-left: 10px; }
  .assistant-back { width: 70px; }
  .assistant-bubble { margin-left: 30px; }
  .assistant-welcome { padding-top: 16px; }
  .assistant-icon--hero { width: 60px; height: 60px; margin-bottom: 18px; }
  .assistant-welcome p { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .assistant-icon--animated, .assistant-icon--animated .assistant-spark, .assistant-typing span { animation: none; }
}
