/* Chat-only polish. The shared brand and non-chat page remain intact. */
#ask{margin-bottom:var(--section-gap);scroll-margin-top:12px}
#ask .ai-controls{grid-template-columns:1fr;width:min(100%,320px);margin-bottom:14px}
#ask .chat-shell{min-width:0;display:flex;flex-direction:column;border:2px solid var(--ink);box-shadow:4px 4px 0 var(--ink)}
#ask .chat-shell.is-conversation{height:min(680px,calc(var(--chat-viewport,100dvh) - 24px));min-height:0}
#ask .chat-identity{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:4px 10px;padding:12px 16px 0;flex:none}
#ask .chat-identity>p{font-size:13px;font-weight:700;color:var(--navy)}
#ask .reset-chat{margin:0;padding:8px 10px;border:0;box-shadow:none;background:var(--soft);color:var(--navy);text-decoration:none;cursor:pointer;min-height:44px;font-size:13px}
#ask .chat-welcome{padding:12px 16px 14px;max-width:none;margin:0}
#ask #ask-title{font-size:24px;line-height:1.16;letter-spacing:-.03em}
#ask .chat-purpose{font-size:15px;line-height:1.5;margin-top:8px}
#ask .chat-body.is-conversation{height:auto;flex:1;min-height:0;padding:16px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
#ask [hidden]{display:none!important}
#ask .chat-shell.is-conversation .composer-area{max-height:calc(var(--chat-viewport,100dvh) - 84px);overflow-y:auto;scroll-padding-block:12px}
#ask .composer-area{padding:12px 16px calc(16px + env(safe-area-inset-bottom,0px));flex:none;min-width:0;background:var(--tint)}
#ask #chat-form{display:flex;flex-direction:column;align-items:stretch;min-height:148px;padding:0;gap:8px;border:0;box-shadow:none;background:transparent}
#ask #chat-form:focus-within{box-shadow:none;outline:2px solid var(--blue);outline-offset:6px}
#ask #chat-input{font:inherit;font-size:16px;line-height:1.5;min-height:76px;height:76px;max-height:180px;width:100%;flex:auto;resize:vertical;padding:0;border:0;background:transparent;color:var(--ink);border-radius:0}
#ask #chat-input:focus-visible{outline:none}
#ask .composer-actions{display:flex;justify-content:flex-end;min-height:44px;flex:none}
#ask .send-button{cursor:pointer;min-width:64px;width:auto;height:44px;min-height:44px;padding:0 12px;background:var(--navy);color:var(--white);border-radius:0;box-shadow:2px 2px 0 var(--ink)}
#ask .send-button:disabled{cursor:not-allowed;background:var(--line);color:var(--muted);box-shadow:none;transform:none;opacity:1}
#ask .send-button span{display:inline;font-size:14px}
#ask .suggestions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
#ask .suggestion{display:flex;justify-content:center;align-items:center;width:auto;max-width:100%;flex:0 1 auto;text-align:center;min-height:44px;border:0;border-radius:0;padding:8px 10px;font-size:13px;font-weight:700;line-height:1.4;background:var(--soft);color:var(--navy);box-shadow:none;transform:none;transition:background 140ms ease,color 140ms ease}
#ask .suggestion:disabled{cursor:wait;opacity:.6}
#ask .suggestion:focus-visible,#ask .suggestion:active{background:var(--navy);color:var(--white);box-shadow:none;transform:none}
#ask #chat-messages{min-width:0;width:min(100%,64ch,600px);margin-inline:auto;font-size:16px}
#ask .chat-message{max-width:100%;margin:0 0 24px;padding:4px 0;white-space:normal;overflow-wrap:anywhere;border:0;box-shadow:none;font-size:16px;background:var(--white);color:var(--ink)}
#ask .chat-message.user{max-width:min(100%,48ch);margin-left:auto;padding:14px 16px;background:var(--navy);color:var(--white)}
#ask .chat-message.user .message-role{color:var(--white)}
#ask .chat-message.assistant .message-role{color:var(--navy)}
#ask .message-role{font-size:12px;font-weight:700;margin-bottom:8px;line-height:1.4}
#ask .message-text{white-space:normal;line-height:1.65}
#ask .user .message-text{white-space:pre-wrap}
#ask .message-text p{line-height:inherit;text-wrap:pretty}
#ask .message-text>*+*{margin-top:14px}
#ask .message-text ul,#ask .message-text ol{padding-left:24px;margin-bottom:0;line-height:inherit}
#ask .message-text li+li{margin-top:8px}
#ask .message-text li>p+p{margin-top:8px}
#ask .message-text .markdown-heading{font-weight:700;margin-top:20px}
#ask .message-text a{text-decoration:underline;text-underline-offset:3px}
#ask .message-text a:focus-visible{outline:3px solid var(--blue);outline-offset:3px}
#ask .message-text code{font-family:ui-monospace,monospace;font-size:.9em;white-space:pre-wrap;overflow-wrap:anywhere}
#ask .message-text pre{max-width:100%;white-space:pre-wrap;padding:12px;background:var(--soft);color:var(--ink);border-left:2px solid var(--navy)}
#ask .message-text blockquote{margin-inline:0;padding-left:14px;border-left:2px solid var(--blue)}
#ask .markdown-table{max-width:100%;overflow-x:auto}
#ask .markdown-table table{border-collapse:collapse;font-size:14px}
#ask .markdown-table td,#ask .markdown-table th{padding:8px;text-align:left;border:1px solid var(--line)}
#ask .chat-body.is-conversation{overflow-anchor:none}
#ask .chat-shell.is-conversation .composer-area{padding:10px 16px calc(12px + env(safe-area-inset-bottom,0px));max-height:none;overflow:visible}
#ask .chat-shell.is-conversation #chat-form{flex-direction:row;align-items:flex-end;min-height:44px;gap:12px}
#ask .chat-shell.is-conversation #chat-input{min-height:44px;height:44px;max-height:132px;resize:none;flex:1;min-width:0;padding:8px 0;box-sizing:border-box}
#ask .chat-shell.is-conversation #chat-form:focus-within{outline-offset:3px}
#ask .chat-shell.is-conversation .composer-note{margin-top:8px}
#ask .chat-shell.is-conversation .chat-status{font-size:13px}
#ask .chat-shell.is-conversation .chat-status:not(:empty){margin-top:8px}
#ask .chat-shell.is-conversation .chat-intent{margin-bottom:8px}
#ask .chat-shell.is-conversation .chat-identity{padding-top:8px}
#ask .message-note{font-size:12px;font-weight:500;margin-top:10px;color:var(--muted)}
#ask .chat-status{line-height:1.5;overflow-wrap:anywhere}
#ask .chat-status:not(:empty){margin-top:10px}
#ask .chat-recovery{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px}
#ask .chat-recovery:not(:has(button:not([hidden]))){display:none}
#ask .chat-recovery .button{justify-content:center;font-size:13px;min-height:44px;padding:8px 12px;box-shadow:none}
#ask .chat-recovery .message-note{flex-basis:100%;margin:0}
#ask .reset-chat:disabled{opacity:.65;cursor:not-allowed}
#ask .copy-reply{font:inherit;font-size:13px;font-weight:700;cursor:pointer;min-height:44px;margin-top:8px;padding:8px 12px;background:var(--soft);color:var(--navy);border:0;box-shadow:none;transition:background 140ms ease}
#ask .composer-note{font-size:12px;line-height:1.5;margin-top:12px;color:var(--muted)}
#ask .chat-intent{font-size:13px;line-height:1.5;color:var(--navy);margin-bottom:14px;font-weight:700}
#ask .chat-disclosure{max-width:85ch;margin-top:18px;color:var(--muted);font-size:13px;line-height:1.6}
#ask button:focus-visible,#ask .chat-body:focus-visible{outline:3px solid var(--blue);outline-offset:3px}
@media(min-width:760px){#ask .chat-identity{padding:16px 28px 0}#ask .chat-welcome{padding:14px 28px 16px}#ask #ask-title{font-size:28px}#ask .chat-body.is-conversation{padding:20px 28px}#ask .composer-area{padding:14px 28px calc(24px + env(safe-area-inset-bottom,0px))}#ask .send-button{min-width:68px}#ask .suggestions{display:flex;flex-wrap:wrap}#ask .suggestion{width:auto;min-width:0;padding-inline:10px}}
@media(hover:hover) and (pointer:fine){#ask .suggestion:not(:disabled):hover{background:var(--soft);color:var(--navy);box-shadow:none;transform:none}#ask .reset-chat:not(:disabled):hover,#ask .copy-reply:hover{background:var(--tint);transform:none}}
@media(prefers-reduced-motion:reduce){#ask *,#ask *::before,#ask *::after{animation:none!important;transition:none!important;transform:none!important;scroll-behavior:auto!important}}
@media(forced-colors:active){#ask .chat-shell,#ask .send-button{border-color:ButtonText}#ask .suggestion,#ask .copy-reply,#ask .reset-chat,#ask #chat-form{outline:1px solid ButtonText;outline-offset:-1px}#ask button:focus-visible,#ask #chat-input:focus-visible,#ask #chat-form:focus-within{outline-color:Highlight}}
@media print{#ask{display:none}}

#ask .handoff-panel{border:2px solid var(--ink);box-shadow:4px 4px 0 var(--ink);padding:16px;margin-top:20px;min-width:0;overflow-wrap:anywhere;background:var(--white,#fff)}
#ask .handoff-panel .reset-chat{margin:8px 8px 0 0;max-width:100%;white-space:normal}
#ask .handoff-title{font-size:18px;line-height:1.3;margin-bottom:16px}
#ask .handoff-details{display:grid;gap:12px;margin:0 0 16px}
#ask .handoff-details dt{font-size:12px;font-weight:700;color:var(--navy);margin-bottom:3px}
#ask .handoff-details dd{font-size:14px;line-height:1.5;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
@media(min-width:760px){#ask .handoff-panel{padding:24px 28px}}
#ask .handoff-input{display:block;width:100%;max-width:100%;min-height:44px;box-sizing:border-box;padding:10px;background:var(--tint);color:var(--ink);border:1px solid var(--navy);border-radius:0;font:inherit;margin-block:6px 12px}
#ask .handoff-panel label{display:block;font-size:13px}

.consult-footer .footer-chat-link{display:inline-flex;align-items:center;min-height:44px;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-size:14px;cursor:pointer}
.consult-footer .footer-chat-link:focus-visible{outline:3px solid var(--white);outline-offset:6px}
#ask .send-button:not(:disabled):hover{background:var(--navy);color:var(--white);box-shadow:2px 2px 0 var(--ink);transform:none}
