:root{color-scheme:dark;--bg:#11151a;--sidebar:#171c21;--paper:#171c22;--raised:#232a31;--raised-hover:#2b353c;--line:#343c43;--text:#e9e8e5;--muted:#9ca7ac;--faint:#707d84;--accent:#9bd0b8;--accent-dark:#173c31;--focus:#b5d9c7;--danger:#dfa29c;--shadow:0 14px 55px #05090d7a;--radius:14px}
*{box-sizing:border-box}html{height:100%}body{margin:0;min-height:100%;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text);font-size:15px;-webkit-font-smoothing:antialiased}button,input,textarea,select{font:inherit}button{cursor:pointer}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.7;flex-shrink:0}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,[contenteditable]:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button:disabled{opacity:.44;cursor:not-allowed}.hidden{display:none!important}.muted{color:var(--muted)}.micro-label{color:var(--faint);font-weight:700;font-size:10px;letter-spacing:1.5px}.app-shell{display:flex;min-height:100dvh}.sidebar{position:fixed;left:0;top:0;bottom:0;width:250px;background:var(--sidebar);border-right:1px solid var(--line);padding:22px 16px 16px;display:flex;flex-direction:column;gap:21px;z-index:15;overflow:auto}.sidebar-head{display:flex;align-items:center;gap:12px;padding:0 7px}.brand-mark{width:41px;height:41px;border-radius:12px;background:var(--accent-dark);color:var(--accent);display:grid;place-items:center}.brand-mark svg{height:27px;width:27px}.brand-name{font-weight:730;font-size:16px;letter-spacing:-.4px}.brand-subtitle{color:var(--faint);font-size:11px;margin-top:3px}.project-switcher{padding:0 7px}.select-line{display:flex;align-items:center;position:relative;margin-top:8px}.select-line select{width:100%;appearance:none;background:var(--raised);color:var(--text);border:1px solid var(--line);border-radius:10px;padding:11px 28px 11px 10px;font-size:14px;min-width:0}.select-line svg{position:absolute;right:8px;pointer-events:none;width:15px;height:15px;color:var(--muted)}.text-button{border:0;background:none;color:var(--accent);padding:10px 2px}.text-button.small{font-size:12px}.primary-nav{display:grid;gap:4px}.nav-item{border:0;background:transparent;color:var(--muted);border-radius:10px;padding:12px 13px;display:flex;align-items:center;gap:12px;text-align:left;font-weight:540}.nav-item:hover,.footer-button:hover,.recent-item:hover{background:var(--raised)}.nav-item.active{background:var(--accent-dark);color:#d4f2e5}.nav-item svg{width:19px;height:19px}.sidebar-section{min-height:0;display:grid;gap:9px}.section-label-row{display:flex;align-items:center;justify-content:space-between;padding:0 10px}.tiny-icon{border:0;background:transparent;color:var(--muted);padding:4px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px}.tiny-icon svg{width:15px;height:15px}.tiny-icon:hover{background:var(--raised-hover)}.recent-list{display:grid;gap:3px}.recent-item{border:0;background:none;color:var(--muted);text-align:left;border-radius:9px;padding:10px 12px;overflow:hidden;display:flex;align-items:center;gap:9px}.recent-item.active{color:var(--text);background:#283139}.recent-item span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:13px}.recent-item svg{width:16px;height:16px}.sidebar-footer{margin-top:auto;display:grid;gap:3px}.footer-button{border:0;background:transparent;color:var(--faint);padding:11px 12px;text-align:left;display:flex;align-items:center;gap:10px;border-radius:10px;font-size:12px}.footer-button svg{width:16px;height:16px}.main-area{margin-left:250px;min-width:0;width:calc(100% - 250px);min-height:100dvh;display:flex;flex-direction:column}.topbar{height:64px;padding:0 clamp(14px,3vw,37px);display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #252b30;position:relative;gap:10px}.topbar-left,.topbar-right{display:flex;align-items:center;gap:11px}.crumbs{display:flex;align-items:center;gap:11px;color:var(--muted);font-size:12px}.crumb-slash{color:#58646b}.save-state{color:var(--faint);font-size:11px;white-space:nowrap;display:flex;align-items:center;gap:7px}.save-dot{width:6px;height:6px;border-radius:50%;background:var(--accent)}.save-state.unsaved .save-dot{background:#e8bc81}.icon-button{background:transparent;border:0;color:var(--muted);height:35px;width:35px;display:grid;place-items:center;border-radius:9px}.icon-button:hover{background:var(--raised)}.icon-button svg{width:18px;height:18px}.more-menu{position:absolute;right:24px;top:54px;width:250px;z-index:20;background:var(--raised);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:12px;padding:6px}.more-menu button{display:block;width:100%;text-align:left;border:0;border-radius:7px;background:none;color:var(--text);padding:11px;font-size:13px}.more-menu button:hover{background:var(--raised-hover)}.view{display:none;flex:1;min-height:0}.view.active{display:block}.editor-frame{width:min(100%,850px);margin:0 auto;padding:42px clamp(24px,6vw,77px) 140px;min-height:calc(100dvh - 64px)}.doc-top-row{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:27px}.title-input{font-family:Georgia,"Iowan Old Style",serif;font-size:clamp(25px,3vw,32px);font-weight:600;letter-spacing:-.6px;background:none;color:var(--text);border:0;outline:none;width:100%;min-width:0;padding:3px 0}.title-input::placeholder{color:#858d92;opacity:1}.title-input:focus{outline:none}.title-input:focus-visible{box-shadow:0 1px var(--accent)}.doc-top-actions{display:flex;flex-shrink:0}.subtle-button{background:none;border:1px solid transparent;border-radius:9px;color:var(--muted);padding:9px 8px;display:flex;align-items:center;gap:6px;font-size:12px}.subtle-button:hover{border-color:var(--line);background:var(--raised)}.subtle-button svg{width:16px;height:16px}.session-note{background:#202d2a;border:1px solid #345147;color:#c5d9cf;border-radius:12px;padding:14px;margin-bottom:18px;display:flex;align-items:start;gap:12px}.session-note>svg{width:16px;height:16px;margin-top:3px}.session-note-content{display:grid;gap:6px;flex:1;font-size:13px;line-height:1.5}.session-note-content .micro-label{color:#9bbbab}.structured-tools{display:flex;align-items:center;flex-wrap:wrap;gap:9px;padding:10px 0 21px;color:var(--muted);font-size:12px}.timer-choice{background:var(--raised);border:1px solid var(--line);color:var(--text);padding:7px 11px;border-radius:8px}.timer-choice:hover{border-color:var(--accent)}.timer-display{color:var(--accent);font-weight:650;font-variant-numeric:tabular-nums}.editor{width:100%;min-height:calc(100dvh - 310px);font:normal 19px/1.84 Georgia,"Iowan Old Style","Palatino Linotype",serif;color:#e6e6e0;letter-spacing:.06px;outline:0;overflow-wrap:anywhere;white-space:normal;caret-color:var(--accent)}.editor:focus-visible{outline:none}.editor p,.editor div{margin:0 0 1em;min-height:1.35em}.editor p[data-kind="dialogue"],.editor div[data-kind="dialogue"]{font-weight:750;text-transform:uppercase;font-size:.95em;line-height:1.7}.editor p[data-kind="thought"],.editor div[data-kind="thought"]{font-style:italic}.editor:empty:before{content:attr(data-placeholder);pointer-events:none;color:var(--faint)}.editor p:only-child:has(br):before{content:attr(data-never)}.editor-end{display:flex;align-items:center;justify-content:space-between;padding-top:15px;color:var(--faint);font-size:11px}.writing-toolbar{height:66px;position:fixed;bottom:0;right:0;left:250px;z-index:12;border-top:1px solid var(--line);background:#171d23ef;backdrop-filter:blur(20px);display:flex;align-items:center;justify-content:center;padding:0 22px;gap:28px}.toolbar-tools,.toolbar-right{display:flex;align-items:center;gap:8px}.toolbar-right{position:absolute;right:clamp(18px,4vw,48px)}.format-button{color:var(--muted);background:transparent;border:1px solid transparent;border-radius:10px;display:flex;gap:8px;align-items:center;padding:10px 13px;font-size:12px;font-weight:650}.format-button:hover,.format-button.active{color:var(--accent);background:var(--accent-dark);border-color:#315248}.format-button svg{width:18px;height:18px}.format-button.only-symbol{padding:10px}.page-content{max-width:1050px;margin:0 auto;padding:50px clamp(20px,5vw,65px) 110px}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:30px}.page-heading h1{font:500 36px Georgia,serif;margin:8px 0}.page-heading p{margin:0;font-size:13px}.primary-button{background:#9bd0b8;color:#13241e;border:0;border-radius:10px;padding:12px 15px;white-space:nowrap;font-size:13px;font-weight:700}.primary-button:hover{background:#b0e1ca}.secondary-button{background:var(--raised);color:var(--text);border:1px solid var(--line);border-radius:10px;padding:11px 14px;font-size:13px}.secondary-button:hover{background:var(--raised-hover)}input[type="search"],.form-input,textarea.form-input{background:var(--raised);color:var(--text);border:1px solid var(--line);border-radius:10px;padding:12px 13px;outline:none;width:100%}.form-input:focus,input[type="search"]:focus{border-color:var(--accent);outline:none}textarea.form-input{resize:vertical;min-height:108px;line-height:1.6}.list-controls{display:flex;align-items:center;gap:15px;margin-bottom:22px}.list-controls input{flex:1;min-width:100px}.segmented{display:flex;padding:4px;background:var(--raised);border-radius:10px;border:1px solid var(--line)}.segment{border:0;background:none;color:var(--muted);border-radius:7px;padding:8px 12px;font-size:12px}.segment.selected{background:#3c4c49;color:#e9f7ed}.fragment-collection.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(235px,1fr));gap:13px}.fragment-collection.list{display:grid;gap:7px}.fragment-card{background:var(--paper);border:1px solid var(--line);border-radius:13px;padding:20px;min-width:0;text-align:left;color:var(--text);min-height:154px;display:flex;flex-direction:column;gap:11px}.fragment-card:hover,.library-entry:hover,.inbox-note:hover{border-color:#668d7d;background:#202b2a}.fragment-card .card-title{font-size:15px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fragment-card .card-preview{font:14px/1.55 Georgia,serif;color:var(--muted);overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.fragment-card .card-date{font-size:11px;color:var(--faint);margin-top:auto}.fragment-collection.list .fragment-card{min-height:0;padding:16px;gap:5px}.fragment-collection.list .card-preview{font:12px/1.5 sans-serif;-webkit-line-clamp:1}.fragment-collection.list .card-date{margin-top:3px}.empty-state{border:1px dashed var(--line);border-radius:13px;padding:48px 24px;text-align:center;color:var(--muted);font-size:14px;grid-column:1/-1}.inbox-collection,.library-collection{display:grid;gap:11px;margin-top:25px}.inbox-note,.library-entry{background:var(--paper);border:1px solid var(--line);padding:20px;border-radius:13px;display:flex;flex-direction:column;gap:10px}.inbox-note p,.library-entry p{white-space:pre-wrap;line-height:1.6;color:var(--text);margin:0}.inbox-actions,.library-entry-actions{display:flex;gap:9px;flex-wrap:wrap}.inline-action{border:0;background:none;padding:5px 0;color:var(--accent);font-size:12px}.inline-action.muted{color:var(--muted)}.category-group{background:#1a2025;border:1px solid var(--line);border-radius:12px;overflow:hidden}.category-header{width:100%;display:flex;align-items:center;gap:10px;background:transparent;color:var(--text);padding:15px 17px;border:0;text-align:left;font-size:14px;font-weight:650}.category-header:hover{background:var(--raised)}.category-header small{color:var(--faint);font-size:11px;margin-left:auto}.category-body{padding:0 13px 13px;display:grid;gap:7px}.category-body .library-entry{padding:13px}.entry-label{font-size:12px;color:var(--muted)}.mobile-only{display:none}.drawer-scrim{display:none}.modal-backdrop{position:fixed;inset:0;background:#030608b8;z-index:40;display:flex;align-items:center;justify-content:center;padding:15px}.modal{background:#20272e;border:1px solid #48535b;border-radius:16px;width:min(100%,570px);max-height:min(86dvh,790px);display:flex;flex-direction:column;box-shadow:var(--shadow)}.modal-head{padding:20px 20px 13px;display:flex;align-items:center;justify-content:space-between}.modal-head h2{font:500 24px Georgia,serif;margin:0}.modal-content{overflow-y:auto;padding:4px 20px 22px}.modal-content p{color:var(--muted);font-size:13px;line-height:1.65}.field{display:grid;gap:7px;margin-bottom:17px}.field label{font-size:12px;color:var(--muted)}.button-row{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;margin-top:20px}.help-box{background:#172620;border:1px solid #39574a;border-radius:10px;padding:12px 14px;color:#c1e0d0;font-size:12px;line-height:1.5;margin-bottom:12px}.history-list{display:grid;gap:9px}.history-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;background:var(--raised);border-radius:10px}.history-item span{font-size:13px}.history-item small{display:block;color:var(--muted);margin-top:3px}.comparison{display:grid;grid-template-columns:1fr 1fr;gap:11px}.compare-side{border:1px solid var(--line);background:#141a1f;padding:14px;border-radius:10px;min-height:160px;max-height:55dvh;overflow:auto;font:13px/1.65 Georgia,serif;white-space:pre-wrap;overflow-wrap:anywhere}.compare-side .micro-label{display:block;margin-bottom:10px}.diff-removed{background:#64363078;border-radius:3px;text-decoration:line-through;text-decoration-color:#dc9b96}.diff-added{background:#2d644b9c;border-radius:3px}.toast{position:fixed;bottom:78px;left:50%;transform:translate(-50%,10px);pointer-events:none;opacity:0;background:#33433d;color:#e7f6ed;border:1px solid #52705d;padding:12px 17px;border-radius:10px;box-shadow:var(--shadow);z-index:50;font-size:12px;transition:opacity .2s,transform .2s;text-align:center;max-width:92vw}.toast.show{transform:translate(-50%,0);opacity:1}#editor[data-empty="true"]:before{content:attr(data-placeholder);color:#6e7a80;pointer-events:none;position:absolute;line-height:1.6}#editor[data-empty="true"] p:first-child{min-height:2em}
@media(max-width:900px){.sidebar{width:218px}.main-area{margin-left:218px;width:calc(100% - 218px)}.writing-toolbar{left:218px}.toolbar-right{right:14px}.format-button{padding:10px;gap:6px}.editor-frame{padding-top:32px}}
@media(max-width:670px){.mobile-only{display:grid}.sidebar{width:min(85vw,290px);transform:translateX(-100%);transition:transform .22s;box-shadow:var(--shadow)}body.sidebar-open .sidebar{transform:translateX(0)}body.sidebar-open .drawer-scrim{display:block;position:fixed;inset:0;background:#0008;z-index:14}.close-sidebar{margin-left:auto}.main-area{margin:0;width:100%;min-height:100dvh}.topbar{height:57px;padding:0 12px}.crumbs{font-size:12px;gap:6px}.save-state{font-size:0;gap:0}.save-state .save-dot{width:7px;height:7px}.topbar-right{gap:3px}.more-menu{right:9px;top:48px}.editor-frame{padding:27px 22px 120px;min-height:calc(100dvh - 57px)}.title-input{font-size:25px}.doc-top-row{margin-bottom:20px}.subtle-button{font-size:0}.subtle-button svg{width:20px;height:20px}.editor{font-size:18px;line-height:1.78;min-height:calc(100dvh - 295px)}.writing-toolbar{left:0;right:0;height:60px;padding:0 9px;justify-content:space-between;gap:3px;padding-bottom:env(safe-area-inset-bottom);height:calc(60px + env(safe-area-inset-bottom))}.toolbar-tools{gap:0}.format-button{font-size:11px;gap:5px;padding:10px 9px}.format-button svg{width:16px;height:16px}.toolbar-right{position:static;gap:0}.toolbar-right .format-button{padding:10px 7px}.toast{bottom:80px}.page-content{padding:32px 19px 100px}.page-heading h1{font-size:29px}.page-heading .primary-button{padding:11px;font-size:12px}.list-controls{gap:7px}.fragment-collection.cards{grid-template-columns:1fr}.modal{max-height:89dvh}.modal-backdrop{align-items:flex-end;padding:0}.modal{width:100%;border-radius:18px 18px 0 0;max-height:86dvh;padding-bottom:env(safe-area-inset-bottom)}.comparison{grid-template-columns:1fr}.compare-side{max-height:26dvh}}
@media(max-width:365px){.format-button span{display:none}.format-button{padding:10px 16px}.crumbs #projectCrumb{display:none}.crumb-slash{display:none}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

.mode-pill{display:flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--raised);border-radius:10px;padding:8px 10px;color:var(--muted);font-size:11px}.mode-pill:hover{border-color:#647d73;color:var(--text)}.mode-pill svg{width:15px;height:15px}@media(max-width:500px){.mode-pill span{display:none}.mode-pill{padding:9px}}
/* Minimal mode removes the persistent desktop navigation, not the user's work. */
@media(min-width:671px){
 body[data-mode="minimal"] .sidebar{transform:translateX(-100%)}
 body[data-mode="minimal"] .main-area{margin-left:0;width:100%}
 body[data-mode="minimal"] .writing-toolbar{left:0}
 body[data-mode="minimal"] #openSidebar{display:grid}
 body[data-mode="minimal"].sidebar-open .sidebar{transform:translateX(0)}
 body[data-mode="minimal"].sidebar-open .drawer-scrim{display:block;position:fixed;inset:0;background:#0008;z-index:14}
}

/* v2: in-depth character bio stays optional and collapsible */
.bio-switch{display:flex;align-items:flex-start;gap:12px;border:1px solid #3b5850;background:#192b29;border-radius:12px;padding:15px;margin:18px 0 10px;cursor:pointer;line-height:1.3}
.bio-switch input{width:19px;height:19px;flex-shrink:0;margin:1px 0 0;accent-color:#9bd0b8}
.bio-switch span{display:flex;flex-direction:column;gap:5px}
.bio-switch strong{font-size:14px;color:#e4eee8}
.bio-switch small{font-size:12px;line-height:1.5;color:#a9bcb3}
.bio-hint{margin:9px 0 14px!important}
.bio-section{border:1px solid var(--line);border-radius:11px;background:#1a2228;margin-bottom:8px;overflow:hidden}
.bio-section summary{padding:15px 14px;font-size:13px;font-weight:650;cursor:pointer;list-style:none;display:flex;justify-content:space-between;gap:8px;align-items:center}
.bio-section summary::-webkit-details-marker{display:none}
.bio-section summary:after{content:'⌄';font-size:18px;font-weight:400;color:var(--muted)}
.bio-section[open] summary:after{content:'⌃'}
.bio-section[open] summary{border-bottom:1px solid var(--line)}
.bio-section-body{padding:15px 14px 6px}
.bio-field{margin-bottom:16px}
.bio-field textarea.form-input{min-height:84px}
.bio-subheading{font-size:12px;font-weight:700;color:var(--text);margin:14px 0 10px}
.ability-card{border:1px solid var(--line);border-radius:10px;padding:15px 13px 10px;margin:12px 0;background:#232d32}
.ability-card .inline-action{margin-bottom:5px}
.ability-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:8px}
.ability-actions .inline-action{margin-bottom:0}
.recovery-options{display:flex;flex-direction:column;gap:8px;margin:17px 0 4px}
.recovery-options:empty{display:none}
.recovery-options button{text-align:left;white-space:normal}
@media(max-width:670px){.bio-section-body{padding:13px 11px 4px}.bio-section summary{padding:15px 12px}.bio-switch{margin-top:14px}.modal:has(#biographyForm){max-height:93dvh}}

/* v3: clean type throughout; no Times or Georgia in the writing surface. */
:root{--writing-font:Inter,Aptos,-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;--writing-size:19px}
.title-input,.page-heading h1,.modal-head h2{font-family:var(--writing-font);font-weight:650;letter-spacing:-.035em}
.editor{font-family:var(--writing-font);font-size:var(--writing-size);font-weight:400;line-height:1.74;letter-spacing:0}
.compare-side{font-family:var(--writing-font)}
@media(max-width:670px){.editor{font-size:var(--writing-size);line-height:1.75}}
.typography-example{background:#161c22;border:1px solid var(--line);border-radius:12px;padding:18px;font:var(--writing-size)/1.7 var(--writing-font);color:var(--text)}
.bio-main-controls{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:8px 0 12px}
.bio-collapse-button{background:none;color:var(--text);border:0;border-radius:8px;padding:9px 5px;font-size:13px;text-align:left;font-weight:700}
.bio-collapse-button:hover{color:var(--accent)}
.bio-view-switch{display:flex;gap:3px;background:var(--raised);border-radius:10px;padding:3px;border:1px solid var(--line)}
.bio-view-button{border:0;background:none;color:var(--muted);border-radius:8px;padding:8px 15px;font-size:12px}
.bio-view-button.selected{color:var(--text);background:#3c4c49;font-weight:700}
.bio-document{background:#20262c;border:1px solid #475058;border-radius:12px;padding:27px 25px 34px;max-width:100%;font-family:var(--writing-font);font-size:14px;line-height:1.6;color:#e9e9e8;overflow-wrap:anywhere}
.bio-doc-heading{text-align:center;text-decoration:underline;text-underline-offset:4px;font-size:19px;letter-spacing:-.025em;margin:0 0 28px;font-weight:730}
.bio-doc-name{font-size:15px;font-weight:580;letter-spacing:.01em;margin:0 0 35px}
.bio-doc-group{margin:0 0 26px;line-height:1.5}
.bio-doc-detail{margin:1px 0;white-space:pre-wrap}
.bio-doc-inline-label{font-weight:550}
.bio-doc-continuation{margin-left:74px}
.bio-doc-section{margin:0 0 27px}
.bio-doc-section-title{font-weight:620;margin:0 0 3px}
.bio-doc-lines{display:grid;gap:2px}
.bio-doc-line{position:relative;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.bio-doc-bullet{padding-left:22px}
.bio-doc-bullet::before{content:'•';position:absolute;left:4px;color:var(--muted)}
.bio-doc-depth-1{margin-left:22px}.bio-doc-depth-2{margin-left:43px}.bio-doc-depth-3{margin-left:64px}
.bio-doc-ability{margin:4px 0 9px}.bio-doc-nested{margin-left:23px}.bio-doc-spacer{height:7px}
.bio-doc-empty{font-size:13px;margin:3px 0 0;color:var(--muted)}
@media(max-width:670px){.bio-document{padding:22px 14px 30px;font-size:13px}.bio-doc-name{margin-bottom:25px}.bio-doc-heading{margin-bottom:22px}.bio-doc-continuation{margin-left:36px}.bio-doc-depth-2{margin-left:27px}.bio-doc-depth-3{margin-left:39px}.bio-main-controls{flex-wrap:wrap}.bio-doc-bullet{padding-left:17px}}

.modal:has(#biographyForm){width:min(100%,780px);max-height:92dvh}

/* v4: the character name is the biography heading, with an obvious inline rename action. */
.bio-doc-heading{display:none}
.bio-doc-name-row{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:10px;margin:0 0 26px}
.bio-doc-name{font-size:1.07em;font-weight:650;letter-spacing:.005em;margin:0;min-width:0;overflow-wrap:anywhere}
.bio-rename-button{font-size:12px;white-space:nowrap;color:var(--accent);background:transparent;padding:5px 3px}
.bio-rename-button:hover{text-decoration:underline}
.bio-doc-name-row.is-renaming>.bio-doc-name,.bio-doc-name-row.is-renaming>.bio-rename-button{display:none}
.bio-rename-form{display:flex;align-items:center;flex-wrap:wrap;gap:6px;width:100%}
.bio-rename-form .form-input{flex:1 1 150px;min-width:110px}
.bio-rename-form .inline-action{font-size:12px}
.bio-rename-save{font-weight:750!important;color:var(--accent)!important}
.bio-document{font-size:var(--bio-font-size,17px);line-height:1.4;max-width:960px;margin:0 auto;overflow-wrap:normal;word-break:normal;padding:27px 25px 30px}
.bio-doc-group{line-height:1.4;margin-bottom:22px}
.bio-doc-section{margin-bottom:22px}
.bio-doc-line{line-height:1.4}
.bio-doc-continuation{margin-left:45px}
.bio-doc-bullet{padding-left:19px}
.bio-doc-depth-1{margin-left:18px}.bio-doc-depth-2{margin-left:35px}.bio-doc-depth-3{margin-left:53px}
.bio-doc-nested{margin-left:19px}
.bio-main-controls{flex-wrap:wrap}
.bio-type-controls{display:flex;align-items:center;gap:5px;margin-left:auto;border:1px solid var(--line);border-radius:9px;padding:2px 5px;background:var(--raised)}
.bio-type-controls .inline-action{font-size:13px;min-width:29px;padding:7px 5px;margin:0}
.bio-type-controls .inline-action:disabled{opacity:.35;cursor:default}
.bio-size-label{font-size:11px;color:var(--muted);min-width:30px;text-align:center}
.modal:has(#biographyForm){width:min(calc(100vw - 32px),1060px)}
@media(max-width:670px){
 .bio-document{font-size:calc(var(--bio-font-size,17px) - 1px);line-height:1.4;padding:20px 16px 26px}
 .bio-doc-name-row{margin-bottom:23px}
 .bio-doc-continuation{margin-left:24px}
 .bio-doc-depth-1{margin-left:14px}.bio-doc-depth-2{margin-left:25px}.bio-doc-depth-3{margin-left:36px}
 .bio-doc-bullet{padding-left:17px}
 .bio-doc-nested{margin-left:14px}
 .bio-type-controls{margin-left:0}
 .modal:has(#biographyForm){width:100%}
}

/* v6 – color selected manuscript text and mark costs clearly in the biography. */
.bio-doc-cost{color:#f0a2a2}
.bio-doc-cost .bio-doc-bullet::before{color:#f0a2a2}
.ability-actions{align-items:center}
.ability-drag-handle{display:inline-flex;align-items:center;gap:6px;border:1px dashed #5c7169;border-radius:8px;color:#b8d5ca;font-size:12px;padding:8px 11px;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.ability-drag-handle:active{cursor:grabbing}
.ability-drag-handle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ability-card.is-dragging{opacity:.68}
.ability-card.drop-before{box-shadow:inset 0 4px 0 var(--accent)}
.ability-card.drop-after{box-shadow:inset 0 -4px 0 var(--accent)}
.overall-cost-editor{margin-top:16px;border-top:1px solid var(--line);padding-top:16px}
.color-tool-icon{font-size:16px;font-weight:750;text-decoration:underline;text-decoration-color:#efa5a5;text-decoration-thickness:3px;text-underline-offset:4px}
.ink-menu{position:fixed;z-index:75;background:#242e34;border:1px solid #52616a;box-shadow:var(--shadow);border-radius:12px;padding:11px;width:251px;max-width:calc(100vw - 16px)}
.ink-menu-heading{font-weight:650;font-size:12px;color:var(--muted);padding:4px 6px 8px}
.ink-palette{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.ink-swatch{display:flex;flex-direction:column;align-items:center;gap:5px;border:1px solid #45535b;border-radius:9px;background:#1b242a;color:var(--text);font-size:11px;padding:8px 3px}
.ink-swatch:hover,.ink-swatch:focus-visible{border-color:var(--accent);background:#2b3839}
.ink-dot{background:var(--swatch-color);border:1px solid #ffffff3a;width:18px;height:18px;border-radius:50%;color:#12161a;text-align:center;line-height:16px}
.ink-link{display:block;width:100%;text-align:left;background:transparent;color:var(--text);border:0;border-bottom:1px solid var(--line);padding:9px 5px 12px;font-size:13px;margin-bottom:9px}
#editor span[data-ink="red"]{color:#efa5a5}
#editor span[data-ink="orange"]{color:#efbd8b}
#editor span[data-ink="yellow"]{color:#f1dc98}
#editor span[data-ink="green"]{color:#9bd9b3}
#editor span[data-ink="blue"]{color:#9ec6f1}
#editor span[data-ink="purple"]{color:#cab2f3}
#editor span[data-ink="default"]{color:#e6e6e0}
@media(max-width:670px){.color-tool{padding:9px 7px;gap:5px}.color-tool span:last-child{display:none}.ability-actions{gap:5px}.ability-drag-handle{min-height:40px}}

/* v7: character note previews and reversible writing links */
.library-entry-card{border:1px solid var(--line);border-radius:12px;background:var(--paper);overflow:hidden}
.library-entry-card>.library-entry{width:100%;border:0;border-radius:0;background:transparent}
.library-entry-card:hover{border-color:#668d7d}
.library-entry-card .library-entry:hover{background:#202b2a}
.entry-notes-preview{border-top:1px solid var(--line);padding:9px 13px 12px}
.entry-notes-label{display:block;font-size:11px;font-weight:650;color:var(--muted);margin-bottom:5px}
.entry-notes-text{font:13px/1.5 var(--writing-font);color:var(--text);white-space:pre-wrap;overflow-wrap:anywhere}
.entry-notes-text.collapsed{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.entry-notes-toggle{margin-top:7px;font-size:12px;min-height:24px}
.linked-writing-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line);padding:8px 0}
.linked-writing-name{flex:1;text-align:left;overflow-wrap:anywhere}
.linked-writing-unlink{color:var(--danger);flex-shrink:0}
.linked-writing-empty{color:var(--muted);font-size:13px;margin:0 0 6px}
.linked-writing-add{margin-top:10px;display:inline-block}
.linked-writing-picker{border:1px solid var(--line);background:var(--paper);padding:12px;border-radius:10px;margin-top:10px}
.linked-writing-picker label{font-size:12px;color:var(--muted);display:block;margin-bottom:8px}
.linked-writing-choices,.link-target-results{max-height:230px;overflow:auto;margin-top:8px}
.linked-choice{display:block;width:100%;text-align:left;border-bottom:1px solid var(--line);padding:10px 2px}
.linked-target-label{font-size:13px;overflow-wrap:anywhere}
@media(max-width:670px){.linked-writing-row{align-items:flex-start}.linked-target-label{max-width:70%}}

/* v8: concise character cards and private local reference galleries. */
.entry-cover-image{width:78px;height:92px;object-fit:cover;object-position:center;float:left;border-radius:8px;margin:0 13px 5px 0;background:#303b40;border:1px solid var(--line)}
.entry-short-description{clear:both;border-top:1px solid var(--line);padding:10px 13px 13px;color:#c9d6d3;font-size:13px;line-height:1.55;white-space:pre-line;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
.character-media-panel{border-top:1px solid var(--line);padding:15px 0;margin:12px 0}
.character-media-title{font-size:14px;font-weight:700;margin-bottom:7px}
.character-media-hint{font-size:12px!important;color:var(--muted)!important;line-height:1.55!important;margin:4px 0 12px!important}
.character-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(135px,1fr));gap:12px;margin:12px 0}
.character-photo{min-width:0;background:#1a2228;border:1px solid var(--line);border-radius:12px;padding:8px;display:flex;flex-direction:column;gap:8px}
.character-photo-open{display:block;width:100%;height:138px;overflow:hidden;border:0;background:#10191c;border-radius:8px;padding:0;cursor:zoom-in}
.character-photo-open img{display:block;width:100%;height:100%;object-fit:cover}
.character-photo-caption{min-width:0!important;padding:8px 9px!important;font-size:12px!important}
.character-photo-actions{display:flex;justify-content:space-between;gap:6px;flex-wrap:wrap}
.character-photo-actions .inline-action{font-size:11px;margin:0;padding:6px 3px}
.image-lightbox{position:fixed;inset:0;background:#040607ed;z-index:80;display:flex;align-items:center;justify-content:center;padding:60px 15px 25px;cursor:zoom-out}
.image-lightbox img{display:block;max-width:95vw;max-height:calc(100dvh - 100px);object-fit:contain;border-radius:7px;box-shadow:0 12px 60px #0009}
.image-lightbox-close{position:fixed;right:20px;top:20px;border:1px solid #ffffff55;border-radius:9px;background:#28343d;color:#fff;padding:9px 14px;cursor:pointer}
@media(max-width:480px){.character-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.character-photo-open{height:132px}.entry-cover-image{width:64px;height:74px}}
.library-entry:has(.entry-cover-image){display:grid;grid-template-columns:76px minmax(0,1fr);grid-template-rows:auto auto;align-content:center;align-items:start;gap:5px 12px}
.library-entry:has(.entry-cover-image) .entry-cover-image{grid-column:1;grid-row:1 / 3;float:none;margin:0;width:76px;height:88px}
.library-entry:has(.entry-cover-image) strong{grid-column:2;grid-row:1;overflow-wrap:anywhere}
.library-entry:has(.entry-cover-image) .entry-label{grid-column:2;grid-row:2}
@media(max-width:480px){.library-entry:has(.entry-cover-image){grid-template-columns:60px minmax(0,1fr)}.library-entry:has(.entry-cover-image) .entry-cover-image{width:60px;height:70px}}

/* v9: fragment annotations and collapsible story-arc grouping */
#writeView{position:relative}
.editor [data-mark="yellow"]{background:rgba(229,201,112,.36);box-decoration-break:clone;border-radius:3px}
.editor [data-mark="green"]{background:rgba(150,202,165,.36);box-decoration-break:clone;border-radius:3px}
.editor [data-mark="blue"]{background:rgba(150,190,217,.36);box-decoration-break:clone;border-radius:3px}
.editor [data-mark="pink"]{background:rgba(223,156,187,.36);box-decoration-break:clone;border-radius:3px}
.editor [data-mark="purple"]{background:rgba(195,165,221,.36);box-decoration-break:clone;border-radius:3px}
.editor [data-note]{text-decoration:underline dotted var(--accent);text-underline-offset:4px;cursor:pointer}
.margin-notes{position:fixed;z-index:11;top:90px;right:13px;bottom:95px;width:245px;background:#1b2228;border:1px solid #3b494c;box-shadow:0 9px 35px #060b0f77;border-radius:13px;display:flex;flex-direction:column;overflow:hidden}
.margin-notes-head{padding:13px 14px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}
.margin-notes-head strong{font-size:13px}
.margin-notes-head button{border:0;background:none;color:var(--muted);font-size:23px;cursor:pointer}
.margin-notes-list{overflow:auto;padding:10px;display:grid;align-content:start;gap:9px}
.margin-note-card{width:100%;border:1px solid var(--line);border-radius:10px;background:var(--paper);padding:11px;display:grid;text-align:left;gap:5px;color:var(--text)}
.margin-note-card:hover{border-color:var(--accent)}
.margin-note-label{font-size:10px;letter-spacing:.02em;color:var(--accent)}
.margin-note-quote{font-size:12px;color:var(--muted);line-height:1.4;white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.margin-note-body{font-size:12px;line-height:1.4;white-space:pre-wrap}
.note-selected-quote{background:var(--raised);border-left:3px solid var(--accent);margin:0 0 17px;padding:11px;max-height:110px;overflow:auto;font-size:13px;line-height:1.55}
.margin-counter{font-size:10px;color:var(--accent);position:absolute;transform:translate(12px,-10px)}
.mark-palette{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:10px}
.mark-swatch{background:color-mix(in srgb,var(--mark-color) 20%,#242e34);border:1px solid color-mix(in srgb,var(--mark-color) 45%,#242e34);color:var(--text);padding:6px 7px;border-radius:7px;font-size:11px}
.arc-group,.ungrouped-section{width:100%;grid-column:1/-1}
.arc-group{border:1px solid var(--line);border-radius:13px;margin-bottom:12px;overflow:hidden;background:#192127}
.arc-group-heading{display:flex;align-items:center;gap:9px;padding:11px 13px;flex-wrap:wrap}
.arc-toggle{border:0;background:none;text-align:left;color:var(--text);font-weight:700;font-size:14px;flex:1;min-width:105px;padding:5px}
.arc-count{font-size:11px;color:var(--muted)}
.arc-small{font-size:11px;color:var(--accent);white-space:nowrap}
.arc-body{padding:5px 12px 12px;display:grid;gap:8px}
/* v20.8.4: Arc Skeleton overview inside its Fragments arc group. */
.arc-overview{margin:0 12px 11px;padding:10px 13px;background:#1b2a29;border-left:2px solid #759f8b;border-radius:0 8px 8px 0;min-width:0}
.arc-overview-label{font-size:10px;letter-spacing:.065em;text-transform:uppercase;color:#a0c6b3;font-weight:720;margin-bottom:5px}
.arc-overview-preview{color:#c7d8d0;font-size:12px;line-height:1.55;overflow:hidden;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;max-height:3.1em}
.arc-overview-content{color:#d8e3dc;font-size:13px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.arc-overview-content.rich-rendered{white-space:normal}
.arc-overview-content.rich-rendered p,.arc-overview-content.rich-rendered li{font-size:inherit;line-height:inherit}
.arc-overview-content.rich-rendered :first-child{margin-top:0}
.arc-overview-content.rich-rendered :last-child{margin-bottom:0}
@media(max-width:670px){.arc-overview{margin:0 9px 10px;padding:9px 11px}}

.arc-body[hidden]{display:none}
.arc-fragment-row{display:flex;align-items:center;gap:6px;min-width:0}
.arc-fragment-row>.fragment-card{flex:1;min-width:0}
.arc-fragment-controls{display:flex;align-items:center;flex-wrap:wrap;gap:4px}
.arc-fragment-controls .inline-action{padding:8px 6px;font-size:11px}
.fragment-card-container{display:grid;align-content:stretch;gap:5px;padding:0;min-height:0;overflow:hidden}
.fragment-card-open{border:0;background:transparent;display:flex;flex-direction:column;text-align:left;gap:8px;min-width:0;padding:17px;color:inherit;cursor:pointer}
.fragment-card-open:hover{background:#263330}
.fragment-card-open .card-preview{font-family:var(--writing-font,system-ui),sans-serif}
.fragment-organize{padding:7px 14px 11px;text-align:left;border-top:1px solid var(--line)}
.fragment-group-grid{display:grid;gap:13px}
.fragment-group-grid.cards{grid-template-columns:repeat(auto-fill,minmax(235px,1fr))}
.fragment-group-grid.list{grid-template-columns:1fr;gap:7px}
.fragment-group-grid.list .fragment-card-open{padding:11px}
.fragment-group-grid.list .card-preview{font-size:12px;-webkit-line-clamp:1}
.fragments-group-label{font-size:13px;font-weight:650;margin:13px 0 11px;color:var(--muted)}
.arc-membership{display:flex;gap:10px;align-items:center;padding:10px 6px;border-bottom:1px solid var(--line)}
.arc-membership input{accent-color:var(--accent)}
@media(min-width:1300px){body:not([data-mode="minimal"]) .editor-frame:has(+ .margin-notes:not(.hidden)){margin-left:clamp(120px,12vw,240px);margin-right:260px;width:calc(100% - 320px)}}
@media(max-width:900px){.margin-notes{width:230px}.arc-fragment-row{align-items:stretch;flex-direction:column}.arc-fragment-controls{justify-content:flex-end}}
@media(max-width:670px){.margin-notes{top:auto;bottom:calc(65px + env(safe-area-inset-bottom));left:9px;right:9px;width:auto;max-height:54dvh}.list-controls{flex-wrap:wrap}.list-controls>#newArcGroup{order:3}.fragment-group-grid.cards{grid-template-columns:1fr}.mark-palette{margin-bottom:12px}}
@media(max-width:440px){#addMarginNoteBtn{padding:8px}#toggleMarginNotes{padding:7px}.writing-toolbar{gap:1px}}

/* Compact arc groups in the sidebar's existing Fragments navigation */
.recent-group-toggle{border:0;background:#232b2e;color:var(--text);text-align:left;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:12px;font-weight:650;border-radius:7px;padding:10px 9px;width:100%;cursor:pointer}
.recent-group-toggle:hover{background:#2a3735}
.recent-group-item{padding-left:22px}
.recent-ungrouped-label{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;padding:8px 11px 3px}

/* v10: discoverable, pointer-based fragment arrangement across sidebar and Fragments page */
.recent-draggable{display:flex;align-items:center;position:relative;min-width:0;border-radius:8px;gap:3px}
.recent-draggable .recent-item{flex:1;min-width:0;width:100%;padding-left:6px}
.recent-draggable.recent-group-item{padding-left:8px}
.fragment-drag-handle{appearance:none;border:0;background:transparent;color:#9bb5ac;border-radius:7px;font-size:21px;line-height:1;min-width:27px;min-height:32px;padding:3px;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;flex-shrink:0}
.fragment-drag-handle:hover,.fragment-drag-handle:focus-visible{background:#315349;color:#e8fff3}
.fragment-card-container{position:relative}
.fragment-card-container>.fragment-drag-handle{position:absolute;right:9px;top:8px;z-index:1}
.fragment-card-container>.fragment-card-open{padding-right:43px}
.arc-fragment-row>.fragment-drag-handle{align-self:center}
.fragment-drag-help{font-size:12px;color:var(--muted);margin:4px 0 12px;line-height:1.5}
.fragment-drag-ghost{position:fixed;z-index:10000;max-width:210px;background:#3b5650;border:1px solid var(--accent);box-shadow:0 12px 34px #0009;border-radius:9px;color:white;padding:10px 13px;font-weight:620;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
body.is-fragment-dragging{cursor:grabbing!important;user-select:none;-webkit-user-select:none}
.fragment-drop-arc{outline:2px solid var(--accent)!important;outline-offset:-2px;background:#304941!important;box-shadow:0 0 0 2px #263f33}
.fragment-drop-before{box-shadow:inset 0 4px var(--accent)!important;outline:1px solid #688c7e}
.fragment-drop-after{box-shadow:inset 0 -4px var(--accent)!important;outline:1px solid #688c7e}
@media(max-width:900px){.arc-fragment-row>.fragment-drag-handle{align-self:flex-start}.arc-fragment-row{position:relative;padding-left:29px}.arc-fragment-row>.fragment-drag-handle{position:absolute;top:5px;left:0}}

/* v11 — data protection and uncluttered writing return */
.return-to-writing{background:#284338;border:1px solid #588b75;border-radius:999px;color:#e3f5e8;font:inherit;font-weight:600;font-size:12px;padding:8px 12px;white-space:nowrap;cursor:pointer;max-width:200px}
.return-to-writing:hover,.return-to-writing:focus-visible{background:#365d4d}
.return-to-writing.hidden{display:none!important}
.storage-blocker{position:fixed;inset:0;background:rgba(8,11,15,.97);z-index:99999;display:flex;align-items:center;justify-content:center;padding:18px;overflow-y:auto}
.storage-blocker-card{width:min(610px,100%);border:1px solid #8b7560;background:#202830;border-radius:15px;padding:28px;color:#f2eee9;box-shadow:0 12px 45px #0009}
.storage-protected .modal-backdrop{z-index:100000}
.storage-blocker-card h2{font-size:23px;margin:0 0 12px}.storage-blocker-card p{line-height:1.6;color:#d5d4d0}
.storage-blocker-card .button-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}
@media(max-width:650px){.return-to-writing{padding:8px;font-size:17px}.return-to-writing span{display:none}.storage-blocker-card{padding:18px}}

/* v12: accessible sidebar rename and reversible Fragments toggle */
.fragments-section-toggle{appearance:none;border:0;background:transparent;cursor:pointer;color:var(--muted);text-align:left;padding:5px 4px;margin-left:-4px;border-radius:5px;font-weight:700;letter-spacing:.08em}
.fragments-section-toggle:hover,.fragments-section-toggle:focus-visible,.fragments-section-toggle.active{color:#bce5d0;background:#273f37}
.recent-group-heading{display:flex;align-items:center;gap:2px;border-radius:7px;background:#232b2e;min-width:0}
.recent-group-heading .recent-group-toggle{flex:1;min-width:0;background:transparent}
.recent-group-heading:hover{background:#2a3735}
.sidebar-rename-btn{appearance:none;border:0;background:transparent;color:#a2b4ad;font-size:16px;line-height:1;cursor:pointer;border-radius:5px;min-width:25px;min-height:30px;flex-shrink:0;opacity:.72;padding:3px 2px}
.sidebar-rename-btn:hover,.sidebar-rename-btn:focus-visible{background:#345046;color:#eefcf5;opacity:1}
.sidebar-rename-input{width:100%;min-width:0;flex:1;border:1px solid var(--accent);border-radius:6px;background:#11191b;color:var(--text);font:inherit;font-size:12px;padding:7px;outline:0}
.recent-draggable .recent-item{overflow:hidden;text-align:left}
.recent-draggable .recent-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fragment-context{border:1px solid var(--line);border-radius:11px;background:#1c242a;margin:-3px 0 23px;overflow:hidden}
.fragment-context summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:10px;padding:12px 15px;color:var(--text);font-size:13px;font-weight:620}
.fragment-context summary::-webkit-details-marker{display:none}
.fragment-context summary:before{content:'▸';font-size:14px;color:var(--accent)}
.fragment-context[open] summary:before{content:'▾'}
.fragment-context summary:hover,.fragment-context summary:focus-visible{background:#293531}
.fragment-context-status{margin-left:auto;color:var(--muted);font-size:11px;font-weight:400}
.fragment-context-inside{padding:1px 14px 14px;display:grid;gap:9px}
.fragment-context-inside label{font-size:12px;line-height:1.5;color:var(--muted)}
.fragment-context-inside textarea{resize:vertical;min-height:80px;width:100%;max-width:100%;background:#141b1f;color:var(--text);border:1px solid #43534f;border-radius:8px;padding:12px 13px;font:14px/1.6 var(--writing-font,system-ui);outline:0}
.fragment-context-inside textarea:focus{border-color:var(--accent)}
@media(max-width:670px){.fragment-context{margin-bottom:18px}.fragment-context summary{padding:12px}.fragment-context-inside{padding:2px 11px 12px}}

/* v13: arc reordering in the sidebar and Fragments page. Arc drop markers are
   distinct from fragment-to-arc link targets to avoid ambiguous actions. */
.arc-drag-handle{min-width:29px;min-height:33px;font-size:20px;align-self:center}
.recent-group-heading>.arc-drag-handle{margin-left:2px}
.arc-group-heading>.arc-drag-handle{margin-left:-6px}
body.is-arc-dragging{cursor:grabbing!important;user-select:none;-webkit-user-select:none}
.arc-drag-ghost{max-width:260px}
.arc-order-before{box-shadow:inset 0 4px #9ed5b7!important;background:#28433a!important}
.arc-order-after{box-shadow:inset 0 -4px #9ed5b7!important;background:#28433a!important}
@media(max-width:670px){.arc-group-heading{gap:5px}.arc-group-heading>.arc-drag-handle{margin-left:-4px}}

/* v14: complete, collapsible fragment index and selected-document reveal. */
.sidebar-section{flex:0 0 auto;min-height:auto}
.sidebar-footer{flex-shrink:0}
.all-fragments-header{display:flex;align-items:center;gap:4px;background:#202a2b;border-radius:8px;margin-top:9px;min-width:0}
.all-fragments-toggle{flex:1;min-width:0;text-align:left;border:0;background:transparent;color:var(--text);font-weight:660;font-size:12px;padding:11px 10px;border-radius:8px}
.all-fragments-toggle:hover,.all-fragments-toggle:focus-visible{background:#2a3935}
.all-fragments-count{color:#a4beb3;font-size:11px;padding-right:12px;font-variant-numeric:tabular-nums}
.recent-list-empty{color:var(--muted);font-size:12px;margin:6px 9px}
.recent-draggable.selected-fragment-row>.recent-item.active{background:#2a453a;color:#e1f6e9;border-left:3px solid #a3dbc0;padding-left:3px;font-weight:650}
.recent-group-heading.focused-arc{box-shadow:inset 3px 0 #8abda6;background:#293c36}
.all-fragments-section{margin-top:10px;border-top:1px solid var(--line);padding-top:10px}
.all-fragments-page-heading{display:flex;align-items:center;gap:10px;min-height:45px;margin:0 0 12px}
.all-fragments-page-toggle{background:transparent;color:var(--text);border:0;border-radius:7px;text-align:left;font-size:18px;font-weight:700;padding:8px 9px}
.all-fragments-page-toggle:hover,.all-fragments-page-toggle:focus-visible{background:var(--raised)}
.all-fragments-page-count{font-size:12px;color:var(--muted);white-space:nowrap}
@media(max-width:670px){.all-fragments-page-toggle{font-size:16px}.recent-list .recent-item{min-height:34px}}

/* v15 — Location Explorer. All optional; contained places are the folders. */
.location-sidebar-section{flex:0 0 auto;min-width:0}.location-sidebar-toggle{border:0;background:transparent;text-align:left;padding:5px 0;cursor:pointer;color:var(--faint)}
.location-sidebar-toggle:hover{color:var(--text)}.location-sidebar-list{display:grid;gap:2px;min-width:0}
.location-tree-row{display:flex;gap:2px;align-items:center;min-width:0;border-radius:8px;padding:3px 4px 3px calc(4px + var(--location-depth)*13px);position:relative;border:1px solid transparent}
.location-tree-row:hover{background:var(--raised)}.location-tree-row.selected{background:#263e35;border-color:#3b6754}
.location-tree-name{border:0;background:none;color:var(--text);min-width:0;flex:1;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;padding:7px 2px}
.location-tree-row.selected .location-tree-name{font-weight:700;color:#c0f1d7}
.location-expander,.location-tree-action{border:0;background:none;color:var(--muted);padding:5px 3px;min-width:18px;border-radius:5px}
.location-expander:disabled{opacity:.4}.location-tree-action:hover,.location-expander:not(:disabled):hover{color:var(--text);background:#34463d}
.location-tree-row .fragment-drag-handle{font-size:14px;min-width:19px;padding:6px 3px;touch-action:none}
.location-drop-inside{background:#284f40!important;border-color:#79b99a!important;box-shadow:inset 0 0 0 1px #79b99a}
.location-drop-before:before,.location-drop-after:after{content:'';position:absolute;left:3px;right:3px;height:3px;border-radius:5px;background:#a6e6be}
.location-drop-before:before{top:-3px}.location-drop-after:after{bottom:-3px}
.location-explorer-toolbar,.location-profile-top,.location-inside-head,.location-profile-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.location-explorer-toolbar{padding:8px 0 15px;border-bottom:1px solid var(--line)}
.location-explorer-layout{display:grid;grid-template-columns:minmax(155px,34%) minmax(0,1fr);gap:16px;padding:17px 0}
.location-nav{border-right:1px solid var(--line);padding:9px 12px 12px 0;min-width:0;overflow-x:auto}
.location-nav .micro-label{display:block;margin:0 0 12px 10px}
.location-explorer-tree{display:grid;gap:1px;min-width:0}
.location-focus{min-height:210px;padding:13px 6px 25px;min-width:0;overflow-wrap:anywhere}
.location-heading{font:600 clamp(20px,2vw,26px)/1.3 Inter,system-ui,sans-serif;margin:8px 0}
.location-type,.location-description{color:var(--muted);font-size:13px;line-height:1.55}
.location-breadcrumbs{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:0 0 15px}
.location-breadcrumbs button{font-size:11px;border:0;background:none;color:var(--muted);padding:5px 3px;white-space:normal;text-align:left}
.location-breadcrumbs button:hover,.location-breadcrumbs button.current{color:#b4e1c6}.location-crumb-sep{color:var(--faint)}
.location-child-card{display:block;width:100%;background:var(--raised);border:1px solid var(--line);border-radius:10px;color:var(--text);text-align:left;padding:12px;font-size:13px;margin:7px 0}
.location-child-card:hover{border-color:#668d7d;background:#2d4239}
.location-inside-head{padding-top:16px;margin-top:14px;border-top:1px solid var(--line);font-size:13px}
.location-profile-notes,.location-profile-references{border:1px solid var(--line);border-radius:9px;padding:10px 13px;margin:10px 0;font-size:13px}
.location-profile-notes summary,.location-profile-references summary{cursor:pointer;font-weight:600}
.location-profile-references button{display:block;background:none;border:0;color:#b3d8c5;text-align:left;padding:9px 0}
.location-cover{max-width:100%;height:160px;object-fit:contain;border-radius:10px;margin-top:10px;cursor:zoom-in;background:#171f20}
.location-profile-actions{justify-content:flex-start;margin-top:23px}.location-help,.location-empty{font-size:12px;color:var(--muted);line-height:1.6;padding:8px}
.location-results{padding:15px}.location-new-btn{font-size:12px;padding:8px 11px}
@media(max-width:680px){.location-explorer-layout{grid-template-columns:1fr;gap:2px}.location-nav{border-right:0;border-bottom:1px solid var(--line);padding:8px 0 15px;max-height:38vh;overflow:auto}.location-focus{padding:15px 2px}.location-explorer-tree .location-tree-row{min-height:37px}}

/* v16: fragments-only sidebar + a single user-ordered mixed outline. */
.sidebar{gap:18px;padding-top:18px}.sidebar-head{margin-bottom:3px}
.sidebar #recentSection{flex:1 0 auto}.sidebar .sidebar-section{position:relative}
.sidebar-add-button{border:1px solid #3a5449;color:#bfe8d2;background:#263c33;border-radius:7px;min-width:28px;height:28px;font-size:20px;line-height:1}
.sidebar-add-button:hover{background:#38594a}
.sidebar-create-menu{position:absolute;top:32px;right:5px;width:200px;z-index:24;background:#283337;box-shadow:0 12px 40px #000a;border:1px solid #52675d;border-radius:10px;padding:5px;display:grid;gap:3px}
.sidebar-create-menu button{border:0;text-align:left;background:transparent;color:var(--text);padding:11px 9px;font-size:12px;border-radius:7px}
.sidebar-create-menu button:hover{background:#3c5048}
.sidebar-arc-add{border:0;background:#2e493d;color:#bde7ce;cursor:pointer;border-radius:6px;padding:2px 8px;font-size:17px;min-height:29px;flex:0 0 auto}
.sidebar-arc-add:hover{background:#41654e}
.workspace-button{background:#242f33;border:1px solid #40554c;border-radius:8px;color:#cfe6d8;padding:9px 10px;font-size:12px;white-space:nowrap}
.workspace-button:hover{background:#32423e}
.workspace-menu{position:absolute;z-index:35;left:19px;top:56px;width:min(270px,calc(100vw - 30px));max-height:calc(100dvh - 74px);overflow-y:auto;display:grid;gap:13px;padding:17px;background:#202a2e;border:1px solid #49564f;border-radius:13px;box-shadow:var(--shadow)}
.workspace-menu .project-switcher{padding:0}.workspace-menu .primary-nav{display:grid;gap:3px}
.workspace-menu .sidebar-footer{margin-top:7px;border-top:1px solid var(--line);padding-top:8px}
.workspace-menu .location-sidebar-section{border-top:1px solid var(--line);padding-top:8px}
.workspace-menu .location-sidebar-list{max-height:30vh;overflow:auto}
.browse-standalone{min-width:0;position:relative}.fragment-collection.cards>.browse-standalone{grid-column:auto}
.fragment-collection.list>.browse-standalone{grid-column:1/-1}
.recent-group-heading[data-outline-kind],.recent-draggable[data-outline-kind],.browse-standalone{position:relative}
.fragment-drop-before[data-outline-kind],.fragment-drop-after[data-outline-kind],.arc-order-before[data-outline-kind],.arc-order-after[data-outline-kind]{outline-offset:1px}
body[data-mode="minimal"] .workspace-menu:not(.hidden){display:grid}
@media(max-width:700px){.workspace-button{font-size:11px;padding:8px}.topbar-left{gap:6px}.crumbs{gap:5px}.workspace-menu{left:8px}.sidebar-add-button{min-height:31px}}

/* v16: reordering lists and galleries remains optional, not additional permanent navigation. */
.ordered-handle{flex:0 0 auto;min-width:25px;touch-action:none}
.category-group{position:relative}
.category-group>.ordered-handle{position:absolute;top:3px;right:9px;z-index:2}
.category-group>.category-header{padding-right:40px}
.library-entry-card{position:relative}
.library-entry-card>.ordered-handle{position:absolute;right:7px;top:8px;z-index:2}
.library-entry-card>.library-entry{padding-right:43px}
.inbox-note{position:relative}
.inbox-note>.ordered-handle{float:right;margin-left:8px}
.character-photo{position:relative}
.character-photo>.ordered-handle{position:absolute;top:4px;right:5px;z-index:2;border:1px solid #496457;background:#243b34}
.ordered-before{box-shadow:inset 0 4px #97d6b7!important;outline:1px dashed #78ab97}
.ordered-after{box-shadow:inset 0 -4px #97d6b7!important;outline:1px dashed #78ab97}

/* Keep sidebar list directly beneath its header rather than vertically stretching. */
.sidebar #recentSection{display:block;flex:0 0 auto;min-height:auto}
.sidebar #recentSection>.section-label-row{margin-bottom:9px}
.sidebar #recentFragments{align-content:start}


/* v16.1 — restore the familiar, persistent project and navigation area.
   The story outline stays scrollable and unchanged; tools remain in a quiet menu. */
.sidebar{padding-top:0;gap:0;overscroll-behavior:contain;scrollbar-gutter:stable}
.sidebar-pinned{position:sticky;top:0;z-index:12;background:var(--sidebar);padding:17px 0 13px;display:grid;gap:12px;flex:0 0 auto;border-bottom:1px solid var(--line);margin-bottom:14px}
.sidebar-pinned .sidebar-head{margin:0 0 3px}
.sidebar-pinned .primary-nav{display:grid;gap:2px}
.sidebar-pinned .nav-item{min-height:38px;padding:9px 13px}
.sidebar-pinned .project-switcher{padding:0 7px}
.sidebar-pinned .select-line select{padding-top:10px;padding-bottom:10px}
.sidebar #recentSection{padding-top:2px;padding-bottom:15px}
.sidebar #recentSection>.section-label-row{margin-bottom:9px}
.sidebar-pinned .nav-item:focus-visible,.sidebar-pinned select:focus-visible{outline:2px solid #8fceb0;outline-offset:1px}
.workspace-menu{max-height:calc(100dvh - 72px)}
@media(max-width:670px){
  .sidebar-pinned{padding-top:13px;gap:10px;margin-bottom:11px}
  .sidebar-pinned .nav-item{min-height:36px;padding:8px 12px}
}


/* v16.2 — always accessible top controls + in-place reference browsing. */
.topbar{position:sticky;top:0;z-index:19;flex-shrink:0;background:#151b20f2;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.sidebar{z-index:23}
.workspace-reference-actions{display:grid;gap:3px;border-bottom:1px solid var(--line);padding-bottom:12px}
.workspace-reference-actions button{appearance:none;border:0;border-radius:7px;background:none;text-align:left;color:var(--text);padding:11px 9px;font-size:12px;line-height:1.35}
.workspace-reference-actions button:hover,.workspace-reference-actions button:focus-visible{background:#30433b}
.reference-top-button{display:flex;align-items:center;gap:6px;background:#202d2b;border:1px solid #425d52;border-radius:8px;color:#c5e5d5;padding:9px 10px;font-size:12px;white-space:nowrap}
.reference-top-button:hover,.reference-top-button[aria-pressed="true"]{color:#e6fff1;background:#2a4c3d}
.reference-panel{position:fixed;right:0;top:64px;bottom:66px;width:360px;z-index:16;display:flex;flex-direction:column;background:#1b2228;border-left:1px solid #3c4f48;box-shadow:-12px 4px 30px #050a0d77;min-height:0}
.reference-head{flex:0 0 auto;padding:19px 19px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:11px}
.reference-head strong{display:block;font-size:16px;margin-top:5px}
.reference-close{background:transparent;border:0;border-radius:8px;color:var(--muted);font-size:26px;line-height:1;min-width:34px;min-height:34px}
.reference-close:hover{color:var(--text);background:var(--raised-hover)}
.reference-browser,.reference-details{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px}
.reference-search-label{display:block;font-size:11px;color:var(--muted);margin-bottom:9px}
.reference-browser input[type="search"]{font-size:13px}
.reference-entry-list{display:grid;gap:6px;padding:15px 0 10px;align-content:start}
.reference-category{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:#91aaa0;font-weight:700;padding:17px 3px 4px}
.reference-list-entry{appearance:none;width:100%;text-align:left;color:var(--text);background:#242e31;border:1px solid #354840;border-radius:9px;padding:11px 12px;font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.reference-list-entry:hover,.reference-list-entry:focus-visible{border-color:#8cbba7;background:#2a4038}
.reference-list-entry small{display:block;font-size:11px;color:var(--muted);margin-top:4px}
.reference-empty{font-size:13px;line-height:1.6;color:var(--muted);padding:24px 10px;text-align:center}
.reference-back{border:0;background:none;color:var(--accent);font-size:12px;padding:4px 0 17px;text-align:left}
.reference-title{font-size:21px;line-height:1.3;font-weight:650;overflow-wrap:anywhere;margin:4px 0 4px}
.reference-kind{font-size:11px;color:#9cbea9;margin-bottom:16px}
.reference-description,.reference-note{font-size:13px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;color:#e2e7e1}
.reference-block{margin:16px 0;border-top:1px solid #364840;padding:14px 0 0;min-width:0}
.reference-block-heading{font-size:11px;letter-spacing:.06em;font-weight:750;color:#a8cbb8;margin-bottom:10px}
.reference-value{font-size:12px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;color:#d7e0d9;margin:6px 0}
.reference-value b{color:#a9c6b9}
.reference-cost,.reference-cost b,.reference-cost .reference-value{color:#efa6a6}
.reference-photo{display:block;max-width:100%;width:100%;max-height:260px;object-fit:contain;background:#151d20;border-radius:9px;cursor:zoom-in;margin:10px auto}
.reference-linked{font-size:12px;line-height:1.5;color:var(--muted);margin:6px 0}
.reference-footer{flex:0 0 auto;border-top:1px solid var(--line);padding:12px 16px 16px;display:grid;gap:8px}
.reference-footer button{border:1px solid #426858;border-radius:9px;background:#213c30;color:#d2f1e0;padding:10px;text-align:center;font-size:12px}
.reference-footer button:hover{background:#305041}
.reference-footer span{font-size:10px;text-align:center;color:var(--faint)}
#writeView.reference-open .editor-frame{width:calc(100% - 360px);max-width:850px;margin-left:auto;margin-right:360px;padding-left:clamp(22px,3vw,55px);padding-right:clamp(22px,3vw,55px)}
@media(min-width:1300px){body:not([data-mode="minimal"]) #writeView.reference-open .editor-frame:has(+ .margin-notes:not(.hidden)){margin-left:auto;margin-right:360px;width:calc(100% - 360px)}}
@media(max-width:1090px){#writeView.reference-open .editor-frame{width:min(100%,850px);margin:0 auto;padding-left:clamp(22px,6vw,77px);padding-right:clamp(22px,6vw,77px)}.reference-panel{width:min(400px,calc(100vw - 22px));box-shadow:-16px 0 36px #0009}}
@media(max-width:700px){body.sidebar-open .drawer-scrim,body[data-mode="minimal"].sidebar-open .drawer-scrim{z-index:21}.topbar{min-height:57px}.reference-top-button{padding:8px 9px;font-size:14px}.reference-top-button span{display:none}.reference-panel{top:57px;bottom:calc(60px + env(safe-area-inset-bottom));width:min(100vw,410px)}.reference-head{padding:13px 15px}.reference-browser,.reference-details{padding:14px}.reference-footer{padding:10px 13px}.topbar-right{gap:1px}}
@media(max-width:425px){.topbar{padding-left:8px;padding-right:8px}.topbar-left{gap:4px}.reference-top-button{padding:7px}.workspace-button{padding:7px 8px}.crumbs{display:none}}

/* v16.3: One small application menu; primary actions stay in the sidebar/top bar. */
.compact-app-menu{right:19px;top:56px;width:min(255px,calc(100vw - 20px));padding:7px;max-height:calc(100dvh - 75px);overflow-y:auto;z-index:36}
.compact-app-menu>button{padding:12px 11px;min-height:43px}
.menu-document-details{border-top:1px solid var(--line);margin-top:7px;padding-top:5px}
.menu-document-details>summary{cursor:pointer;list-style:none;padding:11px 10px;color:var(--muted);font-size:12px;border-radius:7px;display:flex;justify-content:space-between;align-items:center}
.menu-document-details>summary::-webkit-details-marker{display:none}
.menu-document-details>summary:hover,.menu-document-details>summary:focus-visible{background:var(--raised-hover);color:var(--text)}
.menu-document-details[open]>summary span{transform:rotate(180deg)}
.menu-document-items{padding-left:8px;border-left:1px solid var(--line);margin-left:12px;margin-bottom:5px}
.compact-app-menu .menu-document-items button{font-size:12px;min-height:37px;padding:9px}
.quiet-menu-choices{display:grid;gap:9px;margin-top:18px}
.quiet-menu-choices button{text-align:left;width:100%;white-space:normal}
@media(max-width:670px){.compact-app-menu{top:49px;right:7px}}

/* v17: Story Bible Hub — references existing entries, never duplicates data. */
.bible-view-tabs{display:flex;gap:4px;background:#151e23;border:1px solid #34443e;border-radius:12px;padding:4px;margin:0 0 16px}
.bible-view-tabs button{flex:1;border:0;background:transparent;color:#aebdb7;border-radius:9px;padding:10px 9px;font-size:12px;font-weight:650}
.bible-view-tabs button[aria-pressed="true"]{background:#294637;color:#e4ffef}
.library-view-tabs{max-width:400px;margin-top:20px;margin-bottom:18px}
.bible-hub-intro{display:flex;align-items:start;justify-content:space-between;gap:18px;margin:0 0 20px}
.bible-hub-intro h2{font-size:23px;letter-spacing:-.035em;margin:0 0 4px}
.bible-hub-intro p{max-width:660px;line-height:1.5;margin:0}
.bible-hub-intro>button{white-space:nowrap}
.story-bible-collection{display:flex;flex-direction:column;gap:10px;max-width:920px}
.bible-hub-section{position:relative;background:#222c31;border:1px solid #384c43;border-radius:13px;overflow:visible}
.bible-hub-section>summary{cursor:pointer;display:flex;align-items:center;gap:12px;min-height:58px;padding:15px 17px 15px 53px;list-style:none}
.bible-hub-section>summary::-webkit-details-marker{display:none}
.bible-hub-section>summary:after{content:'⌄';color:#99b8a9;margin-left:auto;transition:transform .15s ease}
.bible-hub-section:not([open])>summary:after{transform:rotate(-90deg)}
.bible-section-title{font-weight:680;font-size:14px}
.bible-hub-content{padding:12px 20px 22px 53px;border-top:1px solid #38443f;display:grid;gap:10px}
.bible-hub-content .field{margin:0}
.bible-roster-filters{display:flex;gap:8px;flex-wrap:wrap}.bible-roster-filters .form-input{max-width:230px;width:clamp(155px,46%,230px);font-size:12px}
.bible-hub-content label{font-size:12px}
.bible-hub-entry{display:flex;flex-direction:column;align-items:flex-start;gap:4px;background:#1b2429;border:1px solid #37473f;color:#e8ece8;text-align:left;border-radius:10px;font-size:13px;padding:12px 15px;width:100%}
.bible-hub-entry:hover{border-color:#8abcaa;background:#283d36}
.bible-hub-entry small{color:#b1c4ba;line-height:1.4}
.bible-hub-add{justify-self:start;margin-top:4px}
.bible-hub-section>.ordered-handle{position:absolute;left:13px;top:13px;z-index:2}
.bible-hub-section.ordered-before{outline:2px solid #8fbda5;outline-offset:3px}
.bible-hub-section.ordered-after{outline:2px solid #8fbda5;outline-offset:3px}
.bible-metadata{border:1px solid #3d5349;border-radius:12px;background:#1d292c;margin:10px 0 16px}
.bible-metadata>summary{cursor:pointer;padding:14px 15px;font-weight:650;font-size:13px}
.bible-metadata-body{padding:10px 16px 17px;border-top:1px solid #3d5349;display:grid;gap:8px}
.bible-metadata-body .field{margin:2px 0}
.bible-custom-row{border-top:1px solid #3d5349;padding-top:12px;display:grid;gap:7px}
.bible-custom-actions,.bible-editor-actions{display:flex;flex-wrap:wrap;gap:6px}
.bible-custom-actions .secondary-button,.bible-editor-actions .secondary-button{padding:6px 10px;font-size:11px}
.bible-editor-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;border-bottom:1px solid #35453c;padding:10px 0}
.reference-bible-note{white-space:pre-wrap;font-size:12px;line-height:1.6;color:#d4e3d9;border-left:2px solid #80a98e;padding:10px 12px;background:#26352f;border-radius:0 8px 8px 0}
.reference-bible-empty{font-size:11px;color:#8b9f95;padding:0 5px 8px}
@media(max-width:650px){.bible-hub-intro{flex-direction:column}.bible-hub-section>summary{padding-left:44px}.bible-hub-section>.ordered-handle{left:5px}.bible-hub-content{padding:13px 13px 17px}.bible-editor-row{grid-template-columns:1fr}}

/* v17.1: drag every Story Bible roster row, and open Reference beside Library. */
.bible-hub-entry-row{display:flex;align-items:center;gap:8px;min-width:0;border-radius:10px}
.bible-hub-entry-row>.ordered-handle{position:static;flex:0 0 30px;touch-action:none;min-height:35px;align-self:center}
.bible-hub-entry-row>.bible-hub-entry{flex:1;min-width:0}
.bible-hub-entry-row.ordered-before{box-shadow:0 -3px 0 #96c6ad}
.bible-hub-entry-row.ordered-after{box-shadow:0 3px 0 #96c6ad}
#libraryView.reference-open .page-content{max-width:calc(100% - 360px);margin-right:360px;margin-left:auto;padding-left:clamp(22px,3vw,65px);padding-right:clamp(22px,3vw,65px)}
@media(max-width:1090px){#libraryView.reference-open .page-content{max-width:none;margin-right:auto;margin-left:auto;padding-left:clamp(22px,4vw,65px);padding-right:clamp(22px,4vw,65px)}}
@media(max-width:700px){.bible-hub-entry-row{gap:4px}.bible-hub-entry-row>.ordered-handle{flex-basis:24px}}

/* v17.2: Keep Library reference usable during in-place profile editing.
   Library entries are still edited in the same form, with no changes to their data. */
.modal-head{gap:10px}
.modal-head h2{min-width:0;flex:1;overflow-wrap:anywhere}
.editor-reference-toggle{flex-shrink:0;padding:9px 12px;white-space:nowrap;background:#20372f;border-color:#446552;color:#d2eedd}
.library-entry-editing .editor-reference-toggle{display:inline-flex;align-items:center;justify-content:center;gap:5px}
.library-entry-editing .editor-reference-toggle[aria-pressed="true"]{background:#315747;border-color:#779b88}
.library-edit-reference-open .reference-panel{z-index:44}
@media(min-width:861px){
 .library-edit-reference-open #modalBackdrop{right:360px;width:calc(100vw - 360px);justify-content:center;padding:15px 20px}
 .library-edit-reference-open #modalBackdrop>.modal{width:min(100%,870px);max-height:calc(100dvh - 42px);min-width:0}
}
@media(min-width:861px) and (max-width:1090px){
 .library-edit-reference-open #modalBackdrop{right:400px;width:calc(100vw - 400px);padding:10px}
 .library-edit-reference-open #modalBackdrop>.modal{max-height:calc(100dvh - 20px)}
}
@media(max-width:860px){
 /* On narrow windows switch between the two, retaining the live editor behind. */
 .library-edit-reference-open .reference-panel{z-index:44;top:0;bottom:0;width:min(100vw,440px)}
 .library-edit-reference-open #modalBackdrop{width:100%}
}
.reference-block-heading{display:flex;gap:8px;align-items:center;justify-content:space-between}
.reference-copy{border:1px solid #405e51;border-radius:6px;color:#b0d6c5;background:transparent;padding:4px 7px;font-size:10px;font-weight:500;letter-spacing:normal;opacity:.65;flex-shrink:0}
.reference-copy:hover,.reference-copy:focus-visible{opacity:1;background:#325042}
@media(max-width:670px){
 .library-entry-editing .modal-head{padding:12px 14px 10px;gap:7px}
 .library-entry-editing .modal-head h2{font-size:19px}
 .library-entry-editing .editor-reference-toggle{padding:8px;font-size:11px}
 .library-edit-reference-open .reference-panel{width:100vw}
}


/* v17.3: Subtle, parent-derived nesting in the Story Bible location roster.
   Only locations with an explicitly assigned parent are indented. */
.bible-hub-entry-row.bible-location-row{
  position:relative;
  margin-inline-start:calc(var(--bible-location-depth,0) * 19px);
}
.bible-hub-entry-row.bible-location-row[style*="--bible-location-depth: 1"]::before,
.bible-hub-entry-row.bible-location-row[style*="--bible-location-depth: 2"]::before,
.bible-hub-entry-row.bible-location-row[style*="--bible-location-depth: 3"]::before,
.bible-hub-entry-row.bible-location-row[style*="--bible-location-depth: 4"]::before,
.bible-hub-entry-row.bible-location-row[style*="--bible-location-depth: 5"]::before,
.bible-hub-entry-row.bible-location-row[style*="--bible-location-depth: 6"]::before,
.bible-hub-entry-row.bible-location-row[style*="--bible-location-depth: 7"]::before,
.bible-hub-entry-row.bible-location-row[style*="--bible-location-depth: 8"]::before{
  content:'';position:absolute;left:-10px;top:7px;bottom:7px;width:1px;background:#466458;
}
.bible-location-row>.location-drag-handle{
  position:static;flex:0 0 30px;min-height:35px;touch-action:none;align-self:center;
}
.bible-location-row.location-drop-inside{
  background:#284f40;border:1px solid #79b99a;
}
.reference-location-entry{
  width:calc(100% - var(--bible-location-depth,0) * 14px);
  margin-inline-start:calc(var(--bible-location-depth,0) * 14px);
}
@media(max-width:700px){
 .bible-hub-entry-row.bible-location-row{margin-inline-start:calc(var(--bible-location-depth,0) * 12px)}
 .bible-location-row>.location-drag-handle{flex-basis:24px}
 .reference-location-entry{width:calc(100% - var(--bible-location-depth,0) * 10px);margin-inline-start:calc(var(--bible-location-depth,0) * 10px)}
}

/* v17.4: Multi-category profiles. Kept inside existing Library editor; no new sidebar items. */
.entry-category-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:7px;margin-top:7px}
.entry-category-choice{display:flex;align-items:center;gap:8px;border:1px solid #3b4b48;border-radius:9px;padding:9px 11px;background:#202a2d;color:#d8e5df;font-size:12px;cursor:pointer}
.entry-category-choice:has(input:checked){border-color:#6d9e85;background:#253f34}
.entry-category-choice input{accent-color:#8ac7a3;min-width:15px;min-height:15px}
.entry-multi-category{display:block;color:#9cbcad;font-size:10px;margin-top:2px}
.connection-preview{font-size:12px;line-height:1.6;padding:11px;border:1px solid #40594f;border-radius:9px;background:#1f2a2b;color:#c9d8d0;min-height:36px;margin:8px 0 14px}

/* v17.5: quiet deletion actions, recoverable Trash, and ID-backed affiliation suggestions */
.sidebar-delete-btn{border:0;background:transparent;color:var(--muted,#9ca8ac);font-size:16px;cursor:pointer;opacity:.58;padding:2px 5px;border-radius:6px;flex:none}
.sidebar-delete-btn:hover,.sidebar-delete-btn:focus-visible{opacity:1;color:#e8ada7;background:rgba(220,125,119,.12)}
.recent-draggable .sidebar-delete-btn,.recent-group-heading .sidebar-delete-btn{opacity:.3}
.recent-draggable:hover .sidebar-delete-btn,.recent-group-heading:hover .sidebar-delete-btn,.sidebar-delete-btn:focus-visible{opacity:1}
.fragment-delete{font-size:12px;opacity:.65;align-self:center}
.fragment-delete:hover{opacity:1}
.affiliation-picker{position:relative;min-width:0}
.affiliation-chips{display:flex;flex-wrap:wrap;gap:6px;margin:7px 0}
.affiliation-chips:empty{display:none}
.affiliation-chip{display:inline-flex;gap:8px;align-items:center;background:rgba(112,168,150,.12);border:1px solid rgba(112,168,150,.3);border-radius:10px;padding:5px 8px;font-size:12px;max-width:100%}
.affiliation-chip button{font-size:16px;line-height:1;background:transparent;color:inherit;border:0;cursor:pointer}
.affiliation-suggestions{display:flex;flex-direction:column;gap:2px;border:1px solid var(--line,rgba(255,255,255,.15));border-radius:8px;padding:4px;margin-top:4px;max-height:220px;overflow:auto;background:#20292e;position:relative;z-index:4}
.affiliation-suggestions.hidden{display:none}
.affiliation-suggestion{background:transparent;border:0;border-radius:6px;color:inherit;text-align:left;cursor:pointer;padding:9px}
.affiliation-suggestion:hover,.affiliation-suggestion:focus-visible{background:rgba(150,200,170,.12)}
.trash-items{display:flex;flex-direction:column;gap:8px;max-height:52vh;overflow-y:auto;margin:14px 0}
.trash-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px;border:1px solid rgba(255,255,255,.10);border-radius:8px}
.trash-row span{flex:1;min-width:145px;overflow-wrap:anywhere}
@media(hover:none){.sidebar-delete-btn,.recent-draggable .sidebar-delete-btn,.recent-group-heading .sidebar-delete-btn{opacity:.65}}

/* v18: Focus Timeline — chronological focus rather than an overwhelming full-map view. */
.timeline-collection{max-width:950px;margin:16px 0 40px}
.timeline-intro{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;margin:8px 0 20px}
.timeline-intro h2{margin:0 0 6px;font-size:23px}
.timeline-intro p{margin:0;font-size:13px}
.timeline-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:10px 0}
.timeline-tools .secondary-button{padding:9px 12px}
.timeline-year-input{flex:0 1 112px;width:112px;min-width:80px;text-align:center}
.timeline-current-period{font-size:19px;margin:20px 0 14px}
.timeline-filter-row{display:flex;align-items:center;gap:12px;margin:12px 0 22px}
.timeline-filter-row label{font-size:12px;color:#a8bdb4;flex:none}
.timeline-filter-row select{max-width:340px}
.timeline-event-list{border-left:2px solid #496758;margin-left:12px;display:flex;flex-direction:column;gap:13px;padding:0 0 10px 18px}
.timeline-event{position:relative;border:1px solid #3b514a;border-radius:11px;background:#1f2a2b;overflow:visible}
.timeline-event:before{content:'';position:absolute;left:-25px;top:23px;width:10px;height:10px;border-radius:50%;background:#87b99e;border:2px solid #182222}
.timeline-event summary{cursor:pointer;display:flex;align-items:center;gap:8px;padding:14px 16px;list-style:none}
.timeline-event summary::-webkit-details-marker{display:none}
.timeline-event summary:after{content:'⌄';color:#abcbb9;margin-left:auto}
.timeline-event[open] summary:after{content:'⌃'}
.timeline-event-summary{display:flex;flex-direction:column;gap:5px;min-width:0;overflow-wrap:anywhere}
.timeline-event-date{font-size:11px;color:#9cbdae}
.timeline-event-summary strong{font-size:14px;font-weight:600}
.timeline-event-detail{border-top:1px solid #3c5048;padding:12px 16px 16px}
.timeline-event-notes{white-space:pre-wrap;line-height:1.6;font-size:13px;overflow-wrap:anywhere;margin:2px 0 14px}
.timeline-event-links,.timeline-event-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:10px}
.timeline-link,.timeline-arc-tag{font-size:12px;border:1px solid #4c695c;border-radius:7px;background:#263831;padding:6px 9px;color:#bbdacb}
.timeline-link{cursor:pointer}
.timeline-link:hover,.timeline-link:focus-visible{background:#355646}
.timeline-arc-tag{color:#a9b7ae;background:transparent}
.timeline-editor-date{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.timeline-editor-links{display:grid;gap:10px;margin:14px 0}
.timeline-editor-links details{border:1px solid #41554d;border-radius:9px;padding:11px}
.timeline-editor-links summary{cursor:pointer;font-size:13px;font-weight:600}
.timeline-pick-list{max-height:180px;overflow-y:auto;margin-top:10px;display:flex;flex-direction:column;gap:5px}
.timeline-picker{display:flex;align-items:center;gap:9px;border-radius:7px;padding:7px;font-size:12px}
.timeline-picker:hover{background:rgba(132,186,152,.11)}
.reference-open-profile{width:100%;margin:8px 0 16px;text-align:center}
@media(max-width:600px){.timeline-intro h2{font-size:21px}.timeline-tools{gap:6px}.timeline-tools .secondary-button{font-size:11px}.timeline-editor-date{grid-template-columns:1fr}.timeline-filter-row{align-items:stretch;flex-direction:column;gap:5px}}

/* Authorized GK timeline companion (v18). */
.timeline-import-actions { display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap; }
.timeline-age-reference { border:1px solid var(--line, #3b4947);border-radius:10px;margin:10px 0;padding:10px 14px;background:rgba(120,150,142,.06); }
.timeline-age-reference summary {cursor:pointer;font-size:13px;font-weight:600;}
.timeline-age-lines {font-size:13px;white-space:pre-line;line-height:1.75;color:var(--text-muted,#abb8b2);padding:12px 2px 4px;}
@media(max-width:700px){.timeline-import-actions {justify-content:flex-start;}.timeline-import-actions button{max-width:100%;}}

/* Explicit timeline character attribution, preserving original author event text. */
.timeline-character-chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px;align-items:center}
.timeline-focus-chip,.timeline-mentioned-chip,.timeline-review-chip,.timeline-character-chip{display:inline-flex;align-items:center;border-radius:7px;padding:3px 8px;font-size:11px;line-height:1.4;font-weight:600;max-width:100%;overflow-wrap:anywhere}
.timeline-focus-chip{background:rgba(105,173,147,.22);color:#b8e9d3;border:1px solid rgba(113,188,159,.35)}
.timeline-mentioned-chip{background:rgba(146,160,178,.13);color:var(--text,#d7e2dc);border:1px solid rgba(146,160,178,.28)}
.timeline-review-chip{background:rgba(229,191,104,.12);color:#ebd5a0;border:1px solid rgba(229,191,104,.27)}
.timeline-character-summary{font-size:12px;color:var(--muted,#acb8b3);margin-bottom:10px}
.timeline-character-editor{border:1px solid rgba(145,167,159,.27);border-radius:10px;padding:14px;margin:12px 0}
.timeline-character-editor h3{margin:0 0 7px;font-size:15px}
.timeline-character-editor p{font-size:12px;margin:0 0 12px}
.timeline-character-pickers{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.timeline-character-add{display:flex;gap:6px;align-items:center}
.timeline-character-add input{min-width:0;flex:1}
.timeline-character-add button{white-space:nowrap}
.timeline-character-chip{background:rgba(105,173,147,.18);color:var(--text,#d8e4de);gap:7px}
.timeline-character-remove{border:0;background:transparent;color:inherit;font-size:16px;line-height:1;cursor:pointer;padding:0 2px}
.timeline-review-checkbox{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:12px}
@media(max-width:690px){.timeline-character-pickers{grid-template-columns:1fr}}

/* Timeline profile resolution and one-step Library creation */
.library-category-header-line{display:flex;align-items:stretch;gap:6px;min-width:0}
.library-category-header-line>.category-header{flex:1;min-width:0}
.library-category-add,.bible-section-add{border:1px solid var(--line);border-radius:10px;background:var(--raised);color:var(--text);font-weight:650;font-size:18px;cursor:pointer;min-width:35px;min-height:34px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.library-category-add:hover,.bible-section-add:hover{background:var(--raised-hover)}
.bible-hub-section>summary .bible-section-add{margin-left:auto;min-width:34px;min-height:32px}
.timeline-unlinked-profiles{display:flex;flex-wrap:wrap;align-items:center;gap:7px;padding:8px 0 13px}
.timeline-unlinked-profiles p{width:100%;margin:0 0 4px}
@media(max-width:650px){.bible-hub-section>summary .bible-section-add{min-width:34px}}
/* Keep category reorder handle distinct from the category + action. */
.category-group>.library-category-header-line{padding-right:48px}

/* v19: fast, searchable navigation without extra permanent tabs. */
.smart-select-native{display:none!important}
.smart-select-trigger{display:block;width:100%;min-width:0;max-width:100%;min-height:41px;border:1px solid var(--line,#46534f);border-radius:9px;background:var(--raised,#222a2d);color:var(--text,#edf1ec);padding:9px 28px 9px 12px;font:inherit;font-size:13px;cursor:text;background-image:linear-gradient(45deg,transparent 50%,#a6b3ad 50%),linear-gradient(135deg,#a6b3ad 50%,transparent 50%);background-position:calc(100% - 15px) 49%,calc(100% - 10px) 49%;background-size:5px 5px;background-repeat:no-repeat}
.smart-select-trigger:focus{outline:2px solid #74bda0;outline-offset:1px}
.smart-select-popover{position:fixed;z-index:12000;overflow-y:auto;max-height:min(330px,46vh);background:#222b2d;border:1px solid #577064;box-shadow:0 12px 38px #0008;border-radius:10px;padding:5px;color:#e9ede8}
.smart-select-option{display:block;width:100%;text-align:left;border:0;background:transparent;color:inherit;font-size:13px;line-height:1.35;padding:11px 12px;border-radius:7px;cursor:pointer;white-space:normal;overflow-wrap:anywhere}
.smart-select-option:hover,.smart-select-option.active{background:#365146;color:#f5fff9}
.smart-option-empty{padding:12px;font-size:12px}
.quick-switch-trigger{white-space:nowrap;min-width:60px}
.quick-switcher-backdrop{position:fixed;inset:0;background:rgba(7,10,12,.72);z-index:15000;display:flex;align-items:flex-start;justify-content:center;padding:10vh 14px 12px}
.quick-switcher-backdrop.hidden{display:none}
.quick-switcher-dialog{width:min(710px,96vw);background:#202a2b;border:1px solid #53695e;box-shadow:0 22px 65px #0009;border-radius:15px;overflow:hidden}
.quick-switcher-search{display:flex;align-items:center;gap:12px;padding:14px;border-bottom:1px solid #46564f}
.quick-switcher-search span{font-size:22px;color:#a0c7b0}
.quick-switcher-search input{flex:1;min-width:0;border:none;outline:none;background:transparent;color:#edf0ec;font-size:16px}
.quick-switcher-search button{background:transparent;color:#dde7e1;border:0;cursor:pointer;font-size:22px;padding:2px 6px}
.quick-switcher-results{max-height:59vh;overflow-y:auto;padding:8px}
.quick-search-item{display:flex;flex-direction:column;gap:3px;text-align:left;align-items:flex-start;width:100%;border:0;border-radius:9px;background:transparent;color:#e6ede8;padding:10px 13px;cursor:pointer}
.quick-search-item.active,.quick-search-item:hover{background:#304a3e}
.quick-search-type{text-transform:uppercase;font-size:10px;letter-spacing:.09em;color:#9fc5b0}
.quick-search-item strong{font-size:14px;font-weight:600}
.quick-search-item small{font-size:11px;color:#b3c2ba;line-height:1.4}
.quick-switcher-hint{padding:10px 15px;border-top:1px solid #40534a;color:#adbbb1;font-size:11px}
.reference-pin-button{width:100%;margin:3px 0 9px}
.affiliation-inline-create{display:flex;gap:8px;align-items:center;margin:8px 0 12px;flex-wrap:wrap}
.affiliation-inline-create .smart-select-trigger{flex:0 1 190px;width:190px}
.affiliation-inline-create .secondary-button{flex:1;min-width:145px}
.entry-where-used{margin:12px 0;border:1px solid #4b6558;border-radius:9px;padding:10px}
.entry-where-used summary{cursor:pointer;font-size:13px;font-weight:650}
.entry-used-contents{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:12px 6px 4px;font-size:12px}
.bulk-fragment-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:9px;background:#25332f;border:1px solid #496255;border-radius:10px;padding:11px;margin:5px 0 18px}
.bulk-fragment-toolbar.hidden{display:none}
.bulk-fragment-toolbar>strong{font-size:12px}
.bulk-fragment-toolbar label{font-size:12px;color:#c2d0c8;display:flex;align-items:center;gap:8px;min-width:190px}
.bulk-fragment-toolbar .smart-select-trigger{max-width:230px}
.bulk-fragment-choice{display:flex;align-items:center;gap:6px;color:#bad5c5;font-size:11px;padding:8px 12px 0;cursor:pointer}
.bulk-fragment-choice input{accent-color:#71b596}
@media(max-width:700px){.quick-switcher-backdrop{padding-top:5vh}.quick-switcher-results{max-height:69vh}.quick-switch-trigger{padding:7px 9px}.quick-switch-trigger span{display:none}.smart-select-popover{max-height:40vh}.affiliation-inline-create{align-items:stretch}.affiliation-inline-create .smart-select-trigger{width:100%;flex:1 1 145px}}

/* Library bulk organization is opt-in, not a permanent checkbox column. */
.library-bulk-area{margin:8px 0 13px;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.library-bulk-area.hidden{display:none}
.library-bulk-area>.bulk-fragment-toolbar{flex:1 1 100%;margin:0}
.library-bulk-area .smart-select-trigger{max-width:230px}
.library-bulk-area .bulk-fragment-toolbar label{min-width:145px}
.bulk-library-choice{flex:none!important;position:relative!important;padding:5px 7px!important;align-self:center!important}
.library-entry-card:has(.bulk-library-choice){display:flex;flex-wrap:wrap;align-items:center}
.library-entry-card:has(.bulk-library-choice) .library-entry{flex:1 1 170px}
.bible-hub-entry-row:has(.bulk-library-choice){flex-wrap:wrap}
@media(max-width:650px){.library-bulk-area .bulk-fragment-toolbar{flex-direction:column;align-items:stretch}.library-bulk-area .bulk-fragment-toolbar label{width:100%}}


/* v19.1 — Full Visual Timeline: user-controlled zoom, no synthetic dates. */
.vt-view-switch{display:inline-flex;gap:3px;background:#1b2627;border:1px solid #3b5249;border-radius:12px;padding:4px;margin:4px 0 13px;max-width:100%}
.vt-view-option{background:transparent;border:0;color:#a5b9ae;font-size:13px;padding:10px 16px;border-radius:9px;font-weight:650;cursor:pointer}
.vt-view-option[aria-pressed="true"]{color:#def4e8;background:#334f44}
.vt-view-option:focus-visible,.vt-zoom-button:focus-visible,.vt-year-card:focus-visible,.vt-decade-card:focus-visible,.vt-event-pill:focus-visible,.vt-chronology-entry:focus-visible{outline:2px solid #a9e2c7;outline-offset:2px}
.vt-root{padding:16px;border:1px solid #3a5149;border-radius:15px;background:#1b2426;margin-top:12px;min-width:0}
.vt-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.vt-toolbar h3{margin:0 0 4px;font-size:19px}.vt-toolbar p{font-size:12px;margin:0}
.vt-zoom-controls{display:flex;gap:3px;flex-wrap:wrap;background:#141e20;padding:4px;border-radius:9px}
.vt-zoom-button{border:0;background:transparent;color:#b0c5bb;padding:8px 12px;border-radius:7px;cursor:pointer;font-size:12px;font-weight:600}
.vt-zoom-button[aria-pressed="true"]{background:#355448;color:#e7f8ed}
.vt-stats{display:flex;gap:12px;align-items:center;flex-wrap:wrap;font-size:12px;color:#b6cdc1;padding:13px 0 20px}
.vt-stats>span+span{border-left:1px solid #4a5d56;padding-left:12px}
.vt-undated-button{padding:6px 9px;border:1px solid #668e7c;color:#c8e8d8;background:transparent;border-radius:7px;cursor:pointer;font-size:11px}
.vt-track{overflow-x:auto;overscroll-behavior-inline:contain;display:flex;gap:13px;padding:13px 6px 22px;scrollbar-color:#567b6a #1b2526;scrollbar-width:thin;max-width:100%;scroll-snap-type:x proximity}
.vt-track>*{flex-shrink:0;scroll-snap-align:start}
.vt-decade-track{align-items:stretch}
.vt-decade-card{width:186px;min-height:170px;background:#203331;color:#dceee4;border:1px solid #42665a;border-radius:13px;padding:16px;display:flex;flex-direction:column;align-items:flex-start;gap:7px;text-align:left;cursor:pointer}
.vt-decade-card:hover,.vt-year-card:hover,.vt-event-pill:hover,.vt-chronology-entry:hover{background:#2b4239;border-color:#8bc2a4}
.vt-period{font-size:12px;font-weight:700}.vt-decade-number{font-size:30px;line-height:1.2}.vt-small{font-size:11px;color:#a8c2b5;line-height:1.45}
.vt-density{display:flex;gap:4px;margin-top:auto}.vt-density-cell{width:10px;height:10px;border:1px solid #456055;border-radius:3px;background:#263735}.vt-density-cell.is-filled{background:#8dbb9e;border-color:#9bd0b8}
.vt-year-hint,.vt-hint,.vt-empty-filter{font-size:12px;color:#b0c4b9;line-height:1.6;margin:10px 0}.vt-year-track{align-items:flex-end;gap:5px;padding-top:15px}
.vt-year-card{width:64px;height:163px;background:#202c2b;color:#dceee6;border:1px solid #3e574c;border-radius:9px;padding:10px 4px 9px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:9px;cursor:pointer}
.vt-year-card.is-selected{border-color:#b1ddc1;box-shadow:0 0 0 1px #b1ddc1}.vt-year-card:not(.has-events){opacity:.72}
.vt-year-label{font-size:12px;font-weight:700}.vt-year-bar{width:21px;min-height:6px;max-height:82px;border-radius:5px 5px 1px 1px;background:linear-gradient(180deg,#a9d2bc,#5b9177)}
.vt-year-card:not(.has-events) .vt-year-bar{background:#42554c}.vt-year-count{font-size:10px;line-height:1.2;color:#b3cfc0;min-height:24px}
.vt-selected-year{display:flex;justify-content:space-between;gap:9px;align-items:center;flex-wrap:wrap;margin:9px 0 16px}
.vt-year-navigation{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.vt-year-navigation strong{min-width:82px;text-align:center}
.vt-jump{width:118px!important;min-width:90px!important;padding:9px!important}.vt-year-navigation .secondary-button,.vt-selected-year .secondary-button{padding:9px 12px}
.vt-month-track{align-items:flex-start;gap:9px}.vt-month-card{width:230px;min-height:230px;max-height:390px;overflow-y:auto;padding:13px;background:#202f2d;border:1px solid #3f5b50;border-radius:11px;scrollbar-width:thin}
.vt-month-card h4{margin:0 0 4px;font-size:13px}.vt-month-count{font-size:11px;color:#a3bbaa}.vt-month-events{display:flex;flex-direction:column;gap:7px;margin-top:12px}
.vt-event-pill{display:flex;flex-direction:column;gap:4px;align-items:flex-start;border:1px solid #415d51;border-radius:8px;background:#182723;color:#d4e8de;width:100%;padding:11px;text-align:left;cursor:pointer;white-space:normal;overflow-wrap:anywhere}
.vt-event-pill strong{font-size:12px;font-weight:650;line-height:1.45}.vt-event-pill.is-selected,.vt-chronology-entry.is-selected{background:#294b3c;border-color:#9fd5b9}
.vt-event-chronology{border-left:2px solid #648c77;margin:12px 0 16px 12px;padding:0 0 0 18px;display:flex;flex-direction:column;gap:9px;max-height:650px;overflow-y:auto;scrollbar-width:thin}
.vt-chronology-entry{position:relative;width:100%;text-align:left;display:flex;flex-direction:column;gap:6px;background:#1d302c;border:1px solid #405a50;border-radius:10px;padding:13px;cursor:pointer;color:#dcece4;overflow-wrap:anywhere}
.vt-chronology-entry:before{content:'';width:10px;height:10px;background:#a8d4bb;border-radius:50%;position:absolute;left:-25px;top:18px;border:2px solid #1b2526}
.vt-chronology-entry strong{font-size:13px}
.vt-preview{border:1px solid #6d9f85;background:#1d302a;border-radius:12px;padding:18px;margin:16px 0;scroll-margin-top:80px}
.vt-preview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.vt-preview-head h3{margin:3px 0 10px;font-size:18px}
.vt-eyebrow{font-size:11px;color:#b0cfb8;margin:0}.vt-preview-close{background:none;border:1px solid #4e6c5b;color:#d5e6db;border-radius:7px;padding:5px 10px;font-size:18px;cursor:pointer}
.vt-notes{font-size:13px;white-space:pre-wrap;line-height:1.65;overflow-wrap:anywhere;max-height:340px;overflow-y:auto;margin:13px 0}
.vt-preview-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}.vt-preview-actions .secondary-button{font-size:12px;padding:9px 10px}
@media(max-width:650px){.vt-root{padding:12px}.vt-view-switch{display:flex;width:100%}.vt-view-option{flex:1;padding:10px 5px}.vt-year-card{width:56px}.vt-month-card{width:210px;max-height:340px}.vt-toolbar{align-items:flex-start}.vt-zoom-button{padding:8px 10px}.vt-stats{gap:8px}.vt-jump{width:90px!important}}

/* v20: focused, responsive, text-accessible relationship explorer */
.relationships-collection{max-width:1120px;margin:0 auto;padding:14px 0 35px;display:flex;flex-direction:column;gap:16px}
.relationships-collection.hidden{display:none}
.relationship-heading h2{margin:0 0 6px;font-size:22px}
.relationship-heading p{margin:0 0 5px}
.relationship-finder{display:flex;flex-direction:column;gap:7px;max-width:640px}
.relationship-search-results{display:flex;flex-direction:column;gap:3px;max-height:220px;overflow-y:auto}
.relationship-result{background:#1e2b29;border:1px solid #425951;border-radius:8px;text-align:left;padding:9px 12px;color:#e0e9e3;cursor:pointer}
.relationship-result:hover,.relationship-result:focus-visible{border-color:#8fc8ac}
.relationship-focus-pane{border:1px solid #395349;border-radius:14px;background:#1b2527;padding:17px;min-width:0}
.relationship-focus-heading h3{margin:1px 0 2px;font-size:20px}.relationship-eyebrow{font-size:10px;letter-spacing:1.6px;color:#a4c9b4}.relationship-focus-heading{margin-bottom:12px}
.relationship-graph{background:#151e20;border:1px solid #31443d;border-radius:13px;width:100%;padding:8px;overflow:hidden}
.relationship-graph svg{display:block;width:100%;height:auto;max-height:430px}
.relationship-line{stroke:#698e7d;stroke-width:1.8;stroke-opacity:.65;stroke-linecap:round}
.relationship-node{cursor:pointer;outline:none}.relationship-node-plate{fill:#263b37;stroke:#759c88;stroke-width:1.5}
.relationship-node-dot{fill:#91c8ae}.relationship-node-label{font:12px system-ui,sans-serif;fill:#e5f4e9;pointer-events:none}
.relationship-node:not(.is-focus) .relationship-node-label{opacity:0;transition:opacity .12s ease}
.relationship-node:hover .relationship-node-label,.relationship-node:focus-visible .relationship-node-label{opacity:1}
.relationship-node:hover .relationship-node-plate,.relationship-node:focus-visible .relationship-node-plate{stroke:#d9f6e4;stroke-width:3}
.relationship-node.is-focus .relationship-node-plate{fill:#284e40;stroke:#b1dec7;stroke-width:2}.relationship-node.is-focus .relationship-node-label{font-weight:700;opacity:1}
.relationship-overflow{font-size:12px;padding-top:7px}
.relationship-connection-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(215px,1fr));gap:8px;margin-top:14px}
.relationship-connection-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;background:#23312f;border:1px solid #3b544b;border-radius:8px;padding:7px 8px;min-width:0}
.relationship-connection-name{background:transparent;border:0;color:#e1f1e7;text-decoration:underline;text-decoration-color:#718e80;text-underline-offset:3px;text-align:left;font-size:12px;cursor:pointer;min-width:0;overflow-wrap:anywhere}
.relationship-connection-type{color:#9ebdaf;font-size:11px}.relationship-remove{margin-left:auto;border:0;border-radius:5px;background:transparent;color:#f2b2a7;font-size:19px;cursor:pointer}
.relationship-writing{border:1px solid #3b5148;border-radius:10px;margin-top:14px;padding:11px 14px}.relationship-writing summary{cursor:pointer;font-size:13px;font-weight:600}
.relationship-writing-body{display:flex;flex-direction:column;gap:8px;padding-top:12px}.relationship-writing-link{border:0;background:none;text-align:left;cursor:pointer;color:#b9e3cf;font-size:12px;overflow-wrap:anywhere}
.relationship-actions{background:#202b2b;border:1px solid #395247;border-radius:12px;padding:16px;display:flex;flex-direction:column;align-items:flex-start;gap:12px}
.relationship-add-form{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 13px;align-items:end}.relationship-add-form h3{grid-column:1/-1;margin:0;font-size:16px}.relationship-add-form label{font-size:12px;color:#c0d5cb}
.relationship-add-form select,.relationship-add-form input,.relationship-add-form button{min-width:0;width:100%}.relationship-add-form .primary-button{grid-column:1/-1;justify-self:start;max-width:260px}
.relationship-open{width:auto}.reference-relationship-graph svg{max-height:280px}.reference-relationship-graph .relationship-node-label{font-size:14px}.reference-connections-button{margin:6px 0 12px;display:block}.reference-details .relationship-connection-list{grid-template-columns:1fr}.reference-details .relationship-connection-row{max-width:100%}
@media(max-width:650px){.relationships-collection{padding:5px 0 24px}.relationship-focus-pane{padding:11px}.relationship-add-form{grid-template-columns:1fr}.relationship-add-form h3,.relationship-add-form .primary-button{grid-column:1}.relationship-graph{padding:2px}.relationship-node-label{font-size:14px}.reference-relationship-graph svg{max-height:260px}}

@media(hover:none),(pointer:coarse){.relationship-node:not(.is-focus) .relationship-node-label{opacity:1;font-size:14px}}

/* v20.1: save controls stay visible even when Library forms are very long. */
.entry-save-actions{display:flex;align-items:center;gap:9px;padding:10px 20px;border-block:1px solid #40564c;background:#1b2828;flex-shrink:0}
.entry-save-actions.hidden{display:none!important}.entry-save-actions .secondary-button,.entry-save-actions .primary-button{min-height:39px;padding:9px 14px}
.entry-save-hint{font-size:11px;color:#b0cabd;flex:1;min-width:0}
@media(max-width:680px){.entry-save-actions{padding:9px 12px;gap:7px}.entry-save-hint{display:none}.entry-save-actions>button{flex:1}}
/* Expanded parent folders are visually distinct from both leaf and focused rows. */
.location-tree-row.is-expanded-parent:not(.selected){background:#263630;border:1px solid #3a5547}
.location-tree-row.is-expanded-parent:not(.selected) .location-tree-name{color:#d7f2e0;font-weight:650}
.location-tree-row.is-expanded-parent::before{content:"";position:absolute;left:calc(4px + var(--location-depth)*13px);top:6px;bottom:6px;width:2px;border-radius:3px;background:#679e80;opacity:.65}
.location-tree-row.is-expanded-parent.selected{background:#28493c;border-color:#80b69a}
/* Relationship labels use browser-native text, avoiding SVG text downscaling/blurring. */
.relationship-graph{position:relative;min-height:420px;padding:0;overflow:hidden}
.relationship-graph>svg{position:absolute;inset:0;width:100%;height:100%;max-height:none;pointer-events:none}
.relationship-node-button{position:absolute;transform:translate(-50%,-50%);width:125px;min-height:52px;padding:8px 10px;border-radius:12px;border:1.5px solid #759d88;background:#273b36;color:#f0f7f2;font:650 13px/1.25 system-ui,sans-serif;overflow-wrap:anywhere;text-align:center;cursor:pointer;z-index:1;box-shadow:0 2px 8px #080b0a70}
.relationship-node-button:hover,.relationship-node-button:focus-visible{outline:2px solid #a2d7ba;outline-offset:2px;background:#34564a}
.relationship-node-button.is-focus{width:180px;min-height:62px;font-size:15px;background:#315e4e;border:2px solid #b0e7c7;z-index:2}
.relationship-connection-row{align-content:center}
.relationship-history-button,.relationship-remove-button{border:1px solid #4e6a5b;background:#1d2a28;color:#d3e9dc;padding:6px 8px;border-radius:7px;font:600 11px system-ui,sans-serif;cursor:pointer}
.relationship-remove-button{color:#f4c0b5;border-color:#77544e}
.relationship-history-count{font-size:10px;color:#b3cdbc}
.relationship-history-intro{padding:12px;background:#192b27;border-radius:9px;font-weight:650;color:#d9f4e3}
.relationship-history-items{display:grid;gap:8px;margin:12px 0 19px;max-height:220px;overflow-y:auto}
.relationship-history-record{border:1px solid #425b50;border-radius:9px;padding:10px 12px;display:grid;gap:5px}
.relationship-history-record small{color:#b0ccba}.relationship-history-record p{white-space:pre-wrap;margin:0}
.relationship-current-tag{color:#a9dbc0;font-size:11px}
.reference-relationship-graph{min-height:330px}.reference-relationship-graph>svg{max-height:none}
@media(max-width:680px){.relationship-graph{min-height:0;height:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:11px}.relationship-graph>svg{display:none}.relationship-node-button{position:static!important;transform:none!important;width:100%;min-height:55px}.relationship-node-button.is-focus{grid-column:1/-1;width:100%;order:-1}.reference-relationship-graph{min-height:0}}

/* v20.2: focused organization hierarchy and flexible character groups */
.library-structured-category,.bible-hub-content{min-width:0}
.library-structure-tools{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:8px 0 13px;color:var(--muted);font-size:12px}
.library-hierarchy-row{--library-hierarchy-depth:0;display:flex;align-items:center;gap:6px;min-height:43px;margin:4px 0 4px calc(var(--library-hierarchy-depth)*15px);padding:3px 7px;border:1px solid var(--line);background:#1b2429;border-radius:9px;min-width:0;position:relative}
.library-hierarchy-row:not([style*="depth: 0"]){border-left-color:#45695e}
.library-hierarchy-row.is-expanded-parent{background:#244137;border-color:#537966}
.library-hierarchy-row.organization-hierarchy-row.is-expanded-parent{background:#254338;border-color:#54856c}
.library-hierarchy-row .fragment-drag-handle{height:29px;width:23px;flex:none;padding:1px;touch-action:none}
.library-tree-toggle{background:none;border:0;color:var(--muted);min-width:22px;padding:6px 2px}
.library-tree-spacer{display:inline-flex;align-items:center;justify-content:center;color:var(--faint);width:22px;flex:none}
.library-tree-entry{flex:1;min-width:0;color:var(--text);text-align:left;border:0;background:transparent;padding:6px 2px;font-size:13px;font-weight:560;overflow:hidden;text-overflow:ellipsis}
.library-tree-entry small{display:block;color:var(--muted);font-size:11px;font-weight:400;white-space:normal;margin-top:3px}
.library-tree-actions{display:flex;gap:2px;flex:none}
.library-tree-actions button,.library-tree-remove{border:0;background:transparent;color:var(--muted);border-radius:7px;padding:5px 7px}
.library-tree-actions button:hover,.library-tree-remove:hover{background:var(--raised-hover);color:var(--text)}
.character-group-heading{background:#22342f;border-color:#45685b}
.character-group-entry{background:#192127}
.character-ungrouped-heading{background:#273038;color:var(--muted);font-size:12px;padding:12px;border-radius:8px;margin-top:16px}
.character-group-actions{display:flex;flex-wrap:wrap;gap:12px;margin:2px 0 10px calc(var(--library-hierarchy-depth)*15px + 30px)}
.library-add-to-group{background:transparent;border:0;color:var(--accent);font-size:11px;padding:6px}
.library-add-to-group:hover{text-decoration:underline}
.character-matches{display:grid;gap:5px;max-height:270px;overflow:auto}
.character-match{display:block;text-align:left;padding:11px;border-radius:8px;border:1px solid var(--line);background:var(--raised);color:var(--text)}
.hierarchy-before{box-shadow:inset 0 3px #9ac7aa!important}.hierarchy-after{box-shadow:inset 0 -3px #9ac7aa!important}.hierarchy-inside{background:#2c5744!important;border-color:#8fd3af!important}
@media(max-width:660px){.library-hierarchy-row{margin-left:calc(var(--library-hierarchy-depth)*11px);gap:3px;padding:3px 4px}.library-tree-actions button{padding:4px}.library-tree-entry{font-size:12px}.character-group-actions{margin-left:calc(var(--library-hierarchy-depth)*11px + 15px)}}

.library-structure-filter{width:auto!important;max-width:205px;min-width:145px;padding:8px 10px!important;font-size:12px!important}

/* v20.3 — writing comfort and Library Clarity */
.fragment-sticky-controls{position:sticky;top:55px;z-index:17;display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:8px clamp(12px,3vw,40px);border-bottom:1px solid var(--line);background:#171f23f5;backdrop-filter:blur(10px)}
.fragment-sticky-controls button{background:#233037;border:1px solid #394a49;border-radius:8px;padding:8px 10px;min-height:34px;color:var(--text);font:inherit;font-size:12px;cursor:pointer}
.fragment-sticky-controls button:hover,.fragment-sticky-controls button:focus-visible{background:#2c443f;border-color:var(--accent)}
#writeView .doc-top-actions{display:none}
#writeView.context-side-open .fragment-context{display:block;position:fixed;z-index:18;top:116px;left:calc(260px + 11px);width:min(256px,27vw);max-height:calc(100vh - 190px);overflow-y:auto;box-shadow:0 14px 36px #0008}
#writeView:not(.context-side-open) .fragment-context{display:none}
@media(min-width:1100px){#writeView.context-side-open .editor-frame{margin-left:max(255px,calc(50% - 325px));margin-right:20px;width:min(780px,calc(100% - 300px))}}
@media(max-width:900px){#writeView.context-side-open .fragment-context{left:6px;width:min(320px,85vw);top:110px;box-shadow:0 14px 44px #000d}}
@media(max-width:670px){.fragment-sticky-controls{top:55px;padding:6px;gap:4px}.fragment-sticky-controls button{padding:7px 6px;font-size:11px}#writeView.context-side-open .fragment-context{left:8px;right:8px;width:auto;top:104px;max-height:62dvh}#writeView.context-side-open .editor-frame{margin:0 auto;width:100%}}
.clarity-heading{display:grid;gap:4px;margin:16px 0 10px;padding:10px 12px;border-left:3px solid var(--accent);background:#1b282a;border-radius:5px}
.clarity-heading strong{font-size:15px}.clarity-heading small{font-size:12px;color:var(--muted)}
.clarity-connections{padding:8px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.clarity-connection-row{border:1px solid #374844;border-radius:10px;background:#192327;padding:10px 12px;margin:8px 0;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.clarity-connection-main{display:grid;gap:5px;min-width:160px}.clarity-connection-main small{font-size:12px}.clarity-connection-actions{display:flex;gap:5px}
.clarity-connection-details{width:100%;padding-top:10px;border-top:1px solid #394844;display:grid;gap:8px}.clarity-connection-details[hidden]{display:none}
.clarity-history-line{font-size:13px;color:var(--muted)}.clarity-unlinked-notes{margin:13px 0}.clarity-note-body{display:grid;gap:7px;padding:10px}
.connection-pick-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:5px 0;padding:8px;border:1px solid var(--line);border-radius:9px}
.character-multiselect{max-height:50dvh;overflow-y:auto}.character-multi-choice{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--line);border-radius:9px;margin:5px 0;cursor:pointer}
.character-multi-choice input{width:17px;height:17px;accent-color:var(--accent)}
.timeline-placement-year{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:space-between}.timeline-placement-year .form-input{max-width:110px}
.timeline-placement-months{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:14px 0}
.placement-month{padding:12px 5px;border:1px solid #3a4c4a;border-radius:7px;background:#202c30;color:var(--text);cursor:pointer}.placement-month.is-selected{background:#285044;border-color:#78b59c}
.timeline-placement-events{max-height:220px;overflow-y:auto;display:grid;gap:5px}.placement-event{display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:#1d292d;border-radius:9px;padding:9px}.placement-event span{font-size:11px;color:var(--muted)}.placement-event strong{flex:1;min-width:140px;font-size:13px}
@media(max-width:580px){.timeline-placement-months{grid-template-columns:repeat(3,minmax(0,1fr))}}

.clarity-profile-maintenance{margin:18px 0;border:1px solid var(--line);border-radius:9px;padding:10px 13px}.clarity-profile-maintenance summary{cursor:pointer;color:var(--muted);font-size:13px}.clarity-profile-maintenance p{font-size:12px}
.fragment-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:12px 0}.fragment-action-grid button{min-height:46px}
.placement-year-hint{color:var(--muted);font-size:12px;margin:14px 0 5px}.placement-year-strip{display:grid;grid-template-columns:repeat(11,minmax(0,1fr));gap:4px}
.placement-year-tick{display:flex;flex-direction:column;align-items:center;justify-content:end;gap:5px;min-height:67px;border:1px solid #344644;border-radius:7px;background:#1c282b;color:var(--muted);font-size:11px;cursor:pointer;padding:5px 0}
.placement-year-tick.is-selected{background:#265044;border-color:#79b69f;color:var(--text);font-weight:700}.placement-year-tick:hover{background:#354841}.placement-year-count{width:45%;border-radius:3px 3px 0 0;background:#689a86;min-height:4px;max-height:60px}
@media(max-width:580px){.placement-year-strip{gap:2px}.placement-year-tick{font-size:9px}.fragment-action-grid{grid-template-columns:1fr}}

/* v20.4 — timelines can be reordered directly; never imply new chronology on drag. */
.timeline-drag-grip{cursor:grab;touch-action:none;user-select:none;display:inline-flex;flex:none;align-items:center;justify-content:center;color:#a9c8ba;border:1px solid #53665e;background:#293b35;border-radius:7px;width:27px;height:29px;font-size:18px;vertical-align:middle;margin-right:5px}
.timeline-drag-grip:focus-visible{outline:2px solid #b3e7c6;outline-offset:2px}
.timeline-drop-before{box-shadow:0 -4px 0 #a8d8bc!important;border-top-color:#a8d8bc!important}
.timeline-drop-after{box-shadow:0 4px 0 #a8d8bc!important;border-bottom-color:#a8d8bc!important}
.timeline-drag-ghost{position:fixed;pointer-events:none;z-index:1000;max-width:250px;padding:9px 14px;background:#385a4a;color:#f0fff7;border:1px solid #aadfc3;border-radius:8px;box-shadow:0 8px 24px #0008;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px}
.vt-event-pill .timeline-drag-grip,.vt-chronology-entry .timeline-drag-grip{float:right;align-self:flex-start;position:relative;z-index:1;margin-left:auto}
.vt-event-pill,.vt-chronology-entry{min-height:62px}
/* Notes are a second, intentionally project-scoped resource; the main sidebar remains unchanged. */
.global-notes-panel{position:fixed;z-index:23;right:12px;top:72px;bottom:83px;width:min(750px,calc(100vw - 285px));background:#1d262b;border:1px solid #496159;border-radius:14px;box-shadow:0 14px 50px #000a;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.desk-notes-header{display:flex;justify-content:space-between;align-items:center;padding:15px 18px;border-bottom:1px solid var(--line)}
.desk-notes-header strong{display:block;font-size:17px;margin-top:3px}
.desk-notes-header button{background:transparent;color:var(--text);border:0;font-size:26px;cursor:pointer}
.desk-notes-filter{display:flex;gap:6px;padding:10px 14px 0;flex-wrap:wrap}
.desk-notes-filter button{background:#28353a;color:#c9dad5;border:1px solid #42534e;border-radius:8px;padding:8px 11px;font-size:12px;cursor:pointer}
.desk-notes-filter button[aria-pressed="true"]{background:#315c4c;border-color:#8bbfa7;color:#effff5}
.desk-notes-search{display:flex;gap:8px;padding:11px 14px}.desk-notes-search input{min-width:0;flex:1}.desk-notes-search button{white-space:nowrap}
.desk-notes-layout{display:grid;grid-template-columns:minmax(145px,36%) 1fr;flex:1;min-height:0;border-top:1px solid var(--line)}
.desk-notes-list{border-right:1px solid var(--line);overflow-y:auto;padding:10px;display:flex;flex-direction:column;gap:6px}
.desk-note-item{background:#233036;border:1px solid #3e4d4b;border-radius:8px;color:var(--text);text-align:left;padding:11px;cursor:pointer;min-width:0;display:grid;gap:6px}
.desk-note-item[aria-pressed="true"]{background:#304d43;border-color:#8ac3a5}
.desk-note-item strong{font-size:12px;overflow-wrap:anywhere}.desk-note-item span{font-size:11px;color:var(--muted);overflow-wrap:anywhere}
.desk-notes-editor{padding:16px;display:flex;flex-direction:column;gap:12px;min-height:0;overflow-y:auto}
.desk-note-type{font-size:10px;font-weight:650;letter-spacing:.08em;color:#a4cab6}.desk-note-quote{font-size:12px;color:#d2dcd8;background:#273437;border-left:3px solid #83bb9b;padding:10px;margin:0;white-space:pre-wrap;max-height:110px;overflow:auto}
.desk-note-body{flex:1;min-height:155px!important;resize:none!important;font-size:14px!important;line-height:1.6!important}
.desk-note-status{color:var(--muted);font-size:11px}.desk-note-actions{display:flex;flex-wrap:wrap;gap:7px}
.desk-note-empty{color:var(--muted);font-size:12px;line-height:1.5;padding:12px}
.desk-notes-trash{padding:9px 14px;border-top:1px solid var(--line);max-height:135px;overflow:auto;font-size:11px;color:var(--muted)}
.desk-note-trash-row{display:flex;justify-content:space-between;align-items:center;gap:9px;padding:6px}.desk-note-trash-row button{padding:6px 8px}
.note-anchor-flash{outline:3px solid #eac86f;outline-offset:2px}
@media(max-width:900px){.global-notes-panel{right:0;top:60px;bottom:60px;width:min(100vw,640px);border-radius:0}}
@media(max-width:560px){.global-notes-panel{width:100vw}.desk-notes-layout{grid-template-columns:minmax(112px,34%) 1fr}.desk-notes-search{flex-wrap:wrap}.desk-notes-search input{width:100%;flex-basis:100%}.desk-notes-editor{padding:10px}.desk-notes-list{padding:6px}.desk-note-item{padding:8px}.desk-notes-filter button{padding:7px}}

.timeline-drag-hint{font-size:11px;color:var(--muted);margin:8px 0 14px;padding-left:10px}

.timeline-event,.timeline-event-list{scroll-margin-top:126px}

/* v20.5: project-persistent resizable desktop Notes window */
@media(min-width:901px){
 .global-notes-panel{top:auto;bottom:83px;width:min(var(--desk-width,750px),calc(100vw - 275px));height:min(var(--desk-height,680px),calc(100dvh - 155px));min-width:340px;min-height:280px;max-height:calc(100dvh - 155px)}
 .desk-notes-resize-width{position:absolute;z-index:6;left:0;top:45px;bottom:8px;width:10px;cursor:ew-resize;background:transparent;touch-action:none}
 .desk-notes-resize-height{position:absolute;z-index:6;left:13px;right:60px;top:0;height:9px;cursor:ns-resize;background:transparent;touch-action:none}
 .desk-notes-resize-width:hover,.desk-notes-resize-width.resizing{background:linear-gradient(90deg,#84c0a5,transparent)}
 .desk-notes-resize-height:hover,.desk-notes-resize-height.resizing{background:linear-gradient(#84c0a5,transparent)}
 .desk-notes-resize-width:focus-visible,.desk-notes-resize-height:focus-visible{outline:2px solid #94d2b0;outline-offset:0}
}
@media(max-width:900px){.desk-notes-resize-width,.desk-notes-resize-height{display:none}}


/* v20.6: dock Notes BESIDE the workspace. No overlapping or lost reading position. */
@media(min-width:901px){
 body.notes-docked .main-area{margin-right:var(--notes-dock-width,550px);width:calc(100% - 250px - var(--notes-dock-width,550px));}
 body.notes-docked[data-mode="minimal"] .main-area{margin-left:0;width:calc(100% - var(--notes-dock-width,550px))}
 body.notes-docked .global-notes-panel{
  position:fixed;top:64px;bottom:0;right:0;left:auto;
  width:var(--notes-dock-width,550px);min-width:340px;
  height:calc(100dvh - 64px)!important;max-height:none;min-height:0;
  border-radius:0;border-right:0;border-bottom:0;box-shadow:none;
 }
 body.notes-docked .writing-toolbar{right:var(--notes-dock-width,550px)}
 body.notes-docked .topbar{padding-left:12px;padding-right:12px;gap:6px}
 body.notes-docked .crumbs{display:none}
 body.notes-docked .topbar-left,body.notes-docked .topbar-right{gap:4px;min-width:0}
 body.notes-docked .topbar-right .save-state{font-size:0;gap:0}
 body.notes-docked .editor-frame{padding-left:clamp(16px,3vw,48px);padding-right:clamp(16px,3vw,48px)}
 body.notes-docked .page-content{padding-left:clamp(15px,2vw,36px);padding-right:clamp(15px,2vw,36px)}
 body.notes-docked .desk-notes-resize-height{display:none}
 body.notes-docked .desk-notes-resize-width{top:0;bottom:0;width:12px}
}
@media(min-width:901px) and (max-width:1200px){
 body.notes-docked .topbar-left .reference-top-button span{display:none}
 body.notes-docked .return-to-writing span{display:none}
 body.notes-docked .doc-top-row{flex-wrap:wrap}
 body.notes-docked .fragment-sticky-controls{gap:3px}
 body.notes-docked .fragment-sticky-controls button{padding:6px;font-size:11px}
}
/* Editor gets most of the Notes width. The list is optional and remembered. */
.desk-notes-layout{grid-template-columns:minmax(120px,28%) minmax(0,1fr)}
.global-notes-panel.notes-list-collapsed .desk-notes-layout{grid-template-columns:minmax(0,1fr)}
.global-notes-panel.notes-list-collapsed .desk-notes-list{display:none}
.desk-notes-editor{min-width:0}
.desk-note-body{min-height:240px!important}
.desk-notes-header-actions{display:flex;gap:5px;align-items:center}
.desk-notes-header-actions .desk-notes-list-toggle,.desk-notes-header-actions .desk-notes-step{
 background:#263a37;border:1px solid #47645a;border-radius:8px;color:#d6efe3;
 padding:6px 9px;font-size:12px;cursor:pointer;white-space:nowrap;
}
.desk-notes-header-actions .desk-notes-step{font-size:20px;line-height:17px;min-width:32px}
.desk-notes-header-actions .desk-notes-step:disabled{opacity:.3;cursor:default}
.desk-notes-header-actions .desk-notes-list-toggle:hover,.desk-notes-header-actions .desk-notes-step:hover:not(:disabled){background:#365249}
.desk-notes-header-actions button:focus-visible{outline:2px solid #9bcfb7;outline-offset:2px}
@media(max-width:900px){
 .desk-notes-layout{grid-template-columns:minmax(104px,28%) minmax(0,1fr)}
 .desk-notes-header{padding:12px}
 .desk-notes-header-actions{gap:3px}
 .desk-notes-header-actions .desk-notes-list-toggle{font-size:11px;padding:6px}
}


/* v20.7: Optional narrative structure, kept visually subordinate to the fragment outline. */
.show-structure-toggle{background:transparent;color:var(--muted);font-size:10px;border:1px solid var(--line);border-radius:7px;padding:5px 7px;cursor:pointer;margin-left:auto;white-space:nowrap}
.show-structure-toggle.is-active,.show-structure-toggle[aria-pressed="true"]{background:#284b3d;border-color:#5d9d7a;color:#d5f3e4}
.structure-key-heading{display:flex;align-items:center;gap:5px;border-top:1px solid var(--line);margin:5px 2px 8px;padding-top:10px}
.structure-section-toggle{border:0;background:transparent;color:#bfdfcf;flex:1;text-align:left;font-weight:650;font-size:12px;cursor:pointer;padding:6px 8px}
.structure-count{font-size:10px;color:var(--muted);margin-right:9px}
.structure-key-items{display:grid;gap:3px;padding:0 6px 10px 10px;max-height:240px;overflow:auto}
.structure-key-item{border:0;background:#20302d;color:var(--text);padding:8px;border-radius:7px;text-align:left;display:flex;gap:7px;font-size:11px;line-height:1.4;cursor:pointer}
.structure-key-item:hover,.arc-skeleton-beat:hover{background:#30483d}
.structure-key-date{color:#b3d8bf;font-size:10px;flex:0 0 31px}
.arc-skeleton-outline{display:flex;gap:5px;align-items:center;padding-left:24px}
.arc-skeleton-toggle{border:0;background:transparent;color:#adcdbb;cursor:pointer;text-align:left;font-size:11px;min-width:0;flex:1;padding:7px 2px}
.arc-skeleton-edit{background:none;border:1px solid transparent;color:#a5c8b9;border-radius:5px;font-size:12px;padding:4px 6px;cursor:pointer}
.arc-skeleton-edit:hover{border-color:var(--line)}
.arc-skeleton-beats{padding:0 6px 7px 42px;display:grid;gap:3px}
.arc-skeleton-beat{width:100%;border:0;color:#b5ccbf;background:#1d2926;border-left:2px solid #567d69;text-align:left;font-size:11px;line-height:1.4;padding:7px 8px;border-radius:3px 7px 7px 3px;cursor:pointer;overflow-wrap:anywhere}
.structure-empty{color:var(--muted);font-size:11px;margin:3px 0 7px;line-height:1.5}
.skeleton-editor-beats{display:grid;gap:12px}.skeleton-editor-beat{background:#182722;border:1px solid #365246;border-radius:10px;padding:12px;display:grid;gap:9px}
.skeleton-editor-beat.skeleton-drag-target{outline:2px solid #8dc8a4}.skeleton-beat-toolbar{display:flex;gap:6px;align-items:center;justify-content:flex-end}
.skeleton-beat-toolbar button{background:#283733;color:#e1efe7;border:1px solid #3d5a4c;border-radius:6px;padding:5px 9px;cursor:pointer}
.skeleton-beat-toolbar .skeleton-beat-grip{margin-right:auto;cursor:grab;touch-action:none;font-size:19px}
.skeleton-beat-links{border-top:1px solid #365246;padding:8px 0;font-size:12px}.skeleton-beat-links summary{cursor:pointer;color:#aed5c0}
.skeleton-link-list{display:grid;gap:8px;padding:10px 0}.skeleton-link-choices{display:grid;gap:4px;max-height:210px;overflow:auto}
.skeleton-link-choice{display:flex;align-items:flex-start;gap:9px;padding:5px 7px;border-radius:5px;color:var(--text);line-height:1.4;cursor:pointer}
.skeleton-link-choice:hover{background:#31413b}.skeleton-link-heading{font-size:12px;margin-top:7px}
.arc-reference-beat{background:#202b29;border:1px solid #3a5248;border-radius:10px;padding:11px;margin-top:9px;display:grid;gap:8px}
.arc-reference-beat.active{border-color:#7cba99}.arc-reference-beat-title{background:none;border:0;text-align:left;color:#e1f2e7;font-weight:700;cursor:pointer;font-size:13px;padding:4px 0}
.arc-reference-detail,.arc-reference-overview{white-space:pre-wrap;overflow-wrap:anywhere;color:#d1dfd6;line-height:1.65;font-size:13px}
.moment-editor{border:1px solid #41594b;border-radius:10px;padding:12px;margin-bottom:16px}.moment-check{display:flex;gap:10px;align-items:center;margin-bottom:14px;color:#d9e7dc;font-size:13px}
.moment-why{white-space:pre-wrap;color:#d5e6d7;background:#233c2e;border-left:3px solid #9bc69d;border-radius:5px;padding:12px;font-size:12px;line-height:1.65;margin:12px 0}
.moment-tag{font-size:10px;color:#eedda0;margin-left:8px}.browse-arc-structure{padding:5px 18px 8px}.browse-arc-structure button{font-size:12px}
@media(max-width:800px){.show-structure-toggle{font-size:10px;padding:4px}.structure-key-items{max-height:180px}.skeleton-editor-beat{padding:9px}}

/* v20.7.1 — simultaneous docks, deliberate two-pane research mode, and reference Key Moments. */
.reference-head-actions{display:flex;gap:5px;align-items:center;min-width:0}
.reference-mini-action{border:1px solid #47645a;color:#d6eee2;background:#294039;border-radius:8px;font-size:11px;padding:7px 8px;white-space:normal;text-align:center}
.reference-mini-action:hover{background:#375347}
.reference-mini-action:focus-visible,.research-mode-bar button:focus-visible{outline:2px solid #a4e6c9;outline-offset:2px}
.reference-moment{border:1px solid #354740;border-radius:10px;overflow:hidden}
.reference-moment-heading{border:0;border-radius:0;background:#253132;font-weight:600}
.reference-moment-date{display:block!important;color:#a1c3b1!important;margin:0 0 4px!important;font-weight:450;font-size:11px!important}
.reference-moment-details{display:none;padding:0 11px 13px;line-height:1.55}
.reference-moment.expanded .reference-moment-details{display:grid;gap:10px}
.reference-moment-details .reference-block{margin:5px 0;padding:10px 0 0}
.reference-moment-details .secondary-button{width:100%}
.bible-view-tabs button{min-width:0;font-size:11px;padding:10px 4px}
.research-mode-bar{position:fixed;z-index:19;left:250px;right:0;top:64px;min-height:39px;padding:5px 14px;background:#20332c;border-bottom:1px solid #527965;display:flex;align-items:center;justify-content:space-between;gap:12px;color:#d6ece1;font-size:12px}
body[data-mode="minimal"] .research-mode-bar{left:0}
.research-mode-bar button{border:1px solid #609578;border-radius:8px;background:#315544;color:#e2f7ea;padding:7px 10px;font-size:12px;font-weight:650;white-space:nowrap}
/* A wide desktop shows writing + both docks without a sheet over any content. */
@media(min-width:901px){
 body.dual-references .main-area{margin-right:calc(var(--dual-reference-width) + var(--dual-notes-width));width:calc(100% - 250px - var(--dual-reference-width) - var(--dual-notes-width));min-width:0}
 body.dual-references[data-mode="minimal"] .main-area{margin-left:0;width:calc(100% - var(--dual-reference-width) - var(--dual-notes-width))}
 body.dual-references .reference-panel{position:fixed;right:var(--dual-notes-width);top:64px;bottom:0;width:var(--dual-reference-width);box-shadow:none;z-index:24}
 body.dual-references .global-notes-panel{position:fixed;right:0;top:64px;bottom:0;width:var(--dual-notes-width)!important;height:calc(100dvh - 64px)!important;max-height:none;box-shadow:none;z-index:23;border-radius:0;border-bottom:0}
 body.dual-references .writing-toolbar{right:calc(var(--dual-reference-width) + var(--dual-notes-width))}
 body.dual-references #writeView.reference-open .editor-frame,body.dual-references #libraryView.reference-open .page-content{width:100%;max-width:100%;margin-left:auto;margin-right:auto;padding-left:16px;padding-right:16px}
 body.dual-references .reference-head{padding:12px 10px}
 body.dual-references .reference-head-actions{gap:4px}
 body.dual-references .global-notes-panel .desk-notes-header{padding:11px}
 /* Compact screens and manual Focus hide only the background editor, not its state. */
 body.research-focus .main-area{margin-left:250px;margin-right:0;width:calc(100% - 250px)}
 body.research-focus[data-mode="minimal"] .main-area{margin-left:0;width:100%}
 body.research-focus .main-area>.view,body.research-focus .writing-toolbar{visibility:hidden;pointer-events:none}
 body.research-focus .reference-panel{position:fixed;top:103px;bottom:0;left:250px;right:auto;width:calc((100vw - 250px)/2);min-width:0;max-width:none;z-index:24;box-shadow:none}
 body.research-focus[data-mode="minimal"] .reference-panel{left:0;width:50vw}
 body.research-focus .global-notes-panel{position:fixed;top:103px;bottom:0;right:0;left:auto;width:calc((100vw - 250px)/2)!important;min-width:0;max-width:none;height:calc(100dvh - 103px)!important;max-height:none;z-index:23;box-shadow:none;border-radius:0}
 body.research-focus[data-mode="minimal"] .global-notes-panel{width:50vw!important}
 body.research-focus .reference-head{padding:10px 12px}
 body.research-focus .desk-notes-header{padding:10px 12px}
 body.research-focus .desk-notes-resize-width{display:none}
 body.research-focus .reference-head strong{font-size:14px}
 /* Keep the separate editable Library modal available above the docks. */
 body.research-focus.library-entry-editing #modalBackdrop{z-index:40}
 body.research-focus.library-edit-reference-open .reference-panel{z-index:44}
}
/* Mobile: both remain open internally; swap visible sheet without losing note edits. */
@media(max-width:900px){
 body.dual-mobile .reference-panel{z-index:25}
 body.dual-mobile .global-notes-panel{z-index:25}
 body.dual-mobile:not(.mobile-show-notes) .global-notes-panel{visibility:hidden;pointer-events:none}
 body.dual-mobile.mobile-show-notes .reference-panel{visibility:hidden;pointer-events:none}
 body.dual-mobile .reference-mini-action{display:inline-flex;align-items:center}
 body.dual-mobile .global-notes-panel{top:57px;bottom:0;height:calc(100dvh - 57px)}
 body.dual-mobile .reference-panel{top:57px;bottom:0}
}
@media(max-width:670px){
 body.dual-mobile .reference-head{padding:9px 12px}
 body.dual-mobile .desk-notes-header-actions{flex-wrap:wrap;justify-content:end}
}

/* v20.7.1 final: optional two-way divider and coexistence with Library editing. */
@media(min-width:901px){
 .reference-resize-grip{position:absolute;z-index:10;top:0;right:-6px;bottom:0;width:12px;cursor:col-resize;touch-action:none}
 .reference-resize-grip:hover,.reference-resize-grip:focus-visible{background:linear-gradient(90deg,transparent,#8bcbb0,transparent);outline:none}
 body.dual-references .reference-panel{width:var(--dual-reference-width)}
 body.research-focus .reference-panel{width:var(--research-ref-width)}
 body.research-focus .global-notes-panel{width:calc(100vw - 250px - var(--research-ref-width))!important}
 body.research-focus[data-mode="minimal"] .global-notes-panel{width:calc(100vw - var(--research-ref-width))!important}
 body.library-entry-editing.dual-references .global-notes-panel,body.library-entry-editing.research-focus .global-notes-panel{z-index:46}
}
@media(max-width:900px){.reference-resize-grip{display:none}}

/* v20.7.3 · Feature Usage stays in Preferences, never a permanent sidebar item. */
.usage-toggle{display:flex;align-items:center;gap:12px;font-weight:650;padding:12px;border:1px solid var(--border,#3c4949);border-radius:10px;cursor:pointer}
.usage-toggle input{width:18px;height:18px;flex-shrink:0}
.usage-summary{max-height:34vh;overflow:auto;padding:12px;background:rgba(117,152,142,.06);border-radius:10px}
.usage-feature-list{display:grid;gap:4px}.usage-feature-row{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:4px 6px;border-bottom:1px solid rgba(150,180,170,.14)}
.usage-feature-row strong{font-variant-numeric:tabular-nums}

/* v20.7.4 — keyboard shortcut recorder */
.shortcut-rows{display:grid;gap:5px;margin:14px 0 10px}
.shortcut-category{font-size:.79rem;text-transform:uppercase;letter-spacing:.07em;opacity:.7;margin:14px 0 5px}
.shortcut-row{display:grid;grid-template-columns:minmax(135px,1fr) minmax(105px,auto) auto auto;align-items:center;gap:8px;padding:8px 3px;border-bottom:1px solid var(--line,#3335)}
.shortcut-label{font-size:.9rem;min-width:0}
.shortcut-binding{font-size:.77rem;white-space:nowrap;max-width:225px;overflow-wrap:anywhere;word-break:break-word;white-space:normal;border:1px solid var(--line,#3335);padding:5px 7px;border-radius:6px}
.shortcut-row .secondary-button{padding:7px 9px;font-size:.81rem}
.shortcut-feedback{min-height:1.4em;font-size:.86rem;opacity:.85;margin:6px 0 12px}
.shortcut-feedback.is-error{color:#bb715f;opacity:1}
@media(max-width:650px){.shortcut-row{grid-template-columns:minmax(100px,1fr) auto auto;gap:6px}.shortcut-binding{grid-column:1/-1;grid-row:2}.shortcut-row .secondary-button{font-size:.74rem}}



/* v20.7.5 — relationship labels inside visual map nodes.
   The map's own width, not viewport width, determines when it stacks. */
.relationship-graph-shell{width:100%;min-width:0;container:relationship-shell / inline-size}
.relationship-graph{
  position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:10px;
  min-height:var(--relationship-map-height,430px);padding:0;overflow:hidden;
  background:radial-gradient(ellipse at 50% 50%,#22372f 0%,#192724 49%,#141e20 100%);
  border:1px solid #3b5449;border-radius:15px;
}
.relationship-graph>svg{position:absolute;inset:0;width:100%;height:100%;max-height:none;pointer-events:none;opacity:.90}
.relationship-graph .relationship-line{fill:none;stroke:#749c88;stroke-width:1.6;stroke-opacity:.64;stroke-linecap:round}
.relationship-node-button{
  position:absolute;transform:translate(-50%,-50%);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  width:184px;min-height:75px;padding:11px 10px;
  border:1px solid #557d69;background:#253b33;color:#eef6f0;
  border-radius:13px;box-shadow:0 4px 16px #060e0a70;
  font:inherit;line-height:1.28;transition:background .12s,border-color .12s;z-index:1;
}
.relationship-node-button:hover,.relationship-node-button:focus-visible{background:#345b48;border-color:#acd7bc;outline:2px solid #a2d7ba;outline-offset:2px}
.relationship-node-name{font-size:13px;font-weight:675;line-height:1.3;overflow-wrap:anywhere;max-width:100%;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.relationship-node-type{
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;
  max-width:100%;max-height:calc(3.9em + 8px);overflow:hidden;overflow-wrap:anywhere;
  background:#192c24;border:1px solid #496c58;border-radius:999px;
  padding:4px 10px;color:#bee0ca;font-size:11px;font-weight:560;line-height:1.3;
}
.relationship-node-button.is-focus{width:194px;min-height:75px;background:#315847;border:1.5px solid #afd8bc;box-shadow:0 4px 22px #040b0890;z-index:2}
.relationship-node-button.is-focus .relationship-node-name{font-size:15px;font-weight:760}
.relationship-node-focus-label{font-size:10px;text-transform:uppercase;letter-spacing:.09em;background:#234638;color:#daeee1;border-color:#6a9b80}
.reference-relationship-graph{min-height:var(--relationship-map-height,430px)}
/* A 300px Reference dock is compact even if the monitor is 2000px wide. */
@container relationship-shell (max-width:660px){
 .relationship-graph{min-height:0;height:auto;padding:12px;gap:10px}
 .relationship-graph>svg{display:none}
 .relationship-node-button,.relationship-node-button.is-focus{
   position:static!important;transform:none!important;min-width:0;width:100%;min-height:64px;
   padding:10px 8px;box-shadow:none;
 }
 .relationship-node-button.is-focus{grid-column:1/-1;order:-1}
 .relationship-node-type{display:block;max-height:none;-webkit-line-clamp:unset;border-radius:8px}
}
@container relationship-shell (max-width:390px){
 .relationship-graph{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){.relationship-node-button{transition:none}}

/* v20.7.6 — Quiet Inbox cards match the fragment index; pasted note images. */
.inbox-collection.fragment-group-grid.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(235px,1fr));gap:13px;align-items:stretch}
.inbox-collection .inbox-note{position:relative;min-width:0;background:var(--raised);border:1px solid var(--line);border-radius:13px;overflow:hidden}
.inbox-collection .inbox-note>.ordered-handle{position:absolute;top:8px;right:9px;z-index:2;float:none;margin:0}
.inbox-collection .inbox-note>.fragment-card-open{padding-right:43px;min-height:146px}
.inbox-collection .inbox-note>.fragment-organize{width:100%;text-align:left;min-height:34px}
.inbox-collection .inbox-note>.fragment-delete{width:calc(100% - 12px);margin:0 6px 6px}
.inbox-image-indicator{font-size:11px;color:var(--accent);margin-top:auto}
.note-images{display:grid;gap:8px;margin-top:9px;min-width:0}
.note-image-toolbar{display:flex;align-items:center;justify-content:space-between;gap:9px;flex-wrap:wrap}
.note-image-toolbar>.muted{font-size:11px;flex:1;min-width:125px}
.note-image-toolbar .secondary-button{padding:7px 10px;font-size:12px}
.note-image-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(108px,1fr));gap:8px}
.note-images-empty .note-image-gallery{display:none}
.note-image-tile{position:relative;min-width:0;background:var(--paper);border:1px solid var(--line);border-radius:9px;overflow:hidden}
.note-image-open{width:100%;height:118px;border:0;background:transparent;display:block;padding:4px;cursor:zoom-in}
.note-image-open img{width:100%;height:100%;object-fit:contain;border-radius:6px}
.note-image-remove{width:100%;background:var(--raised);border:0;border-top:1px solid var(--line);color:var(--muted);padding:7px;font-size:11px}
.note-image-remove:hover{color:var(--text);background:var(--raised-hover)}
#globalNotesEditor .note-images{flex:0 0 auto;padding-bottom:10px}
#globalNotesEditor .note-image-gallery{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}
@media(max-width:670px){.inbox-collection.fragment-group-grid.cards{grid-template-columns:1fr}.note-image-open{height:134px}}


/* v20.8.0 — spacious note writing + restrained shared rich-text controls */
.rich-field{display:flex;flex-direction:column;gap:0;width:100%;min-width:0;border:1px solid #456158;border-radius:9px;overflow:clip;background:#172220}
.rich-hidden-source{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;padding:0!important;margin:0!important;border:0!important;overflow:hidden!important}
.rich-toolbar{display:flex;align-items:center;gap:3px;overflow-x:auto;flex-shrink:0;padding:5px 7px;background:#273730;border-bottom:1px solid #40594e;scrollbar-width:thin;position:sticky;top:0;z-index:8;border-radius:8px 8px 0 0}
.rich-tool{background:none;border:0;border-radius:5px;color:#d9eee0;cursor:pointer;font-family:inherit;font-weight:650;font-size:12px;padding:7px 9px;min-width:27px;white-space:nowrap}
.rich-tool:hover,.rich-tool:focus-visible{background:#3c5e4d;outline:none}
.rich-tool strong{font-weight:850}.rich-tool em{font-style:italic;font-family:Georgia,serif;font-size:14px}.rich-tool u{text-underline-offset:2px;text-decoration-thickness:1.5px}.rich-tool s{text-decoration-thickness:1.5px}.rich-tool-heading{font-size:14px;font-weight:850;letter-spacing:-.03em}.rich-tool-quote{font-size:18px;line-height:12px;font-family:Georgia,serif;font-style:italic}.rich-tool-list{font-weight:650}
.rich-editable{padding:14px;min-height:135px;max-height:440px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;color:var(--text);outline:none;font-size:14px;tab-size:3}
.rich-editable:focus{box-shadow:inset 0 0 0 1px #82b49a}
.rich-editable:empty:before{content:attr(data-placeholder);color:#829c91;pointer-events:none}
.rich-editable p,.rich-editable>div{margin:0 0 .7em}.rich-editable p:last-child,.rich-editable>div:last-child{margin-bottom:0}
.rich-editable ul,.rich-editable ol,.editor ul,.editor ol{padding-left:1.65em;margin:.4em 0 .8em}
.rich-editable li,.editor li{margin:.18em 0}
.rich-editable blockquote,.editor blockquote{border-left:3px solid #79ae93;padding-left:12px;color:#c3d8c9;margin:.65em 0}
.rich-editable h1,.rich-editable h2,.rich-editable h3,.editor h1,.editor h2,.editor h3{line-height:1.3;margin:.6em 0 .4em}
.rich-editable a,.editor a{color:#8ac7ca;text-decoration:underline}
.rich-manuscript-toolbar{position:sticky;top:var(--sticky-controls-height,118px);z-index:5;margin:4px 0 10px;border:1px solid #3c5249;border-radius:8px}
.desk-notes-editor{gap:8px;padding:11px;min-width:0}
.desk-notes-editor>.rich-field{flex:1;min-height:170px}
.desk-notes-editor>.rich-field .rich-editable{max-height:none;min-height:155px;height:100%;font-size:15px;line-height:1.75}
.desk-notes-editor>.note-images{flex-shrink:0}
.desk-note-actions{flex-shrink:0}.desk-note-type{font-size:10px}
.global-notes-panel .desk-notes-trash:not([open]){padding:4px 12px}
.desk-notes-editor .note-image-toolbar{padding:4px 0}
.desk-notes-editor .note-image-gallery{max-height:160px;overflow:auto}
@media(min-width:901px){
 body.notes-expanded .main-area>.view,body.notes-expanded .writing-toolbar{visibility:hidden;pointer-events:none}
 body.notes-expanded .global-notes-panel{position:fixed!important;top:64px!important;bottom:0!important;left:250px!important;right:0!important;width:calc(100vw - 250px)!important;height:calc(100dvh - 64px)!important;max-height:none!important;z-index:30!important;border-radius:0!important}
 body.notes-expanded[data-mode="minimal"] .global-notes-panel{left:0!important;width:100vw!important}
 body.notes-expanded .reference-panel:not(.hidden){position:fixed;top:64px;bottom:0;left:250px!important;right:auto!important;width:clamp(300px,34vw,520px)!important;z-index:31!important}
 body.notes-expanded[data-mode="minimal"] .reference-panel:not(.hidden){left:0!important}
 body.notes-expanded:has(.reference-panel:not(.hidden)) .global-notes-panel{left:calc(250px + clamp(300px,34vw,520px))!important;width:calc(100vw - 250px - clamp(300px,34vw,520px))!important}
 body.notes-expanded[data-mode="minimal"]:has(.reference-panel:not(.hidden)) .global-notes-panel{left:clamp(300px,34vw,520px)!important;width:calc(100vw - clamp(300px,34vw,520px))!important}
 body.notes-expanded .desk-notes-filter,body.notes-expanded .desk-notes-search,body.notes-expanded .desk-notes-trash{display:none!important}
 body.notes-expanded .desk-notes-layout{grid-template-columns:minmax(0,1fr)!important}
 body.notes-expanded .desk-notes-list{display:none!important}
 body.notes-expanded .desk-notes-editor{padding:16px clamp(16px,3vw,48px);max-width:100%;width:100%}
 body.notes-expanded .desk-notes-editor>.rich-field{min-height:260px}
}
@media(max-width:900px){body.notes-expanded .desk-notes-filter,body.notes-expanded .desk-notes-search,body.notes-expanded .desk-notes-trash,body.notes-expanded .desk-notes-list{display:none!important}body.notes-expanded .desk-notes-layout{grid-template-columns:minmax(0,1fr)!important}body.notes-expanded .desk-notes-editor>.rich-field{flex:1;min-height:250px}}

/* Formatted freeform text in read-only References and timeline previews. */
.rich-rendered{white-space:normal!important;overflow-wrap:anywhere}
.rich-rendered p{margin:.2em 0 .7em}.rich-rendered p:last-child{margin-bottom:0}
.rich-rendered ul,.rich-rendered ol{padding-left:1.65em;margin:.35em 0 .8em}
.rich-rendered li{margin:.15em 0}.rich-rendered blockquote{border-left:3px solid #79ae93;padding-left:12px;color:#c3d8c9;margin:.6em 0}
.rich-rendered h1,.rich-rendered h2,.rich-rendered h3{line-height:1.3;margin:.6em 0 .4em}
.rich-rendered a{color:#8ac7ca;text-decoration:underline}

/* v20.8.1: off-screen, rendered text verification for legacy sidecars. */
.rich-plain-probe{position:absolute!important;left:-100000px!important;top:0!important;opacity:0!important;white-space:pre-wrap!important;width:1000px!important;pointer-events:none!important}

/* v20.8.2: Library profile-level Read / Edit. One record, two presentations. */
.entry-profile-tabs{display:flex;gap:4px;padding:4px;margin:0 0 22px;border:1px solid var(--line);border-radius:11px;background:var(--raised);max-width:330px}
.entry-profile-tabs button{flex:1;border:0;border-radius:8px;background:transparent;color:var(--muted);padding:10px 16px;font-size:13px;font-weight:650}
.entry-profile-tabs button.selected{color:var(--text);background:#3c4c49;box-shadow:0 1px 3px #0004}
.entry-profile-tabs button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.entry-profile-read{max-width:940px;margin:0 auto;padding:4px 3px 30px;color:var(--text);font:var(--bio-font-size,17px)/1.6 var(--writing-font,Georgia,serif);overflow-wrap:anywhere}
.entry-read-header{display:flex;gap:24px;align-items:flex-start;border-bottom:1px solid var(--line);padding:5px 3px 24px;margin-bottom:8px}
.entry-read-portrait{width:124px;max-height:175px;aspect-ratio:3/4;flex-shrink:0;padding:0;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--raised)}
.entry-read-portrait img{width:100%;height:100%;object-fit:cover}
.entry-read-heading{flex:1;min-width:0}.entry-read-heading h2{margin:0 0 9px;font:600 clamp(23px,3vw,31px) Georgia,serif;line-height:1.2}
.entry-read-categories{font:12px/1.6 Inter,system-ui,sans-serif;color:var(--muted)}
.entry-read-summary{margin:16px 0 0!important;font-size:.89em!important;color:var(--text)!important;white-space:pre-wrap}
.entry-read-section{padding:18px 3px 20px;border-bottom:1px solid var(--line)}
.entry-read-section>h3{font:650 16px/1.4 Inter,system-ui,sans-serif;margin:0 0 17px;color:#c5e2d2}
.entry-read-field{margin:0 0 15px}.entry-read-field:last-child{margin-bottom:0}
.entry-read-label{font:650 11px/1.5 Inter,system-ui,sans-serif;letter-spacing:.045em;color:var(--muted);margin:0 0 4px}
.entry-read-value{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}
.entry-read-value.rich-rendered{white-space:normal}.entry-read-value.rich-rendered :first-child{margin-top:0}.entry-read-value.rich-rendered :last-child{margin-bottom:0}
.entry-read-value.rich-rendered p,.entry-read-value.rich-rendered li{color:inherit;font-size:inherit;line-height:inherit}
.entry-read-ability{padding:2px 0 13px;margin-bottom:13px;border-bottom:1px solid #ffffff16}
.entry-read-ability>strong{font-size:1em}.entry-read-ability-text{margin-top:7px;white-space:pre-wrap}.entry-read-ability-text.rich-rendered{white-space:normal}
.entry-read-ability-cost{margin-top:9px;font-size:.94em;color:#f0b2ad}.entry-read-ability-cost>strong{display:block;margin-bottom:2px;font:650 11px Inter,system-ui,sans-serif}
.entry-read-link{display:block;margin:0 0 13px;font:14px/1.6 Inter,system-ui,sans-serif}.entry-read-link>strong{font-weight:650}
.entry-read-link-type{margin-left:9px;color:var(--muted)}.entry-read-link-history{margin:3px 0 0 15px;color:var(--muted);font-size:12px}
.entry-read-open{padding:0;background:transparent;color:var(--accent);border:0;font:inherit;text-align:left}
.entry-read-photos{margin-top:15px}.entry-read-photos h4{margin:0 0 13px;font:650 12px Inter,system-ui,sans-serif;color:var(--muted)}
.entry-read-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px}
.entry-read-photo{background:var(--raised);border:1px solid var(--line);border-radius:9px;padding:5px;display:flex;flex-direction:column;gap:6px;color:var(--muted);text-align:left;font-size:11px}
.entry-read-photo img{width:100%;height:125px;object-fit:cover;border-radius:5px}.entry-read-photo span{padding:0 3px 3px}
.entry-read-empty{color:var(--muted)}
@media(max-width:600px){.entry-read-header{gap:14px}.entry-read-portrait{width:88px;max-height:128px}.entry-profile-read{font-size:calc(var(--bio-font-size,17px) - 1px)}.entry-read-section{padding:16px 0}.entry-read-heading h2{font-size:23px}}

/* v20.8.5 — optional Character Toolkit tab. Not a Library profile or project record. */
.library-view-tabs{max-width:850px;flex-wrap:wrap}
.library-view-tabs button{flex:1 1 135px}
.character-toolkit{max-width:1040px;margin:0 0 48px}
.character-toolkit-head{margin:10px 0 18px}
.character-toolkit-head h2{font-size:23px;letter-spacing:-.02em;margin:0 0 6px}
.character-toolkit-head p{font-size:13px;line-height:1.6;margin:0;color:#aabbb3;max-width:720px}
.character-toolkit-nav{display:flex;flex-wrap:wrap;gap:7px;padding:0 0 16px;border-bottom:1px solid #36473e;margin-bottom:22px}
.character-toolkit-nav button{border:1px solid #42544c;background:#222b2e;color:#bbcbc3;border-radius:9px;padding:10px 13px;font-size:12px;font-weight:650;cursor:pointer;min-height:38px}
.character-toolkit-nav button[aria-pressed="true"]{background:#2b5342;color:#eafff1;border-color:#6f9f86}
.character-toolkit-nav button:focus-visible,.character-toolkit-open:focus-visible{outline:2px solid #a5d8bb;outline-offset:3px}
.character-toolkit-panel h3{font-size:17px;font-weight:700;margin:18px 0 9px;color:#e3ebe6}
.character-toolkit-panel p{font-size:13px;line-height:1.65;color:#b3c3ba}
.character-toolkit-note{font-size:12px!important;color:#9fb9aa!important;max-width:760px}
.character-toolkit-zodiac{display:grid;grid-template-columns:repeat(auto-fit,minmax(205px,1fr));gap:10px;margin:13px 0 24px}
.character-toolkit-sign{background:#1b2729;border:1px solid #3b5147;border-radius:11px;padding:13px 15px;min-width:0}
.character-toolkit-sign strong{font-size:14px;color:#e1ece6}
.character-toolkit-sign small{display:block;color:#98baaa;font-size:11px;margin:3px 0 8px}
.character-toolkit-sign p{margin:0;color:#c7d5ce;line-height:1.5;font-size:12px}
.character-toolkit-blood{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin:12px 0 23px}
.character-toolkit-type{background:#1b2729;border:1px solid #3b5147;border-radius:11px;padding:15px}
.character-toolkit-type h4{font-size:17px;margin:0 0 2px}
.character-toolkit-type .toolkit-archetype{font-size:12px;margin:0 0 13px;color:#a9d3be}
.character-toolkit-type dl{margin:0;display:grid;gap:10px}
.character-toolkit-type dt{color:#93b4a5;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}
.character-toolkit-type dd{margin:3px 0 0;color:#cfdbd4;font-size:12px;line-height:1.5}
.character-toolkit-visuals{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,350px),1fr));gap:15px;margin:15px 0 18px}
.character-toolkit-visuals.single{grid-template-columns:minmax(0,1fr);max-width:780px}
.character-toolkit-figure{margin:0;background:#1b2729;border:1px solid #3c5449;border-radius:12px;overflow:hidden}
.character-toolkit-figure img{display:block;background:#fafafa;width:100%;height:auto;object-fit:contain}
.character-toolkit-figure figcaption{padding:12px 13px;display:flex;gap:8px;justify-content:space-between;align-items:center;flex-wrap:wrap;color:#b4c8bb;font-size:12px}
.character-toolkit-open{border:1px solid #547c68;background:#2a493b;color:#e4ffee;padding:6px 9px;border-radius:7px;cursor:pointer;font-size:12px}
.character-toolkit-lightbox{border:1px solid #547562;border-radius:12px;background:#172124;color:#eaf5ef;padding:14px;max-width:96vw;width:min(1100px,96vw);max-height:94vh;box-sizing:border-box}
.character-toolkit-lightbox::backdrop{background:rgba(0,0,0,.85)}
.character-toolkit-lightbox .lightbox-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.character-toolkit-lightbox .lightbox-top strong{font-size:13px}
.character-toolkit-lightbox img{display:block;width:100%;height:auto;max-height:calc(94vh - 100px);object-fit:contain;background:#fff}
@media(max-width:560px){.character-toolkit-nav{gap:6px}.character-toolkit-nav button{flex:1 1 44%;padding:9px 6px}.character-toolkit-zodiac,.character-toolkit-blood{grid-template-columns:1fr}.character-toolkit-visuals{grid-template-columns:1fr}}

/* v20.8.6 · directional, user-authored relationship statuses. */
.relationship-perspective-editor{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;width:100%;min-width:0}
.relationship-perspective-editor>.field{margin:0;min-width:0}
.relationship-perspective-editor .form-input{width:100%;min-width:0}
.relationship-mutual-option{grid-column:1/-1;display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;background:#26352e;border:1px solid #486350;cursor:pointer;font-size:12px;color:#e0ede5}
.relationship-mutual-option input{width:16px;height:16px;accent-color:#a3d4b8;flex-shrink:0}
.relationship-perspective-hint{grid-column:1/-1;display:block;line-height:1.5}
.relationship-add-perspectives{grid-column:1/-1;min-width:0;width:100%}
.relationship-connection-row{align-items:flex-start;flex-direction:column;gap:7px}
.relationship-connection-views{display:grid;gap:4px;width:100%;min-width:0}
.relationship-connection-views>.relationship-connection-type{display:block;overflow-wrap:anywhere;line-height:1.45}
.relationship-connection-row .relationship-history-button,.relationship-connection-row .relationship-remove-button{max-width:100%}
.relationship-node-directions{display:flex;flex-direction:column;align-items:center;gap:4px;max-width:100%;min-width:0}
.relationship-node-direction{font-size:10px;color:#c6e8d3;background:#172b22;border:1px solid #52745d;border-radius:7px;padding:3px 6px;max-width:100%;overflow-wrap:anywhere;font-weight:600;line-height:1.25}
.relationship-node-direction.is-mutual{background:#244635;border-color:#90c8a5;color:#e3f8e8}
.relationship-direction-key{color:#aecbbb;font-size:11px;line-height:1.5;margin:7px 1px 0;overflow-wrap:anywhere}
.relationship-graph .relationship-line-explicit{stroke:#9dccb2;stroke-width:2.25;stroke-opacity:1}
.relationship-history-record{overflow-wrap:anywhere}
@media(max-width:650px){.relationship-perspective-editor{grid-template-columns:1fr}}


/* v20.8.7 — unified, predictable manuscript controls on phones and desktops. */
.fragment-sticky-controls{display:none!important}
.manuscript-control-bar{position:sticky;top:var(--manuscript-top,69px);z-index:18;
 display:flex;align-items:stretch;gap:0;margin:5px 0 12px;
 border:1px solid #456158;border-radius:9px;background:#273730;
 min-width:0;box-shadow:0 4px 12px #0003}
.manuscript-control-bar .rich-manuscript-toolbar{
 position:static;top:auto;z-index:auto;margin:0;border:0;border-radius:8px 0 0 8px;
 flex:1 1 auto;min-width:0;width:0;max-width:none;overflow-x:auto;overscroll-behavior-inline:contain;
 scrollbar-width:thin;white-space:nowrap;
}
.manuscript-control-bar .rich-ink-tool{color:#e9f4eb;display:flex;flex-shrink:0;min-width:33px;padding:5px 9px;
 border:0;border-radius:5px;background:transparent;align-items:center;justify-content:center}
.manuscript-control-bar .rich-ink-tool:hover{background:#3c5e4d}
.manuscript-control-bar .color-tool-icon{font-size:15px}
.manuscript-control-bar .rich-ink-tool>span:last-child{display:none}
.writing-tools-toggle{flex:0 0 auto;border:0;border-left:1px solid #486055;
 background:#2c463a;color:#e6f4e9;min-height:45px;min-width:77px;
 padding:8px 11px;font-size:12px;font-weight:750;border-radius:0 8px 8px 0;white-space:nowrap}
.writing-tools-toggle:hover,.writing-tools-toggle[aria-expanded="true"]{background:#40624f}
.writing-tools-menu{position:fixed;z-index:28;width:min(314px,calc(100vw - 16px));
 max-height:min(70dvh,560px);overflow:auto;background:#202b29;
 border:1px solid #658575;border-radius:12px;padding:7px 9px;
 box-shadow:0 16px 48px #000b;color:var(--text)}
.writing-tools-group{padding:6px 0}.writing-tools-group+.writing-tools-group{border-top:1px solid #405449}
.writing-tools-heading{color:#94b9a5;font-weight:750;letter-spacing:.08em;text-transform:uppercase;
 font-size:10px;margin:5px 8px 7px}
.writing-tools-menu .writing-menu-action{display:block;text-align:left;width:100%;color:#e3f1e7;
 border:0;background:none;border-radius:8px;padding:11px 12px;min-height:42px;font-size:13px;cursor:pointer}
.writing-tools-menu .writing-menu-action:hover,.writing-tools-menu .writing-menu-action:focus-visible{
 background:#3a574a;outline-offset:-2px}
/* Writing modes are the only permanent bottom actions; remaining commands are in the sticky top bar. */
.writing-toolbar .toolbar-tools{flex:1 1 auto;justify-content:center;gap:clamp(6px,1.2vw,18px)}
.writing-toolbar{gap:0}
@media(max-width:670px){
 .manuscript-control-bar{margin:3px -6px 10px;top:var(--manuscript-top,62px)}
 .manuscript-control-bar .rich-manuscript-toolbar{padding:4px 3px}
 .manuscript-control-bar .rich-tool{padding:8px 7px;min-width:30px}
 .writing-tools-toggle{min-width:69px;padding:8px 7px;font-size:12px}
 .writing-toolbar{justify-content:center;padding-left:6px;padding-right:6px}
 .writing-toolbar .toolbar-tools{gap:clamp(0px,1.5vw,12px);justify-content:space-evenly;max-width:100%}
 .writing-toolbar .toolbar-tools .format-button{flex:0 1 auto;min-width:0;padding:10px 7px}
 #writeView.context-side-open .fragment-context{top:calc(var(--workspace-sticky-top,57px) + 54px)}
}
@media(max-width:360px){.writing-toolbar .toolbar-tools .format-button{padding:9px 3px;font-size:10px}.writing-tools-toggle{min-width:62px}}

/* The earlier tablet-width header could exceed the remaining editor width
   after the sidebar. Compact labels before allowing horizontal overflow. */
@media(min-width:671px) and (max-width:1100px){
 .topbar{padding-inline:10px;gap:5px}
 .topbar-left,.topbar-right{gap:4px;min-width:0}
 .topbar .crumbs{display:none}
 .topbar .reference-top-button{padding:7px 9px;white-space:nowrap}
 .topbar .reference-top-button span{display:none}
 .topbar .save-state{font-size:0;gap:0}
 .topbar .mode-pill span{display:none}
 .topbar .return-to-writing span{display:none}
 .topbar .icon-button{width:32px;height:34px}
}
@media(max-width:365px){
 .writing-toolbar .toolbar-tools .format-button span{display:inline}
 .writing-toolbar .toolbar-tools .format-button svg{display:none}
 .writing-toolbar .toolbar-tools .format-button{padding:8px 5px;font-size:11px}
}

/* v20.8.8: one contextual Find entry point, no additional persistent toolbar row. */
.section-heading-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.contextual-find-button{white-space:nowrap;min-height:36px}
.relationship-connection-name.is-editor-action{font-weight:650;text-decoration:underline;text-decoration-style:solid;}
.relationship-connection-name.is-editor-action:hover,.relationship-connection-name.is-editor-action:focus-visible{color:#bce3cb;outline-offset:3px}
.relationship-focus-link{padding:4px 7px;border:1px solid #476658;border-radius:6px;color:#bad6c7;background:transparent;font-size:11px;cursor:pointer}
.relationship-focus-link:hover,.relationship-focus-link:focus-visible{background:#315447;color:#fff}
.relationship-quick-context{font-size:12px;line-height:1.55;color:#b8c8bf;margin:0 0 14px}
.relationship-quick-extra{border:1px solid #465b51;border-radius:8px;padding:9px 12px;margin:13px 0}
.relationship-quick-extra summary{cursor:pointer;color:#c6decf;font-size:12px}
.quick-switcher-scope{padding:8px 15px 0;font-size:11px;color:#a6cebb;letter-spacing:.03em}
@media(max-width:670px){.section-heading-actions{gap:6px}.contextual-find-button{padding:10px;font-size:12px}.page-heading{gap:10px;align-items:flex-start}.page-heading .section-heading-actions{max-width:65%;justify-content:flex-end}}
.relationship-edit-glyph{font-size:10px;color:#9bc8ae;font-weight:400;white-space:nowrap}
/* 320px phones: keep the existing global actions reachable even in Library. */
@media(max-width:360px){
 .topbar{padding-inline:6px;gap:4px}
 .topbar-left,.topbar-right{gap:2px}
 .topbar .icon-button{width:30px;min-width:30px}
 .topbar .reference-top-button{padding:6px;min-width:0}
 .topbar .return-to-writing{padding:6px}
 .topbar .mode-pill{padding:7px}
}

/* v20.8.9 — small, legible relationship-history controls and opt-in Timeline views */
.relationship-history-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:3px}
.relationship-history-actions .secondary-button{padding:6px 10px;font-size:12px}
.relationship-history-delete{color:#eeb4a5!important;border-color:#76534b!important}
.relationship-history-delete.is-confirming{background:#6b3933!important;color:#fff!important}
.relationship-timeline-fields{border-top:1px solid #425b50;margin:16px 0 12px;padding-top:13px;display:grid;gap:10px}
.relationship-timeline-fields h4{margin:0;font-size:14px;color:#d8eade}
.relationship-timeline-fields .muted{margin:0;font-size:12px}
.relationship-milestone-toggle{display:flex;align-items:center;gap:9px;cursor:pointer;border:1px solid #477159;padding:10px 12px;border-radius:9px;background:#21392f}
.relationship-milestone-toggle input{accent-color:#a3d2ba;width:17px;height:17px}
.relationship-date-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.relationship-independent-date{display:grid;gap:8px}
.relationship-milestone{background:#20302c;border:1px solid #4d6b5c;border-radius:10px;padding:11px 13px;display:grid;gap:8px;overflow-wrap:anywhere;margin:8px 0}
.relationship-milestone-heading{display:flex;align-items:flex-start;gap:10px;font-size:13px}
.relationship-milestone-icon{color:#a9d8bb;font-size:16px}
.relationship-milestone-details{display:flex;flex-direction:column;gap:4px;color:#b6cabd;font-size:12px}
.relationship-milestone-details p{margin:0;white-space:pre-wrap}
.relationship-milestone-edit{width:max-content;max-width:100%;border:1px solid #48685a;border-radius:7px;background:#1c3029;color:#b9dfc8;padding:6px 9px;font-size:12px;cursor:pointer}
.relationship-milestone-edit:hover{border-color:#a3cdb3}
.timeline-relationship-links{margin:13px 0;border-top:1px solid #41564b;padding-top:10px}
.timeline-relationship-links h4,.timeline-standalone-milestones h4{font-size:14px;margin:0 0 9px;color:#cbe6d5}
.timeline-standalone-milestones{margin-top:12px;display:grid;gap:6px}
.timeline-standalone-milestones>.muted{margin:0 0 4px;font-size:12px}
.relationship-visual-milestones{margin:18px 0 10px;border:1px solid #456452;border-radius:10px;padding:12px}
.relationship-visual-milestones>summary{cursor:pointer;font-weight:600;color:#cee4d5}
.relationship-visual-milestones-list{max-height:440px;overflow-y:auto;margin-top:10px}
.relationship-linked-dot{font-size:11px;color:#b4dec4}
@media(max-width:520px){.relationship-date-row{grid-template-columns:1fr}.relationship-history-record{padding:9px}.relationship-visual-milestones{padding:9px}.relationship-milestone{padding:9px}}
.timeline-relationship-chip{background:#26483d;border:1px solid #618c73;color:#c0e2c9;border-radius:9px;padding:2px 6px;font-size:11px}
/* Keep searchable picker above modal/backdrop, including storage-protection stacking. */
.smart-select-popover{z-index:120005}

/* v20.8.10 — Quick deletion is visible without opening event editing. */
.vt-event-tile{position:relative;min-width:0}
.vt-event-tile>.vt-event-pill,.vt-event-tile>.vt-chronology-entry{padding-right:72px}
.timeline-inline-delete{border:1px solid #75534e;background:#302524;color:#ffd4c6;border-radius:7px;font:inherit;font-size:11px;line-height:1.2;padding:7px 8px;cursor:pointer;touch-action:manipulation}
.vt-event-tile>.timeline-inline-delete{position:absolute;right:8px;top:9px;z-index:3}
.timeline-event summary>.timeline-inline-delete{margin-left:auto;flex:none}
.timeline-event summary:after{margin-left:5px}
.timeline-inline-delete:hover,.timeline-inline-delete:focus-visible,.timeline-delete-action:hover{background:#51302e;color:#ffe0d8;border-color:#d4a18c}
.timeline-inline-delete:focus-visible,.timeline-delete-action:focus-visible{outline:2px solid #ffdccf;outline-offset:2px}
.timeline-delete-action{border-color:#75534e;color:#ffd4c6}
@media(max-width:650px){.vt-event-tile>.vt-event-pill,.vt-event-tile>.vt-chronology-entry{padding-right:67px}.timeline-inline-delete{min-height:34px}}

/* v20.8.11 — compact, predictable navigation and author-controlled significance */
.workspace-history-buttons{display:flex;align-items:center;gap:2px;flex:0 0 auto}
.nav-history-arrow{width:30px;height:34px;border:1px solid transparent;font-size:19px;font-weight:600;line-height:1}
.nav-history-arrow:not(:disabled){color:var(--accent);border-color:var(--line);background:var(--raised)}
.nav-history-arrow:disabled{opacity:.36}
.moment-inline-editor{border:1px solid #446657;background:#1c3029;border-radius:11px;padding:12px 14px;margin:12px 0;max-width:100%;overflow-wrap:anywhere}
.moment-inline-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
.moment-inline-heading strong{font-size:13px;color:#c6ebd7}
.moment-inline-action{padding:6px 10px;font-size:12px;white-space:nowrap}
.moment-inline-text{margin-top:7px;white-space:pre-wrap;line-height:1.5;font-size:13px}
.moment-inline-text p{margin:0 0 5px}
.moment-inline-form{margin-top:12px}
.moment-inline-form label{display:grid;gap:7px;font-size:12px}
.moment-inline-form textarea{width:100%;min-height:90px;resize:vertical}
.moment-inline-preview{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:min(100%,600px);font-size:12px;color:#a8cfbe;margin-top:4px;font-weight:400}
@media(max-width:650px){.workspace-history-buttons{gap:0}.nav-history-arrow{width:29px;height:31px;font-size:17px}.moment-inline-editor{padding:10px}.moment-inline-preview{max-width:calc(100vw - 125px)}}

.modal-history-buttons{display:flex;gap:2px;margin-left:auto;flex:0 0 auto}.modal-history-buttons.hidden{display:none!important}.modal-head .modal-history-buttons .nav-history-arrow{width:30px;height:30px}.modal-head h2{min-width:0}

/* v20.8.12: Chapter assembly is an optional second mode of the Fragments page. */
.browse-mode-tabs{display:inline-flex;gap:5px;margin:0 0 14px;padding:4px;background:#172320;border:1px solid #345448;border-radius:12px}
.browse-mode-tabs button{border:0;border-radius:9px;background:transparent;color:#acc4b9;padding:10px 16px;font-size:13px;font-weight:600;cursor:pointer}
.browse-mode-tabs button[aria-pressed="true"]{background:#2b5040;color:#f1fff6}
.chapter-assembly-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:5px 0 18px;color:#a7b9b5;font-size:12px}
.chapter-assembly{display:grid;grid-template-columns:minmax(180px,260px) minmax(0,1fr);gap:16px;align-items:start}
.chapter-list-panel,.chapter-detail-panel{background:#1b2324;border:1px solid #334a44;border-radius:14px;padding:17px;min-width:0}
.chapter-list-panel h2{font-size:14px;margin:0 0 12px}.chapter-choice{width:100%;display:flex;flex-direction:column;gap:4px;background:#182423;border:1px solid #354941;border-radius:9px;text-align:left;color:#ebf3ee;margin-top:7px;padding:13px;cursor:pointer}
.chapter-choice.selected{background:#2a4d3e;border-color:#8bb8a0}.chapter-choice small{color:#aec3b7;font-size:11px}
.chapter-detail-heading{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-bottom:15px}.chapter-detail-heading>div{flex:1;min-width:130px}.chapter-detail-heading h2{margin:3px 0;font-size:20px}.chapter-detail-heading button{font-size:12px}
.chapter-purpose-label{display:block;color:#b4c5c0;font-size:12px;margin:0 0 7px}.chapter-purpose{margin-bottom:10px;resize:vertical}
.chapter-intro{font-size:12px;margin:8px 0 15px}.chapter-sequence-list{display:grid;gap:9px}.chapter-sequence{display:flex;align-items:center;justify-content:space-between;gap:13px;padding:13px;border-radius:10px;border:1px solid #3b5148;background:#202e2a}
.chapter-sequence-copy{min-width:0;display:grid;gap:5px}.chapter-sequence-copy strong{overflow-wrap:anywhere}.chapter-sequence-number{color:#a2cdb7}.chapter-sequence-preview{font-size:12px;color:#b8c2c0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.chapter-sequence-actions{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.chapter-sequence-actions button{padding:8px;font-size:12px;min-height:36px}
.chapter-fragment-picker{margin-top:17px;border:1px solid #426052;border-radius:10px;background:#192821}.chapter-fragment-picker summary{color:#b6e5cc;font-size:13px;font-weight:600;cursor:pointer;padding:13px}
.chapter-picker-content{padding:0 12px 13px}.chapter-picker-matches{display:grid;gap:5px;max-height:275px;overflow:auto;margin-top:10px}.chapter-picker-choice{border:1px solid #3a5449;background:#24332d;color:#e5f0e9;border-radius:8px;padding:11px;text-align:left;cursor:pointer;font-size:12px}
.chapter-picker-choice:hover{background:#345343}.chapter-empty{padding:16px}
.vt-event-chronology .vt-preview,.vt-month-events .vt-preview{margin:4px 0 12px;max-width:100%;min-width:0}.vt-month-events .vt-preview{padding:12px}.vt-month-events .vt-preview-actions{flex-direction:column}
@media(max-width:760px){.chapter-assembly{grid-template-columns:1fr}.chapter-list-panel{display:flex;flex-wrap:wrap;gap:7px}.chapter-list-panel h2{flex-basis:100%;margin:0}.chapter-choice{width:auto;min-width:125px;flex:1;margin:0}.chapter-assembly-head{flex-wrap:wrap}.chapter-sequence{flex-direction:column;align-items:stretch}.chapter-sequence-actions{justify-content:flex-start}}

@media(max-width:670px){.topbar{padding-left:7px;padding-right:7px}.topbar-left{gap:5px}.topbar-right{gap:2px}}

@media(max-width:670px){.topbar{gap:2px;padding-left:5px;padding-right:5px}.topbar-left{gap:3px;min-width:0}.topbar-right{gap:0}}

/* v20.8.13 — optional structured Library properties */
.property-editor-section{border-top:1px solid var(--line);padding-top:12px;margin-top:8px}
.property-rows{display:grid;gap:12px}.property-editor-row{border:1px solid #3a544b;border-radius:10px;background:#182626;padding:12px;display:grid;gap:10px;min-width:0}
.property-editor-top{display:grid;grid-template-columns:minmax(0,1fr) minmax(118px,175px);gap:8px;align-items:center}
.property-editor-value{display:grid;gap:7px;min-width:0}.property-editor-value .form-input{max-width:100%;box-sizing:border-box}
.property-editor-actions{display:flex;gap:6px;justify-content:flex-end}.property-editor-actions button{min-height:34px}.property-title-input{font-weight:650}
.property-chooser{display:grid;gap:8px;margin-top:14px;border:1px solid #3d5349;border-radius:10px;padding:12px;background:#1b2828}
.property-chooser>label{font-weight:650;font-size:13px}.property-suggestions{display:grid;gap:3px;max-height:180px;overflow-y:auto;border:1px solid #3d5349;border-radius:7px;padding:4px;background:#192526}
.property-suggestion{display:flex;gap:8px;align-items:center;justify-content:space-between;text-align:left;background:transparent;border:0;border-radius:5px;color:var(--text);padding:9px 10px;min-height:36px;font:inherit;font-size:12px;cursor:pointer}
.property-suggestion:hover,.property-suggestion:focus-visible{background:#2b4d41}.property-suggestion small{font-size:10px;opacity:.7;text-align:right}
.property-picker-actions{display:flex;justify-content:flex-end}.property-picker-actions button{min-height:36px}
.entry-read-property{display:grid;grid-template-columns:minmax(115px,33%) minmax(0,1fr);gap:12px;align-items:baseline;padding:10px 12px;margin:0;border:1px solid #3a5349;border-bottom:0;background:#202e2d}
.entry-read-property:first-of-type{border-radius:8px 8px 0 0}.entry-read-property:last-child{border-bottom:1px solid #3a5349;border-radius:0 0 8px 8px}
.entry-read-property .entry-read-label{margin:0}.entry-read-property-tags{display:flex;flex-wrap:wrap;gap:5px}.entry-read-property-tag{font-size:.88em;background:#29453b;border:1px solid #466e5b;border-radius:6px;padding:3px 7px}
@media(max-width:560px){.property-editor-top{grid-template-columns:1fr}.entry-read-property{grid-template-columns:1fr;gap:4px}.property-suggestion{min-height:42px}}

/* v20.8.14 · A discreet sync control that does not crowd writing. */
.wd-cloud-top{border:1px solid #456757;border-radius:12px;padding:8px 10px;color:#d6eee2;background:#20342d;display:inline-flex;align-items:center;gap:7px;font:inherit;font-size:12px;font-weight:650;white-space:nowrap;cursor:pointer;min-height:35px}
.wd-cloud-top:hover{background:#294b3b}.wd-cloud-dot{display:block;width:7px;height:7px;border-radius:100%;background:#98a09e;box-shadow:0 0 0 2px #20342d}
.wd-cloud-top[data-status="synced"] .wd-cloud-dot{background:#a0d2bd}.wd-cloud-top[data-status="pending"] .wd-cloud-dot{background:#efcf89}.wd-cloud-top[data-status="conflict"] .wd-cloud-dot{background:#eb9c8b}
.wd-cloud-panel{display:grid;gap:14px;color:#e4ebe8}.wd-cloud-eyebrow{font-size:10px;letter-spacing:.14em;color:#8fc1ac;font-weight:750;text-transform:uppercase}.wd-cloud-title{font-size:19px;font-weight:750;margin:0}.wd-cloud-explainer{font-size:12px;line-height:1.6;color:#b4c2bb;margin:0}
.wd-cloud-hero{background:linear-gradient(130deg,#263b32,#1d2c29);border:1px solid #406354;border-radius:16px;padding:16px;display:grid;gap:6px}
.wd-cloud-kpi{display:flex;justify-content:space-between;gap:8px;align-items:baseline;font-size:12px;color:#a8c9ba}
.wd-cloud-kpi strong{font-size:21px;color:#e6f1ea;font-variant-numeric:tabular-nums}
.wd-cloud-status{display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:650;color:#b5cfbf}
.wd-cloud-divider{border:0;border-top:1px solid #3a4a45;margin:0}.wd-cloud-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.wd-cloud-actions{display:flex;flex-wrap:wrap;gap:8px}.wd-cloud-panel button{min-height:38px}.wd-cloud-panel input{width:100%;box-sizing:border-box}
.wd-cloud-field{display:grid;gap:5px;font-size:12px;color:#bed4c9}.wd-cloud-card{border:1px solid #405149;border-radius:12px;padding:12px;background:#1d2929;display:grid;gap:7px}
.wd-cloud-meter{height:7px;border-radius:8px;background:#34443f;overflow:hidden}.wd-cloud-meter span{display:block;background:#92c9b0;height:100%;border-radius:inherit;max-width:100%}
.wd-cloud-notice{padding:10px 12px;border:1px solid #736344;border-radius:10px;color:#ecd7a8;background:#302c23;font-size:12px;line-height:1.5}
.wd-cloud-quiet{font-size:11px;color:#a9b8b1}.wd-cloud-checks{display:grid;gap:5px;font-size:12px;color:#b4c2ba}
.wd-cloud-panel a{color:#a9e4c6;text-decoration:underline}
@media(max-width:700px){.wd-cloud-top{padding:8px 9px}.wd-cloud-top span{display:none}.wd-cloud-grid{grid-template-columns:1fr}}
