/* css/chat-page.css - the AI chat page (chat.html), Renee 11/16: an AI answer reads as a document. Self-contained under .cqp so it looks right both in the V2 shell
   (the legacy shell moves the page into it) and on the classic rail. Colours are the existing V2 tokens (fallbacks are the same values). Answer typography is the
   .aiq-* set from js/ai-answer.js, shared with the agent answer pages. */
.cqp{ --q-ink: var(--ink, #1F2A2E); --q-act: var(--act, #0F3D3A); --q-muted: var(--muted, #6B6B62); --q-serif: var(--serif, 'Fraunces', serif); --q-sans: var(--sans, 'DM Sans', sans-serif); --q-mono: var(--mono, 'DM Mono', monospace);
  font-family: var(--q-sans); color: var(--q-ink); max-width: 1180px; margin: 0 auto; padding: 18px 26px 24px; width: 100%; }
.cqp .cq-card{ background: #FFFEFB; border: 1px solid #EAE3D6; border-radius: 16px; padding: 20px 22px; margin: 0 0 16px; box-shadow: 0 1px 2px rgba(60,50,30,.04); }
.cqp .cq-card.warn{ background: #FFF6E6; border-color: #F0D9A8; }
.cqp .cq-btn{ display: inline-flex; gap: 7px; align-items: center; height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid #DCD3C2; background: #fff; color: var(--q-ink); font: 600 14px var(--q-sans); cursor: pointer; }
.cqp .cq-btn:hover{ border-color: #C9BFAA; background: #FBF8F1; } .cqp .cq-btn.pri{ background: var(--q-act); border-color: var(--q-act); color: #fff; } .cqp .cq-btn.quiet{ border-color: transparent; background: transparent; color: var(--q-muted); height: 32px; padding: 0 10px; }
.cqp .cq-btn[disabled]{ opacity: .45; cursor: not-allowed; }
.cqp .cq-ic{ flex: 0 0 auto; }
.cqp .aiq-pill{ display: inline-block; padding: 2px 10px; border-radius: 999px; font: 600 12.5px/1.5 var(--q-sans); background: #EFE9DC; color: #4A4538; }
.cqp .aiq-pill.rose{ background: #F7E2DF; color: #9F2D2D; } .cqp .aiq-pill.amber{ background: #FCEBC3; color: #7A4F08; } .cqp .aiq-pill.mint{ background: #DCEFE7; color: #1E5B53; } .cqp .aiq-pill.blue{ background: #DDE8F4; color: #254B7A; }
.cqp .cq-fold{ margin-top: 12px; border-top: 1px solid #EFE9DC; padding-top: 8px; } .cqp .cq-fold summary{ cursor: pointer; font: 600 14px var(--q-sans); padding: 6px 0; display: flex; gap: 8px; align-items: center; list-style: none; } .cqp .cq-fold summary::-webkit-details-marker{ display: none; }
.cqp .cq-fold summary::before{ content: '›'; display: inline-block; transition: transform .15s; font-size: 18px; line-height: 1; } .cqp .cq-fold[open] summary::before{ transform: rotate(90deg); }
.cqp .cq-warnrow{ display: flex; gap: 10px; align-items: center; margin: 0 0 8px; } .cqp .cq-warnrow h2{ font: 600 19px var(--q-serif); margin: 0; }
.cqp .cq-empty{ margin: 8vh 0 0; } .cqp .tdots{ display: flex; gap: 5px; }

.cqp .cq{ max-width: 1180px; }
.cqp .cq-head{ display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin: 4px 0 14px; padding-right: 130px; }
.cqp .cq-head h1{ font: 700 30px/1.2 var(--q-serif); margin: 0; color: var(--q-ink); } .cqp .cq-head p{ margin: 6px 0 0; font-size: 14.5px; color: var(--q-muted); max-width: 640px; line-height: 1.5; }
.cqp .cq-first .cq-big{ font: 600 26px/1.25 var(--q-serif); margin: 0 0 8px; color: var(--q-ink); }
.cqp .cq-box{ display: flex; gap: 10px; align-items: flex-end; border: 1px solid #E0D9CB; border-radius: 14px; background: #FFFEFB; padding: 10px 10px 10px 16px; }
.cqp .cq-box:focus-within{ outline: 2px solid var(--q-act); outline-offset: 1px; }
.cqp .cq-box textarea{ flex: 1; border: 0; outline: 0; background: none; resize: none; font: 16px/1.55 var(--q-sans); color: var(--q-ink); min-height: 28px; max-height: 140px; padding: 6px 0; }
.cqp .cq-send{ height: 42px; padding: 0 18px; flex: 0 0 auto; } .cqp .cq-send[disabled]{ opacity: .45; cursor: not-allowed; }
.cqp .cq-hint{ margin: 8px 2px 0; font-size: 12.5px; color: var(--q-muted); line-height: 1.5; max-width: 880px; }
.cqp .cq-composer{ margin: 14px 0 0; } .cqp .cq-composer:not(.first){ position: sticky; bottom: 0; background: linear-gradient(to top, #F7F1E7 78%, rgba(247,241,231,0)); padding: 18px 0 10px; z-index: 3; }
.cqp .cq-ex{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } .cqp .cq-exb{ text-align: left; padding: 12px 14px; border: 1px solid #E5DECF; border-radius: 10px; background: #fff; cursor: pointer; font: 14px/1.4 var(--q-sans); color: var(--q-ink); display: flex; flex-direction: column; gap: 3px; }
.cqp .cq-exb:hover{ border-color: #C9BFAA; background: #FBF8F1; } .cqp .cq-exb span{ font-size: 12.5px; color: var(--q-muted); }
/* a turn: the question is the document's title, the answer is its body */
.cqp .cq-turn{ margin: 0 0 16px; }
.cqp .cq-q{ padding-bottom: 12px; border-bottom: 1px solid #EFE9DC; } .cqp .cq-qlbl{ font: 700 11px/1 var(--q-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--q-muted); }
.cqp .cq-q h2{ font: 600 22px/1.35 var(--q-serif); margin: 6px 0 0; color: var(--q-ink); } .cqp .cq-meta{ margin: 6px 0 0; font-size: 13px; color: var(--q-muted); }
.cqp .cq-acts{ display: flex; gap: 10px; align-items: center; margin: 10px 0 0; } .cqp .cq-acts .cq-btn, .cqp .cq-ct{ margin-left: 0; }
.cqp .cq-body{ margin: 6px 0 0; max-width: 1080px; font-size: 15.5px; line-height: 1.65; color: var(--q-ink); }
.cqp .cq-body p{ margin: 10px 0; } .cqp .cq-body .aiq-h{ font: 600 19px/1.3 var(--q-serif); margin: 22px 0 8px; color: var(--q-ink); } .cqp .cq-body h3.aiq-h:first-child{ margin-top: 12px; }
.cqp .cq-body .aiq-rule{ border: 0; border-top: 1px solid #E6DFD0; margin: 18px 0; } .cqp .cq-body .aiq-list{ margin: 8px 0 8px 22px; } .cqp .cq-body .aiq-list li{ margin: 5px 0; }
.cqp .cq-body .aiq-pre{ margin: 8px 0; padding: 12px; border: 1px solid #EFE9DC; border-radius: 10px; background: #FBF8F1; font: 12.5px/1.5 var(--q-mono); white-space: pre-wrap; overflow: auto; }
.cqp .cq-body code{ font: 13px var(--q-mono); background: #F3EDE0; padding: 1px 5px; border-radius: 4px; }
.cqp .cq-body .md-link{ color: var(--q-act); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
/* real tables: their own scroll box, so the PAGE never scrolls sideways */
.cqp .aiq-tablewrap{ overflow-x: auto; border: 1px solid #EAE3D6; border-radius: 12px; background: #FFFEFB; margin: 8px 0 14px; max-width: 100%; -webkit-overflow-scrolling: touch; }
.cqp .aiq-tablewrap:focus-visible{ outline: 2px solid var(--q-act); }
.cqp .aiq-table{ width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.cqp .aiq-table th{ text-align: left; padding: 10px 14px; font: 700 11px/1.2 var(--q-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--q-muted); background: #FBF8F1; border-bottom: 1px solid #EAE3D6; white-space: nowrap; position: sticky; top: 0; }
.cqp .aiq-table td{ padding: 11px 14px; border-top: 1px solid #EFE9DC; vertical-align: top; } .cqp .aiq-table tbody tr:first-child td{ border-top: 0; } .cqp .aiq-table tbody tr:hover td{ background: #FBF8F1; }
.cqp .aiq-table th.n, .cqp .aiq-table td.n{ text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; } .cqp .aiq-table th.c, .cqp .aiq-table td.c{ text-align: center; }
.cqp .aiq-table td.f{ white-space: nowrap; font-weight: 600; } .cqp .aiq-date{ white-space: nowrap; } .cqp .aiq-table .aiq-pill{ white-space: nowrap; }
.cqp .aiq-table tr:last-child td strong{ font-weight: 700; }
/* the old query trace, folded under every answer */
.cqp .cq-how{ margin-top: 12px; } .cqp .cq-how summary small{ font-weight: 400; color: var(--q-muted); margin-left: 8px; }
.cqp .cq-step{ display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid #EFE9DC; font-size: 13.5px; flex-wrap: wrap; } .cqp .cq-step:first-child{ border-top: 0; }
.cqp .cq-ok{ color: #1E6B4C; display: inline-flex; } .cqp .cq-ok.bad{ color: #9F2D2D; } .cqp .cq-purpose{ flex: 1; min-width: 200px; } .cqp .cq-meta{ color: var(--q-muted); font-size: 12.5px; }
.cqp .cq-sqlb{ height: 28px; padding: 0 10px; margin-left: 0; } .cqp .cq-sql{ margin: 4px 0 8px; padding: 12px; border-radius: 10px; background: #254859; color: #E3EDF1; font: 12px/1.5 var(--q-mono); white-space: pre-wrap; }
/* waiting */
.cqp .cq-wait{ display: flex; gap: 14px; align-items: center; padding: 18px 0 6px; } .cqp .cq-wait .tdots{ display: flex; gap: 5px; } .cqp .cq-wait .tdots span{ width: 9px; height: 9px; border-radius: 50%; background: var(--q-act); opacity: .35; animation: cqb 1.2s infinite; } .cqp .cq-wait .tdots span:nth-child(2){ animation-delay: .2s } .cqp .cq-wait .tdots span:nth-child(3){ animation-delay: .4s }
@keyframes cqb{ 0%,80%,100%{ opacity: .3; transform: translateY(0) } 40%{ opacity: 1; transform: translateY(-4px) } }
@media (prefers-reduced-motion: reduce){ .cqp .cq-wait .tdots span{ animation: none; opacity: .7; } }
@media (max-width: 900px){ .cqp .cq-ex{ grid-template-columns: repeat(2, minmax(0, 1fr)); } .cqp .cq-q h2{ font-size: 19px; } .cqp .cq-head h1{ font-size: 25px; } .cqp .cq-body{ font-size: 15px; } }

.cqp .cq-lead{ margin: 0 0 14px; font-size: 14.5px; line-height: 1.55; color: var(--q-muted); max-width: 760px; }
.cqp .cq-sub{ font-size: 13px; color: var(--q-muted); margin-top: 2px; }
.cqp .cq-err p{ margin: 0 0 10px; font-size: 14.5px; line-height: 1.55; }
.cqp .banner{ margin: 8px 0 0; }
.cqp .cq-composer .cq-box{ flex-wrap: wrap; }
.cqp .aiq-quote{ margin: 10px 0; padding: 8px 14px; border-left: 3px solid #D9CBF0; background: #FBF8F1; color: var(--q-muted); border-radius: 0 8px 8px 0; }
