/* Additive grounded-conversation styling. No selectors affect legacy intake. */
.route-helper-chat .route-helper-content { display: flex; flex-direction: column; gap: .75rem; padding-top: .5rem; }
.route-helper-chat .route-helper-thread { display: flex; flex-direction: column; gap: .75rem; min-width: 0; margin: 0; padding: 0; list-style: none; }
.route-helper-chat .route-helper-turn { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: .375rem; }
.route-helper-chat .route-helper-turn-user { align-items: flex-end; }
.route-helper-chat .route-helper-bubble { max-width: 100%; box-sizing: border-box; border: 1px solid #dce3e8; border-radius: 4px 16px 16px 16px; background: #fff; padding: .75rem .875rem; overflow-wrap: anywhere; white-space: normal; }
.route-helper-chat .route-helper-turn-user .route-helper-bubble { max-width: 88%; border-color: #16303f; border-radius: 16px 16px 4px 16px; color: #fff; background: #16303f; white-space: pre-wrap; }
.route-helper-chat .route-helper-speaker { margin: 0; color: #627986; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .025em; }
.route-helper-chat .route-helper-bubble p { margin: 0 0 .625rem; }
.route-helper-chat .route-helper-bubble p:last-child { margin-bottom: 0; }
.route-helper-chat .route-helper-steps { margin: .625rem 0; padding-inline-start: 1.25rem; }
.route-helper-chat .route-helper-steps li { margin-bottom: .625rem; }
.route-helper-chat .route-helper-steps > li { white-space: pre-line; }
.route-helper-chat .route-helper-conditions { margin-top: .25rem; color: #536773; font-size: .8125rem; }
.route-helper-chat .route-helper-sources { margin-block: .75rem; }
.route-helper-chat .route-helper-sources h3 { margin: .625rem 0 .25rem; color: #16303f; font: 650 .8125rem/1.4 var(--sans, Arial, sans-serif); }
.route-helper-chat .route-helper-sources ul { margin: 0; padding-inline-start: 1.125rem; }
.route-helper-chat .route-helper-sources a { text-decoration: underline; text-underline-offset: .15em; overflow-wrap: anywhere; }
.route-helper-chat .route-helper-source-date { display: block; color: #536773; font-size: .75rem; }
.route-helper-chat .route-helper-coverage { color: #536773; font-size: .8125rem; }
.route-helper-chat .route-helper-question { padding-top: .625rem; border-top: 1px solid #dce3e8; font-weight: 600; }
.route-helper-chat .route-helper-offer { border-color: #e2dacb; background: #f4f1e9; }
.route-helper-chat .route-helper-stale-label { display: block; margin: 0 0 .5rem; color: #705735; font-size: .75rem; font-weight: 600; }
.route-helper-chat .route-helper-superseded { background: #f5f6f7; }
.route-helper-chat .route-helper-superseded .route-helper-bubble { background: transparent; }
.route-helper-chat .route-helper-off-notice { margin: 0; padding: .5rem .625rem; color: #705735; background: #f4f1e9; border-radius: 8px; font-size: .8125rem; }
.route-helper-chat .route-helper-composer { margin-top: .25rem; }
.route-helper-chat #route-helper-status:empty { display: none; }
.route-helper-chat .route-helper-draft-wrap { width: 100%; margin-top: .625rem; padding-top: .625rem; border-top: 1px solid #d8cebb; }
.route-helper-chat .route-helper-draft-wrap button { margin-top: .5rem; }
.route-helper-chat #route-helper-draft { max-height: 22rem; }
.route-helper-chat #route-helper-reset { display: block; }
.route-helper-chat [hidden] { display: none !important; }
#route-helper-dialog.route-helper-chat { background: #f8fafb; }
#route-helper-dialog.route-helper-chat .route-helper-thread { order: 0; }
#route-helper-dialog.route-helper-chat #route-helper-status { order: 1; }
#route-helper-dialog.route-helper-chat form { order: 2; margin-top: 0; }
#route-helper-dialog.route-helper-chat .route-helper-off-notice { order: -1; }
#route-helper-dialog.route-helper-chat .route-helper-header { padding-block: .75rem; }
/* Compact provider/privacy link; preserve source-review styling and a 44px tap target. */
.route-helper-chat details summary { font-size: 12px; min-height: 44px; }
.route-helper-chat .route-helper-composer > .route-helper-privacy-link { display: flex; align-items: center; width: fit-content; max-width: 100%; min-height: 44px; box-sizing: border-box; margin-top: .375rem; font-size: 11px; line-height: 1.4; }
@media (max-width: 420px) {
 #route-helper-dialog.route-helper-chat { width: calc(100% - .5rem); max-width: calc(100% - .5rem); max-height: calc(100dvh - .5rem); border-radius: 16px; }
 .route-helper-chat .route-helper-bubble { padding: .75rem; }
 .route-helper-chat .route-helper-turn-user .route-helper-bubble { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { .route-helper-chat * { scroll-behavior: auto; } }
/* Chat keeps header and composer in view; only the transcript scrolls. */
#route-helper-dialog.route-helper-chat[open] { display: flex; flex-direction: column; height: min(52rem, calc(100dvh - 1rem)); overflow: hidden; }
#route-helper-dialog.route-helper-chat .route-helper-header { flex-shrink: 0; }
#route-helper-dialog.route-helper-chat .route-helper-content { flex: 1 1 auto; min-height: 0; overflow: hidden; }
#route-helper-dialog.route-helper-chat .route-helper-thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .125rem .25rem; }
#route-helper-dialog.route-helper-chat .route-helper-composer, #route-helper-dialog.route-helper-chat #route-helper-status, #route-helper-dialog.route-helper-chat .route-helper-off-notice { flex: 0 0 auto; }
#route-helper-dialog.route-helper-chat #route-helper-message { max-height: 7rem; }
#route-helper-dialog.route-helper-chat details[open] { max-height: min(14rem, 30dvh); overflow-y: auto; overscroll-behavior: contain; }
#route-helper-dialog.route-helper-chat details[open] summary { position: sticky; top: 0; z-index: 1; background: #f8fafb; }
#route-helper.route-helper-chat .route-helper-thread { max-height: 10rem; overflow-y: auto; overscroll-behavior: contain; }
.route-helper-chat .route-helper-assumptions { color: #536773; font-size: .8125rem; }

/* Text actions must not inherit the fixed 44px icon slot. Only transcript scrolls. */
.route-helper-chat .route-helper-text-button { width: auto; height: auto; min-width: min(12rem,100%); max-width: 100%; flex: 0 0 auto; overflow-wrap: normal; word-break: normal; }
.route-helper-chat .route-helper-bubble { width: 100%; }
#route-helper-dialog.route-helper-chat details[open] { max-height: none; overflow: visible; }
#route-helper-dialog.route-helper-chat details[open] summary { position: static; }
.route-helper-chat .route-helper-bubble > div > a { display: inline-block; text-decoration: underline; padding-block: .35rem; }
