:root {
  --zemin: #f5f4ef; --kart: #fcfbf8; --cizgi: #e3e0d6; --yazi: #29261b; --soluk: #77736a;
  --vurgu: #c96442; --koyu: #2b2a26; --kenar: #efede6; --kod: #f0eee6; --wa: #1f9d55;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--zemin); color: var(--yazi); font: 15px/1.6 var(--sans); }
button { font: inherit; color: inherit; }

/* layout */
.uygulama { display: flex; height: 100dvh; overflow: hidden; }
#kenar { width: 292px; flex: none; background: var(--kenar); border-right: 1px solid var(--cizgi); display: flex; flex-direction: column; padding: 12px; gap: 10px; }
.kenar-ust { display: flex; flex-direction: column; gap: 10px; }
.logo { height: 30px; align-self: flex-start; margin: 4px 6px; }
.yeni-btn { border: 1px solid var(--cizgi); background: var(--kart); border-radius: 10px; padding: 9px 12px; text-align: left; cursor: pointer; font-weight: 600; }
.yeni-btn:hover { border-color: var(--vurgu); }
#ara { border: 1px solid var(--cizgi); border-radius: 10px; padding: 8px 11px; font: inherit; background: #fff; }
.filtre { display: flex; gap: 4px; }
.filtre button { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 5px 0; cursor: pointer; color: var(--soluk); font-size: 13px; }
.filtre button.aktif { background: var(--kart); color: var(--yazi); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
#liste { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.grup { font-size: 12px; color: var(--soluk); margin: 12px 8px 4px; font-weight: 600; }
.oge { display: block; width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.oge:hover { background: rgba(0,0,0,.04); }
.oge.secili { background: var(--kart); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.oge .b { display: flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.oge .b span:last-child { overflow: hidden; text-overflow: ellipsis; }
.oge .o { font-size: 12px; color: var(--soluk); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nokta { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #b9b4a7; }
.nokta.whatsapp { background: var(--wa); }
.nokta.calisiyor { background: var(--vurgu); animation: nabiz 1s infinite alternate; }
@keyframes nabiz { to { opacity: .3; } }
.kenar-alt { font-size: 13px; padding: 4px 8px; }
.kenar-alt a { color: var(--soluk); }

main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
header { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--cizgi); background: var(--zemin); }
#menu { display: none; border: 0; background: none; font-size: 20px; cursor: pointer; }
.baslik { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; }
#baslik { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rozet:empty { display: none; }
.rozet { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #e4f4ea; color: var(--wa); white-space: nowrap; }
#model { border: 1px solid var(--cizgi); background: var(--kart); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; }

#akis { flex: 1; overflow-y: auto; padding: 24px 18px 8px; }
#mesajlar { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.bos { max-width: 520px; margin: 12vh auto 0; text-align: center; color: var(--soluk); }
.bos img { height: 52px; opacity: .9; }
.bos h2 { font: 500 28px/1.3 var(--serif); color: var(--yazi); margin: 14px 0 6px; }
.uyari { text-align: center; font-size: 13px; color: var(--soluk); }

.m-user { align-self: flex-end; max-width: 85%; background: #ebe7dc; border-radius: 16px 16px 4px 16px; padding: 9px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.m-user .kim { font-size: 11px; color: var(--soluk); margin-bottom: 2px; white-space: normal; }
.m-user .kim.wa { color: var(--wa); font-weight: 600; }
.m-asst { overflow-wrap: anywhere; }
.m-asst > :first-child { margin-top: 0; } .m-asst > :last-child { margin-bottom: 0; }
.m-asst h1, .m-asst h2, .m-asst h3 { font-family: var(--serif); font-weight: 600; line-height: 1.3; margin: 18px 0 6px; }
.m-asst h1 { font-size: 22px; } .m-asst h2 { font-size: 19px; } .m-asst h3 { font-size: 16px; }
.m-asst p { margin: 8px 0; } .m-asst ul, .m-asst ol { margin: 6px 0; padding-left: 22px; }
.m-asst code { font: 13px var(--mono); background: var(--kod); padding: 1px 5px; border-radius: 5px; }
.m-asst pre { background: #2b2a26; color: #f1efe8; padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
.m-asst pre code { background: none; padding: 0; color: inherit; }
.m-asst table { border-collapse: collapse; margin: 10px 0; font-size: 14px; display: block; overflow-x: auto; }
.m-asst th, .m-asst td { border: 1px solid var(--cizgi); padding: 5px 9px; text-align: left; }
.m-asst th { background: var(--kenar); }
.m-asst a, .dosya a { color: var(--vurgu); }
.m-asst blockquote { border-left: 3px solid var(--cizgi); margin: 8px 0; padding-left: 12px; color: var(--soluk); }
.imlec::after { content: "▍"; color: var(--vurgu); animation: nabiz .6s infinite alternate; }

details.arac { border: 1px solid var(--cizgi); border-radius: 10px; background: var(--kart); font-size: 13px; }
details.arac summary { cursor: pointer; padding: 6px 11px; color: var(--soluk); list-style: none; display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; }
details.arac summary::-webkit-details-marker { display: none; }
details.arac summary b { color: var(--yazi); font-weight: 600; }
details.arac summary .oz { overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12px; }
details.arac.hata summary b { color: #b42318; }
details.arac pre { margin: 0; padding: 8px 11px; border-top: 1px solid var(--cizgi); font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow-y: auto; }
.arac-grup { display: flex; flex-direction: column; gap: 6px; }

.dosya { display: flex; flex-wrap: wrap; gap: 8px; }
.dosya a { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--cizgi); background: var(--kart); border-radius: 10px; padding: 7px 11px; text-decoration: none; font-size: 14px; }
.bilgi { font-size: 12px; color: var(--soluk); }
.m-hata { color: #b42318; background: #fdecea; border-radius: 10px; padding: 8px 12px; white-space: pre-wrap; font-size: 14px; }

footer { padding: 8px 18px calc(14px + env(safe-area-inset-bottom)); }
.yazi-kutu { max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 6px; background: #fff; border: 1px solid var(--cizgi); border-radius: 18px; padding: 8px; box-shadow: 0 2px 10px rgba(40, 30, 20, .05); }
.yazi-kutu:focus-within { border-color: #cfc8b8; }
#girdi { flex: 1; border: 0; resize: none; font: inherit; outline: none; max-height: 240px; padding: 6px 4px; background: transparent; }
#ekle { border: 0; background: none; cursor: pointer; font-size: 18px; padding: 4px 6px; opacity: .7; }
.gonder, .durdur { width: 36px; height: 36px; border: 0; border-radius: 10px; cursor: pointer; color: #fff; font-size: 17px; flex: none; }
.gonder { background: var(--vurgu); } .gonder:disabled { background: #ddd6c8; cursor: default; }
.durdur { background: var(--koyu); }
#ekler { max-width: 780px; margin: 0 auto 6px; display: flex; flex-wrap: wrap; gap: 6px; }
#ekler:empty { display: none; }
.ek { font-size: 13px; background: var(--kart); border: 1px solid var(--cizgi); border-radius: 8px; padding: 3px 8px; }
.ek button { border: 0; background: none; cursor: pointer; color: var(--soluk); }
.not { max-width: 780px; margin: 6px auto 0; font-size: 12px; color: var(--soluk); text-align: center; min-height: 16px; }

@media (max-width: 760px) {
  #kenar { position: fixed; inset: 0 auto 0 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 24px rgba(0,0,0,.12); }
  body.menu-acik #kenar { transform: none; }
  body.menu-acik #perde { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 10; }
  #menu { display: block; }
  header { padding: 8px 12px; }
  #akis { padding: 16px 12px 8px; }
  footer { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); }
  .m-user { max-width: 92%; }
}
