/* Taskioo — notes (Confluence-like wiki): page tree, page view, editor, rich text, overviews. Uses the tokens of app.css. */
.content.notes-wide { max-width: none; padding: 0; }
.nv { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: calc(100dvh - 70px); }
.nv-tree { position: sticky; top: 0; align-self: start; height: calc(100dvh - 70px); overflow: auto; border-right: 1px solid var(--line); padding: 2px 8px 12px; display: flex; flex-direction: column; gap: 1px; background: color-mix(in srgb, var(--canvas) 35%, var(--panel)); }
.nv-main { min-width: 0; padding: 0 44px 120px; }
.nv-scrim, .nv-treebtn { display: none; }

/* ---------- page tree ---------- */
.nt-head { padding: 4px 0 6px; }
.nt-space { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px; border-radius: 8px; font-weight: 600; font-size: 14px; text-align: left; }
.nt-space:hover { background: var(--hover); }
.nt-space-ico, .space-av { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000)); }
.space-av.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 22px; }
.space-av.lg svg { width: 24px; height: 24px; }
.nt-link { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 8px; border-radius: 7px; color: var(--ink-2); font-size: 13.5px; text-decoration: none !important; }
.nt-link svg { color: var(--muted); }
.nt-link:hover { background: var(--hover); color: var(--ink); }
.nt-link.active { background: var(--active); color: var(--ink); font-weight: 550; }
.nt-sec { display: flex; align-items: center; height: 30px; padding: 0 2px 0 8px; margin-top: 10px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.nt-sec .icon-btn { width: 24px; height: 24px; }
.nt-search { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; padding: 0 8px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--raised); color: var(--muted); }
.nt-search input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; font-size: 13px; color: var(--ink); }
.nt-list { flex: 1; }
.nt-row { position: relative; display: flex; align-items: center; height: 30px; padding-left: calc(var(--d) * 14px); border-radius: 7px; font-size: 13.5px; color: var(--ink-2); }
.nt-row:hover { background: var(--hover); color: var(--ink); }
.nt-row.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 550; }
.nt-row.draft .nt-a { font-style: italic; color: var(--muted); }
.nt-row.dragging { opacity: .4; }
.nt-row.drop-in { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.nt-row.drop-before::before, .nt-row.drop-after::after { content: ""; position: absolute; left: calc(var(--d) * 14px + 22px); right: 4px; height: 2px; background: var(--accent); border-radius: 2px; }
.nt-row.drop-before::before { top: -1px; }
.nt-row.drop-after::after { bottom: -1px; }
.nt-caret { width: 20px; height: 22px; display: grid; place-items: center; color: var(--faint); border-radius: 5px; flex: none; transition: transform .12s; }
.nt-caret:hover { background: var(--active); color: var(--ink); }
.nt-caret.closed { transform: rotate(-90deg); }
.nt-caret.empty { visibility: hidden; }
.nt-a { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; height: 100%; color: inherit; text-decoration: none !important; padding-right: 4px; }
.nt-ico { width: 16px; display: grid; place-items: center; color: var(--muted); flex: none; }
.nt-ico .emo, .ncard-ico .emo, .nline .emo, .menu-item .emo { font-size: 14px; line-height: 1; }
.nt-btn { width: 22px; height: 22px; display: none; place-items: center; border-radius: 5px; color: var(--muted); flex: none; }
.nt-btn:hover { background: var(--active); color: var(--ink); }
.nt-row:hover .nt-btn { display: grid; }
.nt-badge { font-size: 10.5px; font-style: normal; font-weight: 600; color: var(--tomorrow); background: color-mix(in srgb, var(--tomorrow) 14%, transparent); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.nt-empty { color: var(--muted); font-size: 12.5px; padding: 6px 10px; }
.nt-foot { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 8px; }

/* ---------- page ---------- */
.pg-top { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 0; }
.pg-crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; }
.pg-crumbs a { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.pg-crumbs a:hover { color: var(--ink); }
.pg-crumbs span { flex: none; }
.pg-acts { display: flex; align-items: center; gap: 4px; flex: none; }
.icon-btn.star-on { color: #f5b000; background: color-mix(in srgb, #f5b000 14%, transparent); }
.icon-btn.star-on svg { fill: currentColor; }
.pg { max-width: 780px; margin: 0 auto; }
.pg.full { max-width: none; }
.pg-head { margin: 18px 0 22px; }
.pg-emoji { font-size: 44px; line-height: 1.1; border-radius: 10px; padding: 2px 4px; margin-left: -4px; }
.pg-emoji:hover { background: var(--hover); }
.pg-emoji.empty { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; opacity: 0; transition: opacity .15s; }
.pg:hover .pg-emoji.empty, .pg.editing .pg-emoji.empty { opacity: 1; }
.pg-title { font-size: 34px; line-height: 1.2; font-weight: 700; letter-spacing: -.028em; margin: 4px 0 10px; overflow-wrap: anywhere; }
.pg-by { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pg-ver { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; }
.pg-ver:hover { background: var(--hover); color: var(--ink); }
.pg-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: color-mix(in srgb, var(--tomorrow) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tomorrow) 28%, transparent); border-radius: 10px; padding: 8px 10px 8px 12px; margin: 10px 0; font-size: 13px; }
.pg-banner.warn { background: color-mix(in srgb, var(--danger) 9%, transparent); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.pg-blank a { text-decoration: underline; }
.pg-kids { margin: 26px 0 0; padding: 12px 10px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 1px; }
.pg-kids-h { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 8px 6px; display: flex; gap: 6px; align-items: center; }
.child-l { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; color: var(--ink) !important; text-decoration: none !important; font-size: 14px; text-align: left; width: 100%; }
.child-l:hover { background: var(--hover); }
.child-l svg { color: var(--muted); }
.child-l.add { color: var(--muted) !important; font-size: 13px; }
.pg-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 26px 0 0; color: var(--muted); }
.pg-label { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 4px 0 9px; border-radius: 12px; background: var(--hover); font-size: 12.5px; }
.pg-label a { color: var(--ink-2); }
.pg-label button { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); opacity: 0; }
.pg-label:hover button { opacity: 1; }
.pg-label button:hover { background: var(--active); }
.pg-label.add { padding: 0 9px; color: var(--muted); background: transparent; border: 1px dashed var(--line); gap: 4px; }
.pg-label.add:hover { color: var(--ink); border-color: var(--faint); }
.pg-comments { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 18px; }
.pg-comments h3 { font-size: 15px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.pg-comments .comment-box textarea { min-height: 56px; }

/* ---------- edit mode ---------- */
.pg-edit-bar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); margin: 0 -44px 6px; padding: 6px 44px; }
.rt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rt-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; flex: 1; min-width: 0; }
.rt-tools-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pg-status { font-size: 12px; white-space: nowrap; }
.tb { height: 30px; min-width: 30px; padding: 0 6px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: var(--ink-2); flex: none; }
.tb:hover { background: var(--hover); color: var(--ink); }
.tb.on { background: var(--accent-soft); color: var(--accent-ink); }
.tb-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; flex: none; }
.tb-style { min-width: 100px; justify-content: space-between; font-size: 13px; font-weight: 550; }
.tb-plus span { font-size: 12.5px; font-weight: 550; }
.rt-ctx { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 0 2px; border-top: 1px dashed var(--line); }
.rt-ctx button { font-size: 12px; height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--raised); color: var(--ink-2); }
.rt-ctx button:hover { background: var(--hover); color: var(--ink); }
.rt-ctx button.dz { color: var(--danger); }
.pg-edit-meta { display: flex; align-items: center; gap: 4px; margin: 18px 0 2px; min-height: 30px; }
.pg-meta-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); padding: 4px 8px; border-radius: 7px; }
.pg-meta-btn:hover { background: var(--hover); color: var(--ink); }
.pg-title-in { width: 100%; border: 0; outline: none; resize: none; background: transparent; font-size: 34px; line-height: 1.2; font-weight: 700; letter-spacing: -.028em; padding: 0; margin: 4px 0 14px; overflow: hidden; color: var(--ink); }
.pg-title-in::placeholder { color: var(--faint); }
.rt-edit { outline: none; min-height: 55vh; position: relative; padding-bottom: 40px; caret-color: var(--accent); }
.rt-edit.is-empty::before { content: attr(data-ph); position: absolute; left: 0; top: 0; color: var(--faint); pointer-events: none; }
.rt-edit div[data-macro] { border: 1px dashed var(--faint); border-radius: 9px; padding: 10px 14px; color: var(--muted); font-size: 13px; background: var(--canvas); cursor: pointer; user-select: none; margin: 8px 0 14px; }
.rt-edit div[data-macro="toc"]::before { content: "📑 Obsah stránky – vytvoří se automaticky z nadpisů"; }
.rt-edit div[data-macro="children"]::before { content: "🗂️ Přehled podstránek – zobrazí odkazy na podstránky"; }
.rt-edit img { cursor: pointer; }
.rt-edit img:hover { outline: 2px solid var(--accent); outline-offset: 2px; }
.rt-edit a[data-task], .rt-edit a[data-note] { cursor: pointer; }
.rt-edit a[data-task] { display: inline-flex; gap: 5px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; text-decoration: none; color: var(--ink); background: var(--raised); font-size: .93em; }
.rt-edit a[data-task]::before { content: ""; width: 11px; height: 11px; border: 1.5px solid var(--p4); border-radius: 50%; }
.rt-edit a[data-note]::before { content: "📄"; font-size: .85em; margin-right: 3px; }
.rt-edit span[data-status], .rt-edit span[data-date] { cursor: pointer; }
.rt-uploading { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); background: var(--hover); border-radius: 6px; padding: 2px 8px; }

/* editor popovers */
.tbl-grid { display: grid; grid-template-columns: repeat(8, 20px); gap: 3px; padding: 8px 8px 4px; }
.tbl-grid i { width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.tbl-grid i.on { background: var(--accent-soft); border-color: var(--accent); }
.tbl-lbl { font-size: 12px; padding: 2px 8px 6px; text-align: center; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 4px; }
.emoji-grid button { font-size: 20px; height: 32px; border-radius: 6px; }
.emoji-grid button:hover, .emoji-grid button.on { background: var(--hover); }
.color-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cdot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); }
.cdot:hover { box-shadow: 0 0 0 2px var(--accent-soft); }
.cdot i { width: 16px; height: 16px; border-radius: 50%; --c: #a1a1aa; }
.cdot[data-kind="text"] i { background: var(--c); }
.cdot[data-kind="bg"] i, .cdot[data-kind="cell"] i { background: color-mix(in srgb, var(--c) 28%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.cdot i[data-color="red"] { --c: #e5484d; } .cdot i[data-color="orange"] { --c: #f76b15; } .cdot i[data-color="yellow"] { --c: #f5b000; }
.cdot i[data-color="green"] { --c: #30a46c; } .cdot i[data-color="teal"] { --c: #12a5b8; } .cdot i[data-color="blue"] { --c: #3e63dd; }
.cdot i[data-color="violet"] { --c: #8e4ec6; } .cdot i[data-color="pink"] { --c: #d6409f; } .cdot i[data-color="grey"] { --c: #a1a1aa; }
.status-pick { border-radius: 6px; padding: 3px; border: 1.5px solid transparent; }
.status-pick.on { border-color: var(--accent); }
.panel-ico { display: grid; place-items: center; }
.panel-ico[data-p="info"] { color: #3e63dd; } .panel-ico[data-p="note"] { color: #8e4ec6; } .panel-ico[data-p="success"] { color: #30a46c; } .panel-ico[data-p="warning"] { color: #f08c00; } .panel-ico[data-p="error"] { color: #e5484d; }

/* ---------- rich text (read & edit) ---------- */
.rt { font-size: 15px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.rt-view { overflow-x: auto; }
.rt > :first-child { margin-top: 0; }
.rt p { margin: 0 0 10px; }
.rt h1, .rt h2, .rt h3, .rt h4 { line-height: 1.3; font-weight: 650; letter-spacing: -.018em; scroll-margin-top: 16px; }
.rt h1 { font-size: 25px; margin: 30px 0 10px; }
.rt h2 { font-size: 20.5px; margin: 26px 0 8px; }
.rt h3 { font-size: 17px; margin: 22px 0 6px; }
.rt h4 { font-size: 15px; margin: 18px 0 6px; }
.rt ul, .rt ol { margin: 0 0 10px; padding-left: 26px; }
.rt li { margin: 3px 0; }
.rt li > p { margin: 0; }
.rt li > ul, .rt li > ol { margin: 2px 0 0; }
.rt ul[data-type="task"] { list-style: none; padding-left: 2px; }
.rt ul[data-type="task"] li { position: relative; padding-left: 28px; }
.rt ul[data-type="task"] li::before { content: ""; position: absolute; left: 2px; top: .3em; width: 17px; height: 17px; box-sizing: border-box; border: 1.5px solid var(--faint); border-radius: 5px; background: var(--raised); cursor: pointer; transition: background .12s, border-color .12s; }
.rt ul[data-type="task"] li:hover::before { border-color: var(--accent); }
.rt ul[data-type="task"] li[data-checked="true"]::before { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat; }
.rt ul[data-type="task"] li[data-checked="true"] { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.rt blockquote { margin: 12px 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--line); color: var(--ink-2); }
.rt blockquote > :last-child { margin-bottom: 0; }
.rt pre { position: relative; background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 12px; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-x: auto; tab-size: 2; }
.rt pre[data-lang]::after { content: attr(data-lang); position: absolute; right: 10px; bottom: 6px; font-size: 10.5px; color: var(--faint); font-family: var(--font); }
.rt code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .87em; background: var(--hover); border-radius: 5px; padding: 1px 5px; }
.rt pre code { background: none; padding: 0; font-size: inherit; }
.pre-copy { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; background: var(--raised); border: 1px solid var(--line); color: var(--muted); opacity: 0; transition: opacity .12s; }
.rt pre:hover .pre-copy { opacity: 1; }
.rt hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.rt a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
.rt img { max-width: 100%; height: auto; border-radius: 8px; margin: 6px 0; vertical-align: middle; }
.rt p > img:only-child { display: block; }
.rt-view img { cursor: zoom-in; }
.rt img[data-width="25"] { width: 25%; } .rt img[data-width="50"] { width: 50%; } .rt img[data-width="75"] { width: 75%; } .rt img[data-width="100"] { width: 100%; }
.rt table { border-collapse: collapse; min-width: 100%; margin: 4px 0 14px; font-size: 14px; line-height: 1.5; }
.rt th, .rt td { border: 1px solid var(--line); padding: 7px 10px; vertical-align: top; text-align: left; min-width: 56px; }
.rt th { background: color-mix(in srgb, var(--canvas) 80%, var(--raised)); font-weight: 600; }
.rt td > :last-child, .rt th > :last-child { margin-bottom: 0; }
.rt [data-bg] { --c: #a1a1aa; background: color-mix(in srgb, var(--c) 15%, transparent); }
.rt [data-color] { --c: #8b8b92; }
.rt span[data-color] { color: var(--c); }
.rt mark { --c: #f5b000; color: inherit; border-radius: 3px; padding: 0 2px; background: color-mix(in srgb, var(--c) 28%, transparent); }
.rt [data-color="red"], .rt [data-bg="red"] { --c: #e5484d; } .rt [data-color="orange"], .rt [data-bg="orange"] { --c: #f76b15; }
.rt [data-color="yellow"], .rt [data-bg="yellow"] { --c: #e0a100; } .rt [data-color="green"], .rt [data-bg="green"] { --c: #30a46c; }
.rt [data-color="teal"], .rt [data-bg="teal"] { --c: #12a5b8; } .rt [data-color="blue"], .rt [data-bg="blue"] { --c: #3e63dd; }
.rt [data-color="violet"], .rt [data-bg="violet"] { --c: #8e4ec6; } .rt [data-color="pink"], .rt [data-bg="pink"] { --c: #d6409f; }
.rt [data-color="grey"], .rt [data-bg="grey"] { --c: #8b8b92; }
.rt [data-panel] { position: relative; border-radius: 10px; padding: 11px 16px 11px 44px; margin: 12px 0; --pc: #3e63dd; background: color-mix(in srgb, var(--pc) 9%, transparent); border: 1px solid color-mix(in srgb, var(--pc) 22%, transparent); }
.rt [data-panel]::before { content: ""; position: absolute; left: 15px; top: 14px; width: 18px; height: 18px; background: var(--pc); -webkit-mask: var(--pi) center/18px no-repeat; mask: var(--pi) center/18px no-repeat; }
.rt [data-panel] > :last-child { margin-bottom: 0; }
.rt [data-panel="info"] { --pc: #3e63dd; --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E"); }
.rt [data-panel="note"] { --pc: #8e4ec6; --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E"); }
.rt [data-panel="success"] { --pc: #30a46c; --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12.5 2.5 2.5 5-5'/%3E%3C/svg%3E"); }
.rt [data-panel="warning"] { --pc: #f08c00; --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.rt [data-panel="error"] { --pc: #e5484d; --pi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.86 2h8.28L22 7.86v8.28L16.14 22H7.86L2 16.14V7.86z'/%3E%3Cpath d='m15 9-6 6M9 9l6 6'/%3E%3C/svg%3E"); }
.rt details { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; margin: 10px 0; }
.rt summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.rt summary::-webkit-details-marker { display: none; }
.rt summary::before { content: ""; width: 0; height: 0; border-left: 5px solid var(--muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s; flex: none; }
.rt details[open] > summary::before { transform: rotate(90deg); }
.rt details[open] > summary { margin-bottom: 8px; }
.rt details > div > :last-child { margin-bottom: 0; }
span[data-status] { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 0 6px; border-radius: 4px; line-height: 19px; vertical-align: 1px; white-space: nowrap; --sc: #71717a; color: color-mix(in srgb, var(--sc) 80%, var(--ink)); background: color-mix(in srgb, var(--sc) 16%, transparent); }
span[data-status="blue"] { --sc: #3e63dd; } span[data-status="green"] { --sc: #30a46c; } span[data-status="yellow"] { --sc: #d39b00; } span[data-status="red"] { --sc: #e5484d; } span[data-status="violet"] { --sc: #8e4ec6; }
.rt span[data-date] { display: inline-block; background: var(--hover); border-radius: 5px; padding: 0 6px; font-size: .92em; white-space: nowrap; }
.rt div[data-macro="toc"] { border-left: 2px solid var(--line); padding: 4px 0 4px 14px; margin: 6px 0 18px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.toc-t { font-weight: 600; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.rt div[data-macro="toc"] a { cursor: pointer; text-decoration: none; }
.rt div[data-macro="toc"] a:hover { text-decoration: underline; }
.toc-l2 { padding-left: 14px; } .toc-l3 { padding-left: 28px; }
.rt div[data-macro="children"] { display: flex; flex-direction: column; gap: 1px; margin: 8px 0 14px; }
.task-ref { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 7px; padding: 1px 8px 1px 5px; text-decoration: none !important; color: var(--ink) !important; background: var(--raised); font-size: .93em; line-height: 1.5; vertical-align: 1px; max-width: 100%; }
.task-ref:hover { border-color: var(--faint); }
.task-ref.broken { color: var(--muted) !important; }
.tr-check { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--p4); display: grid; place-items: center; color: transparent; flex: none; cursor: pointer; }
.tr-check svg { width: 9px; height: 9px; stroke-width: 3.2; }
.tr-check:hover { color: var(--p4); }
.tr-check.p1 { border-color: var(--p1); } .tr-check.p2 { border-color: var(--p2); } .tr-check.p3 { border-color: var(--p3); }
.task-ref.done .tr-check { background: var(--p4); border-color: var(--p4); color: #fff; }
.task-ref.done > span:nth-child(2) { text-decoration: line-through; color: var(--muted); }
.tr-due { font-size: 11.5px; color: var(--muted); }
.page-ref { display: inline-flex; align-items: center; gap: 4px; }
.page-ref svg { color: var(--muted); }
.page-ref.broken { color: var(--muted) !important; text-decoration: line-through !important; }

/* ---------- overviews ---------- */
.nh-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); color: var(--muted); margin: 0 0 18px; }
.nh-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nh-search input { flex: 1; border: 0; outline: none; background: transparent; font-size: 14px; color: var(--ink); }
.nh-sec { margin: 0 0 26px; }
.nh-sec h3 { font-size: 13px; font-weight: 650; margin: 0 0 10px; display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.nh-sec h3 svg { color: var(--muted); }
.ncards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ncard { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink) !important; text-decoration: none !important; background: var(--raised); transition: box-shadow .15s, border-color .15s; min-width: 0; }
.ncard:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--line) 50%, var(--faint)); }
.ncard-ico { color: var(--muted); height: 22px; display: flex; align-items: center; }
.ncard-ico .emo { font-size: 20px; }
.ncard b { font-weight: 600; font-size: 14px; }
.ncard-ex { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.ncard-meta, .ncard-kids { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.nline { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); color: var(--ink) !important; text-decoration: none !important; font-size: 14px; border-radius: 6px; }
a.nline:hover { background: var(--hover); }
.nline .ico { width: 20px; display: grid; place-items: center; color: var(--muted); flex: none; }
.nline-sp { max-width: 28%; font-size: 12.5px; }
.nline-t { font-size: 12.5px; white-space: nowrap; }
.sres { align-items: flex-start; }
.sres-ex { font-size: 12.5px; display: block; margin-top: 2px; }
.sres-ex mark { background: color-mix(in srgb, #f5b000 35%, transparent); color: inherit; border-radius: 3px; }
.spaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.space-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink) !important; text-decoration: none !important; background: var(--raised); }
.space-card:hover { box-shadow: var(--shadow); }
.space-card .space-av { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
.space-card b { display: block; font-weight: 600; }
.space-card .muted { font-size: 12px; display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.space-page { max-width: 980px; margin: 0 auto; }
.space-head { display: flex; align-items: center; gap: 14px; margin: 14px 0 26px; flex-wrap: wrap; }
.space-head .page-title { font-size: 28px; }
.nh-empty { text-align: center; padding: 50px 20px; }
.nh-empty-emo { font-size: 46px; margin-bottom: 8px; }
.nh-empty h4 { font-size: 16px; margin: 0 0 6px; color: var(--ink); }
.nh-empty p { max-width: 460px; margin: 0 auto 16px; font-size: 13.5px; }
.trash-row { gap: 8px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--raised); transition: box-shadow .15s, border-color .15s; }
.tpl:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tpl-emo { font-size: 26px; line-height: 1; margin-bottom: 4px; }
.tpl b { font-size: 14px; font-weight: 600; }
.tpl span:last-child { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.mv-list { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; padding: 4px; }

/* ---------- version history ---------- */
.modal.hist-modal { max-width: 1120px; }
.hist { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: 72vh; border-top: 1px solid var(--line); }
.hist-list { overflow: auto; border-right: 1px solid var(--line); padding: 6px; }
.hist-item { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 8px; width: 100%; font-size: 12.5px; color: var(--muted); }
.hist-item b { color: var(--ink); font-weight: 600; font-size: 13px; }
.hist-item:hover { background: var(--hover); }
.hist-item.on { background: var(--accent-soft); }
.hist-item .cur { font-size: 10.5px; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); border-radius: 4px; padding: 0 5px; margin-left: 4px; font-weight: 600; }
.hist-view { overflow: auto; padding: 0 26px 26px; }
.hist-bar { position: sticky; top: 0; z-index: 2; background: var(--raised); display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 14px; font-size: 13px; flex-wrap: wrap; }
.hist-doc .pg-title { font-size: 26px; }
.diff-del { background: color-mix(in srgb, var(--danger) 10%, transparent); border-left: 3px solid var(--danger); padding: 2px 0 2px 10px; margin: 0 0 6px; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.diff-ins { background: color-mix(in srgb, var(--ok) 12%, transparent); border-left: 3px solid var(--ok); padding: 2px 0 2px 10px; margin: 0 0 6px; }
.diff-legend { display: flex; gap: 8px; margin-bottom: 14px; }
.diff-legend span { font-size: 12px; padding: 2px 8px; border-radius: 6px; margin: 0; }

@media (max-width: 900px) {
  body:has(.rt-edit) .fab { display: none; }
  .nv { grid-template-columns: minmax(0, 1fr); }
  .nv-tree { position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; width: min(86vw, 310px); z-index: 160; background: var(--panel); transform: translateX(-100%); transition: transform .22s var(--ease); box-shadow: var(--shadow-lg); padding-top: max(8px, env(safe-area-inset-top)); }
  .nv.tree-open .nv-tree { transform: none; }
  .nv.tree-open .nv-scrim { display: block; position: fixed; inset: 0; z-index: 155; background: rgba(0, 0, 0, .3); }
  .nv-treebtn { display: inline-grid; }
  .nv-main { padding: 0 16px 140px; }
  .pg-edit-bar { margin: 0 -16px 6px; padding: 6px 16px; }
  .rt-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .rt-tools-right { width: 100%; justify-content: flex-end; }
  .pg-title, .pg-title-in { font-size: 27px; }
  .nt-btn { display: grid; }
  .hist { grid-template-columns: 1fr; height: auto; }
  .hist-list { max-height: 30vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .nline-sp { display: none; }
  .pg-acts .btn { padding: 0 8px; }
}
@media print {
  .sidebar, .topbar, .nv-tree, .pg-top, .pg-comments, .pg-label.add, .pg-label button, .pg-banner, .fab, .toasts, .pre-copy, .pg-ver, .pg-emoji.empty, .pg-edit-bar, .nv-scrim { display: none !important; }
  html, body, .app, .main, .scroller { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; }
  .main { margin: 0 !important; border: 0 !important; box-shadow: none !important; }
  .nv { display: block; }
  .nv-main { padding: 0; }
  .pg { max-width: none; }
  .rt pre, .rt table, .rt [data-panel], .rt img { break-inside: avoid; }
}

/* ---------- pages pinned to a project (above its tasks) ---------- */
.pins { margin: -4px 0 18px; }
.pins-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.pins-add { margin-left: 2px; width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 6px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.pins-add:hover { background: var(--hover, rgba(0,0,0,.05)); color: var(--ink); }
.pins-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.pin-card { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 10px 30px 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: inherit; text-decoration: none; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.pin-card:hover { border-color: color-mix(in srgb, var(--accent, #6366f1) 45%, var(--line)); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06)); }
.pin-ico { flex: none; font-size: 18px; line-height: 22px; color: var(--muted); }
.pin-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pin-body b { font-size: 13.5px; font-weight: 600; }
.pin-ex { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.pin-sp { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.pin-x { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; opacity: 0; }
.pin-card:hover .pin-x, .pin-x:focus-visible { opacity: 1; }
.pin-x:hover { background: var(--hover, rgba(0,0,0,.06)); color: var(--ink); }
@media (hover: none) { .pin-x { opacity: .7; } }
.pg-pins { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.pg-pin { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--ink-2, inherit); text-decoration: none; border: 0; font: inherit; cursor: pointer; }
.pg-pin:hover { background: color-mix(in srgb, var(--muted) 22%, transparent); }
.pg-pin.add { padding: 3px 6px; }
@media print { .pg-pins { display: none; } }
