* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #eceef1; color: #1a1a1a;
  display: flex; flex-direction: column;
}

header {
  background: #1f2937; color: #fff; padding: 12px 18px;
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
header h1 { font-size: 17px; font-weight: 600; }
.dosya-adi { font-size: 13px; color: #9ca3af; }

.toolbar {
  background: #fff; border-bottom: 1px solid #dfe2e6;
  padding: 8px 12px; display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; position: sticky; top: 0; z-index: 5;
}
.grup { display: flex; gap: 6px; align-items: center; }
.ayrac { width: 1px; align-self: stretch; background: #e2e5e9; margin: 2px 4px; }

.btn {
  padding: 7px 12px; border: 1px solid #d3d6da; background: #fafbfc;
  border-radius: 6px; cursor: pointer; font-size: 13px; color: #1a1a1a;
  line-height: 1; min-height: 36px; display: inline-flex;
  align-items: center; justify-content: center;
}
.btn:hover { background: #f0f1f3; }
.btn:active { background: #e6e7ea; }
.btn.ikon { min-width: 38px; font-size: 15px; }
.btn.birincil { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.birincil:hover { background: #1d4ed8; }
.btn.aktif { background: #dbeafe; border-color: #93c5fd; }
.dosya-btn { position: relative; }

.renkler { gap: 8px; }
.renk {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #c5c8cc;
  cursor: pointer; padding: 0;
}
.renk.ozel {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: #555; font-weight: 700; position: relative;
}
.renk.ozel input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.mesaj {
  margin: 10px 16px 0; padding: 10px 14px; border-radius: 6px;
  font-size: 13px;
}
.mesaj.gizli { display: none; }
.mesaj.hata { background: #fde8e8; color: #9b1c1c; border: 1px solid #f5c2c2; }
.mesaj.bilgi { background: #e1effe; color: #1e429f; border: 1px solid #b9d6f5; }

main { flex: 1; padding: 20px 16px 60px; overflow: auto; }
#editor {
  background: #fff; max-width: 820px; margin: 0 auto;
  min-height: 65vh; padding: 48px 56px;
  border: 1px solid #dfe2e6; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  outline: none; line-height: 1.55; font-size: 15px;
  font-family: "Times New Roman", Georgia, serif;
}
#editor .par { min-height: 1.55em; }
#editor:empty::before { content: "Belge boş"; color: #9ca3af; }

@media (max-width: 640px) {
  #editor { padding: 24px 18px; font-size: 15px; }
  .btn { padding: 8px 10px; font-size: 13px; }
  header h1 { font-size: 16px; }
}
