/* ==========================================================================
   Şerefli Kur'ân Meali — Meal Asistanı (/ai)
   Tasarım sistemi: sıcak kâğıt zemin, derin lacivert mürekkep, ince altın vurgu.
   Okuma tipografisi kullanıcı tarafından ayarlanabilir (prefs.js).
   ========================================================================== */

/* ---------- 1. Değişkenler ---------- */

:root {
  /* tipografi (JS ile güncellenir) */
  --ui: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --rd-font: 'Literata', Georgia, 'Times New Roman', serif;
  --rd-size: 17px;
  --rd-lh: 1.74;
  --rd-measure: 68ch;
  --ar-font: 'KFGQPC Uthman', 'Amiri Quran', 'Traditional Arabic', serif;
  --ar-size: 29px;
  --ar-lh: 2.05;
  --vr-size: 15.5px;

  /* renk — açık tema */
  --bg: #f2f5f9;
  --bg-tint: #e9eff7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3f9;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --line-strong: #cdd8e5;

  --text: #16283c;
  --text-2: #33475d;
  --text-3: #5b7086;
  --muted: #7b8da1;

  --blue: #1a5490;
  --blue-700: #133f6d;
  --blue-800: #0f3055;
  --blue-tint: #eaf1f9;
  --blue-tint-2: #dce9f7;

  --gold: #a8863c;
  --gold-2: #c9a860;
  --gold-tint: #fbf5e6;
  --gold-line: #ecdfbf;

  --danger: #b42318;
  --danger-tint: #fef3f2;
  --ok: #0a7d55;
  --ok-tint: #eefbf5;

  --ring: 0 0 0 3px rgba(26, 84, 144, .16);
  --shadow-xs: 0 1px 2px rgba(16, 40, 66, .05);
  --shadow-sm: 0 1px 2px rgba(16, 40, 66, .05), 0 4px 12px -6px rgba(16, 40, 66, .14);
  --shadow-md: 0 2px 4px rgba(16, 40, 66, .04), 0 14px 34px -18px rgba(16, 40, 66, .32);
  --shadow-lg: 0 24px 64px -28px rgba(10, 30, 52, .42), 0 2px 8px rgba(10, 30, 52, .06);

  --radius-s: 9px;
  --radius-m: 13px;
  --radius-l: 18px;
  --radius-xl: 24px;

  --sidebar-w: 292px;
  --topbar-h: 62px;
}

html[data-theme="dark"] {
  --bg: #0a121c;
  --bg-tint: #0d1a28;
  --surface: #111c29;
  --surface-2: #0e1824;
  --surface-3: #162435;
  --line: #22334a;
  --line-soft: #1a2838;
  --line-strong: #2f4460;

  --text: #e8eef6;
  --text-2: #c3d1e0;
  --text-3: #9db0c6;
  --muted: #8296ac;

  --blue: #6fa9e0;
  --blue-700: #8fc0ec;
  --blue-800: #b3d6f5;
  --blue-tint: #152b41;
  --blue-tint-2: #1a3550;

  --gold: #d8b46a;
  --gold-2: #e6cd95;
  --gold-tint: #241f14;
  --gold-line: #3d3320;

  --danger: #fca5a0;
  --danger-tint: #2a1614;
  --ok: #6ee7b7;
  --ok-tint: #10261f;

  --ring: 0 0 0 3px rgba(111, 169, 224, .24);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 14px -8px rgba(0, 0, 0, .5);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 38px -22px rgba(0, 0, 0, .75);
  --shadow-lg: 0 28px 70px -30px rgba(0, 0, 0, .85), 0 2px 8px rgba(0, 0, 0, .4);
}

/* ---------- 2. Temel ---------- */

@font-face {
  font-family: 'KFGQPC Uthman';
  src: url('/meal/fonts/KFGQPC_Uthmanic_Script_HAFS_Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

html { -webkit-text-size-adjust: 100%; }

body.ai-body {
  margin: 0;
  font-family: var(--ui);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  overscroll-behavior: none;
}

::selection { background: rgba(26, 84, 144, .18); color: inherit; }
html[data-theme="dark"] ::selection { background: rgba(111, 169, 224, .30); }

.ai-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.i {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: -3px;
}
.i use { pointer-events: none; }

button, input, textarea, select { font-family: inherit; }

:where(button, a, input, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ---------- 3. Yerleşim ---------- */

.ai-app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 62% -18%, var(--bg-tint), transparent 70%),
    var(--bg);
}

/* ---------- 4. Sol panel ---------- */

.ai-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px 14px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 62%, var(--surface-2) 100%);
  border-right: 1px solid var(--line);
  position: relative;
  z-index: 2;
}

.ai-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ai-brand {
  display: flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  border-radius: var(--radius-m);
  padding: 4px;
  margin: -4px;
  transition: background .16s ease;
}
.ai-brand:hover { background: var(--surface-3); }

.ai-brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  overflow: hidden;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgba(16, 40, 66, .07), 0 3px 10px -4px rgba(16, 40, 66, .3);
}
.ai-brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ai-brand-text { min-width: 0; }

.ai-brand-title {
  display: block;
  font-family: var(--ui);
  font-weight: 650;
  font-size: 14.5px;
  line-height: 1.25;
  letter-spacing: -.012em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-brand-sub {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--gold);
}
.ai-brand-sub::before {
  content: "";
  width: 12px;
  height: 1px;
  background: currentColor;
  opacity: .7;
}

.ai-new-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--blue-800);
  border-radius: var(--radius-m);
  padding: 11px 12px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #1f6099 0%, var(--blue) 46%, var(--blue-700) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 16px -8px rgba(19, 63, 109, .75);
  transition: transform .14s ease, box-shadow .18s ease, filter .18s ease;
}
.ai-new-btn .i { width: 16px; height: 16px; stroke-width: 2; }
.ai-new-btn:hover { filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 10px 22px -10px rgba(19, 63, 109, .85); }
.ai-new-btn:active { transform: translateY(1px); }

.ai-history-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.ai-history-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.ai-history {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.ai-history::-webkit-scrollbar { width: 8px; }
.ai-history::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }

.ai-history-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 8px 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: none;
  text-align: left;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-2);
  cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.ai-history-item:hover { background: var(--surface-3); color: var(--text); }
.ai-history-item.is-active {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.ai-history-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2.5px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}

.ai-history-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-history-del {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity .14s ease, background .14s ease, color .14s ease;
}
.ai-history-item:hover .ai-history-del,
.ai-history-item.is-active .ai-history-del { opacity: 1; }
.ai-history-del:hover { background: var(--danger-tint); color: var(--danger); }

.ai-history-empty {
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 8px;
  line-height: 1.5;
}
.ai-history-empty[hidden] { display: none; }

.ai-sidebar-foot {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-foot-note {
  display: flex;
  gap: 8px;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}
.ai-foot-note .i { width: 14px; height: 14px; margin-top: 1px; color: var(--gold); }
.ai-foot-note strong { color: var(--text-3); font-weight: 600; }

.ai-foot-links { display: flex; gap: 14px; flex-wrap: wrap; }
.ai-foot-links a {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .14s ease;
}
.ai-foot-links a:hover { border-bottom-color: currentColor; }

/* ---------- 5. Ana kolon ---------- */

.ai-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.ai-topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 3;
}

.ai-topbar-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-topbar-text { display: flex; flex-direction: column; min-width: 0; }

.ai-topbar-name {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -.012em;
  color: var(--text);
  line-height: 1.25;
}

.ai-topbar-note {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-topbar-actions { display: flex; align-items: center; gap: 8px; }

.ai-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.ai-icon-btn:hover { background: var(--surface-3); color: var(--text); }

.ai-theme-btn .i-moon { display: none; }
html[data-theme="dark"] .ai-theme-btn .i-sun { display: none; }
html[data-theme="dark"] .ai-theme-btn .i-moon { display: inline-block; }

.ai-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.ai-settings-btn .i { width: 15px; height: 15px; }
.ai-settings-btn:hover { background: var(--surface-3); color: var(--text); }
.ai-settings-btn[aria-expanded="true"] {
  background: var(--blue-tint);
  border-color: var(--blue-tint-2);
  color: var(--blue);
}

.ai-topbar-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--blue);
  text-decoration: none;
  background: var(--surface);
  transition: background .14s ease;
}
.ai-topbar-link:hover { background: var(--blue-tint); }

.ai-menu-btn, .ai-sidebar-close, .ai-topbar-logo { display: none; }

/* ---------- 6. Kaydırma alanı ---------- */

.ai-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.ai-scroll::-webkit-scrollbar { width: 10px; }
.ai-scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.ai-messages {
  padding: 34px 22px 10px;
}

.ai-messages > * {
  max-width: min(calc(var(--rd-measure) + 140px), 100%);
  margin-left: auto;
  margin-right: auto;
}

/* ---------- 7. Boş durum ---------- */

.ai-empty {
  text-align: center;
  padding: 5vh 8px 24px;
  animation: aiFadeUp .5s cubic-bezier(.2, .8, .25, 1) both;
}
.ai-empty[hidden] { display: none; }

.ai-empty-mark {
  width: 74px;
  height: 74px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .9), transparent 62%),
    linear-gradient(150deg, var(--blue-tint), var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .7);
  position: relative;
}
.ai-empty-mark::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--gold) 42%, transparent);
  opacity: .65;
}
.ai-empty-mark span {
  font-family: var(--ar-font);
  font-size: 34px;
  line-height: 1;
  color: var(--blue);
  transform: translateY(-1px);
}

.ai-empty-eyebrow {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}

.ai-empty h1 {
  margin: 0 0 12px;
  font-family: var(--rd-font);
  font-size: clamp(26px, 3.4vw, 33px);
  font-weight: 600;
  letter-spacing: -.021em;
  line-height: 1.2;
  color: var(--text);
}

.ai-empty-lead {
  margin: 0 auto 30px;
  max-width: 56ch;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--text-3);
  text-wrap: pretty;
}

.ai-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
  margin: 0 auto;
}

.ai-suggestions button {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform .16s cubic-bezier(.2, .8, .25, 1), box-shadow .18s ease, border-color .18s ease, color .18s ease;
}
.ai-suggestions button:hover {
  transform: translateY(-2px);
  border-color: var(--blue-tint-2);
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.ai-suggestions button:active { transform: translateY(0); }

.ai-sug-k {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--gold-tint);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-family: var(--ar-font);
  font-size: 14px;
  line-height: 1;
}

.ai-sug-t { flex: 1; }

.ai-suggestions button .i {
  width: 15px;
  height: 15px;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .18s ease, transform .18s ease, color .18s ease;
}
.ai-suggestions button:hover .i { opacity: 1; transform: none; color: var(--blue); }

/* ---------- 8. Mesajlar ---------- */

.ai-msg {
  display: flex;
  gap: 12px;
  margin-bottom: 26px;
  animation: aiFadeUp .34s cubic-bezier(.2, .8, .25, 1) both;
}
.ai-msg[hidden] { display: none; }

/* kullanıcı */
.ai-msg-user { justify-content: flex-end; padding-left: 12%; }

.ai-msg-user .ai-bubble {
  position: relative;
  background: linear-gradient(180deg, #22629c 0%, var(--blue) 55%, #17497e 100%);
  color: #fff;
  border-radius: 18px 18px 6px 18px;
  padding: 12px 16px;
  font-family: var(--ui);
  font-size: calc(var(--rd-size) * .93);
  line-height: 1.62;
  letter-spacing: -.003em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 22px -14px rgba(19, 63, 109, .9), inset 0 1px 0 rgba(255, 255, 255, .16);
  user-select: text;
}
html[data-theme="dark"] .ai-msg-user .ai-bubble {
  background: linear-gradient(180deg, #1d4b78 0%, #173c61 100%);
  color: #eaf2fb;
  box-shadow: 0 8px 22px -16px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .1);
}

/* asistan */
.ai-msg-ai { align-items: flex-start; }

.ai-ai-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  margin-top: 3px;
  border-radius: 11px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(16, 40, 66, .07), 0 3px 10px -5px rgba(16, 40, 66, .35);
}
.ai-ai-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ai-answer {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px var(--radius-l) var(--radius-l) var(--radius-l);
  padding: 20px 22px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.ai-answer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), color-mix(in srgb, var(--blue) 45%, var(--gold)) 55%, var(--gold));
  opacity: .55;
}

/* --- okuma tipografisi --- */
.ai-answer-body {
  font-family: var(--rd-font);
  font-size: var(--rd-size);
  line-height: var(--rd-lh);
  color: var(--text);
  letter-spacing: -.002em;
  font-optical-sizing: auto;
  text-wrap: pretty;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
  user-select: text;
}
.ai-answer-body > *:first-child { margin-top: 0; }
.ai-answer-body > *:last-child { margin-bottom: 0; }

.ai-answer-body p { margin: 0 0 .82em; }
.ai-answer-body p + p { margin-top: 0; }

.ai-answer-body ul,
.ai-answer-body ol { margin: 0 0 .9em; padding-left: 1.35em; }
.ai-answer-body li { margin-bottom: .34em; padding-left: .18em; }
.ai-answer-body li::marker { color: var(--gold); }

.ai-answer-body h3 {
  font-family: var(--rd-font);
  font-size: calc(var(--rd-size) * 1.08);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.012em;
  margin: .2em 0 .55em;
  color: var(--text);
}

.ai-answer-body strong { font-weight: 600; color: var(--text); }
.ai-answer-body em { font-style: italic; }

.ai-answer-body blockquote {
  margin: 0 0 .9em;
  padding: .1em 0 .1em 1em;
  border-left: 2px solid var(--gold-line);
  color: var(--text-2);
}

.ai-answer-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em;
  background: var(--surface-3);
  border-radius: 5px;
  padding: .1em .38em;
}

/* âyet referansı */
.ai-answer .ai-ref,
.ai-ref {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
  padding: 0 .16em;
  border-radius: 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 32%, transparent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background .14s ease, border-color .14s ease;
}
.ai-answer .ai-ref:hover,
.ai-ref:hover {
  background: var(--blue-tint);
  border-bottom-color: transparent;
}

/* yazıyor */
.ai-typing { display: inline-flex; gap: 5px; align-items: center; }
.ai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
  animation: aiBlink 1.25s infinite ease-in-out;
}
.ai-typing i:nth-child(2) { animation-delay: .16s; }
.ai-typing i:nth-child(3) { animation-delay: .32s; }
@keyframes aiBlink {
  0%, 80%, 100% { opacity: .22; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2.5px); }
}

.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ui);
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
  letter-spacing: 0;
}

/* ---------- 9. Kaynak âyet kartları ---------- */

.ai-sources {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--ui);
}

.ai-sources-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}
.ai-sources-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.ai-sources-count {
  order: 3;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gold-tint);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-size: 10.5px;
  letter-spacing: .02em;
}

.ai-source {
  position: relative;
  display: block;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 100%, transparent), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 13px 15px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-xs);
  transition: border-color .18s ease, box-shadow .2s ease, transform .18s ease;
}
.ai-source:hover {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ai-source-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.ai-source-ref {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.ai-source-badge {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 22px;
  padding: 0 7px;
  border-radius: 7px;
  background: linear-gradient(180deg, var(--blue-tint), color-mix(in srgb, var(--blue-tint) 60%, var(--surface)));
  border: 1px solid var(--blue-tint-2);
  color: var(--blue);
  font-family: var(--ui);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

.ai-source-name {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-source-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.ai-source-copy,
.ai-source-open {
  display: inline-grid;
  place-items: center;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.ai-source-copy { width: 27px; padding: 0; }
.ai-source-copy .i { width: 13px; height: 13px; }
.ai-source-open { padding: 0 8px; gap: 5px; font-size: 11px; font-weight: 550; }
.ai-source-open .i { width: 12px; height: 12px; }
.ai-source-copy:hover,
.ai-source-open:hover {
  color: var(--blue);
  border-color: var(--blue-tint-2);
  background: var(--blue-tint);
}
.ai-source-copy.copied,
.ai-source-copy.copied:hover {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 30%, var(--line));
  background: var(--ok-tint);
}

.ai-source-ar {
  margin: 0 0 10px;
  font-family: var(--ar-font);
  font-size: var(--ar-size);
  line-height: var(--ar-lh);
  direction: rtl;
  text-align: right;
  color: color-mix(in srgb, var(--text) 88%, var(--blue));
  letter-spacing: 0;
  word-spacing: .04em;
  padding: 2px 2px 0;
  user-select: text;
  text-wrap: pretty;
  transition: font-size .16s ease;
}
html[data-show-ar="0"] .ai-source-ar { display: none; }

.ai-source-tr {
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-family: var(--rd-font);
  font-size: var(--vr-size);
  line-height: 1.72;
  color: var(--text-2);
  text-wrap: pretty;
  user-select: text;
}
.ai-source-ar[hidden] + .ai-source-tr,
.ai-source-ar:only-of-type + .ai-source-tr { border-top: 0; padding-top: 0; }

.ai-source sup { font-size: .62em; color: var(--gold); }

/* ---------- 10. İlgili makaleler ---------- */

.ai-articles {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--ui);
}
.ai-articles-title {
  margin-bottom: 10px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--gold);
}

.ai-article {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 7px;
  border: 1px solid var(--gold-line);
  border-radius: 10px;
  background: var(--gold-tint);
  color: inherit;
  text-decoration: none;
  transition: background .16s ease, transform .16s ease, box-shadow .18s ease;
}
.ai-article:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--gold-tint) 70%, var(--surface));
  box-shadow: var(--shadow-sm);
}
.ai-article .a-body { flex: 1; min-width: 0; }
.ai-article .t {
  font-family: var(--rd-font);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
}
.ai-article .u {
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--gold);
  margin-top: 2px;
}
.ai-article .i { width: 14px; height: 14px; color: var(--gold); opacity: .8; }

/* ---------- 11. Cevap eylemleri ---------- */

.ai-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--ui);
}

.ai-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color .14s ease, background .14s ease, border-color .14s ease;
}
.ai-copy .i { width: 13px; height: 13px; }
.ai-copy:hover { color: var(--blue); border-color: var(--blue-tint-2); background: var(--blue-tint); }
.ai-copy.copied,
.ai-copy.copied:hover { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); background: var(--ok-tint); }

/* ---------- 12. Hata ---------- */

.ai-error {
  margin-top: 10px;
  padding: 10px 13px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-radius: 10px;
  background: var(--danger-tint);
  color: var(--danger);
  font-family: var(--ui);
  font-size: 12.5px;
  line-height: 1.55;
}

/* ---------- 13. Yazma alanı ---------- */

.ai-composer-wrap {
  flex: 0 0 auto;
  padding: 6px 22px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 42%, color-mix(in srgb, var(--bg) 55%, transparent));
  position: relative;
  z-index: 2;
}
.ai-composer-wrap::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -28px;
  height: 28px;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg) 90%, transparent), transparent);
  pointer-events: none;
}

.ai-composer {
  max-width: min(calc(var(--rd-measure) + 140px), 100%);
  margin: 0 auto;
}

.ai-composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-md);
  transition: border-color .16s ease, box-shadow .18s ease;
}
.ai-composer-inner:focus-within {
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
  box-shadow: var(--shadow-md), var(--ring);
}

#aiInput {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  resize: none;
  padding: 8px 0;
  max-height: 190px;
  background: transparent;
  color: var(--text);
  font-family: var(--ui);
  font-size: calc(var(--rd-size) * .94);
  line-height: 1.55;
  letter-spacing: -.003em;
  scrollbar-width: thin;
}
#aiInput::placeholder { color: var(--muted); opacity: .9; }

.ai-send {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--blue-800);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #22629c, var(--blue) 55%, var(--blue-700));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 16px -8px rgba(19, 63, 109, .8);
  transition: filter .15s ease, opacity .15s ease, transform .12s ease;
}
.ai-send .i { width: 19px; height: 19px; stroke-width: 1.9; }
.ai-send:hover:not(:disabled) { filter: brightness(1.08); }
.ai-send:active:not(:disabled) { transform: translateY(1px); }
.ai-send:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.ai-composer-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 0 6px;
  font-size: 11px;
  color: var(--muted);
}

.ai-limit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.ai-limit::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ok);
  opacity: .8;
}

.ai-hint-key { margin-left: auto; }
.ai-hint-key kbd {
  font-family: var(--ui);
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-3);
}

.ai-stop {
  padding: 4px 11px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line));
  border-radius: 8px;
  background: var(--surface);
  color: var(--danger);
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
}
.ai-stop:hover { background: var(--danger-tint); }

/* bağlam çipi */
.ai-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 7px 10px;
  border: 1px solid var(--blue-tint-2);
  border-radius: 10px;
  background: var(--blue-tint);
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
}
.ai-context[hidden] { display: none; }
.ai-context .i { width: 14px; height: 14px; }
.ai-context-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-context-x {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--blue);
  cursor: pointer;
}
.ai-context-x .i { width: 13px; height: 13px; }
.ai-context-x:hover { background: color-mix(in srgb, var(--blue) 12%, transparent); }

/* ---------- 14. Okuma ayarları paneli ---------- */

.ai-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  right: 16px;
  width: 344px;
  max-height: calc(100dvh - var(--topbar-h) - 26px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  overflow: hidden;
  animation: aiPanelIn .2s cubic-bezier(.2, .8, .25, 1) both;
}
.ai-panel[hidden] { display: none; }

@keyframes aiPanelIn {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.ai-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 15px 14px 13px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.ai-panel-head h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--text);
}
.ai-panel-head p {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}
.ai-panel-head .ai-icon-btn { width: 30px; height: 30px; border-radius: 9px; }
.ai-panel-head .ai-icon-btn .i { width: 15px; height: 15px; }

.ai-panel-reset {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .14s ease, background .14s ease;
}
.ai-panel-reset .i { width: 15px; height: 15px; }
.ai-panel-reset:hover { color: var(--blue); background: var(--blue-tint); }

.ai-panel-body {
  overflow-y: auto;
  padding: 4px 16px 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.ai-panel-body::-webkit-scrollbar { width: 9px; }
.ai-panel-body::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 9px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.ai-field { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.ai-field:last-of-type { border-bottom: 0; }

.ai-field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.ai-field-label > span { flex: 1; }
.ai-field-label output {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  background: var(--blue-tint);
  border: 1px solid var(--blue-tint-2);
  border-radius: 6px;
  padding: 1px 7px;
}
.ai-field-label--gold { color: var(--gold); }
.ai-field-label--sub {
  margin: 12px 0 7px;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--text-3);
}

/* font seçenekleri */
.ai-fonts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.ai-fonts button {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.ai-fonts button:hover { border-color: var(--blue-tint-2); background: var(--surface-2); }
.ai-fonts button.is-on {
  border-color: color-mix(in srgb, var(--blue) 52%, var(--line));
  background: var(--blue-tint);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 22%, transparent);
}
.ai-fonts button.is-on::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.ai-fonts .f-sample {
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
  padding-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-fonts .f-name {
  font-family: var(--ui);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.ai-fonts--ar .f-sample {
  font-family: var(--ar-font);
  font-size: 19px;
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  padding-right: 0;
}
.ai-fonts--ar button .f-sample { font-size: 19px; }

/* segment */
.ai-seg {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-3);
}
.ai-seg button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 6px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.ai-seg button .i { width: 14px; height: 14px; }
.ai-seg button:hover { color: var(--text); }
.ai-seg button.is-on {
  background: var(--surface);
  color: var(--blue);
  box-shadow: var(--shadow-xs);
}

/* slider */
.ai-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  display: block;
}
.ai-field input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue) var(--fill, 50%), var(--line) var(--fill, 50%));
  opacity: .95;
}
.ai-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--blue);
  box-shadow: 0 2px 6px -1px rgba(16, 40, 66, .3);
  transition: transform .12s ease;
}
.ai-field input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.08); }
.ai-field input[type="range"]::-moz-range-track {
  height: 5px;
  border-radius: 99px;
  background: var(--line);
}
.ai-field input[type="range"]::-moz-range-progress {
  height: 5px;
  border-radius: 99px;
  background: var(--blue);
}
.ai-field input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--blue);
}

/* anahtar */
.ai-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.ai-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ai-switch-track {
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  border-radius: 99px;
  background: var(--line-strong);
  position: relative;
  transition: background .18s ease;
}
.ai-switch-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .18s cubic-bezier(.2, .8, .25, 1);
}
.ai-switch input:checked + .ai-switch-track { background: var(--blue); }
.ai-switch input:checked + .ai-switch-track span { transform: translateX(16px); }
.ai-switch input:focus-visible + .ai-switch-track { box-shadow: var(--ring); }

.ai-panel-tip {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- 15. Katman / animasyon ---------- */

.ai-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 34, .42);
  backdrop-filter: blur(2px);
  z-index: 40;
}

@keyframes aiFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: 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;
  }
}

/* ---------- 16. Duyarlı ---------- */

@media (max-width: 900px) {
  :root { --sidebar-w: 280px; }
  .ai-messages { padding: 24px 16px 8px; }
  .ai-composer-wrap { padding: 6px 16px max(12px, env(safe-area-inset-bottom)); }
  .ai-settings-btn span { display: none; }
  .ai-settings-btn { width: 34px; padding: 0; justify-content: center; }
  .ai-hint-key { display: none; }
}

@media (max-width: 860px) {
  :root { --topbar-h: 58px; }
  .ai-sidebar {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    width: 86vw;
    max-width: 320px;
    flex-basis: auto;
    transform: translateX(-102%);
    transition: transform .24s cubic-bezier(.2, .8, .25, 1);
    box-shadow: var(--shadow-lg);
  }
  .ai-sidebar.is-open { transform: none; }

  .ai-menu-btn, .ai-sidebar-close { display: inline-grid; }
  .ai-menu-btn { border: 0; background: none; width: 32px; height: 32px; }
  .ai-menu-btn:hover { background: var(--surface-3); }

  .ai-topbar { padding: 0 12px; gap: 8px; }
  .ai-topbar-logo {
    display: block;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(16, 40, 66, .08);
  }
  .ai-topbar-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .ai-topbar-note { display: none; }
  .ai-topbar-name { font-size: 13.5px; }
  .ai-topbar-link { padding: 0 10px; font-size: 12px; }

  .ai-suggestions { grid-template-columns: 1fr; max-width: 460px; }
  .ai-empty { padding-top: 3vh; }
  .ai-empty-mark { width: 62px; height: 62px; margin-bottom: 18px; }
  .ai-empty-mark span { font-size: 28px; }
  .ai-empty h1 { font-size: 25px; }
  .ai-empty-lead { font-size: 13.5px; margin-bottom: 24px; }

  .ai-msg-user { padding-left: 8%; }
  .ai-answer { padding: 16px 15px 14px; }
  .ai-ai-mark { width: 28px; height: 28px; flex-basis: 28px; border-radius: 9px; }
  .ai-msg { gap: 9px; margin-bottom: 20px; }

  .ai-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    max-height: 84dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: aiSheetIn .24s cubic-bezier(.2, .8, .25, 1) both;
  }
  @keyframes aiSheetIn {
    from { transform: translateY(14%); opacity: .5; }
    to { transform: none; opacity: 1; }
  }
  .ai-panel-head::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 38px;
    height: 4px;
    margin-left: -19px;
    border-radius: 99px;
    background: var(--line-strong);
  }
  .ai-panel-head { padding-top: 22px; position: relative; border-radius: inherit; }
  .ai-panel-body { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .ai-source-head { flex-wrap: wrap; }
  .ai-source-tools { margin-left: auto; }
  .ai-source-open span { display: none; }
  .ai-source-open { width: 27px; padding: 0; }
  .ai-fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-composer-foot { font-size: 10.5px; }
}

/* yazdırma */
@media print {
  .ai-sidebar, .ai-topbar, .ai-composer-wrap, .ai-panel, .ai-actions { display: none !important; }
  .ai-app { display: block; height: auto; }
  .ai-scroll { overflow: visible; }
  .ai-answer { box-shadow: none; border-color: #ccc; }
}
