/* studio.css — ilan stüdyosu: sohbet sütunu, önizleme sütunu ve tablet/telefon sekmeleri.
   Yalnız stüdyo seçicilerini tanımlar; değişkenler ve ortak bileşenler style.css'ten gelir.
   ≥901 px: sohbet ve önizleme .app ızgarasında yan yana iki hücre.
   761–900 px: üstte 48 px sekme satırı, altında tek panel.
   ≤760 px: .app dikey flex; sekmeler, ardından tek panel. */

/* ---------- Tablet/telefon sekmeleri ---------- */
.studio-tabs {
  display: grid; grid-template-columns: 1fr 1fr; min-width: 0; height: 48px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.studio-tabs button {
  position: relative; min-width: 0; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 12px; color: var(--ink-2); font-size: var(--text-15); font-weight: 500; white-space: nowrap;
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}
@media (hover: hover) { .studio-tabs button:hover { color: var(--ink); background: var(--surface-2); } }
.studio-tabs button[aria-selected="true"] { color: var(--green-text); font-weight: 600; }
.studio-tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px;
  background: var(--green); border-radius: 2px 2px 0 0;
}
.studio-tabs button:focus-visible { outline-offset: -3px; }
#previewTabProgress {
  display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px;
  color: var(--green-text); background: var(--green-soft); border-radius: 999px;
  font-size: var(--text-12); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
}

/* ---------- Sütunlar ---------- */
.chat, .preview {
  min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden;
}
.chat { background: var(--canvas); }
.preview { background: var(--surface); border-left: 1px solid var(--line); }

/* ---------- Sohbet başlığı ---------- */
.chat-head {
  flex: 0 0 auto; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px 0 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.head-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.head-copy .title {
  overflow: hidden; color: var(--ink); font-family: var(--font-display); font-size: var(--text-22); font-weight: 400; line-height: 1.1;
  text-overflow: ellipsis; white-space: nowrap;
}
.head-copy .sub {
  min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden;
  color: var(--muted); font-size: var(--text-13); line-height: 1.4; white-space: nowrap;
}
.head-copy .sub::before { content: ""; width: 8px; height: 8px; flex: 0 0 8px; background: var(--green); border-radius: 50%; }
.head-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
.head-btn {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px;
  color: var(--ink-2); border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: var(--text-14); font-weight: 500; white-space: nowrap;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.head-btn > svg, .head-btn > .menu-glyph { order: -1; }
.head-btn:hover { color: var(--ink); background: var(--surface-2); }
.head-btn.quick-new { color: var(--green-text); font-weight: 600; }
.head-btn.quick-new:hover { color: var(--green-text); background: var(--green-tint); }

/* ---------- Mesajlar ---------- */
.messages {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-x: hidden; overflow-y: auto;
  padding: 20px max(24px, calc((100% - 720px) / 2)) 24px;
  overscroll-behavior: contain; scrollbar-width: thin; background: var(--canvas);
}
.conversation-date {
  align-self: center; display: inline-block; margin-bottom: 4px; color: var(--muted);
  font-size: var(--text-12); font-weight: 500; line-height: 1.4;
}
.msg {
  max-width: min(88%, 640px); padding: 12px 16px; border-radius: var(--radius);
  font-size: var(--text-15); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.bot { align-self: flex-start; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; color: #fff; background: var(--green); border-bottom-right-radius: 4px; }
.msg.sys {
  align-self: center; max-width: min(92%, 560px); padding: 2px 12px; color: var(--muted);
  font-size: var(--text-13); line-height: 1.5; text-align: center; border-radius: var(--radius-sm);
}
.msg.sys.warn { padding: 8px 12px; color: var(--amber); background: var(--amber-bg); border: 1px solid var(--amber-line); }
.messages > .social-chat { flex: 0 0 auto; }
@media (prefers-reduced-motion: no-preference) {
  .msg, .choices { animation: msgIn 160ms var(--ease-out); }
  @keyframes msgIn { from { opacity: 0; transform: translateY(4px); } }
}

/* ---------- Seçenekler ---------- */
.choices { align-self: flex-start; width: min(100%, 640px); display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.choice-question { color: var(--ink); font-size: var(--text-14); font-weight: 600; line-height: 1.4; }
.choice-grid, .choice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.choice-chip {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: var(--text-14); font-weight: 500; line-height: 1.25; text-align: center;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.choice-chip:hover { background: var(--green-tint); border-color: var(--green); }
.choice-chip.selected { color: #fff; background: var(--green); border-color: var(--green); }
.choice-chip.skip { color: var(--muted); background: transparent; border-color: transparent; }
.choice-chip.skip:hover { color: var(--ink); background: var(--surface-2); border-color: transparent; }
.choice-done {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px;
  color: #fff; background: var(--green); border: 1px solid var(--green); border-radius: var(--radius-sm);
  font-size: var(--text-14); font-weight: 600; transition: background var(--dur-fast) ease;
}
.choice-done:hover { background: var(--green-deep); border-color: var(--green-deep); }

/* ---------- Düzenleme şeridi ---------- */
.edit-bar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px max(16px, calc((100% - 720px) / 2)); color: var(--amber); background: var(--amber-bg);
  border-top: 1px solid var(--amber-line); font-size: var(--text-13); font-weight: 500;
}
.edit-bar span { min-width: 0; overflow-wrap: anywhere; }
.edit-bar button {
  flex: 0 0 auto; min-height: 32px; padding: 0 12px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: var(--text-13); font-weight: 600;
}
.edit-bar button:hover { background: var(--surface-2); }

/* ---------- Yazma alanı ---------- */
.composer {
  flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px;
  padding: 12px max(16px, calc((100% - 720px) / 2)); background: var(--surface); border-top: 1px solid var(--line);
}
.composer-tools { flex: 0 0 auto; display: flex; gap: 2px; padding-bottom: 2px; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-2);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); border-color: var(--line-2); }
.icon-btn svg { width: 20px; height: 20px; }
.input-wrap { flex: 1 1 auto; min-width: 0; }
.input-wrap textarea, #input {
  display: block; width: 100%; height: 48px; min-height: 48px; max-height: 144px; padding: 12px 14px;
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px;
  font-size: var(--text-15); line-height: 24px; resize: none; overflow-y: auto; scrollbar-width: thin;
}
.input-wrap textarea:focus-visible, #input:focus-visible { background: var(--surface); }
.input-hint { display: none; }
.send-btn {
  width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center;
  color: #fff; background: var(--green); border-radius: 12px; transition: background var(--dur-fast) ease;
}
.send-btn:hover:not(:disabled) { background: var(--green-deep); }
.send-btn svg { width: 20px; height: 20px; stroke-width: 2; }

/* ---------- Önizleme başlığı ve araçlar ---------- */
.preview-head {
  flex: 0 0 auto; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px; border-bottom: 1px solid var(--line);
}
.preview-head > div:first-child { min-width: 0; }
.preview-head strong {
  display: block; overflow: hidden; color: var(--ink); font-family: var(--font-display); font-size: var(--text-22); font-weight: 400; line-height: 1.15;
  text-overflow: ellipsis; white-space: nowrap;
}
.completion-mini { flex: 0 0 120px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.completion-mini span { color: var(--green-text); font-size: var(--text-13); font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.completion-mini i { width: 100%; height: 4px; display: block; overflow: hidden; background: var(--green-soft); border-radius: 999px; }
.completion-mini b { width: 0; height: 100%; display: block; background: var(--green); border-radius: inherit; }
.preview-tools {
  flex: 0 0 auto; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 4px 20px; border-bottom: 1px solid var(--line);
}
.preview-tools .compact-seg { flex: 0 0 auto; padding: 2px; }
.preview-tools .compact-seg .seg-btn { min-height: 30px; padding: 0 10px; }
.watermark-toggle {
  min-width: 0; min-height: 32px; display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-2); font-size: var(--text-13); font-weight: 500; line-height: 1.3; cursor: pointer;
}

/* ---------- Fotoğraf şeridi ---------- */
.thumbs {
  flex: 0 0 auto; display: flex; gap: 8px; padding: 12px 20px; overflow-x: auto; overflow-y: hidden;
  border-bottom: 1px solid var(--line); scrollbar-width: thin;
}
.thumbs:empty { display: none; }
.thumb {
  position: relative; flex: 0 0 96px; width: 96px; height: 72px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9); pointer-events: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .star {
  position: absolute; z-index: 1; top: 4px; left: 4px; width: 22px; height: 22px; display: grid; place-items: center;
  color: var(--amber); background: var(--amber-bg); border-radius: 6px;
}
.thumb .star svg { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.thumb-flag {
  position: absolute; z-index: 1; top: 4px; right: 4px; width: 20px; height: 20px; display: grid; place-items: center;
  color: var(--amber); background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 50%;
  font-size: var(--text-12); font-weight: 700; line-height: 1;
}
.thumb-actions { position: absolute; z-index: 1; left: 4px; right: 4px; bottom: 4px; display: flex; justify-content: center; gap: 2px; }
.thumb-actions button {
  width: 28px; height: 28px; display: grid; place-items: center; color: #fff;
  background: rgba(27, 42, 36, .78); border-radius: 6px; transition: background var(--dur-fast) ease;
}
.thumb-actions button:hover { background: rgba(27, 42, 36, .95); }
.thumb-actions button svg { width: 14px; height: 14px; stroke-width: 2; }

/* ---------- Önizleme gövdesi ---------- */
.preview-body {
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 20px 20px 28px;
  background: var(--surface); overscroll-behavior: contain; scrollbar-width: thin;
}
.preview-body > .empty { min-height: 100%; }
/* İlan pasaportu: amaç rozeti, serif başlık, kesik çizgiyle ayrılan fiyat ve konum. */
.property-hero {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 20px;
  background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius);
}
.property-hero-media {
  position: relative; align-self: stretch; margin: -20px -20px 6px; overflow: hidden; aspect-ratio: 16 / 10;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--green-soft);
}
.property-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.property-hero-media span {
  position: absolute; right: 10px; bottom: 10px; padding: 4px 9px; border-radius: 999px;
  color: #fff; background: rgba(19, 32, 26, .62); font-size: var(--text-12); font-weight: 600;
}
.property-hero.has-media { padding-top: 20px; }
.property-hero-top span {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px;
  color: var(--green-text); background: var(--green-soft); border-radius: 999px; font-size: var(--text-12); font-weight: 600; line-height: 1;
}
.property-hero h2 {
  color: var(--ink); font-family: var(--font-display); font-size: 26px; font-weight: 400; line-height: 1.15;
  letter-spacing: 0; overflow-wrap: anywhere; text-wrap: balance;
}
.property-hero-bottom {
  align-self: stretch; display: flex; flex-direction: column; gap: 2px; min-width: 0;
  margin-top: 2px; padding-top: 12px; border-top: 1px dashed var(--line-2);
}
.property-hero-bottom strong {
  color: var(--green-text); font-family: var(--font-display); font-size: 30px; font-weight: 400; line-height: 1.1;
  letter-spacing: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.property-hero-bottom small { color: var(--muted); font-size: var(--text-13); line-height: 1.5; overflow-wrap: anywhere; }
.missing-card {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 12px;
}
.missing-card strong { color: var(--amber); font-size: var(--text-14); font-weight: 600; line-height: 1.4; }
.missing-card small { color: var(--ink-2); font-size: var(--text-13); line-height: 1.5; }
.missing-card div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.missing-card div span {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px;
  color: var(--amber); background: var(--surface); border: 1px solid var(--amber-line); border-radius: 999px;
  font-size: var(--text-12); font-weight: 500; line-height: 1.2;
}
.missing-card .missing-advice { margin-top: 10px; color: var(--muted); }
/* Önerilen bilgiler yayını engellemez: uyarı rengi yerine sakin, nötr yüzey. */
.missing-card.is-advice { background: var(--green-tint); border-color: var(--line); }
.missing-card.is-advice strong { color: var(--green-text); }
.missing-card.is-advice div span { color: var(--ink-2); border-color: var(--line-2); }
.pv-section-title { margin: 24px 0 8px; color: var(--muted); font-size: var(--text-13); font-weight: 600; line-height: 1.4; }
.property-hero + .pv-section-title { margin-top: 0; }
.pv-desc { color: var(--ink-2); font-size: var(--text-14); line-height: 1.65; overflow-wrap: anywhere; }
.preview .row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.preview .row .k { flex: 0 0 auto; max-width: 45%; color: var(--muted); font-size: var(--text-13); line-height: 1.45; }
.preview .row .v { min-width: 0; color: var(--ink); font-size: var(--text-14); font-weight: 500; line-height: 1.45; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.preview .row:has(+ .chips) { border-bottom: 0; padding-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; font-size: var(--text-13); line-height: 1.2;
}

/* ---------- Önizleme işlemleri ---------- */
.preview-actions {
  flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 16px 20px; background: var(--surface); border-top: 1px solid var(--line);
}
.preview-actions .btn { min-height: 44px; min-width: 0; padding-inline: 12px; }
.result {
  flex: 0 0 auto; max-height: 30%; overflow-y: auto; padding: 12px 20px; color: var(--ink-2);
  border-top: 1px solid var(--line); font-size: var(--text-14); line-height: 1.55; overflow-wrap: anywhere;
}
.result:empty { display: none; }
.result a { color: var(--green-text); font-weight: 600; }

/* Masaüstünde "Mobil" önizleme: gövde telefon genişliğinde ortalanır; panel yerinde kalır. */
.preview.mobile-preview { background: var(--canvas); }
.preview.mobile-preview :is(.preview-head, .preview-tools, .thumbs) { background: var(--surface); }
.preview.mobile-preview #preview {
  width: min(390px, 100%); margin-inline: auto;
  border-inline: 1px solid var(--line);
}

/* ---------- Tablet: ≤900 px ---------- */
@media (max-width: 900px) {
  .studio-tabs { grid-column: 2; grid-row: 1; }
  .chat, .preview { grid-column: 2; grid-row: 2; }
  .preview { border-left: 0; }
  /* Tablette geniş menü yok; menü düğmesi yalnız masaüstünde anlamlı. */
  .nav-toggle { display: none; }
  .head-btn > span { display: none; }
  .head-btn { width: 40px; padding: 0; }
  .preview-tools .compact-seg { display: none; }
  .preview.mobile-preview { background: var(--surface); }
  .preview.mobile-preview #preview { width: auto; margin-inline: 0; border-inline: 0; }
}

/* ---------- Telefon: ≤760 px ---------- */
@media (max-width: 760px) {
  .studio-tabs { order: 1; flex: 0 0 48px; }
  .chat, .preview { order: 2; flex: 1 1 0; height: auto; min-height: 0; }
  /* Sol üstteki sabit 44 px menü düğmesi (left 12, top 60) başlığın içinde kalır; başlık metni 68 px'ten başlar. */
  .chat-head { height: 64px; padding: 0 12px 0 68px; }
  .preview-head { height: 64px; padding: 0 16px 0 68px; gap: 12px; }
  .head-btn { width: 44px; min-height: 44px; }
  .messages { padding: 16px 12px 20px; }
  .msg { max-width: 88%; font-size: var(--text-16); }
  .msg.sys { font-size: var(--text-13); }
  .choices { width: 100%; }
  .choice-chip, .choice-done { min-height: 44px; font-size: var(--text-15); }
  .edit-bar { padding: 8px 12px; }
  .edit-bar button { min-height: 40px; }
  .composer { gap: 6px; padding: 12px; }
  .composer-tools { gap: 0; }
  .input-wrap textarea, #input { font-size: var(--text-16); }
  .completion-mini { flex-basis: 96px; }
  .preview-tools { min-height: 40px; padding: 0 16px; }
  .watermark-toggle { min-height: 40px; }
  .thumbs { padding: 8px 16px; }
  .thumb { flex-basis: 104px; width: 104px; height: 76px; }
  .thumb-actions { left: 1px; right: 1px; bottom: 2px; }
  .thumb-actions button { width: 32px; height: 32px; }
  .preview-body { padding: 16px 16px 24px; }
  .property-hero { padding: 16px; }
  .property-hero h2 { font-size: 28px; }
  .preview-actions { gap: 8px; padding: 12px 16px; }
  .preview-actions .btn { min-height: 48px; }
  .result { padding: 12px 16px; }
}

/* ---------- Kısa ekran (yatay telefon/tablet) ---------- */
@media (max-width: 900px) and (max-height: 500px) {
  .chat-head, .preview-head { height: 48px; }
  .head-copy .sub { display: none; }
  .head-copy .title, .preview-head strong { font-size: var(--text-18); }
  .head-btn { min-height: 40px; }
  .messages { padding-block: 12px; }
  .composer { padding-block: 8px; }
  .preview-tools { min-height: 36px; }
  .preview-body { padding-block: 12px 16px; }
  .property-hero { gap: 6px; margin-bottom: 12px; padding: 12px 16px; }
  .property-hero h2 { font-size: var(--text-22); }
  .property-hero-bottom { padding-top: 8px; }
  .property-hero-bottom strong { font-size: 24px; }
  .preview-actions { padding-block: 8px; }
  .preview-actions .btn { min-height: 44px; }
}
@media (max-width: 760px) and (max-height: 500px) {
  .chat-head, .preview-head { height: 60px; }
}
