/* Sistem → Geliştirici asistanı (dev-agent.js). Temel kart / düğme / diyalog stilleri styles.css, workers.css, system.css'ten. */
.da-tabbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.da-tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; padding-bottom: 2px; }
.da-tab { display: inline-flex; align-items: center; gap: 7px; max-width: 240px; padding: 7px 12px; border: 1px solid #e6e8f0; border-radius: 8px; background: #fff; color: #5e6277; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.da-tab span { overflow: hidden; text-overflow: ellipsis; }
.da-tab.active { border-color: var(--purple); color: var(--ink); box-shadow: 0 0 0 2px #6857df1f; }
.da-tab-flag { display: inline-grid; place-items: center; min-width: 16px; height: 16px; border-radius: 8px; background: #d2873e; color: #fff; font-size: 10px; }
.da-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c5c8d6; flex: none; }
.da-dot.running { background: var(--purple); animation: da-pulse 1.2s ease-in-out infinite; }
.da-dot.queued { background: #d2873e; }
.da-dot.idle { background: var(--green); }
@keyframes da-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .da-dot.running, .da-caret { animation: none; } }
.da-nav-alert { background: #d2873e !important; color: #fff !important; }

.da-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.da-workspace:has(.da-side:not(.hidden)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1200px) { .da-workspace:has(.da-side:not(.hidden)) { grid-template-columns: minmax(0, 1fr); } }
/* Yükseklik dev-agent.js fit() ile pencereye göre (--da-h): sayfada kaydırma çubuğu çıkmaz, yalnızca sohbet kayar. */
.da-chat { display: flex; flex-direction: column; height: var(--da-h, calc(100dvh - 250px)); min-height: 320px; margin-bottom: 0; overflow: hidden; }
.da-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.da-chat-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.da-chat-title input { border: 0; padding: 2px 0; font: 700 15px Manrope, sans-serif; color: var(--ink); background: transparent; min-width: 0; }
.da-chat-title input:focus { outline: none; border-bottom: 1px dashed var(--purple); }
.da-chat-actions { display: flex; align-items: center; gap: 6px; }
.da-chat-actions .button:disabled { opacity: .5; cursor: not-allowed; }
.da-status { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; font-size: 12px; color: #676b7f; }
.da-model { height: 30px; max-width: 170px; padding: 0 6px; font-size: 12px; border: 1px solid #d9dbe5; border-radius: 6px; background: #fff; color: inherit; }

.da-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #fafbfd; }
.da-msg { display: flex; flex-direction: column; max-width: 88%; }
.da-msg.user { align-self: flex-end; align-items: flex-end; }
.da-msg.user .da-bubble { background: var(--purple); color: #fff; border-color: var(--purple); white-space: normal; }
.da-msg.assistant { align-self: flex-start; }
.da-msg.sub { margin-left: 24px; opacity: .85; }
.da-bubble { padding: 9px 13px; border: 1px solid #e6e8f0; border-radius: 10px; background: #fff; font-size: 13.5px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.da-bubble.md > :first-child { margin-top: 0; }
.da-bubble.md > :last-child { margin-bottom: 0; }
.da-bubble pre { padding: 9px 11px; border-radius: 7px; background: #f3f4f8; overflow-x: auto; font-size: 12px; }
.da-bubble code { font-size: 12px; }
.da-by { margin-top: 3px; font-size: 11px; color: var(--muted); }
.da-caret { display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: text-bottom; background: var(--purple); animation: da-pulse 1s steps(2) infinite; }

.da-line { font-size: 12.5px; color: #676b7f; padding: 2px 4px; }
.da-line.md p { margin: 0; }
.da-line.error { color: #c0392b; }
.da-line.done { color: #278b65; }
.da-line.commit code, .da-card code, .da-deploy-item code { font-size: 11.5px; padding: 1px 5px; border-radius: 4px; background: #eef0f5; }

.da-tool { align-self: stretch; border: 1px solid #e9eaf1; border-radius: 8px; background: #fff; font-size: 12.5px; }
.da-tool.sub { margin-left: 24px; }
.da-tool.error { border-color: #f1c6c0; }
.da-tool > summary { display: flex; align-items: center; gap: 7px; padding: 6px 10px; cursor: pointer; list-style: none; color: #4b4f63; }
.da-tool > summary::-webkit-details-marker { display: none; }
.da-tool-icon { width: 16px; text-align: center; color: var(--purple); }
.da-tool-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: #676b7f; }
.da-tool-state { color: #278b65; font-weight: 700; }
.da-tool.error .da-tool-state { color: #c0392b; }
.da-tool.orphan { padding: 6px 10px; }
.da-result-label { padding: 6px 10px 0; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.da-pre { margin: 6px 10px 10px; padding: 8px 10px; max-height: 320px; overflow: auto; border-radius: 6px; background: #f3f4f8; font: 11.5px/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: #2d3148; }
.da-pre.error { background: #fdf1ef; color: #8d2a1f; }

.da-approval { align-self: stretch; padding: 10px 12px; border: 1px solid #f3dcc0; border-left: 4px solid #d2873e; border-radius: 8px; background: #fff8ef; font-size: 13px; }
.da-approval.approved { border-color: #bfe3d2; border-left-color: var(--green); background: #f2fbf7; }
.da-approval.rejected { border-color: #f1c6c0; border-left-color: #c0392b; background: #fdf4f2; }
.da-approval-title { font-weight: 700; color: #7d5525; }
.da-approval .da-pre { margin: 8px 0; }
.da-approval-reason { color: #676b7f; font-size: 12.5px; }
.da-approval-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; }
.da-approval-note { flex: 1; min-width: 0; height: 32px; padding: 0 9px; border: 1px solid #e6e8f0; border-radius: 7px; font-size: 12.5px; }

.da-card { align-self: stretch; padding: 10px 12px; border: 1px solid #e6e8f0; border-radius: 8px; background: #fff; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.da-card.success { border-color: #bfe3d2; background: #f2fbf7; }
.da-card.error { border-color: #f1c6c0; background: #fdf4f2; }
.da-card-actions { margin-top: 4px; }
.da-card.ship { border-color: #d6dcf5; background: #f5f7fe; }
.da-card.ship.wait { border-style: dashed; }
.da-card a.da-ship-log { font-size: 12.5px; }

.da-composer { padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.da-composer textarea { width: 100%; resize: vertical; min-height: 64px; max-height: 30vh; padding: 9px 11px; border: 1px solid #e6e8f0; border-radius: 8px; font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--ink); box-sizing: border-box; }
.da-composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.da-composer-actions .muted { margin-right: auto; }
.da-composer textarea.listening { border-color: #d64545; box-shadow: 0 0 0 3px #d6454514; outline: none; }
.da-composer .da-attach { display: inline-flex; align-items: center; justify-content: center; align-self: stretch; width: 42px; padding: 0; color: var(--purple); }
.da-composer .da-mic { display: inline-flex; align-items: center; justify-content: center; align-self: stretch; width: 42px; padding: 0; color: var(--purple); }
.da-composer .da-mic.hidden { display: none; }
.da-composer .da-mic.listening { color: #fff; background: #d64545; border-color: #d64545; animation: da-mic-pulse 1.2s ease-in-out infinite; }
@keyframes da-mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 #d6454566; } 50% { box-shadow: 0 0 0 6px #d6454500; } }
@media (prefers-reduced-motion: reduce) { .da-composer .da-mic.listening { animation: none; } }
.da-composer.dragging { background: #f4f2fe; box-shadow: inset 0 0 0 2px var(--purple); }
.da-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.da-att { position: relative; width: 72px; height: 72px; border: 1px solid #e6e8f0; border-radius: 8px; overflow: hidden; background: #f3f4f8; }
.da-att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.da-att button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: #20243acc; color: #fff; font-size: 13px; line-height: 20px; cursor: pointer; }
.da-att-size { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 4px; background: #20243a99; color: #fff; font-size: 10px; text-align: center; }
.da-msg-images { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 4px; }
.da-msg-images a { display: block; border: 1px solid #e6e8f0; border-radius: 8px; overflow: hidden; background: #fff; }
.da-msg-images img { display: block; max-width: 220px; max-height: 160px; object-fit: contain; }
.da-att-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 4px 16px; width: 96px; }
.da-att-icon { font-size: 20px; line-height: 1; }
.da-att-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #20243a; }
.da-msg-files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 4px; }
.da-file-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 260px; padding: 4px 10px; border: 1px solid #e6e8f0; border-radius: 8px; background: #fff; font-size: 12px; text-decoration: none; color: inherit; }
.da-file-chip > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.da-side { display: flex; flex-direction: column; height: var(--da-h, calc(100dvh - 250px)); min-height: 320px; margin-bottom: 0; overflow: hidden; }
.da-side-actions { display: flex; gap: 6px; align-items: center; }
.da-diff-files { padding: 0 16px 8px; display: flex; flex-direction: column; gap: 2px; max-height: 30%; overflow-y: auto; border-bottom: 1px solid var(--line); }
.da-diff-files a { display: flex; gap: 6px; align-items: center; font: 12px ui-monospace, Consolas, monospace; color: var(--ink); text-decoration: none; padding: 2px 0; overflow-wrap: anywhere; }
.da-diff-files a:hover { color: var(--purple); }
.da-fs { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; font-size: 10px; font-weight: 700; background: #eef0f5; color: #676b7f; flex: none; }
.da-fs.A { background: #dff3ea; color: #278b65; }
.da-fs.D { background: #fbe3df; color: #c0392b; }
.da-add { color: #278b65; }
.da-del { color: #c0392b; }
.da-diff-patch { flex: 1; overflow: auto; padding: 8px 16px 16px; }
.da-patch { margin: 0 0 12px; padding: 8px 0; border: 1px solid #e9eaf1; border-radius: 7px; background: #fff; font: 11.5px/1.45 ui-monospace, Consolas, monospace; overflow-x: auto; }
.da-patch span { display: block; padding: 0 10px; white-space: pre; min-height: 1.45em; }
.da-patch .a { background: #e9f8f0; color: #1d6b4c; }
.da-patch .d { background: #fdeeee; color: #9b2c22; }
.da-patch .c { color: #6857df; background: #f4f2fe; }
.da-patch .h { font-weight: 700; color: #20243a; }

.da-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 14px; align-items: start; }
.da-form { display: flex; flex-direction: column; gap: 6px; padding: 0 19px 18px; }
.da-form label:not(.check-row) { margin-top: 6px; font-size: 12px; font-weight: 600; color: #4b4f63; }
.da-form input:not([type=checkbox]), .da-form textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #e6e8f0; border-radius: 7px; font-size: 13px; }
div.da-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
div.da-form-row > div { display: flex; flex-direction: column; gap: 6px; }
.da-status-body { padding: 0 19px 16px; }
.da-ok { color: #278b65; }
.da-fail { color: #c0392b; }

.da-deploy-dialog { width: min(760px, 94vw); }
.da-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px 12px; margin: 8px 0; }
.da-deploy-history { margin-top: 14px; }
.da-deploy-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.da-deploy-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 9px; border: 1px solid #e9eaf1; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 12.5px; }
.da-deploy-item:hover { border-color: var(--purple); }
.da-deploy-state { font-weight: 700; min-width: 92px; }
.da-deploy-item.success .da-deploy-state { color: #278b65; }
.da-deploy-item.failed .da-deploy-state { color: #c0392b; }
.da-deploy-item.running .da-deploy-state, .da-deploy-item.queued .da-deploy-state { color: var(--purple); }
.da-deploy-msg { flex-basis: 100%; color: #676b7f; font-size: 12px; }
.da-deploy-log { margin: 10px 0 0; max-height: 300px; overflow: auto; padding: 10px; border-radius: 7px; background: #1e2130; color: #d7dae6; font: 11.5px/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; }

/* Sayfa başlığı kısa, alt bilgi satırı yok: dikey alan sohbete kalır (fit() alt bilgi yoksa 20px boşluk bırakır). */
#page-dev-agent .page-heading { margin-bottom: 12px; }
#page-dev-agent .page-heading .eyebrow, #page-dev-agent .page-heading .muted { display: none; }
#page-dev-agent .page-heading h1 { margin: 0; font-size: 21px; }
#page-dev-agent .da-tabbar { margin-bottom: 10px; }
body:has(#page-dev-agent:not(.hidden)) .main-area > .footer { display: none; }
/* Sekme bilgisi tek satır (tamamı üzerine gelince). */
#daMeta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Masaüstü (fare): düğmeler yazma kutusunun sağında; yazma alanı tek blok, mesaj listesine daha çok yer kalır. */
@media (min-width: 761px) and (pointer: fine) {
  .da-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: end; padding: 10px 14px; }
  .da-composer > .da-attachments { grid-column: 1 / -1; }
  .da-composer > textarea { grid-column: 1; min-height: 58px; }
  .da-composer-actions { grid-column: 2; flex-wrap: wrap; max-width: 300px; margin-top: 0; }
  .da-composer-actions .muted { flex-basis: 100%; margin: 0; text-align: right; }
  .da-composer-actions .muted:empty { display: none; }
}

/* Mobil / dokunmatik: okunur yazı boyutları, daha geniş yazı alanı (16px: iOS odakta yakınlaştırmasın). */
@media (max-width: 760px), (pointer: coarse) {
  #page-dev-agent .page-heading .muted { display: none; }
  .da-bubble { font-size: 15.5px; line-height: 1.55; }
  .da-bubble pre, .da-bubble code { font-size: 13.5px; }
  .da-msg { max-width: 94%; }
  .da-line, .da-approval, .da-card { font-size: 14.5px; }
  .da-tool { font-size: 14px; }
  .da-tool-sum, .da-pre { font-size: 13px; }
  .da-log { padding: 12px; }
  .da-composer { padding: 10px 12px; }
  .da-composer textarea { font-size: 16px; min-height: 96px; max-height: 40vh; }
  .da-composer-actions .button { min-height: 40px; font-size: 15px; }
  .da-chat-head { padding: 10px 12px; gap: 8px; }
  /* Sekme bilgisi (dal · kişi · tarih · model · son commit) en fazla 2 satır; mesaj alanına yer kalsın. */
  #daMeta { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
  .da-chat-actions { flex-wrap: wrap; }
  .da-chat-title input { font-size: 16px; }
  .da-model { height: 36px; font-size: 14px; }
  .da-tab { font-size: 14px; padding: 9px 13px; }
}
