/* ============================================================
   Kişisel Notlar — iPhone Notlar tarzı iki panelli not defteri.
   Sol: arama + not listesi (önizlemeli) · Sağ: editör (başlık + gövde).
   Hafif: salt CSS, kütüphane yok.
   ============================================================ */
.kn2-wrap {
  display: flex; height: calc(100vh - 168px); min-height: 460px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-sm);
}

/* — Sol: liste paneli — */
.kn2-list-pane { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface-alt); }
.kn2-list-head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3); border-bottom: 1px solid var(--border); }
.kn2-search-box { flex: 1; margin: 0; }
.kn2-search-box input { padding: 9px 12px 9px 36px; border-radius: var(--radius); font-size: var(--fs-sm); }
.kn2-new { flex-shrink: 0; width: 38px; height: 38px; border: 0; border-radius: var(--radius); background: var(--brand); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.kn2-new:hover { background: var(--brand-deep, var(--brand)); filter: brightness(.95); }
.kn2-new svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.kn2-list { flex: 1; overflow: auto; }
.kn2-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.kn2-item:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.kn2-item.is-active { background: color-mix(in srgb, var(--brand) 11%, transparent); box-shadow: inset 3px 0 0 var(--brand); }
.kn2-item-title { font-weight: 700; color: var(--navy); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kn2-item-row { display: flex; gap: 6px; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); min-width: 0; }
.kn2-item-time { flex-shrink: 0; }
.kn2-item-snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.kn2-list-empty { padding: var(--space-6) var(--space-3); text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }
.kn2-list-foot { padding: 8px 14px; border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-faint); text-align: center; }

/* — Sağ: editör — */
.kn2-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.kn2-editor { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.kn2-ed-bar { display: flex; align-items: center; gap: var(--space-3); padding: 10px 18px; border-bottom: 1px solid var(--border); }
.kn2-ed-date { flex: 1; font-size: var(--fs-xs); color: var(--text-muted); text-align: center; }
.kn2-back { display: none; border: 0; background: transparent; cursor: pointer; color: var(--brand); padding: 4px; }
.kn2-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.kn2-del { border: 0; background: transparent; cursor: pointer; color: var(--text-muted); padding: 6px; border-radius: var(--radius-sm); display: inline-flex; }
.kn2-del:hover { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.kn2-del svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.kn2-title { border: 0; outline: none; background: transparent; width: 100%; box-sizing: border-box;
  padding: 20px 28px 6px; font-size: 24px; font-weight: 800; color: var(--navy); }
.kn2-title::placeholder { color: var(--text-faint); font-weight: 700; }
.kn2-body { flex: 1; min-height: 0; border: 0; outline: none; resize: none; background: transparent;
  width: 100%; box-sizing: border-box; padding: 6px 28px 18px; font: inherit; font-size: 15px;
  line-height: 1.75; color: var(--text); }
.kn2-body::placeholder { color: var(--text-faint); }
.kn2-ed-foot { padding: 8px 28px; border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-faint); }

/* Not seçilmemiş */
.kn2-noselect { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); text-align: center; color: var(--text-muted); padding: var(--space-6); }
.kn2-noselect-ico { width: 56px; height: 56px; fill: none; stroke: var(--border); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.kn2-link { border: 0; background: transparent; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.kn2-link:hover { text-decoration: underline; }

/* — Liste öğesi: başlık satırı + renk noktası + pin — */
.kn2-item-head { display: flex; align-items: center; gap: 6px; }
.kn2-item-title { flex: 1; min-width: 0; }
.kn2-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.kn2-pin-ic { flex: none; width: 14px; height: 14px; fill: color-mix(in srgb, var(--brand) 28%, transparent); stroke: var(--brand); stroke-width: 1.6; stroke-linejoin: round; }
.kn2-item[style*="--kn-accent"] { box-shadow: inset 3px 0 0 var(--kn-accent); }
.kn2-item.is-active { box-shadow: inset 3px 0 0 var(--brand); }  /* aktif → marka (renkliyi ezer) */

/* — Editör: pin + renk paleti — */
.kn2-pin { border: 0; background: transparent; cursor: pointer; color: var(--text-muted); padding: 6px; border-radius: var(--radius-sm); display: inline-flex; }
.kn2-pin svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kn2-pin:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }
.kn2-pin.is-on { color: var(--brand); }
.kn2-pin.is-on svg { fill: color-mix(in srgb, var(--brand) 22%, transparent); }
.kn2-colors { display: inline-flex; gap: 5px; align-items: center; }
.kn2-sw { width: 18px; height: 18px; border-radius: 50%; border: 0; cursor: pointer; background: var(--sw); padding: 0; }
.kn2-sw.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.kn2-sw--none { background: var(--surface); border: 1.5px solid var(--border); position: relative; }
.kn2-sw--none::after { content: ""; position: absolute; inset: 0; margin: auto; width: 1.5px; height: 13px; background: var(--red); transform: rotate(45deg); }
.kn2-sw--none.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text-muted); }

/* — Biçim araç çubuğu — */
.kn2-toolbar { display: flex; gap: 4px; padding: 6px 22px; border-bottom: 1px solid var(--border); }
.kn2-toolbar button { width: 32px; height: 30px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.kn2-toolbar button:hover { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, transparent); }
.kn2-toolbar button b { font-size: 15px; font-weight: 800; }
.kn2-toolbar button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* — Zengin gövde (contenteditable) — */
.kn2-body { overflow: auto; }
.kn2-body:focus { outline: none; }
.kn2-body:empty::before { content: attr(data-ph); color: var(--text-faint); pointer-events: none; }
.kn2-body h3 { font-size: 17px; font-weight: 800; color: var(--navy); margin: 10px 0 4px; }
.kn2-body ul, .kn2-body ol { padding-left: 22px; margin: 4px 0; }
.kn2-body li { margin: 2px 0; }

/* — Kontrol listesi — */
.kn2-chk { display: flex; align-items: flex-start; gap: 9px; margin: 3px 0; }
.kn2-chk-box { flex: none; width: 19px; height: 19px; margin-top: 2px; border: 2px solid var(--border-strong, #b9b9c4); border-radius: 5px; cursor: pointer; position: relative; }
.kn2-chk[data-done="1"] .kn2-chk-box { background: var(--brand); border-color: var(--brand); }
.kn2-chk[data-done="1"] .kn2-chk-box::after { content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.kn2-chk[data-done="1"] { color: var(--text-muted); text-decoration: line-through; }

/* — Mobil: tek panel (liste ↔ editör) — */
@media (max-width: 720px) {
  .kn2-wrap { height: calc(100vh - 150px); }
  .kn2-list-pane { width: 100%; border-right: 0; }
  .kn2-main { display: none; }
  .kn2-wrap.kn2-show-editor .kn2-list-pane { display: none; }
  .kn2-wrap.kn2-show-editor .kn2-main { display: flex; }
  .kn2-back { display: inline-flex; }
}
