@font-face{font-family:Manrope;src:url('/font.ttf') format('truetype');font-weight:200 800;font-display:swap}
:root{--code-bg:#f1f3f6;--code-text:#303642;--syntax-comment:#626d7e;--syntax-keyword:#7044a4;--syntax-string:#326839;--syntax-number:#93501e;--syntax-title:#23628f;--syntax-attr:#765b20;--syntax-tag:#256b67;--syntax-delete:#a7354b;--syntax-meta:#67568b;--bg:#f8f9fb;--surface:#fff;--ink:#282b31;--muted:#666c77;--line:#e6e8ec;--green:#596aca;--accent:#596aca;--tint:#edf0fc;--focus:#8b9099;font-family:Manrope,'Segoe UI',sans-serif;color:var(--ink);background:var(--bg);font-synthesis:none;color-scheme:light}
:root[data-theme=dark]{--code-bg:#23272f;--code-text:#d5dae3;--syntax-comment:#9eacc5;--syntax-keyword:#c6a6ff;--syntax-string:#a6dda7;--syntax-number:#f2be8c;--syntax-title:#8dcfff;--syntax-attr:#ead49b;--syntax-tag:#87d9d3;--syntax-delete:#ff9dac;--syntax-meta:#c2b8e8;--bg:#17191d;--surface:#22252a;--ink:#f0f1f4;--muted:#a5acb8;--line:#363a41;--green:#a2afff;--accent:#a2afff;--tint:#30364d;--focus:#9299a4;color-scheme:dark}
*{box-sizing:border-box;scrollbar-width:thin;scrollbar-color:#a5abb6 transparent}body{margin:0}body.record-open{overflow:hidden}button,input,select,textarea{font:inherit;color:inherit}button,a,input,select{touch-action:manipulation;-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.45;cursor:default}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid var(--focus);outline-offset:4px}::selection{background:var(--line);color:var(--ink)}input,textarea{caret-color:var(--ink)}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.skip{position:fixed;top:-100px;left:16px;z-index:20;background:var(--surface);padding:12px}.skip:focus{top:8px}
svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;width:20px;height:20px;flex:none}.sidebar{position:fixed;inset:0 auto 0 0;width:72px;background:var(--surface);border-right:1px solid var(--line);display:flex;align-items:center;flex-direction:column;gap:30px;padding:24px 0;z-index:2}.brand{font-size:25px;font-weight:750;letter-spacing:-.04em}.rail-home{width:42px;height:42px;display:grid;place-items:center;border-radius:12px;background:var(--tint);color:var(--green)}.theme-button{margin-top:auto}.workspace{margin-left:72px}.topbar{padding:20px 42px;display:flex;align-items:center;justify-content:space-between;gap:24px;border-bottom:1px solid var(--line);background:var(--surface)}.breadcrumb{font-size:14px;font-weight:550;white-space:nowrap}.quiet{border:0;background:transparent;padding:10px;color:var(--muted);font-size:12px;border-radius:9px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:8px}.quiet:hover{background:var(--line);color:var(--ink)}.search{display:flex;align-items:center;gap:12px;max-width:440px;flex:1;min-width:0;color:var(--muted);background:var(--bg);border:1px solid var(--line);padding:10px 14px;border-radius:10px}.search input{background:none;border:0;outline:0;color:var(--ink);min-width:0;width:100%;font-size:13px}.search input::placeholder{color:var(--muted)}.search:focus-within{outline:2px solid var(--focus);outline-offset:2px}.search kbd{font-size:11px;border:1px solid var(--line);padding:0 5px;border-radius:3px}main{padding:36px 42px 0;max-width:1900px;margin:auto;outline:0}.heading{display:flex;align-items:center;gap:14px;margin-bottom:24px}h1{font-size:28px;letter-spacing:-.025em;line-height:1.4;margin:0;font-weight:550;overflow-wrap:anywhere}.total{color:var(--muted);font-size:13px;font-variant-numeric:tabular-nums}.sort{margin-left:auto;font-size:12px}.sort select{border:0;background:var(--bg);padding:10px;color:var(--muted);max-width:150px}#sections{display:flex;gap:8px;overflow:auto;margin-bottom:16px;padding:4px 0;scrollbar-width:thin}.nav-item{display:flex;align-items:center;gap:8px;white-space:nowrap;border:0;border-radius:8px;padding:10px 15px;color:var(--muted);font-size:12px;background:transparent}.nav-item:hover{background:var(--line)}.nav-item.active{background:var(--ink);color:var(--surface)}.nav-item .count{font-size:11px;opacity:.85}.grid{columns:4;column-gap:22px}.card{width:100%;display:inline-block;vertical-align:top;break-inside:avoid;margin-bottom:26px;border-radius:12px;outline-offset:5px}.art{background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden;position:relative;transition:box-shadow .22s,translate .22s}.card:hover .art{translate:0 -3px;box-shadow:0 8px 24px #20263215}.photo img{display:block;width:100%;height:auto;max-height:560px;object-fit:contain}.text-preview{padding:24px 22px}.preview-title{font-size:19px;font-weight:550;line-height:1.5;letter-spacing:-.02em;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.preview-text{font-size:13px;line-height:1.85;color:var(--muted);margin:16px 0 0;display:-webkit-box;-webkit-line-clamp:7;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;white-space:pre-wrap}.preview-links{display:grid;gap:10px;margin-top:20px;font-size:12px}.preview-links span{border-bottom:1px solid var(--line);padding-bottom:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.code-preview{background:var(--code-bg);color:var(--code-text);padding:22px 18px}.code-preview .code{padding:0;margin:16px 0 0;border-radius:0;font-size:11px;line-height:1.8;max-height:285px;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;background:none}.preview-language{font-size:11px;text-transform:uppercase;color:var(--syntax-comment)}.media-count{position:absolute;right:10px;bottom:10px;background:var(--surface);color:var(--ink);border-radius:6px;padding:4px 7px;font-size:11px;border:1px solid var(--line)}.card-body{padding:11px 2px 0}.card-body h2{font-size:13px;font-weight:550;line-height:1.6;margin:0;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.card-meta{display:flex;justify-content:space-between;gap:8px;color:var(--muted);font-size:11px;margin-top:5px}.review-badge{font-size:11px;color:var(--muted);display:inline-block;margin-top:7px}.review-badge.warning{color:#886014}.filter-panel{margin:0 0 8px;font-size:12px;color:var(--muted)}.filter-panel>summary{cursor:pointer;min-height:36px;padding:8px 0;width:fit-content}.filters{display:flex;gap:20px;flex-wrap:wrap;margin:12px 0}.filters label{display:flex;gap:10px;align-items:center}.filters select{background:var(--surface);border:1px solid var(--line);padding:8px;border-radius:6px;max-width:240px}.tags{display:flex;flex-wrap:wrap;gap:7px;max-height:120px;overflow:auto;padding:5px}.tag{font-size:11px;border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:6px;padding:6px 10px}.tag.selected{color:var(--surface);background:var(--ink)}.collection-bar{font-size:11px;color:var(--muted);margin:12px 0 22px}#notice{font-size:12px;color:var(--green);margin:12px 0}#notice:empty{display:none}.file-errors{padding:16px;font-size:13px;border:1px solid var(--line);border-radius:8px}.file-errors p{overflow-wrap:anywhere}.empty{column-span:all;padding:60px 0;text-align:center}.empty h2{font-size:20px;font-weight:550}.empty p{font-size:13px;color:var(--muted)}.button{border:1px solid var(--line);background:var(--surface);color:var(--ink);padding:10px 16px;border-radius:8px;font-size:13px}.button:hover{background:var(--tint)}.more{display:block;margin:30px auto}footer{font-size:12px;color:var(--muted);margin-top:36px;padding:20px 0;border-top:1px solid var(--line)}#import-report{margin-top:24px;font-size:12px;color:var(--muted)}#import-report summary{cursor:pointer}#import-status{overflow:auto}#import-status table{width:100%;border-collapse:collapse;margin-top:16px}#import-status td,#import-status th{text-align:left;padding:10px;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}
#record-dialog{padding:0;border:1px solid var(--line);border-radius:18px;background:var(--surface);color:var(--ink);width:min(1280px,94vw);max-width:94vw;height:88dvh;max-height:1050px;overflow:hidden;box-shadow:0 32px 100px #0003}#record-dialog::backdrop{background:#181c2466;backdrop-filter:blur(5px)}.detail{height:100%;display:grid;grid-template-columns:minmax(0,1.25fr) minmax(350px,1fr);position:relative}.detail.text-only{grid-template-columns:minmax(0,1fr);max-width:850px;margin:auto}#record-dialog:has(.text-only){width:min(850px,94vw)}.record-content,.record-media{overflow:auto;min-width:0;overscroll-behavior:contain}.record-content{padding:62px 40px 32px}.record-media{background:var(--bg);border-right:1px solid var(--line);padding:36px 40px}.record-close{position:absolute!important;right:16px;top:16px;z-index:2;background:var(--surface)!important}.article-title-row{display:flex;align-items:flex-start}.article-title-row h1{font-size:26px;font-weight:550;line-height:1.45;flex:1;min-width:0}.lead{font-size:14px;line-height:1.85;color:var(--muted);margin:14px 0 0}.article-meta{display:flex;gap:10px 16px;flex-wrap:wrap;font-size:11px;color:var(--muted);margin:22px 0;line-height:1.8}.external{color:var(--ink);text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:4px;overflow-wrap:anywhere}.external:hover{text-decoration-color:var(--ink)}.review-note{font-size:12px;line-height:1.75;color:var(--muted);padding:12px 0;border-bottom:1px solid var(--line)}.prose{font-size:14px;line-height:1.9;white-space:pre-wrap;max-width:75ch;overflow-wrap:anywhere}.block-heading{font-size:21px;font-weight:550;line-height:1.5}.callout{background:var(--tint);color:var(--accent);border-radius:10px;padding:22px 24px}.callout h3{font-size:16px;font-weight:550;margin:0 0 8px}.callout p{margin:0;line-height:1.8;white-space:pre-wrap}.gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.gallery img{display:block;width:100%;height:auto;border-radius:8px}.gallery-open{padding:0;border:0;background:transparent;display:block;cursor:zoom-in}.gallery .attachment-tile:first-child{grid-column:1/-1}.caption{grid-column:1/-1;font-size:12px;color:var(--muted);margin:0}.video,.standalone{width:100%;max-height:700px;object-fit:contain;border-radius:10px}.audio{width:100%}.link-row{padding:16px 0;border-bottom:1px solid var(--line)}.link-row a{font-size:13px;font-weight:550}.link-row .link-address{display:block;font-size:12px;font-weight:400;margin-top:8px;color:var(--muted)}.link-row p{font-size:13px;line-height:1.7;color:var(--muted)}.code{padding:24px;background:var(--code-bg);color:var(--code-text);caret-color:var(--code-text);border-radius:10px;overflow:auto;font-size:13px;line-height:1.8}.code-block{position:relative;margin:24px 0}.code-block .code{padding-top:54px}.copy-code{position:absolute;right:12px;top:12px;border:1px solid #555e6b;background:#343b47;color:#ecf0f5;border-radius:6px;padding:5px 10px;font-size:11px}.transcript{margin:24px 0;padding:16px;border:1px solid var(--line);border-radius:9px}.transcript summary{font-size:12px;color:var(--muted);cursor:pointer}.transcript-title{font-size:15px;font-weight:550}.file-download{display:flex;align-items:center;gap:13px;padding:14px 12px;border:1px solid var(--line);border-radius:9px;min-width:0}.file-download:hover{background:var(--bg)}.file-download svg{flex:0 0 20px}.file-download svg:last-child{margin-left:auto}.file-info{display:grid;gap:5px;min-width:0}.file-name{font-size:12px;font-weight:550;overflow-wrap:anywhere}.file-kind{font-size:11px;color:var(--muted)}.viewer-download{width:min(560px,90%);color:#edf2fc;border-color:#505560}.viewer-download:hover{background:#23272f}.viewer-download .file-kind{color:#b5bdcc}
.icon-button{width:36px;height:36px;flex:0 0 36px;display:inline-grid;place-items:center;padding:0;border:0;border-radius:8px;background:transparent;color:var(--muted)}.icon-button:hover{background:var(--tint);color:var(--ink)}.icon-button svg{width:18px;height:18px}.danger,.icon-button.danger{color:#b5374d}:root[data-theme=dark] .danger{color:#ffacba}.delete-material{display:flex;align-items:center;gap:8px;width:100%;height:auto;min-height:44px;flex:0 0 auto;font-size:12px;padding:10px 8px;border-top:1px solid var(--line);justify-content:flex-start}.palette{border:0;padding:0;margin:0;min-width:0;display:flex;gap:4px;flex-wrap:wrap}.palette legend{font-size:11px;color:var(--muted);padding:0;margin-bottom:8px}.swatch{display:grid;place-items:center;width:32px;height:36px;cursor:pointer}.swatch input{appearance:none;position:relative;width:22px;height:22px;border:2px solid transparent;background:var(--accent);border-radius:50%;margin:0;cursor:pointer}.swatch input:checked{outline:2px solid var(--accent);outline-offset:3px}.swatch input:checked::after{content:'';position:absolute;left:6px;top:2px;width:5px;height:10px;border:solid white;border-width:0 2px 2px 0;transform:rotate(45deg)}.blue{--accent:#5069ac;--tint:#eef1fa}.purple{--accent:#80639c;--tint:#f3eef8}.amber{--accent:#916d36;--tint:#f8f2e9}.green{--accent:#47715e;--tint:#edf3ee}.rose{--accent:#a3657a;--tint:#f8eef2}:root[data-theme=dark] .blue{--accent:#b3c5fa;--tint:#29334c}:root[data-theme=dark] .purple{--accent:#d5bdee;--tint:#3b3046}:root[data-theme=dark] .amber{--accent:#dfc393;--tint:#40392d}:root[data-theme=dark] .green{--accent:#b1d9c3;--tint:#2b3b32}:root[data-theme=dark] .rose{--accent:#e4b5c6;--tint:#44303a}.verified-check{display:flex;align-items:center;gap:9px;font-size:12px;min-height:36px;cursor:pointer}.verified-check input{width:17px;height:17px;accent-color:var(--green);margin:0}.add-block{display:flex;gap:8px;flex-wrap:wrap;margin:24px 0}.add-block select{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:8px;font-size:12px;max-width:100%}
@media(min-width:1700px){.grid{columns:5}}@media(max-width:1150px){.grid{columns:3}main{padding:30px}.topbar{padding:20px 30px}.breadcrumb{display:none}.record-media{padding:30px}.record-content{padding:62px 30px 30px}.detail{grid-template-columns:minmax(0,1fr) minmax(330px,1fr)}}
@media(max-width:760px){.sidebar{position:absolute;inset:15px 12px auto auto;width:40px;background:none;border:0;padding:0;z-index:3}.brand,.rail-home{display:none}.theme-button{width:40px;height:40px}.workspace{margin:0}.topbar{padding:14px 60px 14px 18px;gap:8px}.topbar #refresh{padding:8px}.search{padding:10px 12px;max-width:none}.search kbd{display:none}main{padding:26px 18px 0}.heading{gap:8px;margin-bottom:20px}.heading h1{font-size:23px}.total{font-size:11px}.sort{font-size:11px}.sort select{max-width:118px;padding:8px 0}#sections{gap:3px}.nav-item{padding:9px 12px;font-size:11px}.nav-item .count{display:none}.grid{columns:2;column-gap:14px}.card{margin-bottom:20px}.text-preview{padding:17px 14px}.preview-title{font-size:16px}.preview-text{font-size:12px;-webkit-line-clamp:5}.preview-links{font-size:11px}.card-body h2{font-size:12px}.card-meta{font-size:11px;flex-wrap:wrap;gap:3px}.code-preview .code{font-size:11px}.filters{gap:12px}.filters label{justify-content:space-between;flex:1 1 100%}.filters select{max-width:70%;font-size:12px}#record-dialog{width:96vw;max-width:96vw;height:94dvh;border-radius:14px;overflow:auto;overscroll-behavior:contain}.detail{display:flex;flex-direction:column;height:auto;min-height:100%;padding-top:50px}.record-close{position:fixed!important;top:calc(3dvh + 9px);right:calc(2vw + 12px)}.record-content,.record-media{overflow:visible}.record-media{border-right:0;border-bottom:1px solid var(--line);padding:20px 24px}.record-content{padding:26px 24px}.article-title-row h1{font-size:24px}.gallery{gap:12px}.gallery img{max-height:60dvh;object-fit:contain}.gallery .attachment-tile:first-child{grid-column:1/-1}.collection-bar{margin-bottom:18px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Fullscreen media; navigation sits at the image edges, panels float above it. */
.media-viewer{position:fixed;inset:0;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;padding:0;border:0;background:#0b1120;color:#fffaff;overflow:hidden}.media-viewer::backdrop{background:#0b1120}.viewer-stage{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:64px 84px 88px;touch-action:pan-y}.viewer-stage>.viewer-image,.viewer-stage>video{max-width:100%;max-height:100%;object-fit:contain}.viewer-stage>audio{width:min(600px,80%)}.viewer-image{user-select:none}.viewer-control{position:absolute;z-index:4;display:grid;place-items:center;width:48px;height:48px;padding:0;border:1px solid #ffffff26;border-radius:50%;background:#1d2940e6;color:#fffaff;cursor:pointer;transition:background .18s,border-color .18s}.viewer-control svg,.viewer-file svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.viewer-control:hover{background:#354560ef;border-color:#ffffff65}.viewer-control:focus-visible,.viewer-thumb:focus-visible{outline:2px solid #fff;outline-offset:4px}.viewer-control:disabled{opacity:.25;cursor:default}.viewer-close{right:max(20px,env(safe-area-inset-right));top:max(16px,env(safe-area-inset-top))}.viewer-prev,.viewer-next{top:50%;translate:0 -50%}.viewer-prev{left:20px}.viewer-next{right:20px}.viewer-prev::before,.viewer-next::before{content:'';position:absolute;inset:-100px -20px;z-index:-1;opacity:0;pointer-events:none;transition:opacity .22s;background:linear-gradient(90deg,#0006,transparent)}.viewer-next::before{background:linear-gradient(270deg,#0006,transparent)}.viewer-prev:hover::before,.viewer-next:hover::before{opacity:1}.viewer-header{position:absolute;inset:0 0 auto;min-height:84px;padding:24px 88px 28px 26px;display:flex;align-items:center;gap:24px;background:linear-gradient(#080e1eed,transparent);pointer-events:none}.viewer-title{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:65vw}.viewer-counter{font-size:12px;font-variant-numeric:tabular-nums;color:#c8d3e8;margin-left:auto;white-space:nowrap}.viewer-filmstrip{position:absolute;left:50%;bottom:max(18px,env(safe-area-inset-bottom));translate:-50% 0;display:flex;gap:8px;max-width:calc(100vw - 160px);overflow-x:auto;padding:7px 10px;background:#172137ed;border:1px solid #ffffff1f;border-radius:12px;scrollbar-width:none}.viewer-thumb{flex:0 0 48px;width:48px;height:48px;border:2px solid transparent;border-radius:6px;overflow:hidden;padding:0;background:#293752;color:#edf2fc;opacity:.55;cursor:pointer}.viewer-thumb img{width:100%;height:100%;object-fit:cover}.viewer-thumb span{font-size:9px}.viewer-thumb:hover{opacity:.85}.viewer-thumb[aria-current=true]{opacity:1;border-color:#c7ddff}.viewer-panel{transition:opacity .24s,transform .24s cubic-bezier(.16,1,.3,1)}.controls-hidden .viewer-header{opacity:0;transform:translateY(-24px);pointer-events:none}.controls-hidden .viewer-filmstrip{opacity:0;transform:translateY(24px);pointer-events:none}.viewer-loading{position:absolute;width:28px;height:28px;border:2px solid #ffffff30;border-top-color:#fff;border-radius:50%;animation:viewer-spin .75s linear infinite}.viewer-file{display:flex;align-items:center;gap:14px;padding:20px;color:white;text-decoration:underline;text-underline-offset:4px;overflow-wrap:anywhere}.viewer-error{text-align:center;font-size:14px}.viewer-error .viewer-file{justify-content:center}@keyframes viewer-spin{to{rotate:360deg}}
@media(max-width:720px){.viewer-stage{padding:64px 0 88px}.viewer-control{width:44px;height:44px}.viewer-prev{left:10px}.viewer-next{right:10px}.viewer-close{right:12px;top:max(12px,env(safe-area-inset-top))}.viewer-header{padding:26px 72px 28px 16px;gap:12px}.viewer-title{max-width:56vw;font-size:12px}.viewer-filmstrip{max-width:calc(100vw - 24px);bottom:max(12px,env(safe-area-inset-bottom));gap:6px;padding:6px}.viewer-thumb{width:40px;height:40px;flex-basis:40px}.viewer-prev::before,.viewer-next::before{display:none}}
@media(prefers-reduced-motion:reduce){.viewer-panel{transition:none}.viewer-loading{animation:none}}

.code-language{position:absolute;left:24px;top:19px;font-size:11px;color:var(--syntax-comment)}:is(.code,.note-body pre) .hljs-comment,:is(.code,.note-body pre) .hljs-quote{color:var(--syntax-comment);font-style:italic}:is(.code,.note-body pre) .hljs-keyword,:is(.code,.note-body pre) .hljs-selector-tag,:is(.code,.note-body pre) .hljs-literal,:is(.code,.note-body pre) .hljs-type{color:var(--syntax-keyword)}:is(.code,.note-body pre) .hljs-string,:is(.code,.note-body pre) .hljs-regexp,:is(.code,.note-body pre) .hljs-addition{color:var(--syntax-string)}:is(.code,.note-body pre) .hljs-number,:is(.code,.note-body pre) .hljs-symbol,:is(.code,.note-body pre) .hljs-variable,:is(.code,.note-body pre) .hljs-template-variable{color:var(--syntax-number)}:is(.code,.note-body pre) .hljs-title,:is(.code,.note-body pre) .hljs-section,:is(.code,.note-body pre) .hljs-selector-id{color:var(--syntax-title)}:is(.code,.note-body pre) .hljs-attr,:is(.code,.note-body pre) .hljs-attribute,:is(.code,.note-body pre) .hljs-property{color:var(--syntax-attr)}:is(.code,.note-body pre) .hljs-built_in,:is(.code,.note-body pre) .hljs-tag,:is(.code,.note-body pre) .hljs-name{color:var(--syntax-tag)}:is(.code,.note-body pre) .hljs-deletion{color:var(--syntax-delete)}:is(.code,.note-body pre) .hljs-meta{color:var(--syntax-meta)}:is(.code,.note-body pre) .hljs-emphasis{font-style:italic}:is(.code,.note-body pre) .hljs-strong{font-weight:700}

/* Document editing keeps reading layout; controls appear beside the active block. */
.inline-editable{cursor:text;border-radius:5px;outline-offset:4px;min-height:24px;white-space:pre-wrap;overflow-wrap:anywhere}.inline-editable:hover{background:#3e92cc0c;box-shadow:0 0 0 1px #3e92cc40}.inline-placeholder{color:var(--muted);font-size:13px!important;font-weight:400!important}.inline-form{margin:8px 0;min-width:0;width:100%}.inline-input{display:block;width:100%;min-width:0;border:1px solid #3e92cc;border-radius:6px;background:#fffaff;color:var(--ink);padding:10px;font:inherit;line-height:1.7;resize:vertical}.article-title-row .inline-input{font-size:30px;font-weight:750}.inline-actions{display:flex;align-items:center;justify-content:flex-end;gap:4px;margin-top:4px}.inline-status{font-size:12px;color:#9f253b;margin-right:auto;overflow-wrap:anywhere}.inline-code .inline-input{font-family:monospace;font-size:13px;background:#101b33;color:#edf2fc;tab-size:4;white-space:pre;overflow:auto}.code-block:has(.inline-code) .copy-code,.code-block:has(.inline-code)>.code-language{display:none}.document-properties{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin-top:18px;font-size:12px}.properties-popover>summary,.block-options>summary,.link-options>summary{cursor:pointer;padding:8px 0;color:var(--muted);width:fit-content}.properties-popover{min-width:0}.properties-popover[open]{flex:1 1 100%}.properties-body{padding:12px 0 16px;display:grid;grid-template-columns:1fr 1fr;gap:16px 24px;border-bottom:1px solid var(--line)}.property-row{min-width:0;display:grid;gap:6px}.property-label{font-size:11px;color:var(--muted)}.property-value{font-size:13px;overflow-wrap:anywhere;margin:0;min-height:24px}.selection-bar{display:flex;align-items:center;gap:8px;margin-left:auto}.document-block{position:relative;min-width:0;margin:24px 0}.document-block-tools{display:flex;justify-content:flex-end;gap:2px;margin-bottom:2px;opacity:0;transition:opacity .15s}.document-block:hover>.document-block-tools,.document-block:focus-within>.document-block-tools{opacity:1}.document-block>.prose{margin:0}.document-block>.gallery,.document-block>.code-block,.document-block>.callout{margin-top:0}.document-block .block-heading{margin-top:0}.attachment-tile{position:relative;min-width:0}.attachment-tile>.gallery-open{width:100%}.attachment-select{width:18px;height:18px;accent-color:#0a2463}.attachment-tile>.attachment-select{position:absolute;top:10px;left:10px;opacity:0}.attachment-delete{position:absolute;top:4px;right:4px;background:#fffaff;color:#be3344;opacity:0}.attachment-tile:hover>.attachment-delete,.attachment-tile:hover>.attachment-select,.attachment-tile:focus-within>.attachment-delete,.attachment-tile:focus-within>.attachment-select,.attachment-tile>.attachment-select:checked{opacity:1}.attachment-tile:has(>.attachment-select:checked){outline:2px solid #3e92cc;outline-offset:4px;border-radius:9px}.gallery>.attachment-tile:first-child:nth-last-child(2){grid-column:1/-1;max-width:580px;justify-self:center}.file-caption{font-size:12px;color:var(--muted);display:block;width:fit-content}.link-options{font-size:11px;margin-top:8px}.link-properties{display:grid;gap:12px;padding:8px 0}.block-options{margin-top:12px;font-size:11px}.code-language.inline-editable{cursor:pointer;white-space:normal}.code-block>.inline-form:has(select){position:relative;padding:8px 12px;background:#e9effb;border-radius:6px}.article-heading .lead.inline-placeholder{display:block}.inline-form .icon-button{opacity:1}#boot-status{color:var(--muted);font-size:13px;padding:20px 0}
@media(hover:none){.document-block-tools,.attachment-delete,.attachment-tile>.attachment-select{opacity:1}}
@media(max-width:720px){.properties-body{grid-template-columns:1fr}.document-properties{gap:10px 16px}.document-block-tools{opacity:1}.article-title-row .inline-input{font-size:25px}.document-block{margin:18px 0}.selection-bar{margin-left:0}.attachment-delete,.attachment-tile>.attachment-select{opacity:1}}

.viewer-delete{right:80px;top:max(16px,env(safe-area-inset-top));color:#ffb8c6}.viewer-header{padding-right:150px}.viewer-delete:hover{background:#6c2a3b}.viewer-delete:disabled{opacity:.4}@media(max-width:720px){.viewer-delete{right:64px;top:max(12px,env(safe-area-inset-top))}.viewer-header{padding-right:120px}.viewer-title{max-width:40vw}}
@media(min-width:721px){.document-block-tools{position:absolute;left:-38px;top:0;flex-direction:column;margin:0}.document-block-tools .icon-button{width:32px;height:32px;flex-basis:32px}.document-block-tools .attachment-select{position:static}}
.inline-editable:empty::before{content:'Add text';font-size:13px;color:var(--muted)}

/* Inline controls use the current theme; the reading panels retain their scroll. */
.inline-input{background:var(--surface);border-color:var(--focus)}.article-title-row .inline-input{font-size:26px;font-weight:550}.inline-code .inline-input{background:#23272f;color:#d5dae3}.inline-editable:hover{background:var(--bg);box-shadow:0 0 0 1px var(--line)}.document-properties{margin:24px 0;gap:10px}.properties-body{grid-template-columns:1fr;gap:16px;padding:16px 0}.property-row{grid-template-columns:95px minmax(0,1fr);align-items:start;gap:12px}.property-label{padding-top:4px}.property-value{font-size:12px;line-height:1.8}.properties-popover{width:100%}.properties-body .palette,.properties-body .delete-material{grid-column:1/-1}.attachment-select{accent-color:var(--green)}.attachment-delete{background:var(--surface)}.selection-bar{margin-left:0}.document-block-tools{left:-34px}.document-block-tools .icon-button{width:30px;height:30px;flex-basis:30px}.document-block:first-child{margin-top:0}.code-block>.inline-form:has(select){background:var(--tint)}.gallery>.attachment-tile:first-child:nth-last-child(2){max-width:none;width:100%}.media-viewer{background:#15171b}.media-viewer::backdrop{background:#15171b}.viewer-control{background:#2b2f36ed}.viewer-control:hover{background:#434951}.viewer-filmstrip{background:#24282fed}.viewer-thumb{background:#383d46}.viewer-header{background:linear-gradient(#111318ed,transparent)}.viewer-counter{color:#c1c7d0}.viewer-delete{color:#ffb8c6}.viewer-delete:hover{background:#6c2a3b}.inline-status{color:#b5374d}:root[data-theme=dark] .inline-status{color:#ffacba}
@media(max-width:760px){.document-block-tools{position:static;flex-direction:row;opacity:1}.property-row{grid-template-columns:80px minmax(0,1fr)}.document-properties{gap:8px}.attachment-delete,.attachment-tile>.attachment-select{opacity:1}.article-title-row .inline-input{font-size:24px}}
.record-media .gallery{grid-template-columns:repeat(4,minmax(0,1fr))}.record-media .attachment-tile:first-child img{max-height:68dvh;object-fit:contain;min-height:180px}.record-media .attachment-tile:not(:first-child) img{height:100px;object-fit:cover}.record-media .attachment-tile:not(:first-child) .gallery-open{min-height:100px}.record-media .gallery>.caption{padding-top:8px}
@media(max-width:760px){.record-media{max-height:52dvh;overflow:auto;flex-shrink:0}.record-media .gallery{grid-template-columns:repeat(3,minmax(0,1fr))}.record-media .attachment-tile:first-child img{max-height:38dvh;min-height:120px}.record-media .attachment-tile:not(:first-child) img,.record-media .attachment-tile:not(:first-child) .gallery-open{height:90px;min-height:90px}}
/* Notes keep their content in one writing surface. */
#new-note{margin-left:auto;white-space:nowrap}.sort{margin-left:4px}.retired-report{display:none!important}.note-actions{display:flex;align-items:center;gap:10px;margin:12px 0 22px;color:var(--muted)}.note-collection{font-size:12px;min-height:32px;display:inline-flex;align-items:center;padding:4px 8px;background:var(--bg);border-radius:6px}.note-actions>.danger{margin-left:auto}.note-colors{position:relative}.note-colors summary{cursor:pointer;list-style:none;width:34px;height:34px;display:grid;place-items:center;border-radius:8px}.note-colors summary::-webkit-details-marker{display:none}.color-dot{display:block;width:16px;height:16px;border-radius:50%;background:var(--accent)}.color-options{position:absolute;top:38px;left:0;z-index:5;padding:8px 12px;border:1px solid var(--line);border-radius:9px;background:var(--surface);box-shadow:0 6px 20px #0001;width:max-content}.note-writing{position:relative}.writing-toolbar{display:flex;align-items:center;gap:2px;flex-wrap:wrap;margin:0 0 12px;padding:5px 0;border-bottom:1px solid var(--line);opacity:.65}.note-writing:focus-within .writing-toolbar,.writing-toolbar:hover{opacity:1}.text-color{width:28px;height:28px;border:0;padding:4px;background:transparent;border-radius:5px;cursor:pointer}.body-language{font-size:11px;max-width:150px;background:var(--bg);border:1px solid var(--line);border-radius:5px;padding:5px}.note-body{outline:none;min-height:230px;font-size:15px;line-height:1.9;overflow-wrap:anywhere;caret-color:var(--ink)}.note-body:empty:before{content:attr(data-placeholder);color:var(--muted);pointer-events:none}.note-body p,.note-body div{white-space:pre-wrap;margin:0 0 16px}.note-body h2{font-size:23px;font-weight:550;margin:24px 0 12px}.note-body h3{font-size:18px;font-weight:550}.note-body ul,.note-body ol{padding-left:24px}.note-body blockquote{margin:18px 0;background:var(--tint);color:var(--accent);border-radius:9px;padding:18px 20px}.note-body blockquote p:last-child{margin-bottom:0}.note-body a{text-decoration:underline;text-underline-offset:4px;text-decoration-color:var(--muted);color:var(--ink);cursor:pointer}.note-body pre{background:var(--code-bg);color:var(--code-text);caret-color:var(--code-text);padding:18px;border-radius:9px;overflow:auto;white-space:pre;font-size:13px;line-height:1.8}.note-body code{font-family:ui-monospace,monospace}.note-save-status{display:block;min-height:22px;font-size:11px;color:var(--muted);margin-top:8px}.attach-files{padding:8px 12px;margin:12px 0 20px;background:var(--bg);border-radius:6px;font-size:13px}.note-tags{display:flex;gap:8px;flex-wrap:wrap;align-items:center;border-top:1px solid var(--line);padding-top:20px;margin-top:4px}.note-tag{display:inline-flex;align-items:center;gap:4px;background:var(--tint);color:var(--accent);padding:3px 5px 3px 11px;border-radius:8px;font-size:12px;max-width:100%}.note-tag>span{overflow-wrap:anywhere;min-width:0}.note-tag .icon-button{width:26px;height:28px;flex-basis:26px;color:inherit}.note-tag svg{width:13px;height:13px}.tag-input{width:115px;min-width:90px;max-width:100%;border:0;background:transparent;font-size:12px;padding:9px 3px;outline-offset:0}.tag-input::placeholder{color:var(--muted)}.catalog-tag{display:inline-block;padding:2px 7px;background:var(--tint);color:var(--accent);border-radius:5px}.card-meta{justify-content:flex-start;align-items:center;flex-wrap:wrap;gap:6px}.card-meta>span:first-child{margin-right:auto}.note-attachment{position:relative;margin-bottom:18px}.note-attachment>.attachment-select{position:absolute;top:7px;left:7px;z-index:1}.note-attachment>.attachment-delete{opacity:1;position:static;margin-top:8px}.note-attachment:has(>.file-download){padding-left:32px}.note-attachment:has(>.file-download)>.attachment-delete{position:absolute;right:0;top:0;transform:translateY(-75%);opacity:0}.note-attachment:has(>.file-download):hover>.attachment-delete,.note-attachment:has(>.file-download):focus-within>.attachment-delete{opacity:1}.upload-status{font-size:12px;line-height:1.6;color:var(--muted);overflow-wrap:anywhere}.drop-active{outline:3px dashed var(--focus);outline-offset:-10px}.note-body .hljs-keyword,.note-body .hljs-literal{color:var(--syntax-keyword)}.note-body .hljs-string{color:var(--syntax-string)}.note-body .hljs-number{color:var(--syntax-number)}.note-body .hljs-title{color:var(--syntax-title)}.note-body .hljs-comment{color:var(--syntax-comment)}
@media(max-width:760px){#new-note{font-size:11px;padding:8px 10px}.heading{flex-wrap:wrap}.heading h1{font-size:22px}.heading .sort{font-size:11px}.note-body{font-size:14px;min-height:180px}.record-content{padding:22px 24px}.note-tags{gap:7px}.note-attachment:has(>.file-download)>.attachment-delete{opacity:1}.writing-toolbar{opacity:1}.note-tag .icon-button{width:30px;height:30px;flex-basis:30px}}
.writing-toolbar{opacity:1}.note-tag.amber,.catalog-tag.amber{--accent:#805e28}.note-tag.purple,.catalog-tag.purple{--accent:#74568f}.note-tag.rose,.catalog-tag.rose{--accent:#92536a}:root[data-theme=dark] .note-tag.amber,:root[data-theme=dark] .catalog-tag.amber{--accent:#dfc393}:root[data-theme=dark] .note-tag.purple,:root[data-theme=dark] .catalog-tag.purple{--accent:#d5bdee}:root[data-theme=dark] .note-tag.rose,:root[data-theme=dark] .catalog-tag.rose{--accent:#e4b5c6}

/* Comfortable reading sizes across desktop and touch screens. */
.nav-item{font-size:14px;font-weight:500}.nav-item .count{font-size:12px;opacity:1}.note-body{font-size:16px}.note-body pre{font-size:14px}.note-body pre *{caret-color:var(--code-text)}.code-preview .code{font-size:13px}.note-collection,.tag-input,.note-tag{font-size:13px}.card-body h2{font-size:14px}

.note-body pre{position:relative;padding-top:54px}.note-body pre>.body-language{position:absolute;top:10px;left:12px;max-width:calc(100% - 24px);font-family:Manrope,'Segoe UI',sans-serif;font-size:12px;color:var(--syntax-comment);background:var(--code-bg);border:0;padding:5px 8px;cursor:pointer}.note-body pre>.body-language:hover{background:var(--surface);color:var(--code-text)}

.card[draggable=true]{cursor:grab}.card.dragging{opacity:.4}.moving-card .card:hover .art{translate:none;box-shadow:none}.nav-item.drop-available{box-shadow:inset 0 0 0 1px var(--line)}.nav-item.drop-over{background:var(--tint);color:var(--ink);box-shadow:inset 0 0 0 2px var(--focus)}

.new-section{flex-shrink:0;align-self:center}.section-create{display:flex;align-items:center;gap:4px;flex-shrink:0}.section-create input{width:170px;padding:8px 10px;border:1px solid var(--line);border-radius:6px;background:var(--surface);font-size:14px}.section-error{max-width:230px;font-size:12px;color:var(--ink)}#tags .tag:not(.all-tags){background:var(--tint);color:var(--accent);border:1px solid transparent}#tags .tag.selected:not(.all-tags){border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}#tags .tag{font-size:13px;padding:6px 11px}#tags{margin:8px 0 20px}

#new-note{height:38px;min-height:38px;padding:8px 12px;border:0;border-radius:6px;background:transparent;color:var(--ink);font-size:13px;font-weight:500;gap:7px}#new-note svg{width:16px;height:16px}#new-note:hover{background:var(--line)}.heading .sort{display:flex;align-items:center;margin-left:0;font-size:13px}.heading .sort select{height:38px;padding:8px 10px;border-radius:6px;background:transparent}.heading .sort select:hover{background:var(--line)}

#sections>.new-section{position:sticky;right:0;margin-left:auto;background:var(--bg);border-radius:6px;z-index:1}#sections>.new-section:hover{background:var(--line)}

.heading .delete-section{width:32px;height:32px;flex-basis:32px;color:var(--muted)}.heading .delete-section:hover{color:#b5374d;background:var(--line)}

.tag-status:empty{display:none}.tag-status{flex-basis:100%;font-size:12px;color:var(--muted)}

.renameable{cursor:text;border-radius:5px}.renameable:hover{background:var(--line)}.library-rename{display:inline-flex;align-items:center;gap:3px;min-width:0}.library-rename input{font:inherit;color:var(--ink);min-width:100px;width:180px;max-width:50vw;padding:6px 8px;border:1px solid var(--focus);border-radius:6px;background:var(--surface)}.heading .library-rename input{font-size:24px;width:300px}.library-rename .icon-button{width:30px;height:30px;flex-basis:30px}#tags .tag{display:inline-flex;align-items:center;gap:2px;padding:2px 5px 2px 10px}.tag-name,.note-tag-name{border:0;background:none;padding:4px 0;color:inherit;font:inherit;text-align:left;overflow-wrap:anywhere}.tag-name{cursor:pointer}.note-tag-name{cursor:text}.rename-tag{width:24px;height:26px;flex-basis:24px;color:inherit;opacity:.55}.rename-tag svg{width:12px;height:12px}.tag:hover .rename-tag,.rename-tag:focus-visible{opacity:1}#tags .all-tags{padding-right:10px}
/* Shared header and library controls. */
.workspace{margin-left:0}.topbar{gap:14px}.app-identity{display:flex;align-items:center;gap:14px;white-space:nowrap;margin-right:auto}.app-identity .brand{display:block;font-size:26px}.app-name{font-size:17px;font-weight:550}.topbar .theme-button{margin:0}.topbar .search{max-width:480px}.topbar #refresh{margin-left:auto}.heading{flex-wrap:wrap}#view-switch{display:flex;gap:3px;margin-left:8px}.view-button[aria-pressed=true]{background:var(--line);color:var(--ink)}.library-rename{gap:12px;flex-wrap:wrap}.library-rename input,.section-create input{font-size:15px;font-weight:500;border:0;background:var(--line);outline:0;box-shadow:none;padding:9px 12px}.library-rename .icon-button{flex-shrink:0}.library-rename input:focus,.section-create input:focus{outline:0;box-shadow:inset 0 -2px var(--muted)}.inline-editable:hover{box-shadow:none;background:var(--line)}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:0;background-color:var(--line);box-shadow:none}.search:focus-within{outline:0;box-shadow:inset 0 -2px var(--muted)}.nav-item.drop-available{box-shadow:none;background:var(--surface)}.nav-item.drop-over{box-shadow:none;background:var(--tint);color:var(--accent)}#tags .tag.selected:not(.all-tags){border-color:transparent;box-shadow:none;filter:brightness(.94)}#tags .tag{font-size:14px;font-weight:500;padding:3px 11px}.tag-name{padding:5px 0}.tag:hover{filter:brightness(.96)}.preview-text,.card-meta,.note-tag,.tag-input,.note-collection,.quiet,.sort,.total{font-size:14px}.card-body h2{font-size:15px}.note-body{font-weight:450}.card{position:relative}.card-select{width:20px;height:20px;accent-color:var(--accent);cursor:pointer}.grid:not(.table-view) .card-select{position:absolute;top:12px;left:12px;z-index:1;opacity:0}.card:hover .card-select,.card:focus-within .card-select,.card.is-selected .card-select{opacity:1!important}.card.is-selected .art{background:var(--tint);box-shadow:0 4px 16px #20263220}.card.is-selected .photo img{opacity:.7}
.bulk-actions{position:sticky;top:10px;z-index:5;display:flex;align-items:center;flex-wrap:wrap;gap:14px;background:var(--surface);padding:12px 16px;border-radius:10px;box-shadow:0 6px 24px #20263218;margin:12px 0 22px;font-size:14px}.bulk-actions select,.bulk-actions input{font:inherit;border:0;border-radius:6px;background:var(--bg);padding:8px 10px;max-width:200px}.bulk-tag-form{display:flex;gap:8px;align-items:center}.bulk-count{font-weight:550}.bulk-actions>.icon-button:last-child{margin-left:auto}.table-view{columns:auto;overflow-x:auto}.library-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:14px}.library-table th{text-align:left;color:var(--muted);font-weight:500;padding:12px;border-bottom:1px solid var(--line)}.library-table th:first-child{width:48px}.library-table th:nth-child(2){width:40%}.library-table th:last-child{width:64px}.library-table .card{display:table-row;cursor:default}.library-table td{padding:14px 12px;border-bottom:1px solid var(--line);overflow-wrap:anywhere;vertical-align:middle}.library-table .card:hover{background:var(--surface)}.library-table .is-selected{background:var(--tint)}.table-title img{width:40px;height:44px;object-fit:cover;border-radius:5px;float:left;margin-right:12px}.table-title a{font-size:15px;font-weight:500}.table-tags .catalog-tag{margin:3px;font-size:13px}.table-title a:hover{text-decoration:underline;text-underline-offset:4px}
@media(max-width:760px){.topbar{padding:16px 18px;flex-wrap:wrap;gap:8px}.app-identity{margin-right:auto}.topbar .search{order:3;flex:1 0 100%;max-width:none}.topbar #refresh{margin-left:0}.app-name{font-size:16px}main{padding-top:24px}.heading{gap:8px}.heading h1{font-size:24px}.heading .sort{margin-left:auto}#new-note{margin-left:auto}#view-switch{margin-left:0}.grid:not(.table-view) .card-select{opacity:1}.preview-text{font-size:14px}.card-meta{font-size:12px}.library-table{min-width:680px}.bulk-actions{gap:8px}.bulk-actions input{max-width:145px}.heading .library-rename{flex:1 1 100%}.heading .library-rename input{max-width:calc(100vw - 130px);width:260px;font-size:22px}.library-rename input{max-width:calc(100vw - 150px)}}
.grid:not(.table-view) .card:has(.text-preview) .text-preview{padding-top:44px}.tags{max-height:none;overflow:visible}.inline-input{border:0;background:var(--line);outline:0;box-shadow:inset 0 -2px var(--muted)}.inline-input:focus{outline:0;box-shadow:inset 0 -2px var(--muted)}

/* The header and collection share one left edge at every desktop width. */
.topbar{padding-left:32px;padding-right:32px}main{max-width:none;width:100%;margin:0;padding-left:32px;padding-right:32px}.app-identity{gap:10px;min-height:40px}.app-mark{width:38px;height:31px;stroke:none}.app-name{font-family:inherit;font-size:22px;font-weight:500;letter-spacing:-.025em;line-height:1.2}
@media(max-width:760px){.topbar{padding-left:18px;padding-right:18px}main{padding-left:18px;padding-right:18px}}

/* In-note viewing: stable stage and one horizontal attachment filmstrip. */
.record-media.note-media{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:24px 16px 16px;gap:8px}
.note-media-viewport{position:relative;display:grid;grid-template-columns:36px minmax(0,1fr) 36px;align-items:center;gap:4px;flex:1;min-height:0}
.note-media-display{grid-column:2;grid-row:1;min-width:0;height:100%;min-height:0;display:flex;align-items:center;justify-content:center}
.note-media-prev{grid-column:1;grid-row:1}.note-media-next{grid-column:3;grid-row:1}
.note-media-viewport>.icon-button{width:36px;height:44px;min-width:0;flex-basis:36px;background:transparent;color:var(--muted)}
.note-media-viewport>.icon-button:hover{background:var(--line);color:var(--ink)}
.note-media-open{display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:0;border:0;background:transparent;cursor:pointer;border-radius:8px}
.note-media-display img,.note-media-display video{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:8px}
.note-media-display audio{width:100%}.note-media-display .file-download{max-width:100%}
.note-media-tools{display:flex;align-items:center;gap:6px;flex:none;padding:0 4px;min-height:40px}
.note-media-counter{margin-right:auto;font-size:12px;font-variant-numeric:tabular-nums;color:var(--muted)}
.note-filmstrip{display:flex;gap:8px;flex:none;overflow-x:auto;overflow-y:hidden;padding:4px;position:relative;overscroll-behavior-x:contain;scrollbar-width:thin}
.note-film-thumb{display:flex;align-items:center;justify-content:center;flex:0 0 70px;height:76px;min-width:0;padding:5px;border:0;border-radius:7px;background:transparent;color:var(--muted);cursor:pointer;position:relative}
.note-film-thumb img{width:100%;height:100%;object-fit:contain;border-radius:3px;pointer-events:none}.note-film-thumb span{font-size:12px}
.note-film-thumb:hover{background:var(--line)}.note-film-thumb[aria-current=true]{background:var(--line)}
.note-film-thumb[aria-current=true]::after{content:'';position:absolute;bottom:0;left:24px;right:24px;height:2px;border-radius:2px;background:var(--ink)}
.note-filmstrip.is-selecting .note-film-thumb{background:var(--surface)}.note-filmstrip .file-selected{background:var(--tint)}.note-filmstrip .file-selected::before{content:'';position:absolute;top:5px;right:5px;background:var(--accent);border-radius:50%;width:8px;height:8px}
.note-media-error{font-size:14px;color:var(--muted);max-width:100%}.gallery-open{cursor:pointer}
@media(max-width:760px){.record-media.note-media{height:52dvh;max-height:none;min-height:300px;padding:8px 8px 12px}.note-media-viewport{grid-template-columns:32px minmax(0,1fr) 32px;gap:0}.note-media-viewport>.icon-button{width:32px;flex-basis:32px}.note-film-thumb{flex-basis:58px;height:62px}.note-media-tools{min-height:36px}}

/* Actions use a pointer; cards and large media keep a quiet arrow. */
a[href],button,summary,select,input[type=checkbox],input[type=color]{cursor:pointer}
button:disabled{cursor:default}
#grid .card,#grid .card .art,#grid .card img,#grid .card .table-title a,.gallery-open,.note-media-open,.viewer-image{cursor:default}
.note-carousel-dots{display:flex;align-items:center;justify-content:center;gap:0;margin:0 auto;min-width:0}
.note-carousel-dot{width:18px;height:32px;padding:0;border:0;background:transparent;display:grid;place-items:center}
.note-carousel-dot::after{content:'';width:5px;height:5px;background:var(--muted);opacity:.4;border-radius:50%}
.note-carousel-dot[aria-current=true]::after{background:var(--ink);opacity:1;width:6px;height:6px}
.note-carousel-dot:hover::after{opacity:1}.note-media-counter{min-width:7ch;margin-right:0;flex-shrink:0}
.note-media-status:empty{display:none}.note-media-status{font-size:12px;color:var(--danger,#b5374d)}
.note-film-thumb.reordering{opacity:.4}.note-film-thumb.drop-before{box-shadow:inset 2px 0 var(--focus)}.note-film-thumb.drop-after{box-shadow:inset -2px 0 var(--focus)}
.record-media.note-media:focus{outline:0}

/* Button focus uses a soft fill, without the curved inset underline. */
button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible{box-shadow:none}

/* Selection badges exist visually only on selected cards, never on hover. */
.selection-mark{display:none;position:absolute;top:12px;left:12px;width:24px;height:24px;align-items:center;justify-content:center;border-radius:50%;background:var(--accent);color:var(--surface);z-index:1;pointer-events:none}
.selection-mark svg{width:17px;height:17px;stroke-width:2.2}
.card.is-selected .selection-mark{display:flex}.table-title{position:relative}.table-title .selection-mark{position:static;float:left;margin:10px 10px 0 0}
.library-table th:first-child{width:44%}.library-table th:nth-child(2){width:22%}
.grid:not(.table-view) .card:has(.text-preview) .text-preview{padding-top:24px}
.card.is-selected:has(.text-preview)>.selection-mark{top:5px;left:5px;width:18px;height:18px}.card.is-selected:has(.text-preview)>.selection-mark svg{width:13px;height:13px}
#sections{flex-wrap:wrap;overflow:visible;max-height:none;gap:6px;margin-bottom:14px}
#sections .new-section{position:static;flex-shrink:0}
.catalog-tools{display:flex;align-items:flex-start;gap:16px}
.catalog-tools #tags{flex:1;min-width:0;max-height:none;overflow:visible}
.catalog-tools .heading{flex:none;flex-wrap:nowrap;gap:4px;margin:5px 0 0}
.catalog-tools #new-note{margin:0;width:40px;padding:10px}
.catalog-tools #view-switch{margin:0}
.catalog-tools .sort{position:relative;display:grid;place-items:center;width:40px;height:40px;margin:0;border-radius:9px;color:var(--muted)}
.catalog-tools .sort:hover,.catalog-tools .sort:focus-within{background:var(--line);color:var(--ink)}
.catalog-tools .sort select{position:absolute;inset:0;width:100%;height:100%;max-width:none;opacity:0;padding:0}
.collection-bar{display:flex;align-items:center;gap:20px;height:20px;line-height:20px;white-space:nowrap}.collection-bar #notice{margin:0;overflow:hidden;text-overflow:ellipsis;font-size:12px}
.bulk-tag-menu{position:fixed;z-index:20;width:260px;max-width:calc(100vw - 16px);display:grid;gap:10px;padding:16px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 36px #0002}
.bulk-tag-menu strong{font-size:13px;font-weight:550}.bulk-tag-menu input,.bulk-tag-menu select{font:inherit;font-size:14px;min-width:0;width:100%;border:0;border-radius:6px;background:var(--bg);padding:9px 10px}.bulk-tag-menu>.icon-button{justify-self:end}.bulk-tag-status{font-size:12px;color:var(--muted)}.bulk-tag-status:empty{display:none}
@media(max-width:600px){.catalog-tools{gap:6px;flex-wrap:wrap}.catalog-tools #tags{flex-basis:100%}.catalog-tools .heading{gap:0;order:-1;margin-left:auto}.catalog-tools .heading .quiet,.catalog-tools .sort,.catalog-tools .view-button{width:34px;min-width:34px;padding:7px}.collection-bar{gap:10px}}

/* Embedded text fields retain their own surface while typing. */
.search input:focus-visible,.tag-input:focus-visible{background:transparent;box-shadow:none;outline:0}
.search:focus-within{box-shadow:none;border-color:var(--muted)}

#sections .delete-section{flex-shrink:0;margin-left:8px;align-self:center}

.section-actions{display:flex;align-items:center;flex:none;margin-left:auto;gap:4px}#sections .section-actions .new-section{margin:0}#sections .section-actions .delete-section{margin-left:4px}

/* Destructive actions remain red in every interactive state. */
:root{--danger:#b5374d}:root[data-theme=dark]{--danger:#ffacba}
button.danger,button.danger:hover,button.danger:focus-visible,button.danger:active{color:var(--danger)}
.media-viewer button.danger{color:#ffacba}

.table-sort{display:inline-flex;align-items:center;gap:8px;font:inherit;color:inherit;background:transparent;border:0;padding:7px 8px;margin:-7px -8px;border-radius:6px}
.table-sort:hover,.table-sort:focus-visible{background:var(--line);color:var(--ink)}
.table-sort svg{width:14px;height:14px;opacity:0}
th[aria-sort] .table-sort{color:var(--ink)}th[aria-sort] .table-sort svg,.table-sort:hover svg,.table-sort:focus-visible svg{opacity:1}

/* Sorting uses the same type and surfaces as the library. */
.catalog-tools .sort-picker{display:block;position:relative;background:transparent}
.sort-picker>summary{display:grid;place-items:center;width:100%;height:40px;border-radius:9px;list-style:none}
.sort-picker>summary::-webkit-details-marker{display:none}
.sort-picker>summary:hover,.sort-picker[open]>summary{background:var(--line);color:var(--ink)}
.sort-popover{position:absolute;right:0;top:calc(100% + 8px);z-index:10;width:250px;padding:8px;background:var(--surface);color:var(--ink);border-radius:12px;box-shadow:0 8px 28px #0002;font-size:15px;line-height:1.5}
#sort-fields{display:grid;gap:2px}
.sort-option,.sort-order{display:flex;align-items:center;border:0;background:transparent;color:var(--muted);font:inherit;border-radius:7px;padding:9px 12px;gap:6px}
.sort-option{width:100%;justify-content:space-between}.sort-option svg{width:16px;height:16px;visibility:hidden}
.sort-option[aria-pressed=true] svg{visibility:visible}
.sort-option:hover,.sort-order:hover,.sort-option:focus-visible,.sort-order:focus-visible{background:var(--line);color:var(--ink)}
.sort-option[aria-pressed=true],.sort-order[aria-pressed=true]{background:var(--bg);color:var(--ink)}
#sort-direction{display:flex;gap:4px;border-top:1px solid var(--line);margin-top:8px;padding-top:8px}
.sort-order{flex:1;padding:8px 6px;justify-content:center;font-size:13px}.sort-order svg{width:14px;height:14px}
.library-table th:last-child{width:88px}

.card-menu{position:fixed;z-index:20;width:252px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;padding:7px;background:var(--surface);color:var(--ink);font-size:15px;line-height:1.5;border-radius:12px;box-shadow:0 8px 28px #0002;outline:0}
.card-menu-item{display:flex;align-items:center;gap:12px;width:100%;padding:9px 11px;border:0;border-radius:7px;background:transparent;color:var(--ink);font:inherit;text-align:left}
.card-menu-item svg{width:18px;height:18px;color:var(--muted)}.card-menu-item.danger svg{color:inherit}
.card-menu-item:hover:not(:disabled),.card-menu-item:focus-visible{background:var(--line)}
.card-menu-item:disabled{opacity:.35;cursor:default}
.card-menu-separator{height:1px;margin:6px 8px;background:var(--line)}
.card-menu-caption{font-size:13px;color:var(--muted);padding:7px 11px}
.card-menu-heading{display:flex;align-items:center;gap:4px;padding:0 0 8px;font-weight:500}
.card-menu-heading .icon-button{width:34px;height:34px;flex-basis:34px}
.card-menu-form{display:grid;gap:10px;padding:4px}
.card-menu-form input{width:100%;min-width:0;border:0;border-radius:6px;background:var(--bg);color:var(--ink);padding:10px;font:inherit;outline:0}
.card-menu-form input:focus{box-shadow:inset 0 0 0 1px var(--muted)}
.card-menu-modes{display:flex;gap:3px}.card-menu-mode{flex:1;border:0;border-radius:6px;background:transparent;color:var(--muted);font:inherit;font-size:13px;padding:8px 4px}
.card-menu-mode[aria-pressed=true]{background:var(--line);color:var(--ink)}
.card-menu-apply{justify-self:end;border:0;background:var(--ink);color:var(--surface);font:inherit;border-radius:7px;padding:7px 16px}
.card-menu-suggestions{display:flex;gap:5px;flex-wrap:wrap}.card-menu-suggestions button{border:0;font:inherit;font-size:13px;padding:4px 7px}
.card-menu-status{display:block;font-size:13px;color:var(--muted);overflow-wrap:anywhere}.card-menu-status:empty{display:none}
.card-menu-list{max-height:300px;overflow:auto}

.mobile-filter{display:none}
@media(max-width:600px){
 #mobile-collections,#mobile-tags{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:8px 10px;border:0;border-radius:8px;background:transparent;color:var(--ink);font:inherit;font-size:15px;text-align:left;min-width:0}
 #mobile-collections{max-width:100%;margin-bottom:4px}#mobile-tags{margin-right:auto;max-width:calc(100% - 176px)}
 .mobile-filter span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-filter svg{width:16px;height:16px;flex:none}.mobile-filter[aria-expanded=true] svg{transform:rotate(180deg)}
 #catalog:not(.show-collections) #sections,#catalog:not(.show-tags) #tags{display:none}
 .catalog-tools .heading{width:100%;margin:0;gap:0}.catalog-tools #view-switch{gap:0}
 .catalog-tools .heading .quiet,.catalog-tools .heading .sort,.catalog-tools .heading .view-button{width:44px;min-width:44px;height:44px;padding:10px}
 .sort-picker>summary{height:44px}.catalog-tools #tags{padding:6px 0}
 .collection-bar{margin:8px 0 16px;font-size:12px}
 #sections{gap:4px;margin-bottom:8px}.nav-item{min-height:44px}
 #tags .tag-name{min-height:38px}.card-menu-item{min-height:44px}
 input,.search input,.tag-input,.card-menu-form input{font-size:16px}
 .record-close,.note-actions .icon-button,.note-media-tools .icon-button{min-width:44px;min-height:44px}
 .card-menu-mode{min-height:40px}.card-menu-apply{min-height:44px}
}
@media(prefers-reduced-motion:reduce){.card:hover .art{translate:none}.art{transition:none}}

@media(max-width:600px){.catalog-tools .heading .sort-picker{padding:0}}

.note-media-display,.viewer-stage{touch-action:pan-y pinch-zoom}

/* Documents and audio belong with the note, outside the visual gallery. */
.note-files{margin:24px 0 8px;min-width:0}.note-files-title{font-size:14px;font-weight:550;color:var(--muted);margin:0 0 12px}.note-files-list{list-style:none;margin:0;padding:0;display:grid;gap:4px}.note-file{display:flex;align-items:flex-start;gap:8px;min-width:0;border-radius:8px}.note-file-content{flex:1;min-width:0}.note-files .file-download{border:0;background:transparent;padding:12px 8px;gap:12px;min-height:52px}.note-files .file-download:hover{background:var(--bg)}.note-files .file-name{font-size:14px;line-height:1.5}.note-files .file-kind{font-size:12px}.note-files .file-download svg{width:20px;height:20px}.note-file>.icon-button{width:44px;height:44px;flex:0 0 44px;margin-top:4px}.note-audio{display:block;width:100%;height:40px;margin:0 0 12px;color-scheme:light}:root[data-theme=dark] .note-audio{color-scheme:dark}

.document-file-heading{display:flex;align-items:center;gap:4px;min-width:0}.document-open{display:flex;align-items:center;gap:12px;flex:1;min-width:0;text-align:left;padding:12px 8px;border:0;border-radius:8px;background:transparent;color:var(--ink);font:inherit}.document-open:hover,.document-open[aria-expanded=true]{background:var(--bg)}.document-open>svg{width:20px;height:20px;flex:0 0 20px}.document-download{display:grid;place-items:center;width:44px;height:44px;flex:0 0 44px;border-radius:8px}.document-download:hover{background:var(--bg)}.document-download svg{width:20px;height:20px}.document-preview{margin:8px 0 20px;min-width:0}.document-status{font-size:14px;color:var(--muted);line-height:1.6}.document-text{max-height:65dvh;overflow:auto;font-size:15px;line-height:1.75;overflow-wrap:anywhere;padding:16px;background:var(--bg);border-radius:8px}.document-text pre{white-space:pre-wrap;margin:0}.document-text code{font-size:13px}.document-text table{border-collapse:collapse;display:block;overflow:auto}.document-text td,.document-text th{padding:8px;border-bottom:1px solid var(--line)}.document-text a{text-decoration:underline}.document-toolbar{display:flex;align-items:center;gap:4px;padding:4px 0 8px}.document-toolbar>span{font-size:13px;color:var(--muted);margin-right:auto;white-space:nowrap}.document-toolbar .icon-button{width:40px;height:40px;flex-basis:40px}.pdf-pages{height:65dvh;min-height:300px;overflow:auto;background:var(--bg);padding:12px;border-radius:8px;overscroll-behavior:contain}.pdf-page{position:relative;max-width:none;margin:0 auto 12px;background:white;color:#25282b;overflow:hidden}.pdf-page canvas{display:block;width:100%;height:100%}.pdf-text-layer{position:absolute;inset:0;overflow:hidden;line-height:1;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0}.pdf-text-layer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;transform-origin:0 0}.pdf-text-layer> :not(.markedContent),.pdf-text-layer .markedContent span:not(.markedContent){z-index:1}.pdf-text-layer ::selection{background:#7b9dd466}

.note-embeds:empty{display:none}.note-embeds{display:grid;gap:20px;margin:20px 0}.note-embed{min-width:0}.note-embed iframe{display:block;width:100%;border:0;border-radius:8px;background:var(--bg)}.note-embed img{display:block;max-width:100%;height:auto;border-radius:8px}.embed-source{display:block;font-size:13px;color:var(--muted);margin-top:8px;overflow-wrap:anywhere}
.note-file{display:grid;grid-template-columns:minmax(0,1fr) 44px;column-gap:8px;row-gap:0}.note-file-content{display:contents}.note-file>.icon-button{grid-column:2;grid-row:1}.note-file .document-preview,.note-file .note-audio{grid-column:1/-1}.record-content:has(.note-files) .note-body{min-height:96px}
.note-embeds:not(:has(.note-embed:not([hidden]))){display:none}
.confirm-dialog{width:min(420px,calc(100vw - 40px));max-width:calc(100vw - 40px);padding:28px;border:0;border-radius:16px;background:var(--surface);color:var(--ink);box-shadow:0 20px 64px #0003;font-family:inherit}.confirm-dialog::backdrop{background:#11141b66}.confirm-dialog h2{margin:0 0 12px;font-size:21px;line-height:1.3;font-weight:550;letter-spacing:-.02em}.confirm-dialog p{margin:0;font-size:15px;line-height:1.65;color:var(--muted);white-space:pre-line;overflow-wrap:anywhere}.confirm-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}.confirm-actions button{min-height:44px;padding:10px 20px;border:0;border-radius:8px;font:inherit;font-size:14px;font-weight:550}.confirm-cancel{background:var(--bg);color:var(--ink)}.confirm-cancel:hover{background:var(--line)}.confirm-actions .confirm-delete{background:#b5374d;color:#fff}.confirm-actions .confirm-delete:hover{background:#9e2d41}.confirm-actions button:focus-visible{outline:2px solid var(--muted);outline-offset:3px}.inline-title{position:relative;margin:0;width:100%;padding:0}.article-title-row .inline-title .inline-input{padding:0;background:transparent;border:0;border-radius:0;box-shadow:none;width:100%;height:auto;min-height:0;line-height:inherit}.inline-title .inline-input:focus{background:transparent;box-shadow:0 1px var(--line)}.inline-title .inline-actions{position:absolute;right:0;top:100%;z-index:2;gap:2px;margin:2px 0 0;padding:0 2px;border-radius:6px;background:var(--surface)}.inline-title .inline-actions .icon-button{width:28px;height:28px;flex-basis:28px}.inline-title .inline-status:empty{display:none}.inline-title .inline-status{max-width:240px;font-size:12px}

/* Inline names keep their reading size; controls travel with the text. */
.library-rename,.section-create{display:inline-flex;position:relative;align-items:center;flex-wrap:nowrap;gap:6px;width:fit-content;max-width:100%;min-width:0;margin:0;font-size:14px;font-weight:500}
.library-rename input,.section-create input{flex:0 1 auto;min-width:40px;max-width:100%;height:34px;padding:5px 9px;border:0;border-radius:6px;background:var(--surface);color:var(--ink);font:inherit;line-height:24px;box-shadow:none}
.library-rename input:focus,.section-create input:focus{background:var(--surface);box-shadow:inset 0 -1px var(--muted);outline:0}
.rename-tag-field input,.rename-tag-field input:focus{background:var(--tint);color:var(--accent)}
.field-actions{display:inline-flex;align-items:center;flex:none;gap:2px}
.field-actions .icon-button{width:30px;height:32px;flex:0 0 30px;border-radius:6px}
.section-error:empty{display:none}.section-error{position:absolute;left:0;top:100%;z-index:3;background:var(--surface);padding:4px 8px;border-radius:4px;max-width:100%;color:var(--ink)}
.note-actions>.inline-choice{display:inline-flex;align-items:center;position:relative;gap:4px;flex:0 1 auto;width:auto;max-width:calc(100% - 44px);margin:0;min-width:0}
.inline-choice .inline-input{flex:0 1 auto;min-width:60px;max-width:100%;height:34px;padding:4px 8px;border:0;border-radius:6px;background:var(--bg);font:inherit;font-size:14px;line-height:24px;box-shadow:none;cursor:pointer}
.inline-choice .inline-input:focus{background:var(--bg);box-shadow:inset 0 -1px var(--muted)}
.inline-choice .inline-actions{flex:none;gap:2px;margin:0}
.inline-choice .inline-actions .icon-button{width:30px;height:32px;flex-basis:30px}
.inline-choice .inline-status:empty{display:none}.inline-choice .inline-status:not(:empty){position:absolute;top:100%;left:0;z-index:3;padding:4px 8px;background:var(--surface);max-width:100%}
.tag-input{flex:0 1 auto;min-width:70px;max-width:100%}
@media(max-width:760px){
 .library-rename,.section-create{font-size:16px;gap:4px}
 .library-rename input,.section-create input{height:44px;max-width:100%}
 .field-actions .icon-button{width:44px;height:44px;flex-basis:44px}
 .inline-choice .inline-input{font-size:16px;height:44px;min-width:50px}
 .inline-choice .inline-actions .icon-button{width:44px;height:44px;flex-basis:44px}
}

.section-actions{min-width:0;max-width:100%}

.rename-status:empty{display:none}.rename-status:not(:empty){position:absolute;left:0;top:100%;z-index:5;max-width:100%;padding:6px 9px;border-radius:6px;background:var(--surface);color:var(--ink);font-size:13px;font-weight:400;overflow-wrap:anywhere;box-shadow:0 4px 12px #0001}

.link-editor{position:absolute;top:44px;left:0;right:0;z-index:6;display:flex;align-items:center;gap:4px;flex-wrap:wrap;padding:10px;background:var(--surface);border-radius:8px;box-shadow:0 8px 24px #0002}
.link-editor input{flex:1;min-width:70px;border:0;border-radius:5px;padding:8px;background:var(--bg);font:inherit;font-size:15px}
.link-status:empty{display:none}.link-status{flex-basis:100%;font-size:13px;color:var(--muted)}
@media(max-width:760px){.link-editor input{font-size:16px}.link-editor .icon-button{width:44px;height:44px;flex-basis:44px}}

.note-media-open:disabled{opacity:1}
.note-image-loading{position:absolute;left:50%;top:50%;translate:-50% -50%;z-index:2;width:24px;height:24px;border:2px solid var(--line);border-top-color:var(--muted);border-radius:50%;pointer-events:none;animation:viewer-spin .9s linear infinite}
@media(prefers-reduced-motion:reduce){.note-image-loading{animation:none}}
.note-media-error{text-align:center}.note-media-error>.button{margin:0 0 14px}

/* Commands sit on the text baseline; block code retains its own layout. */
.note-body code:not(pre code){font-size:.92em;line-height:inherit;padding:.08em .3em;border-radius:4px;background:var(--code-bg);color:var(--code-text);box-decoration-break:clone;-webkit-box-decoration-break:clone;overflow-wrap:anywhere}
.note-body code{cursor:text}
.clipboard-buffer{position:fixed;inset:0 auto auto 0;width:1px;height:1px;opacity:0;pointer-events:none}

.note-writing{position:relative}
.code-copy-feedback{position:absolute;z-index:3;pointer-events:none;padding:5px 9px;border-radius:6px;background:var(--ink);color:var(--surface);font-size:12px;line-height:1.4;box-shadow:0 3px 10px #0002}
.note-body code:not(pre code){cursor:pointer}

.note-writing:not(.is-editing) .writing-toolbar{display:none}
.note-writing.is-editing .note-body code{cursor:text}
.note-writing:not(.is-editing) .body-language{pointer-events:none;appearance:none;opacity:1;border-color:transparent;background:transparent}

.settings-dialog{width:min(420px,calc(100vw - 32px));padding:24px;border:0;border-radius:16px;background:var(--surface);color:var(--ink);box-shadow:0 18px 60px #0003}
.settings-dialog::backdrop{background:#171b2440}
.settings-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}
.settings-heading h2{margin:0;font-size:20px;font-weight:600}
.debug-toggle{display:flex;align-items:center;justify-content:space-between;gap:24px;font-size:15px;cursor:pointer}
.debug-toggle input{width:18px;height:18px;accent-color:var(--ink)}
.settings-dialog p{font-size:13px;line-height:1.6;color:var(--muted)}
.settings-actions{display:flex;gap:12px;margin-top:20px}
.settings-actions .quiet{padding:8px 12px;background:var(--bg);border-radius:7px}
#settings.debug-active{color:var(--accent);background:var(--tint)}

/* Reserve cover space before remote images arrive, including migrated notes. */
.photo img.cover-unmeasured{aspect-ratio:4/5;object-fit:contain}
html{scrollbar-gutter:stable}
.note-media-open canvas{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}

/* Preview and original fill the same frame regardless of their pixel resolution. */
.note-media-open>img,.note-media-open>canvas,.note-media-display>video,.viewer-stage>.viewer-image,.viewer-stage>video{width:100%;height:100%;object-fit:contain}

/* Keep title controls in their own space, above the collection actions. */
.inline-title{display:flex;align-items:center;gap:8px}
.article-title-row .inline-title .inline-input{flex:1;min-width:0;width:0}
.inline-title .inline-actions{position:static;flex:none;margin:0;padding:0;background:transparent}

/* Page clips join the existing note toolbar and reading surface. */
.clipper{position:relative;flex:none}.clipper>summary{display:flex;position:relative;align-items:center;justify-content:center;list-style:none;width:38px;height:38px}.clipper>summary::-webkit-details-marker{display:none}.clipper>summary svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.clip-count{position:absolute;right:0;top:0;font-size:10px;min-width:14px;text-align:center;border-radius:7px;background:var(--ink);color:var(--surface)}
.clip-panel{position:absolute;right:0;top:calc(100% + 10px);width:360px;max-width:calc(100vw - 36px);padding:20px;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 36px #0002;z-index:40;font-size:14px;font-weight:400;text-align:left}.clip-panel label{display:block;font-size:16px;font-weight:600;margin-bottom:12px}.clip-input-row{display:flex;gap:8px}.clip-input-row input{min-width:0;flex:1;width:0;font:inherit;padding:10px 12px;border-radius:8px;background:var(--surface);border:1px solid var(--line);color:var(--ink)}.clip-input-row input:focus{outline:2px solid var(--muted);outline-offset:1px}.clip-input-row .button{padding:10px 16px;font:inherit}.clip-panel p{font-size:13px;line-height:1.5;overflow-wrap:anywhere}.clip-panel #clip-error:empty{display:none}#clip-jobs{max-height:45dvh;overflow:auto}.clip-job{display:flex;gap:12px;align-items:flex-start;padding:14px 0;border-bottom:1px solid var(--line)}.clip-job:last-child{border-bottom:0;padding-bottom:0}.clip-job-info{min-width:0;flex:1}.clip-job-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.clip-job-state{font-size:13px;color:var(--muted)}.clip-job>.quiet{font:inherit;flex:none;padding:8px}.clip-job-error{color:var(--ink);margin:8px 0 0}.clip-warnings{font-size:12px;margin-top:6px}.clip-warnings summary{color:var(--muted)}
.note-body img{display:block;max-width:100%;height:auto;border-radius:6px;margin:18px 0;cursor:default}.note-body figure{margin:24px 0}.note-body figcaption{color:var(--muted);font-size:14px;line-height:1.6}.note-body table{display:block;width:max-content;max-width:100%;overflow-x:auto;border-collapse:collapse;margin:20px 0;font-size:15px}.note-body th,.note-body td{padding:10px 14px;border:1px solid var(--line);text-align:left;vertical-align:top;min-width:80px}.note-body th{font-weight:600;background:var(--surface)}.note-body h4{font-size:18px;margin:24px 0 10px}.note-body hr{border:0;border-top:1px solid var(--line);margin:24px 0}
@media(max-width:760px){.clipper{position:static}.clip-panel{right:18px;top:auto;margin-top:10px;width:calc(100vw - 36px)}.clip-input-row input,.clip-input-row .button{min-height:44px}.clip-job>.quiet{min-height:44px}}

.clip-extension-link{display:block;margin-top:16px;padding-top:12px;border-top:1px solid var(--line);font-size:13px;color:var(--muted);text-decoration:underline;text-underline-offset:3px}

/* The note can fill the viewport without replacing its editor or media nodes. */
.record-expand{position:absolute;right:58px;top:16px;z-index:5}
#record-dialog.is-expanded{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0;border:0;margin:0}
#record-dialog.is-expanded .detail.text-only .record-content{width:100%;max-width:1100px;margin-inline:auto}
#clip-form>label{display:flex;align-items:center;justify-content:space-between;gap:12px}
@media(max-width:760px),(pointer:coarse) and (max-width:950px) and (max-height:500px){
 #record-dialog,#record-dialog:has(.text-only){width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;overflow:auto;overscroll-behavior:contain}
 #record-dialog .record-expand{display:none}
 #record-dialog .record-close{position:fixed!important;top:max(9px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:44px;height:44px}
 #record-dialog .detail{padding-top:calc(62px + env(safe-area-inset-top));padding-bottom:env(safe-area-inset-bottom)}
}
