/* Chat styles are scoped to this page; the site header and other pages keep their styles. */
.atc-chat-page { --chat-paper:var(--card,#f8f0df); --chat-surface:#f2e6d1; --chat-sidebar:#f1e5cf; --chat-user:#eedfc7; --chat-accent:#79543a; --chat-hover:#68432f; --chat-line:#d8c8ad; --chat-ink:#19202b; --chat-muted:#6e6154; background:var(--chat-paper); }
.atc-chat-page [hidden] { display:none !important; }
.atc-chat-page { overflow:hidden; }
.atc-chat-page>footer { display:none; }
.atc-chat-page .atc-chat-main { overflow:visible; }
.atc-chat-page .atc-chat {
  width:min(900px,100%); height:var(--atc-chat-height,calc(100dvh - 72px));
  margin:0 auto; padding:0 28px; display:flex; flex-direction:column; min-height:0;
}
.atc-chat-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; flex:none; min-height:68px; }
.atc-chat-toolbar-label { display:flex; align-items:center; gap:9px; color:var(--chat-muted); font-size:.75rem; }
.atc-chat-toolbar-label>span:first-child { width:6px; height:6px; border-radius:50%; background:var(--chat-accent); flex:none; }
.atc-chat-toolbar-label { white-space:nowrap; }
.atc-chat-new { display:inline-flex; align-items:center; gap:6px; border:1px solid transparent; border-radius:9px; background:transparent; color:var(--chat-muted); padding:8px 10px; min-height:44px; font-size:.78rem; cursor:pointer; }
.atc-chat-new:hover:not(:disabled) { background:var(--chat-surface); color:var(--ink); }
.atc-chat-new:disabled { opacity:.5; cursor:default; }
.atc-chat-new>span { font-size:1.1rem; }
.atc-chat-viewport { display:flex; flex-direction:column; justify-content:flex-start; flex:1; min-height:0; overflow-y:auto; padding-bottom:18px; }
.atc-chat-welcome { text-align:center; margin:auto auto 28px; max-width:670px; flex:none; }
.atc-chat-welcome-group { display:contents; }
.atc-chat.has-messages .atc-chat-welcome-group { display:none; }
.atc-chat-mark { display:grid; place-items:center; margin:0 auto 18px; width:46px; height:46px; border:1px solid var(--chat-line); border-radius:14px; background:var(--chat-surface); color:var(--chat-accent); transform:rotate(-5deg); }
.atc-chat-mark svg { width:29px; height:29px; }
.atc-chat-eyebrow { font-size:.64rem; font-weight:700; letter-spacing:.14em; color:var(--chat-accent); margin-bottom:12px; }
.atc-chat-welcome h1 { font-size:clamp(1.9rem,3.5vw,2.55rem); font-weight:600; letter-spacing:-.035em; line-height:1.22; max-width:20ch; margin:0 auto; }
.atc-chat-subtitle { max-width:56ch; margin:16px auto 0; font-size:.86rem; line-height:1.75; color:var(--chat-muted); }
.atc-chat-composer-area { width:100%; flex:none; margin-top:auto; }
.atc-chat-form { position:relative; }
.atc-chat-composer { border:1px solid var(--chat-line); border-radius:28px; background:#ffffff; padding:19px 18px 12px; box-shadow:none; }
.atc-chat-composer:focus-within { border-color:var(--chat-accent); box-shadow:0 0 0 3px #79543a18; }
.atc-chat-composer textarea { display:block; width:100%; border:0; padding:0 2px; margin:0 0 12px; min-height:var(--composer-min-height,78px); max-height:var(--composer-max-height,180px); resize:none; overflow-y:auto; background:transparent; color:var(--ink); font:400 1rem/1.65 var(--font); }
.atc-chat-composer textarea::placeholder { color:var(--chat-muted); }
.atc-chat-composer textarea:focus { outline:none; }
.atc-chat-composer-tools { display:flex; align-items:flex-end; flex-wrap:wrap; gap:8px 12px; }
.atc-chat-feature-tools { display:flex; flex:1 1 240px; flex-wrap:wrap; gap:8px; min-width:0; }
.atc-chat-feature { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-width:0; max-width:100%; min-height:44px; border:1px solid var(--chat-line); border-radius:999px; padding:8px 11px; background:transparent; color:var(--chat-muted); font:500 .73rem/1.35 var(--font); cursor:pointer; }
.atc-chat-feature span { min-width:0; overflow-wrap:anywhere; text-align:start; }
.atc-chat-feature .atc-chat-label-mobile { display:none; }
.atc-chat-feature svg { width:18px; height:18px; flex:none; }
.atc-chat-feature:hover:not(:disabled):not([aria-disabled="true"]) { background:var(--chat-surface); border-color:var(--chat-line); }
.atc-chat-feature[aria-pressed="true"] { background:var(--chat-surface); border-color:var(--chat-accent); color:var(--chat-accent); }
.atc-chat-feature:disabled,.atc-chat-feature[aria-disabled="true"] { opacity:.55; cursor:not-allowed; }
.atc-chat-send-tools { display:flex; flex:none; align-items:center; gap:4px; margin-inline-start:auto; }
.atc-chat-attach { display:inline-flex; align-items:center; justify-content:center; flex:none; width:44px; height:44px; padding:10px; border:0; border-radius:50%; color:var(--chat-muted); background:transparent; cursor:pointer; }
.atc-chat-attach:hover:not(:disabled) { background:var(--chat-surface); }
.atc-chat-attach svg { width:21px; height:21px; flex:none; }
.atc-chat-attach:disabled { opacity:.5; cursor:default; }
.atc-chat-send { display:inline-flex; align-items:center; justify-content:center; flex:none; width:44px; height:44px; border:1px solid var(--chat-accent); border-radius:50%; padding:10px; background:var(--chat-accent); color:#fff; cursor:pointer; }
.atc-chat-send svg { width:22px; height:22px; }
.atc-chat-send-pending { display:none; font:600 1.2rem/1 var(--font); }
.atc-chat-send[data-sending="true"] svg { display:none; }
.atc-chat-send[data-sending="true"] .atc-chat-send-pending { display:block; }
.atc-chat-send:hover:not(:disabled) { background:var(--chat-hover); }
.atc-chat-send:disabled { opacity:.4; cursor:default; }
.atc-chat-send[data-sending="true"] { opacity:.65; }
.atc-chat-composer-tools button:focus-visible,.atc-chat-progress summary:focus-visible { outline:2px solid var(--chat-accent); outline-offset:3px; }
.atc-chat-progress { max-width:100%; padding:2px 0 0; color:var(--chat-muted); font:400 .82rem/1.6 var(--font); }
.atc-chat-progress-inline { display:flex; align-items:center; gap:9px; min-height:28px; }
.atc-chat-progress-current { margin:0; overflow-wrap:anywhere; }
.atc-chat-progress-time { flex:none; color:var(--chat-muted); font-size:.72rem; font-variant-numeric:tabular-nums; }
.atc-chat-progress-spinner { flex:none; width:14px; height:14px; border:1.5px solid var(--chat-line); border-top-color:var(--chat-accent); border-radius:50%; animation:atc-chat-spin 1.1s linear infinite; }
.atc-chat-progress[data-stopped="true"] .atc-chat-progress-spinner { animation:none; }
@keyframes atc-chat-spin { to { transform:rotate(360deg); } }
.atc-chat-progress details { margin:4px 0 0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; font-size:.72rem; }
.atc-chat-progress summary { display:inline-flex; align-items:center; gap:6px; width:fit-content; max-width:100%; min-height:44px; padding:10px 0; cursor:pointer; color:var(--chat-muted); font:inherit; }
.atc-chat-progress summary::after { content:"›"; position:static; color:inherit; font-size:1rem; font-weight:400; transform:none; }
.atc-chat-progress details[open] summary::after { content:"›"; transform:rotate(90deg); }
.atc-chat-progress details p { margin:3px 0; overflow-wrap:anywhere; }
.atc-chat-progress ul { margin:6px 0 8px; padding-inline-start:18px; }
.atc-chat-status { color:var(--chat-accent); font-size:.76rem; line-height:1.5; margin:8px 6px 0; }
.atc-chat-status:empty { display:none; }
.atc-chat-footnote { display:flex; align-items:baseline; justify-content:center; flex-wrap:wrap; gap:6px 13px; color:var(--chat-muted); font-size:.63rem; margin:12px 8px 0; line-height:1.5; }
.atc-chat-privacy { position:relative; padding:0; margin:0; border:0; background:transparent; box-shadow:none; max-width:100%; }
.atc-chat-privacy summary { padding:0; margin:0; font-size:inherit; font-weight:400; color:inherit; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.atc-chat-privacy summary::after { content:none; }
.atc-chat-privacy[open] { width:100%; }
.atc-chat-privacy p { max-width:690px; margin:8px auto; font-size:.7rem; line-height:1.65; }
.atc-chat.has-messages .atc-chat-viewport { justify-content:flex-start; overflow:hidden; padding-bottom:14px; }
.atc-chat.has-messages { --composer-min-height:30px; --composer-max-height:112px; }
.atc-chat.has-messages .atc-chat-composer { padding:8px 10px; }
.atc-chat.has-messages .atc-chat-composer textarea { margin-bottom:6px; }
@media(min-width:1024px){
  .atc-chat.has-messages { --composer-min-height:70px; --composer-max-height:144px; }
  .atc-chat.has-messages .atc-chat-composer { padding:14px 18px 12px; }
  .atc-chat.has-messages .atc-chat-composer textarea { margin-bottom:10px; }
}
.atc-chat-thread { flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; position:relative; scroll-padding:16px; padding:18px 4px 24px; scrollbar-width:thin; scrollbar-color:var(--chat-line) transparent; }
.atc-chat-message { min-width:0; overflow-wrap:anywhere; margin-bottom:30px; }
.atc-chat-message-user { display:flex; flex-direction:column; align-items:flex-end; margin-left:auto; max-width:min(78%,720px); }
.atc-chat-user-bubble { padding:13px 18px; border:1px solid var(--chat-line); border-radius:20px 20px 5px 20px; background:var(--chat-user); max-width:100%; font-size:.92rem; line-height:1.75; }
.atc-chat-user-bubble p { white-space:pre-wrap; margin:0; }
.atc-chat-message-assistant { max-width:880px; margin-right:auto; }
.atc-chat-author { display:flex; align-items:center; gap:9px; margin-bottom:12px; color:var(--chat-muted); font-size:.73rem; font-weight:600; }
.atc-chat-author-mark { display:grid; place-items:center; width:23px; height:23px; border-radius:7px; background:var(--chat-accent); color:#fff; font-size:.65rem; font-weight:700; }
.atc-chat-answer { font-size:.94rem; line-height:1.85; color:var(--chat-ink); }
.atc-chat-answer p { margin:0 0 14px; }
.atc-chat-answer h3 { margin:22px 0 9px; font-size:1rem; line-height:1.5; font-weight:600; }
.atc-chat-answer h3:first-child { margin-top:0; }
.atc-chat-answer ul,.atc-chat-answer ol { margin:8px 0 16px; padding-left:24px; }
.atc-chat-answer ul { list-style:disc; }
.atc-chat-answer ol { list-style:decimal; }
.atc-chat-answer li { padding-left:3px; margin:6px 0; }
.atc-chat-answer a,.atc-chat-actions a { color:var(--chat-accent); text-decoration:underline; text-underline-offset:3px; }
.atc-chat-answer>:last-child { margin-bottom:0; }
.atc-chat-answer h4,.atc-chat-answer h5,.atc-chat-answer h6 { margin:18px 0 8px; font-size:.96rem; line-height:1.5; }
.atc-chat-answer li>p { margin:6px 0; }
.atc-chat-answer li>ul,.atc-chat-answer li>ol { margin:6px 0; }
.atc-chat-answer code { background:var(--chat-surface); padding:2px 4px; border-radius:4px; font-size:.9em; }
.atc-chat-answer pre { max-width:100%; overflow-x:auto; padding:12px; background:var(--chat-surface); border-radius:8px; }
.atc-chat-answer pre code { padding:0; white-space:pre; overflow-wrap:normal; }
.atc-chat-answer blockquote { margin:12px 0; padding-left:14px; border-left:3px solid var(--chat-accent); }
.atc-answer-table { max-width:100%; overflow-x:auto; margin:14px 0; border:1px solid var(--chat-line); border-radius:8px; }
.atc-answer-table table { width:100%; border-collapse:collapse; font-size:.88em; }
.atc-answer-table th,.atc-answer-table td { padding:10px 12px; min-width:120px; max-width:320px; vertical-align:top; text-align:left; border-bottom:1px solid var(--chat-line); }
.atc-answer-table th { background:var(--chat-surface); font-weight:600; }
.atc-answer-table tbody tr:last-child td { border-bottom:0; }
.atc-answer-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:10px; }
.atc-chat-page .atc-answer-copy { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:44px; min-width:44px; padding:8px 10px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--chat-muted); font:inherit; font-size:.78rem; cursor:pointer; }
.atc-chat-page .atc-answer-copy:hover { background:var(--chat-surface); color:var(--chat-accent); }
.atc-answer-copy-status { font-size:.78rem; color:var(--chat-muted); }
.atc-answer-copy:focus-visible,.atc-answer-table:focus-visible { outline:2px solid var(--chat-accent); outline-offset:2px; }
.atc-chat-freshness { margin:14px 0 0; color:var(--chat-muted); font-size:.76rem; line-height:1.65; }
.atc-chat-sources { margin-top:18px; padding-top:12px; border-top:1px solid var(--chat-line); font-size:.76rem; line-height:1.6; }
.atc-chat-sources h3 { margin:0 0 6px; font-size:.78rem; font-weight:600; }
.atc-chat-sources ul { display:grid; gap:4px; margin:0; padding:0; list-style:none; }
.atc-chat-sources li { min-width:0; overflow-wrap:anywhere; }
.atc-chat-sources a { display:flex; align-items:center; min-height:44px; color:var(--chat-accent); text-decoration:underline; text-underline-offset:3px; }
.atc-chat-sources a:hover { color:var(--chat-hover); }
.atc-chat-sources a:focus-visible { outline:2px solid var(--chat-accent); outline-offset:3px; border-radius:3px; }
.atc-chat-sources li>span { display:block; color:var(--chat-muted); font-size:.68rem; }
.atc-chat-actions { display:flex; flex-wrap:wrap; gap:8px 22px; margin-top:15px; font-size:.74rem; line-height:1.6; }
.atc-chat-thinking { display:flex; align-items:center; gap:9px; color:var(--chat-muted); font-size:.85rem; padding:2px 0 12px; }
.atc-chat-dots { display:flex; gap:4px; }
.atc-chat-dots i { width:4px; height:4px; border-radius:50%; background:var(--chat-muted); animation:atc-chat-pulse 1.2s infinite; }
.atc-chat-dots i:nth-child(2) { animation-delay:.15s; }
.atc-chat-dots i:nth-child(3) { animation-delay:.3s; }
@keyframes atc-chat-pulse { 0%,80%,100% { opacity:.3; } 40% { opacity:1; } }
.atc-chat-error { color:#a33f2b; font-size:.86rem; line-height:1.65; }
.atc-chat-search-limit { padding:12px 14px; border:1px solid var(--chat-line); border-radius:12px; background:var(--chat-surface); }
.atc-chat-search-limit .atc-chat-error { margin:0; }
.atc-chat-retry { margin-top:11px; min-height:40px; padding:7px 13px; border:1px solid var(--chat-line); border-radius:9px; color:#a33f2b; background:transparent; cursor:pointer; font-size:.78rem; }
.atc-chat-attachment { display:flex; align-items:center; gap:11px; padding:0 0 14px; margin-bottom:12px; border-bottom:1px solid var(--chat-line); }
.atc-chat-attachment img { width:60px; height:60px; object-fit:contain; border:1px solid var(--chat-line); border-radius:9px; background:var(--chat-surface); flex:none; }
.atc-chat-attachment-meta { display:grid; gap:3px; min-width:0; }
.atc-chat-attachment-meta strong { font-size:.73rem; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.atc-chat-attachment-meta span { color:var(--chat-muted); font-size:.63rem; line-height:1.5; }
.atc-chat-remove { margin-left:auto; padding:8px; min-height:40px; border:0; border-radius:8px; background:transparent; color:#a33f2b; cursor:pointer; font-size:.7rem; }
.atc-chat-remove:disabled { opacity:.5; cursor:wait; }
.atc-chat-sent-image { display:block; width:auto; max-width:min(220px,100%); max-height:150px; object-fit:contain; border:1px solid var(--chat-line); border-radius:10px; margin-bottom:9px; background:var(--chat-surface); }
.atc-chat-shell button:focus-visible,.atc-chat-shell summary:focus-visible { outline:2px solid var(--chat-accent); outline-offset:3px; }
.atc-chat-thread:focus-visible { outline:1px solid var(--chat-accent); outline-offset:2px; border-radius:8px; }
/* visualViewport shrinks when a mobile keyboard opens, even on browsers whose
   CSS media-query height stays unchanged. Keep the composer within that space. */
.atc-chat.is-compact .atc-chat-toolbar { min-height:42px; }
.atc-chat.is-compact .atc-chat-mark,.atc-chat.is-compact .atc-chat-subtitle,
.atc-chat.is-compact .atc-chat-eyebrow { display:none; }
.atc-chat.is-compact .atc-chat-welcome { margin:8px auto 16px; }
.atc-chat.is-compact .atc-chat-welcome h1 { font-size:1.3rem; max-width:26ch; }
.atc-chat.is-compact:not(.has-messages) .atc-chat-composer { padding:10px 12px 8px; }
.atc-chat.is-compact { --composer-min-height:30px; --composer-max-height:80px; }
.atc-chat.is-compact .atc-chat-attachment { padding-bottom:9px; margin-bottom:9px; }
.atc-chat.is-compact .atc-chat-attachment img { width:40px; height:40px; }
.atc-chat.is-compact .atc-chat-attachment-meta span { display:none; }
@media (max-width:720px) {
  .atc-chat-page .atc-chat { padding:0 17px; }
  .atc-chat-toolbar { min-height:58px; }
  .atc-chat-toolbar-label { font-size:.68rem; }
  .atc-chat-welcome { margin-bottom:24px; }
  .atc-chat-welcome h1 { font-size:1.9rem; }
  .atc-chat-subtitle { font-size:.8rem; margin-top:14px; padding:0 8px; }
  .atc-chat-composer { padding:15px 12px 10px; border-radius:24px; }
  .atc-chat-composer-tools { flex-wrap:wrap; gap:8px; }
  .atc-chat-feature-tools { flex:1 0 auto; flex-wrap:nowrap; gap:6px; }
  .atc-chat-feature { flex:none; font-size:.68rem; padding:7px 8px; gap:4px; }
  .atc-chat-feature span { white-space:nowrap; }
  .atc-chat-feature .atc-chat-label-full { display:none; }
  .atc-chat-feature .atc-chat-label-mobile { display:inline; }
  .atc-chat-attach { max-width:100%; }
  .atc-chat-message-user { max-width:88%; }
  .atc-chat-user-bubble { padding:11px 14px; font-size:.9rem; }
  .atc-chat-answer { font-size:.91rem; line-height:1.8; }
  .atc-chat.has-messages .atc-chat-viewport { padding-bottom:calc(10px + env(safe-area-inset-bottom,0px)); }
  .atc-chat-footnote { margin-top:9px; font-size:.59rem; gap:4px 10px; }
}
@media (max-height:670px) {
  .atc-chat-viewport { justify-content:flex-start; }
  .atc-chat-welcome { margin-top:12px; margin-bottom:20px; }
  .atc-chat-mark { display:none; }
  .atc-chat-welcome h1 { font-size:1.7rem; }
}
@media (prefers-reduced-motion:reduce) { .atc-chat-dots i { animation:none; opacity:.7; } .atc-chat-progress-spinner { animation:none; } }
.atc-chat-page .atc-chat-support { margin-top:16px; padding:16px; background:var(--chat-surface); border:1px solid var(--chat-line); border-radius:12px; line-height:1.65; font-size:.82rem; }
.atc-chat-page .atc-chat-support > strong { display:block; color:var(--teal); font-size:.88rem; }
.atc-chat-page .atc-chat-support p { margin:8px 0 0; }
.atc-chat-page .atc-chat-support-links { display:flex; flex-wrap:wrap; gap:8px 18px; margin:12px 0; }
.atc-chat-page .atc-chat-support a { color:var(--teal); text-decoration:underline; text-underline-offset:3px; font-weight:600; }
.atc-chat-page .atc-chat-support-note { color:var(--muted); }
.atc-chat-page .atc-chat-copy-contact { margin-top:12px; min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:8px; background:#ffffff; color:var(--ink); font:600 .8rem var(--font); cursor:pointer; }
.atc-chat-page .atc-chat-copy-contact:focus-visible { outline:2px solid var(--chat-accent); outline-offset:3px; }
.atc-chat-page .atc-chat-copy-status { display:block; margin-top:8px; color:var(--teal); font-size:.78rem; }
/* v126: language controls and readable answers, scoped to the chat. */
.atc-chat-toolbar { gap:10px; flex-wrap:wrap; }
.atc-chat-language { position:relative; display:flex; align-items:center; justify-content:center; flex:none; margin-inline-start:auto; width:44px; height:44px; border-radius:9px; color:var(--chat-ink); }
.atc-chat-language>span { display:none; }
.atc-chat-language-globe { display:block; width:22px; height:22px; pointer-events:none; }
.atc-chat-language select { position:absolute; inset:0; width:44px; height:44px; opacity:0; cursor:pointer; }
.atc-chat-language:focus-within { outline:2px solid var(--chat-accent); outline-offset:2px; }
.atc-chat-answer { overflow-wrap:anywhere; }
@media(max-width:480px){.atc-chat-toolbar-label{display:none}.atc-chat-language{margin-inline-start:0}.atc-chat-new{margin-inline-start:auto}}
/* A docked desktop sidebar; smaller screens retain the History drawer. */
.atc-chat-shell { width:100%; display:flex; align-items:stretch; margin:0 auto; position:relative; }
.atc-chat-shell .atc-chat { flex:1; width:auto; min-width:0; padding-inline:clamp(20px,3vw,48px); }
.atc-chat-toolbar,.atc-chat-modes,.atc-chat-viewport { width:min(1040px,100%); margin-inline:auto; }
.atc-chat-history-toggle { display:inline-flex; align-items:center; gap:7px; min-height:40px; padding:7px 9px; border:1px solid var(--chat-line); border-radius:8px; background:transparent; color:var(--chat-muted); cursor:pointer; font:500 .75rem var(--font); }
.atc-chat-history-toggle:hover { background:var(--chat-surface); }
.atc-history { display:flex; flex-direction:column; width:260px; flex:none; height:var(--atc-chat-height,calc(100dvh - 72px)); min-height:0; padding:20px 15px; background:var(--chat-sidebar); border-right:1px solid var(--chat-line); }
.atc-history-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px; }
.atc-history-heading h2 { margin:0; color:var(--ink); font:600 1.06rem var(--font); }
.atc-history-new { flex:none; width:100%; min-height:44px; text-align:left; border:1px solid var(--chat-line); border-radius:9px; padding:9px 12px; background:#ffffff; color:var(--ink); font:500 .82rem var(--font); cursor:pointer; }
.atc-history-tools { display:flex; align-items:center; justify-content:space-between; flex:none; gap:9px; margin:22px 0 5px; color:var(--chat-muted); font-size:.68rem; }
.atc-history-tools button { border:0; border-radius:6px; padding:7px 5px; min-height:44px; background:transparent; color:var(--chat-accent); font:inherit; cursor:pointer; }
.atc-history-status { flex:none; min-height:16px; margin:0 0 8px; color:var(--chat-muted); font-size:.74rem; line-height:1.5; }
.atc-history-list { min-height:0; overflow-y:auto; flex:1; overscroll-behavior:contain; }
.atc-history-row { display:flex; align-items:center; gap:4px; margin-bottom:5px; border-radius:8px; }
.atc-history-row:has([aria-current="true"]) { background:var(--chat-user); box-shadow:inset 3px 0 var(--chat-accent); }
.atc-history-select { min-width:0; flex:1; min-height:44px; padding:9px 9px; border:0; border-radius:8px; background:transparent; text-align:start; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--ink); font:500 .78rem var(--font); cursor:pointer; }
.atc-history-select:hover:not(:disabled) { background:var(--chat-surface); }
.atc-history-delete { flex:none; min-width:44px; min-height:44px; border:0; border-radius:8px; padding:5px; background:transparent; color:var(--chat-muted); font:400 1.25rem var(--font); cursor:pointer; }
.atc-history-delete:hover:not(:disabled) { color:var(--chat-accent); background:var(--chat-surface); }
.atc-history button:disabled { opacity:.55; cursor:default; }
.atc-history button:focus-visible,.atc-chat-toolbar button:focus-visible,.atc-chat-modes button:focus-visible { outline:2px solid var(--chat-accent); outline-offset:2px; }
.atc-history-more,.atc-history-earlier { flex:none; min-height:40px; border:1px solid var(--chat-line); border-radius:8px; padding:8px 12px; margin:10px 0; background:#ffffff; color:var(--chat-muted); font:500 .74rem var(--font); cursor:pointer; }
.atc-history-earlier { align-self:center; margin:0 0 8px; }
.atc-history-note { flex:none; margin:15px 3px 0; color:var(--chat-muted); font-size:.66rem; line-height:1.6; }
.atc-history-backdrop { display:none; }
.atc-chat-user-bubble .atc-chat-unavailable-image { margin-top:10px; padding-top:8px; border-top:1px solid var(--chat-line); font-size:.73rem; line-height:1.6; color:var(--chat-muted); white-space:normal; }

@media (max-width:1023px) {
  .atc-history { display:none; position:fixed; top:0; bottom:0; left:0; z-index:51; width:min(280px,calc(100vw - 24px)); height:auto; box-shadow:10px 0 40px #38261422; }
  .history-open .atc-history { display:flex; }
  .atc-chat-shell .atc-chat { padding-inline:20px; }
  .atc-history-backdrop { display:block; position:fixed; inset:0; z-index:50; border:0; border-radius:0; background:#241c1466; cursor:pointer; }
}
@media (max-width:360px) { .atc-chat-history-toggle { gap:4px; } .atc-chat-new>span { font-size:.92rem; } }

/* Unified mobile-first AI interface; no artwork or background gradients. */
.atc-chat-shell { --ink:var(--chat-ink); --muted:var(--chat-muted); --line:var(--chat-line); --teal:var(--chat-accent); color:var(--chat-ink); }
.atc-chat-toolbar-label { display:block; color:var(--ink); font-size:1.2rem; font-weight:700; white-space:normal; text-align:center; }
.atc-chat-modes { display:flex; flex:none; gap:4px; border:1px solid var(--chat-line); border-radius:999px; background:var(--chat-surface); padding:4px; margin:4px auto 18px; }
.atc-chat-modes button { flex:1; min-width:0; min-height:44px; border:0; border-radius:999px; padding:9px 10px; background:transparent; color:var(--chat-ink); font:600 .9rem/1.3 var(--font); cursor:pointer; }
.atc-chat-modes button[aria-pressed="true"],.atc-chat-feature[aria-pressed="true"] { background:var(--chat-accent); border-color:var(--chat-accent); color:white; }
.atc-chat-modes button:disabled { opacity:.65; cursor:wait; }
.atc-chat-welcome h1 { max-width:27ch; font-weight:700; font-size:clamp(1.65rem,4vw,2.45rem); }
.atc-chat-subtitle { font-size:1rem; line-height:1.55; }
.atc-house-notice { display:flex; align-items:center; gap:8px; flex:none; border:1px solid var(--chat-line); border-radius:12px; background:#fffdf9; padding:10px 14px; margin:0 0 18px; color:var(--muted); font-size:.8rem; line-height:1.5; }
.atc-house-notice>span:first-child { color:var(--chat-accent); font-size:1.15rem; flex:none; }
.atc-housing-profile { flex:none; padding:8px 12px; margin:0 0 8px; border:1px solid var(--line); border-radius:12px; background:white; font-size:.8rem; }
.atc-housing-profile summary { min-height:32px; padding:6px 0; cursor:pointer; font-size:inherit; }
.atc-housing-profile[open] { max-height:180px; overflow-y:auto; }
.atc-housing-profile p { color:var(--chat-muted); margin:4px 0 8px; }
.atc-housing-profile dl { display:grid; grid-template-columns:minmax(90px,1fr) minmax(0,2fr); gap:5px 10px; }
.atc-housing-profile dt { font-weight:600; }.atc-housing-profile dd { margin:0; overflow-wrap:anywhere; }
#needsHousingMaps a { display:inline-block; color:var(--chat-accent); padding:8px; min-height:40px; }
.atc-chat.has-messages .atc-house-notice { margin:0 0 8px; padding:7px 12px; }

@media(max-width:720px){
  .atc-chat-page>nav { display:none; }
  .atc-chat-shell .atc-chat { padding:0 12px; }
  .atc-chat-toolbar { display:grid; grid-template-columns:44px minmax(0,1fr) 44px 44px; gap:2px; padding:8px 0; }
  .atc-chat-toolbar-label { display:block; grid-column:2; grid-row:1; font-size:1.06rem; white-space:nowrap; }
  .atc-chat-history-toggle { grid-column:1; grid-row:1; border:0; width:44px; height:44px; justify-content:center; font-size:1.05rem; }
  .atc-chat-history-toggle [data-i18n] { display:none; }
  .atc-chat-new { grid-column:4; grid-row:1; width:44px; height:44px; justify-content:center; }
  .atc-chat-new [data-i18n] { display:none; }
  .atc-chat-new>span { font-size:1rem; }
  .atc-chat-language-globe { width:19px; height:19px; }
  .atc-chat-language { grid-column:3; grid-row:1; margin:0; }
  .history-open .atc-chat-toolbar-label { display:block; }
  .atc-chat-modes { margin:0 auto 8px; }
  .atc-chat-modes button { font-size:.8rem; padding:7px; }
  .atc-chat-viewport { justify-content:flex-start; padding-bottom:max(12px,env(safe-area-inset-bottom,0px)); }
  .atc-chat-welcome-group { display:flex; flex:1; min-height:0; flex-direction:column; justify-content:center; gap:16px; container:chat-welcome / size; overflow:hidden; }
  .atc-chat .atc-chat-welcome { margin:0 auto; }
  .atc-chat .atc-house-notice { margin:0; }
  .atc-chat-subtitle { font-size:.9rem; }
  .atc-chat-feature-tools { flex:1 1 160px; flex-wrap:wrap; }
  .atc-chat-feature { font-size:.72rem; padding:7px 9px; }
  .atc-chat.has-messages .atc-chat-feature { font-size:.68rem; padding:6px 7px; gap:4px; }
  .atc-chat.has-messages .atc-chat-feature svg { width:16px; height:16px; }
  .atc-chat.has-messages .atc-chat-feature-tools { flex-basis:auto; gap:4px; }
  .atc-history { top:0; }
}
@media(max-width:360px){.atc-chat-feature-tools{gap:4px}.atc-chat-feature{font-size:.66rem;padding:7px}.atc-chat-send-tools{gap:0}.atc-chat-modes button{font-size:.75rem}.atc-chat-toolbar-label{font-size:1rem}}
.atc-chat.is-compact .atc-chat-viewport { justify-content:flex-start; }

.atc-chat.is-compact .atc-chat-modes { margin-bottom:6px; }
.atc-chat.is-compact .atc-house-notice { padding:5px 10px; margin-bottom:8px; }
.atc-chat.is-compact .atc-chat-welcome { margin:4px auto 8px; }
.atc-chat.is-compact:not(.has-messages) .atc-chat-composer-area { padding-top:0; }
.atc-chat.is-compact .atc-housing-profile:not([open]) { padding:0 10px; }
@media(max-width:720px){
  .atc-chat.is-compact .atc-chat-welcome { margin:0 auto; }
  .atc-chat.is-compact .atc-house-notice { margin:0; }
  .atc-chat.is-compact .atc-chat-welcome-group { gap:8px; }
}
/* The remaining space, not a device-specific keyboard offset, controls detail. */
@container chat-welcome (max-height:180px){.atc-chat-subtitle{display:none}}
@container chat-welcome (max-height:100px){.atc-house-notice{display:none}}
@container chat-welcome (max-height:64px){.atc-chat-welcome{display:none}}

/* One bounded horizontal row keeps ten previews usable on small screens. */
.atc-chat-attachment { overflow-x:auto; max-height:116px; align-items:stretch; overscroll-behavior-x:contain; }
.atc-chat-attachment-card { display:grid; grid-template-columns:44px minmax(0,1fr); align-items:center; gap:4px 8px; flex:0 0 180px; min-width:0; }
.atc-chat-attachment-card img { width:44px; height:44px; }
.atc-chat-attachment-card .atc-chat-remove { grid-column:1 / -1; justify-self:start; min-height:28px; }
.atc-chat-image-count { font-size:.68rem; color:var(--chat-muted); white-space:nowrap; }
.atc-chat-sent-image { max-width:min(160px,100%); max-height:160px; object-fit:contain; margin:4px; }
.atc-chat-attachment button:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
@media(max-width:480px) { .atc-chat-attachment-card { flex-basis:150px; } }
