/* Mevcut sade pencere korunur; yalnız sohbet geçmişi kendi alanında kayar. */
.conversation{width:100%;text-align:start;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#55664f transparent;min-height:0;padding:12px 6px 20px}
.conversing .arrival{display:none}.conversing .presence{height:calc(var(--app-height,100dvh) - 160px);display:flex;flex-direction:column;min-height:0;padding-top:0}
.conversing .conversation{flex:1}.conversing .conversation-composer{flex:none}.chat-message{padding:16px 10px 22px;max-width:100%;overflow-wrap:anywhere}.chat-message.user{color:#b5c2ae}.chat-author{display:block;font-size:11px;letter-spacing:.03em;color:#91a18b;margin-bottom:8px}.chat-text{font-size:15px;line-height:1.85;white-space:pre-wrap;unicode-bidi:plaintext}.chat-message img{max-width:min(100%,320px);max-height:260px;object-fit:contain;border-radius:12px;margin-top:14px}
#chat-tools{display:flex;gap:20px;flex-wrap:wrap}#chat-tools[hidden],.conversation[hidden],#image-preview[hidden]{display:none}
#chat-tools button{font-size:11px;padding:0;min-height:36px;color:#b3c1aa;background:none;border:0}#image-preview{display:flex;align-items:center;gap:16px;margin-bottom:12px}#image-preview img{height:60px;width:70px;object-fit:cover;border-radius:8px}#image-preview button{font-size:11px;background:none;border:0;color:#b3c1aa}#chat-tools button:focus-visible,#image-preview button:focus-visible{outline:1px solid #aec4a6;outline-offset:3px}
@media(max-width:600px),(max-height:500px) and (max-width:1000px){.conversing .presence{height:100%;padding-top:0}.conversing .conversation-composer{flex:none}.conversing .conversation-composer textarea{height:54px;flex:none}.conversation{padding-bottom:6px}.chat-message{padding-inline:0}.chat-text{font-size:15px}.conversing #connection-note{font-size:9px;margin-block:6px}.conversing #intent-status{font-size:11px;min-height:0;margin:4px 0}.conversing .conversation-composer{padding-top:12px}html[data-keyboard-open=true] .conversing .conversation-composer{flex:none}html[data-keyboard-open=true] .conversing .conversation-composer textarea{flex:none;height:45px}}

/* Açıklama sakin bir okuma ritmi taşır; biçimleme yalnız asistanın son yanıtına aittir. */
.zen-window.conversing{height:var(--app-height,100dvh);min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
.conversing .presence{height:100%;margin:0 auto;padding-bottom:12px;overflow:hidden}
.conversing .conversation-composer textarea{height:48px;min-height:48px;max-height:160px}
.chat-rich{white-space:normal;min-width:0}
.chat-rich p{margin:0 0 1em;white-space:pre-wrap}
.chat-rich>:last-child{margin-bottom:0}
.chat-rich h2,.chat-rich h3{font-size:17px;line-height:1.5;font-weight:500;letter-spacing:0;margin:1.5em 0 .65em;color:#e5ebdf}
.chat-rich h3{font-size:15px}.chat-rich>:first-child{margin-top:0}
.chat-rich ul,.chat-rich ol{margin:.75em 0 1.2em;padding-inline-start:1.5em}
.chat-rich li{padding-inline-start:.25em;margin:.4em 0;white-space:pre-wrap}
.chat-rich strong{font-weight:600;color:#e5ebdf}
.chat-rich blockquote{margin:1em 0;padding-inline-start:16px;border-inline-start:2px solid #53674f;color:#b9c6b1}
/* Kaynak adı okunaklı kalır; alt çizgi ve klavye odağı bağlantıyı renk dışında da belirtir. */
.chat-rich a{color:#c4d5bc;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.2em;overflow-wrap:anywhere}
.chat-rich a:hover{color:#e5ebdf}
.chat-rich a:focus-visible{outline:2px solid #bed0b2;outline-offset:3px;border-radius:2px}
.chat-rich :not(pre)>code{font: .88em/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;color:#d6e4cd;background:#233027;padding:2px 5px;border-radius:4px}

/* Uzun kod satırı kendi alanında kayar; sayfayı veya mobil pencereyi genişletmez. */
.chat-code{min-width:0;max-width:100%;overflow:hidden;border:1px solid #344438;border-radius:12px;background:#101712;margin:18px 0 24px}
.chat-code-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:2px 14px;background:#1b261e;border-bottom:1px solid #2d3b30;direction:ltr}
.chat-code-language{font:11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;color:#b6c7ae}
.chat-code-copy{min-height:44px;min-width:76px;padding:6px 0;border:0;border-radius:6px;background:none;color:#c4d4bc;font-size:12px}
.chat-code-copy:hover{background:none;color:#f0f4eb}.chat-code-copy:disabled{cursor:wait;opacity:.65}
.chat-code pre{margin:0;padding:18px;overflow:auto;max-height:480px;max-width:100%;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#4c624e transparent;tab-size:4;text-align:left;unicode-bidi:isolate}
.chat-code pre code{display:block;font:13px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace;color:#dce5d5;white-space:pre;overflow-wrap:normal;word-break:normal}
.chat-copy-feedback{display:block;font-size:11px;line-height:1.6;color:#b9cbb0;padding:0 14px 10px}
.chat-copy-feedback:empty{display:none}
.chat-code-copy:focus-visible,.chat-code pre:focus-visible{outline:1px solid #aec4a6;outline-offset:-3px}
@media(max-width:600px){.chat-code{margin:14px 0 20px;border-radius:10px}.chat-code pre{padding:14px;max-height:360px}.chat-code pre code{font-size:12px}.chat-rich h2{font-size:16px}}

/* Gönder: yazı tipi okunun yerine optik olarak ortalanmış çizgi ikon; dokunma alanı korunur. */
.conversation-composer[data-mode=chat] .send-message{margin-inline-start:auto;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:1px solid #c4d4b8;border-radius:15px;display:grid;place-items:center;background:#bed0b2;color:#203023;font-size:0;opacity:1;box-shadow:inset 0 1px 0 #ffffff18;transition:background-color 150ms ease,border-color 150ms ease,transform 150ms ease}
.conversation-composer[data-mode=chat] .send-message::before{content:"";display:block;width:20px;height:20px;background:currentColor;mask:url('assets/send-arrow.svg') center/contain no-repeat;-webkit-mask:url('assets/send-arrow.svg') center/contain no-repeat}
.conversation-composer[data-mode=chat] .send-message:hover:not(:disabled){background:#d0dfc5;border-color:#d0dfc5;transform:translateY(-1px)}
.conversation-composer[data-mode=chat] .send-message:active:not(:disabled){transform:scale(.96)}
.conversation-composer[data-mode=chat] .send-message:focus-visible{outline:1px solid #d3e0cc;outline-offset:3px}
/* Bağlantısız/bekleyen durum sakin kalır; görünüm iyileştirmesi gönderim yetkisini değiştirmez. */
.conversation-composer[data-mode=chat] .send-message:disabled{background:#243128;color:#a7b69f;border-color:#40503f;box-shadow:none;cursor:default;opacity:1;transform:none}
@media(prefers-reduced-motion:reduce){.conversation-composer[data-mode=chat] .send-message{transition:none}.conversation-composer[data-mode=chat] .send-message:hover:not(:disabled),.conversation-composer[data-mode=chat] .send-message:active:not(:disabled){transform:none}}

/* Bekleyiş yanıtın yerinde görünür; süre ölçülür, adımlar zamanlayıcıyla uydurulmaz. */
.chat-activity{padding-top:12px;padding-bottom:28px;min-height:126px;text-align:start}
.chat-activity-receipt{margin:0 0 12px;color:#94aa90;font-size:11px;line-height:1.6}
.chat-activity-receipt::before{content:'✓';margin-inline-end:8px;font-size:11px}
.chat-activity-line{display:flex;align-items:center;gap:11px;min-height:28px;color:#d8e2d1;font-size:15px;line-height:1.7}
.chat-activity-indicator{width:8px;height:8px;flex:none;border-radius:50%;background:#b7ccb0;box-shadow:0 0 0 4px #8fa88616;animation:zen-activity-breathe 2s ease-in-out infinite}
.chat-activity-meta{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-top:8px;padding-inline-start:19px;color:#92a18e;font-size:11px;line-height:1.8}
.chat-activity-time{font-variant-numeric:tabular-nums;letter-spacing:.04em}
.chat-activity-connection:not([hidden])+.chat-activity-time::before{content:'·';margin-inline-end:12px;color:#657761}
.chat-activity-note{margin:12px 0 0;padding-inline-start:19px;font-size:12px;line-height:1.8;color:#aab8a4;max-width:54ch}
.chat-activity[data-state=failed] .chat-activity-indicator,.chat-activity[data-state=cancelled] .chat-activity-indicator{animation:none;box-shadow:none;background:#a2987c}
.chat-activity[data-state=failed] .chat-activity-title{color:#d8c5ad}
@keyframes zen-activity-breathe{0%,100%{opacity:.45;transform:scale(.85)}50%{opacity:1;transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.chat-activity-indicator{animation:none}}

/* Yazı alanı tek araç sırası kullanır; yeni sohbet, görsel ve iptal aynı yerde kalır. */
.conversation-composer .intent-tools{gap:12px}
.conversation-composer #chat-tools{align-items:center;gap:14px;flex-wrap:wrap;min-width:0}
.conversation-composer #chat-tools:not(:has(button:not([hidden]))){display:none}
.conversation-composer[data-mode=chat] textarea{display:block}
@media(max-width:600px),(max-height:500px) and (max-width:1000px){
 /* Boş alan tek satırdır; yazıldıkça JS ile en çok dört satıra büyür. */
 .zen-window .conversation-composer[data-mode=chat]{padding:11px 12px 7px;border-radius:19px;flex:none}
 .zen-window .conversation-composer[data-mode=chat] textarea{height:32px;min-height:32px;max-height:96px;line-height:24px;flex:none;resize:none}
 .zen-window .conversation-composer[data-mode=chat] .intent-tools{margin-top:3px;gap:6px;flex-wrap:nowrap;align-items:center}
 .zen-window .conversation-composer[data-mode=chat] #chat-tools{gap:0;flex-wrap:nowrap}
 .zen-window .conversation-composer[data-mode=chat] #chat-tools button{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;font-size:0;border-radius:12px}
 .zen-window #chat-tools button::before{content:'';width:18px;height:18px;background:currentColor;mask:var(--chat-tool-icon) center/contain no-repeat;-webkit-mask:var(--chat-tool-icon) center/contain no-repeat}
 #attach-image{--chat-tool-icon:url('assets/chat-image.svg')}
 #clear-chat{--chat-tool-icon:url('assets/chat-new.svg')}
 #stop-chat{--chat-tool-icon:url('assets/chat-stop.svg')}
 .zen-window .conversation-composer[data-mode=chat] .mode-link{font-size:11px;padding-inline:5px;flex:none}
 .zen-window.conversing .presence{padding-inline:16px;padding-bottom:4px}
 .zen-window.conversing .conversation{padding-inline:4px;padding-bottom:14px;scroll-padding-block:14px}
 .zen-window.conversing #connection-note{font-size:9px;line-height:1.5;margin:6px 4px 0}
 .zen-window.conversing .window-footer>span:first-child{display:none}
 .zen-window.conversing .window-footer{justify-content:center;padding-bottom:env(safe-area-inset-bottom,0px)}
 .zen-window.conversing .window-footer .quiet{margin:0 auto;font-size:10px}
 /* Klavye açılınca yazı alanı boş kalan ekranı kaplayarak yanıtı sıkıştırmaz. */
 html[data-keyboard-open=true] .zen-window .conversation-composer[data-mode=chat]{display:block;flex:none}
}
