/* Assistant (RWT_ASSISTANT=on). S1 tokens only; colour carries meaning (late/soon/wait/ok), nothing else.
 * A popover under the top bar's Ask button (400 x up to 640), a bottom sheet on a phone. It closes by its X, Escape, or a click outside it. */
html[data-rwt-assistant="on"] .rwt-help-trigger, html[data-rwt-assistant="on"] .rwt-assistant { display: none !important; }
.asst-ico { display: inline-flex; align-items: center; flex: none; }
.asst-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* panel */
.asst-expand { min-height: 32px; }
.s1-panel.asst-panel.asst-panel--wide { top: 0; right: 0; bottom: 0; height: 100dvh; width: min(max(48vw, 480px), 100vw); border-radius: 0; border-width: 0 0 0 1px; transform-origin: right center; }
.asst-panel--wide .asst-head { border-radius: 0; }
.asst-panel--wide .asst-text, .asst-panel--wide .asst-md { max-width: 80ch; }
@media (max-width: 640px) { .asst-expand { min-height: 44px; min-width: 44px; } .s1-panel.asst-panel.asst-panel--wide { top: 0; left: 0; width: 100%; height: 100dvh; border-width: 0; } .asst-expand-label { display: none; } }
.s1-panel.asst-panel { position: fixed; top: 60px; right: 16px; z-index: 860; background: var(--s1-panel); border: 1px solid var(--s1-line); border-radius: 11px; box-sizing: border-box; width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 76px)); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 16px 48px rgb(17 19 24 / .22), 0 2px 8px rgb(17 19 24 / .08); transform-origin: bottom right; animation: s1-pop-in var(--s1-dur-3) var(--s1-ease-emph) both; }
.asst-head { flex: none; display: flex; align-items: center; gap: var(--s1-space-2); border-radius: 0; padding: var(--s1-space-3) var(--s1-space-4); }
.asst-panel .asst-head { border-radius: var(--s1-radius-panel) var(--s1-radius-panel) 0 0; }
.asst-title { display: inline-flex; align-items: center; gap: var(--s1-space-2); margin: 0; font: 700 var(--s1-fs-4)/1.3 var(--s1-font-display); letter-spacing: -.01em; }
.asst-ctx { margin: 0; flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .asst-ctx[hidden] { display: none; }
/* The header never overflows: the title takes the slack and shrinks, every button keeps its size, so the close button is always inside the panel. */
.asst-head { min-width: 0; box-sizing: border-box; max-width: 100%; }
.asst-head .asst-title { flex: 1 1 auto; min-width: 0; }
.asst-head > .s1-btn { flex: none; }
.asst-kbd { font: 600 var(--s1-text-micro)/1 var(--s1-font-ui); color: var(--s1-mute); border: 1px solid var(--s1-line); border-bottom-width: 2px; border-radius: 5px; padding: 3px 5px; background: var(--s1-panel); }
.asst-tabs { flex: none; flex-wrap: nowrap; gap: 0; padding: 0 var(--s1-space-2); border-top: 0; border-bottom: 1px solid var(--s1-line-soft); overflow-x: auto; scrollbar-width: none; }
.asst-tabs::-webkit-scrollbar { display: none; }
.asst-tabs .s1-tab { flex: 1 1 auto; justify-content: center; padding: var(--s1-space-3) calc(6px * var(--s1-scale, 1)); font-size: var(--s1-text-small); white-space: nowrap; min-height: 44px; box-sizing: border-box; }
.asst-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s1-space-3); padding: var(--s1-space-4); animation: s1-fade-in var(--s1-dur-2) var(--s1-ease) both; }
.asst-body--ask { overflow: hidden; }
.asst-quiet { margin: 0; color: var(--s1-mute); font: var(--s1-text-small)/1.5 var(--s1-font-ui); }
.asst-help-note { padding-top: var(--s1-space-1); }
.asst-h { margin: 0 0 var(--s1-space-2); font: 700 var(--s1-text-small)/1.4 var(--s1-font-ui); color: var(--s1-ink-2); }
.asst-status { margin: 0; }
/* rows */
.asst-list { display: grid; gap: var(--s1-space-1); }
.asst-row { display: flex; align-items: center; gap: var(--s1-space-3); width: 100%; min-height: 44px; box-sizing: border-box; padding: calc(8px * var(--s1-scale, 1)) var(--s1-space-3); border: 1px solid var(--s1-line-soft); border-radius: var(--s1-radius-control); color: var(--s1-ink); text-decoration: none; background: var(--s1-panel); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--s1-dur-1) var(--s1-ease), border-color var(--s1-dur-1) var(--s1-ease); }
.asst-row--static { cursor: default; }
.asst-row:hover { background: var(--s1-panel-head); border-color: var(--s1-line); }
.asst-row-text { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
.asst-row-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.asst-row-meta { color: var(--s1-mute); font-size: var(--s1-text-small); line-height: 1.4; overflow-wrap: anywhere; }
.asst-go { display: inline-flex; color: var(--s1-mute); flex: none; transition: transform var(--s1-dur-1) var(--s1-ease); }
.asst-row:hover .asst-go { transform: translateX(2px); color: var(--s1-ink); }
.asst-tone-red .asst-ico, .asst-tone-red .asst-row-meta { color: var(--s1-late); }
.asst-tone-amber .asst-ico, .asst-tone-amber .asst-row-meta { color: var(--s1-soon); }
.asst-tone-blue .asst-ico, .asst-tone-blue .asst-row-meta { color: var(--s1-wait); }
.asst-find { display: block; flex: none; }
.asst-find-out { display: grid; gap: var(--s1-space-4); animation: s1-rise-in var(--s1-dur-2) var(--s1-ease) both; }
.asst-section { display: block; }
/* states */
.asst-state { display: grid; justify-items: center; gap: var(--s1-space-2); text-align: center; padding: var(--s1-space-6) var(--s1-space-3); animation: s1-rise-in var(--s1-dur-2) var(--s1-ease) both; }
.asst-state-badge { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--s1-radius-pill); background: var(--s1-column); color: var(--s1-ink-2); }
.asst-state--ok .asst-state-badge { color: var(--s1-ok); }
.asst-state-title { margin: 0; font: 700 var(--s1-fs-4)/1.35 var(--s1-font-display); color: var(--s1-ink); text-wrap: balance; }
.asst-state-text { margin: 0; max-width: 34ch; color: var(--s1-mute); font: var(--s1-text-small)/1.55 var(--s1-font-ui); text-wrap: pretty; }
.asst-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s1-space-2); margin-top: var(--s1-space-2); }
/* Ask */
.asst-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; gap: var(--s1-space-4); align-content: start; padding-bottom: var(--s1-space-2); }
.asst-intro { display: grid; gap: var(--s1-space-2); }
.asst-chips { display: flex; flex-wrap: wrap; gap: var(--s1-space-2); }
.asst-msg { display: grid; gap: 4px; animation: s1-rise-in var(--s1-dur-2) var(--s1-ease) both; }
.asst-who { font: 700 var(--s1-text-micro)/1.4 var(--s1-font-ui); color: var(--s1-mute); text-transform: uppercase; letter-spacing: .04em; }
.asst-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 70ch; line-height: 1.55; }
.asst-md { white-space: normal; }
.asst-md > :first-child { margin-top: 0; } .asst-md > :last-child { margin-bottom: 0; }
.asst-md p, .asst-md ul, .asst-md ol, .asst-md pre, .asst-md blockquote { margin: 0 0 8px; }
.asst-md ul, .asst-md ol { padding-left: 20px; }
.asst-md .rwt-md-h { margin: 10px 0 4px; font-size: var(--s1-fs-4); font-weight: 600; }
.asst-md code { font-family: ui-monospace, monospace; font-size: var(--s1-fs-1); background: var(--s1-column); border-radius: 4px; padding: 1px 4px; }
.asst-md pre { background: var(--s1-column); border-radius: var(--s1-radius-control); padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.asst-md pre code { background: none; padding: 0; }
.asst-md blockquote { border-left: 3px solid var(--s1-line-strong); padding-left: 10px; }
.asst-md a { text-decoration: underline; }
.asst-md .rwt-md-table { overflow-x: auto; margin: 0 0 8px; border: 1px solid var(--s1-line-soft); border-radius: var(--s1-radius-control); }
.asst-md table { border-collapse: collapse; width: 100%; }
.asst-md th, .asst-md td { padding: 4px 8px; text-align: left; border-bottom: 1px solid var(--s1-line-soft); vertical-align: top; }
.asst-md th { background: var(--s1-panel-head); font-weight: 600; }
.asst-md tr:last-child td { border-bottom: 0; }
.asst-msg--user .asst-text { background: var(--s1-column); border-radius: var(--s1-radius-control); padding: calc(8px * var(--s1-scale, 1)) calc(12px * var(--s1-scale, 1)); width: fit-content; max-width: 100%; box-sizing: border-box; }
.asst-think { display: inline-flex; gap: 5px; padding: calc(6px * var(--s1-scale, 1)) 2px; }
.asst-think i { width: 6px; height: 6px; border-radius: 50%; background: var(--s1-mute); opacity: .35; animation: asst-dot 1.2s var(--s1-ease) infinite; }
.asst-think i:nth-child(2) { animation-delay: .15s; }
 .asst-think i:nth-child(3) { animation-delay: .3s; }
@keyframes asst-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.asst-proposal { margin-top: var(--s1-space-2); }
/* The composer is the Apex page's own (.comp .inp, redesign-v3.css and s1-messages.css); in the panel it sits on the panel, not in a tinted band. */
.asst-form.comp { flex: none; background: none; border-top: 1px solid var(--s1-line-soft); padding: var(--s1-space-3) 0 0; }
.asst-form.comp > * { max-width: none; }
.asst-form .fine { margin: 2px 0 0; }
.asst-msgline:empty { display: none; }
.asst-msgline .s1-btn { margin-left: 8px; vertical-align: middle; }
@media (max-width: 640px) {  .s1-panel.asst-panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: min(92dvh, 100dvh - 24px); border-width: 1px 0 0; border-radius: var(--s1-radius-panel) var(--s1-radius-panel) 0 0; transform-origin: bottom center; animation: s1-sheet-in var(--s1-dur-3) var(--s1-ease-emph) both; padding-bottom: env(safe-area-inset-bottom); }
  .asst-panel .asst-kbd { display: none !important; }
  .asst-form .inp textarea, .asst-find .s1-field-control { font-size: var(--s1-fs-4); }
  .asst-tabs .s1-tab { padding-left: 4px; padding-right: 4px; gap: 3px; font-size: var(--s1-text-small); }
  .asst-tabs .s1-tab .asst-ico { display: none; }
  .asst-body { padding: var(--s1-space-3); }
}
@media (forced-colors: active) { .asst-panel { border: 1px solid CanvasText; }
 .asst-row { border-color: CanvasText; }
}
.asst-av { display: inline-flex; flex: none; }
.asst-chip--person { display: inline-flex; align-items: center; gap: var(--s1-space-2); }
/* Suggestions tab */
.asst-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: var(--s1-radius-pill); background: var(--s1-ink); color: var(--s1-on-ink); font: 700 var(--s1-text-micro)/1 var(--s1-font-ui); }
.asst-sg { margin-top: var(--s1-space-2); }
.asst-panel .asst-tabs { flex-wrap: nowrap; overflow-x: auto; }
.asst-tabs .s1-tab { flex: 1 0 auto; padding-left: calc(6px * var(--s1-scale, 1)); padding-right: calc(6px * var(--s1-scale, 1)); }
.asst-tabs .s1-tab .asst-ico { display: none; }
.asst-tab-label { white-space: nowrap; }
.asst-badge { vertical-align: middle; }
/* "Open in Apex tab" link in the panel header */
.asst-agent { white-space: nowrap; }


/* Items an answer points to: a plain list of whole-row links, full width, wrapping, hairlines between (not a cloud of bordered pills). */
.asst-chips:not(.asst-suggest) { flex-direction: column; flex-wrap: nowrap; gap: 0; margin-top: 8px; }
.asst-chips:not(.asst-suggest) > a.k-fchip { border: 0; border-bottom: 1px solid var(--s1-line-soft, var(--s1-line)); border-radius: 0; background: none; padding: calc(9px * var(--s1-scale, 1)) 0; justify-content: flex-start; text-align: left; white-space: normal; text-decoration: none; color: var(--s1-ink); font-weight: 650; min-height: 0; }
.asst-chips:not(.asst-suggest) > a.k-fchip:last-child { border-bottom: 0; }
.asst-chips:not(.asst-suggest) > a.k-fchip:hover { text-decoration: underline; text-underline-offset: 3px; }

/* A2: the chat scrolls inside the panel, long unbroken text never widens it, and past chats are one tap away. */
.asst-body--ask { min-height: 0; }
.asst-log { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; grid-template-columns: minmax(0, 1fr); }
.asst-msg { min-width: 0; }
.asst-convbar { flex: none; display: flex; gap: var(--s1-space-2); justify-content: flex-end; }
.asst-past { flex: none; display: grid; gap: 2px; max-height: 40%; overflow-y: auto; border: 1px solid var(--s1-line-soft); border-radius: 8px; padding: 4px; }
.asst-past-row { display: grid; gap: 2px; text-align: left; background: none; border: 0; border-radius: 6px; padding: calc(6px * var(--s1-scale, 1)) calc(8px * var(--s1-scale, 1)); cursor: pointer; color: inherit; font: inherit; }
.asst-past-row:hover, .asst-past-row:focus-visible { background: var(--s1-line-soft); }
.asst-past-title { font-weight: 600; overflow-wrap: anywhere; }
[data-ask][data-reply-ready="true"]::after { content: ""; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--s1-accent, currentColor); }
