/* Application-owned layouts. Primer supplies the color and type foundations. */
:root {
  --nav-width:224px; --context-width:252px; --reading-width:700px; --reading-size:18px;
  --ink:var(--primer-color-text); --muted:var(--primer-color-muted);
  --paper:var(--primer-color-surface); --canvas:var(--primer-color-canvas);
  --raised:var(--primer-color-raised); --line:var(--primer-color-border-subtle);
  --accent:var(--primer-color-accent); --fill:var(--primer-color-accent-fill);
  --on-fill:var(--primer-color-on-accent);
}
* { box-sizing:border-box; }
html,body { margin:0; height:100%; min-width:320px; background:var(--paper); color:var(--ink); font:400 14px/1.5 var(--primer-font-body); -webkit-font-smoothing:antialiased; }
button,input,select,textarea { font:inherit; color:inherit; }
button { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:8px 12px; border:0; border-radius:6px; background:transparent; cursor:pointer; transition:background 120ms,color 120ms; }
button:hover { background:var(--raised); }
button:disabled { opacity:.45; cursor:default; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,[contenteditable]:focus-visible { outline:2px solid var(--primer-color-focus); outline-offset:3px; }
input,select { border:1px solid var(--primer-color-border); border-radius:6px; background:var(--paper); padding:10px 12px; }
input::placeholder { color:var(--muted); opacity:1; }
a { color:var(--accent); }
h1,h2,h3,p { margin:0; }
h1,h2,h3 { line-height:1.2; }
.icon { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.icon-definitions { position:absolute; width:0; height:0; overflow:hidden; }
.skip-link { position:fixed; left:16px; top:-60px; padding:12px 20px; z-index:100; background:var(--paper); }
.skip-link:focus { top:12px; }
.primary { background:var(--fill); color:var(--on-fill); min-height:40px; }
.primary:hover { background:var(--primer-color-accent-fill-hover); }
.outline { border:1px solid var(--primer-color-border); }
.icon-button { width:36px; height:36px; padding:8px; flex:none; color:var(--muted); }
.icon-button:hover,.icon-button[aria-pressed=true] { color:var(--accent); background:var(--raised); }
.eyebrow { font-size:11px; letter-spacing:1.15px; text-transform:uppercase; font-weight:500; color:var(--muted); }
.quiet-action { font-size:12px; color:var(--accent); padding:7px 0; }
.quiet-action .icon { width:15px; height:15px; }
kbd { font:10px ui-monospace,monospace; border:1px solid var(--line); padding:2px 4px; border-radius:4px; }

/* The library shell keeps named navigation in a side pane. */
.shell { height:100dvh; display:grid; grid-template-columns:var(--nav-width) minmax(0,1fr); overflow:hidden; }
.sidebar { display:flex; flex-direction:column; min-height:0; overflow:auto; padding:28px 16px 18px; background:var(--canvas); border-right:1px solid var(--line); }
.brand { justify-content:flex-start; padding:0 8px; gap:9px; font-size:21px; letter-spacing:-.8px; font-weight:500; text-align:left; }
.brand:hover { background:transparent; }
.brand-mark { width:23px; height:27px; color:var(--accent); stroke-width:1.65; }
.workspace-name { margin:4px 0 28px; padding-left:40px; color:var(--muted); font-size:11px; }
.sidebar-search { width:100%; justify-content:flex-start; padding:9px 10px; background:var(--paper); border:1px solid var(--line); font-size:12px; color:var(--muted); }
.sidebar-search .icon { width:17px; height:17px; }
.sidebar-search kbd { margin-left:auto; }
.new-object { justify-content:flex-start; width:100%; margin:8px 0 28px; padding:10px 12px; font-size:13px; }
.new-object .icon { width:18px; height:18px; }
.nav-group { display:grid; gap:3px; margin-bottom:28px; }
.nav-button { justify-content:flex-start; text-align:left; gap:11px; width:100%; min-height:39px; padding:9px 11px; font-size:13px; }
.nav-button .icon { color:var(--muted); width:18px; height:18px; }
.nav-button small { margin-left:auto; font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums; }
.nav-button.active { background:var(--raised); color:var(--accent); font-weight:500; }
.nav-button.active .icon { color:var(--accent); }
.nav-label { padding:0 11px; margin-bottom:9px; font-size:10px; }
.pinned { border-top:1px solid var(--line); padding-top:23px; margin-bottom:26px; }
.thread-button { font-size:12px; padding:8px 11px; min-height:36px; }
.thread-button .icon { width:15px; height:15px; }
.thread-button span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-footer { display:flex; align-items:center; gap:9px; margin-top:auto; padding:17px 4px 0; border-top:1px solid var(--line); }
.avatar,.tiny-avatar { display:inline-grid; place-items:center; flex:none; border-radius:50%; background:var(--raised); color:var(--accent); }
.avatar { width:30px; height:30px; font-size:10px; }
.tiny-avatar { width:25px; height:25px; font-size:9px; }
.account { flex:1; font-size:12px; }
.account small { display:block; margin-top:2px; color:var(--muted); font-size:10px; }
.sidebar-footer .icon-button { width:28px; padding:5px; }
.workspace { display:flex; flex-direction:column; min-width:0; min-height:0; }
.topbar { position:relative; z-index:4; display:flex; align-items:center; gap:5px; height:60px; min-height:60px; padding:0 24px; background:var(--paper); border-bottom:1px solid var(--line); }
.breadcrumbs { display:flex; align-items:center; gap:9px; min-width:0; flex:1; color:var(--muted); font-size:12px; }
.breadcrumbs button { padding:5px 2px; flex:none; color:var(--muted); font-size:12px; }
.breadcrumbs button:hover { color:var(--ink); background:transparent; }
.breadcrumbs .current { color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.slash { color:var(--muted); opacity:.55; }
.control { font-size:12px; white-space:nowrap; min-height:34px; }
.control .icon { width:17px; height:17px; }
.type-size { font-size:17px; font-weight:400; padding:4px 10px; }
.save-top { display:flex; align-items:center; gap:5px; color:var(--muted); font-size:10px; margin-right:12px; white-space:nowrap; }
.save-top .icon { width:13px; height:13px; }
.topbar-rule { height:17px; border-left:1px solid var(--line); margin:0 5px; }
.topbar-note { color:var(--muted); font-size:11px; margin-left:15px; }
.top-search,.mobile-nav-toggle { display:none; }
.content-layout { display:flex; flex:1; min-height:0; overflow:hidden; position:relative; }
.reading-scroll { flex:1; min-width:0; overflow:auto; scroll-behavior:smooth; background:var(--paper); }

/* Collection cards show the material, rather than a generic icon. */
.collection { width:min(100%,1180px); padding:48px 56px 32px; margin:0 auto; }
.collection-kicker { display:flex; align-items:center; gap:9px; color:var(--muted); font-size:12px; margin-bottom:14px; }
.collection-kicker>span { width:5px; height:5px; border-radius:50%; background:var(--fill); }
.collection-header { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:38px; }
.collection-header h1 { display:flex; align-items:center; gap:15px; font-size:44px; font-weight:500; letter-spacing:-1.8px; line-height:1.12; }
.collection-total { display:grid; place-items:center; min-width:28px; height:28px; padding:0 7px; border:1px solid var(--line); border-radius:7px; color:var(--muted); font-size:13px; letter-spacing:0; font-weight:400; }
.intro { color:var(--muted); font-size:16px; font-weight:350; line-height:1.65; margin-top:13px; max-width:500px; }
.collection-header>.primary { font-size:12px; padding:10px 15px; flex:none; }
.collection-header>.primary .icon { width:17px; height:17px; }
.collection-navigation { display:flex; align-items:center; justify-content:space-between; gap:16px; border-bottom:1px solid var(--line); margin-bottom:18px; }
.collection-tabs { display:flex; align-items:center; gap:24px; min-width:0; overflow:auto; }
.collection-tabs button { position:relative; border-radius:0; color:var(--muted); padding:0 0 15px; font-size:13px; white-space:nowrap; }
.collection-tabs button:hover { color:var(--ink); background:transparent; }
.collection-tabs button.selected { color:var(--accent); }
.collection-tabs button.selected:after { content:''; position:absolute; bottom:-1px; left:0; right:0; height:2px; background:var(--fill); }
.collection-tabs button span { display:inline-block; color:var(--muted); font-size:10px; }
.collection-label { font-size:12px; color:var(--muted); padding-bottom:15px; }
.view-switch { display:flex; align-self:flex-start; flex:none; gap:2px; margin-top:-6px; }
.view-switch button { color:var(--muted); padding:7px; }
.view-switch .icon { width:16px; height:16px; }
.view-switch .selected { background:var(--raised); color:var(--accent); }
.collection-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:24px; }
.collection-search { display:flex; align-items:center; gap:9px; flex:1; min-width:0; color:var(--muted); }
.collection-search .icon { width:16px; height:16px; }
.collection-search input { border:0; background:transparent; min-width:0; width:100%; padding:7px 0; font-size:13px; outline-offset:5px; }
.collection-filters { display:flex; align-items:center; gap:12px; }
.collection-filters select { padding:7px 22px 7px 5px; border:0; background:transparent; font-size:11px; color:var(--muted); max-width:148px; }
.object-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:stretch; }
.library-card { position:relative; border:1px solid var(--line); border-radius:8px; background:var(--paper); overflow:hidden; transition:border-color 160ms,box-shadow 160ms; min-width:0; }
.library-card:hover { border-color:var(--primer-color-border); box-shadow:0 5px 18px color-mix(in srgb,var(--ink) 4%,transparent); }
.card-main { display:flex; flex-direction:column; align-items:stretch; text-align:left; width:100%; height:100%; padding:26px; border-radius:0; gap:0; }
.card-main:hover { background:transparent; }
.card-main:focus-visible { outline-offset:-3px; }
.card-eyebrow { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:11px; margin-bottom:18px; padding-right:44px; }
.card-eyebrow>.icon { width:15px; height:15px; }
.card-date { margin-left:auto; font-size:10px; }
.card-title { display:block; font-size:24px; line-height:1.25; font-weight:500; letter-spacing:-.65px; margin-bottom:13px; overflow-wrap:anywhere; }
.card-excerpt { display:block; font-size:15px; font-weight:350; line-height:1.8; color:var(--muted); }
.card-quote { display:block; margin:22px 0 0; padding:1px 0 1px 14px; border-left:2px solid var(--fill); font-size:14px; font-weight:350; line-height:1.7; color:var(--ink); }
.card-bottom { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--muted); font-size:11px; padding-top:22px; margin-top:auto; }
.card-bottom>span { display:inline-flex; align-items:center; gap:6px; }
.card-bottom>.card-relation { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block; max-width:75%; }
.card-relation .icon { vertical-align:middle; margin-right:5px; }
.card-bottom .icon { width:14px; height:14px; }
.favorite-button { border-radius:50%; width:32px; height:32px; padding:8px; }
.favorite-button .icon { width:16px; height:16px; }
.library-card>.favorite-button { position:absolute; top:15px; right:14px; }
.is-favorite .icon { fill:color-mix(in srgb,var(--accent) 12%,transparent); stroke:var(--accent); }
.featured-note { grid-column:1/-1; background:var(--canvas); }
.featured-note .card-main { padding:32px; display:grid; grid-template-columns:1.15fr .85fr; column-gap:42px; }
.featured-note .card-eyebrow,.featured-note .card-bottom { grid-column:1/-1; }
.featured-note .card-title { grid-column:1; font-size:34px; letter-spacing:-1.05px; line-height:1.2; margin-bottom:14px; }
.featured-note .card-excerpt { grid-column:1; font-size:16px; line-height:1.8; }
.featured-note .card-quote { grid-column:2; grid-row:2/4; margin:4px 0; padding:10px 0 10px 24px; align-self:center; font-size:23px; font-weight:350; line-height:1.55; letter-spacing:-.45px; }
.featured-note .card-bottom { border-top:1px solid var(--line); margin-top:25px; padding-top:16px; }
.featured-note>.favorite-button { top:21px; right:20px; }
.card-author { display:block; color:var(--muted); font-size:13px; line-height:1.6; }
.card-excerpt,.book-card-note,.card-quote,.document-subtitle,.intro,.backlink p,.project-note-list strong,.list-copy strong { overflow-wrap:anywhere; }
.author-link,.meta-item button,.context-property button { min-width:0; max-width:100%; overflow-wrap:anywhere; }
.shelf-stage { display:grid; place-items:center; padding:28px; background:var(--canvas); border-bottom:1px solid var(--line); min-height:220px; }
.book-card .card-main { padding:0; }
.shelf-copy { display:flex; flex-direction:column; flex:1; padding:24px; }
.shelf-copy .card-eyebrow { margin-bottom:9px; }
.shelf-copy .card-title { margin-bottom:5px; }
.book-card-note { color:var(--muted); font-weight:350; font-size:13px; line-height:1.75; margin-top:14px; }
.collection-book { grid-template-columns:repeat(3,minmax(0,1fr)); }
.collection-favorites .book-card .card-main { flex-direction:row; }
.collection-favorites .shelf-stage { width:35%; flex:none; padding:20px 15px; border-bottom:0; border-right:1px solid var(--line); }
.collection-favorites .shelf-stage .book-cover { width:90px; height:134px; }
.collection-favorites .shelf-stage .cover-book-title {  }
.collection-favorites .shelf-stage .cover-author { font-size:7px; }
.collection-favorites .shelf-stage .cover-edition { font-size:5px; }
.collection-favorites .shelf-copy { padding:25px 20px; min-width:0; }
.collection-favorites .book-card .favorite-button { top:12px; right:12px; }
.status-pill { display:inline-flex; align-items:center; gap:7px; width:max-content; padding:4px 9px; border-radius:20px; background:var(--raised); color:var(--accent); font-size:11px; line-height:1.5; }
.status-pill:before { content:''; width:4px; height:4px; border-radius:50%; background:currentColor; }
.book-cover { position:relative; display:flex; flex-direction:column; width:110px; height:162px; padding:14px 13px 10px 16px; background:var(--raised); color:var(--accent); border:1px solid color-mix(in srgb,var(--accent) 20%,var(--line)); border-radius:1px 3px 3px 1px; box-shadow:5px 7px 12px color-mix(in srgb,var(--ink) 8%,transparent),inset 5px 0 0 color-mix(in srgb,var(--ink) 6%,transparent); text-align:left; }
.cover-edition { font-size:5px; letter-spacing:.9px; margin-bottom:14px; }
.cover-book-title {  line-height:1.04; letter-spacing:-.7px; font-weight:550; overflow-wrap:anywhere; }
.cover-rule { width:23px; height:1px; background:currentColor; opacity:.5; margin:12px 0; }
.cover-author { font-size:7px; line-height:1.5; letter-spacing:.4px; margin-top:auto; }
.cover-mark { position:absolute; bottom:7px; right:9px; font-size:10px; opacity:.6; }
.book-cover.cover-1 { background:var(--fill); color:var(--on-fill); }
.book-cover.cover-2 { background:var(--canvas); color:var(--ink); }
.person-card-top { display:flex; align-items:center; gap:16px; margin-bottom:23px; }
.person-card-top .card-eyebrow { margin:0; }
.person-initial { display:grid; place-items:center; width:64px; height:64px; border-radius:50%; background:var(--raised); color:var(--accent); font-size:23px; font-weight:350; }
.person-card-place { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:12px; margin-top:16px; }
.person-card-place .icon { width:15px; height:15px; }
.person-card .card-title { margin-bottom:7px; }
.person-card .card-bottom { margin-top:25px; padding-top:15px; border-top:1px solid var(--line); }
.project-card .card-eyebrow { margin-bottom:23px; padding-right:38px; }
.project-card .card-eyebrow .status-pill { margin-left:auto; font-size:10px; }
.project-card .card-title { font-size:28px; }
.project-card-threads { display:grid; gap:11px; margin:23px 0; color:var(--muted); font-size:12px; }
.project-card-threads>span { display:flex; align-items:center; gap:9px; }
.project-card-threads .icon { width:14px; height:14px; }
.owner { gap:7px!important; }
.project-card .card-bottom { padding-top:17px; border-top:1px solid var(--line); }
.collection-footer { display:flex; justify-content:space-between; gap:16px; align-items:center; border-top:1px solid var(--line); color:var(--muted); font-size:11px; margin-top:32px; padding-top:18px; }
.collection-footer>span { display:flex; align-items:center; gap:7px; }
.collection-footer .icon { width:13px; height:13px; }
.view-list { display:block; }
.object-list-row { display:flex; width:100%; justify-content:flex-start; gap:16px; text-align:left; padding:19px 10px; border-bottom:1px solid var(--line); border-radius:0; }
.list-symbol { display:grid; place-items:center; width:38px; height:38px; border:1px solid var(--line); border-radius:6px; background:var(--canvas); color:var(--accent); }
.list-symbol .icon { width:18px; height:18px; }
.list-copy { min-width:0; flex:1; }
.list-copy strong { display:block; font-size:15px; font-weight:500; }
.list-copy small { display:block; font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:500px; margin-top:5px; }
.list-kind,.list-date { color:var(--muted); font-size:11px; }
.object-list-row>.icon { color:var(--muted); width:15px; height:15px; }
.empty-state { grid-column:1/-1; padding:56px 24px; text-align:center; color:var(--muted); border:1px dashed var(--line); border-radius:8px; }
.empty-state>.icon { width:28px; height:28px; margin-bottom:15px; }
.empty-state h3 { color:var(--ink); font-weight:500; font-size:20px; margin-bottom:9px; }
.empty-state p { font-size:13px; line-height:1.8; }
.empty-state button { margin-top:22px; font-size:12px; }

/* An editorial page with useful identities for each kind of object. */
.document { width:min(calc(100% - 96px),var(--reading-width)); margin:0 auto; padding:40px 0 64px; }
.type-badge { display:flex; align-items:center; gap:7px; margin-bottom:14px; font-size:11px; letter-spacing:1.1px; text-transform:uppercase; font-weight:500; color:var(--muted); }
.type-badge>.icon { width:14px; height:14px; }
.type-badge-line { height:1px; width:28px; background:var(--line); margin-left:4px; }
.title-row { display:flex; align-items:flex-start; gap:8px; }
.title-row>.favorite-button { margin-top:5px; margin-right:-7px; }
.document-title { flex:1; min-width:0; outline:none; font-size:43px; font-weight:500; line-height:1.13; letter-spacing:-1.5px; overflow-wrap:anywhere; }
.document-subtitle { margin-top:13px; color:var(--muted); font-size:17px; font-weight:350; line-height:1.65; outline:none; }
.document-subtitle:empty:before { content:'Add a little context…'; color:var(--muted); opacity:.7; }
.meta-row { display:flex; flex-wrap:wrap; align-items:center; gap:16px 22px; margin-top:25px; padding:0 0 25px; border-bottom:1px solid var(--line); }
.meta-item { display:flex; align-items:center; gap:9px; color:var(--muted); font-size:12px; }
.meta-item>span { font-size:11px; }
.meta-item button { gap:6px; padding:3px 0; color:var(--accent); font-size:12px; }
.meta-item button.status-pill { padding:4px 9px; }
.meta-item .icon { width:14px; height:14px; }
.more-properties { margin-left:auto; padding:3px 0; color:var(--muted); font-size:11px; gap:3px; }
.more-properties>.icon { width:12px; height:12px; }
.note-identity:has(.cover:not([hidden])) { display:grid; grid-template-columns:minmax(0,1fr) 136px; column-gap:24px; grid-template-areas:'identity image' 'meta meta'; }
.note-identity .object-title-block { grid-area:identity; }
.note-identity .meta-row { grid-area:meta; }
.cover { grid-area:image; height:130px; overflow:hidden; border-radius:6px; align-self:center; position:relative; }
.cover img { width:100%; height:100%; object-fit:cover; object-position:68% 65%; display:block; }
.cover-caption { display:none; }
.note-identity .document-title { font-size:39px; }
.writing-body { position:relative; margin-top:27px; }
.writing-header { display:flex; align-items:center; justify-content:space-between; height:32px; margin-bottom:23px; }
.write-button { font-size:11px; color:var(--muted); padding:6px 0 6px 10px; }
.write-button .icon { width:13px; height:13px; }
.editor-toolbar { display:none; position:absolute; top:-3px; left:0; z-index:2; align-items:center; gap:2px; padding:4px 7px; border:1px solid var(--line); border-radius:7px; background:var(--paper); box-shadow:0 5px 18px color-mix(in srgb,var(--ink) 5%,transparent); max-width:100%; }
.writing-body:has(.editor:focus,.editor-toolbar:focus-within) .editor-toolbar { display:flex; }
.writing-body:has(.editor:focus,.editor-toolbar:focus-within) .writing-header { visibility:hidden; }
.editor-toolbar button { padding:4px 7px; height:28px; min-width:28px; font-size:12px; }
.editor-toolbar .icon { width:15px; height:15px; }
.toolbar-separator { border-left:1px solid var(--line); height:15px; margin:0 4px; }
.toolbar-caption { color:var(--muted); font-size:10px; padding:0 6px; }
.editor { font-size:var(--reading-size); font-weight:350; line-height:1.8; letter-spacing:.005em; outline:none; min-height:180px; overflow-wrap:anywhere; caret-color:var(--accent); }
.editor:focus-visible { outline:none; }
.editor h2 { font-size:calc(var(--reading-size) * 1.4); line-height:1.3; font-weight:500; letter-spacing:-.55px; margin:32px 0 16px; scroll-margin-top:25px; }
.editor h2:first-child { margin-top:0; }
.editor h3 { font-size:calc(var(--reading-size) * 1.13); font-weight:500; margin:27px 0 14px; }
.editor p { margin:0 0 22px; }
.editor strong,.editor b { font-weight:550; }
.editor blockquote { margin:27px 0 32px; padding:15px 0 15px 22px; border-left:2px solid var(--fill); font-size:calc(var(--reading-size) * 1.04); font-weight:350; line-height:1.7; letter-spacing:-.15px; }
.editor ul,.editor ol { padding-left:23px; margin:14px 0 26px; }
.editor li { margin:8px 0; padding-left:4px; }
.editor hr { border:0; border-top:1px solid var(--line); margin:32px 0; }
.editor a.object-link { color:var(--accent); text-decoration:none; border-bottom:1px solid color-mix(in srgb,var(--accent) 35%,transparent); padding:0 1px; cursor:pointer; }
.editor a.object-link:before { content:'↗'; font-size:.7em; margin-right:3px; }
.editor a.object-link:hover { background:var(--raised); }
.editor:empty:before { content:'Start with a thought. Type / for blocks, or @ to make a connection.'; color:var(--muted); pointer-events:none; }
.editor .checklist { padding-left:0; list-style:none; }
.editor .checklist li { display:flex; align-items:flex-start; gap:11px; padding:0; }
.editor input[type=checkbox] { width:17px; height:17px; margin:8px 0 0; padding:0; accent-color:var(--fill); flex:none; cursor:pointer; }
.editor .checklist li:has(input:checked)>span { color:var(--muted); text-decoration:line-through; }
.editor-footer { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:10px; margin-top:32px; padding-top:16px; border-top:1px solid var(--line); }
.editor-footer .icon { width:13px; height:13px; }
.word-count { margin-left:auto; }
.document-end { border-top:1px solid var(--line); margin-top:38px; padding-top:26px; }
.section-heading { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-bottom:16px; }
.section-heading h2 { font-size:20px; letter-spacing:-.4px; font-weight:400; margin-top:8px; }
.connection-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 24px; }
.mini-object { display:flex; justify-content:flex-start; text-align:left; width:100%; padding:13px 0; gap:10px; border-bottom:1px solid var(--line); border-radius:0; }
.mini-object>.icon:first-child { width:18px; height:18px; color:var(--accent); }
.mini-object>span { flex:1; min-width:0; font-size:13px; }
.mini-object small { display:block; font-size:10px; color:var(--muted); margin-top:3px; }
.mini-object>.icon:last-child { width:13px; height:13px; color:var(--muted); }
.book-identity { display:grid; grid-template-columns:160px minmax(0,1fr); gap:31px; align-items:center; margin-bottom:27px; }
.book-stage { display:grid; place-items:center; padding:21px 12px; background:var(--canvas); border-radius:7px; }
.book-stage .book-cover { width:126px; height:186px; padding:18px 15px 13px 18px; }
.book-stage .cover-book-title {  }
.book-stage .cover-edition { font-size:6px; margin-bottom:18px; }
.book-stage .cover-author { font-size:8px; }
.book-stage .cover-rule { margin:15px 0; }
.book-identity .document-title { font-size:43px; }
.book-identity .document-subtitle { font-size:15px; }
.book-properties { display:flex; flex-wrap:wrap; align-items:center; gap:12px 16px; margin-top:20px; }
.author-link { justify-content:flex-start; color:var(--accent); padding:0; font-size:13px; gap:8px; }
.author-link .icon { width:12px; height:12px; }
.book-properties>.author-link { width:100%; }
.rating { font-size:13px; letter-spacing:1px; color:var(--accent); padding:2px 0; }
.reading-bridge { display:flex; align-items:center; flex-wrap:wrap; gap:8px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:15px 0; color:var(--muted); font-size:12px; }
.reading-bridge>.icon { width:15px; height:15px; }
.reading-bridge button { font-size:12px; color:var(--accent); margin-left:auto; padding:3px 0; }
.reading-bridge button .icon { width:13px; height:13px; }
.person-identity { display:grid; grid-template-columns:104px minmax(0,1fr); gap:27px; align-items:center; padding:5px 0 26px; }
.portrait { display:grid; place-items:center; position:relative; width:104px; height:104px; border-radius:50%; font-size:36px; font-weight:300; letter-spacing:-1.5px; color:var(--accent); background:var(--raised); border:5px solid var(--canvas); }
.portrait-mark { position:absolute; bottom:-3px; right:-3px; display:grid; place-items:center; width:28px; height:28px; border:3px solid var(--paper); border-radius:50%; background:var(--canvas); }
.portrait-mark .icon { width:13px; height:13px; }
.person-identity .document-title { font-size:40px; }
.person-identity .document-subtitle { font-size:15px; }
.profile-facts { display:flex; align-items:center; flex-wrap:wrap; gap:12px 20px; padding:17px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); color:var(--muted); font-size:12px; }
.profile-facts button { font-size:12px; color:var(--accent); padding:2px 0; }
.profile-facts .icon { width:14px; height:14px; }
.profile-facts>span { margin-left:auto; font-size:11px; }
.profile-thread { padding:22px 24px; margin-top:25px; background:var(--canvas); border-radius:7px; }
.profile-thread button { display:block; text-align:left; padding:12px 0 0; width:100%; }
.profile-thread button:hover { background:transparent; }
.profile-thread strong { font-size:20px; font-weight:400; letter-spacing:-.5px; }
.profile-thread p { color:var(--muted); font-size:14px; font-weight:350; line-height:1.75; margin:9px 0 13px; }
.profile-thread button>span { display:flex; align-items:center; gap:7px; color:var(--accent); font-size:11px; }
.profile-thread .icon { width:13px; height:13px; }
.project-identity { padding:5px 0 27px; border-bottom:1px solid var(--line); }
.project-kicker { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:11px; margin-bottom:24px; }
.project-kicker>.icon { width:17px; height:17px; color:var(--accent); }
.project-identity .type-badge { display:none; }
.project-facts { display:flex; align-items:center; flex-wrap:wrap; gap:15px; margin-top:24px; }
.project-facts>span { margin-left:auto; color:var(--muted); font-size:11px; }
.project-material { margin:25px 0 29px; }
.material-count { color:var(--muted); font-size:11px; }
.project-note-list { border-top:1px solid var(--line); }
.project-note-list button { display:flex; gap:12px; width:100%; justify-content:flex-start; padding:14px 0; text-align:left; border-bottom:1px solid var(--line); border-radius:0; }
.project-note-list button>span { flex:1; min-width:0; }
.project-note-list strong { display:block; font-size:14px; font-weight:400; }
.project-note-list small { display:block; margin-top:4px; color:var(--muted); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.project-note-list .icon { width:16px; height:16px; color:var(--accent); }
.project-note-list .icon:last-child { width:12px; height:12px; color:var(--muted); }
.more-material summary { padding:13px 0; color:var(--accent); font-size:12px; cursor:pointer; }
.more-material[open] summary { border-bottom:1px solid var(--line); }

/* A quiet, optional margin and the alternate object browser. */
.context-panel { flex:0 0 var(--context-width); padding:27px 23px; background:var(--canvas); border-left:1px solid var(--line); overflow:auto; }
.context-heading { display:flex; align-items:center; justify-content:space-between; font-size:13px; margin-bottom:29px; }
.context-heading .icon-button { width:25px; height:25px; padding:5px; margin-right:-5px; }
.context-heading .icon { width:15px; height:15px; }
.context-section { padding-bottom:25px; margin-bottom:25px; border-bottom:1px solid var(--line); }
.context-section:last-child { border-bottom:0; }
.context-section>.eyebrow { display:flex; align-items:center; gap:8px; margin-bottom:15px; font-size:10px; }
.context-section>.eyebrow>span { font-size:10px; letter-spacing:0; }
.outline-link { justify-content:flex-start; display:block; width:100%; text-align:left; font-size:12px; line-height:1.7; color:var(--muted); padding:6px 0; border-radius:0; }
.outline-link:first-of-type { color:var(--ink); }
.context-object { display:flex; align-items:center; gap:10px; justify-content:flex-start; width:100%; padding:10px 0; text-align:left; }
.context-object>.icon { width:18px; height:18px; color:var(--accent); }
.object-info { font-size:13px; flex:1; min-width:0; overflow-wrap:anywhere; }
.object-info small { display:block; color:var(--muted); font-size:10px; margin-top:2px; }
.context-object>.icon:last-child { width:12px; height:12px; color:var(--muted); }
.context-edit { font-size:11px; color:var(--accent); padding:7px 0 0; justify-content:flex-start; }
.context-edit .icon { width:12px; height:12px; }
.backlink { display:block; width:100%; text-align:left; padding:10px 0; }
.backlink>span { display:flex; gap:7px; align-items:flex-start; font-size:12px; line-height:1.6; }
.backlink .icon { width:13px; height:13px; color:var(--muted); margin-top:3px; }
.backlink p { color:var(--muted); font-size:11px; font-weight:350; line-height:1.7; padding-left:20px; margin-top:5px; }
.context-empty { color:var(--muted); font-size:12px; line-height:1.85; }
.context-property { display:grid; grid-template-columns:1fr; gap:2px; margin:14px 0; }
.context-property>span { font-size:10px; color:var(--muted); }
.context-property button { justify-content:flex-start; text-align:left; font-size:12px; color:var(--accent); padding:2px 0; }
.browser-panel { width:264px; flex:none; border-right:1px solid var(--line); padding:25px 17px; background:var(--canvas); overflow:auto; }
.browser-heading-row { display:flex; align-items:center; justify-content:space-between; margin:0 3px 17px; }
.browser-heading-row h2 { font-size:21px; letter-spacing:-.5px; font-weight:500; }
.browser-heading-row .icon-button { width:25px; height:25px; padding:5px; }
.browser-heading-row .icon { width:15px; height:15px; }
.browser-search { width:100%; font-size:12px; border-color:var(--line); }
.browser-tab { font-size:10px; color:var(--muted); padding:17px 8px 12px; border-bottom:1px solid var(--line); }
.note-preview { display:block; width:100%; text-align:left; padding:17px 12px; border-bottom:1px solid var(--line); border-radius:0; }
.note-preview.active { border-radius:6px; background:var(--raised); border-bottom-color:transparent; }
.preview-date { display:block; font-size:10px; color:var(--muted); }
.note-preview strong { display:block; font-size:13px; font-weight:500; line-height:1.5; margin:6px 0; }
.note-preview p { font-size:12px; font-weight:350; color:var(--muted); line-height:1.75; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.focus-mode .shell { grid-template-columns:minmax(0,1fr); }
.focus-mode .sidebar,.focus-mode .context-panel,.focus-mode .browser-panel { display:none!important; }
.focus-mode .document { padding-top:48px; }
.focus-mode .document-end { display:none; }
.focus-mode .topbar { border-bottom-color:transparent; }
.focus-mode .breadcrumbs,.focus-mode .save-top,.focus-mode .top-search,.focus-mode .browser-toggle,.focus-mode .context-toggle,.focus-mode .mobile-nav-toggle { visibility:hidden; }
.focus-mode .focus-control { color:var(--accent); }
.focus-mode .cover { display:none; }
.focus-mode .note-identity:has(.cover) { display:block; }
.focus-mode .book-stage,.focus-mode .portrait,.focus-mode .profile-thread,.focus-mode .project-material,.focus-mode .reading-bridge,.focus-mode .meta-row,.focus-mode .profile-facts,.focus-mode .project-facts,.focus-mode .book-properties { display:none; }
.focus-mode .book-identity,.focus-mode .person-identity { display:block; }

/* Native dialogs keep search and property editing on one interaction model. */
dialog { width:min(550px,calc(100% - 32px)); max-height:min(720px,88dvh); overflow:auto; padding:0; border:1px solid var(--line); border-radius:12px; background:var(--paper); color:var(--ink); box-shadow:0 24px 90px #11111025; }
dialog::backdrop { background:#11111040; backdrop-filter:blur(3px); }
.dialog-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:21px 25px 17px; border-bottom:1px solid var(--line); }
.dialog-header h2 { font-size:20px; letter-spacing:-.6px; font-weight:500; }
.dialog-body { padding:25px; }
.dialog-intro { color:var(--muted); font-size:13px; line-height:1.85; margin-bottom:23px; }
.dialog-field { display:grid; gap:8px; margin-bottom:20px; font-size:13px; }
.dialog-field>span { font-size:12px; color:var(--muted); }
.dialog-field input,.dialog-field select { width:100%; min-height:42px; }
.dialog-field input[type=checkbox] { min-height:0; accent-color:var(--fill); }
.dialog-actions { display:flex; justify-content:flex-end; gap:8px; border-top:1px solid var(--line); padding-top:18px; margin-top:24px; }
.dialog-actions button { min-height:39px; font-size:13px; }
.dialog-search { display:flex; align-items:center; gap:12px; padding:19px 25px; border-bottom:1px solid var(--line); }
.dialog-search .icon { color:var(--muted); }
.dialog-search input { border:0; background:transparent; flex:1; min-width:0; font-size:17px; padding:3px; outline:none; }
.search-results { padding:8px; max-height:365px; overflow:auto; }
.search-result { display:flex; align-items:center; justify-content:flex-start; width:100%; gap:14px; padding:14px 17px; text-align:left; }
.search-result>.icon { color:var(--accent); width:19px; height:19px; }
.result-copy { flex:1; min-width:0; font-size:14px; }
.result-copy small { display:block; color:var(--muted); font-size:11px; line-height:1.65; margin-top:4px; }
.search-result>.icon:last-child { width:13px; height:13px; color:var(--muted); }
.search-result.selected,.search-result:focus { background:var(--raised); }
.dialog-footnote { color:var(--muted); font-size:11px; border-top:1px solid var(--line); padding:13px 25px; }
.appearance-row { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-bottom:25px; font-size:13px; }
.appearance-row label { color:var(--muted); }
.segmented { display:flex; background:var(--canvas); border:1px solid var(--line); border-radius:6px; padding:3px; }
.segmented button { padding:6px 11px; font-size:12px; }
.segmented .icon { width:15px; height:15px; }
.segmented .selected { color:var(--accent); background:var(--paper); box-shadow:0 1px 4px #1111100c; }
.size-stepper { display:flex; align-items:center; gap:12px; }
.size-stepper button { width:31px; height:31px; border:1px solid var(--line); padding:0; font-size:18px; }
.size-stepper output { min-width:36px; text-align:center; font-size:13px; }
.appearance-example { background:var(--canvas); border:1px solid var(--line); border-radius:6px; padding:20px; font-size:var(--reading-size); font-weight:350; line-height:1.8; }
.appearance-example strong { display:block; font-weight:500; font-size:1.15em; margin-bottom:9px; }
.insert-list { display:grid; gap:5px; }
.insert-list button { justify-content:flex-start; text-align:left; padding:12px; font-size:14px; }
.insert-list small { color:var(--muted); margin-left:auto; font-size:11px; }
.navigation-dialog .eyebrow { padding:20px 11px 10px; }
.navigation-dialog .nav-button { min-height:43px; }
.navigation-dialog>.primary { margin-top:25px; width:100%; }
#toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); max-width:calc(100% - 32px); padding:12px 18px; background:var(--ink); color:var(--canvas); border-radius:7px; font-size:12px; text-align:center; z-index:30; opacity:0; pointer-events:none; transition:opacity 120ms; }
#toast.show { opacity:1; }

@media(min-width:1600px) {
  :root { --nav-width:240px; --context-width:280px; }
  .sidebar { padding-left:20px; padding-right:20px; }
  .context-panel { padding-left:28px; padding-right:28px; }
  .collection { padding-top:56px; }
}
@media(max-width:1300px) {
  .save-top { display:none; }
  .collection { padding-left:40px; padding-right:40px; }
  .featured-note .card-main { column-gap:30px; }
  .collection-book { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .collection-favorites .book-card .card-main { flex-direction:column; }
  .collection-favorites .shelf-stage { width:100%; border-right:0; border-bottom:1px solid var(--line); min-height:200px; }
  .collection-favorites .shelf-stage .book-cover { width:110px; height:162px; }
}
@media(max-width:1100px) {
  :root { --nav-width:184px; --context-width:225px; }
  .sidebar { padding:24px 11px 17px; }
  .brand { font-size:18px; gap:6px; padding:0 6px; letter-spacing:-.7px; }
  .brand-mark { width:20px; height:24px; }
  .workspace-name { font-size:10px; padding-left:32px; margin-bottom:26px; }
  .sidebar-search { gap:7px; font-size:11px; padding:9px; }
  .sidebar-search kbd { display:none; }
  .nav-button { font-size:12px; gap:9px; padding-left:10px; padding-right:10px; }
  .thread-button { font-size:11px; gap:7px; }
  .account small { font-size:9px; }
  .sidebar-footer { gap:7px; }
  .topbar { padding:0 16px; gap:3px; }
  .topbar .control-label { display:none; }
  .topbar .control { padding:7px 8px; }
  .topbar-note { display:none; }
  .export-control { display:none; }
  .document { width:min(calc(100% - 64px),var(--reading-width)); padding-top:32px; }
  .document-title,.book-identity .document-title { font-size:36px; }
  .note-identity .document-title { font-size:35px; }
  .note-identity:has(.cover:not([hidden])) { grid-template-columns:minmax(0,1fr) 110px; gap:0 20px; }
  .cover { height:124px; }
  .collection { padding:36px 32px 28px; }
  .collection-header { margin-bottom:32px; }
  .collection-header h1 { font-size:39px; }
  .intro { font-size:15px; }
  .featured-note .card-main { display:flex; padding:27px; }
  .featured-note .card-title { font-size:29px; }
  .featured-note .card-quote { font-size:17px; margin-top:20px; padding:2px 0 2px 15px; }
  .featured-note .card-bottom { margin-top:22px; }
  .collection-favorites .book-card .card-main { flex-direction:row; }
  .collection-favorites .shelf-stage { width:35%; min-height:0; border-bottom:0; border-right:1px solid var(--line); }
  .collection-favorites .shelf-stage .book-cover { width:80px; height:122px; }
  .collection-favorites .shelf-stage .cover-book-title {  }
  .collection-favorites .shelf-copy { padding:23px 18px; }
  .book-identity { grid-template-columns:135px minmax(0,1fr); gap:24px; }
  .book-stage { padding:17px 8px; }
  .book-stage .book-cover { width:110px; height:164px; padding:15px; }
  .book-stage .cover-book-title {  }
  .person-identity { grid-template-columns:85px minmax(0,1fr); gap:21px; }
  .portrait { width:85px; height:85px; font-size:30px; }
  .person-identity .document-title { font-size:35px; }
  .profile-facts>span { width:100%; margin-left:0; }
  .connection-list { column-gap:18px; }
}
@media(max-width:1000px) {
  .context-panel { display:none; }
  .context-requested .context-panel { display:block; position:fixed; z-index:8; top:60px; bottom:0; right:0; width:280px; box-shadow:-20px 0 50px #11111018; }
  .browser-panel { width:245px; }
  .breadcrumb-root,.breadcrumb-root+.slash { display:none; }
  .collection-header>.primary { font-size:11px; padding:9px 12px; }
  .object-grid { grid-template-columns:minmax(0,1fr); gap:18px; }
  .collection-book,.collection-person { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .collection-favorites .shelf-stage { width:32%; min-height:200px; }
  .collection-favorites .shelf-stage .book-cover { width:100px; height:150px; }
  .collection-favorites .shelf-stage .cover-book-title {  }
  .collection-favorites .shelf-copy { padding:26px; }
  .collection-footer>span:last-child { font-size:10px; }
  .context-requested.focus-mode .context-panel { display:none; }
}
@media(max-width:900px) {
  .browser-panel { position:fixed; z-index:7; top:60px; left:var(--nav-width); bottom:0; width:260px; box-shadow:20px 0 50px #11111018; }
  .collection { padding:32px 24px 26px; }
  .collection-header { align-items:flex-start; gap:15px; }
  .collection-header h1 { font-size:37px; }
  .collection-kicker { font-size:11px; }
  .collection-header>.primary { font-size:0; width:36px; height:36px; min-height:36px; padding:8px; margin-top:25px; }
  .collection-header>.primary .icon { width:19px; height:19px; }
  .collection-tabs { gap:21px; }
  .collection-filters { gap:4px; }
  .collection-filters select { max-width:125px; font-size:11px; }
  .collection-book,.collection-person { grid-template-columns:minmax(0,1fr); }
  .collection-book .book-card .card-main { flex-direction:row; }
  .collection-book .shelf-stage { width:35%; min-height:220px; padding:24px 12px; border-bottom:0; border-right:1px solid var(--line); }
  .collection-book .shelf-copy { padding:26px; min-width:0; }
  .collection-book .shelf-stage .book-cover { width:92px; height:140px; }
  .collection-book .shelf-stage .cover-book-title {  }
  .collection-footer>span:last-child { max-width:210px; line-height:1.6; }
}
@media(max-width:740px) {
  .document { width:calc(100% - 48px); padding-top:28px; }
  .document-title,.book-identity .document-title,.person-identity .document-title { font-size:32px; letter-spacing:-1px; }
  .note-identity .document-title { font-size:32px; }
  .document-subtitle { font-size:16px; margin-top:11px; }
  .note-identity:has(.cover:not([hidden])) { grid-template-columns:minmax(0,1fr) 86px; gap:0 17px; }
  .cover { height:116px; }
  .type-badge { font-size:10px; margin-bottom:12px; }
  .title-row>.favorite-button { position:absolute; top:-4px; right:-4px; margin:0; }
  .object-title-block { position:relative; padding-top:0; }
  .object-title-block>.type-badge { padding-right:32px; }
  .meta-row { gap:11px 16px; margin-top:23px; padding-bottom:22px; }
  .meta-item { font-size:12px; gap:7px; }
  .meta-item>span { display:none; }
  .meta-item button { font-size:12px; }
  .more-properties { font-size:11px; }
  .writing-body { margin-top:23px; }
  .editor h2 { font-size:25px; }
  .connection-list { grid-template-columns:minmax(0,1fr); }
  .collection-header h1 { font-size:36px; }
  .collection-kicker { font-size:10px; }
  .collection-header .intro { font-size:14px; line-height:1.7; }
  .collection-header { margin-bottom:27px; }
  .collection-tabs button { font-size:12px; }
  .collection-toolbar { margin-bottom:18px; gap:10px; }
  .collection-filters select { max-width:117px; font-size:10px; }
  .collection-search { gap:7px; }
  .collection-search input { font-size:12px; }
  .collection-filters:has(#collection-status) { gap:0; }
  .collection-filters:has(#collection-status) #collection-sort { max-width:90px; }
  .card-main { padding:23px; }
  .card-title { font-size:24px; }
  .featured-note .card-main { padding:25px; }
  .featured-note .card-title { font-size:29px; }
  .featured-note .card-excerpt { font-size:15px; }
  .featured-note .card-quote { font-size:16px; }
  .card-date { font-size:10px; }
  .collection-favorites .shelf-stage { width:32%; padding:19px 10px; }
  .collection-favorites .shelf-stage .book-cover { width:80px; height:122px; }
  .collection-favorites .shelf-stage .cover-book-title {  }
  .collection-favorites .shelf-copy { padding:24px 20px; }
  .collection-footer { font-size:10px; }
  .list-kind,.list-date { display:none; }
  .object-list-row { gap:11px; }
  .list-copy strong { font-size:14px; }
  .list-copy small { font-size:11px; max-width:250px; }
  .book-identity { grid-template-columns:115px minmax(0,1fr); gap:20px; }
  .book-stage { padding:16px 8px; }
  .book-stage .book-cover { width:92px; height:145px; padding:14px 12px; }
  .book-stage .cover-book-title {  }
  .book-stage .cover-edition { font-size:5px; margin-bottom:13px; }
  .book-stage .cover-author { font-size:7px; }
  .book-identity .document-subtitle,.person-identity .document-subtitle { font-size:14px; }
  .book-properties { gap:11px; }
  .author-link { font-size:12px; }
  .reading-bridge { gap:8px; font-size:11px; }
  .reading-bridge button { width:100%; justify-content:flex-start; margin-left:22px; font-size:12px; }
  .person-identity { grid-template-columns:73px minmax(0,1fr); gap:20px; }
  .portrait { width:73px; height:73px; font-size:26px; border-width:4px; }
  .profile-thread { padding:21px; }
  .profile-thread strong { font-size:20px; }
  .project-facts>span { width:100%; margin-left:0; }
  .project-card .card-title { font-size:27px; }
  .project-kicker { font-size:10px; }
  .editor-footer { flex-wrap:wrap; }
  .word-count { font-size:10px; }
  .topbar { padding:0 12px; gap:1px; }
  .topbar-rule { margin:0 3px; }
  .topbar .icon-button { width:31px; height:33px; padding:7px; }
  .topbar .icon-button .icon { width:17px; height:17px; }
  .breadcrumbs { gap:7px; font-size:11px; }
  .breadcrumbs button { font-size:11px; }
  .type-size { padding:5px 8px; }
}
@media(max-width:520px) {
  .shell { grid-template-columns:minmax(0,1fr); }
  .sidebar { display:none; }
  .mobile-nav-toggle,.top-search { display:inline-flex; }
  .topbar { padding:0 12px; height:56px; min-height:56px; gap:3px; }
  .topbar .icon-button { width:34px; height:36px; padding:8px; }
  .topbar .browser-toggle,.topbar-rule,.breadcrumbs .object-crumb,.breadcrumbs .current { display:none; }
  .breadcrumbs { padding-left:5px; }
  .breadcrumbs button { font-size:12px; color:var(--ink); }
  .document { width:calc(100% - 40px); padding-top:27px; }
  .document-title,.note-identity .document-title,.person-identity .document-title { font-size:33px; }
  .note-identity:has(.cover:not([hidden])) { display:block; }
  .note-identity .cover { display:none; }
  .document-subtitle { font-size:16px; }
  .meta-row { gap:10px 17px; }
  .editor { font-size:var(--reading-size); line-height:1.8; }
  .toolbar-caption { display:none; }
  .editor-toolbar { padding:4px 5px; gap:1px; }
  .editor-toolbar button { min-width:30px; padding:5px 7px; }
  .collection { padding:30px 20px 24px; }
  .collection-header h1 { font-size:39px; }
  .collection-header { gap:12px; }
  .collection-kicker { font-size:11px; }
  .collection-kicker>span { width:4px; height:4px; }
  .collection-header .intro { font-size:14px; }
  .collection-header>.primary { margin-top:29px; width:38px; height:38px; }
  .collection-tabs { gap:24px; }
  .collection-tabs button { font-size:13px; }
  .collection-label { font-size:11px; }
  .featured-note .card-main,.card-main { padding:23px; }
  .featured-note .card-title { font-size:28px; }
  .featured-note .card-quote { margin-top:21px; font-size:17px; }
  .featured-note .card-bottom { margin-top:23px; }
  .card-excerpt { font-size:15px; }
  .collection-favorites .book-card .card-main,.collection-book .book-card .card-main { flex-direction:row; }
  .collection-book .shelf-stage,.collection-favorites .shelf-stage { width:32%; padding:20px 10px; min-height:215px; }
  .collection-book .shelf-stage .book-cover,.collection-favorites .shelf-stage .book-cover { width:78px; height:122px; }
  .collection-book .shelf-stage .cover-book-title,.collection-favorites .shelf-stage .cover-book-title {  }
  .collection-book .shelf-copy,.collection-favorites .shelf-copy { padding:23px 18px; }
  .shelf-copy .card-title { font-size:24px; }
  .book-card-note { font-size:12px; }
  .collection-toolbar:has(#collection-status) { flex-wrap:wrap; }
  .collection-toolbar:has(#collection-status) .collection-search { flex-basis:100%; }
  .collection-toolbar:has(#collection-status) .collection-filters { justify-content:space-between; width:100%; }
  .collection-filters:has(#collection-status) #collection-sort { max-width:148px; }
  .collection-footer { align-items:flex-start; }
  .collection-footer>span:last-child { max-width:190px; text-align:right; justify-content:flex-end; }
  .book-identity { grid-template-columns:108px minmax(0,1fr); gap:20px; }
  .book-identity .document-title { font-size:32px; }
  .book-stage .book-cover { width:87px; height:142px; padding:14px 11px; }
  .book-stage .cover-book-title {  }
  .book-identity .type-badge-line { display:none; }
  .book-properties .tiny-avatar { display:none; }
  .rating { font-size:11px; }
  .person-identity { grid-template-columns:68px minmax(0,1fr); gap:19px; }
  .portrait { width:68px; height:68px; }
  .profile-facts { font-size:11px; gap:12px 18px; }
  .profile-facts button { font-size:11px; }
  .context-requested .context-panel { top:56px; width:min(310px,calc(100% - 32px)); }
  .browser-panel { left:0; top:56px; width:min(300px,calc(100% - 32px)); }
  .focus-mode .topbar { justify-content:flex-end; }
  .focus-mode .breadcrumbs,.focus-mode .mobile-nav-toggle,.focus-mode .top-search { display:none; }
  .focus-mode .document { padding-top:25px; }
  .dialog-header,.dialog-body { padding:20px; }
  .dialog-header h2 { font-size:19px; }
  .appearance-row { font-size:12px; gap:10px; }
  .segmented button { padding:6px 8px; font-size:11px; }
  .insert-list button { padding:12px 5px; font-size:13px; }
  .insert-list small { font-size:10px; }
}
@media(prefers-reduced-motion:reduce) { *,*:before,*:after { transition:none!important; scroll-behavior:auto!important; } }

/* Cover lettering scales with its own content box, preserving whole words. */
.book-cover { container-type:inline-size; }
.book-cover .cover-book-title { font-size:min(26px,calc(180cqi / var(--longest-word,6))); overflow-wrap:normal; }

/* Longer notes: each material keeps its own reading rhythm. */
.writing-controls { position:sticky; top:0; z-index:3; height:55px; background:var(--paper); padding-top:4px; }
.writing-controls .writing-header { margin-bottom:0; }
.writing-controls .editor-toolbar { top:0; }
.writing-body:has(.editor:focus,.editor-toolbar:focus-within) .writing-controls { box-shadow:0 8px 12px var(--paper); }
.editor figure { margin:32px 0 36px; }
.editor figure img { display:block; width:100%; height:auto; max-height:580px; object-fit:contain; border-radius:6px; background:var(--canvas); }
.editor figcaption { color:var(--muted); font-size:13px; line-height:1.7; font-weight:350; margin:12px 0 0; max-width:94%; }
.editor .table-wrap { max-width:100%; overflow-x:auto; margin:26px 0 32px; border:1px solid var(--line); border-radius:6px; scroll-margin-top:65px; }
.editor table { border-collapse:collapse; width:100%; min-width:560px; font-size:14px; line-height:1.7; font-weight:350; letter-spacing:0; }
.editor caption { padding:14px 18px; text-align:left; font-size:13px; font-weight:500; border-bottom:1px solid var(--line); }
.editor th,.editor td { padding:14px 18px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.editor thead th { font-weight:500; background:var(--canvas); font-size:12px; color:var(--muted); }
.editor tbody th { font-weight:500; width:24%; }
.editor tr:last-child td,.editor tr:last-child th { border-bottom:0; }
.editor code { font-family:var(--primer-font-mono,ui-monospace,monospace); font-size:.78em; font-weight:400; background:var(--raised); padding:2px 5px; border-radius:4px; letter-spacing:0; }
.editor pre { max-width:100%; overflow-x:auto; background:var(--canvas); border:1px solid var(--line); border-radius:6px; padding:23px 24px; margin:27px 0 30px; font-family:var(--primer-font-mono,ui-monospace,monospace); font-size:13px; font-weight:400; line-height:1.85; letter-spacing:0; overflow-wrap:normal; tab-size:2; scroll-margin-top:65px; }
.editor pre code { font:inherit; padding:0; background:transparent; border-radius:0; white-space:pre; }
.editor figure,.editor table { scroll-margin-top:65px; }
.editor h2,.editor h3 { scroll-margin-top:70px; }
.editor h3 { line-height:1.45; }
.editor h2:not(:first-child) { margin-top:40px; }
.editor a:not(.object-link) { text-underline-offset:4px; }
.dialog-field textarea { width:100%; resize:vertical; min-height:190px; padding:14px; border:1px solid var(--primer-color-border); border-radius:6px; background:var(--canvas); font:13px/1.8 var(--primer-font-mono,ui-monospace,monospace); }
textarea:focus-visible,.table-wrap:focus-visible { outline:2px solid var(--primer-color-focus); outline-offset:3px; }
.form-message { font-size:13px; color:var(--primer-color-error); }

/* The margin is a page map. Incoming mentions have one home after the writing. */
.context-panel { padding-top:28px; }
.outline-link { position:relative; padding:7px 0 7px 14px; font-size:12px; line-height:1.65; border-left:1px solid var(--line); }
.outline-link:first-of-type { color:var(--muted); }
.outline-link.outline-nested { padding-left:25px; font-size:11px; }
.outline-link.active { border-left:2px solid var(--fill); padding-left:13px; color:var(--accent); }
.outline-link.outline-nested.active { padding-left:24px; }
.material-jump { display:block; width:100%; text-align:left; padding:9px 0; }
.material-jump>span { display:block; font-size:10px; color:var(--muted); margin-bottom:3px; }
.material-jump>strong { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:12px; line-height:1.65; font-weight:400; }
.reading-progress { color:var(--muted); font-size:10px; margin-top:27px; }
.reading-progress>div { display:flex; justify-content:space-between; gap:8px; }
.reading-progress progress { display:block; appearance:none; width:100%; height:3px; margin-top:12px; border:0; border-radius:2px; color:var(--fill); background:var(--line); }
.reading-progress progress::-webkit-progress-bar { background:var(--line); border-radius:2px; }
.reading-progress progress::-webkit-progress-value { background:var(--fill); border-radius:2px; }
.reading-progress p { margin-top:20px; line-height:1.9; }
.mention-count { margin-left:7px; color:var(--muted); font-size:13px; }
.mention-list { display:grid; gap:0; }
.mention-card { display:block; width:100%; border-bottom:1px solid var(--line); border-radius:0; text-align:left; padding:20px 0; }
.mention-source { display:flex; align-items:flex-start; gap:10px; }
.mention-source>.icon { width:16px; height:16px; color:var(--accent); margin-top:3px; }
.mention-source>.icon:last-child { margin-left:auto; width:13px; flex:none; color:var(--muted); }
.mention-source strong { font-size:15px; font-weight:500; line-height:1.6; overflow-wrap:anywhere; }
.mention-card p { margin:9px 24px 9px 26px; font-size:14px; color:var(--muted); font-weight:350; line-height:1.75; }
.mention-card>small { display:block; margin-left:26px; font-size:10px; color:var(--accent); }
.load-mentions { margin-top:17px; }
.leave-sample { padding:0; font-size:10px; color:var(--accent); }

/* Larger libraries can stay spacious or become a compact, aligned index. */
.collection-list-header { display:grid; grid-template-columns:minmax(0,1fr) 150px 110px 60px; gap:16px; padding:8px 42px 12px 64px; color:var(--muted); font-size:10px; border-bottom:1px solid var(--line); }
.collection-list-header[hidden] { display:none; }
.object-list-row { display:grid; grid-template-columns:38px minmax(0,1fr) 150px 110px 60px 15px; align-items:center; padding:16px 10px; }
.list-status { color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
.list-kind { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.list-copy strong { line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.list-date { white-space:nowrap; }
.note-card:not(.featured-note) .card-excerpt { display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
.collection-pagination { display:flex; justify-content:center; gap:20px; align-items:center; margin:28px 0 0; color:var(--muted); font-size:12px; }
.collection-pagination:empty { display:none; }
.collection-pagination button { font-size:12px; }
.collection-pagination .icon { width:14px; height:14px; }
.search-summary { color:var(--muted); font-size:11px; line-height:1.7; padding:11px 17px; }
@media(max-width:1300px) {
  .object-list-row { grid-template-columns:32px minmax(0,1fr) 110px 90px 52px 12px; gap:13px; }
  .list-symbol { width:32px; height:36px; }
  .collection-list-header { grid-template-columns:minmax(0,1fr) 110px 90px 52px; gap:13px; padding-left:55px; padding-right:35px; }
}
@media(max-width:1050px) {
  .object-list-row { grid-template-columns:32px minmax(0,1fr) 90px 12px; }
  .list-kind,.list-date { display:none; }
  .collection-list-header { grid-template-columns:minmax(0,1fr) 90px; padding-right:35px; }
  .collection-list-header>span:nth-child(2),.collection-list-header>span:nth-child(4) { display:none; }
}
@media(max-width:740px) {
  .object-list-row { grid-template-columns:28px minmax(0,1fr) 12px; gap:11px; padding:16px 0; }
  .list-status { display:none; }
  .list-symbol { width:28px; height:32px; border:0; background:transparent; }
  .list-copy small { max-width:none; }
  .collection-list-header { display:none; }
  .editor pre { padding:18px; font-size:12px; }
  .editor figcaption { max-width:100%; font-size:12px; }
  .editor figure { margin-top:27px; }
  .mention-card p { margin-right:0; }
}
@media(max-width:620px) {
  .editor caption:after { content:'↔ Scroll for all columns'; display:block; color:var(--muted); font-size:11px; font-weight:400; margin-top:3px; }
}
/* Full names remain distinguishable when long titles share the same beginning. */
.list-copy strong { display:block; -webkit-line-clamp:unset; overflow:visible; }
/* Export remains reachable when a reader is using a smaller screen. */
.export-control { display:inline-flex; }

/* Connected objects open along a thread while the source document stays mounted. */
:root { --preview-width:400px; }
#object-preview { position:fixed; z-index:12; inset:72px 12px 12px auto; margin:0; width:min(440px,calc(100% - 24px)); height:calc(100dvh - 84px); max-height:none; max-width:none; padding:0; overflow:hidden; border:1px solid var(--line); border-radius:12px; background:var(--paper); color:var(--ink); box-shadow:0 16px 64px color-mix(in srgb,var(--ink) 14%,transparent); }
#object-preview[open] { display:flex; flex-direction:column; }
#object-preview::backdrop { background:color-mix(in srgb,var(--ink) 18%,transparent); backdrop-filter:blur(2px); }
.preview-docked .content-layout { margin-right:var(--preview-width); }
.preview-docked .context-panel,.preview-docked .browser-panel { display:none!important; }
.preview-docked .document { width:min(calc(100% - 64px),var(--reading-width)); }
.preview-docked #object-preview { inset:60px 0 0 auto; width:var(--preview-width); height:calc(100dvh - 60px); border-radius:0; border-width:0 0 0 1px; box-shadow:none; }
.preview-header { flex:none; padding:16px 22px 13px; border-bottom:1px solid var(--line); background:var(--canvas); }
.preview-topline { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.preview-topline>span { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--accent); }
.preview-topline>span>.icon { width:16px; height:18px; }
.preview-topline .icon-button { width:30px; height:30px; padding:6px; margin-right:-7px; }
.preview-topline .icon-button .icon { width:17px; height:17px; }
.preview-navigation { display:flex; gap:3px; align-items:center; margin:9px 0 0 -6px; }
.preview-navigation .icon-button { width:28px; height:28px; padding:6px; }
.preview-navigation .icon { width:15px; height:15px; }
.preview-navigation>span { min-width:0; display:block; margin-left:9px; color:var(--muted); font-size:10px; line-height:1.7; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.preview-navigation strong { display:block; font-size:11px; font-weight:400; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:var(--ink); }
.preview-scroll { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; scroll-behavior:auto; }
.preview-trail { display:flex; align-items:center; gap:4px; padding:17px 24px 0; overflow:auto; white-space:nowrap; scrollbar-width:thin; }
.preview-trail button { font-size:10px; padding:4px 1px; color:var(--muted); border-radius:0; flex:none; }
.preview-trail button[aria-current=page] { color:var(--accent); }
.preview-trail>.icon { width:10px; height:10px; color:var(--muted); }
.preview-object { padding:23px 24px 32px; }
.preview-identity { display:flex; align-items:center; gap:20px; margin-bottom:21px; }
.preview-identity>div:last-child { flex:1; min-width:0; }
.preview-identity .type-badge { font-size:10px; margin-bottom:10px; letter-spacing:1px; }
.preview-identity .type-badge>.icon { width:13px; height:13px; }
.preview-identity h2 { font-size:30px; font-weight:500; letter-spacing:-1px; line-height:1.18; overflow-wrap:anywhere; outline:none; }
.preview-identity p { margin-top:10px; font-size:13px; font-weight:350; color:var(--muted); line-height:1.75; overflow-wrap:anywhere; }
.preview-jacket { flex:none; padding:15px 11px; background:var(--canvas); border-radius:6px; }
.preview-jacket .book-cover { width:78px; height:124px; padding:13px 10px 11px 13px; }
.preview-jacket .cover-book-title { font-size:min(25px,calc(185cqi / var(--longest-word,6))); }
.preview-jacket .cover-edition { font-size:4px; letter-spacing:.7px; margin-bottom:12px; }
.preview-jacket .cover-author { font-size:6px; }
.preview-jacket .cover-rule { margin:10px 0; }
.preview-portrait { flex:none; display:grid; place-items:center; width:68px; height:68px; border-radius:50%; background:var(--raised); color:var(--accent); font-size:26px; font-weight:350; }
.preview-properties { display:grid; grid-template-columns:1fr 1fr; gap:15px 20px; margin:0 0 25px; padding:17px 0 20px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.preview-properties>div { min-width:0; }
.preview-properties dt { font-size:10px; color:var(--muted); margin-bottom:5px; }
.preview-properties dd { margin:0; font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.preview-properties dd button { padding:0; font-size:12px; color:var(--accent); gap:5px; text-align:left; justify-content:flex-start; line-height:1.7; }
.preview-properties .icon { width:11px; height:11px; }
.preview-passage { border:1px solid var(--line); border-radius:6px; padding:17px 18px 14px; background:var(--canvas); margin-bottom:28px; }
.preview-section-label { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:10px; font-weight:500; letter-spacing:.85px; text-transform:uppercase; line-height:1.7; }
.preview-section-label>span { letter-spacing:0; margin-left:auto; font-size:10px; }
.preview-passage p { margin-top:9px; font-size:13px; font-weight:350; line-height:1.85; overflow-wrap:anywhere; }
.preview-passage mark { color:var(--accent); background:color-mix(in srgb,var(--accent) 10%,transparent); border-radius:3px; padding:1px 2px; }
.preview-passage>button { padding:0; margin-top:12px; font-size:11px; color:var(--accent); gap:6px; text-align:left; }
.preview-passage>button>.icon { width:12px; height:12px; }
.preview-takeaway { font-size:16px; font-weight:350; line-height:1.85; margin-top:13px; overflow-wrap:anywhere; }
.preview-writing>blockquote { font-size:14px; font-weight:350; line-height:1.8; margin:20px 0; padding:2px 0 2px 15px; border-left:2px solid var(--fill); }
.preview-full-note { margin:18px 0 28px; }
.preview-full-note>summary,.preview-more-connections>summary { font-size:11px; color:var(--accent); cursor:pointer; padding:8px 0; }
.preview-full-note>summary>span { float:right; color:var(--muted); font-size:10px; }
.preview-prose { border-top:1px solid var(--line); padding-top:20px; margin-top:10px; font-size:15px; font-weight:350; line-height:1.85; overflow-wrap:anywhere; }
.preview-prose h2 { font-size:20px; line-height:1.4; font-weight:500; letter-spacing:-.3px; margin:25px 0 12px; }
.preview-prose h2:first-child { margin-top:0; }
.preview-prose h3 { font-size:17px; font-weight:500; line-height:1.5; margin:24px 0 11px; }
.preview-prose p { margin:0 0 17px; }
.preview-prose strong { font-weight:500; }
.preview-prose ul,.preview-prose ol { padding-left:20px; margin:15px 0 23px; }
.preview-prose li { margin:6px 0; }
.preview-prose blockquote { border-left:2px solid var(--fill); padding-left:15px; margin:20px 0; }
.preview-prose a[data-object] { color:var(--accent); text-decoration:underline; text-decoration-color:color-mix(in srgb,var(--accent) 40%,transparent); text-underline-offset:4px; }
.preview-prose figure { margin:22px 0; }
.preview-prose img { display:block; max-width:100%; height:auto; border-radius:4px; }
.preview-prose figcaption { font-size:11px; color:var(--muted); line-height:1.7; margin-top:8px; }
.preview-prose .table-wrap,.preview-prose pre { max-width:100%; overflow:auto; border:1px solid var(--line); border-radius:4px; margin:20px 0; }
.preview-prose table { border-collapse:collapse; min-width:520px; font-size:12px; line-height:1.7; }
.preview-prose td,.preview-prose th,.preview-prose caption { padding:10px; border-bottom:1px solid var(--line); text-align:left; }
.preview-prose th { background:var(--canvas); font-weight:500; }
.preview-prose code { font-family:var(--primer-font-mono,ui-monospace,monospace); font-size:.8em; }
.preview-prose pre { padding:15px; font-size:12px; background:var(--canvas); overflow-wrap:normal; }
.preview-prose pre code { font:inherit; }
.preview-prose .checklist { list-style:none; padding-left:0; }
.preview-prose .checklist li { display:flex; align-items:flex-start; gap:9px; }
.preview-prose .checklist input { margin-top:7px; accent-color:var(--fill); }
.preview-prose hr { margin:24px 0; border:0; border-top:1px solid var(--line); }
.preview-connections { border-top:1px solid var(--line); padding-top:23px; }
.preview-group { margin-top:21px; }
.preview-group>h3 { font-size:11px; color:var(--muted); font-weight:400; margin:0 0 7px; }
.preview-connection { display:flex; width:100%; gap:10px; padding:12px 0; text-align:left; border-bottom:1px solid var(--line); border-radius:0; }
.preview-connection-symbol { display:grid; place-items:center; flex:none; width:27px; height:30px; }
.preview-connection-symbol>.icon { width:18px; height:18px; color:var(--accent); }
.preview-connection>span:nth-child(2) { flex:1; min-width:0; }
.preview-connection strong { display:block; font-size:13px; font-weight:400; line-height:1.6; overflow-wrap:anywhere; }
.preview-connection small { display:block; color:var(--muted); font-size:11px; font-weight:350; line-height:1.75; margin-top:3px; overflow-wrap:anywhere; }
.preview-connection>.icon { width:13px; height:13px; color:var(--muted); }
.preview-more-connections { margin-top:7px; }
.preview-footer { display:flex; justify-content:space-between; gap:10px; flex:none; background:var(--paper); border-top:1px solid var(--line); padding:16px 22px; }
.preview-footer button { padding:7px 0; font-size:11px; gap:6px; color:var(--muted); }
.preview-footer .icon { width:13px; height:13px; }
.preview-footer .preview-open-page { color:var(--accent); }
.document [data-preview-active=true] { background:var(--raised); box-shadow:0 0 0 3px var(--raised); border-radius:3px; }
@media(max-width:520px) {
  #object-preview { inset:16px 0 0; width:100%; height:calc(100dvh - 16px); border-radius:12px 12px 0 0; border-bottom:0; }
  .preview-header { padding:14px 20px 12px; }
  .preview-trail { padding-left:20px; padding-right:20px; }
  .preview-object { padding:21px 20px 30px; }
  .preview-identity { gap:19px; }
  .preview-identity h2 { font-size:29px; }
  .preview-topline .icon-button { width:36px; height:36px; margin-right:-7px; }
  .preview-navigation .icon-button { width:34px; height:34px; }
  .preview-footer { padding:12px 20px max(12px,env(safe-area-inset-bottom)); }
  .preview-footer button { min-height:38px; font-size:12px; }
}
.preview-properties { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding-top:14px; padding-bottom:16px; margin-bottom:21px; }
.preview-context-text:not(.expanded) { display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
.preview-passage>.preview-context-expand { font-size:10px; color:var(--muted); margin-right:15px; }
.preview-passage { margin-bottom:24px; }
.preview-navigation>span>small { display:block; font-size:10px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.preview-navigation h2 { font-size:12px; line-height:1.65; font-weight:400; color:var(--ink); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; outline:none; }
.preview-prose table { min-width:560px; }
.preview-prose td,.preview-prose th { overflow-wrap:normal; }
.preview-prose caption:after { content:'↔ Scroll for all columns'; display:block; color:var(--muted); font-size:10px; font-weight:400; margin-top:3px; }
