/* Ask Praxiom: full-screen chat.
   Ported from Beautiful UI (beautifului.dev/r/*.json): Shimmer (thinking label), StreamText (blur tail + caret),
   StreamingText (action row: copy / retry, follow-up prompts), pop-in keyframes, hairline-ring surfaces,
   press scale .96. Mapped onto the site tokens (navy ink, gold focus). */
.section-chat { background: var(--paper); overflow: hidden; }
.chat-app { height: 100dvh; display: grid; grid-template-rows: auto 1fr; }

/* top bar */
.chat-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; height: 60px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--border); }
.chat-back { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 8px 10px; margin-left: -6px; border-radius: 10px; text-decoration: none; font-size: var(--text-sm); color: var(--text-2); transition: background-color var(--d-fast), color var(--d-fast); }
@media (hover: hover) and (pointer: fine) { .chat-back:hover { background: var(--surface-muted); color: var(--ink); } }
.chat-id { display: flex; align-items: center; gap: 10px; }
.chat-id img { border-radius: 8px; }
.chat-id span { display: grid; line-height: 1.15; }
.chat-id b { font: 600 .9375rem/1.2 var(--f-display); }
.chat-id small { font-size: .75rem; color: var(--text-3); }
.chat-bar-actions { justify-self: end; display: flex; gap: 6px; align-items: center; }
.chat-bar-actions form { margin: 0; }
@media (max-width: 640px) { .chat-back span, .chat-bar-actions .btn span, .chat-id small, .chat-signin { display: none; } .chat-bar { grid-template-columns: auto 1fr auto; } .chat-id { justify-self: center; } }

/* main */
.chat-main { min-height: 0; display: grid; grid-template-rows: 1fr auto; }
.chat-scroll { overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.chat-col { width: min(100% - 32px, 760px); margin-inline: auto; }
.chat-scroll .chat-col { padding: 28px 0 24px; }

/* empty state */
.chat-empty { min-height: calc(100dvh - 300px); display: grid; align-content: center; justify-items: center; text-align: center; gap: 12px; padding: 24px 0; animation: pop-in 280ms cubic-bezier(.23, 1, .32, 1) both; }
.chat-empty-logo { border-radius: 14px; box-shadow: 0 0 0 1px var(--border), 0 8px 24px -10px rgb(7 29 58 / .25); }
.chat-empty h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem); letter-spacing: -.03em; max-width: 22ch; }
.chat-empty > p { margin: 0; color: var(--text-2); max-width: 52ch; }
.chat-suggest { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
@media (max-width: 640px) { .chat-suggest { grid-template-columns: 1fr; } }
.chat-chip { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgb(7 29 58 / .04); color: var(--ink); font-size: var(--text-sm); font-weight: 500; line-height: 1.35; cursor: pointer; transition: box-shadow 150ms ease-out, background-color 150ms ease-out, transform 150ms ease-out; }
.chat-chip i { color: var(--text-3); flex: none; }
.chat-chip:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .chat-chip:hover { box-shadow: 0 0 0 1px var(--border-strong), 0 4px 12px -4px rgb(7 29 58 / .14); } }
.chat-note { display: inline-flex; gap: 6px; align-items: center; font-size: var(--text-xs); color: var(--text-3); margin: 4px 0 0; }

/* thread */
.chat-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.msg { display: grid; gap: 6px; animation: pop-in 250ms cubic-bezier(.23, 1, .32, 1) both; }
.msg-you { justify-items: end; }
.msg-bubble { max-width: min(85%, 560px); padding: 11px 15px; border-radius: 18px 18px 6px 18px; background: var(--ink); color: #fff; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.msg-quote { max-width: min(85%, 560px); margin: 0; padding: 6px 10px; border-radius: 10px; background: rgb(242 183 5 / .14); color: var(--text-2); font-size: var(--text-xs); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg-bot { grid-template-columns: 28px 1fr; align-items: start; gap: 12px; }
.msg-avatar { border-radius: 8px; margin-top: 2px; }
.msg-body { min-width: 0; display: grid; gap: 8px; }
.msg-text { color: var(--ink); line-height: 1.65; font-size: 1rem; overflow-wrap: anywhere; }
.msg-text p { margin: 0 0 .85em; }
.msg-text p:last-child { margin-bottom: 0; }
.msg-thinking { padding: 4px 0; font-weight: 500; font-size: var(--text-sm); }

/* Beautiful UI Shimmer */
.shimmer { display: inline-block; background-image: linear-gradient(90deg, var(--text-3) 35%, var(--ink) 50%, var(--text-3) 65%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer-text 1.8s linear infinite; }
@keyframes shimmer-text { from { background-position: 150% center; } to { background-position: -50% center; } }
/* Beautiful UI StreamText */
.stream-tail { filter: blur(1.6px); -webkit-mask-image: linear-gradient(to right, #000 20%, rgb(0 0 0 / .2)); mask-image: linear-gradient(to right, #000 20%, rgb(0 0 0 / .2)); }
.stream-caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 1.5px; border-radius: 1px; background: var(--ink); vertical-align: text-bottom; }
@keyframes pop-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* actions row (Beautiful UI StreamingText action icons) */
.msg-actions { display: flex; gap: 2px; align-items: center; }
.msg-you .msg-actions { opacity: 0; transition: opacity 150ms ease-out; }
.msg-you:hover .msg-actions, .msg-you:focus-within .msg-actions { opacity: 1; }
@media (hover: none) { .msg-you .msg-actions { opacity: 1; } }
.msg-act { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); font-size: var(--text-xs); font-weight: 500; cursor: pointer; transition: background-color 150ms ease-out, color 150ms ease-out, transform 150ms ease-out; }
.msg-act i { font-size: 1rem; }
.msg-act:active { transform: scale(.96); }
.msg-act.is-done { color: var(--success); }
@media (hover: hover) and (pointer: fine) { .msg-act:hover { background: var(--surface-muted); color: var(--ink); } }
.msg-follow { display: grid; gap: 6px; margin-top: 4px; }
.msg-follow .chat-chip { width: fit-content; max-width: 100%; padding: 9px 12px; }

/* composer */
.chat-composer { padding: 10px 0 14px; background: linear-gradient(to top, var(--paper) 70%, rgb(245 246 244 / 0)); }
.composer-reply { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 6px 6px 12px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--border); font-size: var(--text-sm); color: var(--text-2); animation: pop-in 200ms ease-out both; }
.composer-reply span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-reply > i { color: var(--gold); flex: none; }
.composer-box { display: grid; gap: 4px; padding: 10px 10px 8px 14px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px var(--border-strong), 0 6px 20px -10px rgb(7 29 58 / .22); transition: box-shadow 150ms ease-out; }
.composer-box:focus-within { box-shadow: 0 0 0 1px var(--ink), 0 0 0 4px rgb(242 183 5 / .3), 0 6px 20px -10px rgb(7 29 58 / .22); }
.composer-box textarea { width: 100%; min-height: 26px; max-height: 200px; border: 0; outline: 0; resize: none; background: transparent; font-size: 1rem; line-height: 1.5; padding: 2px 0; color: var(--ink); }
.composer-box textarea::placeholder { color: var(--text-3); }
.composer-tools { display: flex; align-items: center; gap: 8px; }
.composer-count { margin-left: auto; font-size: var(--text-xs); color: var(--text-3); }
.composer-send { width: 36px; height: 36px; flex: none; border-radius: 999px; border: 0; display: grid; place-items: center; font-size: 1.1rem; color: #fff; background: linear-gradient(var(--ink-3), var(--ink-2)); box-shadow: 0 0 0 1px #04142a, inset 0 1px 0 rgb(255 255 255 / .1); cursor: pointer; transition: transform 150ms ease-out, opacity 150ms ease-out; }
.composer-send:active { transform: scale(.94); }
.composer-send:disabled { opacity: .35; cursor: not-allowed; }
.composer-hint { margin: 8px 4px 0; font-size: .6875rem; line-height: 1.45; color: var(--text-3); text-align: center; }
.chat-main .crisis { margin-bottom: 24px; }

@media (prefers-reduced-motion: reduce) {
  .shimmer { animation: none; color: var(--text-2); background: none; }
  .stream-tail { filter: none; -webkit-mask-image: none; mask-image: none; }
  .msg, .chat-empty, .composer-reply { animation: none; }
}

/* Links chosen by Jev to go with an answer */
.msg-links { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.msg-links a { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; padding: 10px 14px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--border); color: var(--ink); text-decoration: none; transition-property: box-shadow, transform; transition-duration: 150ms; transition-timing-function: ease-out; }
.msg-links small { grid-column: 1; font-size: var(--text-xs); color: var(--text-3); }
.msg-links b { grid-column: 1; font-weight: 600; line-height: 1.35; }
.msg-links i { grid-column: 2; grid-row: 1 / span 2; color: var(--text-3); transition: transform 150ms ease-out; }
@media (hover: hover) and (pointer: fine) { .msg-links a:hover { box-shadow: 0 0 0 1px var(--border-strong); } .msg-links a:hover i { transform: translateX(2px); } }
