:root {
  --app-font: 'Inter', system-ui, sans-serif;
  --app-size: 14px;
  --note-font: 'Inter', system-ui, sans-serif;
  --note-size: 15px;

  --text: #202124;
  --text-2: #5f6368;
  --border: #dadce0;
  --hover: #f1f3f4;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --primary: #1a73e8;
  --primary-soft: #e8f0fe;
  --bg: #ffffff;
  --divider: #e8eaed;
  --text-3: #9aa0a6;
  --toolbar: #edf2fa;
  --box-border: #e0e0e0;
  --primary-strong: #174ea6;
  --tb-on: #d3e3fd;
  --tb-on-text: #041e49;
  --danger: #d93025;
  --shadow: 0 1px 2px rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--app-font);
  font-size: var(--app-size);
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  user-select: none;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

/* ---------- Üst çubuk ---------- */
.topbar {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 8px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.3em; color: var(--text-2); }
.brand-icon { color: var(--primary); font-size: 26px; }

.icon-btn {
  width: 40px; height: 40px;
  border: none; background: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.icon-btn:hover { background: var(--hover); }

/* ---------- Yerleşim ---------- */
.layout { flex: 1; display: flex; min-height: 0; }
.pane {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  min-height: 0;
}
.sections-pane { width: 220px; background: var(--surface-2); }
.pages-pane { width: 260px; }
.pane-head {
  padding: 16px 16px 8px;
  font-size: .8em; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 1; }
.list li {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 2px 0;
  border-radius: 8px;
  cursor: pointer;
}
.list li:hover { background: var(--hover); }
.list li.active { background: var(--primary-soft); color: var(--primary-strong); }
.sections-pane .list li { border-radius: 0 20px 20px 0; margin-left: -8px; padding-left: 18px; }
.sec-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.item-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { display: block; font-size: .82em; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-item { flex-direction: column; align-items: stretch !important; gap: 0 !important; }
.page-item .item-name { font-weight: 500; }
.item-actions { display: none; gap: 2px; }
.list li:hover .item-actions { display: flex; }
.page-item .item-actions { position: absolute; right: 6px; top: 6px; }
.mini-btn {
  width: 26px; height: 26px; border: none; border-radius: 50%; background: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-2);
}
.mini-btn:hover { background: rgba(60,64,67,.12); }
.mini-btn .material-symbols-outlined { font-size: 17px; }
.rename-input {
  flex: 1; min-width: 0; border: 1px solid var(--primary); border-radius: 4px;
  padding: 2px 6px; outline: none; background: var(--surface);
}

.add-btn {
  margin: 8px; padding: 8px 14px;
  border: none; background: none; border-radius: 20px;
  display: flex; align-items: center; gap: 8px;
  color: var(--primary); font-weight: 500;
}
.add-btn:hover { background: var(--primary-soft); }

/* ---------- Not alanı ---------- */
.note-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.toolbar {
  flex: none;
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
  margin: 8px 16px 0;
  padding: 4px 8px;
  background: var(--toolbar);
  border-radius: 24px;
}
.tb-btn {
  position: relative;
  height: 32px; min-width: 32px; padding: 0 4px;
  border: none; background: none; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center; flex-direction: column;
  color: var(--text-2);
}
.tb-btn:hover { background: rgba(68,71,70,.1); }
.tb-btn.on { background: var(--tb-on); color: var(--tb-on-text); }
.tb-sep { width: 1px; height: 20px; background: #c7c7c7; margin: 0 6px; }
.tb-color { position: relative; }
.color-bar { display: block; width: 18px; height: 3px; border-radius: 1px; margin-top: -1px; }

.menu {
  position: absolute; top: 36px; left: 0; z-index: 50;
  background: var(--surface); border-radius: 8px; box-shadow: var(--shadow);
  padding: 10px; display: none;
}
.menu.open { display: block; }
.color-menu { width: 222px; }
.color-grid { display: grid; grid-template-columns: repeat(8, 22px); gap: 4px; }
.swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.1); cursor: pointer; padding: 0;
}
.swatch:hover { transform: scale(1.15); }
.menu-reset {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: none; padding: 6px 4px; margin-bottom: 6px; border-radius: 4px;
}
.menu-reset:hover { background: var(--hover); }

.page-head { padding: 18px 48px 4px; flex: none; }
.page-title {
  width: calc(100% - 48px); border: none; outline: none; padding: 0;
  font-family: var(--note-font);
  font-size: calc(2em - 2.67px); font-weight: 700;
  border-bottom: 1px solid transparent;
}
.page-title:focus { border-bottom-color: var(--border); }
.page-meta { color: var(--text-2); font-size: .85em; margin-top: 6px; }

.canvas-wrap { flex: 1; overflow: auto; position: relative; }
.sizer { position: relative; }
.canvas {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  cursor: text;
}
/* Tag sayfası: kartlar alt alta */
.canvas.flow { cursor: default; padding: 16px 48px 80px; }
.canvas.flow .tag-card { max-width: 760px; margin-bottom: 18px; }
.canvas.flow .box { position: relative; left: auto !important; top: auto !important; width: auto !important; border-color: var(--box-border); background: var(--surface); }
.canvas.flow .box-handle, .canvas.flow .box-resize { display: none; }
.canvas.flow .box .box-footer { display: flex; }
.canvas.flow .box:not(:focus-within) .box-footer { border-top-color: var(--hover); }
.tag-source {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; background: none; padding: 2px 4px; margin: 0 0 4px -4px; border-radius: 4px;
  font-size: 12px; color: var(--text-2); font-family: var(--app-font);
}
.tag-source:hover { background: var(--hover); color: var(--primary); }
.tag-source .material-symbols-outlined { font-size: 15px; }
.box.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px #aecbfa; } 100% { box-shadow: none; } }

/* Zoom */
.note-pane { position: relative; }
.zoom-ctrl {
  position: absolute; right: 16px; bottom: 16px; z-index: 20;
  display: flex; align-items: center; gap: 2px;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 3px;
}
.zoom-label {
  border: none; background: none; min-width: 48px; padding: 4px 6px; border-radius: 12px;
  font-size: 12px; color: var(--text-2);
}
.zoom-label:hover { background: var(--hover); }

/* Bölümler paneli kapalı */
.sections-pane { transition: width .15s ease; }
.sections-pane.collapsed { width: 56px; }
.sections-pane.collapsed .pane-head,
.sections-pane.collapsed .item-name,
.sections-pane.collapsed .item-actions,
.sections-pane.collapsed .add-label { display: none !important; }
.sections-pane.collapsed .list { padding: 8px 6px 0; }
.sections-pane.collapsed .list li { margin-left: 0; padding: 10px 0; justify-content: center; border-radius: 50%; width: 44px; height: 40px; }
.sections-pane.collapsed .sec-dot { width: 14px; height: 14px; }
.sections-pane.collapsed .add-btn { justify-content: center; padding: 8px 0; }
.sections-pane.collapsed .list-sep span { display: none; }

/* TAGS bölümü */
.list-sep { margin: 12px 8px 4px; border-top: 1px solid var(--border); }
.list-sep span { display: block; padding-top: 10px; font-size: .8em; font-weight: 500; letter-spacing: .06em; color: var(--text-2); }
.tags-item .material-symbols-outlined.sec-icon { font-size: 18px; color: var(--text-2); }
.tags-item.active .material-symbols-outlined.sec-icon { color: var(--primary-strong); }
.tag-count { font-size: .8em; color: var(--text-2); }
.empty-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-3); pointer-events: none;
}
.empty-state .material-symbols-outlined { font-size: 48px; }
.empty-state.hidden { display: none; }

/* ---------- Not kutusu ---------- */
.box {
  position: absolute;
  min-width: 160px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: auto;
  background: transparent;
}
.box:hover { border-color: var(--box-border); }
.box:focus-within, .box.selected { border-color: var(--box-border); background: var(--surface); box-shadow: 0 1px 3px rgba(60,64,67,.15); }
.box-handle {
  height: 14px;
  border-radius: 6px 6px 0 0;
  cursor: move;
  display: flex; align-items: center; justify-content: space-between;
  opacity: 0;
  background: var(--hover);
  padding: 0 2px 0 6px;
}
.box:hover .box-handle, .box:focus-within .box-handle { opacity: 1; }
.box-handle .grip { width: 24px; height: 4px; border-top: 1px dotted var(--text-3); border-bottom: 1px dotted var(--text-3); }
.box-del {
  border: none; background: none; padding: 0; width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center; color: var(--text-2); border-radius: 50%;
}
.box-del:hover { background: rgba(217,48,37,.12); color: var(--danger); }
.box-del .material-symbols-outlined { font-size: 13px; }

.box-resize {
  position: absolute; right: -4px; top: 14px; bottom: 0; width: 8px; cursor: ew-resize;
}

.editor {
  padding: 4px 10px 6px 16px;
  outline: none;
  min-height: 1.6em;
  font-family: var(--note-font);
  font-size: var(--note-size);
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.editor:empty::before { content: 'Yazmaya başla…'; color: var(--text-3); }
.editor ul, .editor ol { margin: 2px 0; padding-left: 24px; }
.editor a { color: var(--primary); cursor: pointer; }
.editor p { margin: 0; }

/* Görev listesi */
.editor ul.checklist { list-style: none; padding-left: 0; }
.editor ul.checklist > li { position: relative; padding-left: 26px; }
.editor ul.checklist > li::before {
  content: '';
  position: absolute; left: 2px; top: .25em;
  width: 14px; height: 14px;
  border: 2px solid var(--text-2); border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
}
.editor ul.checklist > li.checked { color: var(--text-3); text-decoration: line-through; }
.editor ul.checklist > li.checked::before {
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/12px no-repeat;
  border-color: var(--primary);
}

/* Kutu altı: tag + tarih */
.box-footer {
  display: none;
  flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 4px 8px 6px;
  border-top: 1px dashed var(--divider);
  font-size: 12px;
  font-family: var(--app-font);
}
.box:hover .box-footer, .box:focus-within .box-footer, .box.has-meta .box-footer { display: flex; }
.box:not(:focus-within) .box-footer { border-top-color: transparent; }
.box:not(:hover):not(:focus-within) .tag-input,
.box:not(:hover):not(:focus-within) .date-btn.empty { display: none; }
/* Etiketler yalnızca fare notun üzerindeyken ya da not tıklanmışken görünür */
.box:not(:hover):not(:focus-within) .box-footer .tags { visibility: hidden; }

.tag-chip {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--primary-soft); color: var(--primary-strong);
  border-radius: 12px; padding: 2px 4px 2px 8px;
  white-space: nowrap;
}
.tag-chip::before { content: '#'; opacity: .6; }
.tag-chip button {
  border: none; background: none; padding: 0; width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: inherit;
}
.tag-chip button:hover { background: rgba(23,78,166,.15); }
.tag-chip .material-symbols-outlined { font-size: 13px; }
.tag-input {
  border: none; outline: none; background: none;
  min-width: 70px; width: 90px; padding: 2px 4px; font-size: 12px;
}
.date-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 12px; padding: 1px 8px; font-size: 12px; color: var(--text-2);
}
.date-btn:hover { background: var(--hover); }
.date-btn .material-symbols-outlined { font-size: 15px; }
.date-btn.set { color: #137333; border-color: #ceead6; background: #e6f4ea; }
.date-btn.overdue { color: var(--danger); border-color: #fad2cf; background: #fce8e6; }

/* ---------- Açılır pencereler ---------- */
.popup {
  position: fixed; z-index: 100; display: none;
  background: var(--surface); border-radius: 8px; box-shadow: var(--shadow);
  font-family: var(--app-font); font-size: 13px;
}
.popup.open { display: block; }

.tag-suggest { min-width: 180px; max-height: 240px; overflow-y: auto; padding: 6px 0; }
.tag-suggest .opt { padding: 6px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.tag-suggest .opt .material-symbols-outlined { font-size: 16px; color: var(--text-2); }
.tag-suggest .opt.hl, .tag-suggest .opt:hover { background: var(--hover); }
.tag-suggest .opt-head { padding: 4px 14px; font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }

.datepicker { width: 272px; padding: 12px; }
.dp-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dp-quick button {
  border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 3px 10px; font-size: 12px;
}
.dp-quick button:hover { background: var(--hover); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-head span { font-weight: 500; }
.dp-head .mini-btn .material-symbols-outlined { font-size: 20px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-grid .dow { font-size: 11px; color: var(--text-2); padding: 4px 0; }
.dp-grid .day {
  border: none; background: none; height: 32px; border-radius: 50%; font-size: 12px;
}
.dp-grid .day:hover { background: var(--hover); }
.dp-grid .day.other { color: var(--text-3); }
.dp-grid .day.today { color: var(--primary); font-weight: 700; }
.dp-grid .day.sel { background: var(--primary); color: #fff; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.dp-foot .text-btn { display: inline-flex; align-items: center; gap: 6px; }
.dp-foot .text-btn .material-symbols-outlined { font-size: 18px; }
.dp-foot .muted { color: var(--text-2); }

.text-btn {
  border: none; background: none; color: var(--primary); font-weight: 500;
  padding: 6px 12px; border-radius: 4px;
}
.text-btn:hover { background: var(--primary-soft); }

.link-popup { padding: 8px 8px 8px 12px; align-items: center; gap: 8px; }
.link-popup.open { display: flex; }
.link-popup input {
  width: 260px; border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; outline: none;
}
.link-popup input:focus { border-color: var(--primary); }

/* ---------- Ayarlar ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(32,33,36,.4);
  display: none; align-items: center; justify-content: center; z-index: 200;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 480px; max-width: calc(100vw - 32px); max-height: calc(100vh - 64px); overflow-y: auto;
  background: var(--surface); border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 4px 24px; }
.modal-head h2 { margin: 0; font-size: 1.4em; font-weight: 400; }
.modal-body { padding: 0 24px 24px; }
.modal-body h3 { font-size: .95em; font-weight: 500; margin: 18px 0 8px; color: var(--text); }
.field-row { display: flex; gap: 12px; }
.field-row label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: .85em; color: var(--text-2); }
.field-row select {
  padding: 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font-size: 14px;
}
.note-preview {
  margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--note-font); font-size: var(--note-size);
}
.hint { margin: 0 0 8px; font-size: .85em; color: var(--text-2); }
.tag-library { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-library .empty { color: var(--text-3); font-size: .9em; }

/* ---------- Kutu araçları (tag'e gönder / sil) ---------- */
.box-handle { height: 22px; }
.box-handle .box-tools { display: flex; gap: 2px; }
.box-tool {
  border: none; background: none; padding: 0; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-2);
}
.box-tool:hover { background: rgba(60,64,67,.12); color: var(--text); }
.box-tool.del:hover { background: rgba(217,48,37,.12); color: var(--danger); }
.box-tool .material-symbols-outlined { font-size: 15px; }
.canvas.flow .box-handle { display: flex; cursor: default; background: transparent; justify-content: flex-end; }
.canvas.flow .box-handle .grip { display: none; }
.box.moving { opacity: .92; box-shadow: 0 4px 14px rgba(60,64,67,.25); }

/* Manyetik hizalama çizgileri */
.snap-guide { position: absolute; background: #e8710a; pointer-events: none; z-index: 40; }
.snap-guide.v { width: 1px; }
.snap-guide.h { height: 1px; }

/* ---------- Satır göstergesi ---------- */
.line-handle {
  position: absolute; z-index: 30;
  width: 16px; height: 20px;
  display: none; align-items: center; justify-content: center;
  color: var(--text-3); border-radius: 4px; cursor: grab;
}
.line-handle.show { display: flex; }
.line-handle:hover { color: var(--primary); background: var(--primary-soft); }
.line-handle .material-symbols-outlined { font-size: 20px; }
.drop-line { position: absolute; height: 2px; background: var(--primary); border-radius: 1px; z-index: 35; pointer-events: none; display: none; }
.drop-line.show { display: block; }
.drop-line::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.drag-ghost {
  position: fixed; z-index: 300; pointer-events: none;
  max-width: 280px; padding: 4px 10px; border-radius: 6px;
  background: var(--surface); box-shadow: var(--shadow); font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .95;
}
.editor .dragging-block { opacity: .35; }
body.block-dragging, body.block-dragging * { cursor: grabbing !important; user-select: none; }

/* Girinti kademeleri */
.editor [data-indent="1"] { margin-left: 28px; }
.editor [data-indent="2"] { margin-left: 56px; }
.editor [data-indent="3"] { margin-left: 84px; }
.editor [data-indent="4"] { margin-left: 112px; }
.editor ul ul, .editor ol ol, .editor ul ol, .editor ol ul { margin: 0; }
.editor ul ul { list-style-type: circle; }
.editor ul ul ul { list-style-type: square; }
.editor ul.checklist ul.checklist { list-style: none; padding-left: 0; margin-left: 4px; }

/* ---------- Görseller ---------- */
.editor .img-block { margin: 4px 0; line-height: 0; position: relative; }
.editor .img-block img { max-width: 100%; height: auto; border-radius: 4px; cursor: pointer; display: inline-block; }
.editor .img-block img:not([src]) { min-height: 40px; min-width: 80px; background: var(--hover); }
.editor .img-block.selected img { outline: 2px solid var(--primary); outline-offset: 1px; }
.img-overlay { position: absolute; z-index: 32; pointer-events: none; display: none; }
.img-overlay.show { display: block; }
.img-overlay .corner {
  position: absolute; width: 10px; height: 10px; background: var(--surface); border: 2px solid var(--primary);
  border-radius: 2px; pointer-events: auto;
}
.img-overlay .corner.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.img-overlay .corner.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.img-overlay .corner.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.img-overlay .corner.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.img-overlay .size-label {
  position: absolute; right: 0; bottom: -24px; background: rgba(32,33,36,.85); color: #fff;
  font-size: 11px; padding: 2px 6px; border-radius: 4px; display: none; font-family: var(--app-font);
}
.img-overlay.resizing .size-label { display: block; }
.box.drop-target { border-color: var(--primary) !important; background: var(--surface); }
.canvas.file-over { outline: 2px dashed #aecbfa; outline-offset: -8px; }

/* ---------- Sayfalar paneli genişletme ---------- */
.pages-pane { position: relative; }
.pane-resizer { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 10; }
.pane-resizer:hover, body.col-resizing .pane-resizer { background: linear-gradient(to right, transparent 3px, var(--primary) 3px, var(--primary) 5px, transparent 5px); }
body.col-resizing { cursor: col-resize; user-select: none; }

/* ---------- Tag sayfası ekle düğmeleri ---------- */
.tag-add {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; max-width: 760px; margin: 0 0 18px; padding: 10px;
  border: 1px dashed var(--border); border-radius: 8px; background: none;
  color: var(--text-2); font-family: var(--app-font); font-size: 13px;
}
.tag-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.tag-add .material-symbols-outlined { font-size: 18px; }
.tag-source.static { cursor: default; }
.tag-source.static:hover { background: none; color: var(--text-2); }

/* ---------- Onay penceresi / bildirim ---------- */
.modal.confirm { width: 380px; padding: 24px 24px 16px; }
.modal.confirm p { margin: 0 0 20px; font-size: 15px; line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.filled-btn { border: none; border-radius: 18px; padding: 8px 20px; font-weight: 500; background: var(--primary); color: #fff; }
.filled-btn.danger { background: var(--danger); }
.filled-btn:hover { box-shadow: 0 1px 3px rgba(60,64,67,.3); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #323232; color: #fff; padding: 12px 20px; border-radius: 6px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 400; max-width: 90vw;
}
.toast.open { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Arama ---------- */
.search-box {
  flex: 1; max-width: 620px; margin: 0 24px;
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 4px 0 12px; border-radius: 17px;
  background: var(--hover); transition: background .15s, box-shadow .15s;
}
.search-box:focus-within { background: var(--surface); box-shadow: 0 1px 1px rgba(65,69,73,.3), 0 1px 3px 1px rgba(65,69,73,.15); }
.search-box > .material-symbols-outlined { color: var(--text-2); font-size: 20px; }
.search-box input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-size: 14px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-item .snippet { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.search-item mark, .snippet mark { background: #fdd663; color: inherit; border-radius: 2px; padding: 0 1px; }
.search-item .item-date { font-size: .75em; color: var(--text-3); margin-top: 2px; }
::highlight(search) { background-color: #fdd663; color: inherit; }

.shortcut-row { display: flex; align-items: center; gap: 10px; font-size: .9em; }
.shortcut-row > span { flex: 1; color: var(--text-2); }
.shortcut-btn {
  min-width: 90px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  font-family: var(--app-font); font-size: 14px; letter-spacing: .05em;
}
.shortcut-btn:hover { border-color: var(--primary); }
.shortcut-btn.recording { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------- Sürükle-bırak sıralama ---------- */
.list li.dragging { opacity: .4; }
.list li.drop-before { box-shadow: inset 0 2px 0 var(--primary); }
.list li.drop-after { box-shadow: inset 0 -2px 0 var(--primary); }

/* ---------- Not rengi ---------- */
.box.colored { background: var(--box-bg) !important; border-color: rgba(60,64,67,.12); }
.box.colored .box-handle { background: rgba(255,255,255,.45); }
.canvas.flow .box.colored { background: var(--box-bg) !important; }
.color-popup { padding: 8px; gap: 6px; }
.color-popup.open { display: flex; }
.color-popup .swatch { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.color-popup .swatch.none { background: var(--surface); color: var(--text-2); }
.color-popup .swatch.none .material-symbols-outlined { font-size: 16px; }
.color-popup .swatch.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }

/* ---------- Not altbilgisi: tarih solda, tag'ler sağda ---------- */
.box-footer { flex-wrap: nowrap; }
.footer-spacer { flex: 1; }
.box-footer .tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.date-btn { margin-left: 0; white-space: nowrap; flex: none; }
.tag-input { min-width: 0; width: 46px; }
.tag-input:focus { width: 90px; }
.date-btn.past { color: var(--text-3); border-color: var(--divider); background: var(--hover); }
.date-btn.cal { color: var(--danger); border-color: #fad2cf; background: #fce8e6; }

/* ---------- Takvim sayfası ---------- */
.cal-day {
  display: flex; align-items: center; gap: 10px; max-width: 760px;
  margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  color: var(--text-2); font-family: var(--app-font); font-size: 13px;
}
.cal-day:first-child { margin-top: 4px; }
.cal-num { font-size: 22px; color: var(--text); min-width: 28px; }
.cal-day.today .cal-num { color: #fff; background: var(--primary); border-radius: 50%; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }

[hidden] { display: none !important; }

/* ---------- Tarih renkleri (v4) ---------- */
.date-btn.future { color: var(--danger); border-color: #fad2cf; background: #fce8e6; }
.date-btn.cal { color: #8a6100; border-color: #f6e08a; background: #fef7cd; }
.date-btn.empty { color: var(--text-2); }

/* ---------- Etiket çipleri: tam ad ---------- */
.box-footer .tags { min-width: 0; }
.tag-chip { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Etiket önerileri ---------- */
.tag-suggest .opt b { font-weight: 700; color: var(--text); }
.tag-suggest .opt-sep { border-top: 1px solid var(--divider); margin: 4px 0; }
.tag-suggest .opt.create { color: var(--text-2); }
.tag-suggest .opt.create.armed { color: var(--primary); background: var(--primary-soft); }
.tag-suggest .opt-hint { margin-left: auto; padding-left: 12px; font-size: 11px; color: var(--text-3); }

/* ---------- Sol panel: Etiketler grubu ---------- */
.list li.tag-group { display: block; padding: 0; margin: 6px 0 0; cursor: default; border-radius: 0; }
.list li.tag-group:hover { background: none; }
.tag-group .group-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 18px; margin-left: -8px;
  border-radius: 0 20px 20px 0; cursor: pointer; color: var(--text-2); font-weight: 500;
}
.tag-group .group-head:hover { background: var(--hover); }
.tag-group .chev { margin-left: auto; font-size: 18px; transition: transform .15s; flex: none !important; }
.tag-group.closed .chev { transform: rotate(-90deg); }
.tag-group.closed .sub-list { display: none; }
.sub-list { list-style: none; margin: 0; padding: 0; }
.sections-pane .list .sub-list li.tag-sec { padding-left: 30px; }
.tag-sec .hash { width: 12px; text-align: center; color: var(--text-3); font-weight: 500; flex: none; }
.tag-sec.active .hash { color: var(--primary-strong); }
.tag-sec.empty { color: var(--text-3); cursor: default; font-size: .9em; }
.tag-sec.empty:hover { background: none !important; }
.sections-pane.collapsed .tag-group .group-head { justify-content: center; padding: 10px 0; margin: 0; border-radius: 50%; width: 44px; }
.sections-pane.collapsed .sub-list li.tag-sec { padding-left: 0 !important; }

/* Etiket bölümünde "Tüm notlar" */
.all-item .item-name { display: flex; align-items: center; gap: 6px; }
.all-item .item-name .material-symbols-outlined { font-size: 17px; color: var(--text-2); }

/* ---------- TO-DO bağlı kopya ---------- */
.link-badge {
  display: inline-flex; align-items: center; gap: 2px; margin-right: auto; margin-left: 6px;
  font-size: 10px; color: var(--primary); font-family: var(--app-font);
}
.link-badge .material-symbols-outlined { font-size: 13px; }
.box.linked { border-style: dashed; border-color: #aecbfa; }
.box.linked:hover, .box.linked:focus-within { border-color: var(--primary); }
.box-tool.only-linked { display: none; }
.box.has-link .box-tool.only-linked { display: inline-flex; }
.linked-pill {
  margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 10px; line-height: 16px;
  background: var(--primary-soft); color: var(--primary-strong);
}

/* ---------- ⋮ menüsü ---------- */
.box-menu { min-width: 240px; padding: 6px 0; }
.box-menu .menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: none; background: none; padding: 8px 16px; text-align: left; font-size: 13px;
}
.box-menu .menu-item:hover { background: var(--hover); }
.box-menu .menu-item .material-symbols-outlined { font-size: 19px; color: var(--text-2); }
.box-menu .mi-text { display: flex; flex-direction: column; }
.box-menu .mi-text small { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.box-menu .menu-item.danger, .box-menu .menu-item.danger .material-symbols-outlined { color: var(--danger); }
.box-menu .menu-sep { border-top: 1px solid var(--divider); margin: 6px 0; }

/* Yapıştır düğmesi */
.paste-btn { flex-direction: row; gap: 4px; padding: 0 10px; background: var(--tb-on); color: var(--tb-on-text); border-radius: 16px; }
.paste-btn .paste-label { font-size: 12px; font-weight: 500; }
.paste-btn { margin-left: 6px; }

/* Sayfayı bölüme bırakma */
.list li.page-drop { background: var(--primary-soft) !important; box-shadow: inset 0 0 0 2px var(--primary); }

/* ---------- Açılır-kapanır satırlar ---------- */
.editor [data-toggle] { position: relative; }
.editor [data-toggle]::after {
  content: ''; position: absolute; left: -13px; top: calc(.75em - 5px);
  border-style: solid; border-width: 5px 0 5px 7px; border-color: transparent transparent transparent var(--text);
  transform: rotate(90deg); transition: transform .12s; pointer-events: none;
}
.editor [data-toggle][data-collapsed]::after { transform: none; }
.editor li[data-toggle]::after { left: -37px; }
.editor ul.checklist > li[data-toggle]::after { left: -13px; }
.editor [data-toggle].hl-handle::after { opacity: 0; }
.editor [data-folded] { display: none !important; }
.line-handle.toggle { color: var(--text); }
.line-handle.toggle .material-symbols-outlined { transform: rotate(90deg); transition: transform .12s; font-variation-settings: 'FILL' 1; }
.line-handle.toggle.collapsed .material-symbols-outlined { transform: none; }

/* ---------- PDF ---------- */
.page-head { position: relative; }
.pdf-btn { position: absolute; right: 16px; top: 14px; }
.pdf-modal { width: 900px; max-width: calc(100vw - 32px); height: calc(100vh - 48px); max-height: none; display: flex; flex-direction: column; overflow: hidden; }
.pdf-actions { display: flex; align-items: center; gap: 8px; }
.pdf-actions .text-btn, .pdf-actions .filled-btn { display: inline-flex; align-items: center; gap: 6px; }
.pdf-actions .material-symbols-outlined { font-size: 18px; }
.pdf-stage { flex: 1; overflow: auto; background: var(--divider); padding: 24px; margin-top: 8px; }
.pdf-paper { width: 794px; min-height: 1123px; margin: 0 auto; background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.25); padding: 45px; }
.pdf-content { width: 704px; color: var(--text); font-family: var(--note-font); }
.pdf-title { font-size: 26px; font-weight: 400; margin: 0 0 4px; }
.pdf-sub { color: var(--text-2); font-size: 12px; margin-bottom: 20px; font-family: var(--app-font); }
.pdf-day { font-size: 14px; font-weight: 500; color: var(--text-2); border-bottom: 1px solid var(--border); padding-bottom: 4px; margin: 20px 0 10px; font-family: var(--app-font); }
.pdf-note { border: 1px solid var(--box-border); border-radius: 6px; margin-bottom: 14px; page-break-inside: avoid; break-inside: avoid; }
.pdf-note.colored { border-color: rgba(60,64,67,.12); }
.pdf-editor { padding: 8px 12px; }
.pdf-editor img { max-width: 100%; }
.pdf-meta { padding: 0 12px 8px; font-size: 11px; color: var(--text-3); font-family: var(--app-font); }
.pdf-empty { color: var(--text-3); }
#printArea { display: none; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing { overflow: visible; display: block; height: auto; }
  body.printing #printArea { display: block; }
  body.printing #printArea .pdf-content { width: auto; }
  @page { size: A4; margin: 12mm; }
}

/* ---------- Bulut ---------- */
.cloud-btn.synced { color: #188038; }
.cloud-btn.syncing .material-symbols-outlined { animation: spin 1.2s linear infinite; color: var(--primary); }
.cloud-btn.offline { color: var(--text-3); }
.cloud-btn.error { color: var(--danger); }
.cloud-btn.login { color: var(--text-2); }
@keyframes spin { to { transform: rotate(-360deg); } }
.login-modal { width: 460px; padding: 28px 28px 20px; }
.login-head { text-align: center; margin-bottom: 18px; }
.login-head .material-symbols-outlined { font-size: 40px; color: var(--primary); }
.login-head h2 { margin: 6px 0 4px; font-weight: 400; font-size: 1.5em; }
.login-head p { margin: 0; color: var(--text-2); font-size: .9em; }
.login-modal label { display: flex; flex-direction: column; gap: 4px; font-size: .85em; color: var(--text-2); margin-bottom: 12px; }
.login-modal input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; outline: none; color: var(--text); }
.login-modal input:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.login-msg { min-height: 20px; font-size: .85em; color: var(--danger); margin-bottom: 8px; }
.login-msg.ok { color: var(--text-2); }
.login-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.account-popup { min-width: 260px; padding: 14px 16px 8px; }
.acct-email { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 8px; }
.acct-email .material-symbols-outlined { color: var(--text-2); }
.acct-status { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.acct-actions { display: flex; justify-content: space-between; margin-top: 8px; }
.acct-actions .text-btn { display: inline-flex; align-items: center; gap: 6px; }
.acct-actions .material-symbols-outlined { font-size: 18px; }

/* =========================================================
   Telefon görünümü
   ========================================================= */
.m-back, .fab { display: none; }
@media (hover: none) {
  .box-handle { opacity: 1; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 4px; gap: 4px; }
  .brand > span { display: none; }
  .search-box { margin: 0 4px; height: 36px; padding-left: 12px; }
  .search-box input { font-size: 16px; }   /* iOS'ta otomatik yakınlaştırmayı önler */
  .layout { position: relative; }
  .sections-pane, .pages-pane, .note-pane { position: absolute; inset: 0; width: 100% !important; display: none; border-right: none; }
  body[data-mview="sections"] .sections-pane,
  body[data-mview="pages"] .pages-pane { display: flex; }
  body[data-mview="note"] .note-pane { display: flex; }
  .pane-resizer, .zoom-ctrl { display: none; }
  .m-back { display: inline-flex; }
  .pages-pane .pane-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 4px 4px; }
  .list li { padding: 12px 12px; }
  .toolbar { flex-wrap: nowrap; overflow-x: auto; margin: 6px 8px 0; border-radius: 12px; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .tb-btn { min-width: 38px; height: 38px; flex: none; }
  .page-head { padding: 8px 52px 4px 52px; }
  .page-head .m-back { position: absolute; left: 4px; top: 6px; }
  .page-title { width: 100%; font-size: calc(1.5em - 2.67px); }
  .pdf-btn { right: 4px; top: 6px; }
  .canvas.flow { padding: 8px 12px 96px; }
  .canvas.flow .tag-card { max-width: none; }
  .editor { font-size: max(16px, var(--note-size)); }   /* iOS yakınlaştırmasın */
  .fab {
    display: flex; position: absolute; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
    width: 56px; height: 56px; border-radius: 16px; border: none; z-index: 25;
    align-items: center; justify-content: center;
    background: #c2e7ff; color: #001d35; box-shadow: 0 2px 6px rgba(60,64,67,.3);
  }
  .fab .material-symbols-outlined { font-size: 28px; }
  .modal { max-width: calc(100vw - 24px); }
  .pdf-modal { height: calc(100vh - 24px); }
  .pdf-stage { padding: 8px; }
  .pdf-paper { transform-origin: 0 0; zoom: .45; }
  .box-menu .menu-item { padding: 12px 16px; }
}
.canvas.mobile-flow .box:not(.has-meta):not(:focus-within) .box-footer { display: none; }

/* ---------- Paragraf bağlantısı düğmesi ---------- */
.tb-btn.tb-dark { background: var(--text-2); color: var(--surface); margin-left: 2px; }
.tb-btn.tb-dark:hover { background: var(--text); }
.editor [data-pid].pid-flash { animation: pidflash 2s ease-out; border-radius: 3px; }
@keyframes pidflash { 0%, 35% { background: #fdd663; } 100% { background: transparent; } }
.editor a.para-link { text-decoration: none; border-bottom: 1px dashed currentColor; }
.editor a.para-link::before { content: '↪ '; opacity: .7; }

/* ---------- Temalar ---------- */
.pdf-paper { background: #ffffff !important; color: #202124; }
.pdf-paper .editor { color: #202124; }
:root[data-theme="medium"] {
  --bg: #eceff2;
  --surface: #ffffff;
  --surface-2: #e2e6ea;
  --hover: #dde1e6;
  --divider: #d7dbe0;
  --border: #c9ced5;
  --toolbar: #dde4ee;
  --box-border: #cdd2d8;
  --primary-soft: #dbe6fb;
}
:root[data-theme="medium"] .box:focus-within, :root[data-theme="medium"] .box.selected,
:root[data-theme="medium"] .canvas.flow .box { background: #f8f9fa; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1c1e;
  --surface: #28292c;
  --surface-2: #141517;
  --hover: #323438;
  --divider: #36383c;
  --border: #45484d;
  --text: #e3e3e3;
  --text-2: #a9adb3;
  --text-3: #7c8086;
  --toolbar: #2b2f36;
  --box-border: #3d4045;
  --primary: #8ab4f8;
  --primary-soft: #263449;
  --primary-strong: #a8c7fa;
  --tb-on: #3a4a64;
  --tb-on-text: #d3e3fd;
  --danger: #f28b82;
  --shadow: 0 1px 3px rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.4);
}
:root[data-theme="dark"] .box.colored, :root[data-theme="dark"] .box.colored .editor { color: #202124; }
:root[data-theme="dark"] .date-btn.future, :root[data-theme="dark"] .date-btn.cal, :root[data-theme="dark"] .date-btn.past { filter: saturate(.9); }
:root[data-theme="dark"] .date-btn.past { background: #2f3134; border-color: #3d4045; }
:root[data-theme="dark"] .search-box:focus-within { background: #303134; }
:root[data-theme="dark"] .fab { background: #004a77; color: #c2e7ff; }
:root[data-theme="dark"] .paste-btn { background: var(--tb-on); color: var(--tb-on-text); }
:root[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,.6); }
:root[data-theme="dark"] .filled-btn { color: #062e6f; }
:root[data-theme="dark"] .editor ul.checklist > li.checked::before { border-color: var(--primary); }
:root[data-theme="dark"] .cal-day.today .cal-num { color: #062e6f; }
.theme-pick { display: flex; gap: 8px; }
.theme-pick button {
  flex: 1; padding: 10px 8px 8px; border: 2px solid var(--border); border-radius: 8px; background: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--text);
}
.theme-pick button.sel { border-color: var(--primary); }
.theme-pick .sw { width: 100%; height: 34px; border-radius: 4px; border: 1px solid rgba(0,0,0,.12); }
.page-title, .tag-input, .search-box input { background: transparent; }
.rename-input, .link-popup input, .login-modal input, .field-row select { background: var(--surface); color: var(--text); }

/* ---------- Seçince açılan biçim menüsü ---------- */
.float-bar { padding: 4px; gap: 2px; border-radius: 22px; background: var(--surface); z-index: 150; }
.float-bar.open { display: flex; }
.float-bar .tb-btn { height: 34px; min-width: 34px; border-radius: 17px; }

/* ---------- "/" komut menüsü ---------- */
.slash-menu { min-width: 240px; max-height: 320px; overflow-y: auto; padding: 6px 0; z-index: 150; }
.slash-menu .opt { padding: 7px 14px; cursor: pointer; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.slash-menu .opt .material-symbols-outlined { font-size: 19px; color: var(--text-2); }
.slash-menu .opt .material-symbols-outlined.dark { background: var(--text-2); color: var(--surface); border-radius: 4px; padding: 1px; }
.slash-menu .opt.hl, .slash-menu .opt:hover { background: var(--hover); }
.slash-menu .opt-head { padding: 6px 14px; font-size: 12px; color: var(--text-2); }
.nd-palette { padding: 10px; width: 222px; z-index: 160; }

/* ---------- YouTube / Instagram önizleme ---------- */
.editor .link-thumb { margin: 4px 0 6px; position: relative; }
.editor .link-thumb.yt img { border-radius: 8px; display: block; }
.editor .link-thumb.yt::after {
  content: '▶'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 40px; border-radius: 10px; background: rgba(255,0,0,.85); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; pointer-events: none; line-height: 40px; text-align: center;
}
.editor .embed-wrap { max-width: 100%; border: 1px solid var(--box-border); border-radius: 8px; overflow: hidden; background: var(--surface); line-height: normal; }
.editor .embed-head { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12px; color: var(--text-2); cursor: pointer; font-family: var(--app-font); }
.editor .embed-head .material-symbols-outlined { font-size: 16px; }
.editor .embed-wrap iframe { display: block; width: 100%; aspect-ratio: 4 / 5.4; border: 0; background: #fff; }
.editor .img-block.selected .embed-wrap { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Telefonda üstteki araç çubuğu yerine seçim menüsü ve "/" menüsü kullanılır */
@media (max-width: 760px) {
  .toolbar { display: none; }
}
.float-bar { max-width: calc(100vw - 16px); flex-wrap: wrap; justify-content: center; }
@media (max-width: 760px) {
  .float-bar { border-radius: 14px; }
  .float-bar .tb-btn { height: 38px; min-width: 38px; }
}
.editor .link-thumb.yt { width: fit-content; max-width: 100%; }

/* ---------- Başlıklar ---------- */
.editor h1, .editor h2, .editor h3 { margin: 6px 0 2px; line-height: 1.25; font-weight: 700; }
.editor h1 { font-size: 1.85em; }
.editor h2 { font-size: 1.45em; }
.editor h3 { font-size: 1.2em; }
.tb-T { font-family: 'Inter', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif; font-weight: 700; font-size: 19px; line-height: 1; width: 20px; text-align: center; }
.tb-T.small { font-size: 17px; color: var(--text-2); width: 19px; }

/* Başlık / yazı boyutu açılır menüsü (önizlemeli) */
.nd-pop { padding: 6px 0; min-width: 210px; z-index: 170; max-height: 70vh; overflow-y: auto; }
.nd-pop .pop-head { padding: 4px 14px 6px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.nd-pop .pop-item { display: block; width: 100%; text-align: left; border: none; background: none; padding: 7px 16px; line-height: 1.25; color: var(--text); font-family: var(--note-font); }
.nd-pop .pop-item:hover { background: var(--hover); }
.nd-pop .pop-item.sel { background: var(--primary-soft); }
.nd-pop .pv-h1 { font-size: 26px; font-weight: 700; }
.nd-pop .pv-h2 { font-size: 21px; font-weight: 700; }
.nd-pop .pv-h3 { font-size: 17px; font-weight: 700; }
.nd-pop .pv-div { font-size: 14px; }

/* ---------- Araç çubuğu üst çubukta, arama kutusunun yanında ---------- */
.topbar { gap: 8px; }
.topbar .search-box { flex: 0 1 320px; min-width: 170px; margin: 0 4px; }
.topbar .toolbar {
  margin: 0; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
  justify-content: flex-start; scrollbar-width: none; padding: 3px 8px;
}
.topbar .toolbar::-webkit-scrollbar { display: none; }
.topbar .toolbar .tb-btn, .topbar .toolbar .tb-color, .topbar .toolbar .tb-sep { flex: none; }
.topbar-actions { flex: none; display: flex; }
.brand { flex: none; }
.page-head { padding-top: 14px; }

/* ---------- Sayfa bağlantısı (@) ---------- */
.editor a.page-link { text-decoration: none; background: var(--primary-soft); color: var(--primary-strong); border-radius: 4px; padding: 0 4px; }
.editor a.page-link::before { content: '📄 '; font-size: .85em; }
.slash-menu .opt-title { display: flex; align-items: center; gap: 8px; padding: 6px 14px 2px; font-size: 13px; font-weight: 500; color: var(--text); }
.slash-menu .opt-title .material-symbols-outlined { font-size: 18px; color: var(--primary); }
.slash-menu .opt-text { display: flex; flex-direction: column; min-width: 0; }
.slash-menu .opt-text small { font-size: 11px; color: var(--text-3); }

/* ---------- Görsel menüsü ---------- */
.img-menu { padding: 4px; gap: 2px; z-index: 140; }
.img-menu.open { display: flex; }
.img-menu button { display: flex; align-items: center; gap: 6px; border: none; background: none; padding: 7px 12px; border-radius: 6px; font-size: 13px; color: var(--text); }
.img-menu button:hover { background: var(--hover); }
.img-menu button:disabled { opacity: .5; }
.img-menu .material-symbols-outlined { font-size: 19px; color: var(--text-2); }

/* ---------- PDF: not kenar çizgisi yok ---------- */
.pdf-note { border: none !important; border-radius: 0; margin-bottom: 18px; }
.pdf-note.colored { border-radius: 6px; }
.pdf-editor { padding: 2px 0; }
.pdf-note.colored .pdf-editor { padding: 8px 12px; }
.pdf-meta { padding: 0; }
.pdf-note.colored .pdf-meta { padding: 0 12px 8px; }

/* ---------- Tarih renkleri (v5): geçmiş sarı, bugün/gelecek yeşil, takvimde kırmızı ---------- */
.date-btn.past { color: #8a6100; border-color: #f6e08a; background: #fef7cd; }
.date-btn.future { color: #137333; border-color: #ceead6; background: #e6f4ea; }
.date-btn.cal { color: #c5221f; border-color: #fad2cf; background: #fce8e6; }
:root[data-theme="dark"] .date-btn.past { color: #8a6100; border-color: #f6e08a; background: #fef7cd; }

/* Geri tuşu */
#backBtn:disabled { opacity: .35; cursor: default; }
#backBtn:disabled:hover { background: none; }

/* Emoji listesi */
.slash-menu .emo { font-size: 20px; width: 24px; text-align: center; }
.slash-menu .emoji-row { display: flex; gap: 2px; padding: 2px 8px 6px; }
.slash-menu .emo-btn { font-size: 22px; padding: 4px 6px !important; border-radius: 8px; justify-content: center; }

/* Ayarlar: onay kutusu satırı */
.check-row { display: flex; align-items: center; gap: 8px; font-size: .9em; color: var(--text); cursor: pointer; }

/* =========================================================
   Yapay zekâ paneli
   ========================================================= */
.ai-btn .material-symbols-outlined {
  background: linear-gradient(135deg, #4285f4 0%, #9b72cb 45%, #d96570 75%, #f4b400 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variation-settings: 'FILL' 1; font-size: 24px;
}
body.ai-open .ai-btn { background: var(--primary-soft); }
.ai-panel {
  width: 0; flex: none; overflow: hidden; display: flex; flex-direction: column;
  border-left: 1px solid var(--border); background: var(--surface); transition: width .2s ease;
}
body.ai-open .ai-panel { width: 400px; }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--divider); min-width: 400px; }
.ai-logo {
  font-size: 26px; font-variation-settings: 'FILL' 1;
  background: linear-gradient(135deg, #4285f4, #9b72cb 50%, #d96570); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ai-title { flex: 1; font-weight: 500; font-size: 1.05em; display: flex; flex-direction: column; }
.ai-title small { font-weight: 400; font-size: 11px; color: var(--text-2); }
.ai-selbar { display: flex; align-items: center; gap: 6px; padding: 6px 16px; font-size: 12px; color: var(--text-2); background: var(--surface-2); min-width: 400px; }
.ai-selbar .material-symbols-outlined { font-size: 16px; }
.ai-selbar.has { color: var(--primary-strong); background: var(--primary-soft); }
.ai-selbar .sel-names { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-selbar .text-btn { padding: 2px 8px; font-size: 12px; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 12px; min-width: 400px; }
.ai-msg { max-width: 100%; }
.ai-msg.user { align-self: flex-end; max-width: 85%; }
.ai-msg .ai-body.editor { padding: 0; font-size: 14px; line-height: 1.55; min-height: 0; }
.ai-msg .ai-body.editor:empty::before { content: none; }
.ai-msg.user .ai-body { background: var(--primary-soft); color: var(--text); padding: 8px 12px; border-radius: 16px 16px 4px 16px; }
.ai-msg.assistant .ai-body p { margin: 0 0 8px; }
.ai-msg .ai-body h1 { font-size: 1.3em; } .ai-msg .ai-body h2 { font-size: 1.15em; } .ai-msg .ai-body h3 { font-size: 1.05em; }
.ai-note { border: 1px solid var(--box-border); border-radius: 10px; margin: 8px 0; overflow: hidden; background: var(--surface); }
.ai-note-head { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12px; color: var(--text-2); background: var(--surface-2); }
.ai-note-head .material-symbols-outlined { font-size: 16px; }
.ai-note-body { padding: 8px 12px; }
.ai-actions { display: flex; gap: 6px; align-items: center; padding: 6px 8px; flex-wrap: wrap; }
.ai-actions .text-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 4px 8px; }
.ai-actions .material-symbols-outlined { font-size: 16px; }
.filled-btn.sm { padding: 6px 14px; font-size: 13px; }
.ai-status { font-size: 12px; color: var(--text-2); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.ai-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: aipulse 1s ease-in-out infinite; }
@keyframes aipulse { 50% { opacity: .3; } }
.ai-typing { display: flex; gap: 4px; padding: 6px 0; }
.ai-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: aipulse 1.2s infinite; }
.ai-typing span:nth-child(2) { animation-delay: .2s; } .ai-typing span:nth-child(3) { animation-delay: .4s; }
.ai-error { display: flex; gap: 6px; align-items: flex-start; color: var(--danger); font-size: 13px; }
.ai-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 14px; min-width: 400px; }
.ai-chip {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 14px; padding: 4px 10px; font-size: 12px; color: var(--text);
}
.ai-chip:hover { background: var(--hover); border-color: var(--primary); }
.ai-chip .material-symbols-outlined { font-size: 15px; color: var(--primary); }
.ai-panel.busy .ai-chip, .ai-panel.busy .ai-send { opacity: .5; pointer-events: none; }
.ai-input { display: flex; align-items: flex-end; gap: 8px; margin: 6px 12px 12px; padding: 6px 6px 6px 14px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); min-width: 376px; }
.ai-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.ai-input textarea { flex: 1; border: none; outline: none; resize: none; background: transparent; font: inherit; font-size: 14px; line-height: 1.4; padding: 6px 0; max-height: 160px; color: var(--text); }
.ai-send { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.ai-send .material-symbols-outlined { font-size: 20px; }

/* Notlarda seçim kutusu (panel açıkken) */
.ai-check { display: none; align-items: center; margin-right: 4px; cursor: pointer; }
.ai-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; }
body.ai-open .ai-check { display: inline-flex; }
body.ai-open .box-handle { opacity: 1; }
body.ai-open .box.ai-selected { border-color: var(--primary) !important; box-shadow: 0 0 0 2px var(--primary-soft); }
.canvas.flow .box-handle .ai-check { margin-right: 6px; }

@media (max-width: 760px) {
  .ai-panel { position: fixed; inset: 56px 0 0 0; z-index: 120; width: 100% !important; border-left: none; display: none; }
  body.ai-open .ai-panel { display: flex; }
  .ai-head, .ai-selbar, .ai-msgs, .ai-quick { min-width: 0; }
  .ai-input { min-width: 0; }
}
.box-handle .ai-check { margin-left: auto; }

/* =========================================================
   İğnelenmiş not penceresi (Mac uygulaması ?pin= ve tarayıcı PiP)
   ========================================================= */
.pin-head {
  display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; flex: none;
  border-bottom: 1px solid var(--divider); font-size: 12px; color: var(--text-2); background: var(--surface-2);
}
.pin-head > .material-symbols-outlined { font-size: 16px; color: var(--primary); font-variation-settings: 'FILL' 1; }
.pin-where { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-head .icon-btn { width: 32px; height: 32px; }
.pin-head .icon-btn .material-symbols-outlined { font-size: 18px; }
.pin-flow { padding: 8px !important; position: static !important; width: auto !important; min-height: 0 !important; transform: none !important; }
.pin-flow .box { width: auto !important; }
.pin-missing { padding: 24px; color: var(--text-2); text-align: center; }

body.pin-mode .topbar, body.pin-mode .sections-pane, body.pin-mode .pages-pane, body.pin-mode .page-head,
body.pin-mode .zoom-ctrl, body.pin-mode .fab, body.pin-mode .ai-panel, body.pin-mode .empty-state { display: none !important; }
body.pin-mode .layout { position: relative; }
body.pin-mode .note-pane { display: flex !important; position: absolute; inset: 0; width: 100% !important; }
body.pin-mode .canvas-wrap { overflow: auto; }
body.pin-mode .sizer { width: auto !important; height: auto !important; }
body.pin-mode [data-tool="pin"], body.pin-mode [data-tool="more"] { display: none; }

/* Tarayıcı PiP penceresi */
.pip-body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--app-font); font-size: var(--app-size); display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.pip-body .pin-flow { flex: 1; overflow: auto; }
.pip-body .box-handle { opacity: 1; }
.pip-body .box-tools, .pip-body .tag-input, .pip-body .date-btn.empty { display: none; }
.pip-body .date-btn { pointer-events: none; }

/* =========================================================
   Yatay çizgi, dosyalar, bırakma seçimi, marka, kalınlık
   ========================================================= */
body { font-weight: var(--app-weight, 400); }
.editor { font-weight: var(--note-weight, 400); }
.editor b, .editor strong, .editor h1, .editor h2, .editor h3 { font-weight: 700; }
.editor hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

.brand-home { cursor: pointer; border-radius: 6px; padding: 2px 6px; margin-left: -6px; }
.brand-home:hover { background: var(--hover); color: var(--text); }

.editor .file-block {
  margin: 6px 0; border: 1px solid var(--box-border); border-radius: 10px; background: var(--surface-2);
  overflow: hidden; line-height: normal; font-family: var(--app-font); font-weight: 400; user-select: none;
}
.editor .fb-head { display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 10px; min-width: 0; }
.editor .fb-icon { font-size: 26px; flex: none; }
.editor .fb-pdf .fb-icon { color: #d93025; }
.editor .fb-word .fb-icon { color: #1a73e8; }
.editor .fb-audio .fb-icon { color: #9334e6; }
.editor .fb-video .fb-icon { color: #e8710a; }
.editor .fb-file .fb-icon { color: var(--text-2); }
.editor .fb-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor .fb-size { font-size: 11px; color: var(--text-3); flex: none; }
.editor .fb-btn { border: none; background: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex: none; cursor: pointer; }
.editor .fb-btn:hover { background: var(--hover); color: var(--primary); }
.editor .fb-btn .material-symbols-outlined { font-size: 18px; }
.editor .file-block audio { display: block; width: calc(100% - 16px); margin: 0 8px 8px; height: 36px; }
.editor .file-block video { display: block; width: 100%; max-height: 420px; background: #000; }
.editor .file-block.fb-missing::after { content: 'Dosya bu cihazda yok ve buluttan indirilemedi'; display: block; padding: 0 10px 8px; font-size: 11px; color: var(--danger); }
.editor a.file-link { text-decoration: none; background: var(--surface-2); border: 1px solid var(--box-border); border-radius: 6px; padding: 0 6px; color: var(--text); }
.editor a.file-link::before { content: '📎 '; }

.drop-choice { width: 270px; padding: 6px; z-index: 180; }
.drop-choice .dc-title { padding: 6px 10px 8px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-choice button { display: flex; align-items: flex-start; gap: 10px; width: 100%; border: none; background: none; padding: 8px 10px; border-radius: 8px; text-align: left; color: var(--text); }
.drop-choice button:hover { background: var(--hover); }
.drop-choice button .material-symbols-outlined { color: var(--primary); margin-top: 1px; }
.drop-choice b { display: block; font-weight: 500; font-size: 14px; }
.drop-choice small { display: block; font-size: 11px; color: var(--text-2); margin-top: 1px; }

.search-page .item-name { display: flex; align-items: center; gap: 6px; }
.search-page .item-name .material-symbols-outlined { font-size: 17px; color: var(--primary); }

/* ---------- v10: üçgen, paragraf bağlantısı, etiket bölümleri, başlık, simge, bırakma ---------- */
.editor [data-toggle]::after { border-width: 4px 0 4px 6px; top: calc(.75em - 4px); left: -12px; }
.editor li[data-toggle]::after { left: -36px; }
.editor ul.checklist > li[data-toggle]::after { left: -12px; }

.tb-btn.tb-dark { background: none; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--text-2); }
.tb-btn.tb-dark:hover { background: var(--hover); color: var(--text); }
.slash-menu .opt .material-symbols-outlined.dark { background: none; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--text-2); }

.tag-sec .tag-ic { display: none; font-size: 16px; color: var(--text-3); }
.sections-pane.collapsed .tag-sec .tag-ic { display: inline; }
.sections-pane .list .sub-list li.tag-sec { padding-left: 38px; }
.sections-pane.collapsed .list .sub-list li.tag-sec { padding-left: 0 !important; }

.page-head.compact { padding-top: 10px; }
.page-head.compact .page-title { font-size: calc(1.25em - 2.67px); font-weight: 700; }
.page-head.compact .page-meta { margin-top: 2px; }

.brand-icon { flex: none; display: block; }
.sections-pane { position: relative; }

.drop-ghost {
  position: absolute; height: 72px; border: 2px dashed var(--primary); border-radius: 8px; background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--primary); font-size: 13px;
  pointer-events: none; z-index: 30; font-family: var(--app-font); opacity: .9;
}
.drop-ghost .material-symbols-outlined { font-size: 20px; }

/* ================= v11 ================= */
/* Eylem düğmeli bildirim */
.toast.has-act { pointer-events: auto; display: flex; align-items: center; gap: 16px; }
.toast-act { background: none; border: 0; color: #8ab4f8; font: inherit; font-weight: 500; cursor: pointer; padding: 0; }

/* Hatırlatıcı: tarih seçicide saat satırı */
.dp-time { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 4px 0; border-top: 1px solid var(--divider); color: var(--text-2); }
.dp-time .material-symbols-outlined { font-size: 18px; }
.dp-time-label { flex: 1; font-size: 13px; }
.dp-time input { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg, #fff); color: var(--text); }
.remind-wrap { position: fixed; top: 72px; right: 16px; z-index: 450; display: flex; flex-direction: column; gap: 10px; width: 300px; max-width: calc(100vw - 32px); }
.remind-card { background: var(--surface, #fff); color: var(--text); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 12px 14px; border-left: 4px solid #fbbc04; animation: rcIn .2s ease; }
@keyframes rcIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.rc-head { display: flex; align-items: center; gap: 6px; color: #b06000; font-size: 13px; }
.rc-head .material-symbols-outlined { font-size: 18px; }
.rc-head .mini-btn { margin-left: auto; }
.rc-title { font-weight: 500; margin: 4px 0 2px; }
.rc-body { color: var(--text-2); font-size: 13px; white-space: pre-line; }
.rc-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }

/* Çöp kutusu */
.trash-btn { position: relative; color: var(--text-2); }
.trash-btn .trash-count { margin-left: auto; font-size: 12px; color: var(--text-3, #9aa0a6); }
.trash-modal { width: 620px; max-width: calc(100vw - 32px); }
.trash-info { color: var(--text-2); font-size: 13px; margin: 4px 0 12px; }
.trash-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.trash-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--divider); }
.trash-list li .text-btn { flex: none; }
.trash-list .tr-ic { color: var(--text-2); margin-top: 2px; }
.tr-main { flex: 1; min-width: 0; }
.tr-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-snip { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.tr-sub { color: var(--text-3, #9aa0a6); font-size: 12px; margin-top: 3px; }
.trash-empty { justify-content: center; color: var(--text-2); padding: 32px 0 !important; border: 0 !important; }
.trash-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.text-btn.danger { color: var(--danger); }

/* Sayfa simgesi */
.page-title-row { display: flex; align-items: center; gap: 6px; }
.page-title-row .page-title { flex: 1; min-width: 0; }
.page-icon-btn { flex: none; width: 40px; height: 40px; border: 0; background: none; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; font-size: 28px; line-height: 1; }
.page-icon-btn:hover { background: var(--hover); }
.page-icon-btn.empty { color: var(--text-3, #9aa0a6); opacity: 0; transition: opacity .15s; }
.page-icon-btn.empty .material-symbols-outlined { font-size: 22px; }
.page-head:hover .page-icon-btn.empty, .page-icon-btn.empty:focus { opacity: 1; }
.page-head.compact .page-icon-btn { display: none; }
.pg-icon.pg-img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.pl-icon { margin-right: 6px; font-size: 1.05em; }
.pl-icon.pg-img { width: 18px; height: 18px; object-fit: cover; border-radius: 4px; vertical-align: -4px; }
.icon-pop { width: 320px; padding: 10px; }
.ip-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; }
.ip-grid button { border: 0; background: none; font-size: 20px; padding: 4px 0; border-radius: 6px; cursor: pointer; line-height: 1.2; }
.ip-grid button:hover { background: var(--hover); }
.ip-foot { display: flex; justify-content: space-between; margin-top: 8px; border-top: 1px solid var(--divider); padding-top: 8px; }
.ip-foot .text-btn { display: inline-flex; align-items: center; gap: 6px; }
.ip-foot .text-btn .material-symbols-outlined { font-size: 18px; }
.ip-foot .muted { color: var(--text-2); }

/* Ses kaydı */
.rec-panel { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 420; width: 460px; max-width: calc(100vw - 24px);
  background: var(--surface, #fff); color: var(--text); border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,.22); padding: 12px 14px; }
.rec-top { display: flex; align-items: center; gap: 10px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #d93025; animation: recBlink 1.2s infinite; }
@keyframes recBlink { 50% { opacity: .3; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 500; }
.rec-title { color: var(--text-2); font-size: 13px; flex: 1; }
.rec-text { max-height: 140px; min-height: 44px; overflow: auto; margin: 8px 0; padding: 8px 10px; background: var(--hover); border-radius: 10px; font-size: 14px; line-height: 1.45; }
.rec-ph, .rec-interim { color: var(--text-3, #9aa0a6); }
.rec-note { color: #b06000; font-size: 12px; margin-bottom: 6px; }
.rec-note:empty { display: none; }
.rec-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rec-sum { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.rec-actions .filled-btn { display: inline-flex; align-items: center; gap: 6px; }
.rec-actions .filled-btn .material-symbols-outlined { font-size: 18px; }
body.recording .tb-btn[data-cmd="record"] { color: #d93025; }

/* ================= v12: kart renkleri temadan bağımsız ================= */
:root .box.colored, :root[data-theme] .box.colored, :root[data-theme] .canvas.flow .box.colored {
  background: var(--box-bg) !important; border-color: rgba(60,64,67,.14);
  color-scheme: light;
  --text: #202124; --text-2: #5f6368; --text-3: #9aa0a6; --primary: #1a73e8; --primary-soft: #e8f0fe;
  --hover: rgba(60,64,67,.08); --border: #dadce0; --divider: rgba(60,64,67,.12); --surface: #ffffff; --box-border: rgba(60,64,67,.2);
  --danger: #d93025;
  color: var(--text);
}
:root[data-theme] .box.colored .editor { color: var(--text); }
:root[data-theme] .box.colored.dark-card {
  color-scheme: dark;
  --text: #e3e3e3; --text-2: #a9adb3; --text-3: #7c8086; --primary: #8ab4f8; --primary-soft: #263449;
  --hover: rgba(255,255,255,.08); --border: #45484d; --divider: #3d4045; --surface: #28292c; --box-border: #45484d;
  --danger: #f28b82;
  border-color: #3d4045;
}
:root[data-theme] .box.colored.dark-card .editor { color: var(--text); }
.box.colored .box-handle { background: rgba(255,255,255,.45); }
.box.colored.dark-card .box-handle { background: rgba(255,255,255,.05); }
.box.colored .box-tool:hover { background: var(--hover); }
.box.colored .editor a { color: var(--primary); }
.swatch.dark { border-color: #5f6368; }

/* Sayfa simgesi araması */
.ip-search { display: flex; align-items: center; gap: 6px; padding: 4px 8px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 8px; }
.ip-search .material-symbols-outlined { font-size: 18px; color: var(--text-2); }
.ip-search input { flex: 1; border: 0; outline: 0; background: none; font: inherit; color: var(--text); padding: 4px 0; }
.ip-grid { max-height: 220px; overflow: auto; }
.ip-none { grid-column: 1 / -1; color: var(--text-2); font-size: 13px; padding: 12px 4px; text-align: center; }

/* Hatırlatıcı satırı: onay kutusu + saat */
.dp-rem { display: flex; align-items: center; gap: 6px; flex: 1; cursor: pointer; font-size: 13px; user-select: none; }
.dp-rem .dp-chk { margin: 0; width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.dp-time .dp-tm { opacity: .55; }
.dp-time.on { color: var(--text); }
.dp-time.on .dp-tm { opacity: 1; }

/* ================= v13 ================= */
/* Açılır düğmelerde küçük aşağı ok */
.tb-btn.has-caret { padding-right: 11px; }
.tb-btn .tb-caret { position: absolute; right: -1px; top: 50%; transform: translateY(-50%); font-size: 15px !important; width: 13px; overflow: hidden; color: var(--text-3); pointer-events: none; }
.tb-btn.has-caret:hover .tb-caret { color: var(--text-2); }
/* Yazı stili açılır listesi */
.nd-pop .pop-style { display: flex !important; align-items: center; gap: 10px; font-family: var(--app-font) !important; }
.nd-pop .pop-style .material-symbols-outlined { font-size: 19px; color: var(--text-2); }
.nd-pop .pop-style .ps-label { flex: 1; }
.nd-pop .pop-style .ps-key { color: var(--text-3); font-size: 12px; }
/* Madde işaretli listede tek görev */
.editor ul:not(.checklist) > li.task, .editor ol > li.task { position: relative; padding-left: 22px; }
.editor ul:not(.checklist) > li.task::before, .editor ol > li.task::before {
  content: ''; position: absolute; left: 0; top: .25em; width: 14px; height: 14px;
  border: 2px solid var(--text-2); border-radius: 3px; background: var(--surface); cursor: pointer;
}
.editor li.task.checked { color: var(--text-3); text-decoration: line-through; }
.editor ul:not(.checklist) > li.task.checked::before, .editor ol > li.task.checked::before {
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/12px no-repeat;
  border-color: var(--primary);
}
.tb-ius { display: inline-flex; gap: 1px; font-family: 'Inter', system-ui, sans-serif; font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: 0; }
.tb-ius i { font-family: Georgia, serif; font-style: italic; font-weight: 700; }
.tb-ius u, .tb-ius s { text-decoration-thickness: 1.5px; }

/* ================= v14: şifreli notlar ================= */
.box.locked .editor { cursor: pointer; min-height: 44px; }
.lock-ph { display: flex; align-items: center; gap: 8px; color: var(--text-2); padding: 6px 2px; font-size: .95em; user-select: none; }
.lock-ph .material-symbols-outlined { font-size: 20px; }
.box.locked:hover .lock-ph { color: var(--primary); }
.box.locked .tag-input, .box.locked .tag-chip button { display: none !important; }
.box.secret .box-handle::after { content: 'lock'; font-family: 'Material Symbols Outlined'; font-size: 13px; color: var(--text-3); margin-left: 4px; }
.box.secret:not(.locked) .box-handle::after { content: 'lock_open'; }
.tag-chip[title="#şifreli"] { font-weight: 600; }
.vault-btn.open { color: #188038; }
.lock-snip { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-style: italic; }
.lock-snip .material-symbols-outlined { font-size: 14px; }
.vault-box { width: 440px; max-width: calc(100vw - 32px); padding: 22px 24px 18px; }
.vault-box.busy { opacity: .7; cursor: progress; }
.vault-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.vault-head h2 { margin: 0; font-size: 1.3em; font-weight: 500; }
.vault-head .material-symbols-outlined { color: var(--primary); font-size: 26px; }
.vault-text { color: var(--text-2); font-size: 13.5px; line-height: 1.5; margin: 6px 0 14px; }
.vault-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 13px; color: var(--text-2); }
.vault-field input { font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.vault-field input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.vault-err { color: var(--danger); font-size: 13px; min-height: 18px; }
.vault-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.vault-actions .muted { color: var(--text-2); }
.vault-code { font-family: 'Source Code Pro', ui-monospace, monospace; font-size: 17px; letter-spacing: .04em; background: var(--hover); border-radius: 8px; padding: 12px 14px; text-align: center; user-select: all; margin-bottom: 6px; word-break: break-all; }
.vault-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 12px 0 4px; cursor: pointer; }
.vault-box .text-btn { display: inline-flex; align-items: center; gap: 6px; }
.vault-box .text-btn .material-symbols-outlined { font-size: 17px; }

/* ================= v15 ================= */
.toolbar .tb-btn[data-cmd="record"] { color: #d93025; }
.toolbar .tb-btn[data-cmd="record"]:hover { background: rgba(217,48,37,.1); }
.toolbar .tb-btn[data-cmd="image"] .material-symbols-outlined {
  background: linear-gradient(135deg, #f28b82 0%, #fbbc04 35%, #81c995 65%, #8ab4f8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- v16: tablo ---------- */
.editor table.nd-table, .editor table { border-collapse: collapse; width: 100%; table-layout: fixed; margin: 4px 0; }
.editor table td, .editor table th { border: 1px solid var(--border, #dadce0); padding: 4px 8px; vertical-align: top; min-width: 40px; word-break: break-word; }
.box.dark-card .editor table td { border-color: rgba(255,255,255,.25); }

/* ---------- v16: paylaşım ---------- */
.page-head .share-btn { position: absolute; right: 56px; top: 14px; }
.share-btn.on { color: var(--primary); }
.share-btn.on .material-symbols-outlined { font-variation-settings: 'FILL' 1; }
.page-head:has(.share-btn:not([hidden])) .page-title { width: calc(100% - 96px); }
.share-link { display: flex; gap: 8px; align-items: center; margin: 4px 0 6px; }
.share-link input { flex: 1; min-width: 0; font: inherit; font-size: 13.5px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--hover); color: var(--text); }
.share-box .filled-btn { display: inline-flex; align-items: center; gap: 6px; }
.share-box .filled-btn .material-symbols-outlined { font-size: 17px; }
@media (max-width: 760px) { .page-head .share-btn { right: 44px; top: 6px; } }
.editor table th { border: 1px solid var(--border, #dadce0); padding: 4px 8px; vertical-align: top; text-align: left; font-weight: 600; background: rgba(0,0,0,.05); }
.box.dark-card .editor table th { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); }
body.col-resize .editor table td, body.col-resize .editor table th, body.col-resizing, body.col-resizing * { cursor: col-resize !important; }
body.col-resizing { user-select: none; }
