/* ============================================================
   Atlas — görsel dil
   ============================================================ */
:root {
  --ink: #eef1f7;
  --ink-2: #c7cddb;
  --muted: #99a1b3;
  --muted-2: #737d90;
  --bg: #06070a;
  --panel: #0b0d12;
  --panel-2: #10131a;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --glass: rgba(13, 16, 23, 0.66);
  --glass-2: rgba(18, 22, 31, 0.82);
  --blue: #8ab4ff;
  --violet: #b79cff;
  --pink: #ffb1c8;
  --teal: #74e0d0;
  --danger: #ff8f8f;
  --grad: linear-gradient(100deg, #8ab4ff 0%, #b79cff 46%, #ffb1c8 100%);
  --grad-soft: linear-gradient(100deg, rgba(138, 180, 255, .18), rgba(183, 156, 255, .16) 50%, rgba(255, 177, 200, .14));
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 24px 80px -32px rgba(0, 0, 0, .9);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --side: 286px;
  --maxw: 840px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  overscroll-behavior: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(138, 180, 255, .32); color: #fff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- arka plan ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #05070b;
}
.bg__img {
  position: absolute;
  inset: -3%;
  background: url("assets/atlas-bg.jpg") center 38% / cover no-repeat;
  opacity: .8;
  filter: saturate(.86) contrast(1.04) brightness(1.14);
  transform: scale(1.03);
  animation: drift 48s ease-in-out infinite alternate;
}
.bg__scan {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
  mask-image: radial-gradient(120% 90% at 50% 10%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 10%, #000 0%, transparent 78%);
  opacity: .5;
}
.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}
.bg__glow--a {
  width: 52vw; height: 52vw; left: -12vw; top: -16vw;
  background: radial-gradient(circle, rgba(74, 128, 255, .34), transparent 65%);
}
.bg__glow--b {
  width: 46vw; height: 46vw; right: -10vw; bottom: -18vw;
  background: radial-gradient(circle, rgba(160, 108, 255, .26), transparent 65%);
}
.bg__vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 38%, rgba(4, 5, 8, .62) 100%),
    linear-gradient(180deg, rgba(4, 5, 8, .42) 0%, rgba(4, 5, 8, .28) 34%, rgba(4, 5, 8, .74) 82%, #05060a 100%);
}
@keyframes drift {
  from { transform: scale(1.03) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(0, -1.4%, 0); }
}

/* ---------- iskelet ---------- */
.app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
}

/* ---------- kenar çubuğu ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 12px 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 10, 15, .82), rgba(8, 10, 15, .62));
  backdrop-filter: blur(22px) saturate(1.1);
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
}
.sidebar__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 28px; height: 28px; display: grid; place-items: center;
  filter: drop-shadow(0 0 14px rgba(160, 150, 255, .45));
}
.brand__mark svg { width: 100%; height: 100%; }
.brand__name {
  font-size: 17px; font-weight: 600; letter-spacing: .2px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__tag {
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  padding: 2px 6px; border-radius: 999px;
  margin-left: 2px;
}
.sidebar__close { display: none; }

.new-chat {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.028));
  color: var(--ink);
  font-size: 14px; font-weight: 550;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.new-chat svg { width: 17px; height: 17px; color: var(--blue); }
.new-chat:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.22); }
.new-chat:active { transform: scale(.985); }

.chat-list {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 0 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.14) transparent;
  mask-image: linear-gradient(180deg, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 92%, transparent 100%);
}
.chat-list::-webkit-scrollbar { width: 6px; }
.chat-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 99px; }
.chat-group__label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted-2);
  padding: 14px 10px 7px;
}
.chat-item {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0; border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  text-align: left;
  transition: background .16s ease, color .16s ease;
}
.chat-item:hover { background: rgba(255,255,255,.055); color: var(--ink); }
.chat-item.is-active { background: rgba(255,255,255,.085); color: var(--ink); }
.chat-item.is-active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px;
  border-radius: 2px; background: var(--grad);
}
.chat-item__icon { flex: 0 0 auto; width: 15px; height: 15px; color: var(--muted); }
.chat-item__label {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-item__del {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 7px;
  border: 0; background: transparent; color: var(--muted);
  opacity: 0;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.chat-item:hover .chat-item__del, .chat-item:focus-within .chat-item__del { opacity: 1; }
.chat-item__del:hover { background: rgba(255,255,255,.1); color: var(--danger); }
.chat-item__del svg { width: 13px; height: 13px; }
.chat-empty { padding: 10px 10px 0; font-size: 12.5px; color: var(--muted-2); line-height: 1.6; }

.sidebar__foot { padding-top: 10px; border-top: 1px solid var(--line); }

.profile {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .028);
  color: var(--ink);
  text-align: left;
  transition: background .16s ease, border-color .16s ease;
}
.profile:hover { background: rgba(255, 255, 255, .055); border-color: var(--line-strong); }
.profile__avatar {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--grad-soft);
  border: 1px solid var(--line-strong);
  font-size: 13px; font-weight: 650;
}
.profile.is-empty .profile__avatar { background: rgba(255, 255, 255, .05); color: var(--muted); }
.profile__meta { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.profile__meta strong {
  font-size: 12.5px; font-weight: 550;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile__meta small {
  font-size: 10.8px; color: var(--muted-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile__edit { flex: 0 0 auto; width: 14px; height: 14px; color: var(--muted-2); }

.device-hint {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px 10px;
  font-size: 11.5px; line-height: 1.45;
  color: var(--muted);
}
.device-hint__dot {
  flex: 0 0 auto; width: 6px; height: 6px; margin-top: 4px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px rgba(116, 224, 208, .8);
}
.device-hint code {
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-2);
  background: rgba(255,255,255,.06);
  padding: 1px 5px; border-radius: 5px;
  word-break: break-all;
}
.side-btn {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0; border-radius: 11px;
  background: transparent; color: var(--ink-2);
  font-size: 13px;
  text-align: left;
  transition: background .16s ease, color .16s ease;
}
.side-btn svg { width: 16px; height: 16px; color: var(--muted); }
.side-btn:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.key-status {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px 2px;
  font-size: 11px; color: var(--muted-2);
}
.key-status__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted-2);
}
.key-status.is-live .key-status__dot {
  background: #7ee2a8;
  box-shadow: 0 0 9px rgba(126, 226, 168, .8);
}
.key-status.is-live { color: #a9ecc4; }

/* ---------- ana alan ---------- */
.main {
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 12px clamp(14px, 3vw, 26px);
  min-height: 58px;
}
.topbar__menu { display: none; }
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 8px; }
.model-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 15, 21, .5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12.5px; color: var(--ink-2);
  user-select: none;
}
.model-chip svg { width: 14px; height: 14px; color: var(--muted); }
.model-chip__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(116, 224, 208, .7);
}
.model-chip.is-live-model .model-chip__dot {
  background: #8ab4ff;
  box-shadow: 0 0 8px rgba(138, 180, 255, .8);
}
.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: rgba(255,255,255,.07); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }

.scroll {
  flex: 1; min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 clamp(14px, 3vw, 26px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.14) transparent;
  scroll-behavior: smooth;
}
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 99px; }
.scroll-pad { height: 28px; }

/* ---------- karşılama ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(18px, 6vh, 64px) 0 26px;
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .13em;
  color: var(--muted);
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 13, 19, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 0 0 rgba(183, 156, 255, .55);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(183, 156, 255, .5); }
  70% { box-shadow: 0 0 0 8px rgba(183, 156, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(183, 156, 255, 0); }
}
.hero__title {
  margin: 20px 0 12px;
  font-size: clamp(34px, 6.2vw, 60px);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 560;
  color: #f4f6fb;
  text-shadow: 0 8px 40px rgba(0, 0, 0, .55);
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(150, 130, 255, .28));
}
.hero__sub {
  margin: 0 0 26px;
  max-width: 610px;
  font-size: clamp(14px, 1.6vw, 16.5px);
  line-height: 1.65;
  color: var(--ink-2);
  text-shadow: 0 2px 18px rgba(0, 0, 0, .5);
}
.suggest {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.suggest__card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  padding: 15px 15px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  text-align: left;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.suggest__card::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity .24s ease;
  pointer-events: none;
}
.suggest__card:hover {
  transform: translateY(-2px);
  border-color: rgba(183, 156, 255, .3);
}
.suggest__card:hover::after { opacity: 1; }
.suggest__card > * { position: relative; z-index: 1; }
.suggest__icon {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  margin-bottom: 6px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--blue);
}
.suggest__icon svg { width: 17px; height: 17px; }
.suggest__card:nth-child(2) .suggest__icon { color: var(--violet); }
.suggest__card:nth-child(3) .suggest__icon { color: var(--teal); }
.suggest__card:nth-child(4) .suggest__icon { color: #ffcf9a; }
.suggest__card:nth-child(5) .suggest__icon { color: var(--pink); }
.suggest__card:nth-child(6) .suggest__icon { color: #a8e6a3; }
.suggest__title {
  font-size: 13.5px; font-weight: 600; letter-spacing: -.005em;
  color: var(--ink);
}
.suggest__desc {
  font-size: 11.8px; line-height: 1.45;
  color: var(--muted);
}
.hero__foot {
  margin: 22px 0 0;
  font-size: 11.5px;
  color: var(--muted-2);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ---------- mesajlar ---------- */
.messages {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 8px;
}
.msg {
  display: flex;
  gap: 13px;
  padding: 18px 0;
  animation: msg-in .32s ease both;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.msg--user {
  justify-content: flex-end;
  padding: 16px 0 6px;
}
.msg__bubble {
  max-width: 86%;
  padding: 12px 16px;
  border-radius: 20px 20px 6px 20px;
  border: 1px solid rgba(255,255,255,.09);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.055));
  font-size: 14.5px;
  line-height: 1.6;
  color: #f3f5fa;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 14px 40px -26px rgba(0,0,0,.9);
}
.msg__avatar {
  flex: 0 0 auto;
  position: relative;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 10px;
  background:
    radial-gradient(120% 120% at 20% 15%, rgba(255,255,255,.35), transparent 45%),
    conic-gradient(from 210deg at 50% 50%, #6ea8ff, #a883ff, #ff9fbb, #6ea8ff);
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 8px 24px -10px rgba(150,130,255,.8);
  color: #0a0b10;
  font-size: 13px; font-weight: 800;
  user-select: none;
}
.msg__avatar svg { width: 16px; height: 16px; color: #0a0b10; }
.msg__body { min-width: 0; flex: 1; }
.msg__meta {
  display: flex; align-items: center; gap: 8px;
  margin: 2px 0 9px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  color: var(--ink-2);
}
.msg__meta .badge {
  font-size: 9.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 6px;
}
.msg__actions {
  display: flex; align-items: center; gap: 2px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity .18s ease;
}
.msg:hover .msg__actions, .msg:focus-within .msg__actions { opacity: 1; }
.msg__actions .icon-btn { width: 30px; height: 30px; }
.msg__actions .icon-btn svg { width: 15px; height: 15px; }

/* markdown */
.md { font-size: 14.7px; line-height: 1.72; color: #dde2ec; overflow-wrap: anywhere; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h1, .md h2, .md h3, .md h4 {
  margin: 22px 0 9px;
  line-height: 1.3;
  color: #f2f4fa;
  font-weight: 600;
  letter-spacing: -.01em;
}
.md h1 { font-size: 21px; }
.md h2 { font-size: 18px; }
.md h3 { font-size: 15.8px; }
.md h4 { font-size: 14.5px; }
.md strong { color: #fff; font-weight: 600; }
.md em { color: #e6e9f2; }
.md ul, .md ol { margin: 0 0 13px; padding-left: 22px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--violet); }
.md code {
  font-family: var(--mono);
  font-size: .86em;
  padding: 1.5px 5px;
  border-radius: 5px;
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.06);
  color: #cfe0ff;
}
.md pre {
  margin: 12px 0 14px;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(5, 7, 11, .72);
  border: 1px solid var(--line);
  overflow-x: auto;
  font-size: 12.6px;
  line-height: 1.6;
}
.md pre code { background: none; border: 0; padding: 0; color: #dbe6f7; font-size: inherit; }
.md blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 2px solid rgba(183, 156, 255, .55);
  background: rgba(183, 156, 255, .06);
  border-radius: 0 10px 10px 0;
  color: var(--ink-2);
}
.md hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.md .table-wrap { overflow-x: auto; margin: 12px 0 16px; border-radius: 12px; border: 1px solid var(--line); }
.md table { width: 100%; border-collapse: collapse; font-size: 12.8px; min-width: 340px; }
.md thead th {
  background: rgba(255,255,255,.055);
  color: #eef1f8;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.md th, .md td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md tbody tr:last-child td { border-bottom: 0; }
.md tbody tr:hover { background: rgba(255,255,255,.025); }
.md a { color: var(--blue); }
.md sup { font-size: 10px; color: var(--blue); }

/* kaynaklar */
.sources {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.source-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(138, 180, 255, .22);
  border-radius: 999px;
  background: rgba(138, 180, 255, .07);
  font-size: 11px; font-weight: 550; letter-spacing: .01em;
  color: #bed4ff;
  white-space: nowrap;
}
.source-chip__dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.kb-note {
  display: flex; gap: 9px;
  margin-bottom: 14px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid rgba(116, 224, 208, .18);
  background: rgba(116, 224, 208, .055);
  font-size: 12px; line-height: 1.5;
  color: #b9e8e1;
}
.kb-note svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; }
.kb-note--warn {
  border-color: rgba(255, 196, 130, .2);
  background: rgba(255, 196, 130, .06);
  color: #f0d3ac;
}

/* yazıyor */
.typing {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 2px;
  height: 20px;
}
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--violet);
  opacity: .55;
  animation: blink 1.25s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes blink {
  0%, 80%, 100% { opacity: .28; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}
.caret {
  display: inline-block;
  width: 7px; height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  border-radius: 2px;
  background: var(--violet);
  animation: caret .9s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ---------- bestekâr ---------- */
.composer-wrap {
  position: relative;
  width: 100%;
  max-width: calc(var(--maxw) + 2 * clamp(14px, 3vw, 26px));
  margin: 0 auto;
  padding: 6px clamp(14px, 3vw, 26px) calc(12px + env(safe-area-inset-bottom));
}
.composer {
  position: relative;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 24, 33, .9), rgba(12, 15, 21, .92));
  box-shadow: 0 20px 60px -26px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.composer:focus-within {
  border-color: rgba(183, 156, 255, .38);
  box-shadow: 0 20px 70px -24px rgba(0, 0, 0, .95), 0 0 0 4px rgba(150, 130, 255, .07), inset 0 1px 0 rgba(255,255,255,.07);
}
.composer textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  max-height: 190px;
  padding: 17px 18px 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  resize: none;
  outline: none;
  scrollbar-width: thin;
}
.composer textarea::placeholder { color: #7d8698; }
.composer__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 4px 9px 9px 11px;
}
.composer__right { display: flex; align-items: center; gap: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: var(--ink-2);
  font-size: 11.5px; font-weight: 550;
  transition: background .16s ease, border-color .16s ease;
}
.pill:hover { background: rgba(255,255,255,.075); border-color: var(--line-strong); }
.pill svg { width: 13px; height: 13px; color: var(--muted); }
.pill__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--teal);
}
.pill.is-live-model .pill__dot { background: var(--blue); }
.composer .icon-btn { width: 34px; height: 34px; }
.composer .icon-btn svg { width: 17px; height: 17px; }
.send {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--grad);
  color: #0b0c12;
  box-shadow: 0 8px 22px -8px rgba(160, 130, 255, .7);
  transition: transform .16s ease, filter .16s ease, opacity .16s ease;
}
.send svg { width: 18px; height: 18px; }
.send:hover { filter: brightness(1.08); }
.send:active { transform: scale(.93); }
.send:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.send--stop { background: rgba(255,255,255,.12); color: var(--ink); box-shadow: none; }
.send--stop svg { width: 16px; height: 16px; }
.disclaimer {
  margin: 8px 0 0;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted-2);
}
.credit {
  margin: 3px 0 0;
  text-align: center;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .03em;
  color: var(--muted-2);
  opacity: .75;
}
.gate__card .credit {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted-2);
  opacity: .8;
}
.scroll-bottom {
  position: absolute;
  top: -46px; left: 50%;
  transform: translateX(-50%) translateY(6px);
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(16, 19, 26, .9);
  color: var(--ink-2);
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, background .2s ease;
}
.scroll-bottom svg { width: 15px; height: 15px; }
.scroll-bottom.is-visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.scroll-bottom:hover { background: rgba(28, 33, 44, .95); }

/* ---------- ayarlar ---------- */
.sheet {
  width: min(560px, calc(100vw - 28px));
  max-height: min(86dvh, 780px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: linear-gradient(180deg, #12151d, #0b0d12);
  color: var(--ink);
  box-shadow: 0 40px 120px -30px #000;
}
.sheet::backdrop {
  background: rgba(3, 4, 7, .68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sheet[open] { animation: sheet-in .22s ease both; }
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.sheet__inner {
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px;
  max-height: inherit;
  overflow-y: auto;
}
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.sheet__head h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.sheet__sub { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); max-width: 40ch; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field__link { font-size: 11.5px; color: var(--blue); }
.field__input {
  display: flex; align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field__input:focus-within {
  border-color: rgba(183,156,255,.45);
  box-shadow: 0 0 0 3px rgba(150,130,255,.08);
}
.field__input input {
  flex: 1; min-width: 0;
  padding: 11px 12px;
  border: 0; background: transparent;
  font-family: var(--mono);
  font-size: 12.5px;
  outline: none;
}
.field__input .icon-btn { width: 38px; height: 38px; }
.field select {
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field__hint { margin: 0; font-size: 11.3px; line-height: 1.55; color: var(--muted-2); }
.field__hint--server { color: var(--teal); opacity: .9; }
.field__note { font-size: 11.3px; line-height: 1.55; color: var(--muted-2); }

.text-input {
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.text-input:focus {
  border-color: rgba(183, 156, 255, .45);
  box-shadow: 0 0 0 3px rgba(150, 130, 255, .08);
}

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
  cursor: pointer;
}
.switch-row span:first-child { display: flex; flex-direction: column; gap: 2px; }
.switch-row strong { font-size: 12.8px; font-weight: 550; color: var(--ink-2); }
.switch-row small { font-size: 11px; line-height: 1.45; color: var(--muted-2); }
.switch-row input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.switch {
  position: relative;
  flex: 0 0 auto;
  width: 38px; height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  transition: background .2s ease;
}
.switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #e9edf6;
  transition: transform .2s ease;
}
.switch-row input:checked + .switch { background: linear-gradient(90deg, #6f9cff, #b18cff); }
.switch-row input:checked + .switch::after { transform: translateX(16px); }
.switch-row input:focus-visible + .switch { box-shadow: 0 0 0 3px rgba(150,130,255,.25); }

.sheet__actions { display: flex; gap: 9px; flex-wrap: wrap; }
.sheet__links { display: flex; gap: 16px; flex-wrap: wrap; margin: 2px 0 -2px; }
.sheet__links:empty { display: none; }
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--ink); }
.btn {
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px;
  background: rgba(255,255,255,.09);
  color: var(--ink);
  font-size: 12.8px; font-weight: 600;
  transition: background .16s ease, transform .16s ease, border-color .16s ease;
}
.btn:hover { background: rgba(255,255,255,.14); }
.btn:active { transform: scale(.98); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: rgba(255,255,255,.07); }
.btn--danger {
  margin-left: auto;
  border-color: rgba(255, 122, 122, .28);
  background: rgba(255, 100, 100, .08);
  color: #ffb4b4;
  font-size: 11.8px;
}
.btn--danger:hover { background: rgba(255, 100, 100, .14); }
.sheet__divider { height: 1px; background: var(--line); }
.sheet__foot { display: flex; flex-direction: column; gap: 14px; }
.about { font-size: 11.5px; line-height: 1.7; color: var(--muted); }
.about strong { color: var(--ink-2); }
.sheet__foot .btn--danger { margin-left: 0; align-self: flex-start; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 60;
  transform: translate(-50%, 16px);
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(18, 22, 30, .96);
  color: var(--ink);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.scrim {
  position: fixed; inset: 0;
  z-index: 20;
  background: rgba(2, 3, 6, .62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ---------- duyarlılık ---------- */
@media (max-width: 1120px) {
  .suggest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  :root { --side: 300px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    z-index: 30;
    top: 0; bottom: 0; left: 0;
    width: min(var(--side), 86vw);
    transform: translateX(-104%);
    transition: transform .28s cubic-bezier(.24, .8, .28, 1);
    background: linear-gradient(180deg, rgba(9, 11, 16, .97), rgba(8, 10, 15, .94));
    border-right: 1px solid var(--line);
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    box-shadow: 30px 0 90px -30px #000;
  }
  .sidebar.is-open { transform: none; }
  .sidebar__close { display: grid; }
  .topbar__menu { display: grid; }
  .topbar { padding-top: max(12px, env(safe-area-inset-top)); }
  .bg__img { background-position: 62% 40%; opacity: .5; }
  .bg__vignette {
    background:
      radial-gradient(130% 70% at 50% 0%, transparent 20%, rgba(4,5,8,.7) 90%),
      linear-gradient(180deg, rgba(4,5,8,.6), rgba(4,5,8,.82) 55%, #05060a 96%);
  }
  .hero { padding-top: clamp(12px, 4vh, 36px); }
  .hero__sub { margin-bottom: 20px; }
  .hero__title { font-size: clamp(32px, 9vw, 44px); }
  .suggest { gap: 9px; }
  .suggest__card { padding: 13px 13px 12px; }
  .msg__bubble { max-width: 90%; }
  .composer-wrap { padding-left: 12px; padding-right: 12px; }
  .scroll { padding: 0 14px; }
  .scroll-bottom { display: none; }
}
@media (max-width: 520px) {
  .suggest { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .suggest__card { flex-direction: row; align-items: center; gap: 11px; padding: 11px 12px; }
  .suggest__icon { margin-bottom: 0; width: 34px; height: 34px; flex: 0 0 auto; }
  .suggest__title { font-size: 13px; }
  .suggest__desc { display: none; }
  .hero__foot { display: none; }
  .hero__title { margin-top: 16px; }
  .msg { gap: 10px; }
  .msg__avatar { width: 26px; height: 26px; border-radius: 8px; }
  .md { font-size: 14.3px; }
  .composer textarea { font-size: 16px; padding: 15px 15px 4px; }
  .composer__bar { padding-left: 8px; }
  .sheet__inner { padding: 18px; gap: 16px; }
  .btn--danger { margin-left: 0; }
}
@media (max-height: 660px) and (min-width: 921px) {
  .hero { padding-top: 14px; }
  .hero__title { font-size: 38px; margin: 14px 0 8px; }
  .hero__sub { margin-bottom: 16px; }
  .hero__foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-contrast: more) {
  .md { color: #f2f4fa; }
  .suggest__card, .composer, .model-chip { border-color: rgba(255,255,255,.28); }
}

/* ---------------- üyelik kapısı ---------------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: radial-gradient(1000px 600px at 50% 0%, rgba(70, 78, 120, .22), transparent 70%), rgba(5, 6, 10, .82);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}
.gate__card {
  width: min(430px, 100%);
  padding: 30px 26px 24px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(22, 26, 36, .96), rgba(11, 14, 20, .97));
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
  text-align: center;
}
.gate__mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--grad);
  color: #0b0c12;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .02em;
}
.gate__card h2 { margin: 0 0 10px; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.gate__card p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--muted); }
.gate__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.gate__fine { margin-top: 16px !important; font-size: 11px !important; opacity: .7; }
.gate__card .btn { min-width: 120px; justify-content: center; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ---------------- fotoğraf ---------------- */
.attach-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 10px 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}
.attach-preview img {
  width: 54px;
  height: 54px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .12);
}
.attach-preview__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.attach-preview__meta strong { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-preview__meta small { font-size: 10.5px; color: var(--muted); }
.attach-preview .icon-btn { flex: none; }

.photo-modes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 4px 8px;
}
.photo-modes__label { font-size: 10.5px; color: var(--muted); letter-spacing: .02em; }
.photo-modes button {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 550;
  transition: background .16s ease, border-color .16s ease;
}
.photo-modes button:hover { background: rgba(255, 255, 255, .09); border-color: var(--line-strong); }

.msg__image {
  display: block;
  max-width: 280px;
  max-height: 230px;
  margin-bottom: 7px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  object-fit: cover;
}

.composer .icon-btn.is-listening {
  color: var(--pink);
  background: rgba(255, 150, 190, .12);
  animation: mic-pulse 1.5s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 140, 180, .3); }
  50% { box-shadow: 0 0 0 6px rgba(255, 140, 180, 0); }
}

@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
  .gate__card { padding: 24px 18px 20px; }
  .msg__image { max-width: 220px; max-height: 190px; }
}
