/* ======================= заметки в стиле Notion ======================= */
.blocks { position: relative; padding: 14px 14px 18px 36px; }
.blk { position: relative; display: flex; align-items: flex-start; gap: 4px; padding-top: 1px; padding-bottom: 1px; }
.blk-handle { flex: none; width: 22px; height: 28px; margin-left: -26px; border: 0; background: none; color: var(--muted); cursor: grab; opacity: 0; font-size: 12px; letter-spacing: -3px; padding: 0; touch-action: none; border-radius: 6px; user-select: none; -webkit-user-select: none; }
.blk:hover .blk-handle, .blk-handle:focus-visible { opacity: 1; }
.blk-handle:hover { background: var(--surface2); }
@media (hover: none) { .blk-handle { opacity: .4; } }
.blk-ed { flex: 1; min-width: 0; outline: none; padding: 4px 6px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; border-radius: 6px; min-height: 30px; }
.blk-ed:empty:focus::before { content: attr(data-ph); color: var(--muted); opacity: .7; pointer-events: none; }
.blk-h1 .blk-ed { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 14px; line-height: 1.25; }
.blk-h2 .blk-ed { font-size: 24px; font-weight: 650; margin-top: 10px; line-height: 1.3; }
.blk-h3 .blk-ed { font-size: 19px; font-weight: 650; margin-top: 6px; }
.blk-quote .blk-ed { border-left: 3px solid var(--text); padding-left: 14px; font-size: 1.05em; }
.blk-callout { background: var(--surface2); border-radius: 10px; padding-top: 8px; padding-bottom: 8px; margin: 3px 0; }
.blk-pre { flex: none; width: 24px; text-align: center; padding-top: 4px; color: var(--muted); border: 0; background: none; font-size: inherit; cursor: default; }
.blk-pre.num { width: 28px; font-variant-numeric: tabular-nums; }
.blk-pre.tg, .blk-pre.call-ic { cursor: pointer; }
.blk-pre.call-ic { font-size: 20px; padding-top: 2px; }
.blk-check { width: 19px; height: 19px; margin: 8px 4px 0 3px; flex: none; accent-color: var(--accent); }
.blk.done .blk-ed { text-decoration: line-through; color: var(--muted); }
.blk hr { flex: 1; border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.blk-ed a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.blk-ed a.plink { text-decoration: none; background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 6px; padding: 0 5px; cursor: pointer; }
.blk-ed code { background: var(--surface2); color: var(--danger); border-radius: 5px; padding: 1px 5px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
.c-red { color: #e5484d; } .c-orange { color: #f76808; } .c-yellow { color: #ca8a04; } .c-green { color: #2f9e66; } .c-blue { color: #3b82f6; } .c-purple { color: #8b5cf6; } .c-gray { color: var(--muted); }
.bg-red { background: rgba(229, 72, 77, .22); } .bg-orange { background: rgba(247, 104, 8, .22); } .bg-yellow { background: rgba(245, 190, 20, .3); } .bg-green { background: rgba(47, 158, 102, .24); } .bg-blue { background: rgba(59, 130, 246, .24); } .bg-purple { background: rgba(139, 92, 246, .24); } .bg-gray { background: rgba(128, 128, 140, .26); }
.code-wrap { flex: 1; min-width: 0; position: relative; background: var(--surface2); border-radius: 10px; padding: 8px 10px; }
.code-lang { position: absolute; top: 6px; right: 8px; width: 90px; min-height: 26px; padding: 2px 8px; font-size: 12px; border-radius: 8px; }
.blk-code { display: block; width: 100%; border: 0; background: transparent; padding: 18px 0 0; min-height: 60px; resize: none; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; white-space: pre; overflow: auto; border-radius: 0; }
.blk-code:focus { border: 0; }
.img-wrap { flex: 1; min-width: 0; }
.img-wrap img { max-width: 100%; border-radius: 10px; display: block; }
.img-cap { border: 0; background: transparent; font-size: 13px; color: var(--muted); padding: 4px 2px; min-height: 28px; }
.img-add { flex: 1; display: flex; gap: 8px; align-items: center; background: var(--surface2); border-radius: 10px; padding: 8px 10px; }
.img-add input { background: transparent; border: 0; min-height: 36px; }
.page-link { flex: 1; display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; cursor: pointer; text-align: left; }
.page-link:hover { background: var(--surface2); }
.drop-line { position: absolute; left: 36px; right: 14px; height: 3px; background: var(--accent); border-radius: 2px; pointer-events: none; z-index: 5; }
.blk.dragging { opacity: .3; }
.blk-ghost { position: fixed; z-index: 80; pointer-events: none; opacity: .92; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); padding-left: 8px !important; }

.fmt-bar { position: fixed; z-index: 70; display: flex; gap: 2px; background: #20232f; color: #fff; border-radius: 10px; padding: 4px; box-shadow: var(--shadow); }
.fmt-bar[hidden] { display: none; }
.tb-btn { border: 0; background: none; color: #fff; min-width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.tb-btn:hover { background: rgba(255, 255, 255, .14); }
.tb-btn.b { font-weight: 800; } .tb-btn.i { font-style: italic; } .tb-btn.u { text-decoration: underline; } .tb-btn.s { text-decoration: line-through; }
.tb-btn.color { color: #fb923c; font-weight: 700; }

.popup-item { display: flex; align-items: center; gap: 10px; }
.popup-item .pi { width: 24px; text-align: center; flex: none; color: var(--muted); }
.popup-item small { margin-left: auto; color: var(--muted); font-size: 12px; padding-left: 12px; }
.popup-item.active { background: var(--surface2); }
.popup.slash { min-width: 300px; }
.emoji-pop { width: 320px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 4px; }
.emoji { border: 0; background: none; font-size: 20px; height: 34px; border-radius: 8px; cursor: pointer; }
.emoji:hover { background: var(--surface2); }

.cover { position: relative; height: 170px; border-radius: 16px; margin-bottom: 4px; background: linear-gradient(135deg, #a78bfa, #60a5fa); }
.cover-btn { position: absolute; right: 10px; bottom: 10px; border: 0; background: rgba(0, 0, 0, .4); color: #fff; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; opacity: 0; transition: opacity .15s; }
.cover:hover .cover-btn { opacity: 1; }
@media (hover: none) { .cover-btn { opacity: 1; } }
.cover-g1 { background: linear-gradient(135deg, #f97316, #ec4899); } .cover-g2 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.cover-g3 { background: linear-gradient(135deg, #22c55e, #0d9488); } .cover-g4 { background: linear-gradient(135deg, #a78bfa, #f0abfc); }
.cover-g5 { background: linear-gradient(135deg, #fde68a, #fdba74); } .cover-g6 { background: linear-gradient(135deg, #1e1b4b, #4338ca); }
.cover-g7 { background: linear-gradient(135deg, #fda4af, #fb7185); } .cover-g8 { background: linear-gradient(135deg, #374151, #6b7280); }
.ws-titlebar.with-cover { margin-top: -30px; padding-left: 10px; position: relative; }
.ws-page.font-serif { font-family: Georgia, "Times New Roman", serif; }
.ws-page.font-mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.ws-page .ws-title { font-family: inherit; }
.ws-small .blk-ed { font-size: 14px; }
.backdrop.finder { align-items: flex-start; }
.finder-sheet { margin: 10vh auto 0; border-radius: 16px; max-width: 560px; max-height: 70vh; }
.trash-actions { display: flex; gap: 14px; }
@media (min-width: 900px) { .ws-page.ws-fullw { max-width: none; } }
