.composer-wrap { position: relative; padding: 0 16px calc(12px + env(safe-area-inset-bottom)); }
.composer {
  max-width: 780px;
  margin: 0 auto;
  padding: 12px 10px 8px 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent), var(--shadow-2);
}
.composer textarea { display: block; width: 100%; max-height: 200px; padding: 4px 0 10px; border: 0; outline: 0; background: none; line-height: 1.55; resize: none; }
.composer textarea::placeholder { color: var(--ink-2); }
.composer-row { display: flex; align-items: center; gap: 6px; }
.grow { flex: 1; }

.tool { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); transition: background-color 0.18s, color 0.18s; }
.tool:hover { background: var(--hover); color: var(--ink); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font-size: 14.5px;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.pill:hover { background: var(--hover); color: var(--ink); }
.pill.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.send { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); transition: transform 0.22s var(--ease), background-color 0.2s, opacity 0.2s; }
.send:hover:not(:disabled) { transform: scale(1.07); }
.send:active:not(:disabled) { transform: scale(0.95); }
.send:disabled { background: var(--hover); color: var(--ink-2); opacity: 0.75; cursor: default; }
.send.is-stop { background: var(--ink); color: var(--bg); }

.menu-wrap { position: relative; }
.menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: var(--z-menu); min-width: 260px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-2); animation: pop-in 0.2s var(--ease); }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu svg { color: var(--accent); }

/* Mikrofon: dinlerken ses çubukları */
.wave { display: none; align-items: center; gap: 3px; height: 22px; }
.wave i { width: 3px; height: 6px; border-radius: 2px; background: currentColor; animation: wave 0.9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: 0.15s; }
.wave i:nth-child(3) { animation-delay: 0.3s; }
.wave i:nth-child(4) { animation-delay: 0.45s; }
@keyframes wave { 0%, 100% { transform: scaleY(0.6); } 50% { transform: scaleY(2.8); } }
.tool.is-rec { background: color-mix(in srgb, var(--rooster) 14%, transparent); color: var(--rooster); }
.tool.is-rec .mic-ico { display: none; }
.tool.is-rec .wave { display: inline-flex; }

/* Ekler */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 4px 10px 0; }
.attach { position: relative; display: flex; align-items: center; gap: 10px; height: 64px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--hover); animation: reveal 0.3s var(--ease); }
.attach img { width: 64px; height: 64px; object-fit: cover; }
.attach.file, .attach.is-loading { min-width: 150px; max-width: 240px; padding: 0 40px 0 12px; }
.attach.doc { height: auto; min-height: 64px; min-width: 190px; max-width: 280px; padding: 8px 40px 8px 12px; }
.attach-keep { justify-self: start; margin-top: 2px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 12px; text-decoration: underline; cursor: pointer; }
.attach-keep:disabled { color: var(--ink-2); text-decoration: none; cursor: default; }
.attach-ico { display: inline-grid; color: var(--accent); }
.attach-text { display: grid; min-width: 0; }
.attach-name { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.attach-meta { color: var(--ink-2); font-size: 12px; }
.attach-x { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(14, 13, 24, 0.72); color: #fff; }
.attach-x:hover { background: rgba(14, 13, 24, 0.92); }
.spinner { flex: none; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }

.fine { max-width: 780px; margin: 8px auto 0; color: var(--ink-2); font-size: 12.5px; text-align: center; }
.fine.credit { margin-top: 2px; font-size: 12px; opacity: 0.85; }
.to-bottom { position: absolute; top: -52px; left: 50%; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-2); color: var(--ink-2); transform: translateX(-50%); animation: reveal 0.3s var(--ease); }
.to-bottom:hover { color: var(--ink); }

@media (max-width: 720px) {
  .composer-wrap { padding: 0 10px calc(8px + env(safe-area-inset-bottom)); }
  .pill-label { display: none; }
  .pill { width: 44px; padding: 0; justify-content: center; }
  .fine { display: none; }
  .fine.credit { display: block; margin-top: 4px; font-size: 11px; } /* telif satırı mobilde de görünsün */
}

/* Derin araştırma aç/kapa düğmesi: açıkken vurgulu */
.tool.research-toggle { display: inline-flex; gap: 6px; width: auto; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 550; }
.tool.research-toggle[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 420px) {
  .research-toggle-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tool.research-toggle { width: 44px; padding: 0; justify-content: center; }
}

/* "/" ile skill seçme: yazma alanının üstünde açılan liste ve seçili skill çipi */
.composer { position: relative; }
.skill-menu {
  position: absolute;
  right: 8px;
  bottom: calc(100% + 8px);
  left: 8px;
  z-index: var(--z-menu);
  max-height: min(320px, 50vh);
  margin: 0;
  padding: 6px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  list-style: none;
}
.skill-option { display: grid; gap: 2px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-sm); cursor: pointer; }
.skill-option:hover, .skill-option[aria-selected='true'] { background: var(--hover); }
.skill-option[aria-selected='true'] { box-shadow: inset 3px 0 0 var(--accent); }
.skill-option-name { font-weight: 600; overflow-wrap: anywhere; }
.skill-option-detail { overflow: hidden; color: var(--ink-2); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.skill-empty { padding: 12px; color: var(--ink-2); font-size: 14px; }
.skill-chip-row { display: flex; padding: 0 4px 8px 0; }
.skill-chip { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding-left: 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; font-weight: 600; }
.skill-chip-x { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -6px 0; border: 0; border-radius: 50%; background: none; color: inherit; }
.skill-chip-x:hover { background: var(--hover); }
