/* almakistiyorum — Chat-first tasarım konsepti
   Tokenlar şartnameden (§5.1): beyaz zemin, ölçülü vurgu, ferah boşluk. */
:root{
  --bg:#FFFFFF;
  --surface:#F7F7F8;
  --hover:#EFEFF1;
  --text:#171717;
  --text-2:#6B7280;
  --text-3:#9CA3AF;
  --border:#E5E7EB;
  --border-strong:#D7D8DC;
  --accent:#171717;        /* nötr siyah — yeni logoyla tam uyum, en sakin */
  --primary:#171717;       /* eski bileşenlerin (çerez barı vb.) okuduğu değişken; mor yerine nötr */
  --accent-weak:#F0F0F1;
  --accent-text:#171717;
  --accent-hover:#000000;
  --ok:#059669;
  --sb-w:272px;
  --maxw:820px;
  --r-card:16px;
  --r-input:26px;
  --sp-1:4px;--sp-2:8px;--sp-3:12px;--sp-4:16px;--sp-5:24px;--sp-6:32px;--sp-7:48px;
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:var(--font);font-size:16px;line-height:1.6;color:var(--text);
  background:var(--bg);-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
button{font:inherit;cursor:pointer;border:none;background:none;color:inherit}
svg{display:block}
::selection{background:var(--accent-weak)}

/* ---------- app shell ---------- */
/* --vvh: visualViewport yüksekliği (klavye açıkken JS günceller); yoksa 100dvh */
.app{display:grid;grid-template-columns:var(--sb-w) 1fr;height:100vh;height:100dvh;height:var(--vvh,100dvh)}

/* ---------- sidebar ---------- */
.sb{background:var(--surface);border-right:1px solid var(--border);
  display:flex;flex-direction:column;padding:var(--sp-3);gap:var(--sp-2);overflow:hidden}
.sb__logo{display:flex;align-items:center;height:48px;padding:0 var(--sp-2);margin-bottom:var(--sp-2)}
.sb__logo img{height:30px;width:auto}
.new{display:flex;align-items:center;gap:10px;width:100%;height:44px;padding:0 14px;
  border:1px solid var(--border-strong);border-radius:12px;background:var(--bg);
  font-size:14.5px;font-weight:600;color:var(--text);transition:background .15s}
.new:hover{background:var(--hover)}
.nav{display:flex;flex-direction:column;gap:2px;margin-top:var(--sp-3)}
.nav a{display:flex;align-items:center;gap:11px;height:40px;padding:0 12px;border-radius:10px;
  font-size:14.5px;color:var(--text);transition:background .15s}
.nav a:hover{background:var(--hover)}
.nav a.active{background:#E8E8EB;color:var(--text);font-weight:600}
.nav a svg{width:18px;height:18px;flex:0 0 auto;stroke:currentColor}
.nav__label{font-size:11.5px;font-weight:600;letter-spacing:.04em;color:var(--text-3);
  text-transform:uppercase;padding:14px 12px 6px}
.recents{display:flex;flex-direction:column;gap:1px;overflow-y:auto;flex:1;min-height:0}
.recents a{display:block;height:36px;line-height:36px;padding:0 12px;border-radius:8px;
  font-size:14px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.recents a:hover{background:var(--hover);color:var(--text)}
.sb__foot{border-top:1px solid var(--border);padding-top:var(--sp-2);margin-top:auto}
.me{display:flex;align-items:center;gap:10px;height:48px;padding:0 10px;border-radius:10px}
.me:hover{background:var(--hover)}
.ava{width:30px;height:30px;border-radius:50%;background:var(--accent);color:#fff;
  display:grid;place-items:center;font-size:12.5px;font-weight:700;flex:0 0 auto}
.me__t{font-size:14px;font-weight:600;line-height:1.2}
.me__s{font-size:12px;color:var(--text-2)}

/* ---------- main ---------- */
.main{display:flex;flex-direction:column;min-width:0;background:var(--bg)}
.topbar{height:56px;display:flex;align-items:center;gap:12px;padding:0 var(--sp-5);
  border-bottom:1px solid transparent}
.topbar .burger{display:none}
.topbar__brand{display:none;align-items:center;gap:8px}           /* mobilde görünür: marka→ana sayfa */
.topbar__brand img{height:24px;width:auto}
.topbar__new{display:none}                                        /* mobilde görünür: hızlı Yeni arama */
.topbar__sp{flex:1}
.btn{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 18px;border-radius:999px;
  font-size:14px;font-weight:600;transition:background .15s,box-shadow .15s}
.btn-ghost{color:var(--text)}
.btn-ghost:hover{background:var(--hover)}
.btn-accent{background:var(--accent);color:#fff}
.btn-accent:hover{background:var(--accent-hover)}

.scroll{flex:1;overflow-y:auto;min-height:0}
.center{max-width:var(--maxw);margin:0 auto;padding:0 var(--sp-5)}

/* ---------- empty / greeting ---------- */
.greet{min-height:calc(100vh - 56px - 120px);min-height:calc(100dvh - 176px);
  display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:var(--sp-4)}
.greet h1{font-size:clamp(26px,3.2vw,34px);font-weight:600;letter-spacing:-.02em}
.greet p{color:var(--text-2);font-size:16.5px;max-width:48ch;margin-top:-6px}
.suggest{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:var(--sp-2);max-width:620px}
.sg{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 16px;border:1px solid var(--border);
  border-radius:999px;font-size:14px;color:var(--text);background:var(--bg);transition:.15s}
.sg:hover{background:var(--hover);border-color:var(--border-strong)}
.sg svg{width:16px;height:16px;stroke:var(--text-2)}

/* ---------- composer ---------- */
.composer{padding:16px var(--sp-5) 22px}
.composer .wrap{max-width:var(--maxw);margin:0 auto}
.inputbar{display:flex;align-items:flex-end;gap:10px;background:var(--bg);border:1px solid var(--border-strong);
  border-radius:var(--r-input);padding:8px 8px 8px 8px;box-shadow:0 2px 10px rgba(16,17,20,.05);
  transition:border-color .15s,box-shadow .15s}
.inputbar:focus-within{border-color:#B9BABD;box-shadow:0 2px 14px rgba(16,17,20,.10)}
.iconbtn{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;
  color:var(--text-2);transition:background .15s}
.iconbtn:hover{background:var(--hover);color:var(--text)}
.inputbar textarea{flex:1;border:none;outline:none;resize:none;background:none;
  font-family:var(--font);font-size:16px;letter-spacing:normal;
  line-height:1.5;color:var(--text);padding:9px 2px;max-height:160px;min-height:24px}
.inputbar textarea::placeholder{color:var(--text-3)}
.send{width:40px;height:40px;border-radius:50%;background:var(--accent);color:#fff;
  display:grid;place-items:center;flex:0 0 auto;transition:background .15s}
.send:hover{background:var(--accent-hover)}
.hint{text-align:center;color:var(--text-3);font-size:12px;margin-top:10px}

/* ---------- conversation ---------- */
.thread{padding:28px 0 8px;display:flex;flex-direction:column;gap:26px}
.turn{display:flex;gap:14px}
.turn.user{justify-content:flex-end}
.bubble{background:var(--surface);border:1px solid var(--border);border-radius:16px;
  padding:12px 16px;font-size:15.5px;max-width:78%}
.sys{display:flex;gap:13px;align-items:flex-start}
.sys__ava{width:30px;height:30px;border-radius:8px;background:var(--text);flex:0 0 auto;
  display:grid;place-items:center;margin-top:2px}
.sys__ava svg{width:17px;height:17px;stroke:#fff}
.sys__body{flex:1;min-width:0}
.sys__lead{font-size:15.5px;margin-bottom:12px}
.crit{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:6px}
.ctag{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 8px 0 13px;
  background:var(--surface);border:1px solid var(--border);border-radius:999px;font-size:13.5px;color:var(--text)}
.ctag b{font-weight:600}
.ctag .k{color:var(--text-2);font-weight:500}
/* × görünür küçük, DOKUNMA ALANI ≥44px (::after ile genişletilir) — mobil erişilebilirlik §3 */
.ctag .x{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;color:var(--text-3);
  position:relative;background:none;cursor:pointer;flex:0 0 auto}
.ctag .x::after{content:"";position:absolute;inset:-10px;border-radius:50%}
.ctag .x:hover{background:var(--hover);color:var(--text)}
.ctag.add{border-style:dashed;color:var(--text-2)}
/* Yön (sonuç türü) çipi: × YOK; "değiştir" düğmesi — yanıltıcı kaldırma olmaz §3 */
.ctag.dir{padding-right:6px}
.ctag .swap{display:inline-flex;align-items:center;gap:4px;height:26px;padding:0 9px;margin-left:2px;border-radius:999px;
  border:1px solid var(--border-strong);background:var(--bg);font-size:12px;font-weight:600;color:var(--text);cursor:pointer}
.ctag .swap:hover{background:var(--hover)}
.ctag .swap svg{width:12px;height:12px;stroke:currentColor}
.dirmenu{flex-basis:100%;width:100%;display:flex;flex-wrap:wrap;gap:8px;margin:2px 0 4px;order:99}
.dirmenu button{height:34px;padding:0 14px;border-radius:999px;border:1px solid var(--border-strong);
  background:var(--bg);font-size:13px;font-weight:600;color:var(--text);cursor:pointer}
.dirmenu button:hover{background:var(--hover)}
.dirmenu button.sel{background:var(--accent);color:#fff;border-color:var(--accent)}
.resline{display:flex;align-items:center;gap:8px;margin:16px 0 12px;font-size:14px;color:var(--text-2);flex-wrap:wrap}
.resline b{color:var(--text);font-weight:600}
.resline--warn{color:#92400E}
.resline--warn b{color:#92400E}
.resline--info{color:var(--text-2)}
.u-hidden{display:none !important}
/* Salt-okunur (eski tur) çipleri */
.crit.readonly .ctag{opacity:.72}
.crit.readonly .ctag .x,
.crit.readonly .ctag .swap{display:none}   /* geçmiş turda çalışmayan kaldırma/değiştir gösterme §3 */
.crit.readonly .dirmenu{display:none}
/* Daha fazla / yeni sonuç kontrolleri */
.btn-more{height:40px;padding:0 20px;border-radius:999px;border:1px solid var(--border-strong);
  background:var(--bg);font-size:14px;font-weight:600;color:var(--text);margin:14px auto 2px;display:block;transition:background .15s}
.btn-more:hover{background:var(--hover)}
.jump-new{position:fixed;left:50%;transform:translateX(-50%);bottom:104px;z-index:30;
  height:38px;padding:0 16px;border-radius:999px;background:var(--accent);color:#fff;font-size:13.5px;font-weight:600;
  box-shadow:0 4px 16px rgba(16,17,20,.2);display:none;align-items:center;gap:7px}
.jump-new.show{display:inline-flex}
.softnote{font-size:12.5px;color:var(--text-3);margin:2px 0 8px}
.emptybox{border:1px dashed var(--border-strong);border-radius:var(--r-card);padding:18px;margin-top:6px;background:var(--surface)}
.emptybox p{font-size:14.5px;color:var(--text-2);margin-bottom:12px}
.btn-retry{height:38px;padding:0 16px;border-radius:999px;border:1px solid var(--border-strong);
  background:var(--bg);font-size:13.5px;font-weight:600;color:var(--text);margin-top:4px;transition:background .15s}
.btn-retry:hover{background:var(--hover)}

/* ---------- listing cards — LİSTE formatı (tek sütun, yatay satır) ---------- */
.cards{display:flex;flex-direction:column;gap:10px}
.lc{display:grid;grid-template-columns:108px 1fr;gap:14px;align-items:stretch;
  border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg);padding:10px;
  transition:border-color .15s,box-shadow .15s}
.lc:hover{border-color:var(--border-strong);box-shadow:0 4px 16px rgba(16,17,20,.06)}
.lc__img{width:108px;height:84px;border-radius:10px;overflow:hidden;background:var(--surface);
  display:grid;place-items:center;position:relative;flex:0 0 auto}
.lc__img svg{width:30px;height:30px;stroke:var(--text-3)}
.lc__fav{position:absolute;top:6px;right:6px;width:28px;height:28px;border-radius:50%;
  background:rgba(255,255,255,.92);display:grid;place-items:center;box-shadow:0 1px 4px rgba(0,0,0,.1)}
.lc__fav svg{width:15px;height:15px;stroke:var(--text-2);fill:none}
.lc__b{display:flex;flex-direction:column;min-width:0;padding:2px 6px 2px 0}
.lc__type{font-size:10.5px;font-weight:600;letter-spacing:.03em;color:var(--accent-text);
  background:var(--accent-weak);display:inline-block;padding:2px 7px;border-radius:6px;margin-bottom:5px;align-self:flex-start}
.lc__t{font-size:14.5px;font-weight:600;letter-spacing:-.01em;line-height:1.3;
  overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.lc__meta{display:flex;flex-wrap:wrap;gap:4px 10px;margin-top:4px;color:var(--text-2);font-size:12.5px}
.lc__meta span{display:inline-flex;align-items:center;gap:5px}
.lc__foot{display:flex;align-items:center;justify-content:space-between;gap:4px 12px;margin-top:auto;padding-top:8px;flex-wrap:wrap}
.lc__price{font-size:15.5px;font-weight:700;white-space:nowrap}
.lc__link{font-size:13px;font-weight:600;color:var(--accent-text);white-space:nowrap}
.lc__date{font-size:12px;color:var(--text-3)}

/* ---------- mobile ---------- */
.drawer-scrim{display:none}
@media(max-width:860px){
  .app{grid-template-columns:1fr}
  .sb{position:fixed;left:0;top:0;bottom:0;width:min(84vw,300px);z-index:40;transform:translateX(-100%);
    transition:transform .22s ease;border-right:1px solid var(--border)}
  .sb.open{transform:none;box-shadow:0 10px 40px rgba(0,0,0,.18)}
  .drawer-scrim.show{display:block;position:fixed;inset:0;background:rgba(10,10,15,.32);z-index:35}
  .topbar{padding:0 10px;border-bottom:1px solid var(--border);gap:6px}
  .topbar .burger{display:grid;place-items:center;width:44px;height:44px;border-radius:10px;color:var(--text)}
  .topbar .burger:hover{background:var(--hover)}
  .topbar__brand{display:inline-flex}                                   /* marka→ana sayfa (temiz başlangıç) */
  .topbar__new{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:10px;color:var(--text)}
  .topbar__new:hover{background:var(--hover)}
  .topbar__new svg{width:22px;height:22px;stroke:currentColor}
  .topbar .btn{height:36px;padding:0 12px;font-size:13px}
  .center,.composer .wrap{padding-left:var(--sp-4);padding-right:var(--sp-4)}
  .lc{grid-template-columns:88px 1fr;gap:11px}
  .lc__img{width:88px;height:70px}
  .bubble{max-width:88%}
  /* Klavye açıkken composer erişilebilir kalsın; --vvh JS ile ayarlanır, safe-area eklenir */
  .composer{padding:10px var(--sp-4) calc(10px + env(safe-area-inset-bottom))}
  .thread{padding-top:18px}
  .ctag{height:38px}                 /* daha büyük dokunma hedefi */
  .dirmenu button{height:40px}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}

/* ===================== Sohbet-içi oluşturma taslağı + composer foto (§6/§7) ===================== */
.composer .wrap{display:flex;flex-direction:column}
.cphotos{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 8px}
.cphotos:empty{display:none}
.cph{position:relative;width:56px;height:56px;border-radius:10px;overflow:hidden;border:1px solid var(--border)}
.cph img{width:100%;height:100%;object-fit:cover;display:block}
.cph__x{position:absolute;top:2px;right:2px;width:20px;height:20px;border-radius:50%;border:none;background:rgba(0,0,0,.6);color:#fff;font-size:14px;line-height:1;cursor:pointer;display:grid;place-items:center}
.cphotos__err{flex-basis:100%;font-size:12.5px;color:var(--error)}
.pbtn{flex:0 0 auto;width:40px;height:40px;border-radius:10px;border:none;background:none;color:var(--text-2);cursor:pointer;display:grid;place-items:center}
.pbtn:hover{background:var(--hover);color:var(--text)}
.pbtn svg{width:20px;height:20px;stroke:currentColor}

.draftcard{border:1px solid var(--border-strong);border-radius:14px;padding:14px 16px;margin-top:10px;background:var(--surface)}
.dft__h{font-weight:600;font-size:15px;margin-bottom:10px}
.dft__row{display:flex;gap:10px;padding:5px 0;border-bottom:1px dashed var(--border);font-size:14px}
.dft__row:last-of-type{border-bottom:none}
.dft__k{flex:0 0 96px;color:var(--text-2)}
.dft__v{flex:1;color:var(--text);min-width:0;word-break:break-word}
.dft__acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.dft__btn{height:40px;padding:0 16px;border-radius:10px;border:1px solid var(--border-strong);background:var(--bg);font-size:14px;font-weight:600;color:var(--text);cursor:pointer;display:inline-flex;align-items:center;text-decoration:none}
.dft__btn:hover{background:var(--hover)}
.dft__pub{background:var(--accent);color:#fff;border-color:var(--accent)}
.dft__note{margin-top:10px;font-size:13.5px;color:var(--text-2)}
.dft__cancelled{font-size:13.5px;color:var(--text-3)}
.dft__pick{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.dft__chip{height:40px;padding:0 15px;border-radius:999px;border:1px solid var(--border-strong);background:var(--bg);font-size:14px;font-weight:600;color:var(--text);cursor:pointer}
.dft__chip:hover{background:var(--hover)}
@media (max-width:480px){ .dft__btn,.dft__chip{min-height:44px} .pbtn{width:44px;height:44px} }
