/* ЧИТАЛКА ЗАПИСЕЙ (04.10.2026) — запись дня так, как в Obsidian; и редактор в духе iA Writer */

.nv {
    --nv-ink: #dcddde;
    --nv-mute: #8a8f98;
    --nv-faint: rgba(255, 255, 255, .07);
    --nv-acc: #e8b04b;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    font-size: 14.5px; line-height: 1.62; color: var(--nv-ink);
    letter-spacing: 0; text-transform: none; word-wrap: break-word; overflow-wrap: anywhere;
}
.nv > :first-child { margin-top: 0; }
.nv p { margin: .55em 0; }
.nv .nv-h { font-weight: 650; line-height: 1.3; margin: 1.15em 0 .45em; color: #f2f2f3; letter-spacing: 0; text-transform: none; }
.nv h1.nv-h { font-size: 1.55em; }
.nv h2.nv-h { font-size: 1.3em; }
.nv h3.nv-h { font-size: 1.14em; }
.nv h4.nv-h, .nv h5.nv-h, .nv h6.nv-h { font-size: 1em; color: var(--nv-mute); }
.nv b { font-weight: 650; color: #f2f2f3; }
.nv mark { background: rgba(232, 176, 75, .28); color: inherit; border-radius: 2px; padding: 0 2px; }
.nv code { font-family: 'iA Writer Mono V', ui-monospace, monospace; font-size: .88em; background: var(--nv-faint); border-radius: 4px; padding: 1px 5px; }
.nv .nv-code { background: rgba(0, 0, 0, .35); border: 1px solid var(--nv-faint); border-radius: 6px; padding: 10px 12px; overflow: auto; }
.nv .nv-code code { background: none; padding: 0; }
.nv a { color: #7aa7ff; text-decoration: none; border-bottom: 1px solid rgba(122, 167, 255, .35); }
.nv .nv-link { color: #a88bfa; border-bottom: 1px solid rgba(168, 139, 250, .3); }
.nv .nv-day { cursor: pointer; }
.nv .nv-day:hover { color: #c4b2ff; border-bottom-color: #c4b2ff; }
.nv .nv-tag { color: #b8a2ff; background: rgba(168, 139, 250, .12); border-radius: 10px; padding: 0 7px; font-size: .9em; }
.nv hr { border: none; border-top: 1px solid rgba(255, 255, 255, .12); margin: 1.3em 0; }
.nv ul, .nv ol { margin: .45em 0; padding-left: 1.45em; }
.nv li { margin: .18em 0; }
.nv li::marker { color: var(--nv-mute); }
.nv .nv-task { list-style: none; margin-left: -1.3em; }
.nv .nv-cb {
    display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-right: 7px;
    border: 1.5px solid var(--nv-mute); border-radius: 3px; font-size: 10px; vertical-align: -2px; color: #111;
}
.nv .nv-task.done .nv-cb { background: var(--nv-acc); border-color: var(--nv-acc); }
.nv .nv-task.done { color: var(--nv-mute); text-decoration: line-through; }
.nv blockquote { margin: .6em 0; padding: .1em 0 .1em 1em; border-left: 3px solid rgba(255, 255, 255, .18); color: #c9cbcf; }
.nv .nv-tw { overflow-x: auto; margin: .7em 0; }
.nv table { border-collapse: collapse; font-size: .94em; }
.nv th, .nv td { border: 1px solid rgba(255, 255, 255, .12); padding: 4px 9px; text-align: left; vertical-align: top; }
.nv th { background: var(--nv-faint); font-weight: 600; }

/* картинки: подряд стоящие ![[…|110]] ложатся рядом, как в Obsidian */
.nv .nv-img { max-width: 100%; height: auto; border-radius: 6px; vertical-align: top; margin: 2px 2px 2px 0; display: inline-block; }
.nv .nv-photos { display: flex; flex-wrap: wrap; gap: 4px; margin: .4em 0; }
.nv .nv-photos .nv-img { width: 110px; height: 110px; object-fit: cover; margin: 0; }
.nv .nv-miss { display: inline-block; font-size: .82em; color: var(--nv-mute); background: var(--nv-faint); border-radius: 4px; padding: 1px 6px; margin: 1px 2px; }
.nv .nv-embed { color: var(--nv-mute); font-style: italic; }

/* выноски */
.nv .nv-co {
    --c: 138, 143, 152;
    margin: .7em 0; border-radius: 6px; border-left: 3px solid rgb(var(--c));
    background: rgba(var(--c), .08); padding: 7px 12px;
}
.nv .nv-co--blue { --c: 102, 153, 255; }
.nv .nv-co--cyan { --c: 83, 196, 214; }
.nv .nv-co--green { --c: 84, 189, 120; }
.nv .nv-co--amber { --c: 232, 176, 75; }
.nv .nv-co--red { --c: 233, 98, 98; }
.nv .nv-co--violet { --c: 168, 139, 250; }
.nv .nv-co--gray { --c: 138, 143, 152; }
.nv .nv-co > summary, .nv .nv-co-h { display: flex; align-items: baseline; gap: 7px; font-weight: 600; color: rgb(var(--c)); cursor: default; }
.nv details.nv-co > summary { cursor: pointer; list-style: none; }
.nv details.nv-co > summary::-webkit-details-marker { display: none; }
.nv details.nv-co > summary::after { content: '›'; margin-left: auto; color: rgba(var(--c), .7); transition: transform .15s; }
.nv details.nv-co[open] > summary::after { transform: rotate(90deg); }
.nv .nv-co-i { flex: none; width: 1.1em; text-align: center; }
.nv .nv-co-t { min-width: 0; }
.nv .nv-co-b { margin-top: .35em; }
.nv .nv-co-b > :first-child { margin-top: 0; }
.nv .nv-co-b > :last-child { margin-bottom: 0; }
.nv .nv-co .nv-co { margin: .5em 0; }

/* свойства — свёрнутой строкой сверху */
.nv .nv-props { margin: 0 0 1em; font-size: .86em; color: var(--nv-mute); border-bottom: 1px solid var(--nv-faint); padding-bottom: .6em; }
.nv .nv-props > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; cursor: pointer; list-style: none; }
.nv .nv-props > summary::-webkit-details-marker { display: none; }
.nv .nv-pl { color: var(--nv-mute); }
.nv .nv-pc { background: var(--nv-faint); border-radius: 10px; padding: 1px 8px; }
.nv .nv-pc b { color: #e6e6e6; font-weight: 500; }
.nv .nv-pb { margin-top: .5em; display: grid; gap: 2px; }
.nv .nv-pr { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; }
.nv .nv-pr > span:first-child { color: var(--nv-mute); }

/* светлая тема Играя */
html[data-theme="light"] .nv { --nv-ink: #2b2b2b; --nv-mute: #6b6f76; --nv-faint: rgba(0, 0, 0, .06); }
html[data-theme="light"] .nv .nv-h, html[data-theme="light"] .nv b { color: #111; }

/* ── окно «целиком» для дневника: чтение как в Obsidian, правка как в iA Writer ── */
.matrix-viewer.nv-mode .matrix-viewer-content {
    max-width: 920px; background: #151617; color: #dcddde;
    border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.matrix-viewer.nv-mode .matrix-viewer-content::before { display: none; }
.matrix-viewer.nv-mode .matrix-viewer-backdrop { background: rgba(0, 0, 0, .55); }
.matrix-viewer.nv-mode .matrix-viewer-head { background: transparent; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.matrix-viewer.nv-mode .mv-path { color: #8a8f98; text-shadow: none; font-family: -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: 0; }
.matrix-viewer.nv-mode .mv-meta { color: #6b6f76; }
.matrix-viewer.nv-mode .mv-close, .matrix-viewer.nv-mode .mv-edit, .matrix-viewer.nv-mode .mv-save {
    color: #c9cbcf; border-color: rgba(255, 255, 255, .16); border-radius: 6px; box-shadow: none;
}
.matrix-viewer.nv-mode .mv-save { background: rgba(31, 163, 255, .14); color: #8cc8ff; letter-spacing: 1px; }
.matrix-viewer.nv-mode .matrix-viewer-body { display: none; }
.matrix-viewer.nv-mode .mv-read { flex: 1 1 auto; overflow-y: auto; padding: 26px max(28px, calc((100% - 700px) / 2)) 60px; }
.matrix-viewer.nv-mode .mv-read[hidden] { display: none; }
/* iA Writer: моно, крупно, воздух, одна синяя каретка — без второго мигающего блока внизу */
.matrix-viewer.nv-mode .matrix-editor-body {
    font-family: 'iA Writer Mono V', ui-monospace, monospace; font-size: 16px; line-height: 1.8;
    color: #e4e4e4; background: transparent; caret-color: #1fa3ff; text-shadow: none;
    padding: 30px max(48px, calc((100% - 680px) / 2)) 60px;
}
.matrix-viewer.nv-mode .matrix-editor-body::selection { background: rgba(31, 163, 255, .28); color: #fff; }
.matrix-viewer.nv-mode .mv-cursor { display: none; }
.matrix-viewer.nv-mode .matrix-viewer-foot { background: transparent; border-top: 1px solid rgba(255, 255, 255, .07); color: #6b6f76; letter-spacing: .3px; font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
.matrix-viewer.nv-mode .mv-hint kbd { font: inherit; background: rgba(255, 255, 255, .08); border-radius: 4px; padding: 0 5px; color: #c9cbcf; }
.matrix-viewer.nv-mode .mv-editwrap { position: relative; flex: 1 1 auto; display: flex; min-height: 0; }
.matrix-viewer.nv-mode .mv-editwrap .matrix-editor-body { flex: 1 1 auto; }
/* ◷ слева у пустой строки — отметка воспоминания «## 4 окт. 2026, 22:55» */
.mv-stamp {
    position: absolute; left: 0; width: 26px; height: 26px; display: none; align-items: center; justify-content: center;
    border: 1px solid rgba(31, 163, 255, .45); border-radius: 50%; background: rgba(31, 163, 255, .1);
    color: #8cc8ff; font-size: 13px; cursor: pointer; padding: 0; transform: translateY(-50%);
    transition: background .15s, transform .15s;
}
.mv-stamp.on { display: inline-flex; }
.mv-stamp:hover { background: rgba(31, 163, 255, .25); transform: translateY(-50%) scale(1.08); }
@media (max-width: 640px) {
    .matrix-viewer.nv-mode .mv-read { padding: 18px 16px 50px; }
    .matrix-viewer.nv-mode .matrix-editor-body { padding: 18px 16px 50px 40px; font-size: 15px; }
}
